/* ==========================================================================
   Jigu · ancient book OCR — visual system
   ========================================================================== */

:root {
  --paper: #f3ede1;
  --paper-soft: #faf6ec;
  --paper-deep: #e9dfcd;
  --paper-warm: #efe5d4;
  --ink: #211e18;
  --ink-2: #4c463b;
  --muted: #7d7464;
  --muted-2: #9b917e;
  --line: rgba(54, 46, 34, 0.16);
  --line-strong: rgba(54, 46, 34, 0.3);
  --cinnabar: #a43b2b;
  --cinnabar-deep: #7e2b20;
  --cinnabar-soft: #c16a54;
  --jade: #48604f;
  --amber: #a9762d;
  --dark: #1b1915;
  --dark-2: #24211b;
  --dark-3: #2e2a23;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  --max: 1320px;
  --ease: cubic-bezier(0.22, 0.72, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: rgba(164, 59, 43, 0.19);
  color: var(--ink);
}

img {
  max-width: 100%;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.noscript {
  padding: 10px 20px;
  background: var(--cinnabar);
  color: #fff8ec;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0.26;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.38'/%3E%3C/svg%3E");
}

.container {
  width: min(calc(100% - 96px), var(--max));
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Shared type & controls
   -------------------------------------------------------------------------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.23em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow-line {
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--cinnabar);
  flex: none;
}

.eyebrow.light {
  color: #9e9480;
}

.eyebrow.light .eyebrow-line {
  background: var(--cinnabar-soft);
}

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 21px;
  border: 1px solid var(--btn-bd);
  border-radius: 2px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    border-color 0.3s var(--ease), transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.btn svg,
.mini-btn svg,
.icon-action svg,
.progress-privacy svg,
.studio-note svg,
.privacy-pill svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.4;
  transform: none;
}

.btn-cinnabar {
  --btn-bg: var(--cinnabar);
  --btn-fg: #fbf6ea;
  --btn-bd: var(--cinnabar);
  box-shadow: 0 12px 28px -18px rgba(126, 43, 32, 0.85);
}

.btn-cinnabar:hover {
  --btn-bg: var(--cinnabar-deep);
  --btn-bd: var(--cinnabar-deep);
}

.btn-ink {
  --btn-bg: var(--ink);
  --btn-fg: #f7f1e5;
  --btn-bd: var(--ink);
}

.btn-ink:hover {
  --btn-bg: #37322a;
  --btn-bd: #37322a;
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--line-strong);
}

.btn-ghost:hover {
  --btn-bg: rgba(255, 253, 247, 0.55);
  --btn-bd: var(--ink);
}

.btn-outline-light {
  --btn-bg: transparent;
  --btn-fg: #e8dfcd;
  --btn-bd: rgba(238, 228, 211, 0.24);
}

.btn-outline-light:hover {
  --btn-bg: rgba(255, 255, 255, 0.07);
  --btn-bd: rgba(238, 228, 211, 0.5);
}

.btn-light {
  --btn-bg: #efe5d3;
  --btn-fg: var(--ink);
  --btn-bd: #efe5d3;
}

.btn-light:hover {
  --btn-bg: #fff8e9;
  --btn-bd: #fff8e9;
}

.btn-sm {
  height: 38px;
  padding: 0 15px;
  font-size: 11.5px;
}

.text-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--cinnabar);
  font-size: inherit;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid rgba(164, 59, 43, 0.35);
  transition: border-color 0.25s ease, color 0.25s ease;
}

.text-link:hover {
  color: var(--cinnabar-deep);
  border-color: var(--cinnabar);
}

.text-link.light {
  color: #d6b6a8;
  border-color: rgba(214, 182, 168, 0.3);
}

.text-link.light:hover {
  color: #f3d7cb;
}

:focus-visible {
  outline: 2px solid var(--cinnabar);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(243, 237, 225, 0.82);
  border-bottom: 1px solid rgba(54, 46, 34, 0.08);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(243, 237, 225, 0.94);
  box-shadow: 0 12px 30px -28px rgba(38, 30, 20, 0.5);
}

.header-inner {
  width: min(calc(100% - 64px), 1400px);
  height: 76px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 40px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}

.brand-seal {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--cinnabar);
  border: 1px solid var(--cinnabar);
  background: rgba(255, 252, 244, 0.32);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.4s var(--ease), background 0.4s ease;
}

.brand-seal::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(164, 59, 43, 0.34);
  pointer-events: none;
}

.brand:hover .brand-seal {
  transform: rotate(-4deg);
  background: rgba(255, 252, 244, 0.65);
}

.brand-type {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-type b {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.18em;
}

.brand-type small {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.2em;
  color: var(--muted);
  line-height: 1.3;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-left: 24px;
}

.main-nav a,
.footer-nav a {
  position: relative;
  color: var(--ink-2);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 8px 0;
  transition: color 0.25s ease;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 3px;
  height: 1px;
  background: var(--cinnabar);
  transition: right 0.3s var(--ease);
}

.main-nav a:hover {
  color: var(--ink);
}

.main-nav a:hover::after {
  right: 0;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.privacy-pill svg {
  width: 14px;
  height: 14px;
  color: var(--jade);
}

.privacy-pill.is-cloud svg {
  color: var(--cinnabar);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 70px 0 0;
  overflow: hidden;
}

.hero::before {
  content: "识古";
  position: absolute;
  left: max(-30px, calc(50% - 820px));
  top: 50%;
  transform: translateY(-48%);
  font-family: var(--serif);
  font-size: 310px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.08em;
  color: rgba(59, 49, 36, 0.016);
  writing-mode: vertical-rl;
  pointer-events: none;
  user-select: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.97fr);
  align-items: center;
  gap: 48px;
  min-height: 670px;
}

.hero-copy {
  padding: 26px 0 64px;
  position: relative;
  z-index: 2;
}

.hero h1 {
  margin: 25px 0 27px;
  font-family: var(--serif);
  font-size: clamp(58px, 6.7vw, 94px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.hero h1 em {
  position: relative;
  display: inline-block;
  font-style: normal;
  color: var(--cinnabar);
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 0;
  bottom: -7px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8C57 2 119 10 181 5s82-1 117 2' fill='none' stroke='%23a43b2b' stroke-width='2.2' stroke-linecap='round' opacity='.5'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  pointer-events: none;
}

.hero-lede {
  max-width: 545px;
  margin: 0;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 2.05;
  letter-spacing: 0.01em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 35px 0 30px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.hero-meta li {
  display: flex;
  align-items: center;
}

.hero-meta li + li::before {
  content: "";
  width: 1px;
  height: 11px;
  margin: 0 15px;
  background: var(--line-strong);
}

.hero-visual {
  position: relative;
  z-index: 1;
  padding: 10px 0 40px;
}

.hero-plate-wrap {
  position: relative;
  width: min(100%, 470px);
  margin-left: auto;
  padding: 18px 30px 76px 18px;
}

.plate-annot {
  position: absolute;
  z-index: 4;
  margin: 0;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.plate-annot-top {
  top: -2px;
  right: 38px;
}

.hero-plate {
  position: relative;
  z-index: 2;
  padding: 10px;
  background: #fbf7ed;
  border: 1px solid rgba(74, 58, 38, 0.15);
  box-shadow:
    0 38px 70px -38px rgba(37, 28, 18, 0.55),
    0 2px 0 rgba(255, 255, 255, 0.6) inset;
  transform: rotate(1.35deg);
  transition: transform 0.7s var(--ease);
}

.hero-plate-wrap:hover .hero-plate {
  transform: rotate(0.4deg) translateY(-4px);
}

.plate-top,
.plate-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.plate-top {
  padding: 2px 2px 9px;
}

.plate-bottom {
  padding: 9px 2px 2px;
}

.plate-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #e8dec9;
}

.plate-image > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.95) contrast(1.015);
}

.plate-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 249, 234, 0.11), transparent 16%, transparent 84%, rgba(62, 45, 28, 0.08)),
    radial-gradient(ellipse at center, transparent 55%, rgba(63, 47, 28, 0.1));
  pointer-events: none;
}

