/* ============================================================
   星辰动漫 - 完整样式表
   风格：梦幻紫罗兰 · 玻璃拟态 · 暗色模式
   ============================================================ */

/* ===== CSS变量 ===== */
:root {
    --primary: #7C5CFC;
    --primary-light: #EDE7FF;
    --primary-dark: #5A3CE0;
    --primary-glow: rgba(124, 92, 252, 0.35);
    --bg-light: #F8F4FF;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.65);
    --text-main: #1A1A2E;
    --text-heading: #0D0820;
    --link-color: #4A4AF0;
    --white: #FFFFFF;
    --accent-border: #D4C5FF;
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --gradient-main: linear-gradient(135deg, #7C5CFC 0%, #B79FFF 50%, #E0D6FF 100%);
    --gradient-banner: linear-gradient(135deg, #1E1040 0%, #3A2A6D 50%, #7C5CFC 100%);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ===== 暗色模式 ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #0F0B1E;
        --bg-card: rgba(30, 16, 64, 0.85);
        --bg-glass: rgba(30, 16, 64, 0.65);
        --text-main: #E0D6FF;
        --text-heading: #FFFFFF;
        --link-color: #B9A8FF;
        --accent-border: #3A2A6D;
        --primary-light: #2A1A5E;
        --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    }
}

/* ===== 基础重置 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-light);
    background-image: 
        radial-gradient(circle at 10% 30%, rgba(124, 92, 252, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 90% 70%, rgba(183, 159, 255, 0.06) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.75;
    font-size: 16px;
    min-height: 100vh;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    line-height: 1.3;
    margin-bottom: 0.5em;
    font-weight: 700;
}

h1 { font-size: 2.4rem; letter-spacing: -0.02em; }
h2 { font-size: 1.9rem; margin-top: 1.5em; border-left: 5px solid var(--primary); padding-left: 15px; }
h3 { font-size: 1.3rem; margin-top: 1em; }

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

p { margin-bottom: 0.8em; }

ul, ol { list-style-position: inside; }

.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--gradient-main);
    color: #fff !important;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: bold;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.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;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px var(--primary-glow);
    text-decoration: none;
    color: #fff !important;
}

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

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary) !important;
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff !important;
    box-shadow: 0 8px 20px var(--primary-glow);
}

/* ===== 导航栏 ===== */
.site-header {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--accent-border);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 10px;
}

.logo h1 {
    font-size: 1.9rem;
    margin: 0;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { filter: drop-shadow(0 0 5px var(--primary-glow)); }
    50% { filter: drop-shadow(0 0 20px var(--primary-glow)); }
}

.nav-menu {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    gap: 5px;
}

.nav-menu li a {
    display: block;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-weight: 500;
    transition: all var(--transition-normal);
    position: relative;
    color: var(--text-main);
}

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

.nav-menu li a:hover {
    background: var(--primary-light);
    text-decoration: none;
    color: var(--primary);
}

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

/* ===== 卡片网格 ===== */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.6s ease both;
    position: relative;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }
.card:nth-child(9) { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.5s; }
.card:nth-child(11) { animation-delay: 0.55s; }
.card:nth-child(12) { animation-delay: 0.6s; }

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 0;
    transition: transform var(--transition-slow);
}

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

.card-body {
    padding: 15px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.02));
}

.card-title {
    font-size: 1.15rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-heading);
    transition: color var(--transition-fast);
}

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

.card-text {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 4px;
    opacity: 0.85;
}

/* ===== 侧边栏布局 ===== */
.layout-2col {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    margin: 30px 0;
}

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

.sidebar {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    height: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 80px;
}

.sidebar h3 {
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.rank-list {
    list-style: none;
    padding: 0;
}

.rank-list li {
    padding: 12px 0;
    border-bottom: 1px dashed var(--accent-border);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.rank-list li:hover {
    padding-left: 10px;
    color: var(--primary);
}

.rank-list li span {
    font-weight: bold;
    color: var(--primary);
    margin-right: 10px;
    min-width: 25px;
    text-align: center;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    font-size: 0.85rem;
}

/* ===== 评论区 ===== */
.comment-list {
    list-style: none;
    padding: 0;
}

.comment-list li {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-normal);
    animation: fadeInUp 0.5s ease both;
}

.comment-list li:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.comment-list li:nth-child(1) { animation-delay: 0.05s; }
.comment-list li:nth-child(2) { animation-delay: 0.1s; }
.comment-list li:nth-child(3) { animation-delay: 0.15s; }
.comment-list li:nth-child(4) { animation-delay: 0.2s; }
.comment-list li:nth-child(5) { animation-delay: 0.25s; }

.comment-user {
    font-weight: bold;
    color: var(--primary);
    margin-right: 12px;
    font-size: 1.05rem;
}

.comment-time {
    font-size: 0.8rem;
    color: var(--text-main);
    opacity: 0.6;
}

.comment-content {
    margin-top: 8px;
    padding-left: 0;
    line-height: 1.6;
}

/* ===== 底部 ===== */
.site-footer {
    background: var(--gradient-banner);
    color: #E0D6FF;
    padding: 50px 0 25px;
    margin-top: 60px;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-main);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
}

