/*! course-site styles — light default, dark via [data-theme="dark"] */
:root {
  --bg: #f4f6fa;
  --bg-hero: #e8eefc;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-2: #16a34a;
  --danger: #dc2626;
  --warn: #d97706;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --header-bg: rgba(244, 246, 250, 0.88);
  --input-bg: #ffffff;
  --code-bg: #0f172a;
  --code-fg: #7dd3fc;
  --float-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #0f1419;
  --bg-hero: #0b1020;
  --bg-soft: #161b22;
  --card: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #2f81f7;
  --accent-2: #3fb950;
  --danger: #f85149;
  --warn: #d29922;
  --header-bg: rgba(15, 20, 25, 0.82);
  --input-bg: #0d1117;
  --code-bg: #0d1117;
  --code-fg: #a5d6ff;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  --float-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: linear-gradient(180deg, var(--bg-hero) 0%, var(--bg) 280px);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #a371f7);
  display: grid; place-items: center; font-weight: 700; color: white;
}
.brand h1 { font-size: 16px; margin: 0; font-weight: 600; }
.brand p { margin: 0; color: var(--muted); font-size: 11px; }

.nav { display: flex; gap: 6px; align-items: center; }
.nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 13px;
  transition: all 0.15s ease;
}
.nav a:hover, .nav a.active {
  color: var(--accent); background: rgba(47, 129, 247, 0.1);
}

/* hero */
.hero {
  margin: 28px 0 8px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(circle at top right, rgba(47,129,247,.22), transparent 40%),
    var(--bg-soft);
}
.hero h2 { margin: 0 0 8px; font-size: 28px; }
.hero p { margin: 0; color: var(--muted); max-width: 640px; }
.hero-stats {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px;
}
.stat {
  background: color-mix(in srgb, var(--card) 88%, var(--accent));
  border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px; min-width: 110px;
}
.stat b { display: block; font-size: 20px; }
.stat span { color: var(--muted); font-size: 12px; }

