/* ============================================
   韩漫屋 - 暗夜星河主题样式表
   xqikan.cn | 暗色科幻风格 | 毛玻璃效果
   ============================================ */

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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #0a0a18 0%, #14142a 50%, #0d0d20 100%);
    color: #e0e0f0;
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(10, 10, 24, 0.8);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7c3aed, #4c1d95);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #8b5cf6, #6d28d9);
}

/* ---------- 链接与通用 ---------- */
a {
    color: #a78bfa;
    text-decoration: none;
    transition: all 0.3s ease;
}
a:hover {
    color: #c4b5fd;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

/* ---------- 头部导航 ---------- */
header {
    background: rgba(13, 13, 32, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(45, 45, 85, 0.6);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.logo h1 {
    font-size: 1.8rem;
    color: #f0f0ff;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #a78bfa, #f0f0ff, #8b5cf6);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

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

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
    flex-wrap: wrap;
}

nav ul li a {
    color: #d0d0e8;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    position: relative;
    transition: all 0.3s ease;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #7c3aed, #8b5cf6);
    transition: width 0.3s ease;
}

nav ul li a:hover {
    color: #a78bfa;
    text-decoration: none;
}

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

nav ul li a.active {
    color: #8b5cf6;
    border-bottom-color: #8b5cf6;
}

/* ---------- 英雄区 ---------- */
.hero {
    background: linear-gradient(135deg, #1c1c3a 0%, #14142e 50%, #0d0d20 100%);
    padding: 60px 0;
    border-bottom: 1px solid rgba(45, 45, 85, 0.6);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    animation: heroGlow 8s ease-in-out infinite;
}

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

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-content h2 {
    font-size: 2.2rem;
    color: #f0f0ff;
    margin-bottom: 15px;
    font-weight: 800;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.hero-content p {
    font-size: 1.1rem;
    color: #b0b0d0;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ---------- 区块 ---------- */
.section {
    padding: 50px 0;
}

.section-title {
    font-size: 1.6rem;
    color: #f0f0ff;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #7c3aed, #8b5cf6);
    border-radius: 2px;
}

/* ---------- 网格布局 ---------- */
.grid {
    display: grid;
    gap: 20px;
}

.grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

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

/* ---------- 卡片样式 ---------- */
.card {
    background: rgba(26, 26, 53, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(45, 45, 85, 0.6);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.4);
}

.card img {
    width: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

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

.card-body h3 {
    font-size: 1.1rem;
    color: #f0f0ff;
    margin-bottom: 8px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.card:hover .card-body h3 {
    color: #a78bfa;
}

.card-body p {
    font-size: 0.9rem;
    color: #d0d0e8;
    line-height: 1.5;
    margin-bottom: 4px;
}

/* ---------- 标签 ---------- */
.tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    margin: 3px 3px 3px 0;
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

/* ---------- 详情区块 ---------- */
.detail-section {
    background: rgba(22, 22, 48, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 35px;
    margin: 20px 0;
    border: 1px solid rgba(45, 45, 85, 0.6);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease;
}

.detail-section h3 {
    color: #f0f0ff;
    font-size: 1.4rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.detail-section p {
    color: #e0e0f0;
    margin-bottom: 15px;
    line-height: 1.9;
    font-size: 0.95rem;
}

.detail-section h4 {
    color: #a78bfa;
    font-size: 1.15rem;
    margin: 25px 0 10px;
    font-weight: 600;
}

/* ---------- 角色卡片 ---------- */
.char-card {
    background: rgba(26, 26, 53, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(45, 45, 85, 0.6);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.4s ease;
}

.char-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
}

.char-card img {
    border-radius: 50%;
    margin: 0 auto 15px;
    border: 3px solid #8b5cf6;
    transition: all 0.4s ease;
}

.char-card:hover img {
    border-color: #a78bfa;
    transform: scale(1.05);
}

.char-card h3 {
    color: #f0f0ff;
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.char-card .role {
    color: #a78bfa;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.char-card p {
    color: #d0d0e8;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ---------- 平台区块 ---------- */
.platform-section {
    background: rgba(20, 20, 46, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 35px;
    margin: 20px 0;
    border: 1px solid rgba(45, 45, 85, 0.6);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.platform-section h3 {
    color: #f0f0ff;
    font-size: 1.4rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.platform-section p {
    color: #e0e0f0;
    line-height: 1.9;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

/* ---------- 下载按钮 ---------- */
.download-btn {
    display: inline-block;
    padding: 14px 35px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #ffffff;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    margin: 10px 10px 10px 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

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

.download-btn:hover {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #ffffff;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
    text-decoration: none;
}

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

/* ---------- 评论卡片 ---------- */
.comment-card {
    background: rgba(26, 26, 53, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(45, 45, 85, 0.6);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease;
}

.comment-card:hover {
    transform: translateX(5px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.comment-card .user {
    color: #a78bfa;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.comment-card .time {
    color: #8888aa;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.comment-card .content {
    color: #e0e0f0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
    background: rgba(20, 20, 46, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(45, 45, 85, 0.6);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.sidebar h3 {
    color: #f0f0ff;
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(45, 45, 85, 0.6);
    font-weight: 600;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(45, 45, 85, 0.4);
    transition: all 0.3s ease;
}

.sidebar ul li:last-child {
    border-bottom: none;
}

.sidebar ul li:hover {
    padding-left: 8px;
}

.sidebar ul li a {
    color: #d0d0e8;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.sidebar ul li a:hover {
    color: #a78bfa;
    text-decoration: none;
}

.sidebar .rank-num {
    display: inline-block;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    text-align: center;
    line-height: 25px;
    font-size: 0.8rem;
    margin-right: 10px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* ---------- 统计网格 ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-item {
    background: rgba(26, 26, 53, 0.8);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(45, 45, 85, 0.4);
}

.stat-item:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.2);
}

.stat-item .num {
    font-size: 1.5rem;
    color: #a78bfa;
    font-weight: 700;
    animation: countUp 1s ease;
}

.stat-item .label {
    font-size: 0.8rem;
    color: #d0d0e8;
    margin-top: 5px;
}

/* ---------- 页脚 ---------- */
footer {
    background: rgba(10, 10, 24, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(45, 45, 85, 0.6);
    padding: 30px 0;
    margin-top: 50px;
}

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

.footer-links a {
    color: #a78bfa;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: #c4b5fd;
    transform: translateY(-2px);
}

.copyright {
    text-align: center;
    color: #8888aa;
    font-size: 0.85rem;
    line-height: 1.8;
}

.copyright a {
    color: #a78bfa;
}

/* ---------- 布局 ---------- */
.layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 卡片滚动动画 */
.card, .char-card, .comment-card {
    animation: fadeInUp 0.6s ease;
}

.card:nth-child(2), .char-card:nth-child(2), .comment-card:nth-child(2) {
    animation-delay: 0.1s;
}
.card:nth-child(3), .char-card:nth-child(3), .comment-card:nth-child(3) {
    animation-delay: 0.2s;
}
.card:nth-child(4), .char-card:nth-child(4), .comment-card:nth-child(4) {
    animation-delay: 0.3s;
}
.card:nth-child(5), .char-card:nth-child(5), .comment-card:nth-child(5) {
    animation-delay: 0.4s;
}
.card:nth-child(6), .char-card:nth-child(6), .comment-card:nth-child(6) {
    animation-delay: 0.5s;
}
.card:nth-child(7), .char-card:nth-child(7), .comment-card:nth-child(7) {
    animation-delay: 0.6s;
}
.card:nth-child(8), .char-card:nth-child(8), .comment-card:nth-child(8) {
    animation-delay: 0.7s;
}
.card:nth-child(9), .char-card:nth-child(9), .comment-card:nth-child(9) {
    animation-delay: 0.8s;
}
.card:nth-child(10), .char-card:nth-child(10), .comment-card:nth-child(10) {
    animation-delay: 0.9s;
}
.card:nth-child(11), .char-card:nth-child(11), .comment-card:nth-child(11) {
    animation-delay: 1s;
}
.card:nth-child(12), .char-card:nth-child(12), .comment-card:nth-child(12) {
    animation-delay: 1.1s;
}

/* 深色模式支持（系统偏好） */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #080812 0%, #0f0f22 50%, #0a0a18 100%);
    }
    
    .card, .char-card, .comment-card {
        background: rgba(20, 20, 40, 0.9);
    }
    
    .sidebar, .platform-section, .detail-section {
        background: rgba(15, 15, 35, 0.9);
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- 响应式设计 ---------- */
@media (max-width: 1200px) {
    .layout {
        grid-template-columns: 1fr 280px;
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
    }
    
    .header-inner {
        flex-direction: column;
        text-align: center;
        padding: 12px 0;
    }
    
    nav ul {
        justify-content: center;
        gap: 12px;
        padding: 5px 0;
    }
    
    nav ul li a {
        font-size: 0.85rem;
        padding: 3px 0;
    }
    
    .hero {
        padding: 40px 0;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 0.95rem;
        padding: 0 15px;
    }
    
    .grid-4 {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .grid-3 {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-5 {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .section {
        padding: 30px 0;
    }
    
    .section-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .detail-section,
    .platform-section {
        padding: 20px;
        margin: 15px 0;
    }
    
    .detail-section h3,
    .platform-section h3 {
        font-size: 1.2rem;
    }
    
    .detail-section p,
    .platform-section p {
        font-size: 0.9rem;
        line-height: 1.7;
    }
    
    .download-btn {
        padding: 12px 25px;
        font-size: 0.9rem;
        margin: 5px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-links {
        gap: 12px;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .card-body h3 {
        font-size: 1rem;
    }
    
    .card-body p {
        font-size: 0.85rem;
    }
    
    .comment-card {
        padding: 15px;
    }
    
    .comment-card .content {
        font-size: 0.9rem;
    }
    
    .char-card {
        padding: 15px;
    }
    
    .char-card img {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.4rem;
    }
    
    nav ul {
        gap: 8px;
    }
    
    nav ul li a {
        font-size: 0.8rem;
    }
    
    .hero-content h2 {
        font-size: 1.2rem;
    }
    
    .hero-content p {
        font-size: 0.85rem;
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .grid-5 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .card-body {
        padding: 10px;
    }
    
    .card-body h3 {
        font-size: 0.9rem;
    }
    
    .card-body p {
        font-size: 0.8rem;
    }
    
    .tag {
        font-size: 0.7rem;
        padding: 2px 8px;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .detail-section,
    .platform-section {
        padding: 15px;
        border-radius: 12px;
    }
    
    .detail-section h3,
    .platform-section h3 {
        font-size: 1.1rem;
    }
    
    .detail-section p,
    .platform-section p {
        font-size: 0.85rem;
    }
    
    .download-btn {
        display: block;
        width: 100%;
        margin: 8px 0;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-item {
        padding: 12px;
    }
    
    .stat-item .num {
        font-size: 1.2rem;
    }
    
    .footer-links {
        gap: 8px;
    }
    
    .footer-links a {
        font-size: 0.8rem;
    }
    
    .copyright {
        font-size: 0.75rem;
    }
    
    .sidebar {
        padding: 15px;
    }
    
    .sidebar h3 {
        font-size: 1rem;
    }
    
    .sidebar ul li a {
        font-size: 0.85rem;
    }
}

/* 滚动视差效果 */
@media (min-width: 769px) {
    .hero {
        background-attachment: fixed;
    }
}

/* 高亮选中 */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: #ffffff;
}

/* 聚焦状态 */
a:focus,
button:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* 打印样式 */
@media print {
    header,
    footer,
    .sidebar,
    .download-btn {
        display: none !important;
    }
    
    body {
        background: #ffffff;
        color: #000000;
    }
    
    .layout {
        grid-template-columns: 1fr;
    }
}