/* ============================================================
   别人家的试卷 · 设计系统
   概念：试卷纸（暖白/方格）+ 朱红批改笔 + 宋体大字
   ============================================================ */

:root {
  --paper: #f5f0e4;
  --paper-deep: #efe8d8;
  --card: #fffdf7;
  --ink: #17150f;
  --ink-2: #3b382f;
  --muted: #837c6b;
  --line: #e2d9c6;
  --line-soft: #ece4d4;
  --red: #b3352a;
  --red-deep: #8e251c;
  --red-soft: #fbede9;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 0 rgba(23, 21, 15, 0.04), 0 2px 6px rgba(23, 21, 15, 0.04);
  --shadow-md: 0 2px 4px rgba(23, 21, 15, 0.05), 0 14px 30px rgba(23, 21, 15, 0.09);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 600px at 15% -10%, rgba(255, 252, 240, 0.9), transparent 65%),
    radial-gradient(900px 500px at 95% 0%, rgba(179, 53, 42, 0.05), transparent 60%),
    repeating-linear-gradient(0deg, rgba(23, 21, 15, 0.028) 0 1px, transparent 1px 29px),
    repeating-linear-gradient(90deg, rgba(23, 21, 15, 0.028) 0 1px, transparent 1px 29px);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(179, 53, 42, 0.16); }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------- 顶栏 ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(245, 240, 228, 0.86);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
}
.brand .logo {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: var(--ink);
  color: #fffaf0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1;
  position: relative;
  flex: none;
}
.brand .logo::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 250, 240, 0.28);
  border-radius: 2px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.15;
}
.brand-text em {
  font-family: var(--sans);
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
}
.nav a, .nav button {
  padding: 7px 12px;
  border-radius: 4px;
  color: var(--ink-2);
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.nav a:hover, .nav button:hover { background: rgba(23, 21, 15, 0.06); color: var(--ink); }
.nav .primary-link {
  color: var(--red);
  font-weight: 600;
  border: 1px solid rgba(179, 53, 42, 0.28);
  background: rgba(179, 53, 42, 0.05);
}
.nav .primary-link:hover { background: var(--red); color: #fff8ec; }

/* ---------------- Hero ---------------- */
.hero {
  padding: 56px 0 10px;
  position: relative;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--red);
  font-weight: 600;
  margin-bottom: 18px;
}
.hero-eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--red);
  display: block;
}
.hero-title {
  position: relative;
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(38px, 6.4vw, 66px);
  line-height: 1.08;
  letter-spacing: 0.02em;
  font-weight: 700;
  margin: 0 0 14px;
  padding-right: 8px;
}
.hero-title .seal {
  position: absolute;
  top: -14px;
  right: -46px;
  width: 46px;
  height: 46px;
  border: 2px solid var(--red);
  border-radius: 6px;
  color: var(--red);
  font-size: 22px;
  line-height: 42px;
  text-align: center;
  transform: rotate(8deg);
  opacity: 0.82;
  font-family: var(--serif);
  letter-spacing: 0;
}
.hero-sub {
  margin: 0 0 28px;
  font-size: 15px;
  color: var(--ink-2);
  max-width: 620px;
  line-height: 1.8;
}
.hero-sub strong { color: var(--red); font-weight: 600; }