/* toolbar */
.toolbar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin: 20px 0 16px;
}
.search-box { display: flex; flex: 1; min-width: 220px; }
.search-box input {
  flex: 1; border: 1px solid var(--border); background: var(--input-bg);
  color: var(--text); border-radius: 10px 0 0 10px; padding: 10px 12px; outline: none;
}
.search-box button, .btn {
  border: 1px solid var(--border); background: var(--accent); color: white;
  border-radius: 0 10px 10px 0; padding: 10px 14px; cursor: pointer; font-weight: 600;
}
.btn { border-radius: 10px; display: inline-block; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.toolbar select {
  border: 1px solid var(--border); background: var(--input-bg); color: var(--text);
  border-radius: 10px; padding: 10px 12px;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.chip {
  padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; background: var(--bg-soft);
  transition: all 0.15s ease;
}
.chip.active, .chip:hover {
  color: var(--accent); border-color: var(--accent);
  background: rgba(47,129,247,.08);
}

/* grid */
.section-title {
  display: flex; justify-content: space-between; align-items: end;
  margin: 28px 0 14px;
}
.section-title h3 { margin: 0; font-size: 18px; }
.section-title a { color: var(--muted); font-size: 13px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.load-status {
  text-align: center;
  padding: 18px 0 28px;
  color: var(--muted);
  font-size: 13px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card:hover { transform: translateY(-2px); border-color: rgba(47,129,247,.45); }
.cover-wrap {
  position: relative;
  flex-shrink: 0;
}
.cover {
  aspect-ratio: 3/4;
  background: color-mix(in srgb, var(--bg) 70%, var(--border));
  display: grid; place-items: center;
  color: var(--muted); font-size: 13px; text-align: center; padding: 12px;
  overflow: hidden;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.card-featured {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
  pointer-events: none;
  z-index: 1;
}
.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}
/* 标题固定两行高度，保证价格/按钮行对齐 */
.card h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  height: 2.8em; /* 2 行 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-body > a:first-child { display: block; }
.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}
/* 购物车按钮贴底，行内按钮高度一致 */
.card-cart-form {
  margin-top: auto;
  padding-top: 2px;
}
.card-cart-form .btn {
  width: 100%;
  height: 34px;
  line-height: 1.2;
  padding-top: 0;
  padding-bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.price { color: #ff7b72; font-weight: 700; font-size: 15px; }
.price del { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.badge {
  font-size: 11px; padding: 3px 8px; border-radius: 4px;
  border: 1px solid var(--border); color: var(--muted);
  background: var(--bg-soft);
}
.badge.on { color: var(--accent-2); border-color: rgba(63,185,80,.4); background: rgba(63,185,80,.1); }
.badge.sale { color: var(--warn); border-color: rgba(210,153,34,.4); background: rgba(210,153,34,.1); }

/* detail - 封面 | 信息 | 联系（并排两卡，卡内竖排） */
.detail { margin: 24px 0; }
.detail-header {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
}
.detail-cover {
  width: 100%;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 70%, var(--border));
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.detail-cover img { width: 100%; height: auto; aspect-ratio: 3/4; object-fit: cover; display: block; }
.detail-info {
  min-width: 0;
  padding-top: 2px;
}
.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  margin-bottom: 8px;
}
.title-row h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.35;
  min-width: 0;
}
.buy-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px dashed var(--border);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.detail-author { color: var(--muted); margin: 0 0 8px; font-size: 13px; }
.detail-tags { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.price-row { display: flex; align-items: baseline; gap: 10px; margin: 12px 0 0; }
.price-row .now { font-size: 28px; color: #ff7b72; font-weight: 800; letter-spacing: -0.02em; }
.price-row .old { color: var(--muted); text-decoration: line-through; font-size: 14px; }

.contact-side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 280px;
}
.contact-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  justify-content: flex-start;
}
.contact-card-v {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  min-width: 128px;
  text-align: center;
}
.contact-card-hd {
  font-size: 12px;
  color: var(--muted);
}
.contact-box .contact-qr,
.contact-card-v .contact-qr {
  width: 108px;
  height: 108px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
}
.contact-qr-fallback {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  background: var(--card);
}
.contact-card-v .contact-id {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.contact-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.contact-qr-fallback {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  background: var(--card);
}
.contact-id {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.contact-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  width: 100%;
  text-align: left;
}
.contact-tag {
  display: inline-block;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.4;
  flex-shrink: 0;
}
.desc {
  margin-top: 24px; padding: 24px; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; line-height: 1.8; font-size: 15px;
}
.desc img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
  display: block;
}
.desc h2 {
  font-size: 18px; margin: 24px 0 12px; color: var(--text);
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.desc h2:first-child { margin-top: 0; }
.desc h3 { font-size: 16px; margin: 16px 0 8px; color: var(--text); }
.desc p { margin: 0 0 12px; }
.desc ul, .desc ol { margin: 0 0 12px; padding-left: 1.5em; }
.desc li { margin: 0 0 6px; }
.desc a { color: var(--accent); text-decoration: underline; }
.desc a:hover { text-decoration: none; }
.progress-body {
  font-size: 15px; line-height: 1.85;
  white-space: pre-line;
}
.progress-list p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.7;
}
.progress-list a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}
.progress-list a:hover { text-decoration: underline; }

/* 前台更新进度：分组 + 柔和色块 */
.progress-board {
  display: grid;
  gap: 16px;
}
.progress-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.progress-group.group-updating {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, var(--card)), var(--card) 140px);
}
.progress-group.group-finished {
  border-color: color-mix(in srgb, var(--accent-2) 22%, var(--border));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-2) 4%, var(--card)), var(--card) 140px);
}
.progress-group-title {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 70%, var(--muted));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
  animation: live-pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.9); }
}
.group-count {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  margin-left: 6px;
}
.progress-head {
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.progress-search-box {
  min-width: min(280px, 100%);
  max-width: 360px;
  flex: 0 1 auto;
}
.progress-search-box input {
  min-width: 0;
}

/* 更新中：浅蓝卡片 */
.progress-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.progress-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  background: color-mix(in srgb, var(--accent) 3%, var(--bg-soft));
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.progress-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 8%, transparent);
}
.progress-card-cover {
  width: 48px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--bg) 70%, var(--border));
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  padding: 4px;
}
.progress-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.progress-card-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.progress-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.progress-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.pill-live {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: color-mix(in srgb, var(--accent) 75%, var(--text));
  font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
}
.pill-note {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-2) 8%, transparent);
  color: color-mix(in srgb, var(--accent-2) 70%, var(--text));
  border: 1px solid color-mix(in srgb, var(--accent-2) 16%, transparent);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill-note.muted {
  background: color-mix(in srgb, var(--muted) 8%, transparent);
  color: var(--muted);
  border-color: color-mix(in srgb, var(--muted) 18%, transparent);
}

