/* ==========================================================================
   CryptoCNN - Main Styles (main.css)
   ========================================================================== */

/* --- 基础重置和变量定义 --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* 颜色 */
    --bg-dark: #121212; /* 主背景深色 */
    --bg-dark-light: #1e1e1e; /* 稍亮的深色背景，用于卡片或区隔 */
    --text-light: #e0e0e0; /* 浅色文字 */
    --text-muted: #a0a0a0; /* 灰色辅助文字 */
    --primary-color: #007bff; /* 主题蓝色，用于按钮、链接 */
    --accent-color: #00ffc8; /* 强调色，用于图表、高亮，源自设计图中的亮绿色 */
    --red-negative: #dc3545; /* 下跌红色 */
    --green-positive: #28a745; /* 上涨绿色 */
    --border-color: #333; /* 边框颜色 */
    --border-lighter: #444; /* 稍亮的边框，用于区分元素 */

    /* 字体 */
    --font-family-sans: 'Inter', sans-serif;
    --font-size-base: 16px;

    /* 间距和圆角 */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --border-radius: 8px;
}

body.dark-theme {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-light);
    background-color: var(--bg-dark); /* 主背景色 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 全局链接样式 */
a {
    color: #eee;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    line-height: 1.2;
}
h2 { font-size: 2.2em; }
h3 { font-size: 1.8em; }
h4 { font-size: 1.4em; }

/* 全局容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* 按钮样式 (在 header.css 中有部分定义，这里补充) */
.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 12px 25px;
    border-radius: var(--border-radius);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.btn-primary:hover {
    background-color: #0056b3;
}
.btn-secondary {
    background-color: var(--bg-dark-light);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.btn-secondary:hover {
    background-color: var(--border-color);
}


/* --- 主要内容区域样式 --- */
.main-content {
    padding-top: var(--spacing-lg); /* 顶部留白 */
    padding-bottom: var(--spacing-lg);
}

/* --- Hero Section - 主轮播区 / 头条新闻 --- */
.hero-section {
    background-color: var(--bg-dark-light);
    padding: var(--spacing-lg) 0;
    margin-bottom: var(--spacing-lg);
    border-radius: var(--border-radius);
    overflow: hidden; /* 确保图片或光效不溢出 */
    position: relative;
}
.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
}
.hero-content {
    flex: 1;
    max-width: 55%; /* 控制内容宽度 */
    padding-right: var(--spacing-md);
    z-index: 1; /* 确保文字在图片之上 */
}
.hero-content .tag {
    display: inline-block;
    background-color: #aaa;
    color: var(--bg-dark);
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
}
.hero-content h2 {
    font-size: 2.8em;
    margin-bottom: var(--spacing-md);
    line-height: 1.1;
}
.hero-content .description {
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
    font-size: 1.1em;
}
.hero-visual {
    flex: 1;
    max-width: 45%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}
.hero-visual img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
    opacity: 0.9; /* 稍微透明 */
}
/* 可以在这里添加一些伪元素来模拟设计图中的光效 */
.hero-visual::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(0,255,200,0.2) 0%, rgba(0,255,200,0) 70%);
    transform: translate(-50%, -50%);
    z-index: 0;
}


/* --- 主要内容网格布局 (Main Grid) --- */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 左侧内容区 2 份，右侧边栏 1 份 */
    gap: var(--spacing-lg);
}

.grid-left {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.grid-right {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.section-block {
    background-color: var(--bg-dark-light);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.section-block h3 {
    font-size: 1.2em;
    margin-bottom: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
}
.section-block h3 .fas {
    font-size: 1em; /* 更多选项的图标 */
    color: var(--text-muted);
}


/* --- 新闻卡片样式 --- */
.news-list-horizontal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* 适应宽度，最小280px */
    gap: var(--spacing-md);
}
.news-item-card {
    background-color: var(--bg-dark);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}
.news-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}
.news-item-card img {
    width: 100%;
    height: 180px; /* 固定图片高度 */
    object-fit: cover;
    display: block;
}
.news-item-card h4 {
    font-size: 1.1em;
    padding: var(--spacing-sm) var(--spacing-md) 0;
    margin-bottom: var(--spacing-xs);
}
.news-item-card .summary {
    font-size: 0.9em;
    color: var(--text-muted);
    padding: 0 var(--spacing-md) var(--spacing-sm);
}
.news-item-card .read-more {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9em;
    color: #888;
    text-align: right;
    border-top: 1px solid var(--border-color);
}
.news-item-card .read-more i {
    margin-left: var(--spacing-xs);
}


/* --- 紧凑型新闻列表 (用于 Latest News, Deep Dive, Featured Stories) --- */
.news-list-vertical {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}
.news-item-compact {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}
.news-item-compact:last-child {
    border-bottom: none; /* 最后一个没有下划线 */
    padding-bottom: 0;
}
.news-item-compact img {
    width: 80px; /* 缩略图宽度 */
    height: 60px; /* 缩略图高度 */
    object-fit: cover;
    border-radius: var(--border-radius);
}
.news-item-compact .news-info h4 {
    font-size: 1em;
    margin-bottom: var(--spacing-xs);
    line-height: 1.3;
}
.news-item-compact .news-info .date {
    font-size: 0.8em;
    color: var(--text-muted);
}

/* 最新新闻和深度解析的网格布局 */
.latest-deep-dive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}
.latest-news-block, .deep-dive-block {
    /* 继承 section-block 样式 */
}


