/* =========================================================================
   款式图库 — 视觉系统
   ========================================================================= */

:root {
  --bg: #f6f3ed;
  --bg-deep: #efe9df;
  --surface: #fffdf9;
  --surface-2: #faf7f1;
  --ink: #1d1b18;
  --ink-2: #4d483f;
  --muted: #736c60;
  --line: #e7e0d4;
  --line-strong: #d6ccbb;
  --accent: #b0472c;
  --accent-hover: #973a23;
  --accent-soft: #f4e3da;
  --accent-ring: rgba(176, 71, 44, 0.12);
  --gold: #b98a44;
  --success: #2f7d5b;
  --success-soft: #e3f2ea;
  --danger: #b3402f;
  --danger-soft: #f8e5e1;
  --warn: #96671a;
  --warn-soft: #faf0d8;
  --info: #3a63a8;
  --info-soft: #e7edf9;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(35, 28, 20, 0.04), 0 4px 16px rgba(35, 28, 20, 0.035);
  --shadow-md: 0 16px 44px -14px rgba(35, 28, 20, 0.18), 0 2px 6px rgba(35, 28, 20, 0.04);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --bar-h: 68px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1100px 640px at 8% -12%, #efe6d8 0%, rgba(239, 230, 216, 0) 62%),
    radial-gradient(900px 560px at 102% 2%, #f3e7e0 0%, rgba(243, 231, 224, 0) 58%),
    var(--bg);
  background-attachment: fixed;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums lining-nums;
}

body.no-scroll {
  overflow: hidden;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  color: inherit;
}

img {
  max-width: 100%;
}

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

[hidden] {
  display: none !important;
}

.hidden {
  display: none !important;
}

.no-scroll {
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

.hint {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  line-height: 1.4;
  text-transform: uppercase;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.field-label em {
  margin-left: 4px;
  color: var(--muted);
  font-style: normal;
  font-weight: 400;
}

.field-hint {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.spacer {
  flex: 1;
}

code,
kbd {
  font-family: var(--font-mono);
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 10.5px;
  line-height: 1.5;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   按钮 / 文本链接
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    transform 0.18s ease, box-shadow 0.18s ease;
}

.btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(176, 71, 44, 0.65);
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -12px rgba(176, 71, 44, 0.72);
}

.btn.primary:active {
  transform: translateY(0);
}

.btn.ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.btn.ghost:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.btn.secondary {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink-2);
}

.btn.secondary:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn.danger-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--danger);
}

.btn.danger-ghost:hover {
  background: var(--danger-soft);
}

.btn.small {
  height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 12.5px;
}

.btn.small svg {
  width: 15px;
  height: 15px;
}

.btn.block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.btn.is-loading {
  opacity: 0.78;
  pointer-events: none;
}

.btn.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading svg {
  display: none;
}

.text-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.text-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-link:disabled {
  color: var(--muted);
  cursor: default;
  text-decoration: none;
}

/* -------------------------------------------------------------------------
   加载条 / 提示
   ------------------------------------------------------------------------- */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  width: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: width 0.35s ease, opacity 0.25s ease;
}

.loading-bar.is-active {
  width: 72%;
  opacity: 1;
  transition: width 2.6s cubic-bezier(0.15, 0.65, 0.2, 1), opacity 0.2s ease;
}

.loading-bar.is-done {
  width: 100%;
  opacity: 0;
  transition: width 0.18s ease, opacity 0.3s ease 0.12s;
}

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 320;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 11px 16px;
  border-radius: 12px;
  background: #26221d;
  color: #fff;
  font-size: 13.5px;
  line-height: 1.4;
  box-shadow: 0 14px 34px rgba(20, 15, 10, 0.28);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.toast.is-show {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  display: flex;
  flex: none;
}

.toast-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast-success .toast-icon {
  color: #74d3a4;
}

.toast-error .toast-icon {
  color: #ff9f90;
}

.toast-info .toast-icon {
  color: #d9c7a7;
}

.toast-text {
  min-width: 0;
}

