/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* 白色金色主题配色变量 */
:root {
    --primary-gold: #E5A000;
    --primary-gold-light: #F5B800;
    --primary-gold-dark: #CC8800;
    --gold-gradient: linear-gradient(135deg, #FFB800 0%, #FF9500 50%, #FF8000 100%);
    --gold-gradient-hover: linear-gradient(135deg, #FFC933 0%, #FFA733 50%, #FF9500 100%);
    --bg-dark: #f3f4f6;
    --bg-dark-secondary: #e9ebee;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f1f3;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-gold: #E5A000;
    --border-color: #e0e0e0;
    --border-gold: rgba(229, 160, 0, 0.3);
    --shadow-gold: rgba(229, 160, 0, 0.15);
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
    /* 安全区域适配 */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.no-image-save {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

#root, #app {
    width: 100%;
    min-height: 100vh;
    max-width: 768px;
    margin: 0 auto;
    background-color: var(--bg-dark);
    position: relative;
}

.page-container {
    width: 100%;
    padding-bottom: 70px;
}

.page {
    display: none;
    width: 100%;
    min-height: calc(100vh - 70px);
}

.page.active { display: block; }

/* 顶部导航 */
.top-nav {
    background: var(--bg-card);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 2px 12px var(--shadow-gold);
    padding: 12px 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-gold);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px var(--shadow-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gold-gradient);
    color: #000;
    font-size: 28px;
    border: 2px solid var(--primary-gold);
}

.nav-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    text-shadow: 0 0 10px var(--shadow-gold);
}

.nav-subtitle {
    font-size: 14px;
    color: var(--primary-gold);
    font-weight: 500;
    text-transform: uppercase;
}

.nav-action-button {
    background: var(--gold-gradient);
    color: #000;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 10px var(--shadow-gold);
}

.nav-action-button:hover {
    background: var(--gold-gradient-hover);
    transform: translateY(-1px);
}

/* 页面头部 */
.page-header {
    background: var(--bg-card);
    padding: 16px;
    text-align: center;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 2px 12px var(--shadow-gold);
    border-bottom: 1px solid var(--border-gold);
}

.page-header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-gold);
    text-shadow: 0 0 10px var(--shadow-gold);
}

/* Banner */
.banner-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

/* 公告栏 */
.announcement-bar {
    margin: 12px;
    background: var(--gold-gradient);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow-gold);
}

.announcement-container {
    display: flex;
    align-items: center;
    padding: 10px 12px;
}

.announcement-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    flex-shrink: 0;
}

.announcement-text {
    flex: 1;
    overflow: hidden;
    margin-left: 10px;
}

.announcement-scroll {
    white-space: nowrap;
    color: #000;
    font-size: 13px;
    font-weight: 500;
    animation: scroll-text 20s linear infinite;
}

@keyframes scroll-text {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Tab */
.tab-button {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.tab-button.active {
    background: var(--gold-gradient);
    color: #000;
    box-shadow: 0 2px 10px var(--shadow-gold);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* 广告列表 - 每行两个 */
.ad-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ad-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.ad-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-gold);
    border-color: var(--border-gold);
}

.ad-card:active { transform: scale(0.98); }

.ad-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-card-img img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 120px;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-gold);
    text-align: center;
    padding: 20px;
    text-shadow: 0 0 10px var(--shadow-gold);
}

.ad-card-info { 
    padding: 12px 16px;
    background: var(--bg-card);
}

.ad-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ad-card-desc {
    font-size: 13px;
    color: var(--primary-gold);
}

/* 旧版分类卡片保留兼容 */
.category-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-gold);
    border-color: var(--border-gold);
}

.category-card:active { transform: scale(0.98); }

.category-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-gold);
    text-align: center;
    padding: 10px;
    text-shadow: 0 0 10px var(--shadow-gold);
}

.category-card-content { padding: 12px; }

.category-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-card-desc {
    font-size: 12px;
    color: var(--primary-gold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 联系卡片 */
.contact-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
}

.contact-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-dark-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-copy-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    color: #000;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--gold-gradient);
}

.contact-action-btn {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 768px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-gold);
    box-shadow: 0 -2px 16px var(--shadow-gold);
    z-index: 1000;
    border-radius: 20px 20px 0 0;
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 12px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    cursor: pointer;
    position: relative;
}

