/**
 * 足彩 社区论坛 - 核心公共 CSS 样式表
 * 
 * 本样式表采用现代 CSS 变量体系，严格遵循移动端优先及响应式栅格设计。
 * 融合了传统 BBS/贴吧的紧凑布局，与现代高档社区论坛的精致质感（阴影、微交互、平滑过渡）。
 */

:root {
    /* 核心品牌配色 */
    --primary-color: #2d64b3;       /* 经典贴吧/论坛深蓝色 */
    --primary-hover: #1e4b8a;       /* 深蓝色悬停状态 */
    --primary-light: #eff6ff;       /* 浅蓝色背景 */
    --accent-color: #ef4444;        /* 警示/置顶/APP下载红色 */
    --accent-hover: #dc2626;        /* 红色悬停状态 */
    --success-color: #10b981;       /* 精华/安全绿色 */
    --warning-color: #f59e0b;       /* 达人/金牌橙色 */
    
    /* 中性色调 */
    --bg-main: #f2f5f8;             /* 全站主背景色 */
    --bg-card: #ffffff;             /* 卡片/帖子背景色 */
    --border-color: #e2e8f0;        /* 边框分割线颜色 */
    --text-main: #1e293b;           /* 主要文字颜色 */
    --text-muted: #64748b;          /* 次要/脱敏文字颜色 */
    --text-white: #ffffff;          /* 白色文字 */
    
    /* 布局及装饰 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans CJK SC", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 常用排版工具类 */
.container {
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* 顶部导航栏 */
header {
    background-color: var(--bg-card);
    border-bottom: 2px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-top {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
}

.logo span {
    font-size: 12px;
    background-color: var(--primary-color);
    color: var(--text-white);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: normal;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none !important;
}

.nav-links a:hover, .nav-links li.active a {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-main);
}

/* 论坛横幅 Banner */
.forum-banner {
    max-width: 1100px;
    margin: 15px auto;
    height: 180px;
    background-image: url('/assets/bbs_banner.webp');
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 20px;
    color: #ffffff;
}

.banner-title {
    font-size: 24px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.banner-desc {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
    background-color: var(--bg-card);
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.breadcrumb .separator {
    color: #cbd5e1;
}

/* 双栏主布局 */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: start;
    margin-bottom: 40px;
}

/* 论坛卡片容器 */
.thread-container, .post-list-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* 帖子列表头部 */
.post-list-header {
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.tab-btn {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.tab-btn.active, .tab-btn:hover {
    color: var(--primary-color);
    background-color: var(--primary-light);
    text-decoration: none !important;
}

/* 帖子单项 */
.post-item {
    display: flex;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
    align-items: center;
    gap: 15px;
}

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

.post-item:hover {
    background-color: #f8fafc;
}

/* 回复数气泡 */
.post-reply-count {
    width: 45px;
    height: 24px;
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: var(--text-muted);
    flex-shrink: 0;
}

.post-main-info {
    flex: 1;
    min-width: 0;
}

.post-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.post-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
    word-break: break-all;
}

.post-title:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 徽章样式 */
.post-badge {
    font-size: 11px;
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    font-weight: bold;
    flex-shrink: 0;
}

.badge-top {
    background-color: #fef2f2;
    color: #ef4444;
    border: 1px solid #fca5a5;
}

.badge-essence {
    background-color: #ecfdf5;
    color: #10b981;
    border: 1px solid #6ee7b7;
}

.post-meta-row {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.post-author {
    color: #475569;
    font-weight: 500;
}

/* 帖子详情楼层样式 */
.thread-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: #f8fafc;
}

.thread-title-h1 {
    font-size: 18px;
    font-weight: bold;
    color: #0f172a;
    line-height: 1.5;
}

.floor-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    border-bottom: 1px solid var(--border-color);
}

.floor-item:last-of-type {
    border-bottom: none;
}

.floor-left {
    background-color: #fafafa;
    border-right: 1px solid var(--border-color);
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.floor-avatar {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.floor-username {
    font-weight: bold;
    font-size: 13px;
    color: #334155;
    text-align: center;
    word-break: break-all;
}

.floor-user-badge {
    font-size: 11px;
    padding: 2px 8px;
    background-color: #e2e8f0;
    color: #475569;
    border-radius: 10px;
    font-weight: bold;
}

.floor-right {
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
}

.floor-content {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.8;
}

.floor-content p {
    margin-bottom: 15px;
}

.floor-content p:last-child {
    margin-bottom: 0;
}

.floor-signature {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

.floor-footer {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 20px;
}

/* 伪回帖/发帖输入框 */
.reply-editor-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
}

.editor-title {
    font-size: 15px;
    font-weight: bold;
    color: #0f172a;
    margin-bottom: 12px;
}

.pseudo-textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--text-muted);
    font-size: 13px;
    background-color: #f8fafc;
    cursor: text;
    margin-bottom: 15px;
    transition: var(--transition-fast);
}

.pseudo-textarea:focus-within, .pseudo-textarea:hover {
    border-color: var(--primary-color);
    background-color: #ffffff;
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-white);
    border: none;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: bold;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* 右侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 15px 20px;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 14px;
    font-weight: bold;
    color: #0f172a;
    border-left: 3px solid var(--primary-color);
    padding-left: 8px;
    margin-bottom: 12px;
}

.stat-num {
    float: right;
    font-weight: bold;
    color: var(--primary-color);
}

/* 官方推荐卡片 */
.official-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeade 100%);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.official-title {
    font-size: 15px;
    font-weight: bold;
    color: #1e3a8a;
}

.btn-download-now {
    background-color: var(--accent-color);
    color: var(--text-white) !important;
    font-weight: bold;
    text-align: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
    transition: var(--transition-fast);
    display: block;
    text-decoration: none !important;
}

.btn-download-now:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(239, 68, 68, 0.4);
}