/* -------------------------------------------------------------------------
   顶栏 / 品牌
   ------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid rgba(214, 204, 187, 0.55);
  background: rgba(246, 243, 237, 0.82);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--bar-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, #c05a3c, #963a22);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 7px 18px -8px rgba(176, 71, 44, 0.7);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1;
}

.brand-text strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.brand-text small {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topnav-sep {
  width: 1px;
  height: 18px;
  margin: 0 5px;
  background: var(--line);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: rgba(29, 27, 24, 0.055);
  color: var(--ink);
}

.nav-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* -------------------------------------------------------------------------
   首屏
   ------------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.96fr);
  align-items: center;
  gap: clamp(36px, 6vw, 88px);
  padding: 62px 0 54px;
}

.hero-copy {
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero h1 {
  margin: 16px 0 22px;
  font-size: clamp(40px, 5.3vw, 64px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.hero h1 span {
  color: var(--accent);
}

.lede {
  max-width: 31em;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.9;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px;
  margin-top: 30px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.hero-facts b {
  color: var(--ink-2);
  font-weight: 600;
}

.dot-sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
}

.search-card {
  position: relative;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 28px 68px -30px rgba(57, 42, 26, 0.28), var(--shadow-sm);
  animation: rise 0.55s 0.08s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.search-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 26%);
  pointer-events: none;
}

.card-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.kicker-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-input {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.search-input > svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.search-input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.06em;
  outline: none;
}

.search-input input::placeholder {
  color: #9d9486;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.search-input input::-webkit-search-cancel-button {
  display: none;
}

.search-input:focus-within {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.clear-input {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(29, 27, 24, 0.07);
  color: var(--muted);
  cursor: pointer;
  flex: none;
}

.clear-input:hover {
  background: rgba(29, 27, 24, 0.12);
  color: var(--ink);
}

.clear-input svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.search-submit {
  height: 58px;
  padding: 0 24px;
  border-radius: 14px;
  font-size: 15px;
}

.search-submit svg {
  transition: transform 0.2s ease;
}

.search-submit:hover svg {
  transform: translateX(2px);
}

.field-hint .text-link {
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(176, 71, 44, 0.3);
}

.date-block {
  margin-top: 22px;
  padding-top: 19px;
  border-top: 1px dashed var(--line);
}

.date-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.date-input {
  flex: 1;
  min-width: 0;
}

.date-input input {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.date-input input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.date-input input::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

.date-sep {
  color: var(--muted);
  font-size: 11.5px;
  flex: none;
}

.quick-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.quick-dates button {
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-dates button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.quick-dates button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

/* -------------------------------------------------------------------------
   结果区
   ------------------------------------------------------------------------- */
.results {
  padding: 10px 0 76px;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--bar-h) + 18px);
}

.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 0 4px;
}

.results-head h2 {
  margin-top: 7px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.hl {
  color: var(--accent);
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.result-meta strong {
  color: var(--ink);
  font-weight: 700;
}

.meta-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.date-nav {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 16px 0 4px;
  scrollbar-width: none;
}

.date-nav::-webkit-scrollbar {
  display: none;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 31px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.date-pill:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.date-pill em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
}

.date-group {
  padding-top: 20px;
  scroll-margin-top: calc(var(--bar-h) + 14px);
  animation: rise 0.4s ease both;
}

.group-head {
  position: sticky;
  top: var(--bar-h);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
  padding: 10px 0;
  background: linear-gradient(to bottom, var(--bg) 72%, rgba(246, 243, 237, 0));
}

.group-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.group-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.group-title h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.weekday {
  color: var(--muted);
  font-size: 11.5px;
}

.group-count {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

/* -------------------------------------------------------------------------
   图片卡片
   ------------------------------------------------------------------------- */
.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  outline: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: rise 0.35s ease both;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 253, 249, 0.9), transparent 68%),
    linear-gradient(155deg, #efebe4, #e4ded3);
}

.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card:hover .card-media img {
  transform: scale(1.018);
}

.time-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(24, 21, 18, 0.6);
  color: #fff;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.preview-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(24, 21, 18, 0.52);
  color: #fff;
  opacity: 0;
  transform: translateY(-4px);
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.preview-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card:hover .preview-btn,
.preview-btn:focus-visible {
  opacity: 1;
  transform: none;
}

.preview-btn:hover {
  background: rgba(24, 21, 18, 0.8);
}

.copy-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(24, 21, 18, 0.76);
  color: #fff;
  font-size: 11.5px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 6px);
  pointer-events: none;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.copy-hint svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card:hover .copy-hint {
  opacity: 1;
  transform: translate(-50%, 0);
}

