/* ==========================================
   光棍天堂 - 影视大全随心看
   风格：暗夜影院 · 霓虹渐变 · 毛玻璃
   ========================================== */

/* ---------- 基础重置 & 设计变量 ---------- */
:root {
    --primary: #e94560;
    --primary-dark: #c73652;
    --primary-glow: rgba(233, 69, 96, 0.35);
    --bg-light: #f5f3f0;
    --bg-dark: #0f0f1a;
    --card-light: #ffffff;
    --card-dark: #1a1a2e;
    --text-light: #1f1f1f;
    --text-dark: #ddd;
    --nav-bg: rgba(15, 15, 26, 0.85);
    --nav-border: rgba(255, 255, 255, 0.1);
    --gradient-main: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --gradient-accent: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.2);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 999px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

* {
    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;
    scroll-padding-top: 80px;
}

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

body.dark {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* ---------- 通用容器 ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* ---------- 导航吸顶 ---------- */
.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-decoration: none;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    position: relative;
    transition: transform 0.3s ease;
    display: inline-block;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.logo:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.nav-links a {
    color: #eee;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
    position: relative;
    background: transparent;
    border: 1px solid transparent;
}

.nav-links a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--primary-glow);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 4px 8px;
}

.menu-toggle:hover {
    transform: scale(1.1);
}

/* 移动菜单 */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        background: var(--nav-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 12px 0;
        margin-top: 10px;
        border-radius: var(--radius-md);
        border: 1px solid var(--nav-border);
        animation: slideDown 0.3s ease;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 12px 20px;
        border-radius: var(--radius-sm);
        margin: 2px 8px;
    }

    .menu-toggle {
        display: block;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- 按钮及通用 ---------- */
.btn {
    background: var(--gradient-accent);
    color: #fff;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--primary-glow);
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
    position: relative;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 40%;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
}

.card {
    background: var(--card-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    transition: all 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

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

body.dark .card {
    background: var(--card-dark);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
}

/* ---------- Banner 轮播 ---------- */
.banner {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin: 30px 0;
    background: var(--gradient-main);
    color: #fff;
    min-height: 280px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-lg);
}

.banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    animation: pulse 6s ease-in-out infinite;
}

.banner::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -20%;
    width: 50%;
    height: 200%;
    background: radial-gradient(circle, rgba(233, 69, 96, 0.2) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite reverse;
}

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

.banner-slide {
    display: none;
    padding: 48px;
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 1;
}

.banner-slide.active {
    display: block;
    animation: fadeSlide 0.6s ease;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.banner h2 {
    font-size: 2.4rem;
    margin-bottom: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #ffd6db 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: none;
}

.banner p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
}

/* ---------- 数字动画 ---------- */
.stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin: 40px 0;
}

.stat-item {
    text-align: center;
    background: var(--card-light);
    padding: 28px;
    border-radius: var(--radius-lg);
    flex: 1;
    min-width: 140px;
    box-shadow: var(--shadow-md);
    transition: all 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.stat-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

body.dark .stat-item {
    background: var(--card-dark);
    border-color: rgba(255, 255, 255, 0.05);
}

.stat-num {
    font-size: 2.8rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    line-height: 1.2;
}

/* ---------- FAQ 展开 ---------- */
.faq-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 16px 0;
    transition: all 0.3s ease;
}

body.dark .faq-item {
    border-color: rgba(255, 255, 255, 0.1);
}

.faq-q {
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
    transition: color 0.3s ease;
    padding: 8px 0;
}

.faq-q:hover {
    color: var(--primary);
}

.faq-q span {
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
    color: var(--primary);
    display: inline-block;
}

.faq-item.open .faq-q span {
    transform: rotate(180deg);
}

.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    color: #666;
    padding: 0;
    line-height: 1.8;
}

body.dark .faq-a {
    color: #aaa;
}

.faq-item.open .faq-a {
    max-height: 500px;
    padding-top: 12px;
    padding-bottom: 8px;
}