/* 已完结：每门课不同柔和色相，便于区分 */
.progress-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.progress-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.progress-chip.is-finished {
  --chip-hue: 200;
  border: 1px solid hsl(var(--chip-hue) 35% 78%);
  background: hsl(var(--chip-hue) 45% 94%);
  color: hsl(var(--chip-hue) 40% 28%);
}
[data-theme="dark"] .progress-chip.is-finished {
  border-color: hsl(var(--chip-hue) 28% 32%);
  background: hsl(var(--chip-hue) 25% 18%);
  color: hsl(var(--chip-hue) 45% 82%);
}
.progress-chip.is-finished:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px hsl(var(--chip-hue) 40% 40% / 0.12);
  filter: saturate(1.05);
}
.progress-chip-title { font-weight: 500; }
.progress-chip-note {
  font-size: 11px;
  opacity: 0.75;
  white-space: nowrap;
}
.note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
}
.note-row-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
@media (max-width: 720px) {
  .note-row { grid-template-columns: 1fr; }
}
.progress-note {
  width: 100%;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  padding: 4px 2px;
}

/* 后台进度快捷列表 */
.quick-updating {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.quick-updating-item {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
}
.quick-updating-item .quick-course {
  flex: 1;
  text-align: left;
  border: none !important;
  justify-content: flex-start;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* list rows */
.list { display: grid; gap: 12px; }
.row {
  display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card);
  align-items: flex-start;
}
.row:hover { border-color: rgba(47,129,247,.4); }
.row-body { flex: 1; min-width: 0; }
.row h4 { margin: 0 0 6px; font-size: 16px; }
.row h4 a:hover { color: var(--accent); }
.row p { margin: 0; color: var(--muted); font-size: 13px; }
.row .date { color: var(--muted); font-size: 12px; white-space: nowrap; padding-top: 2px; }

.progress-card { align-items: flex-start; }
.progress-preview {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.progress-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-line + .progress-line { margin-top: 2px; }
.progress-more {
  margin-top: 6px;
  color: var(--accent);
  font-size: 12px;
}

/* cart */
.cart-link { position: relative; }
.cart-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}
.cart-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.cart-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.card-cart-form { margin-top: auto; padding-top: 2px; }
.card-cart-form .btn {
  width: 100%;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}
.card-cart-form .in-cart {
  opacity: 0.7;
  cursor: default;
  background: transparent;
  color: var(--muted);
}
.detail-cart-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.cart-row { align-items: center; gap: 12px; }
.cart-cover {
  width: 56px;
  height: 74px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 70%, var(--border));
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.cart-cover img { width: 100%; height: 100%; object-fit: cover; }
.cart-price { text-align: right; white-space: nowrap; }
.cart-summary {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cart-total { font-size: 14px; color: var(--muted); }
.contact-box textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  padding: 10px 12px;
  font-family: inherit;
  resize: vertical;
}

/* 首页「更新中」色块 */
.update-blocks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.update-block {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid hsl(var(--block-hue) 55% 80%);
  background: hsl(var(--block-hue) 70% 96%);
  color: hsl(var(--block-hue) 55% 28%);
  font-size: 13px;
  line-height: 1.35;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}
[data-theme="dark"] .update-block {
  border-color: hsl(var(--block-hue) 40% 32%);
  background: hsl(var(--block-hue) 35% 18%);
  color: hsl(var(--block-hue) 70% 78%);
}
.update-block:hover {
  transform: translateY(-1px);
  border-color: hsl(var(--block-hue) 60% 55%);
  box-shadow: 0 6px 16px hsl(var(--block-hue) 50% 40% / 0.15);
}
.update-block-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(var(--block-hue) 70% 50%);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px hsl(var(--block-hue) 70% 50% / 0.18);
}
.update-block-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.update-block-note {
  font-size: 12px;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* pagination */
.pagination {
  display: flex; gap: 8px; justify-content: center; align-items: center;
  margin: 28px 0; flex-wrap: wrap;
}
.pagination a, .pagination span {
  min-width: 36px; height: 36px; padding: 0 10px;
  display: inline-grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--border); color: var(--muted);
}
.pagination .current {
  background: rgba(47,129,247,.18); color: var(--text); border-color: rgba(47,129,247,.45);
}

