/**
 * CryptoNews - 专业虚拟货币资讯网站样式
 * 基于 EmpireCMS 模板系统
 */

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

:root {
    --primary: #f7931a;
    --primary-dark: #e8850f;
    --primary-light: #ffb347;
    --secondary: #1e88e5;
    --success: #10b981;
    --danger: #ef4444;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --white: #ffffff;
    --bg-light: #f8fafc;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-light);
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a { text-decoration: none; color: inherit; transition: all 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ===== 头部 ===== */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--dark);
    color: var(--white);
    padding: 8px 0;
    font-size: 13px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-links a {
    color: var(--gray-light);
    margin-left: 20px;
}

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

.header-main {
    padding: 15px 0;
}

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

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
}

.logo-icon {
    font-size: 32px;
    color: var(--primary);
}

.logo-text {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 导航菜单 */
.main-nav {
    flex: 1;
}

.nav-menu {
    display: flex;
    gap: 10px;
}

.nav-link {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    color: var(--dark);
}

.nav-link:hover {
    background: var(--primary);
    color: var(--white);
}

/* 搜索框 */
.header-search form {
    display: flex;
    gap: 5px;
}

.search-input {
    padding: 10px 15px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    width: 250px;
    font-size: 14px;
}

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

.search-btn {
    padding: 10px 15px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

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

/* ===== 行情 Ticker ===== */
.price-ticker {
    background: var(--dark-light);
    padding: 12px 0;
    overflow: hidden;
}

.ticker-scroll {
    display: flex;
    gap: 40px;
    animation: ticker 30s linear infinite;
    white-space: nowrap;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    color: var(--gray-light);
    font-size: 14px;
    font-weight: 500;
}

.ticker-item .price {
    color: var(--white);
    margin: 0 5px;
    font-weight: 600;
}

.ticker-item .change {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.change.up { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.change.down { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* ===== 主要内容 ===== */
.site-main {
    padding: 30px 0;
}

/* ===== 头条新闻 ===== */
.hero-section {
    margin-bottom: 40px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.hero-main .hero-link {
    display: block;
}

.hero-image {
    position: relative;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.hero-main:hover .hero-image img {
    transform: scale(1.05);
}

.hero-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--primary);
    color: var(--white);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.hero-title {
    font-size: 28px;
    margin-bottom: 15px;
    line-height: 1.4;
    color: var(--dark);
}

.hero-excerpt {
    color: var(--gray);
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.hero-meta {
    display: flex;
    gap: 20px;
    color: var(--gray);
    font-size: 14px;
}

/* 侧边快讯 */
.hero-sidebar {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.sidebar-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--dark);
}

.quick-news {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
    font-size: 14px;
}

.quick-news:last-child { border-bottom: none; }

.quick-time {
    color: var(--primary);
    font-weight: 600;
    flex-shrink: 0;
}

.quick-title {
    color: var(--dark);
    line-height: 1.5;
}

.quick-title:hover { color: var(--primary); }

/* ===== 市场概览 ===== */
.market-section {
    background: var(--white);
    padding: 40px 0;
    margin-bottom: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark);
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.market-card {
    text-align: center;
    padding: 25px;
    background: var(--bg-light);
    border-radius: 12px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.market-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.coin-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 15px;
}

.coin-icon.btc { background: #f7931a; color: #fff; }
.coin-icon.eth { background: #627eea; color: #fff; }
.coin-icon.sol { background: #00ffa3; color: #000; }
.coin-icon.bnb { background: #f3ba2f; color: #fff; }

.coin-name {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark);
}

.coin-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 8px;
}

.coin-change {
    font-size: 14px;
    font-weight: 600;
}

.coin-change.positive { color: var(--success); }
.coin-change.negative { color: var(--danger); }

/* ===== 新闻资讯 ===== */
.news-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.category-tabs {
    display: flex;
    gap: 10px;
}

.tab {
    padding: 8px 20px;
    background: var(--white);
    border-radius: 20px;
    font-size: 14px;
    color: var(--gray);
}

.tab:hover, .tab.active {
    background: var(--primary);
    color: var(--white);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.news-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.news-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.news-card:hover .news-image img {
    transform: scale(1.1);
}

.news-cat {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.news-content {
    padding: 20px;
}

.news-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--dark);
}

.news-excerpt {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    color: var(--gray);
    font-size: 13px;
}

.more-link {
    text-align: center;
    margin-top: 30px;
}

.btn-more {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary);
    color: var(--white);
    border-radius: 25px;
    font-weight: 600;
}

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

/* ===== 专题推荐 ===== */
.featured-section {
    background: var(--white);
    padding: 40px 0;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.featured-card {
    border-radius: 12px;
    overflow: hidden;
}

.featured-image {
    height: 200px;
    overflow: hidden;
    border-radius: 12px;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-content {
    padding: 15px;
}

.featured-content h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.featured-content p {
    color: var(--gray);
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 页脚 ===== */
.site-footer {
    background: var(--dark);
    color: var(--gray-light);
    padding: 50px 0 30px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: var(--white);
    font-size: 16px;
    margin-bottom: 20px;
}

.footer-col p {
    line-height: 1.8;
    font-size: 14px;
    margin-bottom: 20px;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-link {
    padding: 8px 16px;
    background: var(--dark-light);
    border-radius: 8px;
    font-size: 13px;
}

.social-link:hover {
    background: var(--primary);
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--dark-light);
    font-size: 14px;
    color: var(--gray);
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; }
    .market-grid, .news-grid, .featured-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .logo-nav { flex-direction: column; gap: 20px; }
    .nav-menu { flex-wrap: wrap; justify-content: center; }
    .search-input { width: 200px; }
    .market-grid, .news-grid, .featured-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero-image { height: 250px; }
    .hero-title { font-size: 20px; }
}

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

.hero-main, .news-card, .market-card {
    animation: fadeIn 0.6s ease-out;
}
