/* 全局样式 */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.1);
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-accent: #ff6b6b;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0a0a0a;
        --bg-secondary: #1a1a2e;
        --text-primary: #e0e0e0;
        --text-secondary: #b0b0b0;
    }
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gradient-1);
    border-radius: 4px;
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* 渐变Banner */
header {
    background: var(--gradient-1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    animation: fadeInDown 0.8s ease;
}

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

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

nav h1 {
    font-size: 1.5rem;
    animation: fadeInLeft 0.8s ease;
}

nav h1 a {
    color: white;
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    animation: fadeInRight 0.8s ease;
}

nav ul li a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
    transition: all 0.3s ease;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width 0.3s ease;
}

nav ul li a:hover {
    color: white;
    transform: translateY(-2px);
}

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

/* 主内容 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 通用section样式 */
section {
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60%;
    height: 3px;
    background: var(--gradient-2);
    border-radius: 2px;
}

/* 热门漫画网格 */
#hot {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

#hot h2 {
    grid-column: 1 / -1;
}

#hot article {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
    animation: scaleIn 0.6s ease;
    animation-fill-mode: both;
}

#hot article:nth-child(2) { animation-delay: 0.1s; }
#hot article:nth-child(3) { animation-delay: 0.2s; }
#hot article:nth-child(4) { animation-delay: 0.3s; }
#hot article:nth-child(5) { animation-delay: 0.4s; }
#hot article:nth-child(6) { animation-delay: 0.5s; }
#hot article:nth-child(7) { animation-delay: 0.6s; }
#hot article:nth-child(8) { animation-delay: 0.7s; }
#hot article:nth-child(9) { animation-delay: 0.8s; }
#hot article:nth-child(10) { animation-delay: 0.9s; }
#hot article:nth-child(11) { animation-delay: 1.0s; }
#hot article:nth-child(12) { animation-delay: 1.1s; }
#hot article:nth-child(13) { animation-delay: 1.2s; }

#hot article:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: var(--bg-card-hover);
    border-color: var(--text-accent);
}

#hot article img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

#hot article h3 {
    font-size: 1.1rem;
    padding: 0.8rem 1rem 0.3rem;
    color: var(--text-primary);
}

#hot article p {
    padding: 0.1rem 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 精品推荐 */
#recommend {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

#recommend h2 {
    grid-column: 1 / -1;
}

#recommend article {
    background: var(--glass-bg);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease;
    animation-fill-mode: both;
}

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

#recommend article:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--text-accent);
}

#recommend article img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

#recommend article h3 {
    font-size: 1.2rem;
    padding: 1rem 1rem 0.3rem;
    color: var(--text-primary);
}

#recommend article p {
    padding: 0.2rem 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 漫画详细介绍 */
#detail article {
    background: var(--glass-bg);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    animation: fadeInUp 0.8s ease;
}

#detail article h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#detail article img {
    float: left;
    margin: 0 2rem 1rem 0;
    border-radius: 12px;
    max-width: 400px;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

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

#detail article p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: justify;
}

/* 角色介绍 */
#characters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

#characters h2 {
    grid-column: 1 / -1;
}

#characters article {
    background: var(--glass-bg);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
    animation: scaleIn 0.6s ease;
    animation-fill-mode: both;
}

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

#characters article:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--text-accent);
}

#characters article img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--gradient-1);
    transition: transform 0.3s ease;
}

#characters article:hover img {
    transform: scale(1.1) rotate(5deg);
}

#characters article h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

#characters article p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

/* 平台介绍 */
#platform {
    background: var(--glass-bg);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    animation: fadeInUp 0.8s ease;
}

#platform p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: justify;
}

/* APP下载 */
#app {
    background: var(--gradient-1);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

#app h2 {
    color: white;
    -webkit-text-fill-color: white;
}

#app h2::after {
    background: white;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
}

#app p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

#app button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 0.8rem 2rem;
    margin: 0.5rem;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

#app button:hover {
    background: white;
    color: var(--bg-primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* 用户评论 */
#reviews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

#reviews h2 {
    grid-column: 1 / -1;
}

#reviews article {
    background: var(--glass-bg);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease;
    animation-fill-mode: both;
}

#reviews article:nth-child(2) { animation-delay: 0.05s; }
#reviews article:nth-child(3) { animation-delay: 0.1s; }
#reviews article:nth-child(4) { animation-delay: 0.15s; }
#reviews article:nth-child(5) { animation-delay: 0.2s; }
#reviews article:nth-child(6) { animation-delay: 0.25s; }
#reviews article:nth-child(7) { animation-delay: 0.3s; }
#reviews article:nth-child(8) { animation-delay: 0.35s; }
#reviews article:nth-child(9) { animation-delay: 0.4s; }
#reviews article:nth-child(10) { animation-delay: 0.45s; }
#reviews article:nth-child(11) { animation-delay: 0.5s; }
#reviews article:nth-child(12) { animation-delay: 0.55s; }
#reviews article:nth-child(13) { animation-delay: 0.6s; }
#reviews article:nth-child(14) { animation-delay: 0.65s; }
#reviews article:nth-child(15) { animation-delay: 0.7s; }
#reviews article:nth-child(16) { animation-delay: 0.75s; }

#reviews article:hover {
    transform: translateX(5px);
    border-color: var(--text-accent);
}

#reviews article p:first-child {
    color: var(--text-accent);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

#reviews article p:last-child {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 侧边栏 */
aside {
    background: var(--glass-bg);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    margin-top: 2rem;
    animation: fadeInUp 0.8s ease;
}

aside h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

aside section {
    margin-bottom: 1.5rem;
}

aside section h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gradient-2);
    display: inline-block;
}

aside ol {
    list-style-position: inside;
    padding-left: 0;
}

aside ol li {
    padding: 0.4rem 0;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    cursor: pointer;
}

aside ol li:hover {
    color: var(--text-accent);
    transform: translateX(5px);
}

aside section p {
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

/* 页脚 */
footer {
    background: var(--bg-secondary);
    padding: 2rem 1rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    animation: fadeInUp 0.8s ease;
}

footer p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

footer a {
    color: var(--text-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}

/* 响应式布局 */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

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

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

    section h2 {
        font-size: 1.5rem;
    }

    #hot {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    #hot article img {
        height: 220px;
    }

    #recommend {
        grid-template-columns: 1fr;
    }

    #detail article img {
        float: none;
        margin: 0 0 1rem 0;
        max-width: 100%;
    }

    #characters {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    #reviews {
        grid-template-columns: 1fr;
    }

    #app button {
        display: block;
        width: 80%;
        margin: 0.5rem auto;
    }
}

@media (max-width: 480px) {
    nav h1 {
        font-size: 1.2rem;
    }

    nav ul {
        gap: 0.5rem;
    }

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

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

    #hot article img {
        height: 180px;
    }

    #hot article h3 {
        font-size: 0.95rem;
    }

    #hot article p {
        font-size: 0.8rem;
    }

    section {
        margin-bottom: 2rem;
    }

    #detail article {
        padding: 1rem;
    }

    #platform {
        padding: 1rem;
    }

    #app {
        padding: 2rem 1rem;
    }

    aside {
        padding: 1rem;
    }
}

/* 性能优化 - 硬件加速 */
article, section, img {
    will-change: transform;
    backface-visibility: hidden;
}

/* 图片懒加载过渡 */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"]:not([src=""]) {
    opacity: 1;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 选中文本样式 */
::selection {
    background: var(--text-accent);
    color: white;
}

/* 焦点样式 */
:focus-visible {
    outline: 2px solid var(--text-accent);
    outline-offset: 2px;
}