/* ============================================
   清染导航 - 全局样式表
   从 index.html 提取，支持多主题切换
   ============================================ */

/* -------- 基础重置 -------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* -------- CSS 主题变量 -------- */
:root {
    --bg-gradient-start: #ffe6f0;
    --bg-gradient-end: #ffb6c1;
    --hero-bg: rgba(255, 255, 255, 0.9);
    --text-primary: #ff69b4;
    --text-secondary: #c96f8e;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(255, 255, 255, 0.6);
    --btn-bg: #ffe4ed;
    --btn-hover: #ff69b4;
    --tag-bg: #ffe4ed;
    --shadow: rgba(255, 105, 180, 0.2);
    --border-light: #ffc0cb;
    --section-text: #ffffff;
}

body.theme-sky {
    --bg-gradient-start: #c8e6ff;
    --bg-gradient-end: #aad2fa;
    --hero-bg: rgba(255, 255, 255, 0.85);
    --text-primary: #1e6fdf;
    --text-secondary: #4a6a8b;
    --card-bg: rgba(235, 248, 255, 0.92);
    --card-border: rgba(100, 180, 250, 0.3);
    --btn-bg: #e0f0ff;
    --btn-hover: #3b82f6;
    --tag-bg: #d4e8ff;
    --shadow: rgba(59, 130, 246, 0.2);
    --border-light: #b8d9ff;
    --section-text: #1a4a7a;
}

body.theme-light {
    --bg-gradient-start: #f5f7fa;
    --bg-gradient-end: #eef2f5;
    --hero-bg: rgba(255, 255, 255, 0.96);
    --text-primary: #d45a8c;
    --text-secondary: #6c757d;
    --card-bg: #ffffff;
    --card-border: rgba(221, 221, 221, 0.6);
    --btn-bg: #fef2f5;
    --btn-hover: #e96ba9;
    --tag-bg: #ffeef4;
    --shadow: rgba(0, 0, 0, 0.05);
    --border-light: #e9ecef;
    --section-text: #6c757d;
}

body.theme-dark {
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --hero-bg: rgba(30, 30, 46, 0.9);
    --text-primary: #ff79c6;
    --text-secondary: #b0b3c8;
    --card-bg: rgba(25, 25, 40, 0.92);
    --card-border: rgba(255, 255, 255, 0.15);
    --btn-bg: #2d2d44;
    --btn-hover: #ff79c6;
    --tag-bg: #2a2a40;
    --shadow: rgba(0, 0, 0, 0.3);
    --border-light: #2d2d44;
    --section-text: #cdd6f4;
}

body.theme-purple {
    --bg-gradient-start: #f3e6ff;
    --bg-gradient-end: #d9b8ff;
    --hero-bg: rgba(255, 255, 255, 0.92);
    --text-primary: #9b59b6;
    --text-secondary: #7d3c98;
    --card-bg: rgba(255, 245, 255, 0.95);
    --card-border: rgba(155, 89, 182, 0.2);
    --btn-bg: #f0e6ff;
    --btn-hover: #9b59b6;
    --tag-bg: #e8d5f5;
    --shadow: rgba(155, 89, 182, 0.2);
    --border-light: #c39bd3;
    --section-text: #6c3483;
}

/* -------- 布局 -------- */
body {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* -------- Hero 头部 -------- */
.hero {
    background: var(--hero-bg);
    backdrop-filter: blur(10px);
    border-radius: 48px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 20px 40px var(--shadow);
    border: 1px solid var(--card-border);
}

.hero h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--text-primary), #ff99cc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.hero p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* -------- 主题切换按钮 -------- */
.theme-switch-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.theme-btn {
    background: var(--btn-bg);
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 6px 16px;
    border-radius: 40px;
    color: var(--text-primary);
    font-weight: 500;
    transition: 0.2s;
}

.theme-btn:hover {
    opacity: 0.85;
}

.theme-btn.active {
    background: linear-gradient(135deg, var(--text-primary), #ff99cc);
    color: white;
    box-shadow: 0 2px 8px var(--shadow);
}

/* -------- 搜索框 -------- */
.search-box {
    max-width: 500px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid var(--border-light);
    border-radius: 50px;
    font-size: 16px;
    background: white;
    color: var(--text-primary);
}

.search-box input:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.2);
}

/* -------- 快速链接 -------- */
.quick-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.quick-btn {
    background: var(--hero-bg);
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: 0.3s;
    box-shadow: 0 2px 8px var(--shadow);
    backdrop-filter: blur(5px);
}

.quick-btn:hover {
    transform: translateY(-2px);
    background: var(--btn-hover);
    color: white;
}

/* -------- 分类标题 -------- */
.section-title {
    font-size: 1.5rem;
    color: var(--section-text);
    margin: 30px 0 20px;
    padding-left: 15px;
    border-left: 4px solid #ff99cc;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* -------- 卡片网格 -------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    border-radius: 28px;
    padding: 20px;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
    box-shadow: 0 8px 20px var(--shadow);
    border: 1px solid var(--card-border);
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px var(--shadow);
    background: var(--hero-bg);
}

.card-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--text-primary), #ff99cc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

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

.card-tag {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.7rem;
    background: var(--tag-bg);
    padding: 4px 12px;
    border-radius: 20px;
    color: var(--text-primary);
}

/* -------- 管理后台按钮 -------- */
.admin-entry {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    box-shadow: 0 4px 12px var(--shadow);
    transition: 0.3s;
}

.admin-entry:hover {
    background: var(--text-primary);
    color: white;
    transform: scale(1.1);
}

/* -------- 下载按钮 -------- */
.download-btn {
    background: linear-gradient(135deg, var(--text-primary), #ff99cc);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-top: 12px;
    transition: 0.2s;
    display: inline-block;
    text-decoration: none;
}

.download-btn:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* -------- 评论区预览 -------- */
.preview-section {
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    border-radius: 32px;
    padding: 25px;
    margin-top: 20px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.preview-header h3 {
    color: var(--text-primary);
}

.preview-header a {
    color: var(--text-primary);
    font-size: 0.9rem;
    text-decoration: none;
}

.preview-header a:hover {
    text-decoration: underline;
}

.comment-preview {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    align-items: flex-start;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, var(--text-primary), #ff99cc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.comment-body {
    flex: 1;
}

.comment-name {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.comment-time {
    font-size: 0.7rem;
    color: #d9a7b9;
}

/* -------- 页脚 -------- */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.9);
}

footer p {
    margin-bottom: 4px;
}

.beian-info {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.beian-info a {
    color: inherit;
    text-decoration: none;
    opacity: 0.8;
    transition: 0.2s;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.beian-info a:hover {
    opacity: 1;
    text-decoration: underline;
}

.beian-info img {
    height: 14px;
    width: auto;
    vertical-align: middle;
}

/* -------- 空状态 -------- */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    grid-column: 1 / -1;
}

/* -------- 响应式 -------- */
@media (max-width: 768px) {
    .hero {
        border-radius: 32px;
        padding: 20px 15px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

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

    .quick-links {
        gap: 10px;
    }
}