.nav-icon {
    font-size: 22px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.nav-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-item.active .nav-icon,
.nav-item.active .nav-label { color: var(--primary-gold); }

.nav-indicator {
    position: absolute;
    bottom: -4px;
    width: 20px;
    height: 3px;
    border-radius: 2px;
    background: transparent;
}

.nav-item.active .nav-indicator { background: var(--gold-gradient); }

.btn-active { cursor: pointer; transition: all 0.15s; }
.btn-active:active { transform: scale(0.96); opacity: 0.9; }

/* 分享弹窗 */
.share-popup {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    justify-content: center;
    align-items: flex-end;
}

.share-popup.active { display: flex; }

.share-container {
    width: 100%;
    max-width: 768px;
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    animation: slideUp 0.3s ease;
    border-top: 1px solid var(--border-gold);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.share-platform {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.share-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    font-size: 20px;
}

/* 公告弹窗 */
.announcement-popup {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.announcement-popup.active { display: flex; }

.announcement-container-new {
    width: 100%;
    max-width: 360px;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    animation: popIn 0.3s ease;
    border: 1px solid var(--border-gold);
    box-shadow: 0 4px 30px var(--shadow-gold);
}

@keyframes popIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.announcement-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-dark-secondary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 10;
}

.noticeNew {
    padding: 24px 20px 16px;
    text-align: center;
}

.topline {
    width: 60px;
    height: 4px;
    background: var(--gold-gradient);
    border-radius: 2px;
    margin: 0 auto 16px;
}

.logoimg {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    margin: 0 auto 16px;
    display: block;
    box-shadow: 0 4px 16px var(--shadow-gold);
    border: 2px solid var(--primary-gold);
}

.dear {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-gold);
    margin-bottom: 12px;
}

.maincontents {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: left;
    white-space: pre-line;
    max-height: 200px;
    overflow-y: auto;
    padding: 0 8px;
}

.info-group {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.foot { font-size: 14px; font-weight: 600; color: var(--primary-gold); }
.date { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* 发现页面 */
.discover-page {
    height: calc(100vh - 130px);
    background: var(--bg-dark);
}

.discover-content {
    width: 100%;
    height: 100%;
}

.iframe-full {
    width: 100%;
    height: 100%;
    border: none;
}

.empty-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}

/* 大舞台样式 */
.stage-banner {
    position: relative;
    height: 160px;
    background: linear-gradient(180deg, #fff8e1 0%, #fff3cd 50%, #ffecb3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-gold);
}

.stage-banner-title {
    color: var(--primary-gold);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 0 20px var(--shadow-gold);
}

.stage-user-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold-gradient);
    border: none;
    color: #000;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stage-site-bar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.stage-site-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gold-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 2px 12px var(--shadow-gold);
    overflow: hidden;
    order: 3;
    flex-shrink: 0;
    border: 2px solid var(--primary-gold);
}

.stage-site-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stage-site-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    order: 1;
}

.stage-site-slogan {
    font-size: 12px;
    color: var(--primary-gold);
    margin-left: auto;
    margin-right: 12px;
    order: 2;
}

.stage-posts {
    background: var(--bg-dark);
    padding-bottom: 100px;
}

/* 底部发布按钮 */
.stage-publish-float {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.stage-publish-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gold-gradient);
    color: #000;
    border: none;
    padding: 14px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--shadow-gold);
}

