/* ===================================
   六零导航页主题商店 - 样式表
   Theme Store for LyLme Spage
   =================================== */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-bg: #eef2ff;
    --secondary: #ec4899;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --bg: #f8fafc;
    --bg-alt: #f1f5f9;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.15);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-blue: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);

    --header-h: 64px;
    --max-w: 1280px;
}

/* ===== Reset ===== */
* { 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", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; font-size: inherit; }

/* ===== Container ===== */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Header / Nav ===== */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
    display: flex;
    align-items: center;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 20px; font-weight: 700; color: var(--text);
}
.logo:hover { color: var(--text); }
.logo-text-mobile { display: none; }
@media (max-width: 768px) {
    .logo-text-desktop { display: none; }
    .logo-text-mobile { display: inline; }
}
.logo-icon {
    width: 36px; height: 36px;
    background: var(--gradient);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px; font-weight: 800;
}
.nav-links {
    display: flex; align-items: center; gap: 28px;
    list-style: none;
}
.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-search {
    position: relative;
}
.nav-search input {
    width: 240px;
    padding: 8px 16px 8px 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-alt);
    color: var(--text);
    transition: all .2s;
}
.nav-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.nav-search svg {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--text-muted);
    pointer-events: none;
}
.nav-actions { display: flex; align-items: center; gap: 12px; }
.btn-admin {
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all .2s;
}
.btn-admin:hover { border-color: var(--primary); color: var(--primary); }

/* ===== Hero ===== */
.hero {
    background: linear-gradient(180deg, var(--primary-bg) 0%, var(--bg) 100%);
    padding: 56px 0 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -100px; left: 50%; transform: translateX(-50%);
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero h1 {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}
.hero p {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
    position: relative;
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 36px;
    position: relative;
}
.hero-stat { text-align: center; }
.hero-stat .num {
    font-size: 28px; font-weight: 800; color: var(--text);
}
.hero-stat .label {
    font-size: 13px; color: var(--text-muted); margin-top: 4px;
}

/* ===== Toolbar ===== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 24px 0 20px;
}
.toolbar-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 12px; }
.filter-chips {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.chip {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .2s;
    background: var(--card-bg);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.chip .count { font-size: 11px; opacity: 0.7; }
.sort-select {
    padding: 6px 32px 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* ===== Theme Grid ===== */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 24px;
    padding: 8px 0 48px;
}

/* ===== Theme Card ===== */
.theme-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all .3s cubic-bezier(0.4,0,0.2,1);
    position: relative;
    display: flex;
    flex-direction: column;
}
.theme-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}
.card-thumb {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--bg-alt);
}
.card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.theme-card:hover .card-thumb img { transform: scale(1.05); }
.card-thumb-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--gradient);
    color: #fff; font-size: 48px; font-weight: 800;
    letter-spacing: -2px;
}
.card-badges {
    position: absolute;
    top: 12px; left: 12px;
    display: flex; gap: 6px;
    z-index: 2;
}
.badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    backdrop-filter: blur(4px);
}
.badge-featured { background: rgba(245,158,11,0.9); }
.badge-free { background: rgba(16,185,129,0.9); }
.badge-paid { background: rgba(236,72,153,0.9); }
.badge-new { background: rgba(99,102,241,0.9); }

/* 评论状态徽章 */
.status-1 { background: rgba(16,185,129,0.9); }   /* 已显示 */
.status-0 { background: rgba(148,163,184,0.9); }   /* 已隐藏 */
.status-2 { background: rgba(245,158,11,0.95); }    /* 待审核 */

