/* ==========================================================================
   51影院 (bjhuiyuan.cn) - 全站样式表
   风格: 深蓝金典 / 毛玻璃 / 渐变Banner / 圆角卡片 / 响应式 / 暗色模式
   版本: 2.0
   ========================================================================== */

/* ===== CSS 自定义属性 (色彩系统) ===== */
:root {
    /* 浅色模式 */
    --bg-1: #f5f7fa;
    --bg-2: #ffffff;
    --bg-3: #eef2f6;
    --text-1: #17202A;
    --text-2: #243447;
    --text-3: #334155;
    --brand: #0b1a2f;
    --brand-light: #1e3a5f;
    --brand-glow: rgba(245, 197, 66, 0.15);
    --line: #d0d8e0;
    --card: rgba(255, 255, 255, 0.85);
    --card-solid: #ffffff;
    --nav-bg: rgba(11, 26, 47, 0.85);
    --nav-text: #f1f5f9;
    --btn-bg: #0b1a2f;
    --btn-text: #ffffff;
    --footer-bg: #0b1a2f;
    --footer-text: #d1dce6;
    --heading: #0b1a2f;
    --link: #1e4a7a;
    --tag-bg: #e9edf2;
    --tag-text: #1f2a3a;
    --hero-gradient: linear-gradient(145deg, #0b1a2f 0%, #1a2f4a 50%, #1e3a5f 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] {
    --bg-1: #0f172a;
    --bg-2: #1a2332;
    --bg-3: #0f172a;
    --text-1: #E5E7EB;
    --text-2: #E2E8F0;
    --text-3: #CBD5E1;
    --brand: #0b1a2f;
    --brand-light: #1e3a5f;
    --line: #2d3a4a;
    --card: rgba(30, 41, 59, 0.85);
    --card-solid: #1e293b;
    --nav-bg: rgba(11, 26, 47, 0.9);
    --nav-text: #F8FAFC;
    --btn-bg: #1e3a5f;
    --btn-text: #ffffff;
    --footer-bg: #0b1a2f;
    --footer-text: #cbd5e1;
    --heading: #F8FAFC;
    --link: #7ab0e6;
    --tag-bg: #2d3a4a;
    --tag-text: #E2E8F0;
    --hero-gradient: linear-gradient(145deg, #0b1a2f 0%, #16294a 60%, #1e3a5f 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* ===== 基础重置 ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg-1);
    color: var(--text-1);
    line-height: 1.7;
    transition: background 0.3s ease, color 0.3s ease;
    font-size: 16px;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--brand-light);
}

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

/* ===== 导航栏 ===== */
.site-header {
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--nav-text);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.logo svg {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 2px 8px rgba(245, 197, 66, 0.3));
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.95rem;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #f5c542;
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: #ffffff;
}

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

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 4px 4px 4px 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: #f5c542;
    box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.1);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    width: 120px;
    padding: 6px 8px;
    font-size: 0.9rem;
    transition: width 0.3s ease;
}

.search-box input::placeholder {
    color: #cbd5e1;
}

.search-box button {
    background: #f5c542;
    border: none;
    border-radius: 30px;
    padding: 6px 14px;
    font-weight: 600;
    cursor: pointer;
    color: #0b1a2f;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.search-box button:hover {
    background: #ffd75e;
    transform: scale(1.05);
}

.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--nav-text);
    border-radius: 30px;
    padding: 6px 16px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #f5c542;
}

.mobile-menu {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.3s;
}