.detect-box {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  z-index: 3;
  border: 1px solid rgba(164, 59, 43, 0.52);
  background: linear-gradient(180deg, rgba(164, 59, 43, 0.045), rgba(164, 59, 43, 0.008) 70%, transparent);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.detect-box::before,
.detect-box::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-color: rgba(164, 59, 43, 0.95);
  border-style: solid;
}

.detect-box::before {
  left: -1px;
  top: -1px;
  border-width: 1.5px 0 0 1.5px;
}

.detect-box::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 1.5px 1.5px 0;
}

.detect-box i {
  position: absolute;
  top: -14px;
  left: -1px;
  font-family: var(--mono);
  font-size: 6.5px;
  font-style: normal;
  letter-spacing: 0.06em;
  color: var(--cinnabar);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hero-plate:hover .detect-box i {
  opacity: 0.9;
}

.plate-scan {
  position: absolute;
  left: -2%;
  right: -2%;
  top: 12%;
  height: 1.5px;
  z-index: 4;
  background: linear-gradient(90deg, transparent, rgba(190, 79, 58, 0.86) 18%, rgba(190, 79, 58, 0.95) 50%, rgba(190, 79, 58, 0.86) 82%, transparent);
  box-shadow: 0 0 14px rgba(164, 59, 43, 0.6), 0 0 42px rgba(164, 59, 43, 0.24);
  animation: hero-scan 6s var(--ease) infinite;
}

@keyframes hero-scan {
  0% { top: 11%; opacity: 0; }
  10% { opacity: 1; }
  87% { opacity: 1; }
  100% { top: 88%; opacity: 0; }
}

.plate-corner {
  position: absolute;
  z-index: 5;
  width: 17px;
  height: 17px;
  border-color: rgba(164, 59, 43, 0.6);
  border-style: solid;
  pointer-events: none;
}

.plate-corner-tl { left: 4px; top: 4px; border-width: 1px 0 0 1px; }
.plate-corner-tr { right: 4px; top: 4px; border-width: 1px 1px 0 0; }
.plate-corner-bl { left: 4px; bottom: 4px; border-width: 0 0 1px 1px; }
.plate-corner-br { right: 4px; bottom: 4px; border-width: 0 1px 1px 0; }

.note-card {
  position: absolute;
  z-index: 6;
  left: -18px;
  bottom: 36px;
  width: 268px;
  padding: 18px 20px 15px;
  background: #fcf8ef;
  border: 1px solid rgba(75, 58, 38, 0.18);
  box-shadow: 0 26px 45px -30px rgba(35, 27, 18, 0.6);
  transform: rotate(-3deg);
  transition: transform 0.5s var(--ease);
}

.note-card:hover {
  transform: rotate(-1.6deg) translateY(-3px);
}

.note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
}

.note-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--jade);
  letter-spacing: 0.08em;
}

.note-state i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--jade);
}

.note-card p {
  margin: 14px 0 15px;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.9;
  letter-spacing: 0.05em;
  color: #2d2820;
}

.note-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed rgba(75, 58, 38, 0.2);
  color: var(--muted-2);
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.seal-sticker {
  position: absolute;
  z-index: 7;
  right: 2px;
  top: -24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  padding-top: 1px;
  background: var(--cinnabar);
  color: #f8eddb;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.04em;
  transform: rotate(5deg);
  box-shadow: 0 12px 24px -16px rgba(126, 43, 32, 0.8);
  outline: 1px solid rgba(248, 237, 219, 0.5);
  outline-offset: -5px;
}

.vertical-note {
  position: absolute;
  right: -28px;
  top: 76px;
  margin: 0;
  writing-mode: vertical-rl;
  color: var(--muted-2);
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.3em;
  line-height: 1;
}

.hero-foot {
  display: flex;
  align-items: center;
  gap: 46px;
  margin-top: 12px;
  padding: 25px 0 27px;
  border-top: 1px solid var(--line);
}

.hero-foot-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.hero-foot-item .num {
  color: var(--cinnabar);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  transform: translateY(-7px);
}

.hero-foot-item div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hero-foot-item b {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.hero-foot-item small {
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.03em;
}

.hero-foot-note {
  margin: 0 0 0 auto;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Section scaffolding
   -------------------------------------------------------------------------- */

.section {
  padding: 112px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 44px;
}

.section-head h2 {
  margin: 16px 0 0;
  font-family: var(--serif);
  font-size: clamp(34px, 3.7vw, 50px);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

.section-note {
  max-width: 330px;
  margin: 0 0 5px;
  text-align: right;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 2;
  letter-spacing: 0.03em;
}

.section-note span {
  color: var(--muted-2);
}

/* Engine selector */

.studio-head-side {
  width: 392px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.engine-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 253, 247, 0.42);
}

.engine-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.engine-option:hover:not(:disabled):not(.is-active) {
  color: var(--ink);
  background: rgba(255, 253, 247, 0.7);
}

.engine-option.is-active {
  color: #f6efe1;
  background: var(--ink);
  box-shadow: 0 7px 18px -14px rgba(33, 30, 24, 0.8);
}

.engine-option:disabled {
  opacity: 0.34;
  cursor: not-allowed;
}

.engine-option-mark {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: none;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: inherit;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1;
  opacity: 0.82;
}

.engine-option-mark svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.engine-option-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.engine-option b {
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-option small {
  display: none;
}

.engine-option.is-active .engine-option-mark {
  border-color: rgba(246, 239, 225, 0.3);
  color: #dda38f;
}

.engine-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 1px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.status-led {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--muted-2);
}

.status-led.is-online {
  background: var(--jade);
  box-shadow: 0 0 0 3px rgba(72, 96, 79, 0.08);
}

.status-led.is-offline {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(169, 118, 45, 0.08);
}

.engine-hint {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

.provider-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 5px;
  border: 1px solid rgba(164, 59, 43, 0.2);
  border-radius: 2px;
  color: var(--cinnabar);
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.04em;
  vertical-align: 1px;
}

/* --------------------------------------------------------------------------
   Studio
   -------------------------------------------------------------------------- */

.studio-section {
  background:
    linear-gradient(180deg, transparent 0, rgba(228, 217, 198, 0.48) 12%, rgba(228, 217, 198, 0.48) 88%, transparent 100%);
  padding-top: 48px;
}

.studio-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  height: 760px;
  min-height: 760px;
  border: 1px solid rgba(45, 38, 29, 0.16);
  border-radius: 3px;
  overflow: hidden;
  background: var(--dark);
  box-shadow:
    0 44px 80px -56px rgba(36, 28, 18, 0.7),
    0 3px 0 rgba(255, 255, 255, 0.35) inset;
}

.stage-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    radial-gradient(ellipse at 50% 36%, rgba(84, 75, 60, 0.36), transparent 58%),
    linear-gradient(155deg, #27231d 0%, #1d1a16 58%, #191713 100%);
  color: #eae1d0;
}

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(244, 234, 215, 0.1);
}