/* --- 市场数据块 (Market Data) --- */
.market-data .data-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}
.market-data .data-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px dashed var(--border-color); /* 虚线分隔 */
}
.market-data .data-item:last-child {
    border-bottom: none;
}
.market-data .coin-name {
    font-weight: 500;
}
.market-data .price {
    font-weight: 600;
}
.market-data .change {
    font-weight: 600;
    font-size: 0.9em;
}
.market-data .change.positive {
    color: var(--green-positive);
}
.market-data .change.negative {
    color: var(--red-negative);
}


/* --- 时事通讯订阅 (Newsletter Signup) --- */
.newsletter-signup form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}
.newsletter-signup input[type="email"] {
    padding: 10px 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-size: 15px;
    outline: none;
}
.newsletter-signup input[type="email"]::placeholder {
    color: var(--text-muted);
}
.newsletter-signup p {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: var(--spacing-sm);
}


/* --- Footer 样式 --- */
.site-footer {
    background-color: var(--bg-dark-light);
    padding: var(--spacing-lg) 0;
    color: var(--text-muted);
    font-size: 0.9em;
    margin-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}
.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}
.footer-logo img {
    height: 30px;
    margin-bottom: var(--spacing-md);
}
.site-footer p {
    margin-bottom: var(--spacing-md);
}
.social-links a {
    color: var(--text-muted);
    font-size: 1.4em;
    margin-right: var(--spacing-md);
    transition: color 0.3s ease;
}
.social-links a:hover {
    color: var(--primary-color);
}
.site-footer h4 {
    font-size: 1.1em;
    margin-bottom: var(--spacing-md);
    color: var(--text-light);
}
.site-footer ul {
    list-style: none;
    padding: 0;
}
.site-footer ul li {
    margin-bottom: var(--spacing-xs);
}
.site-footer ul li a {
    color: var(--text-muted);
}
.site-footer ul li a:hover {
    color: var(--text-light);
}


/* --- 响应式设计 (Media Queries) --- */
@media (max-width: 992px) {
    .hero-inner {
        flex-direction: column; /* 小屏幕上主轮播区堆叠 */
        text-align: center;
    }
    .hero-content {
        max-width: 100%;
        padding-right: 0;
    }
    .hero-visual {
        max-width: 100%;
        justify-content: center;
        margin-top: var(--spacing-md);
    }
    .main-grid {
        grid-template-columns: 1fr; /* 小屏幕上主内容区变为单列 */
    }
    .latest-deep-dive-grid {
        grid-template-columns: 1fr; /* 小屏幕上最新新闻和深度解析变为单列 */
    }
    .section-block {
        padding: var(--spacing-md);
    }
    .news-list-horizontal {
        grid-template-columns: 1fr; /* 小屏幕上热门新闻变为单列 */
    }
    .news-item-card img {
        height: 200px;
    }
    .footer-inner {
        grid-template-columns: 1fr; /* 底部也变为单列 */
        text-align: center;
    }
    .footer-logo {
        margin: 0 auto var(--spacing-md);
    }
    .social-links {
        display: flex;
        justify-content: center;
        gap: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }
    .social-links a {
        margin: 0; /* 移除原有间距 */
    }
    .newsletter-signup form {
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    h2 { font-size: 2em; }
    h3 { font-size: 1.5em; }
    .hero-content h2 {
        font-size: 2.2em;
    }
    .btn-primary {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    h2 { font-size: 1.8em; }
    h3 { font-size: 1.3em; }
    .hero-content h2 {
        font-size: 1.8em;
    }
    .news-item-compact img {
        width: 60px;
        height: 45px;
    }
    .news-item-compact .news-info h4 {
        font-size: 0.9em;
    }
}