/* 基础重置和变量 */
:root {
    --primary: #0d6efd;
    --secondary: #6610f2;
    --dark: #212529;
    --light: #f8f9fa;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    --gray: #6c757d;
    --gradient: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f5f7fa;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

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

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

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 右上角功能区域 */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 语言切换 */
.language-switcher {
    position: relative;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(13, 110, 253, 0.1);
    border: none;
    border-radius: 20px;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.language-btn:hover {
    background: rgba(13, 110, 253, 0.2);
}

.language-btn i {
    font-size: 14px;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    min-width: 150px;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1001;
}

.language-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.language-option button{
    width: 100%;
    padding: 20px;
}

.language-option:hover {
    background: #f8f9fa;
}

.language-option.active {
    background: rgba(13, 110, 253, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.language-flag {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.flag-cn {
    background: #de2910;
    color: #ffde00;
}

.flag-us {
    background: #3c3b6e;
    color: white;
}

.flag-jp {
    background: white;
    color: #bc002d;
}

.flag-kr {
    background: #cd2e3a;
    color: #0047a0;
}

/* 搜索框 */
/*.search-box {*/
/*    display: flex;*/
/*    align-items: center;*/
/*    background: #f8f9fa;*/
/*    border-radius: 20px;*/
/*    padding: 8px 15px;*/
/*    width: 200px;*/
/*}*/

/*.search-box input {*/
/*    border: none;*/
/*    background: transparent;*/
/*    padding: 5px 10px;*/
/*    width: 100%;*/
/*    outline: none;*/
/*    font-size: 14px;*/
/*}*/

/*.search-box button {*/
/*    background: none;*/
/*    border: none;*/
/*    color: var(--gray);*/
/*    cursor: pointer;*/
/*}*/

/* 导航菜单 */
.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-menu a {
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s;
}

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

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s;
}

.nav-menu a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--dark);
    cursor: pointer;
}

/* 英雄区域 */
.hero {
    background: var(--gradient);
    color: white;
    padding: 60px 0;
    text-align: center;
    border-radius: 0 0 var(--radius) var(--radius);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

/* 新闻网格 */
.news-container {
    padding: 40px 0;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eaeaea;
}

.section-title h2 {
    font-size: 28px;
    color: var(--dark);
}

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

.filter-btn {
    padding: 8px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* 新闻卡片 */
.news-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.news-image {
    height: 200px;
    width: 100%;
    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.05);
}

.news-content {
    padding: 25px;
}

.news-category {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(13, 110, 253, 0.1);
    color: var(--primary);
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}

.news-category.defi {
    background: rgba(86, 202, 154, 0.1);
    color: #56ca9a;
}
.news-category.nft {
    background: rgba(235, 87, 87, 0.1);
    color: #414a85;
}
.news-category.web3 {
    background: rgba(155, 81, 224, 0.1);
    color: #5ae156;
}
.news-category.policy {
    background: rgba(155, 81, 224, 0.1);
    color: #9b51e0;
}
.news-category.ethereum {
    background: rgba(98, 126, 234, 0.1);
    color: #627eea;
}
.news-category.bitcoin {
    background: rgba(248, 177, 45, 0.1);
    color: #f8b12d;
}
.news-category.exchange {
    background: rgba(45, 156, 255, 0.1);
    color: #2d9cff;
}
.news-category.important {
    background: rgba(45, 156, 255, 0.1);
    color: #b521ef;
}

.news-category.hot {
    background: rgba(248, 177, 45, 0.1);
    color: #de1313;
}

.news-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-excerpt {
    color: var(--gray);
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
}

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

.news-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 侧边栏 */
.sidebar {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.trending-title {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.trending-item {
    display: flex;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
}

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

.trending-rank {
    font-size: 24px;
    font-weight: 700;
    color: #ddd;
    min-width: 30px;
}

.trending-content h4 {
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 1.4;
}

.trending-stats {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--gray);
}


.load-more-container {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
}

.load-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 36px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    min-width: 160px;
    position: relative;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.load-more-btn:active {
    transform: translateY(0);
}

.load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.no-more-data {
    color: #666;
    font-size: 14px;
    padding: 15px;
}

/* 页脚 */
footer {
    background: var(--dark);
    color: white;
    padding: 0px 0 30px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    /*margin-bottom: 40px;*/
}

.footer-logo {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
}

.footer-about p {
    color: #aaa;
    margin-bottom: 20px;
}

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

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

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

.footer-links h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: white;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: #aaa;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.newsletter h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.newsletter p {
    color: #aaa;
    margin-bottom: 20px;
}

.newsletter-form {
    display: flex;
    gap: 10px;
}

.newsletter-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 30px;
    background: rgba(255,255,255,0.1);
    color: white;
}

.newsletter-input::placeholder {
    color: #aaa;
}

.newsletter-btn {
    padding: 12px 25px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.3s;
}

.newsletter-btn:hover {
    opacity: 0.9;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #aaa;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2rem;
    }

    .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .filter-tabs {
        flex-wrap: wrap;
    }

    .header-right {
        gap: 15px;
    }

    /*.search-box {*/
    /*    width: 160px;*/
    /*}*/
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
        z-index: 999;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .hero {
        padding: 40px 0;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .header-right {
        order: 2;
    }

    .logo {
        order: 1;
    }

    .mobile-menu-btn {
        order: 3;
    }

    .header-container {
        flex-wrap: wrap;
        gap: 15px;
    }

    /*.search-box {*/
    /*    display: none;*/
    /*}*/
}

@media (max-width: 576px) {
    .container {
        padding: 10px 15px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .section-title h2 {
        font-size: 24px;
    }

    .filter-btn {
        padding: 6px 15px;
        font-size: 14px;
    }

    .news-content {
        padding: 20px;
    }

    .language-btn span {
        display: none;
    }

    .language-btn {
        padding: 8px 12px;
    }
}

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

.news-card {
    animation: fadeIn 0.5s ease-out forwards;
}

.news-card:nth-child(2) { animation-delay: 0.1s; }
.news-card:nth-child(3) { animation-delay: 0.2s; }
.news-card:nth-child(4) { animation-delay: 0.3s; }
.news-card:nth-child(5) { animation-delay: 0.4s; }
.news-card:nth-child(6) { animation-delay: 0.5s; }

.tag {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tag.bitcoin {
    background: rgba(248, 177, 45, 0.1);
    color: #f8b12d;
}

.tag.hot {
    background: rgba(248, 177, 45, 0.1);
    color: #de1313;
}

.tag.ethereum {
    background: rgba(98, 126, 234, 0.1);
    color: #627eea;
}

.tag.defi {
    background: rgba(86, 202, 154, 0.1);
    color: #56ca9a;
}

.tag.nft {
    background: rgba(235, 87, 87, 0.1);
    color: #414a85;
}

.tag.policy {
    background: rgba(155, 81, 224, 0.1);
    color: #9b51e0;
}

.tag.web3 {
    background: rgba(155, 81, 224, 0.1);
    color: #5ae156;
}

.tag.exchange {
    background: rgba(45, 156, 255, 0.1);
    color: #2d9cff;
}


.tag.important {
    background: rgba(45, 156, 255, 0.1);
    color: #b521ef;
}


.crypto-ticker-container {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 头部 */
.ticker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ticker-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #4fc3f7;
}

.ticker-title i {
    font-size: 16px;
}

.ticker-controls {
    display: flex;
    gap: 8px;
}

.ticker-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.ticker-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* 跑马灯主体 */
.ticker-wrapper {
    overflow: hidden;
    position: relative;
    height: 60px;
    padding: 0 16px;
}

.ticker-scroll {
    display: flex;
    align-items: center;
    height: 100%;
    animation: tickerScroll 60s linear infinite;
    white-space: nowrap;
    gap: 32px;
    padding: 0 16px;
}

.ticker-scroll.paused {
    animation-play-state: paused;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 220px;
    transition: all 0.3s ease;
    position: relative;
}

.ticker-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.crypto-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.crypto-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.crypto-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.crypto-symbol {
    font-weight: 600;
    color: white;
}

.crypto-fullname {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80px;
}

.crypto-price {
    font-size: 14px;
    font-weight: 600;
    color: white;
    font-family: 'Courier New', monospace;
}

.crypto-change {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
}

.change-up {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.change-down {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.crypto-volume {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 8px;
    font-family: 'Courier New', monospace;
}

/* 底部 */
.ticker-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.ticker-footer span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.update-time i, .data-source i {
    font-size: 11px;
}

#last-update {
    color: #4fc3f7;
    font-weight: 500;
}

/* 动画 */
@keyframes tickerScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .crypto-ticker-container {
        font-size: 12px;
    }

    .ticker-header {
        padding: 6px 12px;
    }

    .ticker-title {
        font-size: 12px;
    }

    .ticker-wrapper {
        height: 52px;
        padding: 0 12px;
    }

    .ticker-item {
        min-width: 180px;
        padding: 6px 12px;
        gap: 8px;
    }

    .crypto-icon {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .crypto-name {
        font-size: 11px;
    }

    .crypto-fullname {
        font-size: 10px;
        max-width: 60px;
    }

    .crypto-price {
        font-size: 12px;
    }

    .crypto-change {
        font-size: 11px;
        padding: 1px 4px;
    }

    .crypto-volume {
        display: none; /* 在小屏幕上隐藏交易量 */
    }

    .ticker-footer {
        padding: 6px 12px;
        font-size: 11px;
    }

    .ticker-btn {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .ticker-item {
        min-width: 150px;
        padding: 4px 8px;
        gap: 6px;
    }

    .crypto-icon {
        width: 22px;
        height: 22px;
        font-size: 9px;
    }

    .crypto-fullname {
        display: none; /* 在超小屏幕上隐藏全名 */
    }

    .ticker-footer {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }

    .ticker-scroll {
        gap: 16px;
        animation-duration: 40s; /* 加快滚动速度 */
    }

    .data-source {
        font-size: 10px;
    }
}

/* 暗色/亮色模式支持 */
@media (prefers-color-scheme: light) {
    .crypto-ticker-container {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        color: #212529;
        border-bottom: 1px solid #dee2e6;
    }

    .ticker-header, .ticker-footer {
        background: rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.1);
    }

    .ticker-item {
        background: rgba(0, 0, 0, 0.03);
        border-color: rgba(0, 0, 0, 0.1);
    }

    .ticker-item:hover {
        background: rgba(0, 0, 0, 0.06);
    }

    .crypto-symbol, .crypto-price {
        color: #212529;
    }

    .crypto-fullname, .crypto-volume {
        color: rgba(0, 0, 0, 0.6);
    }

    .ticker-title {
        color: #0d6efd;
    }

    .ticker-btn {
        background: rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.1);
        color: #212529;
    }

    .ticker-btn:hover {
        background: rgba(0, 0, 0, 0.1);
    }
}

/* 加载动画 */
.ticker-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    color: rgba(255, 255, 255, 0.7);
    gap: 8px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #4fc3f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 高亮动画 */
@keyframes highlight {
    0%, 100% {
        box-shadow: 0 0 0 rgba(79, 195, 247, 0);
    }
    50% {
        box-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
    }
}

.highlight-update {
    animation: highlight 1s ease;
}