.stage-file {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: #bdb29d;
  font-size: 10.5px;
  letter-spacing: 0.05em;
}

.stage-file span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: #756a58;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.status-dot.is-loaded {
  background: #8da58e;
  box-shadow: 0 0 0 4px rgba(141, 165, 142, 0.08);
}

.status-dot.is-working {
  background: var(--cinnabar-soft);
  box-shadow: 0 0 0 4px rgba(193, 106, 84, 0.12);
  animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  50% { opacity: 0.35; }
}

.stage-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(244, 234, 215, 0.13);
  border-radius: 2px;
  background: transparent;
  color: #c9bda8;
  font-size: 9.5px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.mini-btn svg {
  width: 13px;
  height: 13px;
}

.mini-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(244, 234, 215, 0.25);
  color: #f0e7d7;
}

.mini-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.mini-btn.run-mini {
  border-color: var(--cinnabar);
  background: var(--cinnabar);
  color: #fff8ec;
}

.mini-btn.run-mini:hover:not(:disabled) {
  background: var(--cinnabar-deep);
  border-color: var(--cinnabar-deep);
}

.stage-body {
  position: relative;
  flex: 1;
  min-height: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  overflow: hidden;
}

.stage-body::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(238, 228, 211, 0.035);
  pointer-events: none;
}

.drop-state {
  position: relative;
  z-index: 2;
  width: min(100%, 420px);
  text-align: center;
  cursor: pointer;
  transition: transform 0.35s var(--ease);
}

.drop-state:hover {
  transform: translateY(-2px);
}

.drop-art {
  position: relative;
  width: 126px;
  height: 126px;
  margin: 0 auto 22px;
}

.drop-ring {
  position: absolute;
  border: 1px solid rgba(226, 212, 190, 0.09);
  border-radius: 50%;
}

.ring-a { inset: 0; }
.ring-b { inset: 15px; border-color: rgba(226, 212, 190, 0.06); }

.drop-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(226, 212, 190, 0.17);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
  color: #c5b69f;
}

.drop-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: rgba(193, 106, 84, 0.55);
  border-style: solid;
}

.c1 { left: 1px; top: 1px; border-width: 1px 0 0 1px; }
.c2 { right: 1px; top: 1px; border-width: 1px 1px 0 0; }
.c3 { left: 1px; bottom: 1px; border-width: 0 0 1px 1px; }
.c4 { right: 1px; bottom: 1px; border-width: 0 1px 1px 0; }

.drop-state h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #eee4d3;
}

.drop-state > p {
  margin: 0;
  color: #948a77;
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 0.03em;
}

.drop-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin: 25px 0 20px;
}

.drop-state .drop-hint {
  color: #756c5b;
  font-size: 10px;
}

.image-state {
  width: 100%;
  height: 100%;
  min-height: 478px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-image-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 470px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#previewImage {
  display: block;
  max-width: 100%;
  max-height: 545px;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow:
    0 26px 50px -24px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(239, 228, 208, 0.12);
}

#boxCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.stage-scan {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 16%;
  z-index: 4;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(213, 109, 87, 0.95), transparent);
  box-shadow: 0 0 18px rgba(190, 79, 58, 0.55);
  animation: stage-scan 3.4s ease-in-out infinite;
}

@keyframes stage-scan {
  0% { top: 8%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { top: 90%; opacity: 0; }
}

.stage-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(238, 228, 211, 0.14);
  border-radius: 2px;
  background: rgba(21, 18, 14, 0.75);
  color: #c8bca7;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(6px);
}

.stage-badge.is-working {
  color: #e5c7ba;
  border-color: rgba(193, 106, 84, 0.35);
}

.stage-drop-hint {
  position: absolute;
  inset: 15px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed rgba(225, 179, 158, 0.5);
  background: rgba(33, 27, 21, 0.86);
  color: #eadfcc;
  font-size: 12px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(5px);
}

.stage-drop-hint svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--cinnabar-soft);
  stroke-width: 1.3;
}

.stage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 42px;
  padding: 0 22px;
  border-top: 1px solid rgba(244, 234, 215, 0.09);
  color: #7e7462;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
}

.stage-hint kbd {
  display: inline-block;
  padding: 1px 4px;
  border: 1px solid rgba(238, 228, 211, 0.14);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 7px;
  color: #a49a87;
  background: rgba(255, 255, 255, 0.03);
}

/* result pane */

.result-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.55), transparent 18%),
    var(--paper-soft);
  border-left: 1px solid rgba(54, 46, 34, 0.14);
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 25px 30px 21px;
  border-bottom: 1px solid var(--line);
}

.result-title-wrap {
  min-width: 0;
}

.result-kicker {
  margin: 0 0 7px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.result-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confidence-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: none;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.confidence-num {
  color: var(--jade);
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.1;
}

.confidence-num.is-mid { color: var(--amber); }
.confidence-num.is-low { color: var(--cinnabar); }

.confidence-label {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.result-body {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* empty state */

.result-empty {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px 34px;
  overflow: hidden;
}

.empty-watermark {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-54%);
  color: rgba(47, 40, 30, 0.035);
  font-family: var(--serif);
  font-size: 174px;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.empty-title {
  position: relative;
  z-index: 1;
  margin: 0 0 24px;
  text-align: center;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.empty-steps {
  position: relative;
  z-index: 1;
  width: min(100%, 330px);
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.empty-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.empty-step > span {
  width: 21px;
  flex: none;
  padding-top: 1px;
  color: var(--cinnabar);
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.5;
}

.empty-step p {
  margin: 0;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.55;
  letter-spacing: 0.02em;
}

.empty-step small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.02em;
}

/* progress state */

.result-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
}

.progress-top {
  display: flex;
  align-items: center;
  gap: 23px;
}

.progress-ring {
  --value: 0;
  position: relative;
  width: 112px;
  height: 112px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--cinnabar) calc(var(--value) * 1%), rgba(54, 46, 34, 0.09) 0);
  transition: background 0.4s linear;
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--paper-soft);
}

