/* ===== 桃花视频 · 全局样式 ===== */
:root {
    --bg-primary: #0a0a18;
    --bg-secondary: #14142a;
    --bg-card: #1a1a35;
    --bg-card-hover: #1f1f40;
    --bg-aside: #14142e;
    --border-color: #2d2d55;
    --border-hover: #8b5cf6;
    --text-primary: #f0f0ff;
    --text-secondary: #d0d0e8;
    --text-muted: #b0b0d0;
    --text-dim: #8888aa;
    --accent: #a78bfa;
    --accent-light: #c4b5fd;
    --accent-dark: #8b5cf6;
    --gradient-accent: linear-gradient(135deg, #c4b5fd, #a78bfa);
    --gradient-btn: linear-gradient(145deg, #7c3aed, #6d28d9);
    --gradient-btn-hover: linear-gradient(145deg, #8b5cf6, #7c3aed);
    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 12px 40px rgba(139, 92, 246, 0.15);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

/* ===== 基础重置与暗色模式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(145deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-secondary);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 16px;
    overflow-x: hidden;
    transition: background 0.3s ease;
}

/* 暗色模式增强 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(145deg, #080812 0%, #0f0f24 100%);
    }
}

/* ===== 链接与标题 ===== */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease;
}

a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    background: #252550;
    object-fit: cover;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

h1, h2, h3 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.3px;
}

h1 {
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    letter-spacing: 1px;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 1.9rem);
    margin-bottom: 1.5rem;
    border-left: 6px solid var(--accent-dark);
    padding-left: 1rem;
    position: relative;
    overflow: hidden;
}

h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-dark), transparent);
    opacity: 0.3;
}

h3 {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    margin-bottom: 0.5rem;
}

/* ===== 动画关键帧 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.2); }
    50% { box-shadow: 0 0 35px rgba(139, 92, 246, 0.4); }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ===== 滚动动画触发 ===== */
.section {
    animation: fadeInUp 0.8s ease both;
}

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

/* ===== 容器 ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.2rem 2%;
    width: 100%;
}

/* ===== 头部导航毛玻璃效果 ===== */
header {
    background: rgba(13, 13, 32, 0.85);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.header-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0.8rem 2%;
    gap: 0.8rem;
}

.logo h1 {
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 20px rgba(139, 92, 246, 0.2);
    cursor: pointer;
    transition: text-shadow 0.3s ease;
}

.logo h1:hover {
    text-shadow: 0 4px 30px rgba(139, 92, 246, 0.5);
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.8rem, 2vw, 1.2rem);
    list-style: none;
    align-items: center;
}

nav ul li a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.4rem 0.2rem;
    position: relative;
    transition: color 0.25s ease;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-dark);
    transition: width 0.3s ease;
    border-radius: 2px;
}

nav ul li a:hover {
    color: var(--accent);
    text-decoration: none;
    border-bottom: none;
}

nav ul li a:hover::after {
    width: 100%;
}

nav ul li a.active {
    color: var(--accent-dark);
    border-bottom: none;
}

nav ul li a.active::after {
    width: 100%;
}

/* ===== 卡片通用 ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease both;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

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

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

.card img {
    width: 100%;
    transition: transform 0.4s ease, filter 0.3s ease;
}

.card:hover img {
    transform: scale(1.02);
}

.card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.card .meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===== 网格布局 ===== */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
}

.grid-list .card img {
    width: 100%;
    aspect-ratio: 220/310;
    object-fit: cover;
    background: #252550;
}

.grid-list .card:nth-child(odd) {
    animation-delay: 0.05s;
}

.grid-list .card:nth-child(even) {
    animation-delay: 0.1s;
}

/* ===== 板块间隔 ===== */
.section {
    margin: 3.5rem 0;
    scroll-margin-top: 100px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ===== 侧边栏 ===== */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }
}

aside .card {
    background: var(--bg-aside);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    animation: scaleIn 0.5s ease both;
}

aside .card:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

aside h3 {
    font-size: 1.3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

aside ul {
    list-style: none;
    margin-top: 0.5rem;
}

aside li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--border-color);
    color: var(--text-secondary);
    transition: transform 0.2s ease, color 0.2s ease;
}

aside li:last-child {
    border-bottom: none;
}

aside li:hover {
    transform: translateX(4px);
    color: var(--text-primary);
}

aside li span:first-child {
    font-weight: 500;
}

aside .stat-number {
    color: var(--accent);
    font-weight: 600;
    background: rgba(139, 92, 246, 0.1);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* ===== 精品推荐横条 ===== */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.featured-grid .card img {
    width: 100%;
    aspect-ratio: 300/200;
    object-fit: cover;
}

.featured-grid .card p:last-child {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== 角色卡片 ===== */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
}

.character-grid .card {
    text-align: center;
    padding: 1.5rem 1rem;
}

.character-grid .card img {
    width: 120px;
    height: 120px;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 0.8rem;
    border: 3px solid var(--border-color);
    transition: border-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.character-grid .card:hover img {
    border-color: var(--accent-dark);
    transform: scale(1.05) rotate(2deg);
}

/* ===== 详细介绍区域 ===== */
.detail-block {
    background: var(--bg-aside);
    border-radius: var(--radius-xl);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease both;
}

.detail-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent-light), transparent);
}

