/* ==========================================================
   galhub —— 极简资料库风格，支持 深色 / 浅色 双主题
   主题切换：html[data-theme="dark" | "light"]
   ========================================================== */

:root {
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC",
    "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* ---------- 深色（默认） ---------- */
:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1017;
  --bg-soft: #0f151e;
  --surface: #141b25;
  --surface-2: #1a2331;
  --line: #26313f;
  --line-strong: #35465c;
  --txt: #e8eef6;
  --txt-2: #c3cfdd;
  --muted: #8496ab;
  --accent: #5ee0bd;
  --accent-ink: #05201a;
  --accent-soft: #122a26;
  --blue: #78a9ff;
  --danger: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --cover-bg: linear-gradient(150deg, #1a2432, #0e141c);
  --ad-bg: linear-gradient(100deg, #14202c, #101821);
  --ad-border: #2b3c50;
  --header-bg: rgba(11, 16, 23, 0.82);
  --bg-hero: url('/covers/hero-narcissu.jpg');
  --hero-mask-1: rgba(11, 16, 23, 0.52);
  --hero-mask-2: rgba(11, 16, 23, 0.86);
  --hero-mask-3: #0b1017;
}

/* ---------- 浅色 ---------- */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f9;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --line: #e4e9f0;
  --line-strong: #cdd6e2;
  --txt: #16202c;
  --txt-2: #33414f;
  --muted: #65758a;
  --accent: #0e9f78;
  --accent-ink: #ffffff;
  --accent-soft: #e6f7f2;
  --blue: #2563eb;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.07);
  --cover-bg: linear-gradient(150deg, #eef2f7, #e2e8f0);
  --ad-bg: linear-gradient(100deg, #f7fafc, #eef3f8);
  --ad-border: #d5dfea;
  --header-bg: rgba(255, 255, 255, 0.85);
  --bg-hero: url('/covers/hero-narcissu.jpg');
  --hero-mask-1: rgba(246, 247, 249, 0.66);
  --hero-mask-2: rgba(246, 247, 249, 0.92);
  --hero-mask-3: #f6f7f9;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background-color: var(--bg);
  /* 游戏 CG 做底，从上往下渐变收进纯色，保证文字区可读 */
  background-image:
    linear-gradient(180deg,
      var(--hero-mask-1) 0%,
      var(--hero-mask-2) 34%,
      var(--hero-mask-3) 62%,
      var(--hero-mask-3) 100%),
    var(--bg-hero);
  background-size: cover, cover;
  background-position: center top, center 18%;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
  color: var(--txt);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 5px;
}
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---------- 顶栏 ---------- */
.top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--txt);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  flex: 0 0 auto;
}
.brand:hover { text-decoration: none; opacity: 0.85; }
.logo { font-size: 1.3rem; line-height: 1; }

.search {
  display: flex;
  gap: 8px;
  flex: 1 1 240px;
  max-width: 420px;
}
.search input {
  flex: 1;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--txt);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

button,
.btn {
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--txt);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
button:hover,
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); text-decoration: none; }

.nav {
  display: flex;
  gap: 4px;
  font-size: 0.9rem;
  margin-left: auto;
}
.nav a {
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}
.nav a:hover { color: var(--txt); background: var(--surface-2); text-decoration: none; }