.loading-posts {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* 帖子卡片 */
.post-card {
    background: var(--bg-card);
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.post-header {
    display: flex;
    align-items: flex-start;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--gold-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 24px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--primary-gold);
}

.post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-body {
    flex: 1;
    margin-left: 12px;
}

.post-author {
    font-weight: 700;
    font-size: 15px;
    color: var(--primary-gold);
    margin-bottom: 6px;
}

.post-title {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.post-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 10px;
    white-space: pre-line;
}

/* 图片展示 */
.post-images {
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
}

.post-images.single {
    max-width: 260px;
}

.post-images img {
    width: 100%;
    display: block;
    cursor: pointer;
}

.post-video {
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.post-video video {
    width: 100%;
    max-height: 360px;
}

.post-date {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* 底部互动区 */
.post-interact {
    background: var(--bg-dark-secondary);
    border-radius: 4px;
    overflow: hidden;
}

/* 点赞用户列表 */
.post-likes-list {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--primary-gold);
    display: flex;
    align-items: flex-start;
    gap: 6px;
    border-bottom: 1px solid var(--border-color);
}

.post-likes-list .like-icon {
    color: var(--primary-gold);
    flex-shrink: 0;
}

.post-likes-list .like-users {
    flex: 1;
    line-height: 1.6;
}

.post-visitor-count {
    color: var(--text-secondary);
    font-size: 12px;
}

/* 评论区 */
.post-comments {
    padding: 0;
    background: transparent;
    border-radius: 0;
    margin-top: 0;
}

.comment-item {
    font-size: 14px;
    line-height: 1.8;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-author {
    color: var(--primary-gold);
    font-weight: 500;
}

.comment-text {
    color: var(--text-primary);
}

/* 帖子操作栏 */
.post-action-bar {
    display: flex;
    border-top: 1px solid var(--border-color);
    margin-top: 12px;
    padding-top: 8px;
}

.post-action-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.post-action-item:hover {
    color: var(--primary-gold);
    background: rgba(255, 215, 0, 0.1);
}

.post-action-item:first-child {
    border-right: 1px solid var(--border-color);
}

.post-action-item .action-icon {
    font-size: 18px;
}

.post-action-item.liked {
    color: var(--primary-gold);
}

.post-action-item.liked .action-icon {
    color: var(--primary-gold);
}

/* 悬浮客服按钮 - 图标在上文字在下 */
.chat-float-btn {
    position: fixed !important;
    right: 15px !important;
    bottom: 120px !important;
    width: 60px !important;
    height: 70px !important;
    padding: 10px 8px !important;
    border-radius: 12px !important;
    background: var(--gold-gradient) !important;
    color: #000 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 15px var(--shadow-gold) !important;
    z-index: 9999 !important;
    transition: transform 0.3s, box-shadow 0.3s !important;
    border: 2px solid var(--primary-gold) !important;
    outline: none !important;
}

.chat-float-icon {
    font-size: 24px !important;
    display: block !important;
    line-height: 1 !important;
}

.chat-float-text {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #000000 !important;
    display: block !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.chat-float-btn:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 20px var(--shadow-gold) !important;
}

/* 移动端样式 */
@media (max-width: 768px) {
    .chat-float-btn {
        right: 10px !important;
        bottom: 90px !important;
        width: 55px !important;
        height: 65px !important;
        padding: 8px 6px !important;
        border-radius: 10px !important;
    }
    
    .chat-float-icon {
        font-size: 22px !important;
    }
    
    .chat-float-text {
        font-size: 10px !important;
    }
    
    .chat-window {
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

.chat-badge {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute;
    top: -5px;
    right: -5px;
}

/* 客服聊天窗口 */
.chat-window {
    display: none;
    position: fixed;
    right: 20px;
    bottom: 230px;
    width: 320px;
    height: 420px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--shadow-gold);
    z-index: 1001;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-gold);
}

.chat-window.active {
    display: flex;
}

.chat-header {
    background: var(--gold-gradient);
    color: #000;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: #000;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-dark-secondary);
}

.chat-welcome {
    text-align: center;
    padding: 20px;
}

.chat-welcome-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.chat-welcome-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.chat-msg {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.chat-msg.user {
    align-items: flex-end;
}

.chat-msg.admin {
    align-items: flex-start;
}

.chat-msg-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.chat-msg.user .chat-msg-bubble {
    background: var(--gold-gradient);
    color: #000;
    border-bottom-right-radius: 4px;
}

.chat-msg.admin .chat-msg-bubble {
    background: var(--bg-dark);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
}

.chat-msg-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.chat-input-area {
    display: flex;
    padding: 12px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    gap: 8px;
}

.chat-input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    background: var(--bg-dark-secondary);
    color: var(--text-primary);
}

.chat-input:focus {
    border-color: var(--primary-gold);
}

.chat-send {
    background: var(--gold-gradient);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.comment-input-wrap {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.comment-input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    background: var(--bg-dark-secondary);
    color: var(--text-primary);
}

.comment-input:focus {
    border-color: var(--primary-gold);
}

.comment-send-btn {
    background: var(--gold-gradient);
    color: #000;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* 发帖弹窗 */
.post-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    z-index: 3000;
}

.post-modal.active {
    display: block;
}

.post-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
}

.post-modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
}

.post-modal-submit {
    background: var(--gold-gradient);
    color: #000;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.post-modal-submit:disabled {
    background: var(--bg-dark-secondary);
    color: var(--text-secondary);
}

.post-modal-body {
    padding: 16px;
}

.post-textarea {
    width: 100%;
    min-height: 150px;
    border: none;
    outline: none;
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    background: var(--bg-dark);
    color: var(--text-primary);
}

.post-textarea::placeholder {
    color: var(--text-secondary);
}

.post-media-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.post-media-preview .media-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.post-media-preview .media-item img,
.post-media-preview .media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-media-preview .remove-media {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
}

.upload-progress-overlay {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(102,126,234,0.08);
    border-radius: 10px;
    font-size: 13px;
    color: #667eea;
    font-weight: 500;
    width: 100%;
}
.upload-spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(102,126,234,0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: uploadSpin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes uploadSpin { to { transform: rotate(360deg); } }

.post-modal-tools {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 20px;
}

.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.tool-btn span:first-child {
    font-size: 24px;
}

/* 登录弹窗 */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.login-modal.active {
    display: flex;
}

.login-box {
    background: var(--bg-card);
    border-radius: 12px;
    width: 90%;
    max-width: 340px;
    padding: 24px;
    border: 1px solid var(--border-gold);
    box-shadow: 0 4px 30px var(--shadow-gold);
    position: relative;
}

.login-title {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-gold);
}

.login-tabs {
    display: flex;
    margin-bottom: 20px;
}

.login-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 15px;
    cursor: pointer;
    color: var(--text-secondary);
}

.login-tab.active {
    color: var(--primary-gold);
    border-bottom-color: var(--primary-gold);
}

.login-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 12px;
    background: var(--bg-dark-secondary);
    color: var(--text-primary);
}

