/* ============================================================
   图种工坊 · Seed Archive
   纸张 / 油墨 / 朱砂 —— 一份关于「封装」的档案
   ============================================================ */

:root {
  --paper: #f3eee3;
  --paper-deep: #eae2d1;
  --card: #fbf7ee;
  --ink: #1a1510;
  --ink-soft: #5f5548;
  --ink-faint: #8b8172;
  --line: rgba(26, 21, 16, 0.16);
  --line-strong: rgba(26, 21, 16, 0.34);
  --accent: #c2401d;
  --accent-deep: #9c2f12;
  --accent-wash: rgba(194, 64, 29, 0.09);
  --green: #245c47;
  --green-wash: rgba(36, 92, 71, 0.1);
  --radius: 3px;
  --shadow: 0 1px 0 rgba(26, 21, 16, 0.05), 0 18px 40px -28px rgba(26, 21, 16, 0.45);
  --font-display: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 80% at 8% -10%, #fffdf6 0%, rgba(255, 253, 246, 0) 55%),
    radial-gradient(90% 60% at 100% 0%, rgba(194, 64, 29, 0.06) 0%, rgba(194, 64, 29, 0) 60%);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

/* 纸纹 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

a { color: inherit; }

/* ============================== 页头 ============================== */

.site-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 32px 22px;
  border-bottom: 1px solid var(--line);
}

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

.brand-seal {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  transform: rotate(-4deg);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px rgba(194, 64, 29, 0.35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-family: var(--font-display); font-size: 19px; letter-spacing: 0.14em; font-weight: 600; }
.brand-text em {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.tabs { display: flex; gap: 4px; margin-left: 18px; }

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px 11px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.2s ease;
}

.tab::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tab:hover { color: var(--ink); }

.tab.is-active { color: var(--ink); }
.tab.is-active::after { transform: scaleX(1); }

.tab-idx {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.offline-note {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  white-space: nowrap;
}

.offline-note .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-wash);
}

/* ============================== 布局 ============================== */

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.55fr);
  gap: 56px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 46px 32px 72px;
  align-items: start;
}

/* ============================== 左侧宣言 ============================== */

.hero {
  position: sticky;
  top: 32px;
  padding-right: 22px;
  border-right: 1px solid var(--line);
}

.kicker {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.34em;
  color: var(--accent);
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 3.5vw, 47px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: 0.015em;
  animation: rise 0.7s 0.06s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero h1 .hl {
  position: relative;
  color: var(--accent);
  white-space: nowrap;
}

.hero h1 .hl::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 6px;
  height: 7px;
  background: var(--accent-wash);
  z-index: -1;
}

.lede {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.85;
  max-width: 34em;
  animation: rise 0.7s 0.12s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-facts {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  animation: rise 0.7s 0.18s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.fact {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.fact-key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  padding-top: 2px;
}

.fact-val { font-size: 13px; color: var(--ink-soft); }

.hero-stamp {
  display: inline-flex;
  gap: 10px;
  margin-top: 30px;
  padding: 9px 14px;
  border: 1.5px dashed var(--line-strong);
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  transform: rotate(-1.4deg);
  animation: rise 0.7s 0.24s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-foot {
  margin: 16px 0 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
}

/* ============================== 面板 ============================== */

.workspace { min-width: 0; }

.panel { animation: fade 0.4s ease both; }

.panel-head { margin-bottom: 30px; }

.panel-head h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.idx {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.1em;
  padding-bottom: 3px;
}

.panel-head p { margin: 0; color: var(--ink-soft); font-size: 13.5px; max-width: 52em; }

.step { margin-bottom: 28px; }

.step-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.step-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.step-hint {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  text-align: right;
}

/* ============================== 拖放区 ============================== */

.drop {
  position: relative;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.72), rgba(251, 247, 238, 0.4)),
    repeating-linear-gradient(135deg, transparent 0 9px, rgba(26, 21, 16, 0.018) 9px 10px);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  outline: none;
}

.drop::before,
.drop::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.drop::before { top: -1px; left: -1px; border-width: 1.5px 0 0 1.5px; }
.drop::after { bottom: -1px; right: -1px; border-width: 0 1.5px 1.5px 0; }

.drop:hover, .drop:focus-visible { border-color: var(--accent); }
.drop:hover::before, .drop:hover::after,
.drop:focus-visible::before, .drop:focus-visible::after { opacity: 1; }

.drop.is-over {
  border-color: var(--accent);
  background-color: var(--accent-wash);
  transform: translateY(-1px);
}

.drop.is-over::before, .drop.is-over::after { opacity: 1; }

.drop-empty { padding: 26px 20px; text-align: center; }

.drop-empty .ico {
  width: 30px;
  height: 30px;
  color: var(--accent);
  stroke-width: 1.2;
  margin-bottom: 8px;
}

.drop-title { margin: 0 0 4px; font-size: 13.5px; font-weight: 500; }
.drop-sub { margin: 0; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; color: var(--ink-faint); }

.drop-buttons { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }

.drop-cover { min-height: 148px; }

/* 已选择文件后，拖放区收成一行提示 */
.drop-files.has-items .drop-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  text-align: left;
  flex-wrap: wrap;
}