/* footer */
.site-footer {
  margin-top: 48px; padding: 24px 0 40px;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 13px;
  text-align: center;
}

/* sidebar contact float */
.float-contact {
  position: fixed; right: 18px; bottom: 18px; z-index: 30;
  background: var(--accent); color: #fff; border-radius: 999px; border: none;
  padding: 12px 18px; box-shadow: var(--float-shadow); font-weight: 600; font-size: 14px;
  cursor: pointer;
}
.float-contact:hover { filter: brightness(1.08); }

.contact-mask {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(15, 23, 42, 0.45);
}
.contact-modal {
  position: fixed; z-index: 50; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100% - 28px));
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 18px 14px; box-shadow: var(--shadow);
}
.contact-modal-hd {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; font-size: 18px;
}
.contact-close {
  border: none; background: transparent; color: var(--muted);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.contact-close:hover { color: var(--text); }
.contact-modal-tip {
  margin: 0 0 14px; color: var(--muted); font-size: 13px;
}
.contact-modal-body {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
}
.contact-card {
  flex: 1 1 200px; max-width: 230px;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; text-align: center; background: var(--bg-soft);
}
.contact-card-title { font-size: 13px; margin-bottom: 10px; color: var(--muted); }
.contact-card .contact-qr {
  width: 160px; height: 160px; margin: 0 auto 10px;
}
.contact-qr-fallback {
  display: grid; place-items: center;
  border: 1px dashed var(--border); border-radius: 10px;
  color: var(--muted); font-size: 12px; line-height: 1.5;
  background: var(--card);
}
.contact-id { font-size: 13px; display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; }
.copy-btn {
  border: 1px solid var(--border); background: var(--card); color: var(--accent);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; cursor: pointer;
}
.copy-btn:hover { border-color: var(--accent); }
.contact-modal-foot {
  margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 12px;
}

/* theme toggle */
.theme-toggle {
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--muted);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 12px;
  line-height: 1; white-space: nowrap; transition: all 0.15s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); background: rgba(47, 129, 247, 0.08); }

/* contact panel */
.contact-panel {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start;
}
.contact-qr {
  width: 140px; height: 140px; border-radius: 12px; border: 1px solid var(--border);
  object-fit: cover; background: var(--bg-soft);
}
.contact-lines { flex: 1; min-width: 200px; }
.contact-lines p { margin: 0 0 8px; }
.contact-tag {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); margin-right: 6px;
}