.progress-ring-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.progress-ring-inner span {
  font-family: var(--serif);
  font-size: 35px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
}

.progress-ring-inner small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.progress-copy {
  min-width: 0;
}

.progress-stage {
  margin: 0 0 5px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.progress-sub {
  margin: 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.7;
}

.progress-track {
  height: 2px;
  margin: 27px 0 20px;
  background: rgba(54, 46, 34, 0.1);
  overflow: hidden;
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cinnabar);
  transition: width 0.3s var(--ease);
}

.progress-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.03em;
  transition: color 0.3s ease;
}

.progress-steps li span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  transition: color 0.3s ease;
}

.progress-steps li.is-active {
  color: var(--ink);
}

.progress-steps li.is-active span {
  color: var(--cinnabar);
}

.progress-steps li.is-done {
  color: var(--jade);
}

.progress-steps li.is-done span {
  color: var(--jade);
}

.progress-privacy {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 25px 0 0;
  color: var(--muted-2);
  font-size: 8.5px;
  letter-spacing: 0.03em;
}

.progress-privacy svg {
  width: 13px;
  height: 13px;
  color: var(--jade);
}

/* done state */

.result-done {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 30px 0;
  border-bottom: 1px solid var(--line);
}

.tabs {
  display: flex;
  align-items: center;
  gap: 22px;
}

.tab {
  position: relative;
  padding: 0 0 11px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.25s ease;
}

.tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -1px;
  height: 1.5px;
  background: var(--cinnabar);
  transition: right 0.3s var(--ease);
}

.tab:hover {
  color: var(--ink-2);
}

.tab.active {
  color: var(--ink);
}

.tab.active::after {
  right: 0;
}

.tab sup {
  position: relative;
  top: -0.2em;
  margin-left: 1px;
  color: var(--cinnabar);
  font-family: var(--mono);
  font-size: 7px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.auto-punct-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 9px;
  border: 1px solid rgba(164, 59, 43, 0.25);
  border-radius: 20px;
  background: rgba(164, 59, 43, 0.045);
  color: var(--cinnabar);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.auto-punct-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auto-punct-btn:hover:not(:disabled) {
  border-color: rgba(164, 59, 43, 0.55);
  background: rgba(164, 59, 43, 0.1);
}

.auto-punct-btn.is-active {
  border-color: var(--cinnabar);
  background: var(--cinnabar);
  color: #fbf6ea;
}

.auto-punct-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.low-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 3px 8px;
  border: 1px solid rgba(169, 118, 45, 0.32);
  border-radius: 20px;
  background: rgba(169, 118, 45, 0.05);
  color: var(--amber);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.low-chip:hover {
  background: rgba(169, 118, 45, 0.11);
  border-color: rgba(169, 118, 45, 0.55);
}

.low-chip span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--amber);
}

.low-chip b {
  font-weight: 600;
}

.sync-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 8px 30px 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.sync-mark {
  position: relative;
  width: 11px;
  height: 11px;
  flex: none;
  border: 1px solid rgba(164, 59, 43, 0.42);
}

.sync-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--cinnabar);
  opacity: 0.68;
}

.sync-hint.is-disabled {
  color: var(--muted-2);
}

.sync-hint.is-disabled .sync-mark::after {
  opacity: 0.25;
}

.result-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px 30px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(54, 46, 34, 0.22) transparent;
}

.result-scroll::-webkit-scrollbar {
  width: 8px;
}

.result-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.result-scroll::-webkit-scrollbar-thumb {
  background: rgba(54, 46, 34, 0.18);
  border: 2px solid var(--paper-soft);
  border-radius: 10px;
}

.result-text {
  counter-reset: ocr-line;
  max-width: 640px;
  padding-left: 34px;
  color: #302b22;
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 2.15;
  letter-spacing: 0.025em;
  outline: none;
  caret-color: var(--cinnabar);
}

.result-text.is-vertical {
  width: 100%;
  max-width: none;
  padding-left: 0;
}

.result-text.is-char-board {
  width: 100%;
  max-width: none;
  padding-left: 0;
}

.char-board {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  width: max-content;
  min-width: 100%;
  padding: 6px 0 14px;
}

.char-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: var(--board-gap, 6px);
  width: max-content;
  padding: 2px 0;
  border-radius: 2px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.char-row.low {
  background: linear-gradient(90deg, rgba(169, 118, 45, 0.12), rgba(169, 118, 45, 0.02) 78%, transparent);
  box-shadow: inset 2px 0 0 rgba(169, 118, 45, 0.45);
}

.char-row.is-target {
  animation: line-pulse 1.6s ease;
}

.char-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: none;
  align-items: center;
  gap: 4px;
  width: var(--cell-w, 46px);
  padding: 3px 0;
  border-radius: 2px;
  cursor: text;
  transition: background 0.18s ease;
}

.char-cell:hover {
  background: rgba(164, 59, 43, 0.05);
}

.char-crop {
  width: var(--cell-img, 36px);
  height: var(--cell-img, 36px);
  flex: none;
  border: 1px solid rgba(54, 46, 34, 0.13);
  background-color: #f4eddc;
  background-repeat: no-repeat;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.char-cell:hover .char-crop {
  border-color: rgba(164, 59, 43, 0.42);
}

.char-cell.is-active {
  background: rgba(164, 59, 43, 0.08);
}

.char-cell.is-active .char-crop {
  border-color: var(--cinnabar);
  box-shadow: 0 0 0 2px rgba(164, 59, 43, 0.16);
}

.char-cell.is-active .char-cell-text {
  color: var(--cinnabar);
}

.char-cell-text {
  position: relative;
  min-height: 1.3em;
  color: #302b22;
  font-family: var(--serif);
  font-size: var(--cell-text, 11px);
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
}

.char-cell.is-edited .char-cell-text::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cinnabar);
  transform: translateX(-50%);
}