/* 后台评论管理标签 */
.comment-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.comment-tab {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-alt);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border-light);
    transition: all .15s ease;
}
.comment-tab:hover { color: var(--text); }
.comment-tab.active { background: var(--primary, #6366f1); color: #fff; border-color: transparent; }

.comment-content {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* 后台侧边栏待审核角标 */
.menu-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    padding: 0 5px;
    border-radius: 9px;
}

.card-actions {
    position: absolute;
    top: 12px; right: 12px;
    display: flex; gap: 6px;
    opacity: 0;
    transition: opacity .3s;
    z-index: 2;
}
.theme-card:hover .card-actions { opacity: 1; }
.card-action-btn {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(4px);
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .2s;
    color: var(--text-secondary);
}
.card-action-btn:hover { background: var(--primary); color: #fff; }
.card-action-btn svg { width: 18px; height: 18px; }

.card-body {
    padding: 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}
.card-title a { color: inherit; }
.card-title a:hover { color: var(--primary); }
.card-version {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
    flex: 1;
}
.card-tags {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 14px;
}
.card-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-alt);
    color: var(--text-muted);
}
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}
.card-author {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-secondary);
}
.author-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
}
.card-meta {
    display: flex; align-items: center; gap: 12px;
    font-size: 12px; color: var(--text-muted);
}
.card-meta span { display: flex; align-items: center; gap: 3px; }
.card-meta svg { width: 14px; height: 14px; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    line-height: 1.4;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-gradient {
    background: var(--gradient);
    color: #fff;
}
.btn-gradient:hover { color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; }

/* ===== Detail Page ===== */
.detail-hero {
    background: var(--primary-bg);
    padding: 40px 0;
}
.detail-hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.detail-gallery {
    position: relative;
}
.gallery-main {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--bg-alt);
    aspect-ratio: 16/10;
    max-height: min(70vh, 600px);
    cursor: zoom-in;
}
.gallery-main img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity .25s;
}
.gallery-main img.is-loading { opacity: 0; }
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px; height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.45);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 3;
    transition: background .2s;
    backdrop-filter: blur(2px);
}
.gallery-nav:hover { background: rgba(15, 23, 42, 0.7); }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-thumbs {
    display: flex; gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.gallery-thumb {
    flex-shrink: 0;
    width: 100px; height: 62px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .2s;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--primary); }
.gallery-thumb:hover { border-color: var(--primary-light); }

.detail-info h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text);
}
.detail-info .desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.7;
}
.detail-info { overflow-wrap: break-word; word-break: break-word; }
.detail-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.meta-item {
    display: flex; align-items: center; gap: 10px;
    font-size: 14px;
}
.meta-item .meta-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}
.meta-item .meta-icon svg { width: 18px; height: 18px; }
.meta-item .meta-label { font-size: 12px; color: var(--text-muted); }
.meta-item .meta-value { font-size: 14px; font-weight: 600; color: var(--text); }
.detail-actions {
    display: flex; gap: 12px; flex-wrap: wrap;
}

/* Detail body */
.detail-body {
    padding: 40px 0 60px;
}
.detail-body .container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}
/* 详情页分区标题（模板生成）：左侧渐变竖条 + 浅底块，与文档内 h2 区分 */
.detail-content > h2 {
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    margin: 36px 0 18px;
    padding: 11px 14px;
    background: var(--primary-bg);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.detail-content > h2::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--gradient);
    flex-shrink: 0;
}
.detail-content > h2:first-child { margin-top: 0; }
.detail-content p {
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.8;
}

/* 主题文档（Markdown / HTML 渲染） */
.doc-content {
    color: var(--text-secondary);
    line-height: 1.85;
    font-size: 15.5px;
    word-break: break-word;
}
.doc-content > *:first-child { margin-top: 0; }
.doc-content > *:last-child { margin-bottom: 0; }

/* 主题文档折叠：超过高度则遮罩 + 「显示更多」 */
.doc-collapsible {
    max-height: 260px;
    overflow: hidden;
    position: relative;
    transition: max-height .3s ease;
}
.doc-collapsible.expanded { max-height: none; }
.doc-collapsible:not(.expanded)::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 64px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(127,127,127,0), var(--card-bg));
}
.doc-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    padding: 9px 24px;
    border: none;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .3px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.doc-toggle::after {
    content: '▾';
    font-size: 12px;
    transition: transform .2s ease;
}
.doc-collapsible.expanded + .doc-toggle::after { transform: rotate(180deg); }
.doc-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(99, 102, 241, 0.35);
    filter: brightness(1.04);
}
.doc-toggle:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25); }