.login-input:focus {
    outline: none;
    border-color: var(--primary-gold);
}

.login-input::placeholder {
    color: var(--text-secondary);
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--gold-gradient);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.login-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
}

/* 用户中心弹窗 */
.user-center {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    z-index: 2500;
    overflow-y: auto;
}

.user-center.active {
    display: block;
}

.user-header {
    background: linear-gradient(180deg, #fff8e1 0%, #fff3cd 50%, #ffecb3 100%);
    padding: 60px 20px 30px;
    color: var(--text-primary);
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--border-gold);
}

.user-header-close {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--gold-gradient);
    border: none;
    color: #000;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-card);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    overflow: hidden;
    border: 3px solid var(--primary-gold);
    box-shadow: 0 4px 20px var(--shadow-gold);
}

.user-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-nickname-large {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--primary-gold);
}

.user-bio {
    font-size: 14px;
    color: var(--text-secondary);
}

.user-menu {
    background: var(--bg-card);
    margin: 16px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.user-menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-primary);
}

.user-menu-item:last-child {
    border-bottom: none;
}

.user-menu-item span:first-child {
    font-size: 20px;
    margin-right: 12px;
}

.user-menu-item span:last-child {
    margin-left: auto;
    color: var(--text-secondary);
}

/* 通知 */
.share-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--primary-gold);
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 9999;
    display: none;
    border: 1px solid var(--border-gold);
    box-shadow: 0 4px 20px var(--shadow-gold);
}

.share-notification.active { display: block; }

