/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #0b0f1c 0%, #1a1f2f 50%, #0f1923 100%);
    color: #e0e6f0;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

/* 暗色模式支持（默认暗色） */
@media (prefers-color-scheme: light) {
    body {
        background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 50%, #d0d9e6 100%);
        color: #1a202c;
    }
}

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

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

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

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(108, 92, 231, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(108, 92, 231, 0.7);
    }
}

/* 通用section动画 */
section {
    animation: fadeInUp 0.8s ease-out 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; }
section:nth-child(6) { animation-delay: 0.5s; }
section:nth-child(7) { animation-delay: 0.6s; }

/* 头部导航 */
header {
    background: rgba(15, 20, 35, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s;
}

@media (prefers-color-scheme: light) {
    header {
        background: rgba(255, 255, 255, 0.8);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
}

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

nav h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe, #fd79a8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    font-weight: 800;
    text-shadow: none;
    animation: pulseGlow 3s infinite;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    align-items: center;
}

nav ul li a {
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.95rem;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #6c5ce7, #fd79a8);
    transition: width 0.3s ease;
}

nav ul li a:hover {
    background: rgba(108, 92, 231, 0.15);
    color: #a29bfe;
}

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

/* 主内容区 */
main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
}

/* 通用卡片样式 */
section, aside {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}

@media (prefers-color-scheme: light) {
    section, aside {
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
}

section:hover, aside:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(108, 92, 231, 0.2);
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #6c5ce7, #fd79a8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #6c5ce7, #fd79a8);
    border-radius: 4px;
    margin-top: 0.5rem;
}

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

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

article {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 1.2rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.6s ease both;
}

@media (prefers-color-scheme: light) {
    article {
        background: rgba(255, 255, 255, 0.8);
        border: 1px solid rgba(0, 0, 0, 0.05);
    }
}

article:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(108, 92, 231, 0.1);
    box-shadow: 0 12px 30px rgba(108, 92, 231, 0.25);
    border-color: rgba(108, 92, 231, 0.3);
}

figure {
    margin: 0;
    overflow: hidden;
    border-radius: 16px;
    position: relative;
}

figure img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 16px;
    transition: transform 0.5s ease, filter 0.3s;
    display: block;
}

article:hover figure img {
    transform: scale(1.08);
    filter: brightness(1.1);
}

figcaption {
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 0.8rem;
    color: #a29bfe;
    text-align: center;
}

article p {
    font-size: 0.9rem;
    margin: 0.3rem 0;
    color: rgba(255, 255, 255, 0.7);
}

@media (prefers-color-scheme: light) {
    article p {
        color: #4a5568;
    }
}

/* 详情页特殊样式 */
#detail article {
    display: block;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 24px;
}

#detail h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.8rem;
    color: #a29bfe;
    border-left: 4px solid #6c5ce7;
    padding-left: 1rem;
}

#detail p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

#detail ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

#detail ul li {
    background: rgba(108, 92, 231, 0.2);
    padding: 0.3rem 1rem;
    border-radius: 30px;
    font-size: 0.9rem;
    color: #a29bfe;
    border: 1px solid rgba(108, 92, 231, 0.2);
}

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

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

#characters article {
    text-align: center;
    padding: 1.5rem 1rem;
}

#characters figure img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
    border: 3px solid rgba(108, 92, 231, 0.3);
    transition: all 0.4s ease;
}

#characters article:hover figure img {
    transform: scale(1.1) rotate(5deg);
    border-color: #a29bfe;
    box-shadow: 0 0 30px rgba(108, 92, 231, 0.4);
}

/* 平台介绍 */
#platform article {
    padding: 2rem;
}

#platform h3 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.8rem;
    color: #a29bfe;
}

#platform p {
    margin-bottom: 1rem;
}

/* APP下载 */
#app article {
    text-align: center;
    padding: 3rem 2rem;
}

#app ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

#app ul li a {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

#app ul li a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.5);
    background: linear-gradient(135deg, #5a4bd1, #8b7cf7);
}

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

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

#reviews article {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border-left: 4px solid #6c5ce7;
}

#reviews article p {
    font-size: 0.95rem;
}

#reviews article p strong {
    color: #a29bfe;
    margin-right: 0.5rem;
}

/* 侧边栏 */
aside {
    position: sticky;
    top: 80px;
    height: fit-content;
}

aside h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

aside ol, aside ul {
    list-style-position: inside;
    padding: 0;
    margin-bottom: 1.5rem;
}

aside ol li, aside ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    transition: color 0.3s, padding-left 0.3s;
}

aside ol li:hover, aside ul li:hover {
    color: #a29bfe;
    padding-left: 0.5rem;
}

aside ul li {
    list-style: none;
}

@media (max-width: 1024px) {
    aside {
        position: static;
        margin-top: 2rem;
    }
}

/* 页脚 */
footer {
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media (prefers-color-scheme: light) {
    footer {
        background: rgba(255, 255, 255, 0.8);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }
}

footer h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

footer ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

footer ul li a {
    color: #a29bfe;
    text-decoration: none;
    transition: color 0.3s;
}

footer ul li a:hover {
    color: #fd79a8;
    text-decoration: underline;
}

footer p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0.3rem 0;
}

@media (prefers-color-scheme: light) {
    footer p {
        color: #718096;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.8rem 1rem;
    }

    nav ul {
        margin-top: 0.8rem;
        gap: 0.6rem;
    }

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

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

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

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

    h2 {
        font-size: 1.6rem;
    }

    section, aside {
        padding: 1.2rem;
    }
}

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

    #characters {
        grid-template-columns: repeat(2, 1fr);
    }

    article {
        padding: 0.8rem;
    }

    figcaption {
        font-size: 0.9rem;
    }

    #app ul {
        flex-direction: column;
        align-items: center;
    }

    footer ul {
        gap: 1rem;
    }
}

/* 渐变Banner效果（为每个section添加顶部渐变线） */
section::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, #6c5ce7, #fd79a8, #a29bfe);
    border-radius: 4px;
    margin-bottom: 1.5rem;
    width: 80px;
}

/* 卡片圆角统一 */
* {
    border-radius: 0;
}

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

::-webkit-scrollbar-track {
    background: rgba(15, 20, 35, 0.3);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6c5ce7, #a29bfe);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5a4bd1, #8b7cf7);
}

/* 选择文本颜色 */
::selection {
    background: #6c5ce7;
    color: #fff;
}