/* ---------- 图片懒加载样式 ---------- */
.lazy-img {
    background: linear-gradient(90deg, #eee 25%, #ddd 50%, #eee 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

body.dark .lazy-img {
    background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
    background-size: 200% 100%;
}

/* ---------- 返回顶部 ---------- */
.to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--gradient-accent);
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 999;
    box-shadow: 0 4px 16px var(--primary-glow);
    font-size: 1.4rem;
}

.to-top.show {
    opacity: 1;
    visibility: visible;
}

.to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px var(--primary-glow);
}

/* ---------- 滚动动画 ---------- */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.fade-up.appear {
    opacity: 1;
    transform: translateY(0);
}

/* 延迟动画类 */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* ---------- 暗黑模式切换按钮 ---------- */
.dark-mode-toggle {
    background: none;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.dark-mode-toggle:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 16px var(--primary-glow);
}

/* ---------- 网格布局 ---------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

/* ---------- 页脚 ---------- */
footer {
    background: var(--gradient-main);
    color: #aaa;
    padding: 48px 0;
    margin-top: 80px;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

footer a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
}

.footer-grid h4 {
    color: #fff;
    margin-bottom: 16px;
    font-size: 1.1rem;
    position: relative;
    padding-bottom: 8px;
}

.footer-grid h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary);
}

/* ---------- 文章卡片 ---------- */
.article-card h3 {
    color: var(--text-light);
    transition: color 0.3s ease;
    font-size: 1.15rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

body.dark .article-card h3 {
    color: #eee;
}

.article-card h3:hover {
    color: var(--primary);
}

.article-card .date {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.article-card p {
    margin-bottom: 12px;
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
    display: flex;
    gap: 10px;
    padding: 16px 0;
    font-size: 0.9rem;
    color: #777;
    align-items: center;
}

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

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

/* ---------- 搜索框 ---------- */
.search-box {
    display: flex;
    gap: 6px;
    align-items: center;
    background: var(--card-light);
    border-radius: var(--radius-full);
    padding: 6px 12px;
    max-width: 280px;
    margin-left: auto;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 4px 16px var(--primary-glow);
}

body.dark .search-box {
    background: #2a2a2a;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    padding: 8px;
    color: inherit;
    font-size: 0.95rem;
}

.search-box button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.search-box button:hover {
    transform: scale(1.15);
}

/* ---------- 标签 ---------- */
.tag {
    background: var(--gradient-accent);
    color: #fff;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 2px 8px var(--primary-glow);
    transition: all 0.3s ease;
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* ---------- 图标文字 ---------- */
.icon-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---------- SVG 占位 ---------- */
.svg-placeholder {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

.lazy-img svg {
    width: 100%;
    height: auto;
}

/* ---------- 标题层级 ---------- */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }

/* ---------- 响应式优化 ---------- */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .banner h2 {
        font-size: 1.8rem;
    }

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

    .banner-slide {
        padding: 32px 20px;
    }

    .stat-num {
        font-size: 2rem;
    }

    .grid-2, .grid-3 {
        gap: 16px;
    }

    .card {
        padding: 20px;
    }

    .search-box {
        max-width: 100%;
        margin: 16px 0;
    }

    .to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }

    .banner {
        min-height: 200px;
    }

    .banner h2 {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .stats {
        gap: 12px;
    }

    .stat-item {
        padding: 20px;
        min-width: 100px;
    }

    .stat-num {
        font-size: 1.6rem;
    }
}

/* ---------- 玻璃拟态效果 ---------- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

/* ---------- 霓虹光效 ---------- */
.neon-text {
    text-shadow: 0 0 10px var(--primary), 0 0 20px var(--primary), 0 0 40px var(--primary);
}

/* ---------- 图片悬停放大 ---------- */
.img-hover {
    overflow: hidden;
    border-radius: var(--radius-md);
}

.img-hover img {
    transition: transform 0.5s ease;
}

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

/* ---------- 卡片链接 ---------- */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ---------- 分割线 ---------- */
.divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 24px 0;
}

/* ---------- 无障碍：焦点可见 ---------- */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* ---------- 减少动画偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- 打印样式 ---------- */
@media print {
    .sticky-nav,
    .to-top,
    .dark-mode-toggle,
    .menu-toggle,
    .search-box {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}