/* style.css - 虫虫漫画网站样式 */
/* 全局重置与基础 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #ff6b9d;
    --primary-dark: #e0557a;
    --secondary: #c084fc;
    --accent: #facc15;
    --bg: #0f0f1a;
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-glass: rgba(255, 255, 255, 0.12);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.15);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s ease;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --gradient-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --gradient-banner: linear-gradient(135deg, #ff6b9d, #c084fc, #60a5fa);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* 头部导航 */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(15, 15, 26, 0.75);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 24px;
}

nav h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-banner);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    letter-spacing: 1px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

nav ul li a {
    display: block;
    padding: 8px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 50px;
    transition: all var(--transition);
    position: relative;
    background: transparent;
}

nav ul li a:hover,
nav ul li a:focus {
    color: #fff;
    background: var(--bg-glass);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,107,157,0.3);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--gradient-banner);
    border-radius: 2px;
    transition: all var(--transition);
    transform: translateX(-50%);
}

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

/* 主内容 */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

main > section {
    flex: 1 1 100%;
}

/* 通用section标题 */
section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 32px;
    position: relative;
    display: inline-block;
    background: var(--gradient-banner);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

section h2::after {
    content: '';
    display: block;
    width: 60%;
    height: 4px;
    background: var(--gradient-banner);
    border-radius: 4px;
    margin-top: 8px;
}

/* 热门漫画 - 网格 */
#hot {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

#hot h2 {
    flex: 0 0 100%;
}

#hot article {
    flex: 1 1 calc(16.666% - 24px);
    min-width: 160px;
    max-width: 220px;
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: all var(--transition);
    transform: translateY(0);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    cursor: default;
    position: relative;
    overflow: hidden;
}

#hot article::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,107,157,0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

#hot article:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(255,107,157,0.25);
}

#hot article:hover::before {
    opacity: 1;
}

#hot article img {
    width: 100%;
    height: auto;
    aspect-ratio: 200/280;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    transition: transform var(--transition);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#hot article:hover img {
    transform: scale(1.03);
}

#hot article h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #fff;
}

#hot article p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 2px;
    line-height: 1.5;
}

#hot article p:first-of-type {
    color: var(--secondary);
    font-weight: 500;
}

/* 精品推荐 - 类似卡片 */
#recommend {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

#recommend h2 {
    flex: 0 0 100%;
}

#recommend article {
    flex: 1 1 calc(25% - 24px);
    min-width: 220px;
    max-width: 320px;
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
    transform: translateY(0);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

#recommend article::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-banner);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

#recommend article:hover {
    transform: translateY(-8px);
    border-color: var(--secondary);
    box-shadow: 0 12px 40px rgba(192,132,252,0.2);
}

#recommend article:hover::after {
    transform: scaleX(1);
}

#recommend article img {
    width: 100%;
    height: auto;
    aspect-ratio: 300/420;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    transition: transform var(--transition);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#recommend article:hover img {
    transform: scale(1.02);
}

#recommend article p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

#recommend article p:first-of-type {
    color: #e2e8f0;
    font-style: italic;
    font-weight: 400;
}

/* 漫画详细介绍 */
#detail article {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

#detail article:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(255,107,157,0.15);
}

#detail article h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: var(--gradient-banner);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#detail article p {
    margin-bottom: 16px;
    font-size: 1rem;
    line-height: 1.8;
    color: #cbd5e1;
}

#detail article p strong {
    color: var(--secondary);
    font-weight: 600;
}

/* 角色介绍 */
#characters {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

#characters h2 {
    flex: 0 0 100%;
}

#characters article {
    flex: 1 1 calc(25% - 24px);
    min-width: 180px;
    max-width: 240px;
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: all var(--transition);
    transform: translateY(0);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: relative;
}

#characters article:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 12px 40px rgba(250,204,21,0.15);
}

#characters article img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    border: 3px solid transparent;
    background: var(--gradient-banner);
    padding: 3px;
    transition: transform var(--transition);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

#characters article:hover img {
    transform: scale(1.05) rotate(2deg);
}

#characters article h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

#characters article p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

#characters article p:first-of-type {
    color: var(--primary);
    font-weight: 600;
}

/* 平台介绍 */
#platform {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

#platform:hover {
    border-color: var(--secondary);
    box-shadow: 0 12px 40px rgba(192,132,252,0.15);
}

#platform p {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #cbd5e1;
    max-width: 900px;
}

/* APP下载 */
#app {
    background: var(--gradient-banner);
    border-radius: var(--radius);
    padding: 48px 40px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(255,107,157,0.3);
    position: relative;
    overflow: hidden;
}

#app::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: float 6s ease-in-out infinite;
}

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

#app h2 {
    color: #fff;
    -webkit-text-fill-color: #fff;
    background: none;
    font-size: 2.2rem;
    margin-bottom: 16px;
}

#app h2::after {
    background: #fff;
    width: 80px;
    margin: 12px auto 0;
}

#app p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 28px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#app button {
    display: inline-block;
    padding: 14px 36px;
    margin: 8px 12px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    background: rgba(255,255,255,0.2);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

#app button:hover {
    background: rgba(255,255,255,0.35);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    border-color: #fff;
}

#app button:active {
    transform: translateY(0) scale(0.98);
}

/* 用户评论 */
#reviews {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

#reviews h2 {
    flex: 0 0 100%;
}

#reviews article {
    flex: 1 1 calc(33.333% - 16px);
    min-width: 240px;
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

#reviews article:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 8px 30px rgba(250,204,21,0.1);
}

#reviews article p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

