/*
 * 期货研习社 - 专业金融风格 CSS v10.3
 * 设计理念：白色背景 + 深蓝导航栏 + 黄色主色调
 * 主色调：#F5B800（黄色）
 * 背景：纯白/极浅灰 + 专业金融质感
 */

/* ==================== CSS变量 ==================== */
:root {
    --primary: #F5B800;
    --primary-dark: #D4A000;
    --primary-light: #FFD54F;
    --primary-subtle: rgba(245, 184, 0, 0.1);
    --bg-page: #f8fafc;
    --bg-white: #ffffff;
    --nav-bg: #0a1628;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 8px 30px rgba(10, 22, 40, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ==================== 页面背景 ==================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-secondary);
    background: var(--bg-page);
    min-height: 100vh;
    font-size: 16px;
    position: relative;
}

/* 极简网格纹理背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(10, 22, 40, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 22, 40, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* ==================== 导航栏 ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0 24px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.navbar-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.navbar-brand {
    color: var(--primary);
    font-size: 1.5em;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
    transition: var(--transition);
}

.navbar-brand:hover {
    color: var(--primary-light);
    text-shadow: 0 0 20px rgba(245, 184, 0, 0.5);
}

.navbar-menu {
    display: flex;
    gap: 4px;
    list-style: none;
    align-items: center;
}

.navbar-menu a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 0.95em;
    font-weight: 500;
    position: relative;
}

.navbar-menu a:hover {
    color: #ffffff;
    background: rgba(245, 184, 0, 0.15);
}

.navbar-menu a.active {
    color: var(--primary);
    font-weight: 600;
}

/* 黄色下划线高亮 */
.navbar-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(245, 184, 0, 0.5);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5em;
    cursor: pointer;
    padding: 8px;
}

/* ==================== 主容器 ==================== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
    padding-top: 100px;
}

/* ==================== 面包屑导航 ==================== */
.breadcrumb {
    margin-bottom: 24px;
    font-size: 0.9em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: var(--transition);
}

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

/* ==================== 页面头部 Hero ==================== */
header {
    text-align: center;
    padding: 70px 40px;
    background: linear-gradient(135deg, var(--nav-bg) 0%, #1e3a5f 50%, var(--nav-bg) 100%);
    color: white;
    border-radius: var(--radius);
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(245, 184, 0, 0.05) 0%, transparent 50%);
    animation: shimmer 10s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(3%, 3%); }
}

header h1 {
    font-size: 2.8em;
    margin-bottom: 12px;
    font-weight: 700;
    position: relative;
    letter-spacing: -1px;
    color: #ffffff;
}

header .subtitle {
    font-size: 1.15em;
    opacity: 0.9;
    position: relative;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
}

header .tag {
    display: inline-block;
    background: rgba(245, 184, 0, 0.2);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 25px;
    margin-top: 20px;
    font-size: 0.95em;
    border: 1px solid rgba(245, 184, 0, 0.3);
}

/* ==================== 通用区块 ==================== */
.section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 40px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--card-border);
}

.section:hover {
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

.section-title {
    font-size: 1.5em;
    color: var(--text-primary);
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.section-title::before {
    content: '';
    width: 5px;
    height: 26px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 3px;
}

/* ==================== 卡片 ==================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--card-border);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

.card-title {
    font-size: 1.4em;
    color: var(--text-primary);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.card-title::before {
    content: '';
    width: 5px;
    height: 24px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 3px;
}

/* ==================== 标题样式 ==================== */
h2 {
    font-size: 1.8em;
    margin: 32px 0 18px;
    color: var(--text-primary);
    font-weight: 600;
}

h3 {
    color: var(--text-primary);
    margin: 28px 0 14px;
    font-size: 1.3em;
    font-weight: 600;
}

h4 {
    color: var(--text-primary);
    margin: 20px 0 10px;
    font-size: 1.1em;
    font-weight: 600;
}

p {
    margin-bottom: 16px;
    text-align: justify;
    color: var(--text-secondary);
    line-height: 1.9;
}

/* ==================== 列表 ==================== */
ul, ol {
    margin: 20px 0;
    padding-left: 28px;
    color: var(--text-secondary);
}

li {
    margin-bottom: 10px;
    line-height: 1.8;
}

/* ==================== 高亮框 ==================== */
.highlight-box {
    background: linear-gradient(135deg, var(--primary-subtle) 0%, rgba(245, 184, 0, 0.05) 100%);
    border-left: 5px solid var(--primary);
    padding: 24px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 24px 0;
    box-shadow: var(--shadow-sm);
}

.highlight-box p {
    color: var(--text-primary);
    margin-bottom: 0;
}

.key-point {
    background: #f1f5f9;
    border-left: 5px solid var(--primary);
    padding: 24px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 24px 0;
    box-shadow: var(--shadow-sm);
}

.key-point p {
    color: var(--text-primary);
    margin-bottom: 0;
}

.risk-box {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.03) 100%);
    border: 2px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    padding: 24px;
    margin: 24px 0;
    box-shadow: var(--shadow-sm);
}

.risk-box h4 {
    color: #dc2626;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.risk-box p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ==================== 表格 ==================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.95em;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
}

th, td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

