/* PDF 1.1 全局视觉规范：暗色默认 + 亮色可选，CSS 变量驱动 */
:root,
:root[data-theme="dark"] {
    --bg: #202020;
    --card: #2a2a2a;
    --input: #333333;
    --text: #e6e6e6;
    --text-muted: #9e9e9e;
    --border: #3a3a3a;
    --accent: #d63031;
    --accent-hover: #e74c3c;
    --shadow: rgba(0, 0, 0, 0.4);
    --header-bg: #1a1a1a;

    --font-stack: system-ui, "Segoe UI", Roboto, "Helvetica Neue", "Microsoft YaHei", sans-serif;
    --font-size-body: 14px;
    --font-size-badge: 12px;
    --font-size-title: 20px;

    --radius-card: 3px;
    --radius-btn: 3px;
    --gap-grid: 10px;
    --gap-filter: 16px;
    --page-pad-x: 20px;

    --header-h: 56px;
    --cols: 4; /* 1200-1599px，见响应式断点 */
}

:root[data-theme="light"] {
    --bg: #f5f5f5;
    --card: #ffffff;
    --input: #ebebeb;
    --text: #1f1f1f;
    --text-muted: #666666;
    --border: #dddddd;
    --accent: #d63031;
    --accent-hover: #c0392b;
    --shadow: rgba(0, 0, 0, 0.12);
    --header-bg: #ffffff;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-stack);
    font-size: var(--font-size-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }

button, input, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.site-main {
    max-width: 1920px;
    margin: 0 auto;
    padding: var(--gap-filter) var(--page-pad-x) 48px;
    min-height: calc(100vh - var(--header-h) - 120px);
}

h1, h2, h3 { margin: 0 0 12px; font-weight: 600; }
h1 { font-size: var(--font-size-title); }
h2 { font-size: 18px; }

.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.btn:hover { background: var(--input); }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.section-note {
    color: var(--text-muted);
    font-size: var(--font-size-body);
}

/* PDF 1.4 瀑布流占位（W2 实现具体卡片；此处仅定义列数与间距） */
.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: var(--gap-grid);
}

/* PDF 1.1 响应式断点：>=1600 6列 / 1200-1599 5列 / 900-1199 4列 / 600-899 3列 / <600 2列 */
@media (min-width: 1600px) { :root { --cols: 5; } }
@media (min-width: 1200px) and (max-width: 1599px) { :root { --cols: 4; } }
@media (min-width: 900px) and (max-width: 1199px) { :root { --cols: 3; } }
@media (min-width: 600px) and (max-width: 899px) { :root { --cols: 3; } }
@media (max-width: 599px) { :root { --cols: 2; } }

/* 首页组件（PDF P1） */
.hero {
    text-align: center;
    padding: 56px 0 40px;
}
.hero-title {
    font-size: 36px;
    margin-bottom: 20px;
}
.hero-search {
    display: flex;
    max-width: 720px;
    margin: 0 auto;
    gap: 8px;
}
.hero-search-input {
    flex: 1;
    padding: 12px 18px;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 999px;
    outline: none;
}
.hero-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(214, 48, 49, .2);
}
.hero-search-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}
.hero-subtitle {
    margin-top: 14px;
    color: var(--text-muted);
}

.ai-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    margin: 24px 0;
    background: linear-gradient(90deg, var(--card), var(--input));
    border-radius: var(--radius-card);
    border-left: 3px solid var(--accent);
}
.ai-banner h2 { font-size: 18px; margin-bottom: 4px; }
.ai-banner p { margin: 0; color: var(--text-muted); }

.category-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-grid);
    margin: 24px 0;
}
.category-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 24px;
    background: var(--card);
    border-radius: var(--radius-card);
    transition: transform .15s, box-shadow .15s;
}
.category-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--shadow);
}
.category-card-title { font-size: 18px; font-weight: 600; }
.category-card-sub { color: var(--text-muted); font-size: var(--font-size-badge); }

.tag-cloud { margin: 32px 0; }
.tag-cloud-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
    display: inline-block;
    padding: 4px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: var(--font-size-badge);
}
.tag-pill:hover { border-color: var(--accent); }
.tag-cloud-note { margin-top: 12px; color: var(--text-muted); }

.latest-preview, .forum-preview { margin: 32px 0; }
.latest-more { text-align: center; margin-top: 20px; }

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--header-bg);
}
.footer-inner {
    max-width: 1920px;
    margin: 0 auto;
    padding: 20px var(--page-pad-x);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { font-size: var(--font-size-badge); color: var(--text-muted); }
.footer-note { margin: 12px 0 0; color: var(--text-muted); font-size: var(--font-size-badge); }

/* 弹层（NSFW 年龄确认） */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-dialog {
    width: min(420px, 90vw);
    padding: 24px;
    background: var(--card);
    border-radius: var(--radius-card);
    box-shadow: 0 12px 32px var(--shadow);
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* 占位页 */
.placeholder-main { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.placeholder-card {
    padding: 40px 60px;
    background: #1c1c1c;
    border: 1px solid #2e2e2e;
    border-radius: 4px;
    text-align: center;
}
.placeholder-card h1 { margin: 0 0 10px; color: #e8e8e8; font-size: 24px; font-weight: 600; }
.placeholder-card p { margin: 0 0 18px; color: #8a969c; font-size: 13px; }
.placeholder-back {
    display: inline-block;
    padding: 8px 22px;
    background: linear-gradient(180deg, #2c5860, #1b3c44);
    border: 1px solid #10262c;
    border-radius: 3px;
    color: #dce8ea;
    font-size: 13px;
}
.placeholder-back:hover { color: #fff; }