/* 工具类 */
.text-primary { color: var(--primary-gold); }
.bg-primary { background: var(--gold-gradient); color: #000; }
.text-white { color: #fff; }
.text-text-dark { color: var(--text-primary); }
.text-text-light { color: var(--text-secondary); }
.bg-gray-50 { background-color: var(--bg-dark-secondary); }
.border-gray-100 { border-color: var(--border-color); }
.border-gray-200 { border-color: var(--border-color); }
.border-primary { border-color: var(--primary-gold); }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.space-x-2 > * + * { margin-left: 8px; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-5 { padding: 20px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.mx-3 { margin-left: 12px; margin-right: 12px; }
.mx-4 { margin-left: 16px; margin-right: 16px; }
.my-4 { margin-top: 16px; margin-bottom: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.ml-3 { margin-left: 12px; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-auto { margin-top: auto; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-l-lg { border-radius: 8px 0 0 8px; }
.rounded-r-lg { border-radius: 0 8px 8px 0; }
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.overflow-hidden { overflow: hidden; }
.object-cover { object-fit: cover; }
.text-center { text-align: center; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

@media (max-width: 480px) {
    .nav-logo { width: 48px; height: 48px; }
    .nav-title { font-size: 18px; }
    .nav-subtitle { font-size: 12px; }
    .nav-action-button { padding: 8px 14px; font-size: 13px; }
    .ad-card-title { font-size: 14px; }
    .ad-card-desc { font-size: 12px; }
    .ad-card-info { padding: 8px 10px; }
}

@media (max-width: 360px) {
    .ad-list { gap: 8px; }
    .ad-card-img { aspect-ratio: 1/1; }
}

/* ========== 预测页面 - 加拿大28开奖系统 ========== */

/* Header Ad */
.p28-header-ad { padding: 8px 12px 0; }
.p28-header-ad a { display: block; border-radius: 10px; overflow: hidden; }
.p28-header-ad img { width: 100%; height: auto; display: block; }

/* Ticker */
.p28-ticker {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 13px;
    color: #fff;
    font-weight: 500;
}
.p28-ticker-track {
    display: inline-block;
    animation: p28TickerScroll 20s linear infinite;
}
@keyframes p28TickerScroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Ad Banner */
.p28-ad-banner { padding: 8px 12px 0; }
.p28-ad-banner-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}
.p28-ad-banner-scroll::-webkit-scrollbar { display: none; }
.p28-ad-item {
    flex-shrink: 0;
    width: 140px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.p28-ad-item img { width: 100%; height: 100%; object-fit: cover; }

/* Latest Draw Card */
.p28-latest-card {
    margin: 12px;
    background: var(--bg-card);
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(102,126,234,0.1);
    overflow: hidden;
    border: 1px solid rgba(102,126,234,0.12);
}
.p28-latest-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.p28-latest-main {
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    background: linear-gradient(180deg, rgba(102,126,234,0.03) 0%, transparent 100%);
}
.p28-section-label {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 8px;
}
.p28-section-label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}
.p28-period-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.p28-period-label {
    font-size: 0.82em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.p28-period-value {
    font-size: 2.4em;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}
.p28-draw-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.p28-ball {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, #667eea 0%, #5a67d8 50%, #764ba2 100%);
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(102,126,234,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: transform 0.2s;
}
.p28-ball:hover { transform: scale(1.08); }
.p28-ball-sum {
    width: 52px;
    height: 52px;
    font-size: 23px;
    background: linear-gradient(145deg, #f5576c 0%, #e91e63 50%, #f093fb 100%);
    box-shadow: 0 4px 16px rgba(245,87,108,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
.p28-op {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
}
.p28-draw-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.p28-tag {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 1px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.p28-tag-da { background: linear-gradient(135deg, #f5576c, #ff6b6b); }
.p28-tag-xiao { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.p28-tag-dan { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.p28-tag-shuang { background: linear-gradient(135deg, #f97316, #fb923c); }

/* Sidebar */
.p28-latest-sidebar {
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}
.p28-cd-box {
    padding: 18px 16px;
    background: linear-gradient(135deg, #667eea 0%, #5a67d8 40%, #764ba2 100%);
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.p28-cd-box::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.p28-cd-title {
    font-size: 0.85em;
    opacity: 0.9;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
.p28-cd-timer {
    font-size: 2.4em;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.p28-cd-info {
    font-size: 0.75em;
    opacity: 0.8;
    margin-top: 4px;
}
.p28-cd-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.25);
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 0.85em;
}
.p28-cd-col { text-align: center; }
.p28-cd-sub { opacity: 0.8; font-size: 0.85em; }
.p28-cd-val { font-weight: 700; font-size: 1.1em; margin-top: 2px; }
.p28-cd-sep {
    width: 1px;
    height: 30px;
    background: rgba(255,255,255,0.3);
}

/* Recent 5 */
.p28-recent5 {
    flex: 1;
    padding: 12px 16px;
}
.p28-r5-title {
    font-size: 0.92em;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.p28-r5-title::before {
    content: '';
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: linear-gradient(180deg, #667eea, #764ba2);
}
.p28-r5-list { font-size: 0.88em; }
.p28-r5-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    border-radius: 8px;
    transition: all 0.2s;
}
.p28-r5-item:hover { background: rgba(102,126,234,0.06); transform: translateX(2px); }
.p28-r5-item:last-child { border-bottom: none; }
.p28-r5-nbr {
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 40px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}
.p28-r5-nums {
    display: flex;
    gap: 3px;
    align-items: center;
    flex: 1;
}
.p28-r5-ball {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #667eea;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.p28-r5-op { font-size: 11px; color: var(--text-secondary); }
.p28-r5-sum {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.p28-r5-tags {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}
.p28-r5-tag {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.r5t-da { background: linear-gradient(135deg, #ff6b6b, #ee5a24); color: #fff; }
.r5t-xiao { background: linear-gradient(135deg, #54a0ff, #2e86de); color: #fff; }
.r5t-dan { background: linear-gradient(135deg, #ffa502, #e67e22); color: #fff; }
.r5t-shuang { background: linear-gradient(135deg, #2ed573, #26de81); color: #fff; }

/* Nav Tabs */
.p28-nav-tabs {
    display: flex;
    margin: 8px 12px;
    background: var(--bg-card);
    border-radius: 14px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    scrollbar-width: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 4px;
    gap: 4px;
}
.p28-nav-tabs::-webkit-scrollbar { display: none; }
.p28-nav-tab {
    flex: 1;
    min-width: 0;
    padding: 10px 8px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 10px;
    transition: all 0.25s;
    white-space: nowrap;
}
.p28-nav-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 3px 10px rgba(102,126,234,0.3);
}

/* Tab Panels */
.p28-tab-panel {
    display: none;
    padding: 12px;
    padding-bottom: 100px;
}
.p28-tab-panel.active { display: block; }

/* Controls */
.p28-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.p28-controls label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.p28-controls select {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* Tables */
.p28-tbl-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(102,126,234,0.12);
    box-shadow: 0 2px 12px rgba(102,126,234,0.06);
}
.p28-tbl {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    font-size: 13px;
}
.p28-tbl thead th {
    padding: 14px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #667eea;
    background: linear-gradient(180deg, rgba(102,126,234,0.08), rgba(102,126,234,0.03));
    border-bottom: 2px solid rgba(102,126,234,0.12);
    text-align: center;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.p28-tbl tbody td {
    padding: 11px 6px;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    color: var(--text-primary);
    vertical-align: middle;
}
.p28-tbl tbody tr:last-child td { border-bottom: none; }
.p28-tbl tbody tr:hover { background: rgba(102,126,234,0.04); }
.p28-tbl tbody tr:nth-child(even) { background: rgba(102,126,234,0.015); }
.p28-empty {
    text-align: center;
    padding: 30px !important;
    color: #999 !important;
}

/* Prediction Intro */
.p28-pred-intro {
    background: linear-gradient(135deg, rgba(102,126,234,0.08), rgba(118,75,162,0.06));
    padding: 16px 18px;
    border-radius: 14px;
    margin-bottom: 14px;
    border: 1px solid rgba(102,126,234,0.15);
    font-size: 0.9em;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
    overflow: hidden;
}
.p28-pred-intro::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(102,126,234,0.12) 0%, transparent 70%);
    border-radius: 50%;
}
.p28-pred-intro strong { color: #667eea; font-size: 1.05em; }
.p28-pred-intro p { margin: 6px 0 0; color: var(--text-secondary); font-size: 0.9em; }

/* Prediction Type Tabs */
.p28-pred-types {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
    padding: 6px;
    background: var(--bg-card);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.p28-pt {
    padding: 10px 8px;
    border-radius: 10px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.25s;
    text-align: center;
}
.p28-pt:hover { background: rgba(102,126,234,0.06); }
.p28-pt.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    box-shadow: 0 3px 12px rgba(102,126,234,0.35);
}

/* Hit / Miss / Wait */
.p28-hit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #34d399);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}
.p28-miss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}
.p28-wait {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 14px;
    background: rgba(102,126,234,0.12);
    color: #667eea;
    font-size: 12px;
    font-weight: 600;
}

/* Trend Table */
.p28-trend-tbl th, .p28-trend-tbl td { padding: 8px 4px !important; }
.p28-trend-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}
.p28-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}
.p28-dot-da { background: #f5576c; }
.p28-dot-xiao { background: #4facfe; }
.p28-dot-dan { background: #a855f7; }
.p28-dot-shuang { background: #f97316; }
.p28-dot-empty { background: transparent; }

/* Inline badges */
.p28-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.p28-badge-da { background: linear-gradient(135deg, #f5576c, #ff6b6b); }
.p28-badge-xiao { background: linear-gradient(135deg, #4facfe, #00c6fb); }
.p28-badge-dan { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.p28-badge-shuang { background: linear-gradient(135deg, #f97316, #fb923c); }

/* Number badges in table */
.p28-tbl-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #667eea;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    margin: 0 1px;
}
.p28-tbl-sum {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* 咪牌按钮 */
.p28-scratch-btn {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #92400e;
    border: none;
    padding: 9px 28px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(245,158,11,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
    transition: transform 0.15s, box-shadow 0.15s;
    letter-spacing: 1px;
}
.p28-scratch-btn:active { transform: scale(0.93); box-shadow: 0 2px 8px rgba(245,158,11,0.25); }

/* 咪牌弹窗 - 全屏遮罩 */
.p28-scratch-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at center, rgba(30,10,60,0.95) 0%, rgba(0,0,0,0.97) 100%);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(8px);
}
.p28-scratch-modal.active { display: flex; }

.p28-scratch-popup {
    background: linear-gradient(170deg, #ffffff 0%, #f8f6ff 50%, #f0edff 100%);
    border-radius: 24px;
    width: 100%;
    max-width: 360px;
    padding: 0 24px 24px;
    box-shadow: 0 25px 80px rgba(102,126,234,0.35), 0 0 0 1px rgba(102,126,234,0.1);
    position: relative;
    overflow: hidden;
}
.p28s-top-decor {
    height: 6px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 200% 100%;
    animation: p28sShimmer 3s linear infinite;
    margin: 0 -24px;
}
@keyframes p28sShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.p28s-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(0,0,0,0.06);
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}
.p28s-close:hover { background: rgba(0,0,0,0.12); color: #333; }
.p28s-icon {
    text-align: center;
    font-size: 36px;
    margin-top: 20px;
    margin-bottom: 4px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}
.p28s-title {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: 3px;
    margin-bottom: 16px;
}
.p28s-cd-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}
.p28s-cd-label {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}
.p28s-cd-value {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 15px;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    box-shadow: 0 3px 12px rgba(102,126,234,0.3);
}
.p28s-period {
    text-align: center;
    font-size: 13px;
    color: #888;
    margin-bottom: 18px;
    font-weight: 500;
}
.p28s-period span {
    color: #667eea;
    font-weight: 800;
    font-size: 15px;
}
.p28s-card-area {
    position: relative;
    background: linear-gradient(145deg, #eef0ff 0%, #e8e4f8 40%, #fce4ec 100%);
    border-radius: 16px;
    overflow: hidden;
    min-height: 140px;
    margin-bottom: 14px;
    border: 2px solid rgba(102,126,234,0.12);
    box-shadow: inset 0 2px 8px rgba(102,126,234,0.08);
}
.p28s-card-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 36px 16px;
    flex-wrap: wrap;
}
.p28s-ball {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(145deg, #667eea, #5a67d8);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102,126,234,0.35), inset 0 -2px 4px rgba(0,0,0,0.1), inset 0 2px 4px rgba(255,255,255,0.25);
}
.p28s-ball-sum {
    width: 56px; height: 56px;
    background: linear-gradient(145deg, #f093fb, #ec4899);
    font-size: 24px;
    box-shadow: 0 4px 14px rgba(236,72,153,0.4), inset 0 -2px 4px rgba(0,0,0,0.1), inset 0 2px 4px rgba(255,255,255,0.25);
}
.p28s-sym {
    font-size: 20px;
    font-weight: 800;
    color: #aaa;
}
#p28ScratchCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    cursor: pointer;
    touch-action: none;
    border-radius: 14px;
}
.p28s-hint {
    text-align: center;
    font-size: 12px;
    color: #aaa;
    margin-bottom: 18px;
    letter-spacing: 0.5px;
}
.p28s-btns {
    display: flex;
    gap: 10px;
}
.p28s-btn-refresh {
    flex: 1;
    padding: 12px;
    border-radius: 14px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    box-shadow: 0 4px 14px rgba(102,126,234,0.3);
    transition: transform 0.15s, box-shadow 0.15s;
    letter-spacing: 1px;
}
.p28s-btn-refresh:active { transform: scale(0.96); }
.p28s-btn-close {
    flex: 1;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.08);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: #666;
    transition: all 0.15s;
}
.p28s-btn-close:active { transform: scale(0.96); background: #f5f5f5; }

/* ========== Mobile responsive ========== */
@media (max-width: 768px) {
    .p28-latest-layout { grid-template-columns: 1fr; }
    .p28-latest-sidebar { border-left: none; border-top: 1px solid var(--border-color); }
    .p28-latest-main { padding: 20px 16px; }
    .p28-latest-card { margin: 8px; }
    .p28-nav-tabs { margin: 0 8px; }
    .p28-tab-panel { padding: 8px; padding-bottom: 100px; }
    .p28-tbl { font-size: 12px; }
    .p28-tbl thead th { padding: 8px 4px; font-size: 11px; }
    .p28-tbl tbody td { padding: 8px 4px; }
    .p28-tbl-ball { width: 20px; height: 20px; font-size: 10px; }
    .p28-tbl-sum { width: 24px; height: 24px; font-size: 11px; }
    .p28-badge { padding: 2px 6px; font-size: 10px; }
    .p28-ad-banner { padding: 6px 8px 0; }
    .p28-ticker { font-size: 12px; padding: 6px 0; }
    .p28-header-ad { padding: 6px 8px 0; }
}

@media (max-width: 480px) {
    .p28-ball { width: 36px; height: 36px; font-size: 15px; }
    .p28-ball-sum { width: 42px; height: 42px; font-size: 18px; }
    .p28-op { font-size: 15px; }
    .p28-period-value { font-size: 1.6em; }
    .p28-section-label { font-size: 1em; }
    .p28-nav-tab { font-size: 12px; padding: 10px 4px; }
    .p28-cd-timer { font-size: 2em; }
    .p28-cd-box { padding: 12px; }
    .p28-r5-ball { width: 20px; height: 20px; font-size: 10px; }
    .p28-r5-sum { width: 22px; height: 22px; font-size: 11px; }
    .p28-r5-nbr { min-width: 40px; font-size: 0.85em; }
    .p28-pred-types { gap: 6px; }
    .p28-pt { padding: 6px 12px; font-size: 12px; }
    .p28-pred-intro { padding: 10px 12px; font-size: 0.85em; }
    .p28-trend-num { width: 24px; height: 24px; font-size: 11px; }
    .p28-dot { width: 22px; height: 22px; font-size: 10px; }
    .p28s-ball { width: 40px; height: 40px; font-size: 17px; }
    .p28s-ball-sum { width: 48px; height: 48px; font-size: 20px; }
    .p28s-sym { font-size: 16px; }
    .p28s-card-result { padding: 28px 12px; }
    .p28-r5-tag { font-size: 9px; padding: 2px 6px; }
    .p28-controls select { padding: 5px 8px; font-size: 12px; }
    .p28-controls label { font-size: 12px; }
}

@media (max-width: 360px) {
    .p28-ball { width: 32px; height: 32px; font-size: 14px; }
    .p28-ball-sum { width: 38px; height: 38px; font-size: 16px; }
    .p28-draw-row { gap: 4px; }
    .p28-op { font-size: 13px; }
    .p28-nav-tab { font-size: 11px; padding: 8px 3px; }
    .p28-tbl-ball { width: 18px; height: 18px; font-size: 9px; }
    .p28-tbl-sum { width: 22px; height: 22px; font-size: 10px; }
    .p28-badge { padding: 1px 5px; font-size: 9px; }
    .p28-scratch-popup { padding: 0 14px 14px; }
    .p28s-ball { width: 36px; height: 36px; font-size: 15px; }
    .p28s-ball-sum { width: 42px; height: 42px; font-size: 18px; }
    .p28-r5-tags { gap: 3px; }
    .p28-r5-tag { font-size: 9px; padding: 1px 5px; }
}