.drop-files.has-items .drop-empty .ico { width: 18px; height: 18px; margin: 0; }
.drop-files.has-items .drop-title { margin: 0; font-size: 12px; color: var(--ink-soft); }
.drop-files.has-items .drop-sub,
.drop-files.has-items .drop-buttons { display: none; }

/* 封面预览 */
.cover-preview {
  display: flex;
  gap: 20px;
  padding: 16px;
  align-items: center;
}

.cover-preview img {
  width: 128px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--paper-deep);
  box-shadow: 4px 4px 0 rgba(26, 21, 16, 0.07);
  flex: none;
}

.cover-info { min-width: 0; }
.cover-name {
  margin: 0 0 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  word-break: break-all;
}
.cover-meta { margin: 0 0 12px; font-size: 11.5px; color: var(--ink-faint); }
.cover-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 文件列表 */
.file-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.file-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto 26px;
  gap: 12px;
  align-items: center;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  animation: fade 0.25s ease both;
}

.file-row .ico { color: var(--ink-faint); }

.file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}

.file-size {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.files-tools { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ============================== 设置 ============================== */

.settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.field { display: flex; flex-direction: column; gap: 9px; min-width: 0; }

.field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.seg { position: relative; flex: 1; }

.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
  margin: 0;
}

.seg span {
  display: block;
  padding: 8px 6px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  transition: background 0.18s ease, color 0.18s ease;
}

.seg + .seg span { border-left: 1px solid var(--line); }

.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

.input-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.7);
  overflow: hidden;
  transition: border-color 0.18s ease;
}

.input-wrap:focus-within { border-color: var(--accent); }

.input-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  outline: none;
}

.input-suffix {
  display: grid;
  place-items: center;
  padding: 0 12px;
  border-left: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}

/* ============================== 按钮 ============================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  padding: 12px 26px;
  font-size: 13.5px;
  letter-spacing: 0.12em;
}

.btn-primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }

.btn-ghost { border-color: var(--line-strong); color: var(--ink-soft); background: rgba(255, 253, 247, 0.4); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); background: var(--card); }

.btn-sm { padding: 6px 12px; font-size: 11.5px; }
.btn-sm .ico { width: 14px; height: 14px; }

.btn-danger { color: var(--accent-deep); border-color: rgba(194, 64, 29, 0.35); }
.btn-danger:hover:not(:disabled) { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-deep); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ============================== 操作条 ============================== */

.actionbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.status {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.status.is-error { color: var(--accent-deep); }
.status.is-ok { color: var(--green); }

.progress {
  height: 3px;
  margin-top: 14px;
  background: var(--paper-deep);
  overflow: hidden;
}

.progress span {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--accent);
  animation: indeterminate 1.1s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ============================== 结果卡片 ============================== */

.result {
  margin-top: 30px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  box-shadow: var(--shadow);
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.result-main {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  padding: 24px;
  align-items: start;
}

.result-main img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}

.result-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: var(--accent);
}

.result-info h3 {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  word-break: break-all;
}

.specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin: 0 0 20px;
}

.specs div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 7px;
  border-bottom: 1px dotted var(--line);
}

.specs dt {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.specs dd {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink);
  word-break: break-all;
}

.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================== 解包面板 ============================== */

.drop-extract { padding: 0; }
.drop-extract .drop-empty { padding: 40px 20px; }
.drop-extract .ico { width: 34px; height: 34px; }

.extract-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  word-break: break-all;
}

.extract-file .ico { color: var(--accent); }

.hint-line {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--ink-faint);
  line-height: 1.7;
}

.hint-line .ico { width: 15px; height: 15px; margin-top: 2px; color: var(--accent); }

.extract-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 26px 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.specimen {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.cover-figure { margin: 0; }

.cover-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}

.cover-figure figcaption {
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
}

.cover-figure.is-missing { display: none; }

.specimen-info h3 {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  word-break: break-all;
}

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

.notice {
  display: flex;
  gap: 10px;
  margin: 20px 24px 0;
  padding: 12px 14px;
  border-left: 2px solid var(--accent);
  background: var(--accent-wash);
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.notice.is-ok { border-left-color: var(--green); background: var(--green-wash); }

.explorer { padding: 22px 0 0; }

.explorer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px 14px;
  flex-wrap: wrap;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 160px;
  max-width: 300px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.6);
  transition: border-color 0.18s ease;
}

.search:focus-within { border-color: var(--accent); }
.search .ico { width: 15px; height: 15px; color: var(--ink-faint); }

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink);
}

.explorer-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

.explorer-bar .btn { margin-left: auto; }

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0 24px;
  max-height: 460px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.entry-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  animation: fade 0.25s ease both;
}

.entry-row .ico { color: var(--ink-faint); }
.entry-row.is-dir .ico { color: var(--accent); }

.entry-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}