/* ---------- 主题切换 ---------- */
.theme-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.theme-switch button {
  padding: 4px 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.3;
}
.theme-switch button:hover { background: transparent; color: var(--txt); }
.theme-switch button.on {
  background: var(--surface);
  color: var(--txt);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* ---------- 账号区（顶栏右侧） ---------- */
.user-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.user-link {
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.user-link:hover {
  color: var(--txt);
  border-color: var(--line-strong);
  background: var(--surface-2);
  text-decoration: none;
}
.user-link.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.user-link.primary:hover {
  background: var(--accent);
  color: var(--accent-ink);
  filter: brightness(1.08);
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--txt);
  font-size: 0.86rem;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip:hover { border-color: var(--accent); text-decoration: none; }

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 28px 72px;
}

/* ---------- 首页 hero ---------- */
.hero {
  padding: 8px 0 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.hero h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.hero p { margin: 3px 0; color: var(--muted); font-size: 0.93rem; }
.daily-line { color: var(--accent) !important; font-size: 0.86rem !important; font-variant-numeric: tabular-nums; }
.daily-line b { color: inherit; }

/* ---------- 筛选 ---------- */
.filters { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--line-strong); color: var(--txt); text-decoration: none; }
.chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.chip b { margin-left: 5px; font-weight: 500; opacity: 0.7; }
.result-line { color: var(--muted); margin: 0 0 16px; font-size: 0.9rem; }

/* ---------- 卡片网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--txt);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
  text-decoration: none;
}
.cover {
  aspect-ratio: 3 / 4;
  background: var(--cover-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.nopic-text { color: var(--muted); font-size: 0.8rem; opacity: 0.65; }

/* 价格角标：免费绿、付费深色 */
.price-tag {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.4;
  background: rgba(8, 12, 18, 0.78);
  color: #e8eef6;
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(4px);
  white-space: nowrap;
}
.price-tag.free {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

.card .meta { padding: 11px 13px 13px; }
.card h3 {
  margin: 0;
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .orig {
  margin: 3px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .sub { margin: 5px 0 0; font-size: 0.78rem; color: var(--muted); }

.tags { display: flex; gap: 5px; flex-wrap: wrap; margin: 8px 0 0; }
.tag {
  font-size: 0.71rem;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--txt-2);
  border: 1px solid var(--line);
}
.card .stats {
  margin: 9px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.empty {
  color: var(--muted);
  padding: 56px 0;
  text-align: center;
  grid-column: 1 / -1;
  font-size: 0.92rem;
}

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 5px; justify-content: center; margin-top: 38px; flex-wrap: wrap; }
.pg {
  min-width: 34px;
  text-align: center;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.87rem;
  font-variant-numeric: tabular-nums;
}
.pg:hover { border-color: var(--line-strong); color: var(--txt); text-decoration: none; }
.pg.on { background: var(--txt); color: var(--bg); border-color: var(--txt); font-weight: 700; }

/* ---------- 详情 ---------- */
.detail { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 4px; }
.detail-cover {
  width: 240px;
  flex: 0 0 240px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  background: var(--cover-bg);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1 1 300px; min-width: 0; }
.detail-info h1 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.detail-info .orig { color: var(--muted); margin: 0 0 18px; font-size: 0.92rem; }

.facts {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 7px 14px;
  margin: 0 0 16px;
  font-size: 0.9rem;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--txt-2); }

.desc, .downloads, .related { margin-top: 40px; }
.desc h2, .downloads h2, .related h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.desc-body { color: var(--txt-2); font-size: 0.94rem; line-height: 1.8; }

.dl-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.dl {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  transition: border-color 0.15s ease;
}
.dl:hover { border-color: var(--line-strong); }
.dl.dl-free { border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.dl.empty { color: var(--muted); justify-content: center; font-size: 0.9rem; }
.badge.free {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.72rem;
  padding: 2px 9px;
  border-radius: 999px;
}
.btn-free {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--accent-ink) !important;
  font-weight: 600;
}
.btn-free:hover { filter: brightness(1.08); background: var(--accent) !important; }
.provider { font-weight: 600; color: var(--txt); min-width: 72px; font-size: 0.92rem; }
.pw { font-size: 0.86rem; color: var(--muted); }
.note { font-size: 0.85rem; color: var(--muted); }
.btn-down {
  margin-left: auto;
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--txt);
  font-weight: 500;
  font-size: 0.88rem;
  transition: all 0.15s ease;
}
.btn-down:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
}
.card.mini h3 { padding: 9px 11px; font-size: 0.84rem; }

/* ---------- 官方购买 ---------- */
.official { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.btn-official {
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.93rem;
  border: 1px solid transparent;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.btn-official:hover { filter: brightness(1.07); text-decoration: none; }
.official .muted { font-size: 0.84rem; }

/* ---------- 表格 / 后台 ---------- */
.table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 0.89rem; }
.table th,
.table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.table tr:hover td { background: var(--surface); }

.page-head { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0 0 6px; font-size: 1.35rem; }
.page-head p { margin: 4px 0; color: var(--muted); font-size: 0.9rem; }

.admin-actions { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }
.ops { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.ops button { padding: 4px 10px; font-size: 0.79rem; }
.ops a { font-size: 0.83rem; }
button.danger { color: var(--danger); border-color: var(--line); }
button.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); }
button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border: 1px solid transparent;
  padding: 9px 20px;
}
button.primary:hover { filter: brightness(1.07); }

.badge { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid transparent; }
.badge.published { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.badge.hidden { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.badge.draft { background: var(--surface-2); color: var(--muted); }

.editor { margin-top: 30px; }
.editor h2, .list h2 { font-size: 1.05rem; margin: 0 0 12px; }
.work-form { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.work-form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; color: var(--muted); }
.work-form input,
.work-form textarea,
.work-form select {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--txt);
  font-family: inherit;
  font-size: 0.91rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.work-form input:focus,
.work-form textarea:focus,
.work-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0; }
legend { color: var(--muted); font-size: 0.83rem; padding: 0 7px; }
.link-row { display: grid; grid-template-columns: 100px 3fr 90px 1fr 96px; gap: 8px; margin-bottom: 8px; }
.link-row input,
.link-row select {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--txt);
  font-size: 0.85rem;
  font-family: inherit;
}