#reviews article p:first-of-type {
    color: var(--secondary);
    font-weight: 600;
}

#reviews article p:nth-of-type(2) {
    font-size: 0.8rem;
    color: #64748b;
}

#reviews article p:last-of-type {
    color: #e2e8f0;
    margin-top: 8px;
    font-style: italic;
}

/* 侧边栏 */
aside {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

aside h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    flex: 0 0 100%;
    background: var(--gradient-banner);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

aside h2::after {
    display: none;
}

aside > ol, aside > p {
    flex: 1 1 30%;
    min-width: 180px;
}

aside ol {
    list-style: none;
    counter-reset: rank;
}

aside ol li {
    counter-increment: rank;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    transition: all var(--transition);
    font-size: 0.95rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 10px;
}

aside ol li::before {
    content: counter(rank);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-banner);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

aside ol li:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(6px);
    color: #fff;
}

aside p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
}

aside p strong {
    color: var(--accent);
}

/* 页脚 */
footer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 8px;
}

footer a {
    color: var(--secondary);
    text-decoration: none;
    transition: color var(--transition);
}

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

/* 滚动动画 (Intersection Observer 用class) */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    #hot article {
        flex: 1 1 calc(20% - 24px);
    }
    #recommend article {
        flex: 1 1 calc(33.333% - 24px);
    }
    #characters article {
        flex: 1 1 calc(33.333% - 24px);
    }
    #reviews article {
        flex: 1 1 calc(50% - 16px);
    }
}

@media (max-width: 992px) {
    nav {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 20px;
        gap: 12px;
    }
    nav ul {
        justify-content: center;
        gap: 4px;
    }
    nav ul li a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    #hot article {
        flex: 1 1 calc(25% - 24px);
    }
    #recommend article {
        flex: 1 1 calc(50% - 24px);
    }
    #characters article {
        flex: 1 1 calc(50% - 24px);
    }
    #reviews article {
        flex: 1 1 calc(50% - 16px);
    }
    #app {
        padding: 36px 24px;
    }
    #app button {
        padding: 12px 28px;
        margin: 6px 8px;
    }
}

@media (max-width: 768px) {
    main {
        padding: 24px 16px;
        gap: 24px;
    }
    nav h1 {
        font-size: 1.4rem;
    }
    section h2 {
        font-size: 1.6rem;
    }
    #hot article {
        flex: 1 1 calc(33.333% - 16px);
        min-width: 130px;
        padding: 12px;
    }
    #hot article h3 {
        font-size: 0.95rem;
    }
    #recommend article {
        flex: 1 1 calc(50% - 16px);
        min-width: 160px;
        padding: 16px;
    }
    #characters article {
        flex: 1 1 calc(50% - 16px);
        min-width: 140px;
        padding: 16px;
    }
    #characters article img {
        width: 90px;
        height: 90px;
    }
    #reviews article {
        flex: 1 1 100%;
    }
    #detail article {
        padding: 24px;
    }
    #detail article h3 {
        font-size: 1.4rem;
    }
    #platform {
        padding: 24px;
    }
    #app h2 {
        font-size: 1.6rem;
    }
    #app button {
        display: block;
        width: 80%;
        margin: 10px auto;
    }
    aside {
        flex-direction: column;
        padding: 24px;
    }
    aside > ol, aside > p {
        flex: 1 1 100%;
    }
}

@media (max-width: 480px) {
    nav {
        flex-direction: column;
        align-items: center;
        padding: 10px 12px;
    }
    nav ul {
        gap: 2px;
    }
    nav ul li a {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
    #hot article {
        flex: 1 1 calc(50% - 12px);
        min-width: 100px;
        padding: 10px;
    }
    #hot article img {
        aspect-ratio: 200/280;
    }
    #recommend article {
        flex: 1 1 100%;
        max-width: 100%;
    }
    #characters article {
        flex: 1 1 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    #reviews article {
        padding: 16px;
    }
    #app {
        padding: 28px 16px;
    }
    #app p {
        font-size: 0.95rem;
    }
    footer {
        font-size: 0.8rem;
        padding: 20px 16px;
    }
}

/* 暗色模式 (已默认暗色) */
@media (prefers-color-scheme: light) {
    :root {
        --bg: #f8fafc;
        --bg-card: rgba(0, 0, 0, 0.04);
        --bg-glass: rgba(0, 0, 0, 0.06);
        --text: #0f172a;
        --text-muted: #475569;
        --border: rgba(0, 0, 0, 0.1);
        --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
        --gradient-bg: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 50%, #dbeafe 100%);
    }
    header {
        background: rgba(248, 250, 252, 0.8);
        border-bottom-color: rgba(0,0,0,0.08);
    }
    #hot article, #recommend article, #characters article, #reviews article,
    #detail article, #platform, aside {
        background: rgba(255,255,255,0.7);
        border-color: rgba(0,0,0,0.08);
    }
    #hot article p, #recommend article p, #characters article p,
    #reviews article p, #detail article p, #platform p, aside p {
        color: #334155;
    }
    #hot article h3, #characters article h3, #detail article h3 {
        color: #0f172a;
    }
    #reviews article p:last-of-type {
        color: #1e293b;
    }
    aside ol li {
        color: #1e293b;
        background: rgba(0,0,0,0.03);
    }
    aside ol li:hover {
        background: rgba(0,0,0,0.08);
    }
    #app {
        box-shadow: 0 8px 40px rgba(255,107,157,0.2);
    }
    footer {
        border-top-color: rgba(0,0,0,0.08);
        color: #475569;
    }
}