.copied-badge {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(47, 125, 91, 0.84);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  opacity: 0;
  pointer-events: none;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  transition: opacity 0.18s ease;
}

.copied-badge svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card.is-copied .copied-badge {
  opacity: 1;
}

.card.is-copying {
  cursor: progress;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 9px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.codes {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  height: 25px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--accent-soft);
  color: #8c3a22;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.code-chip:hover {
  border-color: #dab8a9;
  background: #efd6c9;
}

.code-chip.is-copied {
  background: var(--success-soft);
  color: var(--success);
}

.code-chip.is-static {
  cursor: default;
}

.code-chip.is-static:hover {
  border-color: transparent;
  background: var(--accent-soft);
}

.code-more {
  align-self: center;
  color: var(--muted);
  font-size: 10.5px;
}

.code-empty {
  color: var(--muted);
  font-size: 11.5px;
  font-style: italic;
}

.card-copy {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.card-copy:hover {
  border-color: #dab8a9;
  background: #fff;
  color: var(--accent);
}

.card-copy svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 骨架屏 */
.skeleton-grid {
  padding-top: 14px;
}

.skeleton-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.skeleton-media {
  aspect-ratio: 4 / 5;
  background: linear-gradient(90deg, #f0ece5 25%, #f8f5ef 37%, #f0ece5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-line {
  width: 58%;
  height: 11px;
  margin: 13px 12px;
  border-radius: 6px;
  background: #f0ece5;
}

/* 空状态 / 错误 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 68px 20px 54px;
  text-align: center;
}

.empty-art {
  width: 124px;
  height: 124px;
  margin-bottom: 20px;
  color: var(--line-strong);
}

.empty-art svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-art svg path:nth-child(2) {
  fill: var(--accent-soft);
  stroke: #d8b3a3;
}

.empty h3 {
  margin-bottom: 7px;
  font-size: 19px;
  font-weight: 600;
}

.empty p {
  max-width: 34em;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

.empty.small {
  padding: 46px 20px;
}

.error-state {
  padding: 64px 20px;
  text-align: center;
}

.error-state h3 {
  margin-bottom: 6px;
  font-size: 19px;
}

.error-state p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13.5px;
}

/* -------------------------------------------------------------------------
   页脚
   ------------------------------------------------------------------------- */
.site-footer {
  padding: 26px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.footer-tip {
  color: var(--muted);
}

.noscript {
  padding: 20px;
  text-align: center;
  color: var(--danger);
}

/* -------------------------------------------------------------------------
   大图预览
   ------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 15, 13, 0.78);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.4);
  transform: translateY(10px) scale(0.992);
  transition: transform 0.2s ease;
}

.lightbox.is-open .lightbox-panel {
  transform: none;
}

.lightbox-media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  overflow: hidden;
  background: #141210;
}

.lightbox-media img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  object-fit: contain;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.25s ease;
}

.lightbox-media img.is-loaded:hover {
  opacity: 0.94;
}

.lightbox-media img.is-loaded {
  opacity: 1;
}

.lightbox-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 30px 26px;
  overflow: auto;
}

.lightbox-close {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.lightbox-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.lightbox-side h2 {
  margin: 7px 0 5px;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  word-break: break-word;
}

.lb-date {
  color: var(--muted);
  font-size: 12px;
}

.lb-codes {
  gap: 7px;
}

.lb-codes .code-chip {
  height: 29px;
  padding: 0 10px;
  font-size: 12px;
}

.lb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.lb-actions .btn {
  flex: 1;
  min-width: 128px;
}

.lb-note {
  margin-top: auto;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

/* -------------------------------------------------------------------------
   管理后台
   ------------------------------------------------------------------------- */
.admin-shell {
  padding-top: 38px;
  padding-bottom: 70px;
}

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--bar-h) - 170px);
  padding: 48px 0;
}

.login-card {
  width: min(420px, 100%);
  padding: 38px 36px 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: rise 0.4s ease both;
}

.login-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}