/* ---------- 登录 ---------- */
.login {
  max-width: 360px;
  margin: 64px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.login h1 { margin: 0 0 18px; font-size: 1.2rem; }
.login form { display: flex; flex-direction: column; gap: 14px; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 0.87rem; color: var(--muted); }
.login input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--txt);
  outline: none;
  font-family: inherit;
}
.login input:focus { border-color: var(--accent); }
.login h1 + p { margin-top: -8px; }
.login-more {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.login-more summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  list-style: none;
}
.login-more summary::-webkit-details-marker { display: none; }
.login-more summary::before { content: '＋ '; }
.login-more[open] summary::before { content: '－ '; }
.login-more summary:hover { color: var(--txt); }
.err { color: var(--danger); font-size: 0.88rem; }
.ok { color: var(--accent); font-size: 0.88rem; }

/* ---------- 公告条 ---------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  margin: 0 0 18px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  font-size: 0.9rem;
  color: var(--txt-2);
}
.notice-label {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  margin-top: 1px;
}
.notice-body { flex: 1; line-height: 1.7; min-width: 0; }
.notice-close {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.notice-close:hover { color: var(--txt); background: transparent; }

/* ---------- 文章 ---------- */
.art-list { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.art-card {
  display: block;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--txt);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.art-card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.art-card h3 { margin: 6px 0 6px; font-size: 1.08rem; font-weight: 650; line-height: 1.4; }
.art-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.art-time { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.art-summary { margin: 0 0 8px; color: var(--txt-2); font-size: 0.9rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.art-meta { margin: 0; font-size: 0.78rem; color: var(--muted); }

.badge.own { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.badge.user { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.badge.crawled { background: var(--surface-2); color: var(--muted); border-color: var(--line); }

.art { margin-top: 4px; }
.art h1 { margin: 8px 0 10px; font-size: 1.7rem; line-height: 1.3; letter-spacing: -0.01em; }
.art-lead { margin: 0 0 10px; color: var(--txt-2); font-size: 1rem; line-height: 1.7; padding-left: 12px; border-left: 3px solid var(--accent); }
.art-byline { margin: 0 0 20px; font-size: 0.82rem; color: var(--muted); }
.art-body { font-size: 0.97rem; line-height: 1.9; color: var(--txt-2); max-width: 76ch; }
.art-body p { margin: 0 0 1.1em; }
.art-source { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); word-break: break-all; }

/* ---------- 评论 ---------- */
.comments { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); }
.comments h2 {
  font-size: 0.95rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 16px;
}
.cmt-list { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 12px; }
.cmt { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.cmt.empty { text-align: center; color: var(--muted); font-size: 0.9rem; }
.cmt-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.cmt-head b { font-size: 0.9rem; }
.cmt-time { font-size: 0.75rem; color: var(--muted); }
.cmt-body { font-size: 0.92rem; color: var(--txt-2); line-height: 1.7; word-break: break-word; }
.cmt-form { display: flex; flex-direction: column; gap: 10px; max-width: 620px; }
.cmt-form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; color: var(--muted); }
.cmt-form input, .cmt-form textarea {
  padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--txt); font-family: inherit; font-size: 0.91rem; outline: none;
}
.cmt-form input:focus, .cmt-form textarea:focus { border-color: var(--accent); }
.cmt-form button { align-self: flex-start; }
.cmt-cell { max-width: 320px; font-size: 0.85rem; color: var(--txt-2); }

/* ---------- 广告位 ---------- */
.ads {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 22px;
}
.ad {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px dashed var(--ad-border);
  background: var(--ad-bg);
  color: var(--txt);
  transition: border-color 0.15s ease;
}
.ad:hover { text-decoration: none; border-color: var(--accent); }
.ad img { width: 72px; height: 48px; object-fit: cover; border-radius: 7px; flex: 0 0 72px; }
.ad-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ad-text b { font-size: 0.92rem; }
.ad-text span { font-size: 0.82rem; color: var(--muted); }
.ad-label {
  position: absolute;
  top: -8px;
  left: 12px;
  font-size: 0.66rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
  letter-spacing: 0.05em;
}
.ad-form { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; background: var(--surface); }

/* ---------- 页脚 ---------- */
footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
  margin-top: 56px;
}
footer p { margin: 4px 0; }
footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
footer a:hover { color: var(--txt); }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  main { padding: 22px 16px 48px; }
  .top { padding: 11px 16px; gap: 12px; }
  .search { order: 4; flex: 1 1 100%; max-width: none; }
  .nav { margin-left: 0; order: 3; }
  .user-nav { order: 2; }
  .theme-switch { order: 2; margin-left: auto; }
  .hero h1 { font-size: 1.3rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
  .detail-cover { width: 100%; flex: 1 1 100%; max-width: 230px; margin: 0 auto; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .link-row { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 56px 1fr; }
  .btn-down { margin-left: 0; width: 100%; text-align: center; }
}
