/* ==========================================
   萝莉社 - 二次元萌系社区
   暗色主题 · 毛玻璃 · 渐变 · 响应式
   ========================================== */

/* ---------- CSS 变量 ---------- */
:root {
    --bg-primary: #0a0a18;
    --bg-secondary: #14142e;
    --bg-card: rgba(28, 28, 62, 0.75);
    --bg-card-hover: rgba(36, 36, 80, 0.9);
    --border-color: rgba(90, 90, 160, 0.25);
    --border-hover: rgba(139, 92, 246, 0.6);
    --text-primary: #f0f0ff;
    --text-secondary: #b0b0d0;
    --text-muted: #8888aa;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-gradient: linear-gradient(135deg, #7c3aed, #6d28d9);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --blur: blur(12px);
    --transition: all 0.3s ease;
}

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

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

body {
    background: var(--bg-primary);
    background-image: 
        radial-gradient(ellipse at 20% 0%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(45, 45, 85, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    transition: var(--transition);
}

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

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

ul {
    list-style: none;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
}

/* ---------- 顶部导航 ---------- */
header {
    background: rgba(13, 13, 32, 0.85);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

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

header h1 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin: 0;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #f0f0ff, var(--accent-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
}

header h1:hover {
    filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.5));
    transform: scale(1.02);
}

header nav div {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

header nav a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    position: relative;
    transition: var(--transition);
}

header nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: transform 0.3s ease;
}

header nav a:hover::after,
header nav a.active::after {
    transform: translateX(-50%) scaleX(1);
}

header nav a:hover {
    color: var(--accent-light);
    background: rgba(139, 92, 246, 0.1);
}

header nav a.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

/* ---------- 主内容区 ---------- */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

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