/* rich text editor */
.rte-toolbar {
  display: flex; gap: 6px; flex-wrap: wrap;
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 10px 10px 0 0; padding: 8px;
  background: color-mix(in srgb, var(--card) 80%, var(--bg));
}
.rte-toolbar button {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 12px;
}
.rte-toolbar button:hover { border-color: var(--accent); color: var(--accent); }
.rte-editor {
  min-height: 220px; border: 1px solid var(--border); border-radius: 0 0 10px 10px;
  padding: 12px 14px; background: var(--input-bg); outline: none;
  line-height: 1.7; overflow-wrap: anywhere;
}
.rte-editor:focus { border-color: var(--accent); }
.rte-editor img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.rte-editor p { margin: 0 0 0.75em; }
.cover-preview-box {
  width: 120px;
  height: 160px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
}
.cover-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.desc img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.desc p { margin: 0 0 0.75em; }
.tag-chip {
  display: inline-block; font-size: 12px; padding: 2px 8px; margin: 0 6px 6px 0;
  border-radius: 999px; border: 1px solid var(--border); color: var(--muted);
}

/* admin */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 60px); }
.admin-side {
  border-right: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 92%, #000);
  padding: 16px 12px;
}
.admin-side-group {
  margin: 12px 8px 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: none;
}
.admin-side-group:first-child { margin-top: 0; }
.admin-side a {
  display: block; padding: 9px 12px; border-radius: 10px; color: var(--muted); margin-bottom: 2px;
  font-size: 13px;
}
.admin-side a.active, .admin-side a:hover {
  background: rgba(47,129,247,.15); color: var(--text);
}
.admin-main { padding: 24px; }
.cards-4 {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px;
}
.kpi {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
}
.kpi b { display: block; font-size: 28px; margin-bottom: 4px; }
.kpi span { color: var(--muted); font-size: 13px; }

.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.form-grid .full { grid-column: 1 / -1; }
label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
input[type=text], input[type=number], input[type=password], input[type=datetime-local], textarea, select {
  width: 100%; border: 1px solid var(--border); background: var(--input-bg);
  color: var(--text); border-radius: 10px; padding: 10px 12px; outline: none;
}
select { width: auto; }
textarea { min-height: 160px; resize: vertical; font-family: inherit; }
.checkbox-row { display: flex; gap: 18px; align-items: center; padding-top: 8px; }
.actions { display: flex; gap: 10px; margin-top: 16px; }

table.admin-table {
  width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
table.admin-table th, table.admin-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px;
}
table.admin-table th { color: var(--muted); background: color-mix(in srgb, var(--bg) 85%, #000); font-weight: 500; }
table.admin-table tr:last-child td { border-bottom: none; }

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: min(400px, 100%); background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; box-shadow: var(--shadow);
}
.login-card h2 { margin: 0 0 18px; }
.error {
  background: rgba(248,81,73,.12); border: 1px solid rgba(248,81,73,.35);
  color: #ffb1ad; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: 13px;
}
.empty {
  padding: 40px; text-align: center; color: var(--muted);
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.code {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; overflow: auto; font-family: ui-monospace, Consolas, monospace; font-size: 12px;
  color: var(--code-fg);
}

@media (max-width: 960px) {
  .detail-header {
    grid-template-columns: 160px minmax(0, 1fr);
  }
  .contact-side {
    grid-column: 1 / -1;
    min-width: 0;
  }
  .contact-pair { justify-content: center; }
}
@media (max-width: 640px) {
  .detail-header {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .detail-cover { width: min(220px, 70%); }
  .detail-info { text-align: center; width: 100%; }
  .title-row { justify-content: center; }
  .title-row h2 { font-size: 20px; }
  .detail-tags { justify-content: center; }
  .price-row { justify-content: center; }
  .contact-pair { flex-direction: column; align-items: center; }
  .contact-card-v { width: min(100%, 220px); }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { display: flex; gap: 8px; overflow: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; }
  .header-search { order: 3; max-width: 100%; margin: 8px 0 0; flex-basis: 100%; }
  .nav { flex-wrap: wrap; justify-content: center; }
}

/* 搜索框样式 */
/* search results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
}
.search-result-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
}
.search-result-item:last-child {
  border-bottom: none;
}
.search-result-item:hover {
  background: rgba(47, 129, 247, 0.08);
}
.search-result-cover {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.search-result-info {
  flex: 1;
  min-width: 0;
}
.search-result-title {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 4px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-author {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.search-no-result {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.search-loading {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