/* 底部免责与友情链接区 */
footer {
    background-color: #1e293b;
    color: #94a3b8;
    padding: 40px 0 20px 0;
    margin-top: 60px;
    border-top: 4px solid var(--primary-color);
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: var(--text-white);
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 15px;
}

.footer-section p {
    font-size: 13px;
    line-height: 1.7;
}

.footer-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-section ul a {
    color: #94a3b8;
    font-size: 13px;
    text-decoration: none;
}

.footer-section ul a:hover {
    color: var(--text-white);
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
}

.footer-bottom a {
    color: #cbd5e1;
    font-weight: bold;
}

/* 弹窗/Toast 提醒样式 */
.toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    backdrop-filter: blur(4px);
}

.toast-overlay.active {
    opacity: 1;
    visibility: visible;
}

.toast-box {
    background-color: var(--bg-card);
    border-radius: var(--radius-sm);
    width: 90%;
    max-width: 400px;
    padding: 25px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: var(--transition-normal);
    text-align: center;
}

.toast-overlay.active .toast-box {
    transform: scale(1);
}

.toast-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.toast-title {
    font-size: 16px;
    font-weight: bold;
    color: #0f172a;
    margin-bottom: 10px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.toast-btn {
    background-color: var(--primary-color);
    color: var(--text-white);
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-fast);
}

.toast-btn:hover {
    background-color: var(--primary-hover);
}

/* 响应式媒体查询 */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: var(--bg-card);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        gap: 10px;
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    .nav-links a {
        display: block;
        width: 100%;
    }
    .floor-item {
        grid-template-columns: 1fr;
    }
    .floor-left {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 12px 15px;
    }
    .floor-avatar {
        width: 40px;
        height: 40px;
    }
    .floor-right {
        padding: 15px;
        min-height: auto;
    }
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .download-grid {
        grid-template-columns: 1fr;
    }
}