.doc-content h1, .doc-content h2, .doc-content h3,
.doc-content h4, .doc-content h5, .doc-content h6 {
    color: var(--text);
    font-weight: 700;
    line-height: 1.4;
    margin: 34px 0 16px;
    scroll-margin-top: calc(var(--header-h) + 24px);
}
.doc-content h1 { font-size: 28px; letter-spacing: -0.3px; }
.doc-content h2 {
    font-size: 22px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.doc-content h2::after {
    content: '';
    position: absolute;
    left: 0; bottom: -1px;
    width: 56px; height: 3px;
    border-radius: var(--radius-full);
    background: var(--gradient);
}
.doc-content h3 { font-size: 19px; }
.doc-content h4 { font-size: 17px; }

.doc-content p { margin-bottom: 16px; }
.doc-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all .2s;
}
.doc-content a:hover { color: var(--primary-dark); border-bottom-color: var(--primary-light); }

.doc-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 14px 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.doc-content blockquote {
    margin: 22px 0;
    padding: 14px 18px;
    border-left: 4px solid var(--primary);
    background: linear-gradient(90deg, var(--primary-bg), transparent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}
.doc-content blockquote > *:last-child { margin-bottom: 0; }

.doc-content ul, .doc-content ol { margin: 0 0 16px 1.4em; padding: 0; }
.doc-content li { margin-bottom: 8px; }
.doc-content ul li::marker { color: var(--primary); }
.doc-content ol li::marker { color: var(--primary); font-weight: 600; }

.doc-content hr { border: none; border-top: 1px solid var(--border); margin: 30px 0; }

.doc-content code {
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    background: var(--primary-bg);
    color: #be185d;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.88em;
    border: 1px solid rgba(99,102,241,0.14);
}

.doc-content pre.code-block {
    background: #0f172a;
    color: #e2e8f0;
    padding: 0;
    border-radius: var(--radius);
    overflow: hidden;
    margin: 22px 0;
    border: 1px solid #1e293b;
    box-shadow: var(--shadow-md);
}
.doc-content pre.code-block code {
    display: block;
    background: none;
    color: inherit;
    border: none;
    padding: 18px 20px;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.7;
}
.doc-content pre.code-block code::-webkit-scrollbar { height: 8px; }
.doc-content pre.code-block code::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.doc-content pre.code-block code::-webkit-scrollbar-track { background: transparent; }

/* 防止 Grid/Flex 子项被内部宽内容（表格/代码块）撑破视口 */
.detail-content, .detail-sidebar, .detail-gallery, .detail-info { min-width: 0; }

.doc-content table.md-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    margin: 22px 0;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.doc-content table.md-table th, .doc-content table.md-table td {
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    padding: 11px 14px;
    text-align: left;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.doc-content table.md-table th:last-child,
.doc-content table.md-table td:last-child { border-right: none; }
.doc-content table.md-table tr:last-child td { border-bottom: none; }
.doc-content table.md-table th {
    background: var(--bg-alt);
    color: var(--text);
    font-weight: 600;
}
.doc-content table.md-table tbody tr { transition: background .15s; }
.doc-content table.md-table tbody tr:hover { background: var(--primary-bg); }
.doc-content table.md-table tr:nth-child(even) td { background: rgba(127,127,127,0.03); }

/* 文档页：单栏居中 + 文章卡片布局 */
.doc-page .container { grid-template-columns: 1fr; }
.doc-page .detail-content {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 44px 48px;
}
.doc-page-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
    font-size: 13px;
    color: var(--text-muted);
}
.doc-label-tag {
    display: inline-flex;
    align-items: center;
    background: var(--primary-bg);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
}
.doc-label-name { font-weight: 500; color: var(--text-secondary); }
.doc-page .detail-content > p:last-of-type { margin-bottom: 0; }

@media (max-width: 640px) {
    .doc-page .detail-content { padding: 24px 20px; border-radius: var(--radius); }
    .doc-content h2 { font-size: 20px; }
}
.feature-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.feature-list li {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: var(--text-secondary);
    padding: 8px 12px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
}
.feature-list li::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}
.changelog-box {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    line-height: 1.8;
}
.detail-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 24px);
}
.sidebar-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
}
.sidebar-card h3 {
    font-size: 16px; font-weight: 700;
    margin-bottom: 16px;
}
.sidebar-info-row {
    display: flex; justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.sidebar-info-row:last-child { border-bottom: none; }
.sidebar-info-row .label { color: var(--text-muted); }
.sidebar-info-row .value { font-weight: 600; color: var(--text); }

/* 侧边栏「本页章节」锚点导航 */
.toc-card { padding-bottom: 16px; }
.toc-nav { display: flex; flex-direction: column; gap: 2px; }
.toc-link {
    position: relative;
    display: block;
    padding: 8px 12px 8px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.toc-link:hover {
    color: var(--primary);
    background: var(--primary-bg);
}
.toc-link.active {
    color: var(--primary-dark);
    font-weight: 600;
    background: var(--primary-bg);
    border-left-color: var(--primary);
}

/* 章节标题锚点：避免被吸顶头部遮挡 */
.detail-content h2 { scroll-margin-top: calc(var(--header-h) + 24px); }

/* Rating stars */
.rating-stars { display: inline-flex; gap: 2px; }
.rating-stars svg { width: 16px; height: 16px; }
.star-filled { color: #f59e0b; }
.star-empty { color: var(--text-light); }

/* ===== Preview Page ===== */
.preview-bar {
    position: fixed; top: 0; left: 0; right: 0;
    height: 56px;
    background: #1e293b;
    display: flex; align-items: center;
    padding: 0 20px;
    z-index: 1000;
    justify-content: space-between;
}
.preview-bar .preview-info {
    display: flex; align-items: center; gap: 12px;
    color: #fff;
}
.preview-bar .preview-info .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.5;} }
.preview-bar .preview-actions { display: flex; gap: 10px; }
.preview-bar .btn { padding: 7px 16px; font-size: 13px; }
.preview-frame {
    margin-top: 56px;
    width: 100%;
    height: calc(100vh - 56px);
    border: none;
    background: #fff;
}

/* ===== Pagination ===== */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 6px;
    padding: 24px 0 48px;
}
.pagination a, .pagination span {
    min-width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--card-bg);
    transition: all .2s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ===== Footer ===== */