.vertical-transcript {
  --vt-font: 16px;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.9em;
  min-height: 100%;
  padding: 4px 0 12px;
  color: #302b22;
  font-family: var(--serif);
  font-size: var(--vt-font);
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.ocr-column {
  position: relative;
  flex: none;
  writing-mode: vertical-rl;
  text-orientation: upright;
  white-space: nowrap;
  padding: 2px 0;
  border-radius: 2px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.ocr-column.low {
  padding: 2px 0;
  background: linear-gradient(180deg, rgba(169, 118, 45, 0.13), rgba(169, 118, 45, 0.02) 74%, transparent);
  box-shadow: inset 0 2px 0 rgba(169, 118, 45, 0.5);
}

.ocr-column.is-target {
  animation: line-pulse 1.6s ease;
}

.ocr-char.is-image {
  color: transparent;
  background-color: #f8f2e6;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: inset 0 0 0 1px rgba(54, 46, 34, 0.12);
}

.ocr-char.is-image.is-active {
  box-shadow: inset 0 0 0 2px var(--cinnabar);
}

.ocr-char.is-image::after {
  display: none;
}

.ocr-char.is-image.is-edited {
  color: transparent;
}

.ocr-line {
  position: relative;
  min-height: 2.15em;
  margin: 0;
  padding: 1px 7px 1px 0;
  border-radius: 1px;
  counter-increment: ocr-line;
  white-space: pre-wrap;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.ocr-line::before {
  content: counter(ocr-line, decimal-leading-zero);
  position: absolute;
  left: -34px;
  top: 0.84em;
  color: rgba(54, 46, 34, 0.3);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.ocr-line.low {
  margin-left: -8px;
  padding-left: 8px;
  background: linear-gradient(90deg, rgba(169, 118, 45, 0.13), rgba(169, 118, 45, 0.025) 72%, transparent);
  box-shadow: inset 2px 0 0 rgba(169, 118, 45, 0.52);
}

.ocr-line.low::before {
  color: rgba(169, 118, 45, 0.75);
}

.ocr-line.is-target {
  animation: line-pulse 1.6s ease;
}

.ocr-char {
  position: relative;
  display: inline-block;
  padding: 0.07em 0.015em;
  margin: 0 -0.005em;
  border-radius: 2px;
  cursor: text;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.ocr-char:hover {
  background: rgba(164, 59, 43, 0.1);
  box-shadow: inset 0 -1px 0 rgba(164, 59, 43, 0.38);
}

.ocr-char.is-active {
  background: var(--cinnabar);
  color: #fff7e9;
  box-shadow: 0 0 0 2px rgba(164, 59, 43, 0.15);
}

.ocr-char.is-edited::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cinnabar);
  transform: translateX(-50%);
}

.ocr-char.is-active.is-edited::after {
  background: #f8e7d1;
}

@keyframes line-pulse {
  0%, 100% { background-color: transparent; }
  25% { background-color: rgba(164, 59, 43, 0.12); }
}

.result-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 7px 30px 0;
  color: var(--muted-2);
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

.legend-mark {
  width: 9px;
  height: 9px;
  flex: none;
  border-left: 2px solid rgba(169, 118, 45, 0.55);
  background: rgba(169, 118, 45, 0.13);
}

.result-legend.is-hidden {
  visibility: hidden;
}

.char-editor {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 30px;
  border-top: 1px solid rgba(54, 46, 34, 0.14);
  background: linear-gradient(180deg, var(--paper-deep), #e7dcc8);
  box-shadow: 0 -10px 22px -22px rgba(40, 31, 20, 0.7);
}

.char-editor-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.char-editor-kicker {
  color: var(--cinnabar);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.char-editor-pos {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.char-editor-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.char-editor-preview {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.52);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
}

.char-editor-preview.is-image {
  color: transparent;
  background-color: #f8f2e6;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.char-editor-blank-btn,
.char-editor-insert-btn,
.char-editor-delete-btn {
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: transparent;
  color: var(--ink-2);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.char-editor-blank-btn:hover,
.char-editor-insert-btn:hover,
.char-editor-delete-btn:hover {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
}

.char-editor-blank-btn.is-on {
  border-color: rgba(164, 59, 43, 0.4);
  background: rgba(164, 59, 43, 0.1);
  color: var(--cinnabar);
}

.char-editor-blank-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.char-editor-arrow {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 11px;
}

.char-editor-input {
  width: 48px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #fffdf7;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.char-editor-input:focus {
  border-color: var(--cinnabar);
  box-shadow: 0 0 0 2px rgba(164, 59, 43, 0.1);
}

.btn-xs {
  height: 30px;
  padding: 0 11px;
  font-size: 10px;
}

.char-editor-cancel {
  padding: 6px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.2s ease;
}

.char-editor-cancel:hover {
  color: var(--ink);
}

#previewImage {
  cursor: crosshair;
}

.result-foot {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 10px 30px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.32);
}

.result-stats {
  display: flex;
  align-items: baseline;
  gap: 16px;
  color: var(--muted-2);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.result-stats b {
  margin-right: 2px;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 13px;
  flex: none;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 10px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.25s ease, opacity 0.25s ease;
}

.icon-action svg {
  width: 15px;
  height: 15px;
}

.icon-action:hover:not(:disabled) {
  color: var(--cinnabar);
}

.icon-action:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.studio-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 20px 0 0;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.02em;
  text-align: center;
}

.studio-note svg {
  width: 13px;
  height: 13px;
  color: var(--jade);
}

/* --------------------------------------------------------------------------
   Sample gallery
   -------------------------------------------------------------------------- */

.samples-section {
  padding-top: 104px;
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 23px;
}

.sample-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease),
    border-color 0.45s ease;
}

.sample-card:hover,
.sample-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(54, 46, 34, 0.27);
  box-shadow: 0 30px 45px -38px rgba(42, 33, 22, 0.55);
}

.sample-image {
  position: relative;
  aspect-ratio: 1.24 / 1;
  overflow: hidden;
  background: #e6dcc8;
}

.sample-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(42, 33, 22, 0.06), transparent 30%, rgba(42, 33, 22, 0.18));
  pointer-events: none;
}

.sample-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 33%;
  transition: transform 0.9s var(--ease), filter 0.9s ease;
  filter: saturate(0.94) contrast(1.01);
}

.sample-card:hover .sample-image img {
  transform: scale(1.025);
  filter: saturate(1) contrast(1.02);
}

.sample-index {
  position: absolute;
  z-index: 2;
  left: 13px;
  top: 13px;
  padding: 4px 8px;
  background: rgba(248, 242, 230, 0.88);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  backdrop-filter: blur(5px);
}

.sample-open {
  position: absolute;
  z-index: 2;
  right: 13px;
  top: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  background: rgba(28, 24, 19, 0.82);
  color: #f1e6d3;
  font-size: 8.5px;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease);
  backdrop-filter: blur(5px);
}

.sample-open svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sample-card:hover .sample-open {
  opacity: 1;
  transform: translateY(0);
}

.sample-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 20px 20px;
  flex: 1;
}

.sample-body > div {
  min-width: 0;
}

.sample-cat {
  margin: 0 0 7px;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.sample-body h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.sample-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 10.5px;
  line-height: 1.9;
  letter-spacing: 0.01em;
}