.entry-name .path {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 10px;
}

.entry-size {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.entry-actions { display: flex; gap: 4px; }

.entry-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.entry-btn:hover { color: var(--accent); border-color: var(--line-strong); }
.entry-btn .ico { width: 15px; height: 15px; }

.entry-badge {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 2px;
  white-space: nowrap;
}

.extract-actions {
  display: flex;
  gap: 10px;
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ============================== 预览弹层 ============================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 26px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 21, 16, 0.55);
  backdrop-filter: blur(3px);
  animation: fade 0.2s ease both;
}

.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(980px, 100%);
  max-height: calc(100vh - 52px);
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
  animation: rise 0.28s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-title { display: flex; align-items: center; gap: 12px; min-width: 0; }

.modal-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--accent);
  flex: none;
}

.modal-icon .ico { width: 20px; height: 20px; }

.modal-title > div { min-width: 0; }

.modal-title h3 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-title p {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

.modal-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }

.modal-body {
  flex: 1;
  min-height: 200px;
  overflow: auto;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(90deg, rgba(26, 21, 16, 0.025) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(rgba(26, 21, 16, 0.025) 1px, transparent 1px) 0 0 / 22px 22px;
}

.modal-body img,
.modal-body video {
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;
  box-shadow: 0 12px 30px -18px rgba(0, 0, 0, 0.5);
  background: #fff;
}

.modal-body video { width: 100%; }

.modal-body audio { width: min(560px, 100%); }

.modal-body iframe {
  width: 100%;
  height: 62vh;
  border: 1px solid var(--line);
  background: #fff;
}

.preview-text {
  align-self: stretch;
  width: 100%;
  margin: 0;
  padding: 16px 18px;
  background: #171310;
  color: #e8dfcc;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 62vh;
  overflow: auto;
}

.preview-text .ln { color: rgba(232, 223, 204, 0.3); user-select: none; }

.preview-font {
  width: 100%;
  padding: 30px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
}

.preview-font .sample-lg {
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.2;
  margin: 0 0 16px;
}

.preview-font .sample-md { font-size: 20px; margin: 0 0 10px; color: var(--ink-soft); }
.preview-font .sample-sm { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--ink-faint); }

.preview-fallback {
  text-align: center;
  padding: 42px 24px;
  max-width: 380px;
}

.preview-fallback .ico { width: 34px; height: 34px; color: var(--ink-faint); margin-bottom: 12px; }
.preview-fallback p { margin: 0 0 4px; font-size: 13px; }
.preview-fallback small { color: var(--ink-faint); font-size: 11px; }

body.is-modal-open { overflow: hidden; }

/* ============================== 页脚 / 提示 ============================== */

.site-foot {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 32px 34px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  flex-wrap: wrap;
}

.site-foot a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px dotted var(--line-strong); }
.site-foot a:hover { color: var(--accent); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 90;
  transform: translateX(-50%) translateY(10px);
  padding: 11px 20px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  max-width: calc(100vw - 40px);
}

.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.is-error { background: var(--accent-deep); }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================== 响应式 ============================== */

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; gap: 36px; }
  .hero { position: static; border-right: 0; padding-right: 0; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
  .hero-stamp, .hero-foot { display: none; }
  .hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px; }
  .fact { grid-template-columns: 1fr; gap: 2px; border-bottom: 0; }
}

@media (max-width: 760px) {
  .site-head { flex-wrap: wrap; gap: 14px; padding: 18px 20px 14px; }
  .offline-note { display: none; }
  .tabs { margin-left: 0; width: 100%; border-top: 1px solid var(--line); padding-top: 6px; }
  .tab { flex: 1; justify-content: center; }
  .layout { padding: 28px 20px 56px; }
  .hero h1 { font-size: 34px; }
  .hero-facts { grid-template-columns: 1fr; }
  .fact { grid-template-columns: 48px 1fr; border-bottom: 1px solid var(--line); }
  .hero-facts .fact:last-child { border-bottom: 0; }
  .settings { grid-template-columns: 1fr; gap: 16px; }
  .result-main { grid-template-columns: 1fr; padding: 18px; }
  .specimen { grid-template-columns: 1fr; padding: 18px; }
  .cover-figure { max-width: 260px; }
  .cover-preview { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cover-preview img { width: 100%; height: 150px; }
  .entry-list { padding: 0 18px; max-height: none; }
  .explorer-bar { padding: 0 18px 12px; }
  .explorer-bar .btn { margin-left: 0; }
  .notice { margin: 16px 18px 0; }
  .extract-actions { padding: 16px 18px; }
  .specimen-info h3 { font-size: 12.5px; }
  .modal { padding: 12px; }
  .modal-card { max-height: calc(100vh - 24px); }
  .modal-body { padding: 14px; }
  .site-foot { padding: 16px 20px 26px; flex-direction: column; gap: 4px; }
  .file-row { grid-template-columns: 20px minmax(0, 1fr) auto 24px; gap: 8px; }
  .entry-row { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .entry-row .entry-badge { display: none; }
}

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