.site-footer {
    background: #0f172a;
    color: var(--text-light);
    padding: 48px 0 24px;
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}
.footer-brand h3 {
    color: #fff; font-size: 20px; margin-bottom: 12px;
}
.footer-brand p { font-size: 14px; line-height: 1.7; max-width: 320px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--text-light); font-size: 14px; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Empty / Error ===== */
.empty-state, .error-page {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.empty-state svg, .error-page h1 {
    margin-bottom: 16px;
}
.error-page h1 {
    font-size: 72px; font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== Admin ===== */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    min-height: calc(100vh - var(--header-h));
}
.admin-sidebar {
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
}
.admin-menu { list-style: none; padding: 0 12px; }
.admin-menu li { margin-bottom: 4px; }
.admin-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px; font-weight: 500;
    transition: all .2s;
}
.admin-menu a:hover { background: var(--bg-alt); color: var(--text); }
.admin-menu a.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.admin-menu svg { width: 20px; height: 20px; }
.admin-content {
    padding: 28px 32px;
}
.admin-page-title {
    font-size: 24px; font-weight: 700; margin-bottom: 24px;
    display: flex; align-items: center; justify-content: space-between;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex; align-items: center; gap: 16px;
    transition: all .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    flex-shrink: 0;
}
.stat-icon svg { width: 26px; height: 26px; }
.stat-icon.purple { background: var(--gradient); }
.stat-icon.blue { background: var(--gradient-blue); }
.stat-icon.green { background: var(--success); }
.stat-icon.orange { background: var(--warning); }
.stat-info .num { font-size: 28px; font-weight: 800; color: var(--text); }
.stat-info .label { font-size: 13px; color: var(--text-muted); }

/* Admin table */
.admin-table-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-alt);
    white-space: nowrap;
}
.admin-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-alt); }
.admin-table .theme-thumb {
    width: 64px; height: 40px;
    border-radius: 6px;
    object-fit: cover;
}
.admin-table .theme-thumb-placeholder {
    width: 64px; height: 40px;
    border-radius: 6px;
    background: var(--gradient);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 11px; font-weight: 700;
}
.table-actions { display: flex; gap: 6px; }
.table-actions .btn { padding: 5px 12px; font-size: 12px; }