.login-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-card h1 {
  margin: 7px 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.login-lede {
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.password-field {
  display: flex;
  align-items: center;
  height: 48px;
  margin-bottom: 14px;
  padding-right: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.password-field:focus-within {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.password-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  border: 0;
  background: transparent;
  font-size: 15px;
  outline: none;
}

.password-field button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-field button:hover {
  background: rgba(29, 27, 24, 0.06);
  color: var(--ink);
}

.password-field button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-hint {
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
  text-align: center;
}

.login-hint code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 10.5px;
}

.admin-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 32px;
  margin-bottom: 26px;
}

.admin-intro h1 {
  margin: 7px 0 9px;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.admin-intro-copy > p:last-child {
  max-width: 46em;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 9px;
}

.stat-card {
  min-width: 100px;
  padding: 13px 15px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.stat-card strong {
  display: block;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-card strong.has-pending {
  color: var(--accent);
}

.panel {
  margin-bottom: 22px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.panel-head h2 {
  margin: 5px 0 5px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.panel-head p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.form-field {
  display: block;
  margin-bottom: 15px;
}

.form-field input {
  width: 100%;
}

.form-field input,
.filter-bar > input,
.filter-bar select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-field input:focus,
.filter-bar > input:focus,
.filter-bar select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.form-field input:disabled {
  opacity: 0.6;
}

.form-field .hint {
  display: block;
  margin-top: 6px;
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.import-side {
  display: flex;
  flex-direction: column;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

.selected-count {
  color: var(--muted);
  font-size: 11.5px;
}

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 224px;
  padding: 26px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragging {
  border-color: var(--accent);
  background: #fdf6f1;
  outline: none;
}

.dropzone.is-dragging {
  box-shadow: inset 0 0 0 3px var(--accent-ring);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.dropzone-inner strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 7px;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
}

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

.file-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 9px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.file-thumb {
  position: relative;
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.file-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.file-thumb figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 14px 6px 4px;
  overflow: hidden;
  background: linear-gradient(transparent, rgba(20, 17, 14, 0.74));
  color: #fff;
  font-size: 9px;
  line-height: 1.4;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 17, 14, 0.66);
  color: #fff;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.file-thumb button svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.file-thumb:hover button,
.file-thumb button:focus-visible {
  opacity: 1;
}

.upload-progress {
  margin-top: 18px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #d58257);
  transition: width 0.2s ease;
}

.upload-progress.is-indeterminate .progress-bar {
  width: 100% !important;
  background-image: repeating-linear-gradient(
    90deg,
    var(--accent) 0,
    var(--accent) 38px,
    #d58257 38px,
    #d58257 76px
  );
  background-size: 152px 100%;
  animation: progress-stripes 1.1s linear infinite;
}

.upload-progress.is-error .progress-bar {
  background: var(--danger);
}

.progress-text {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.batch-panel {
  margin-top: 22px;
  padding-top: 19px;
  border-top: 1px dashed var(--line);
}

.batch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 11px;
}

.batch-head h3 {
  font-size: 15px;
  font-weight: 600;
}

.batch-head span {
  color: var(--muted);
  font-size: 11.5px;
}

.batch-items {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 366px;
  padding-right: 4px;
  overflow: auto;
}

.batch-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.batch-item > img {
  flex: none;
  width: 42px;
  height: 54px;
  border-radius: 7px;
  background: #eae5dc;
  object-fit: cover;
}

.batch-item-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.batch-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.batch-codes .code-chip {
  height: 22px;
  padding: 0 7px;
  font-size: 10px;
}

.batch-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-error {
  overflow: hidden;
  color: var(--danger);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-item .text-link {
  flex: none;
  margin-left: 2px;
}

.batch-note {
  margin: 7px 1px 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.status {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-done {
  background: var(--success-soft);
  color: var(--success);
}

.status-pending {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-processing {
  background: var(--info-soft);
  color: var(--info);
}

.status-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 17px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.filter-input {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  max-width: 330px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.filter-input:focus-within {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.filter-input svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.filter-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 13.5px;
  outline: none;
}

.filter-bar select {
  appearance: none;
  min-width: 108px;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 18px, calc(100% - 11px) 18px;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
  cursor: pointer;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: opacity 0.15s ease;
}

.admin-list.is-loading {
  opacity: 0.42;
  pointer-events: none;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.admin-row:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.row-thumb {
  flex: none;
  width: 56px;
  height: 70px;
  border-radius: 8px;
  background: #eae5dc;
  object-fit: cover;
}

.row-body {
  flex: 1;
  min-width: 0;
}

.row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.row-top .codes {
  min-width: 0;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 12px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.row-meta span {
  white-space: nowrap;
}

.row-meta span:nth-child(2) {
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-error {
  margin-top: 4px;
  overflow: hidden;
  color: var(--danger);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.icon-btn.danger:hover {
  border-color: #e7bdb4;
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.pagination .btn:disabled {
  opacity: 0.35;
}

/* -------------------------------------------------------------------------
   编辑弹窗
   ------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.modal.is-open {
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 15, 13, 0.7);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.36);
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.modal.is-open .modal-card {
  transform: none;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.modal-close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(350px, 0.98fr);
}

.edit-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 440px;
  padding: 18px;
  background: #151311;
}

.edit-preview img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 110px);
  object-fit: contain;
}

.edit-download {
  position: absolute;
  bottom: 14px;
  left: 16px;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  text-decoration: none;
}

.edit-download:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.edit-form {
  padding: 30px 28px 26px;
}

.modal-head h2 {
  margin: 6px 0 4px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.edit-sub {
  margin-bottom: 21px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ocr-details {
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.ocr-details summary {
  color: var(--ink-2);
  font-size: 11.5px;
  cursor: pointer;
  user-select: none;
}

.ocr-details pre {
  max-height: 150px;
  margin: 9px 0 0;
  overflow: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.form-error {
  margin: 13px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.55;
}

.form-hint {
  margin: 12px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11.5px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

/* -------------------------------------------------------------------------
   动画
   ------------------------------------------------------------------------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes progress-stripes {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 152px 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* -------------------------------------------------------------------------
   响应式
   ------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-intro {
    align-items: flex-start;
  }

  .stat-grid {
    grid-template-columns: repeat(4, minmax(88px, 1fr));
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 42px 0 38px;
  }

  .hero h1 {
    font-size: clamp(38px, 8vw, 56px);
  }

  .lede {
    max-width: 38em;
  }

  .search-card {
    max-width: 700px;
  }

  .stat-grid {
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .import-grid {
    grid-template-columns: 1fr;
  }

  .dropzone {
    min-height: 180px;
  }

  .edit-grid {
    grid-template-columns: 1fr;
  }

  .edit-preview {
    min-height: 0;
    padding: 14px;
  }

  .edit-preview img {
    max-height: 42vh;
  }
}

@media (max-width: 760px) {
  .shell {
    width: calc(100% - 32px);
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .results-head {
    align-items: flex-start;
  }

  .group-head {
    position: static;
    margin-bottom: 10px;
    padding: 6px 0;
    background: none;
  }

  .date-group {
    padding-top: 16px;
    scroll-margin-top: calc(var(--bar-h) + 8px);
  }

  .hero-facts {
    gap: 10px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-row {
    flex-wrap: wrap;
  }

  .row-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
  }

  .filter-input {
    max-width: none;
  }

  .lightbox-panel {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 24px);
  }

  .lightbox-media {
    min-height: 0;
  }

  .lightbox-media img {
    max-height: 56vh;
  }

  .lightbox-side {
    padding: 22px 20px;
  }

  .edit-preview img {
    max-height: 36vh;
  }

  .edit-form {
    padding: 24px 20px 22px;
  }
}

@media (max-width: 620px) {
  :root {
    --bar-h: 58px;
  }

  .shell {
    width: calc(100% - 28px);
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 37px;
    height: 37px;
    border-radius: 11px;
    font-size: 18px;
  }

  .brand-text strong {
    font-size: 14.5px;
  }

  .brand-text small {
    font-size: 7.5px;
    letter-spacing: 0.16em;
  }

  .nav-link {
    height: 34px;
    padding: 0 9px;
    font-size: 12px;
  }

  .nav-link svg {
    width: 14px;
    height: 14px;
  }

  .topnav-sep {
    display: none;
  }

  .hero {
    padding: 28px 0 30px;
    gap: 26px;
  }

  .hero h1 {
    margin: 12px 0 16px;
    font-size: clamp(34px, 10.5vw, 46px);
  }

  .lede {
    font-size: 14px;
    line-height: 1.8;
  }

  .hero-facts {
    margin-top: 20px;
    font-size: 11px;
  }

  .search-card {
    padding: 18px;
    border-radius: 18px;
  }

  .card-kicker {
    margin-bottom: 16px;
  }

  .search-row {
    flex-direction: column;
  }

  .search-input {
    height: 52px;
  }

  .search-input input {
    font-size: 17px;
  }

  .search-submit {
    width: 100%;
    height: 50px;
  }

  .field-hint {
    font-size: 11px;
  }

  .date-block {
    margin-top: 18px;
    padding-top: 16px;
  }

  .date-row {
    gap: 6px;
  }

  .date-input input {
    height: 40px;
    padding: 0 9px;
    font-size: 12px;
  }

  .quick-dates {
    gap: 6px;
  }

  .results {
    padding-bottom: 56px;
  }

  .results-head {
    padding-top: 20px;
  }

  .date-nav {
    padding-top: 13px;
  }

  .card {
    border-radius: 13px;
  }

  .card-foot {
    padding: 8px;
  }

  .code-chip {
    height: 23px;
    padding: 0 7px;
    font-size: 10px;
  }

  .card-copy {
    width: 27px;
    height: 27px;
    border-radius: 8px;
  }

  .card-copy svg {
    width: 13px;
    height: 13px;
  }

  .preview-btn {
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    opacity: 1;
    transform: none;
  }

  .time-badge {
    top: 6px;
    left: 6px;
    font-size: 9.5px;
  }

  .group-title h3 {
    font-size: 15.5px;
  }

  .group-count {
    font-size: 10.5px;
  }

  .empty {
    padding: 48px 14px 40px;
  }

  .empty-art {
    width: 100px;
    height: 100px;
  }

  .lightbox {
    padding: 0;
  }

  .lightbox-panel {
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    border-radius: 0;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .lightbox-media img {
    max-height: 100%;
  }

  .lightbox-side {
    max-height: 47vh;
    gap: 17px;
    padding: 20px 18px 18px;
    overflow: auto;
  }

  .lightbox-close {
    position: fixed;
    top: 12px;
    right: 12px;
  }

  .lightbox-side h2 {
    font-size: 22px;
  }

  .lb-actions {
    flex-direction: row;
  }

  .lb-note {
    font-size: 10.5px;
  }

  .toast-host {
    bottom: 18px;
  }

  .toast {
    font-size: 12.5px;
  }

  .site-footer {
    padding: 22px 0 28px;
    font-size: 11px;
  }

  .admin-shell {
    padding-top: 26px;
    padding-bottom: 50px;
  }

  .admin-intro {
    margin-bottom: 20px;
  }

  .admin-intro h1 {
    font-size: 30px;
  }

  .stat-card {
    padding: 11px 12px;
  }

  .stat-card strong {
    font-size: 20px;
  }

  .panel {
    padding: 17px;
    border-radius: 16px;
  }

  .panel-head {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
  }

  .panel-head h2 {
    font-size: 19px;
  }

  .dropzone {
    min-height: 160px;
    padding: 20px;
  }

  .file-preview {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  }

  .batch-item {
    flex-wrap: wrap;
  }

  .batch-item .text-link {
    margin-left: auto;
  }

  .filter-bar {
    gap: 8px;
  }

  .filter-input {
    flex: 1 1 100%;
    min-width: 0;
  }

  .filter-bar .btn {
    flex: 1;
  }

  .row-thumb {
    width: 48px;
    height: 60px;
  }

  .row-meta {
    gap: 4px 8px;
  }

  .row-meta span:nth-child(2) {
    max-width: 21ch;
  }

  .login-wrap {
    min-height: calc(100vh - var(--bar-h) - 120px);
    padding: 30px 0;
  }

  .login-card {
    padding: 28px 22px 24px;
    border-radius: 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 0;
  }

  .modal-card {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
  }

  .modal-close {
    position: fixed;
    top: 10px;
    right: 10px;
  }

  .edit-preview {
    min-height: 240px;
    max-height: 38vh;
  }

  .edit-preview img {
    max-height: 34vh;
  }

  .modal-actions .spacer {
    display: none;
  }

  .modal-actions .btn {
    flex: 1;
    min-width: 96px;
  }

  .modal-actions .btn.danger-ghost {
    order: 3;
    flex-basis: 100%;
  }

  .pagination {
    gap: 10px;
  }
}

@media (hover: none) {
  .preview-btn {
    opacity: 1;
    transform: none;
  }

  .copy-hint {
    display: none;
  }

  .file-thumb button {
    opacity: 1;
  }
}

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