section {
    animation: fadeInUp 0.6s ease 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 h2 {
    color: var(--text-primary);
    border-left: 6px solid var(--accent);
    padding-left: 0.8rem;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

section h2::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0.3;
}

section h2:hover::before {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ---------- 漫画卡片网格 ---------- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* ---------- 漫画卡片 ---------- */
article {
    background: var(--bg-card);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

article:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    background: var(--bg-card-hover);
}

article img {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

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

article div {
    padding: 0.8rem;
}

article h3 {
    color: var(--text-primary);
    margin: 0 0 0.3rem;
    font-size: 1.2rem;
    font-weight: 700;
    transition: var(--transition);
}

article:hover h3 {
    color: var(--accent-light);
}

article p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.2rem 0;
    line-height: 1.4;
}

article span {
    display: inline-block;
    background: rgba(45, 45, 85, 0.8);
    color: var(--accent-light);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-top: 0.4rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

article:hover span {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent);
}

/* ---------- 精品推荐卡片 ---------- */
.recommend-card {
    background: linear-gradient(135deg, rgba(26, 26, 53, 0.9), rgba(20, 20, 46, 0.9));
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.recommend-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.recommend-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.recommend-card div {
    padding: 1rem;
}

.recommend-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.recommend-card p:last-child {
    color: var(--text-primary);
    line-height: 1.6;
    margin-top: 0.5rem;
}

/* ---------- 双栏布局 ---------- */
.content-wrapper {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.content-main {
    flex: 2;
    min-width: 300px;
    background: rgba(22, 22, 48, 0.8);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.content-main:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.content-main h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.content-main p {
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.content-main strong {
    color: var(--accent-light);
    font-weight: 600;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
    flex: 1;
    min-width: 250px;
    background: rgba(20, 20, 46, 0.85);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    padding: 1.2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    align-self: flex-start;
    position: sticky;
    top: 90px;
    transition: var(--transition);
}

.sidebar:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.sidebar h2 {
    font-size: 1.4rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.sidebar ul {
    padding: 0;
    color: var(--text-secondary);
}

.sidebar ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(90, 90, 160, 0.1);
    transition: var(--transition);
    cursor: pointer;
}

.sidebar ul li:hover {
    color: var(--accent-light);
    padding-left: 0.5rem;
    border-bottom-color: var(--accent);
}

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

.sidebar p {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

/* ---------- 角色卡片 ---------- */
.character-card {
    background: linear-gradient(135deg, rgba(26, 26, 53, 0.9), rgba(20, 20, 46, 0.9));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    transition: var(--transition);
}

.character-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--accent);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.character-card img {
    border-radius: 50%;
    width: 120px;
    height: 120px;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid var(--border-color);
    transition: var(--transition);
}

.character-card:hover img {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    transform: scale(1.05);
}

.character-card h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.character-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.2rem 0;
}

.character-card p:last-child {
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* ---------- 平台介绍 ---------- */
.platform-section {
    background: rgba(20, 20, 46, 0.85);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 3rem;
    transition: var(--transition);
}

.platform-section:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.platform-section p {
    color: var(--text-primary);
    line-height: 1.8;
}

/* ---------- APP下载区 ---------- */
.download-section {
    text-align: center;
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(26, 26, 53, 0.9), rgba(20, 20, 46, 0.95));
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

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

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

.download-section h2 {
    border-left: none;
    font-size: 2rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.download-section p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.download-btn {
    display: inline-block;
    background: var(--accent-gradient);
    color: #ffffff;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    margin: 0.5rem;
    font-weight: bold;
    text-decoration: none;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.download-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
    color: #ffffff;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

/* ---------- 用户评论 ---------- */
.comment-card {
    background: var(--bg-card);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: var(--transition);
}

.comment-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-sm), var(--shadow-glow);
}

.comment-card p:first-child {
    color: var(--accent-light);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.comment-card p:nth-child(2) {
    color: var(--text-primary);
    line-height: 1.6;
}

.comment-card p:last-child {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* ---------- 底部 ---------- */
footer {
    background: rgba(10, 10, 24, 0.95);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.5;
}

footer div {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

footer p {
    color: var(--text-muted);
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

footer a {
    color: var(--accent-light);
    transition: var(--transition);
}

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

/* ---------- 动画增强 ---------- */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

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

/* 标题渐变动画 */
h1, h2 {
    background: linear-gradient(90deg, #f0f0ff, var(--accent-light), #f0f0ff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

/* ---------- 响应式设计 ---------- */

/* 平板 */
@media (max-width: 1024px) {
    header nav {
        justify-content: center;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        position: static;
        width: 100%;
    }
    
    main {
        padding: 1rem;
    }
    
    section h2 {
        font-size: 1.6rem;
    }
}

/* 手机 */
@media (max-width: 768px) {
    header {
        padding: 0.8rem 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header nav a {
        font-size: 0.9rem;
        padding: 0.3rem 0.5rem;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.8rem;
    }
    
    article h3 {
        font-size: 1rem;
    }
    
    article p {
        font-size: 0.8rem;
    }
    
    .download-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
    
    footer div {
        flex-direction: column;
        gap: 1rem;
    }
    
    .content-main {
        padding: 1rem;
    }
    
    .content-main h2 {
        font-size: 1.4rem;
    }
    
    .platform-section {
        padding: 1.5rem;
    }
    
    .download-section {
        padding: 1.5rem;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    article div {
        padding: 0.5rem;
    }
    
    article h3 {
        font-size: 0.9rem;
    }
    
    article p {
        font-size: 0.75rem;
    }
    
    article span {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
    
    section h2 {
        font-size: 1.3rem;
        padding-left: 0.6rem;
    }
    
    header nav div {
        gap: 0.3rem;
    }
    
    header nav a {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
}

/* ---------- 暗色模式适配 ---------- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0a0a14;
        --bg-secondary: #101024;
        --bg-card: rgba(20, 20, 50, 0.8);
        --text-primary: #e8e8f5;
        --text-secondary: #a0a0c0;
    }
}

/* ---------- 减少动画偏好 ---------- */
@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;
    }
}

/* ---------- 工具类 ---------- */
.text-gradient {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-shadow {
    box-shadow: var(--shadow-md);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* 滚动显示动画 */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }
    
    .reveal.visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载动画 */
@keyframes loading {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 焦点样式 - 无障碍 */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* 选区样式 */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: var(--text-primary);
}