/* CSS 变量 */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255,255,255,0.9);
    --bg-card-hover: rgba(255,255,255,1);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: rgba(148,163,184,0.3);
    --border-hover: #3b82f6;
    --accent: #d97706;
    --accent-secondary: #3b82f6;
    --shadow: rgba(0,0,0,0.08);
    
    /* 趋势颜色 */
    --bullish-bg: rgba(34, 197, 94, 0.1);
    --bullish-color: #16a34a;
    --bullish-border: rgba(34, 197, 94, 0.3);
    --bearish-bg: rgba(239, 68, 68, 0.1);
    --bearish-color: #dc2626;
    --bearish-border: rgba(239, 68, 68, 0.3);
    --neutral-bg: rgba(251, 191, 36, 0.15);
    --neutral-color: #d97706;
    --neutral-border: rgba(251, 191, 36, 0.4);
    
    /* 文章页 */
    --article-bg: #ffffff;
    --article-text: #222;
    --article-border: #e2e8f0;
    --article-header-bg: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

/* ===========================================
   基础样式
   =========================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #e2e8f0 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-secondary); }

/* ===========================================
   头部导航
   =========================================== */
header.site-header {
    border-bottom: 1px solid rgba(148,163,184,0.2);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.site-logo {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1e293b;
}
.site-logo span { color: var(--accent); font-weight: 600; }
.site-logo:hover { text-decoration: none; }

.site-nav-right { font-size: 0.85rem; color: var(--text-muted); }
.site-nav-right a { color: var(--text-muted); }
.site-nav-right a:hover { color: var(--accent-secondary); text-decoration: none; }

/* ===========================================
   布局容器
   =========================================== */
.main-wrapper {
    max-width: 900px;
    margin: 2rem auto 3rem;
    padding: 0 1.25rem;
}

/* ===========================================
   首页介绍卡片
   =========================================== */
.intro-card {
    margin-bottom: 1.5rem;
    padding: 1.5rem 1.4rem;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(241,245,249,0.95));
    border: 1px solid rgba(148,163,184,0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.intro-card h1 {
    font-size: 1.35rem;
    margin-bottom: 0.6rem;
    background: linear-gradient(90deg, #d97706, #b45309);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.intro-card p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* ===========================================
   品种切换 Tab
   =========================================== */
.symbol-tabs {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.symbol-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(148,163,184,0.25);
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.25s ease;
    text-decoration: none;
}

.symbol-tab:hover {
    border-color: var(--border-hover);
    color: var(--accent-secondary);
    background: rgba(255,255,255,1);
    text-decoration: none;
    transform: translateY(-1px);
}

.symbol-tab.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #3b82f6;
    color: #ffffff;
}

.symbol-tab.active:hover {
    transform: none;
}

.tab-icon { font-size: 1.1rem; }
.tab-name { font-weight: 500; }
.tab-count {
    background: rgba(255,255,255,0.2);
    padding: 0.1rem 0.45rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}
.symbol-tab:not(.active) .tab-count {
    background: rgba(100,116,139,0.15);
    color: #64748b;
}

/* ===========================================
   标签栏
   =========================================== */
.tag-bar { 
    margin-top: 0.8rem; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 0.5rem; 
}
.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(59,130,246,0.2);
    color: #3b82f6;
    background: rgba(59,130,246,0.08);
    transition: all 0.2s;
}
.tag:hover {
    background: rgba(59,130,246,0.15);
    border-color: #3b82f6;
}

/* 文章页面的标签样式 */
.article-wrapper .tag {
    background: #e0e7ff;
    color: #4338ca;
    border-color: #c7d2fe;
}
.article-wrapper .tag:hover {
    background: #c7d2fe;
    color: #3730a3;
    border-color: #a5b4fc;
}

/* ===========================================
   文章列表
   =========================================== */
.post-list { margin-top: 1rem; }

.post-item {
    padding: 1.1rem 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(148,163,184,0.2);
    background: rgba(255,255,255,0.95);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.post-item:hover {
    border-color: var(--border-hover);
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}
.post-item.empty {
    text-align: center;
    padding: 2rem;
}
.post-item.empty:hover {
    transform: none;
    box-shadow: none;
}

.post-title { 
    font-size: 1.05rem; 
    font-weight: 600; 
    color: #1e293b;
}
.post-title:hover { 
    color: var(--accent-secondary); 
    text-decoration: none;
}

.post-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.post-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.post-desc strong {
    color: var(--accent);
}

/* 趋势标签 */
.post-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.4rem 0;
}
.trend-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.trend-value {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}
.trend-value.bullish {
    background: var(--bullish-bg);
    color: var(--bullish-color);
    border: 1px solid var(--bullish-border);
}
.trend-value.bearish {
    background: var(--bearish-bg);
    color: var(--bearish-color);
    border: 1px solid var(--bearish-border);
}
.trend-value.neutral {
    background: var(--neutral-bg);
    color: var(--neutral-color);
    border: 1px solid var(--neutral-border);
}

/* 文章卡片内的标签 */
.post-tags { margin-top: 0.6rem; }
.post-tags .tag {
    font-size: 0.7rem;
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

/* ===========================================
   分页导航
   =========================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border-color);
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    height: 2.2rem;
    padding: 0 0.6rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(148,163,184,0.25);
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}
.page-btn:hover {
    background: rgba(59,130,246,0.1);
    border-color: var(--border-hover);
    color: var(--accent-secondary);
    text-decoration: none;
}
.page-btn.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #3b82f6;
    color: #ffffff;
    cursor: default;
}
.page-btn.active:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
}
.page-dots {
    color: var(--text-muted);
    padding: 0 0.3rem;
}

/* ===========================================
   文章详情页
   =========================================== */
.article-page {
    background: #f5f5f7;
    color: #222;
}

.article-header {
    background: var(--article-header-bg);
    color: #f9fafb;
    padding: 1.5rem 1.8rem;
    text-align: center;
}
.article-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}
.article-header p {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.9);
}

.article-wrapper {
    max-width: 860px;
    margin: 0 auto 2.5rem;
    background: var(--article-bg);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2rem 2rem 2.5rem;
    color: var(--article-text);
}

/* ===========================================
   通用排版
   =========================================== */
h2 {
    font-size: 1.15rem;
    margin: 1.8rem 0 0.8rem;
    padding-left: 0.6rem;
    border-left: 4px solid #2563eb;
    color: #1e293b;
}

p {
    line-height: 1.8;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    color: #374151;
}

ul {
    padding-left: 1.4rem;
    font-size: 0.95rem;
}
li {
    margin: 0.35rem 0;
    line-height: 1.7;
    color: #374151;
}

/* 内容卡片 */
.box {
    background: #f8fafc;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    border: 1px solid var(--article-border);
    margin: 0.8rem 0;
}
.box p { margin-bottom: 0.5rem; }
.box ul { margin-bottom: 0; }

/* 多空标记 */
.long { color: #16a34a; font-weight: 600; }
.short { color: #dc2626; font-weight: 600; }
.risk { font-size: 0.88rem; color: #64748b; line-height: 1.8; }

/* 点位表格 */
.level-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8rem 0 1.2rem;
    font-size: 0.9rem;
    border-radius: 8px;
    overflow: hidden;
}
.level-table th,
.level-table td {
    border: 1px solid var(--article-border);
    padding: 0.6rem 0.7rem;
    text-align: center;
}
.level-table th { 
    background: #f1f5f9; 
    font-weight: 600;
    color: #475569;
}
.level-table td { 
    background: #ffffff;
    color: #374151;
}

/* 警告框 */
.box.warning {
    background: #fef3c7;
    border-color: #fbbf24;
}
.box.warning .risk {
    color: #92400e;
}

/* 文章导航 */
.article-nav {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}
.back-link {
    color: #2563eb;
    font-weight: 500;
}
.back-link:hover {
    color: #1d4ed8;
}

/* ===========================================
   页脚
   =========================================== */
.site-footer {
    margin-top: 3rem;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(148,163,184,0.2);
    color: #64748b;
}

.footer-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 1.5rem;
}

.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.footer-logo {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.footer-brand p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.footer-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-links .sep {
    color: var(--border-color);
}

.footer-bottom {
    padding-top: 1rem;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.25rem 0;
    line-height: 1.6;
}

.footer-note {
    margin-top: 1.5rem;
    font-size: 0.82rem;
    color: #6b7280;
}

@media (max-width: 640px) {
    .footer-main {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .footer-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .footer-links .sep {
        display: none;
    }
}

/* ===========================================
   响应式
   =========================================== */
@media (max-width: 640px) {
    header.site-header { 
        padding: 0.9rem 1rem; 
        flex-direction: column;
        gap: 0.5rem;
    }
    .main-wrapper { 
        padding: 0 0.9rem; 
        margin: 1.2rem auto 2rem;
    }
    .intro-card { padding: 1.1rem 1rem; }
    .intro-card h1 { font-size: 1.15rem; }
    
    .symbol-tabs {
        gap: 0.4rem;
    }
    .symbol-tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    .tab-name { display: none; }
    
    .article-wrapper {
        margin: 0;
        padding: 1.2rem 1rem 1.6rem;
        border-radius: 0;
    }
    .article-header { padding: 1.2rem 1rem; }
    .article-header h1 { font-size: 1.2rem; }
    .post-meta { flex-direction: column; gap: 0.3rem; }
}

/* ===========================================
   深色模式
   =========================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-card: rgba(30,41,59,0.9);
        --bg-card-hover: rgba(30,41,59,1);
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --border-color: rgba(148,163,184,0.2);
        --border-hover: #60a5fa;
        --accent: #fbbf24;
        --accent-secondary: #60a5fa;
        --shadow: rgba(0,0,0,0.3);
        
        /* 趋势颜色 */
        --bullish-bg: rgba(34, 197, 94, 0.15);
        --bullish-color: #4ade80;
        --bullish-border: rgba(34, 197, 94, 0.4);
        --bearish-bg: rgba(239, 68, 68, 0.15);
        --bearish-color: #f87171;
        --bearish-border: rgba(239, 68, 68, 0.4);
        --neutral-bg: rgba(251, 191, 36, 0.2);
        --neutral-color: #fbbf24;
        --neutral-border: rgba(251, 191, 36, 0.5);
        
        /* 文章页 */
        --article-bg: #1e293b;
        --article-text: #e2e8f0;
        --article-border: #334155;
        --article-header-bg: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    }
    
    body {
        background: linear-gradient(135deg, var(--bg-primary) 0%, #1e293b 100%);
    }
    
    header.site-header {
        background: rgba(30,41,59,0.98);
        border-bottom-color: rgba(148,163,184,0.15);
    }
    
    .site-logo {
        color: #f1f5f9;
    }
    
    .intro-card {
        background: linear-gradient(145deg, rgba(30,41,59,0.98), rgba(15,23,42,0.95));
        border-color: rgba(148,163,184,0.15);
    }
    
    .intro-card h1 {
        background: linear-gradient(90deg, #fbbf24, #f59e0b);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .symbol-tab {
        background: rgba(30,41,59,0.9);
        border-color: rgba(148,163,184,0.2);
        color: #cbd5e1;
    }
    
    .symbol-tab:hover {
        background: rgba(30,41,59,1);
        color: #60a5fa;
    }
    
    .symbol-tab.active {
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        border-color: #2563eb;
        color: #ffffff;
    }
    
    .symbol-tab:not(.active) .tab-count {
        background: rgba(148,163,184,0.2);
        color: #94a3b8;
    }
    
    .tag {
        background: rgba(96,165,250,0.15);
        border-color: rgba(96,165,250,0.3);
        color: #60a5fa;
    }
    
    .tag:hover {
        background: rgba(96,165,250,0.25);
        border-color: #60a5fa;
    }
    
    .article-wrapper .tag {
        background: rgba(99,102,241,0.2);
        color: #a5b4fc;
        border-color: rgba(99,102,241,0.3);
    }
    
    .article-wrapper .tag:hover {
        background: rgba(99,102,241,0.3);
        color: #c7d2fe;
    }
    
    .post-item {
        background: rgba(30,41,59,0.95);
        border-color: rgba(148,163,184,0.15);
    }
    
    .post-item:hover {
        background: rgba(30,41,59,1);
        border-color: var(--border-hover);
        box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    }
    
    .post-title {
        color: #f1f5f9;
    }
    
    .post-title:hover {
        color: #60a5fa;
    }
    
    .post-tags .tag {
        background: rgba(99,102,241,0.15);
        border-color: rgba(99,102,241,0.25);
        color: #a5b4fc;
    }
    
    .page-btn {
        background: rgba(30,41,59,0.95);
        border-color: rgba(148,163,184,0.2);
        color: #cbd5e1;
    }
    
    .page-btn:hover {
        background: rgba(37,99,235,0.2);
        border-color: #60a5fa;
        color: #60a5fa;
    }
    
    .page-btn.active {
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        border-color: #2563eb;
        color: #ffffff;
    }
    
    /* 文章详情页深色模式 */
    .article-page {
        background: #0f172a;
    }
    
    .article-wrapper {
        background: var(--article-bg);
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    }
    
    h2 {
        color: #f1f5f9;
        border-left-color: #3b82f6;
    }
    
    p, li {
        color: #cbd5e1;
    }
    
    .box {
        background: #0f172a;
        border-color: #334155;
    }
    
    .long { color: #4ade80; }
    .short { color: #f87171; }
    .risk { color: #94a3b8; }
    
    .level-table th {
        background: #334155;
        color: #e2e8f0;
    }
    
    .level-table td {
        background: #1e293b;
        color: #cbd5e1;
        border-color: #334155;
    }
    
    .level-table th {
        border-color: #334155;
    }
    
    .box.warning {
        background: rgba(251,191,36,0.15);
        border-color: rgba(251,191,36,0.4);
    }
    
    .box.warning .risk {
        color: #fbbf24;
    }
    
    .article-nav {
        border-top-color: #334155;
    }
    
    .back-link {
        color: #60a5fa;
    }
    
    .back-link:hover {
        color: #93c5fd;
    }
    
    /* 页脚深色模式 */
    .site-footer {
        background: #1e293b;
        border-top-color: rgba(148,163,184,0.15);
    }
    
    .footer-logo {
        color: #f1f5f9;
    }
}