.footer-links a {
    color: #B9A8FF;
    padding: 5px 15px;
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
    border: 1px solid transparent;
}

.footer-links a:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transform: translateY(-2px);
}

.footer-info {
    text-align: center;
    font-size: 0.8rem;
    color: #B9A8FF;
    line-height: 2.2;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 25px;
}

.footer-info a {
    color: #B9A8FF;
    padding: 0 8px;
    transition: color var(--transition-fast);
}

.footer-info a:hover { color: #fff; }

/* ===== 特色区域 ===== */
.feature-section {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin: 30px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.feature-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(124, 92, 252, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.feature-section h3 {
    color: var(--primary);
    margin-top: 1.5em;
    font-size: 1.4rem;
}

.feature-section h3:first-child { margin-top: 0; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.feature-item {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

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

.character-card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: var(--radius-md);
    padding: 25px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.6s ease both;
}

.character-card:nth-child(1) { animation-delay: 0.05s; }
.character-card:nth-child(2) { animation-delay: 0.1s; }
.character-card:nth-child(3) { animation-delay: 0.15s; }
.character-card:nth-child(4) { animation-delay: 0.2s; }
.character-card:nth-child(5) { animation-delay: 0.25s; }
.character-card:nth-child(6) { animation-delay: 0.3s; }

.character-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.character-card img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px;
    border: 4px solid var(--primary-light);
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.character-card:hover img {
    border-color: var(--primary);
    transform: scale(1.05);
}

.character-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.character-card p {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

/* ===== 下载区块 ===== */
.download-section {
    background: var(--gradient-banner);
    color: #E0D6FF;
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
}

.download-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.download-section h2,
.download-section h3 {
    color: #fff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.download-section p {
    color: #C8B8FF;
    position: relative;
    z-index: 1;
}

.btn-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 25px;
    position: relative;
    z-index: 1;
}

.btn-group .btn {
    background: #fff;
    color: var(--primary-dark) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn-group .btn:hover {
    background: var(--primary-light);
    transform: translateY(-3px) scale(1.02);
}

.btn-group .btn-outline {
    background: transparent;
    border: 2px solid #fff;
    color: #fff !important;
    box-shadow: none;
}

.btn-group .btn-outline:hover {
    background: #fff;
    color: var(--primary-dark) !important;
}

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

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

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

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

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

::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    border: 2px solid var(--bg-light);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

::selection {
    background: var(--primary);
    color: #fff;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .grid-cards {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }

    .card-img { height: 200px; }

    .layout-2col {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        margin-top: 30px;
    }
}

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

    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }

    .nav-container {
        justify-content: center;
        padding: 12px 15px;
    }

    .nav-menu {
        justify-content: center;
        width: 100%;
        gap: 3px;
    }

    .nav-menu li a {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .grid-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .card-img { height: 160px; }

    .card-body { padding: 10px 12px; }

    .card-title { font-size: 1rem; }

    .card-text { font-size: 0.8rem; }

    .feature-section {
        padding: 25px 20px;
        border-radius: var(--radius-md);
    }

    .download-section {
        padding: 40px 20px;
    }

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

    .character-card {
        padding: 15px 10px;
    }

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

    .comment-list li {
        padding: 12px 15px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .btn-group {
        gap: 10px;
    }

    .footer-links {
        gap: 10px;
    }

    .footer-links a {
        padding: 4px 10px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .grid-cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .card-img { height: 130px; }

    .card-body { padding: 8px 10px; }

    .card-title { font-size: 0.95rem; }

    .card-text { font-size: 0.75rem; }

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

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

    .comment-user {
        display: block;
        margin-bottom: 5px;
    }

    .comment-time {
        display: block;
        margin-bottom: 5px;
    }

    .logo h1 { font-size: 1.5rem; }

    .nav-menu li a {
        padding: 5px 8px;
        font-size: 0.8rem;
    }

    .rank-list li {
        font-size: 0.85rem;
        padding: 8px 0;
    }
}

/* ===== 打印样式 ===== */
@media print {
    .site-header,
    .site-footer,
    .download-section,
    .sidebar {
        display: none;
    }

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

    .card,
    .feature-section,
    .character-card,
    .comment-list li {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

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

/* ===== 工具类 ===== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}