.sample-arrow {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-2);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease,
    transform 0.3s var(--ease);
}

.sample-arrow svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sample-card:hover .sample-arrow {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
  color: #fbf6ea;
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Quote
   -------------------------------------------------------------------------- */

.quote-band {
  padding: 76px 0 70px;
  background: var(--paper-deep);
  border-top: 1px solid rgba(54, 46, 34, 0.1);
  border-bottom: 1px solid rgba(54, 46, 34, 0.1);
}

.quote-inner {
  position: relative;
  text-align: center;
}

.quote-mark {
  display: block;
  height: 28px;
  color: var(--cinnabar);
  font-family: var(--serif);
  font-size: 58px;
  line-height: 0.9;
  opacity: 0.55;
}

.quote-inner blockquote {
  margin: 8px 0 13px;
  font-family: var(--serif);
  font-size: clamp(27px, 3.3vw, 40px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.quote-inner cite {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.22em;
}

/* --------------------------------------------------------------------------
   About / dark section
   -------------------------------------------------------------------------- */

.about-section {
  position: relative;
  overflow: hidden;
  padding: 110px 0 0;
  background:
    radial-gradient(ellipse at 95% 15%, rgba(164, 59, 43, 0.13), transparent 36%),
    linear-gradient(150deg, #211e19 0%, #1b1915 55%, #171510 100%);
  color: #eee5d4;
}

.about-section::before {
  content: "识古";
  position: absolute;
  right: -16px;
  top: -70px;
  color: rgba(255, 255, 255, 0.023);
  font-family: var(--serif);
  font-size: 390px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.1em;
  writing-mode: vertical-rl;
  pointer-events: none;
  user-select: none;
}

.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 90px;
  align-items: start;
  position: relative;
  z-index: 1;
}

.about-copy h2 {
  margin: 21px 0 24px;
  font-family: var(--serif);
  font-size: clamp(34px, 3.5vw, 48px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #f1e7d5;
}

.about-copy h2 em {
  font-style: normal;
  color: #d9846b;
}

.about-lede {
  max-width: 480px;
  margin: 0 0 31px;
  color: #a99e8a;
  font-size: 13px;
  line-height: 2.1;
}

.feature-list {
  border-top: 1px solid rgba(238, 229, 212, 0.13);
}

.feature-item {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  gap: 15px;
  padding: 23px 0 24px;
  border-bottom: 1px solid rgba(238, 229, 212, 0.13);
}

.feature-num {
  padding-top: 2px;
  color: #b76a55;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.feature-item h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #e9dfcc;
}

.feature-item p {
  margin: 0;
  color: #918775;
  font-size: 11px;
  line-height: 1.95;
}

.engine-strip {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-top: 72px;
  padding: 21px 0;
  border-top: 1px solid rgba(238, 229, 212, 0.13);
  color: #7e7564;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.engine-strip b {
  color: #b6aa94;
  font-weight: 500;
}

.engine-note {
  margin-left: auto;
  color: #a46c5c;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  padding: 52px 0 25px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.footer-top {
  display: flex;
  align-items: center;
  gap: 40px;
}

.footer-brand .brand-seal {
  width: 33px;
  height: 33px;
  font-size: 18px;
}

.footer-line {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.footer-nav {
  margin-left: auto;
  display: flex;
  gap: 28px;
}

.footer-nav a {
  color: var(--muted);
  font-size: 10.5px;
}

.footer-nav a:hover {
  color: var(--ink);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 35px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   Overlays
   -------------------------------------------------------------------------- */

.drag-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  place-items: center;
  background: rgba(24, 20, 15, 0.86);
  backdrop-filter: blur(10px);
}

body.is-dragging .drag-overlay {
  display: grid;
}

.drag-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(560px, calc(100vw - 48px));
  height: min(340px, calc(100vh - 96px));
  border: 1px dashed rgba(233, 207, 190, 0.47);
  color: #efe4d1;
}

.drag-overlay-inner svg {
  width: 38px;
  height: 38px;
  margin-bottom: 7px;
  fill: none;
  stroke: #d0836c;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drag-overlay-inner b {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.drag-overlay-inner span {
  color: #938673;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px;
  background: rgba(18, 15, 11, 0.94);
  backdrop-filter: blur(12px);
}

.lightbox img {
  max-width: min(86vw, 1000px);
  max-height: 82vh;
  object-fit: contain;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}

.lightbox p {
  margin: 0;
  color: #9e927e;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(238, 228, 211, 0.18);
  border-radius: 50%;
  background: transparent;
  color: #e9dfcc;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(238, 228, 211, 0.4);
}

.lightbox-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 40px);
  padding: 11px 17px;
  border: 1px solid rgba(238, 228, 211, 0.14);
  border-left: 2px solid var(--cinnabar-soft);
  background: rgba(27, 23, 18, 0.95);
  color: #eee4d2;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  box-shadow: 0 20px 40px -22px rgba(0, 0, 0, 0.8);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.35s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-mark {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--cinnabar-soft);
}

.toast.is-error {
  border-left-color: #c6553f;
}

/* --------------------------------------------------------------------------
   Reveal transitions
   -------------------------------------------------------------------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.js .sample-card:nth-child(2) {
  transition-delay: 0.08s;
}

.js .sample-card:nth-child(3) {
  transition-delay: 0.16s;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .container {
    width: min(calc(100% - 64px), var(--max));
  }

  .hero-inner {
    gap: 30px;
  }

  .hero-plate-wrap {
    width: min(100%, 430px);
    padding-right: 12px;
  }

  .note-card {
    left: -8px;
    transform: rotate(-2.5deg) scale(0.94);
    transform-origin: left bottom;
  }

  .vertical-note {
    display: none;
  }

  .hero-foot {
    gap: 30px;
  }

  .hero-foot-note {
    display: none;
  }

  .studio-shell {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  }

  .result-head,
  .result-toolbar,
  .result-scroll,
  .result-foot,
  .result-legend {
    padding-left: 24px;
    padding-right: 24px;
  }

  .about-inner {
    gap: 64px;
  }
}

@media (max-width: 980px) {
  .header-inner {
    height: 68px;
  }

  .main-nav {
    display: none;
  }

  .header-actions {
    gap: 12px;
  }

  .hero {
    padding-top: 54px;
  }

  .hero::before {
    font-size: 220px;
    left: -70px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 0;
  }

  .hero-copy {
    max-width: 680px;
    padding-bottom: 28px;
  }

  .hero h1 {
    font-size: clamp(54px, 10vw, 82px);
  }

  .hero-visual {
    width: min(100%, 540px);
    margin: 0 auto;
    padding-bottom: 55px;
  }

  .hero-plate-wrap {
    width: 100%;
    padding: 18px 60px 76px 42px;
  }

  .note-card {
    left: 6px;
    bottom: 26px;
    transform: rotate(-2.2deg) scale(0.95);
  }

  .hero-foot {
    margin-top: 0;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 18px 26px;
  }

  .hero-foot-note {
    display: block;
    width: 100%;
    margin: 0;
    text-align: right;
  }

  .section {
    padding: 88px 0;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 34px;
  }

  .section-note {
    max-width: none;
    text-align: left;
  }

  .studio-head-side {
    width: min(100%, 460px);
  }

  .studio-section {
    padding-top: 40px;
  }

  .studio-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .stage-pane {
    min-height: 620px;
  }

  .stage-body {
    min-height: 505px;
  }

  .result-pane {
    border-left: 0;
    border-top: 1px solid rgba(54, 46, 34, 0.16);
    height: 640px;
    min-height: 640px;
  }

  .result-body {
    min-height: 0;
  }

  .result-empty {
    padding: 48px 32px;
  }

  .result-progress {
    padding: 44px;
  }

  .sample-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sample-card:last-child {
    grid-column: span 2;
    width: calc(50% - 12px);
    justify-self: center;
  }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 58px;
  }

  .about-section {
    padding-top: 90px;
  }

  .about-copy h2 {
    max-width: 680px;
  }

  .engine-strip {
    margin-top: 56px;
    flex-wrap: wrap;
    gap: 12px 28px;
  }

  .engine-note {
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .container {
    width: calc(100% - 40px);
  }

  .header-inner {
    width: calc(100% - 36px);
    gap: 12px;
  }

  .brand-seal {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .brand-type b {
    font-size: 19px;
  }

  .brand-type small {
    font-size: 6.5px;
  }

  .privacy-pill {
    display: none;
  }

  .btn {
    height: 43px;
    padding: 0 17px;
    font-size: 12px;
  }

  .header-actions .btn {
    height: 35px;
    padding: 0 12px;
    font-size: 10.5px;
  }

  .header-actions .btn svg {
    width: 14px;
    height: 14px;
  }

  .hero {
    padding-top: 42px;
  }

  .hero h1 {
    margin-top: 20px;
    font-size: clamp(47px, 13.2vw, 66px);
  }

  .hero-lede {
    font-size: 14px;
    line-height: 1.95;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
    margin-top: 27px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-meta {
    font-size: 9px;
  }

  .hero-meta li + li::before {
    margin: 0 10px;
  }

  .hero-plate-wrap {
    padding: 12px 40px 70px 28px;
  }

  .plate-annot-top {
    right: 44px;
  }

  .note-card {
    width: 224px;
    padding: 14px 16px 12px;
    left: 18px;
    bottom: 20px;
  }

  .note-card p {
    font-size: 16px;
    margin: 10px 0 11px;
  }

  .seal-sticker {
    width: 48px;
    height: 48px;
    right: 4px;
    top: -16px;
    font-size: 15px;
  }

  .hero-foot {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 17px 18px;
    padding: 21px 0;
  }

  .hero-foot-item {
    gap: 8px;
  }

  .hero-foot-item:nth-child(3) {
    grid-column: span 2;
  }

  .hero-foot-note {
    display: none;
  }

  .hero-foot-item b {
    font-size: 12px;
  }

  .hero-foot-item small {
    font-size: 8.5px;
  }

  .section {
    padding: 74px 0;
  }

  .section-head h2 {
    font-size: 31px;
    line-height: 1.4;
  }

  .section-note {
    font-size: 9.5px;
  }

  .studio-head-side {
    width: 100%;
    gap: 7px;
  }

  .engine-option {
    gap: 7px;
    padding: 8px;
  }

  .engine-option-mark {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .engine-option b {
    font-size: 10.5px;
  }

  .engine-option small {
    font-size: 7px;
  }

  .engine-hint {
    font-size: 8.5px;
  }

  .br-mobile {
    display: inline;
  }

  .studio-section {
    padding-top: 32px;
  }

  .stage-pane {
    min-height: 560px;
  }

  .stage-bar {
    padding: 0 13px;
    gap: 8px;
  }

  .stage-file {
    font-size: 9.5px;
    max-width: 42%;
  }

  .mini-btn span {
    display: none;
  }

  .mini-btn {
    width: 30px;
    justify-content: center;
    padding: 0;
  }

  .mini-btn.run-mini {
    width: auto;
    padding: 0 9px;
  }

  .mini-btn.run-mini span {
    display: inline;
    font-size: 9px;
  }

  .stage-body {
    min-height: 440px;
    padding: 18px;
  }

  .stage-body::before {
    inset: 10px;
  }

  .drop-state h3 {
    font-size: 22px;
  }

  .drop-state > p {
    font-size: 10px;
  }

  .drop-art {
    width: 108px;
    height: 108px;
    margin-bottom: 17px;
  }

  .drop-actions {
    margin-top: 20px;
  }

  #previewImage {
    max-height: 420px;
  }

  .stage-image-shell {
    min-height: 390px;
  }

  .image-state {
    min-height: 390px;
  }

  .stage-foot {
    padding: 0 14px;
    font-size: 7px;
  }

  .stage-hint {
    display: none;
  }

  .result-pane {
    height: 600px;
    min-height: 600px;
  }

  .result-head {
    padding: 20px 20px 17px;
  }

  .result-head h3 {
    font-size: 21px;
  }

  .confidence-badge {
    padding-left: 14px;
  }

  .confidence-num {
    font-size: 22px;
  }

  .result-empty {
    padding: 38px 20px;
  }

  .empty-watermark {
    font-size: 135px;
  }

  .result-progress {
    padding: 30px 20px;
  }

  .progress-top {
    gap: 16px;
  }

  .progress-ring {
    width: 94px;
    height: 94px;
  }

  .progress-ring-inner span {
    font-size: 29px;
  }

  .progress-stage {
    font-size: 16px;
  }

  .result-toolbar,
  .result-scroll,
  .result-foot,
  .result-legend {
    padding-left: 20px;
    padding-right: 20px;
  }

  .result-toolbar {
    gap: 8px;
  }

  .sync-hint {
    padding: 7px 20px 2px;
    font-size: 8.5px;
  }

  .char-editor {
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px 20px;
  }

  .char-editor-info {
    width: 100%;
    justify-content: space-between;
  }

  .char-editor-controls {
    width: 100%;
    justify-content: flex-end;
  }

  .char-editor-preview,
  .char-editor-input {
    width: 33px;
    height: 33px;
    font-size: 20px;
  }

  .tabs {
    gap: 14px;
  }

  .tab {
    font-size: 10.5px;
  }

  .low-chip {
    padding: 3px 6px;
    font-size: 8px;
  }

  .result-text {
    padding-left: 26px;
    font-size: 16.5px;
    line-height: 2.1;
  }

  .ocr-line::before {
    left: -26px;
    font-size: 7px;
  }

  .result-foot {
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .result-stats {
    gap: 12px;
  }

  .result-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .studio-note {
    align-items: flex-start;
    text-align: left;
    font-size: 8.5px;
    line-height: 1.8;
  }

  .sample-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .sample-card:last-child {
    grid-column: auto;
    width: 100%;
  }

  .sample-image {
    aspect-ratio: 1.38 / 1;
  }

  .sample-body h3 {
    font-size: 19px;
  }

  .quote-band {
    padding: 58px 0 54px;
  }

  .quote-inner blockquote {
    font-size: 25px;
    letter-spacing: 0.07em;
  }

  .about-section {
    padding-top: 75px;
  }

  .about-copy h2 {
    font-size: 34px;
  }

  .about-lede {
    font-size: 12px;
  }

  .feature-item {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    padding: 19px 0;
  }

  .feature-item h3 {
    font-size: 16px;
  }

  .engine-strip {
    margin-top: 45px;
    font-size: 7px;
    gap: 9px 18px;
  }

  .footer-top {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px 18px;
  }

  .footer-line {
    width: 100%;
    order: 3;
    font-size: 11px;
  }

  .footer-nav {
    margin-left: auto;
    gap: 15px;
  }

  .footer-nav a {
    font-size: 9.5px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    font-size: 7.5px;
    line-height: 1.7;
  }

  .lightbox {
    padding: 20px;
  }

  .lightbox-close {
    top: 15px;
    right: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Published library catalog */
.catalog-section {
  background: var(--paper-deep);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-top: 54px;
  padding-bottom: 58px;
}

.catalog-intro {
  max-width: 330px;
  color: var(--muted);
  font-size: 10px;
  line-height: 2;
}

.catalog-categories {
  display: grid;
  gap: 34px;
  margin-top: 28px;
}

.catalog-group h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}

.catalog-group h3 span {
  color: var(--muted-2);
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.catalog-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  min-height: 96px;
  padding: 9px;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.catalog-card:hover {
  border-color: rgba(164, 59, 43, 0.38);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -24px rgba(37, 29, 19, 0.6);
}

.catalog-cover {
  display: grid;
  place-items: center;
  width: 64px;
  height: 82px;
  overflow: hidden;
  border: 1px solid rgba(54, 46, 34, 0.16);
  background: #ece3d2;
  color: rgba(95, 72, 43, 0.35);
  font-family: var(--serif);
  font-size: 26px;
}

.catalog-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.catalog-card-body {
  min-width: 0;
  padding: 2px 0;
}

.catalog-card-cat {
  margin: 0 0 5px;
  color: var(--cinnabar);
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.catalog-card h4 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-card-author {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 8px;
}

.catalog-card-desc {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.catalog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted-2);
  font-family: var(--sans);
  font-size: 7px;
}

.catalog-card-meta b {
  color: var(--cinnabar);
  font-weight: 500;
}

.catalog-empty {
  padding: 28px 20px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
  text-align: center;
}

.catalog-loading {
  color: var(--muted-2);
  font-size: 9px;
}

@media (max-width: 640px) {
  .catalog-section {
    padding-top: 34px;
    padding-bottom: 38px;
  }

  .catalog-intro {
    max-width: none;
  }

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

  .catalog-group h3 {
    font-size: 17px;
  }
}

/* BOWEN global categories + app subnavigation */
.app-subnav {
  position: relative;
  z-index: 24;
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
}

.app-subnav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(1220px, calc(100% - 48px));
  min-height: 38px;
  margin: 0 auto;
  overflow-x: auto;
}

.app-subnav a {
  position: relative;
  flex: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.app-subnav a:hover {
  color: var(--cinnabar);
}

.app-subnav a.is-current {
  color: var(--ink);
  font-weight: 600;
}

.app-subnav a.is-current::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -12px;
  left: 0;
  height: 1px;
  background: var(--cinnabar);
}

@media (max-width: 640px) {
  .app-subnav-inner {
    width: calc(100% - 24px);
    gap: 18px;
    min-height: 34px;
  }

  .app-subnav a {
    font-size: 9px;
  }

  .app-subnav a.is-current::after {
    bottom: -9px;
  }
}

.main-nav a.is-current {
  color: var(--ink);
}

.main-nav a.is-current::after {
  right: 0;
}

/* Refined secondary navigation */
.app-subnav {
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.72), rgba(244, 237, 224, 0.58));
  border-bottom: 1px solid rgba(54, 46, 34, 0.1);
}