.detail-block p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.02rem;
    line-height: 1.8;
}

.detail-block strong {
    color: var(--accent);
    font-weight: 600;
}

.detail-block h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* ===== 评论卡 ===== */
.comment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.2rem;
}

.comment-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.5s ease both;
}

.comment-box:nth-child(3n) { animation-delay: 0.1s; }
.comment-box:nth-child(3n+1) { animation-delay: 0.15s; }
.comment-box:nth-child(3n+2) { animation-delay: 0.2s; }

.comment-box:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-hover);
}

.comment-user {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
}

.comment-time {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.comment-text {
    color: var(--text-secondary);
    margin-top: 0.4rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== 按钮 ===== */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-group a {
    background: var(--gradient-btn);
    color: #ffffff;
    padding: 0.8rem 2rem;
    border-radius: 40px;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
    font-size: 1rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-group a::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-group a:hover {
    background: var(--gradient-btn-hover);
    color: white;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

.btn-group a:hover::before {
    left: 100%;
}

.btn-group a:active {
    transform: translateY(0) scale(0.98);
}

/* ===== 底部 ===== */
footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 2.5rem 0 1.5rem;
    position: relative;
}

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

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.2rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--accent);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.copyright {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 1.5rem;
    line-height: 1.8;
    border-top: 1px solid rgba(45, 45, 85, 0.5);
    padding-top: 1rem;
}

/* ===== 图片占位背景 ===== */
img {
    background: linear-gradient(135deg, #1e1e3a, #252550, #2d2d55);
    position: relative;
}

img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1e1e3a, #252550, #2d2d55);
    border-radius: inherit;
}

/* ===== 内容高亮 ===== */
.highlight {
    color: var(--accent);
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge {
    background: var(--border-color);
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: inline-block;
    transition: background 0.3s ease;
}

.badge:hover {
    background: rgba(139, 92, 246, 0.2);
}

/* ===== 平台介绍区块 ===== */
#platform > div {
    background: var(--bg-aside);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease both;
}

#platform > div::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1), transparent 70%);
    pointer-events: none;
}

#platform p {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 1rem;
    font-size: 1.02rem;
}

/* ===== APP下载区域 ===== */
#app {
    text-align: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(139, 92, 246, 0.02));
    border-radius: var(--radius-xl);
    padding: 2.5rem 1.5rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
    position: relative;
    overflow: hidden;
}

#app::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.05), transparent 50%);
    animation: float 6s ease-in-out infinite;
}

#app h2 {
    border-left: none;
    padding-left: 0;
    text-align: center;
    margin-bottom: 1rem;
}

#app h2::after {
    display: none;
}

#app p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* ===== 响应式调整 ===== */
@media (max-width: 1200px) {
    .grid-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .header-wrap {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    nav ul {
        justify-content: center;
        gap: 0.8rem;
    }

    nav ul li a {
        font-size: 0.9rem;
    }

    .grid-list {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 1rem;
    }

    .featured-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }

    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 1rem;
    }

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

    .section {
        margin: 2.5rem 0;
    }

    h2 {
        font-size: 1.4rem;
    }

    .card {
        padding: 0.9rem;
    }

    .btn-group {
        flex-direction: column;
        align-items: center;
    }

    .btn-group a {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    .detail-block {
        padding: 1.2rem;
    }

    aside {
        margin-top: 1rem;
    }

    aside .card {
        padding: 1rem;
    }

    .footer-links {
        justify-content: center;
    }

    .copyright {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .grid-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .grid-list .card p {
        font-size: 0.8rem;
    }

    .grid-list .card .meta {
        font-size: 0.7rem;
    }

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

    .character-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .character-grid .card img {
        width: 90px;
        height: 90px;
    }

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

    nav ul {
        gap: 0.5rem;
    }

    nav ul li a {
        font-size: 0.8rem;
        padding: 0.3rem 0.1rem;
    }

    .container {
        padding: 1rem 3%;
    }

    .card {
        padding: 0.8rem;
        border-radius: var(--radius-md);
    }

    .section {
        margin: 2rem 0;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-light);
}

/* ===== 选择文本颜色 ===== */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: var(--text-primary);
}

/* ===== 焦点可见性 ===== */
:focus-visible {
    outline: 2px solid var(--accent-dark);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== 性能优化 ===== */
.card, .btn-group a, .comment-box, aside .card {
    will-change: transform, box-shadow;
}

img {
    content-visibility: auto;
}

/* ===== 打印样式 ===== */
@media print {
    header, footer, .btn-group, aside {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card, .detail-block, .comment-box {
        background: white;
        border-color: #ddd;
        box-shadow: none;
    }

    h1, h2, h3 {
        color: black;
    }
}

/* ===== 无障碍偏好 ===== */
@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;
    }
}

/* ===== 高对比度支持 ===== */
@media (prefers-contrast: high) {
    :root {
        --border-color: #4a4a7a;
        --text-secondary: #e0e0f0;
        --text-muted: #c0c0d8;
    }
}