.mobile-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 移动端导航 */
.mobile-nav {
    display: none;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav a {
    display: block;
    color: white;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.mobile-nav a:last-child {
    border-bottom: none;
}

.mobile-nav a:hover {
    color: #f5c542;
    padding-left: 8px;
}

@media (max-width: 900px) {
    .nav-links {
        display: none;
    }
    .mobile-menu {
        display: block;
    }
    .search-box input {
        width: 70px;
    }
    .search-box:focus-within input {
        width: 100px;
    }
    .mobile-nav.open {
        display: block;
    }
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    background: var(--btn-bg);
    color: var(--btn-text);
    padding: 12px 28px;
    border-radius: 40px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(11, 26, 47, 0.2);
}

.btn:hover {
    background: #1e3a5f;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11, 26, 47, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--link);
    color: var(--link);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--link);
    color: #fff;
    box-shadow: 0 4px 15px rgba(30, 74, 122, 0.3);
}

/* ===== Hero 区域 ===== */
.hero {
    background: var(--hero-gradient);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(245, 197, 66, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(30, 90, 138, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 40px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.8rem;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 20px;
    font-weight: 800;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.15rem;
    color: #e1e9f2;
    margin-bottom: 25px;
    line-height: 1.8;
    max-width: 600px;
}

.hero-badge {
    display: inline-block;
    background: #f5c542;
    color: #0b1a2f;
    padding: 6px 20px;
    border-radius: 40px;
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(245, 197, 66, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.hero-carousel {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.hero-carousel svg {
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.hero-carousel:hover svg {
    transform: scale(1.02);
}

.hero-stats {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, background 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.12);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: #f5c542;
    line-height: 1.2;
}

.stat-label {
    color: #cddae9;
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ===== 区块通用 ===== */
.section {
    padding: 60px 0;
}

.section-title {
    font-size: 2rem;
    color: var(--heading);
    margin-bottom: 25px;
    border-left: 6px solid #f5c542;
    padding-left: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.section-sub {
    color: var(--text-3);
    margin-top: -10px;
    margin-bottom: 30px;
    font-size: 1rem;
}

/* ===== 卡片网格 ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.card {
    background: var(--card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--line);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f5c542, #f5c54200);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(245, 197, 66, 0.3);
}

.card:hover::before {
    opacity: 1;
}

.card h3 {
    color: var(--heading);
    margin-bottom: 10px;
    font-size: 1.3rem;
    font-weight: 600;
}

.card p {
    color: var(--text-2);
    line-height: 1.7;
}

.card .tag {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    margin-bottom: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.card:hover .tag {
    background: #f5c542;
    color: #0b1a2f;
}

.card a {
    color: var(--link);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.card a:hover {
    color: #f5c542;
}

/* ===== 文章列表 ===== */
.article-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.article-item {
    background: var(--card);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 14px;
    border: 1px solid var(--line);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.article-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(245, 197, 66, 0.3);
}

.article-item .date {
    color: #5f6f82;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 8px;
}

.article-item h4 {
    color: var(--heading);
    margin: 10px 0 6px;
    font-size: 1.2rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.article-item:hover h4 {
    color: #f5c542;
}

.article-item p {
    color: var(--text-2);
    font-size: 0.95rem;
    line-height: 1.6;
}

.article-item .read-more {
    color: var(--link);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 10px;
    transition: color 0.3s ease;
}

.article-item .read-more:hover {
    color: #f5c542;
}

/* ===== FAQ 列表 ===== */
.faq-list details {
    background: var(--card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.faq-list details:hover {
    border-color: rgba(245, 197, 66, 0.3);
    box-shadow: var(--shadow-md);
}

.faq-list details[open] {
    border-color: #f5c542;
    background: var(--card-solid);
}

.faq-list summary {
    font-weight: 600;
    color: var(--heading);
    cursor: pointer;
    font-size: 1.05rem;
    list-style: none;
    position: relative;
    padding-right: 30px;
    transition: color 0.3s ease;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: #f5c542;
    transition: transform 0.3s ease;
}

.faq-list details[open] summary::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-list summary:hover {
    color: #f5c542;
}

.faq-list p {
    color: var(--text-2);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    line-height: 1.7;
}

/* ===== 表格 ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table th {
    background: var(--brand);
    color: #fff;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    color: var(--text-2);
}

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

.data-table tr:hover td {
    background: rgba(245, 197, 66, 0.05);
}

/* ===== 页脚 ===== */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 50px 0 20px;
    margin-top: 40px;
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f5c542, #f5c54200);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.footer-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 0.9rem;
    color: #9db0c2;
    line-height: 1.8;
}

/* ===== 返回顶部 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--brand);
    color: white;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 999;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.back-to-top:hover {
    transform: translateY(-4px);
    background: #f5c542;
    color: #0b1a2f;
    opacity: 1;
    box-shadow: 0 6px 20px rgba(245, 197, 66, 0.3);
}

/* ===== 面包屑 ===== */
.breadcrumb {
    display: flex;
    gap: 8px;
    color: var(--text-3);
    margin-bottom: 25px;
    font-size: 0.95rem;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #f5c542;
}

.breadcrumb span {
    color: var(--text-3);
}

/* ===== 双列布局 ===== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* ===== 工具类 ===== */
.text-muted {
    color: var(--text-3);
}

/* ===== 滚动动画 ===== */
.card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.article-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 为交错动画添加延迟 */
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }
.card:nth-child(5) { animation-delay: 0.4s; }
.card:nth-child(6) { animation-delay: 0.5s; }

.article-item:nth-child(2) { animation-delay: 0.1s; }
.article-item:nth-child(3) { animation-delay: 0.2s; }
.article-item:nth-child(4) { animation-delay: 0.3s; }
.article-item:nth-child(5) { animation-delay: 0.4s; }
.article-item:nth-child(6) { animation-delay: 0.5s; }
.article-item:nth-child(7) { animation-delay: 0.6s; }
.article-item:nth-child(8) { animation-delay: 0.7s; }
.article-item:nth-child(9) { animation-delay: 0.8s; }
.article-item:nth-child(10) { animation-delay: 0.9s; }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 2.4rem;
    }
    .container {
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .hero-grid,
    .two-col {
        grid-template-columns: 1fr;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1.05rem;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .article-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .hero-stats {
        gap: 12px;
    }
    
    .stat-item {
        padding: 12px 16px;
        flex: 1;
        min-width: 100px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .search-box {
        display: none;
    }
    
    .theme-toggle {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 0.95rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo svg {
        width: 30px;
        height: 30px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.4rem;
        padding-left: 12px;
    }
    
    .card {
        padding: 20px;
    }
    
    .article-item {
        padding: 16px;
    }
    
    .footer-links {
        gap: 12px;
    }
}

/* ===== 打印样式 ===== */
@media print {
    .site-header,
    .hero,
    .back-to-top,
    .breadcrumb,
    .mobile-nav {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card,
    .article-item,
    .faq-list details {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===== 无障碍 ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 焦点可见性 */
:focus-visible {
    outline: 3px solid #f5c542;
    outline-offset: 2px;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-1);
}

::-webkit-scrollbar-thumb {
    background: var(--brand-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #f5c542;
}

/* ===== 结束 ===== */