.app-subnav-inner {
  width: min(calc(100% - 64px), 1400px);
  min-height: 44px;
  padding: 5px 0;
  gap: 2px;
  overflow: visible;
  scrollbar-width: none;
}

.app-subnav-inner::-webkit-scrollbar {
  display: none;
}

.app-subnav-inner::before {
  content: "识古";
  margin-right: 12px;
  padding-right: 13px;
  border-right: 1px solid rgba(54, 46, 34, 0.14);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.app-subnav a {
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.app-subnav a:hover {
  background: rgba(164, 59, 43, 0.05);
  color: var(--ink);
}

.app-subnav a.is-current {
  border-color: rgba(164, 59, 43, 0.22);
  background: rgba(164, 59, 43, 0.075);
  color: var(--cinnabar);
  font-weight: 500;
}

.app-subnav a.is-current::after {
  display: none;
}

@media (max-width: 640px) {
  .app-subnav-inner {
    width: calc(100% - 24px);
    min-height: 38px;
    gap: 1px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .app-subnav-inner::before {
    display: none;
  }

  .app-subnav a {
    padding: 5px 8px;
    font-size: 8px;
  }
}

/* unified main navigation: fit the added Áéǩ entry on tablet widths */
@media (min-width: 761px) and (max-width: 1200px) {
  .header-inner { gap: 16px; }
  .main-nav { gap: 18px; margin-left: 16px; }
  .main-nav a { font-size: 11px; }
}

/* mobile: keep the site-wide categories reachable as a scrollable row */
@media (max-width: 940px) {
  .header-inner { height: auto; flex-wrap: wrap; padding: 10px 0 0; gap: 8px; }
  .main-nav { display: flex; order: 3; width: 100%; gap: 16px; margin: 2px 0 8px; overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { font-size: 11.5px; white-space: nowrap; }
}

/* nine entries: compact before the scrollable mobile row */
@media (min-width: 941px) and (max-width: 1200px) {
  .header-inner { gap: 12px; }
  .main-nav { gap: 10px; margin-left: 10px; }
  .main-nav a { font-size: 10.5px; letter-spacing: .02em; }
}

@media (max-width: 940px) {
  .main-nav { flex-wrap: wrap; overflow: visible; }
}

@media (max-width: 480px) {
  .main-nav { flex-wrap: nowrap; gap: 10px; overflow-x: auto; }
  .main-nav a { font-size: 11px; letter-spacing: 0; }
}