.searchbar {
  display: flex;
  gap: 8px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  padding: 5px;
  max-width: 720px;
  box-shadow: 6px 6px 0 rgba(23, 21, 15, 0.06);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.searchbar:focus-within {
  box-shadow: 6px 6px 0 rgba(179, 53, 42, 0.16);
  transform: translate(-1px, -1px);
}
.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 11px 14px;
  background: transparent;
  font-size: 15px;
}
.searchbar input::placeholder { color: #a9a294; }
.searchbar button {
  border: 0;
  background: var(--ink);
  color: #fdf8ec;
  border-radius: 3px;
  padding: 0 26px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: background 0.16s ease;
}
.searchbar button:hover { background: var(--red); }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 26px 0 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.hero-stats strong {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

/* ---------------- 官方配套资源 ---------------- */
.official {
  margin: 30px 0 22px;
  padding: 18px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(180deg, #fbf8f1 0%, #fff 100%);
}
.official-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.official-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.official-sub { font-size: 12px; color: var(--muted); }
.official-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.official-list a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.official-list a:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(120, 96, 58, .1);
  transform: translateY(-1px);
}
.official-list strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.official-list span {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------------- 筛选 ---------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 34px 0 6px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.filters select {
  appearance: none;
  background: var(--card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 12 12'><path d='M2 4.2l4 3.6 4-3.6' fill='none' stroke='%23837c6b' stroke-width='1.4' stroke-linecap='round'/></svg>") no-repeat right 11px center;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 7px 30px 7px 13px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}
.filters select:hover { border-color: #cdc2aa; }
.filters select.active {
  border-color: var(--red);
  color: var(--red-deep);
  background-color: var(--red-soft);
  font-weight: 600;
}
.filters select.secondary {
  border-style: dashed;
  color: var(--muted);
  background-color: transparent;
}
.filters select.secondary.active {
  border-style: solid;
  color: var(--red-deep);
  background-color: var(--red-soft);
}
.filters .reset {
  border: 1px dashed #d3c9b4;
  background: transparent;
  border-radius: 3px;
  padding: 7px 13px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.filters .reset:hover { color: var(--red); border-color: var(--red); }

/* ---------------- 排序栏 ---------------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 18px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.sorts {
  display: flex;
  gap: 2px;
  margin-bottom: -1px;
}
.sorts button {
  border: 0;
  background: transparent;
  padding: 10px 16px 12px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.sorts button:hover { color: var(--ink); }
.sorts button.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--red);
}
.count { color: var(--muted); font-size: 12.5px; letter-spacing: 0.02em; }

/* ---------------- 资料卡片 ---------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: linear-gradient(225deg, var(--paper-deep) 0 50%, transparent 50%);
  border-left: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  opacity: 0.9;
  transition: opacity 0.18s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #cfc3a8;
}
.card:hover::after { opacity: 0; }

.card .top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  padding-right: 16px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11.5px;
  background: rgba(23, 21, 15, 0.05);
  color: var(--ink-2);
  line-height: 1.6;
}
.tag.type {
  background: var(--red);
  color: #fff8ee;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.tag.ext { font-family: ui-monospace, Menlo, Consolas, monospace; background: rgba(23, 21, 15, 0.06); }

.card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .desc {
  margin: 0;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 43px;
}
.card .meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
  font-variant-numeric: tabular-nums;
}
.card .meta .stats { display: flex; gap: 14px; }
.card .meta .stats span { display: inline-flex; align-items: center; gap: 5px; }
.card .meta .stats span:first-child { color: var(--ink-2); font-weight: 600; }

.icon { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* 入场动画 */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  from { background-position: -400px 0; }
  to { background-position: 400px 0; }
}
.cards .card { animation: riseIn 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.cards .card:nth-child(1) { animation-delay: 0.02s; }
.cards .card:nth-child(2) { animation-delay: 0.06s; }
.cards .card:nth-child(3) { animation-delay: 0.1s; }
.cards .card:nth-child(4) { animation-delay: 0.14s; }
.cards .card:nth-child(5) { animation-delay: 0.18s; }
.cards .card:nth-child(6) { animation-delay: 0.22s; }
.cards > .card[style] {
  background-image: linear-gradient(90deg, rgba(23,21,15,0.03), rgba(23,21,15,0.07), rgba(23,21,15,0.03));
  background-size: 400px 100%;
  animation: shimmer 1.1s linear infinite;
}

/* ---------------- 空状态 / 分页 ---------------- */
.empty {
  grid-column: 1 / -1;
  background: rgba(255, 253, 247, 0.7);
  border: 1px dashed #d5cab2;
  border-radius: var(--radius);
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 30px 0 60px;
}
.pager button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 3px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.16s ease, color 0.16s ease;
}
.pager button:hover:not(:disabled) { border-color: var(--ink); }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.pager .pages { color: var(--muted); font-size: 12.5px; letter-spacing: 0.04em; }

/* ---------------- 详情页 ---------------- */
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
  padding: 34px 0 64px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 18px; }
.detail h1 {
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  margin: 10px 0 14px;
  font-weight: 700;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: rgba(23, 21, 15, 0.045);
  border-radius: 3px;
  padding: 3px 9px;
  font-size: 12px;
  color: var(--ink-2);
}
.chip.school {
  background: var(--red-soft);
  color: var(--red-deep);
  font-weight: 600;
}
.desc-block { margin-top: 26px; }
.desc-block h4, .side-title {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.desc-block h4::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}
.description {
  white-space: pre-wrap;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.9;
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.preview-head a {
  color: var(--red-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(179, 53, 42, 0.35);
  padding-bottom: 1px;
  white-space: nowrap;
}
.preview-head a:hover { border-bottom-color: var(--red); }
.preview {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper-deep);
}
.preview iframe { width: 100%; height: clamp(420px, 72vh, 780px); border: 0; display: block; background: #fff; }
.preview.image {
  background-image:
    linear-gradient(45deg, rgba(23, 21, 15, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(23, 21, 15, 0.04) 25%, transparent 25%);
  background-size: 18px 18px;
}
.preview.image a { display: block; cursor: zoom-in; }
.preview.image img { width: 100%; height: auto; display: block; }
.preview .no-preview {
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.preview-tip {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.disclaimer {
  margin: 20px 0 0;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  background: rgba(239, 232, 216, 0.35);
}
.media-item { margin-top: 22px; }
.media-item audio { width: 100%; }
.media-item video { width: 100%; border-radius: 4px; background: #000; }

/* 评论 */
.comment-block { margin-top: 26px; }
.comment-total {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 10px;
  background: var(--line-soft);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  vertical-align: 2px;
}
.comment-form { margin-top: 12px; display: grid; gap: 8px; }
.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
  resize: vertical;
}
.comment-form input:focus,
.comment-form textarea:focus { outline: none; border-color: var(--primary); }
.comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.comment-tip { font-size: 12.5px; color: var(--red); }
.comment-list { margin-top: 16px; display: grid; gap: 0; }
.comment-item { padding: 12px 0; border-top: 1px dashed var(--line-soft); }
.comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.comment-nick { font-size: 13px; font-weight: 600; color: var(--ink); }
.comment-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.comment-body { margin-top: 5px; font-size: 13.5px; line-height: 1.8; color: var(--ink); white-space: pre-wrap; word-break: break-word; }

.side { position: sticky; top: 86px; }
.file-info { display: grid; gap: 0; font-size: 13px; }
.file-info div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.file-info div:last-child { border-bottom: 0; }
.file-info .k { color: var(--muted); }
.file-info .v { color: var(--ink); text-align: right; word-break: break-all; font-weight: 500; font-variant-numeric: tabular-nums; }
.btn-download {
  width: 100%;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: #fdf8ec;
  padding: 14px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  margin-top: 20px;
  box-shadow: 4px 4px 0 rgba(179, 53, 42, 0.22);
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.btn-download:hover { background: var(--red); border-color: var(--red); transform: translate(-1px, -1px); box-shadow: 6px 6px 0 rgba(23, 21, 15, 0.16); }
.btn-download:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn-like {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}
.btn-like:hover { border-color: var(--red); color: var(--red); }
.btn-like.liked { border-color: var(--red); color: var(--red-deep); background: var(--red-soft); }
.hint { color: var(--muted); font-size: 12px; margin-top: 14px; line-height: 1.8; }

/* ---------------- 滑块验证 ---------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(23, 21, 15, 0.5);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 16px;
  animation: riseIn 0.18s ease both;
}
.modal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px 22px 18px;
  width: 348px;
  max-width: 100%;
  box-shadow: 0 30px 70px rgba(23, 21, 15, 0.32);
}
.modal h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.02em;
}
.modal .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 16px; }
.cap-stage {
  position: relative;
  width: 300px;
  height: 150px;
  margin: 0 auto;
  border-radius: 4px;
  overflow: hidden;
  background: #dfe7ea;
  user-select: none;
  touch-action: none;
  border: 1px solid var(--line);
}
.cap-stage img { position: absolute; top: 0; left: 0; }
.cap-piece { will-change: left; }
.cap-track {
  position: relative;
  height: 44px;
  margin-top: 14px;
  border-radius: 4px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.cap-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: rgba(179, 53, 42, 0.12);
}
.cap-handle {
  position: absolute;
  left: 0; top: 0;
  width: 46px;
  height: 44px;
  border-radius: 3px;
  background: var(--ink);
  color: #fdf8ec;
  display: grid;
  place-items: center;
  cursor: grab;
  z-index: 2;
}
.cap-handle svg { stroke: #fdf8ec; }
.cap-handle:active { cursor: grabbing; }
.cap-track .text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  color: var(--muted);
  pointer-events: none;
  letter-spacing: 0.06em;
}
.cap-msg {
  margin-top: 10px;
  font-size: 12.5px;
  min-height: 20px;
  color: var(--red);
  text-align: center;
}
.cap-actions { display: flex; gap: 8px; margin-top: 4px; }
.cap-actions button {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 3px;
  padding: 9px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.16s ease, color 0.16s ease;
}
.cap-actions button:hover { border-color: var(--ink); }
.cap-actions .close { color: var(--muted); }

/* ---------------- 表单 ---------------- */
.form {
  display: grid;
  gap: 18px;
  padding: 36px 0 64px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: var(--ink-2); font-weight: 600; letter-spacing: 0.02em; }
.field label .req { color: var(--red); }
.field input[type="text"], .field input[type="number"], .field input[type="password"], .field select, .field textarea {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 11px 13px;
  background: var(--card);
  outline: none;
  font-size: 14px;
  width: 100%;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23, 21, 15, 0.06);
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.8; }
.field .tip { font-size: 12px; color: var(--muted); }
.file-drop {
  border: 1.5px dashed #d3c9b4;
  border-radius: 4px;
  padding: 22px 18px;
  background: rgba(255, 253, 247, 0.6);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.file-drop:hover { border-color: var(--red); color: var(--ink-2); background: var(--red-soft); }
.file-drop.has-file { border-style: solid; border-color: var(--ink); color: var(--ink); background: #fff; font-weight: 500; }
.file-drop input[type="file"] { display: none; }
.submit-row { display: flex; gap: 14px; align-items: center; }
.btn-primary {
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: #fdf8ec;
  padding: 12px 28px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(179, 53, 42, 0.22);
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.btn-primary:hover { background: var(--red); border-color: var(--red); transform: translate(-1px, -1px); box-shadow: 6px 6px 0 rgba(23, 21, 15, 0.16); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn-ghost {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 12px 22px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.16s ease;
}
.btn-ghost:hover { border-color: var(--ink); }
.notice {
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 13px;
  border: 1px solid transparent;
}
.notice.error { background: var(--red-soft); color: var(--red-deep); border-color: rgba(179, 53, 42, 0.2); }
.notice.ok { background: #eef4e8; color: #3d5a2b; border-color: rgba(61, 90, 43, 0.18); }
.notice-soft {
  margin: 0;
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
  background: rgba(239, 232, 216, 0.5);
  border-left: 3px solid rgba(179, 53, 42, 0.35);
  border-radius: 0 3px 3px 0;
}
.progress { height: 4px; background: var(--paper-deep); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--red); transition: width 0.2s; }

/* ---------------- 登录 ---------------- */
.auth-wrap {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 48px 20px;
}
.auth-card {
  width: 380px;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--shadow-md);
  position: relative;
}
.auth-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), #d18a3a);
  border-radius: 8px 8px 0 0;
}
.auth-card h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.03em;
}
.auth-card p.sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; }

/* ---------------- 审核后台 ---------------- */
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 34px 0 20px;
  flex-wrap: wrap;
}
.admin-head h1 {
  font-family: var(--serif);
  font-size: 26px;
  margin: 0;
  letter-spacing: 0.02em;
}
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; white-space: nowrap; }
.tabs button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 3px;
  padding: 8px 18px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}
.tabs button:hover { border-color: #cdc2aa; }
.tabs button.active {
  border-color: var(--ink);
  color: #fdf8ec;
  background: var(--ink);
  font-weight: 600;
}
.review-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.review-item .head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.review-item h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.01em;
}
.review-item .desc {
  color: var(--ink-2);
  font-size: 13.5px;
  white-space: pre-wrap;
  margin: 12px 0;
  line-height: 1.8;
}
.review-item .actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.review-item .actions input {
  flex: 1;
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px 11px;
}
.btn-approve {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fdf8ec;
  padding: 10px 20px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.16s ease;
}
.btn-approve:hover { background: var(--red); border-color: var(--red); }
.btn-reject {
  border: 1px solid rgba(179, 53, 42, 0.3);
  background: var(--red-soft);
  color: var(--red-deep);
  padding: 10px 20px;
  border-radius: 3px;
  cursor: pointer;
}
.btn-reject:hover { border-color: var(--red); }

/* ---------------- 字典管理 ---------------- */
.dict-panel .dict-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.dict-panel .dict-head h2 {
  font-family: var(--serif);
  font-size: 18px;
  margin: 0;
  letter-spacing: 0.04em;
}
.dict-panel .dict-head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}
.dict-list { margin: 14px 0 4px; }
.dict-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px dashed var(--line-soft);
}
.dict-row.off { opacity: 0.55; }
.dict-name { font-size: 14px; font-weight: 600; min-width: 90px; }
.dict-count { font-size: 12.5px; color: var(--muted); }
.dict-state {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 2px;
  background: rgba(179, 53, 42, 0.08);
  color: var(--red-deep);
  letter-spacing: 0.04em;
}
.dict-row.off .dict-state { background: var(--paper-deep); color: var(--muted); }
.dict-row .btn-ghost {
  margin-left: auto;
  padding: 5px 12px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 3px;
  color: var(--ink-2);
  cursor: pointer;
}
.dict-row .btn-ghost + .btn-ghost { margin-left: 0; }
.dict-row .btn-ghost:hover { border-color: var(--red); color: var(--red-deep); }
.dict-add { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.dict-add input {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px 11px;
  font-size: 13px;
  background: var(--card);
}
.dict-add input:focus { outline: none; border-color: var(--ink-2); }
@media (max-width: 640px) {
  .dict-row { flex-wrap: wrap; }
  .dict-row .btn-ghost { margin-left: 0; }
}

/* ---------------- 页脚 ---------------- */
footer.site-footer {
  background: var(--ink);
  color: rgba(253, 248, 236, 0.62);
  padding: 34px 0 44px;
  font-size: 12.5px;
  text-align: center;
  line-height: 1.9;
  letter-spacing: 0.02em;
}
footer.site-footer a { color: rgba(253, 248, 236, 0.9); text-decoration: underline; text-underline-offset: 3px; }

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(6px);
  background: var(--ink);
  color: #fdf8ec;
  padding: 11px 22px;
  border-radius: 3px;
  font-size: 13px;
  letter-spacing: 0.04em;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(23, 21, 15, 0.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 960px) {
  .official-list { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .hero-title .seal { right: -40px; width: 40px; height: 40px; line-height: 36px; font-size: 19px; }
}
@media (max-width: 640px) {
  .official { padding: 14px 14px 16px; }
  .official-list { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .hero { padding-top: 34px; }
  .hero-title { font-size: 38px; }
  .hero-title .seal { display: none; }
  .hero-sub { font-size: 14px; }
  .hero-stats { gap: 20px; }
  .hero-stats strong { font-size: 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .site-header .inner { height: 58px; gap: 8px; }
  .brand-text { font-size: 15px; }
  .brand-text em { display: none; }
  .nav { gap: 0; min-width: 0; }
  .nav .hide-sm { display: none; }
  .nav a, .nav button { padding: 8px 8px; font-size: 12.5px; }
  .preview iframe { height: 62vh; min-height: 340px; }
  .preview-tip { font-size: 11.5px; }
  .panel { padding: 20px; }
  .detail h1 { font-size: 22px; }
  .searchbar button { padding: 0 18px; }
  .card h3 { font-size: 16.5px; }
  .filters { gap: 6px; }
  .filters select { flex: 1 1 calc(50% - 3px); min-width: 0; }
  .filters .reset { flex: 1 1 100%; }
  .filters select,
  .searchbar input,
  .field input,
  .field select,
  .field textarea,
  .dict-add input,
  .review-item .actions input {
    font-size: 16px;
  }
  .field select, .filters select { padding-top: 9px; padding-bottom: 9px; }
  .review-item .head { flex-direction: column; }
  .review-item .actions { flex-direction: column; }
  .review-item .actions input { min-width: 0; width: 100%; }
  .review-item .actions button { width: 100%; }
  .media-item video { max-height: 62vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