th {
    background: linear-gradient(135deg, #fef9e7 0%, #fef3cd 100%);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.95em;
}

tr {
    transition: var(--transition);
    background: var(--card-bg);
}

tr:hover {
    background: #f8fafc;
}

tr:last-child td {
    border-bottom: none;
}

/* ==================== 文章卡片网格 ==================== */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.article-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: block;
    border: 1px solid var(--card-border);
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.article-card .icon {
    font-size: 2.5em;
    margin-bottom: 16px;
}

.article-card h3 {
    font-size: 1.2em;
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-weight: 600;
}

.article-card p {
    font-size: 0.95em;
    color: var(--text-muted);
    margin: 0 0 16px 0;
    line-height: 1.6;
}

.article-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: var(--text-muted);
}

.article-tag {
    background: linear-gradient(135deg, var(--primary-subtle) 0%, rgba(245, 184, 0, 0.06) 100%);
    color: var(--primary-dark);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    border: 1px solid rgba(245, 184, 0, 0.25);
}

/* ==================== 文章导航 ==================== */
.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 2px solid var(--card-border);
    gap: 20px;
}

.article-nav a {
    background: var(--card-bg);
    color: var(--primary-dark);
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    flex: 1;
    text-align: center;
    border: 1px solid var(--card-border);
}

.article-nav a:hover {
    background: linear-gradient(135deg, var(--primary-subtle) 0%, rgba(245, 184, 0, 0.05) 100%);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

/* ==================== 市场快讯 ==================== */
.market-news {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
}

.news-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}

.news-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.news-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.news-item .time {
    color: var(--primary-dark);
    font-size: 1.2em;
}

.news-item .content {
    flex: 1;
    color: var(--text-secondary);
}

.news-item .up {
    color: #dc2626;
}

.news-item .down {
    color: #16a34a;
}

/* ==================== 学习路径 ==================== */
.learning-path {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
}

.path-step {
    flex: 1;
    min-width: 150px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 2px solid var(--card-border);
    transition: var(--transition);
}

.path-step:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.path-step .num {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--nav-bg);
    border-radius: 50%;
    line-height: 32px;
    margin-bottom: 12px;
    font-weight: 700;
}

.path-step h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.path-step p {
    font-size: 0.85em;
    color: var(--text-muted);
    margin: 0;
    text-align: center;
}

/* ==================== 路径卡片网格 ==================== */
.path-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.path-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 2px solid var(--card-border);
    text-decoration: none;
    color: inherit;
    display: block;
}

.path-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.path-card .icon {
    font-size: 2.8em;
    margin-bottom: 16px;
}

.path-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
    color: var(--text-primary);
}

.path-card p {
    font-size: 0.9em;
    color: var(--text-muted);
    margin: 0;
    text-align: center;
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--nav-bg);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95em;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(245, 184, 0, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(245, 184, 0, 0.4);
    color: var(--nav-bg);
}

.btn-outline {
    background: transparent;
    color: var(--primary-dark);
    border: 2px solid var(--primary);
}

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

/* ==================== 页脚 ==================== */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    margin-top: 30px;
    border-top: 1px solid var(--card-border);
    background: var(--card-bg);
}

footer p {
    margin-bottom: 8px;
    text-align: center;
    color: var(--text-muted);
}

footer .disclaimer {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    line-height: 1.7;
    border: 1px solid var(--card-border);
}

footer a {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

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

/* ==================== 链接样式 ==================== */
a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: var(--transition);
}

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

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 20px;
        padding-top: 90px;
    }
    
    header h1 {
        font-size: 2.2em;
    }
    
    .section {
        padding: 28px;
    }
}

@media (max-width: 768px) {
    .navbar-menu {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        flex-direction: column;
        padding: 16px;
        gap: 4px;
    }
    
    .navbar-menu.active {
        display: flex;
    }
    
    .navbar-menu a {
        padding: 14px 20px;
    }
    
    .navbar-toggle {
        display: block;
    }
    
    header {
        padding: 50px 24px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .section {
        padding: 24px;
    }
    
    .article-grid {
        grid-template-columns: 1fr;
    }
    
    .article-nav {
        flex-direction: column;
    }
    
    th, td {
        padding: 12px 14px;
    }
    
    .learning-path {
        flex-direction: column;
    }
    
    .path-step {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px;
        padding-top: 88px;
    }
    
    header {
        padding: 40px 20px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    .section {
        padding: 20px;
    }
    
    .section-title {
        font-size: 1.3em;
    }
}

/* ==================== 动画效果 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeInUp 0.5s ease-out;
}

.article-card:nth-child(1) { animation: fadeInUp 0.5s ease-out 0.1s both; }
.article-card:nth-child(2) { animation: fadeInUp 0.5s ease-out 0.2s both; }
.article-card:nth-child(3) { animation: fadeInUp 0.5s ease-out 0.3s both; }
.article-card:nth-child(4) { animation: fadeInUp 0.5s ease-out 0.4s both; }
.article-card:nth-child(5) { animation: fadeInUp 0.5s ease-out 0.5s both; }
.article-card:nth-child(6) { animation: fadeInUp 0.5s ease-out 0.6s both; }

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ==================== 选中文字样式 ==================== */
::selection {
    background: rgba(245, 184, 0, 0.25);
    color: var(--text-primary);
}