/* Forms */
.form-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 20px;
}
.form-card h3 {
    font-size: 17px; font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}
.form-group {
    margin-bottom: 18px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 18px;
}
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.form-label .req { color: var(--danger); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: var(--card-bg);
    transition: all .2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-switch {
    display: inline-flex; align-items: center; gap: 10px;
    cursor: pointer;
}
.form-switch input { display: none; }
.form-switch .switch-track {
    width: 44px; height: 24px;
    border-radius: var(--radius-full);
    background: var(--border);
    position: relative;
    transition: background .2s;
}
.form-switch .switch-thumb {
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
    box-shadow: var(--shadow-sm);
}
.form-switch input:checked + .switch-track { background: var(--primary); }
.form-switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--bg-alt);
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
}
.upload-zone svg { width: 32px; height: 32px; color: var(--text-muted); margin-bottom: 8px; }
.upload-zone p { font-size: 14px; color: var(--text-secondary); }
.upload-zone .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Existing screenshots preview */
.existing-shots {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-top: 12px;
}
.existing-shot {
    position: relative;
    width: 120px; height: 75px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
.existing-shot img { width: 100%; height: 100%; object-fit: cover; }
.existing-shot .remove {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(239,68,68,0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}

/* Login */
.login-wrap {
    max-width: 400px;
    margin: 60px auto;
}
.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 36px;
    box-shadow: var(--shadow-md);
}
.login-card h2 {
    text-align: center; margin-bottom: 8px;
}
.login-card .subtitle {
    text-align: center; color: var(--text-muted); margin-bottom: 28px;
    font-size: 14px;
}
.login-error {
    background: #fef2f2;
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid #fecaca;
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px; right: 24px;
    padding: 14px 20px;
    border-radius: var(--radius);
    background: var(--text);
    color: #fff;
    font-size: 14px;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    animation: toastIn .3s ease;
}
@keyframes toastIn { from{transform:translateY(20px);opacity:0;} to{transform:translateY(0);opacity:1;} }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 40px;
}
.lightbox.active { display: flex; }
.lightbox img {
    max-width: 90%; max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
}
.lightbox-close {
    position: absolute; top: 20px; right: 20px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: none; color: #fff;
    font-size: 24px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* ===== 用户评价（评论 + 评分） ===== */
.review-section { margin-top: 36px; }
.review-section h2 { margin-bottom: 16px; }

.rating-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 20px;
}
.rating-summary { display: flex; align-items: center; gap: 12px; }
.rating-score { font-size: 34px; font-weight: 800; color: var(--text); line-height: 1; }
.rating-stars-display { color: #d1d5db; font-size: 18px; letter-spacing: 1px; }
.rating-stars-display .star-ic.on { color: #f59e0b; }
.rating-count { font-size: 13px; color: var(--text-muted); }
/* 评分人数不足 10 人时的提示 */
.rating-score.rating-insufficient,
.rating-count.rating-insufficient {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-alt);
    border: 1px solid var(--border-light);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    line-height: 1.4;
}

.rating-my { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rating-my-label { font-size: 14px; color: var(--text-muted); }
.rating-input { display: inline-flex; gap: 2px; }
.rating-input .star {
    font-size: 28px; line-height: 1;
    color: #d1d5db; cursor: pointer;
    transition: color .12s, transform .12s;
    user-select: none;
}
.rating-input .star:hover { transform: scale(1.15); }
.rating-input .star.lit { color: #f59e0b; }
.rating-my-hint { font-size: 13px; color: var(--primary); min-width: 80px; }

/* 评论表单：卡片式、更清爽的输入体验 */
.comment-form {
    background: var(--card-bg);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
    transition: box-shadow .2s ease;
}
.comment-form:hover {
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.06));
}
.review-identity {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.4fr;
    gap: 16px;
    margin-bottom: 16px;
}
.review-identity label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    gap: 8px;
}
.review-identity .field-label {
    min-height: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.review-identity .req { color: #ef4444; margin-left: 2px; }
.review-identity input,
.comment-form textarea {
    width: 100%;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md);
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg, #fff);
    color: var(--text);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.review-identity input::placeholder,
.comment-form textarea::placeholder {
    color: var(--text-light, #9ca3af);
}
.review-identity input:hover,
.comment-form textarea:hover {
    border-color: var(--primary-light, #a5b4fc);
}
.review-identity input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
}
.comment-form textarea {
    resize: vertical;
    min-height: 110px;
    margin-bottom: 14px;
    line-height: 1.65;
}
.comment-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.form-msg {
    font-size: 13px;
    color: var(--text-muted);
    min-height: 18px;
}
.form-msg.error { color: #ef4444; font-weight: 500; }
.form-msg.ok { color: #16a34a; font-weight: 500; }

/* 响应式：表单三列在小屏幕堆叠 */
@media (max-width: 720px) {
    .review-identity { grid-template-columns: 1fr; }
    .comment-form { padding: 18px; }
    .comment-form-foot { flex-direction: column; align-items: stretch; }
    .comment-form-foot .btn { width: 100%; justify-content: center; }
}

.comment-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.comment-item { display: flex; flex-direction: column; gap: 12px; }
.comment-main { display: flex; gap: 12px; }
.comment-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--bg-alt, #f1f5f9);
    object-fit: cover;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.comment-nick { font-weight: 600; color: var(--text); }
.comment-site {
    font-size: 12px; color: var(--primary);
    text-decoration: none;
    border: 1px solid var(--primary);
    border-radius: 999px;
    padding: 1px 8px;
}
.comment-site:hover { background: var(--primary); color: #fff; }
.comment-date { font-size: 12px; color: var(--text-muted); }
.comment-text { font-size: 14px; line-height: 1.7; color: var(--text); margin: 0; white-space: pre-wrap; word-break: break-word; }

/* 评论操作（回复按钮） */
.comment-actions { margin-top: 6px; display: flex; align-items: center; gap: 12px; }
.comment-reply-btn {
    display: inline-flex; align-items: center; gap: 4px;
    border: none; background: transparent; cursor: pointer;
    font-size: 13px; color: var(--text-muted); padding: 2px 0;
    transition: color .15s;
}
.comment-reply-btn:hover { color: var(--primary); }

/* 嵌套回复 */
.comment-replies {
    list-style: none; display: flex; flex-direction: column; gap: 14px;
    margin: 2px 0 0 22px; padding-left: 16px;
    border-left: 2px solid var(--border, #e5e7eb);
}
.comment-reply-item .comment-avatar { width: 32px; height: 32px; }
.comment-reply-item .comment-text { font-size: 13.5px; }
.comment-reply-to {
    font-size: 12px; color: var(--text-muted); margin-left: 2px;
    background: var(--bg-alt, #f1f5f9); padding: 1px 8px; border-radius: 999px;
}

/* 移动端表单内的回复框（被 JS 移动到评论下） */
.reply-form-wrap { margin-top: 12px; }
.reply-form-wrap[hidden] { display: none; }
.comment-form-reply { padding: 16px; background: var(--bg-alt, #f8fafc); }
.comment-form-reply textarea { min-height: 70px; margin-bottom: 10px; }
.reply-form-actions { display: flex; gap: 10px; justify-content: flex-end; }

.comment-empty { color: var(--text-muted); font-size: 14px; text-align: center; padding: 20px 0; }

@media (max-width: 768px) {
    .rating-card { flex-direction: column; align-items: flex-start; }
    .review-identity { grid-template-columns: 1fr; }
    .comment-form-foot { flex-direction: column; align-items: stretch; }
    .comment-form-foot .btn { width: 100%; }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .detail-hero .container { grid-template-columns: 1fr; }
    .detail-body .container { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-search input { width: 160px; }
    .hero h1 { font-size: 30px; }
    .hero p { font-size: 15px; }
    .hero-stats { gap: 24px; }
    .theme-grid { grid-template-columns: 1fr; }
    .feature-list { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
    .admin-content { padding: 20px 16px; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .detail-meta { grid-template-columns: 1fr; }
    .detail-info h1 { font-size: 26px; }
    .sidebar-info-row .value { word-break: break-word; }
}
span.badge.badge-price {
    font-size: 16px;
    padding: 0 2px;
}