:root {
  --paper: #F6F1E7;
  --paper-2: #FBF8F1;
  --paper-3: #FFFDF8;
  --ink: #26251F;
  --ink-soft: #3D3B33;
  --muted: #7C7568;
  --muted-2: #9A9284;
  --line: #DED4C3;
  --line-soft: #E9E2D4;
  --accent: #B2542F;
  --accent-soft: #F0E1D6;
  --sage: #5B6F5E;
  --sage-soft: #E4E9E0;
  --gold: #A98446;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --shadow: 0 24px 60px -32px rgba(58, 50, 38, .35);
  --radius: 6px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(178, 84, 47, .07), transparent 65%),
    radial-gradient(800px 500px at 0% 30%, rgba(91, 111, 94, .06), transparent 60%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .32;
  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='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E");
}

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 56px);
  background: rgba(246, 241, 231, .82);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid rgba(222, 212, 195, .6);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--serif);
  letter-spacing: .04em;
}

.brand-mark { width: 28px; height: 28px; color: var(--ink); }

.brand-text { font-size: 16px; }

.site-nav {
  display: flex;
  gap: clamp(16px, 3vw, 32px);
  font-size: 14px;
  color: var(--muted);
}

.site-nav a {
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}

.site-nav a:hover { color: var(--ink); border-color: var(--accent); }

.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
}

.history-open {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgba(255, 255, 255, .45);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .2s, color .2s, background-color .2s;
}

.history-open:hover { border-color: var(--accent); color: var(--accent); }
.history-open svg { width: 15px; height: 15px; }

.history-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 100px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  line-height: 1;
}

main {
  position: relative;
  z-index: 2;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px) 80px;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: .28em;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px);
}

.hero h1 {
  margin: 0 0 24px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 4.9vw, 58px);
  line-height: 1.2;
  letter-spacing: .01em;
}

.hero h1::after {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: .18em;
}

.lede {
  max-width: 34em;
  margin: 0 0 26px;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.95;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 13px;
  color: var(--muted);
}

.hero-facts span { display: inline-flex; align-items: center; gap: 8px; }

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
  display: inline-block;
}

.hero-art { display: flex; justify-content: flex-end; }

.art-card {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1 / 1;
  padding: 22px;
  background:
    linear-gradient(var(--paper-3), var(--paper-3)) padding-box,
    linear-gradient(150deg, rgba(178, 84, 47, .35), rgba(91, 111, 94, .25)) border-box;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: var(--shadow);
  transform: rotate(-1.2deg);
}

.art-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  pointer-events: none;
}

.htp-art { width: 100%; height: 100%; color: var(--ink-soft); }

.draw {
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  animation: draw-in 2.6s cubic-bezier(.2, .7, .3, 1) forwards;
}
.d1 { animation-delay: .1s; } .d2 { animation-delay: .25s; } .d3 { animation-delay: .4s; }
.d4 { animation-delay: .55s; } .d5 { animation-delay: .65s; } .d6 { animation-delay: .3s; }
.d7 { animation-delay: .45s; } .d8 { animation-delay: .6s; } .d9 { animation-delay: .75s; }
.d10 { animation-delay: .85s; } .d11 { animation-delay: .95s; }

@keyframes draw-in { to { stroke-dashoffset: 0; } }

.art-caption {
  position: absolute;
  right: 18px;
  bottom: 12px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--muted-2);
}

/* ---------- Section heads ---------- */
.section-head { max-width: 680px; margin-bottom: 28px; }

.section-head h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.3;
}

.section-sub { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.9; }

/* ---------- Workspace / upload ---------- */
.workspace { padding: 24px 0 40px; scroll-margin-top: 90px; }

.panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3.4vw, 38px);
  box-shadow: 0 20px 50px -40px rgba(58, 50, 38, .5);
}

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 288px;
  padding: 32px 24px;
  border: 1.5px dashed var(--line);
  border-radius: 4px;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 31px, rgba(222, 212, 195, .35) 32px);
  cursor: pointer;
  text-align: center;
  transition: border-color .25s, background-color .25s, transform .25s;
}

.upload-zone:hover,
.upload-zone:focus-visible,
.upload-zone.is-drag {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  outline: none;
}

.upload-icon { color: var(--accent); width: 52px; height: 52px; margin-bottom: 8px; }
.upload-icon svg { width: 100%; height: 100%; }

.upload-title { margin: 0; font-family: var(--serif); font-size: 20px; }

.upload-hint { margin: 0 0 14px; font-size: 13px; color: var(--muted); }

.upload-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.preview {
  display: flex;
  gap: clamp(16px, 3vw, 32px);
  align-items: flex-start;
  padding: 4px 0 8px;
}

.preview-img-wrap { position: relative; flex: 0 0 auto; }

.preview-img-wrap img {
  display: block;
  width: clamp(150px, 24vw, 230px);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 12px 30px -18px rgba(58, 50, 38, .45);
}

.preview-remove {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper-3);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.preview-remove:hover { color: var(--accent); border-color: var(--accent); }

.preview-side { padding-top: 6px; }
.preview-label { margin: 0 0 4px; font-family: var(--serif); font-size: 19px; }
.preview-meta { margin: 0 0 10px; font-size: 13px; color: var(--muted); }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 13.5px;
  cursor: pointer;
  border-bottom: 1px solid rgba(178, 84, 47, .35);
  line-height: 1.6;
}
.link-btn:hover { border-color: var(--accent); }

.meta { margin-top: 26px; border-top: 1px solid var(--line-soft); padding-top: 22px; }

.meta-head h3 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 17px;
}
.meta-head span { font-family: var(--sans); font-size: 12.5px; color: var(--muted); font-weight: 400; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 20px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-wide { grid-column: 1 / -1; }

.field span { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 8px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  border-radius: 0;
  transition: border-color .2s;
}

.field select { appearance: none; cursor: pointer; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.field textarea { resize: vertical; min-height: 48px; line-height: 1.7; }

.field input::placeholder,
.field textarea::placeholder { color: var(--muted-2); }

.panel-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}
.privacy-note svg { width: 15px; height: 15px; flex: 0 0 auto; }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-soft);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  cursor: pointer;
}

.consent input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 3px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 22px;
  border-radius: 3px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 14.5px;
  letter-spacing: .02em;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .22s, color .22s, border-color .22s, transform .18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn svg { width: 17px; height: 17px; }

.btn-primary { background: var(--ink); color: var(--paper-3); }
.btn-primary:hover { background: var(--accent); }
.btn-primary:disabled {
  background: #C9C2B6;
  color: #F4EFE6;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn-ghost:hover { border-color: var(--ink-soft); background: rgba(255, 255, 255, .5); }

.form-error {
  margin: 14px 0 0;
  color: #A33A2A;
  font-size: 13.5px;
}

.mobile-only { display: none; }

/* ---------- Report ---------- */
.report {
  padding: 40px 0 20px;
  scroll-margin-top: 84px;
}

.report-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.report-thumb {
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.report-thumb img { width: 100%; height: 100%; object-fit: contain; }

.report-title-wrap h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(24px, 3vw, 32px);
}
.report-meta { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.stream-bar {
  position: sticky;
  top: 68px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: rgba(38, 37, 31, .92);
  color: #F3EDE2;
  font-size: 13px;
  border-radius: 3px;
  backdrop-filter: blur(8px);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #C9794F;
  animation: pulse 1.6s ease-in-out infinite;
  flex: 0 0 auto;
}

@keyframes pulse {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

.stream-count { margin-left: auto; color: #BCB2A2; font-variant-numeric: tabular-nums; }

.stream-bar.is-done { background: rgba(91, 111, 94, .95); }
.stream-bar.is-done .pulse-dot { background: #DCE7D6; animation: none; }
.stream-bar.is-done .stream-count { color: #D8E2D3; }

.markdown code {
  padding: 1px 5px;
  background: rgba(178, 84, 47, .08);
  border-radius: 2px;
  font-size: .92em;
  color: #7A3B22;
}

.report-paper {
  position: relative;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: clamp(24px, 5vw, 64px) clamp(20px, 5vw, 68px);
  box-shadow: var(--shadow);
  min-height: 320px;
}

.report-paper::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: clamp(12px, 2.4vw, 34px);
  width: 1px;
  background: rgba(178, 84, 47, .18);
}

.markdown { position: relative; max-width: 40em; margin: 0 auto; }

.markdown h2 {
  position: relative;
  margin: 2.1em 0 .8em;
  padding-top: 1.1em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(20px, 2.4vw, 25px);
  line-height: 1.5;
  border-top: 1px solid var(--line-soft);
}
.markdown > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.markdown h2::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 42px;
  height: 2px;
  background: var(--accent);
}
.markdown > h2:first-child::before { display: none; }

.markdown h3 {
  margin: 1.8em 0 .6em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18.5px;
  color: var(--ink);
}

.markdown p { margin: .9em 0; font-size: 16px; line-height: 2; color: var(--ink-soft); }

.markdown ul,
.markdown ol { margin: .8em 0 1.1em; padding-left: 0; list-style: none; }

.markdown li {
  position: relative;
  padding-left: 1.3em;
  margin: .5em 0;
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--ink-soft);
}

.markdown ul > li::before {
  content: "";
  position: absolute;
  left: .15em;
  top: .82em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
}

.markdown ol { counter-reset: item; }
.markdown ol > li { counter-increment: item; padding-left: 1.9em; }
.markdown ol > li::before {
  content: counter(item) ".";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 14px;
}

.markdown strong { color: var(--ink); font-weight: 600; }

.markdown blockquote {
  position: relative;
  margin: 1.2em 0;
  padding: 18px 24px 18px 26px;
  background: linear-gradient(100deg, var(--accent-soft), rgba(240, 225, 214, .25));
  border-left: 2px solid var(--accent);
  border-radius: 0 3px 3px 0;
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.9;
  color: #6B3B23;
}
.markdown blockquote p { margin: 0; color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; }
.markdown blockquote::before {
  content: "“";
  position: absolute;
  left: 6px;
  top: -10px;
  font-family: var(--serif);
  font-size: 42px;
  color: rgba(178, 84, 47, .3);
}

.markdown hr { border: 0; border-top: 1px solid var(--line-soft); margin: 2em 0; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .6);
  border-radius: 100px;
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: .02em;
}

.tag-label {
  display: block;
  margin: 18px 0 0;
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--muted-2);
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: -.16em;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}

.report-foot {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: rgba(251, 248, 241, .7);
  font-size: 12.8px;
  line-height: 1.85;
  color: var(--muted);
}
.report-foot p { margin: 0; }
.report-foot strong { color: var(--ink-soft); }

.cancel-row { margin-top: 16px; text-align: center; }

/* ---------- Symbols ---------- */
.symbols { padding: 72px 0 24px; }

.symbol-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.symbol-card {
  padding: 28px 26px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: transform .25s, box-shadow .25s;
}

.symbol-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -28px rgba(58, 50, 38, .5); }

.symbol-card svg { width: 52px; height: 52px; color: var(--accent); margin-bottom: 14px; }

.symbol-card h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
}

.symbol-card p { margin: 0; font-size: 14px; line-height: 1.9; color: var(--muted); }

/* ---------- Method ---------- */
.method {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding: 72px 0;
  border-top: 1px solid var(--line-soft);
  margin-top: 48px;
}

.method-copy h2 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.35;
}

.method-copy p { color: var(--muted); font-size: 14.5px; line-height: 1.95; }

.method-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.method-list li { display: flex; align-items: center; gap: 14px; font-size: 14.5px; color: var(--ink-soft); }
.method-list span { font-family: var(--serif); font-size: 12px; color: var(--accent); letter-spacing: .1em; }

.method-quote {
  padding: 36px 32px;
  background: var(--sage);
  color: #F2EEE4;
  border-radius: 4px;
}

.method-quote p {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1.7;
}
.method-quote span { font-size: 12px; letter-spacing: .08em; opacity: .72; }

/* ---------- Privacy ---------- */
.privacy { padding: 16px 0 48px; }

.privacy-inner {
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-2);
}

.privacy h2 {
  margin: 0 0 24px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(23px, 2.6vw, 30px);
}

.privacy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.privacy-grid h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.privacy-grid p { margin: 0; font-size: 13.5px; line-height: 1.9; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  padding: 34px clamp(20px, 5vw, 56px) 44px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  background: rgba(251, 248, 241, .6);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink-soft);
}
.footer-brand svg { width: 22px; height: 22px; }

.site-footer p { margin: 4px 0; }
.footer-note { color: var(--muted-2); }

/* ---------- History drawer ---------- */
body.drawer-open { overflow: hidden; }

.history-drawer { position: fixed; inset: 0; z-index: 60; }

.history-overlay {
  position: absolute;
  inset: 0;
  background: rgba(38, 37, 31, .35);
  backdrop-filter: blur(2px);
  animation: fade-in .2s ease;
}

.history-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(430px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--paper-2);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px -40px rgba(58, 50, 38, .6);
  animation: slide-in .28s cubic-bezier(.2, .7, .3, 1);
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(30px); opacity: .4; } }

.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 26px 0;
}

.history-head .eyebrow { margin-bottom: 6px; }

.history-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 25px;
}

.history-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.history-close:hover { color: var(--accent); border-color: var(--accent); }

.history-note {
  margin: 12px 26px 0;
  font-size: 12px;
  line-height: 1.75;
  color: var(--muted-2);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 18px 26px 8px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.history-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--paper-3);
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.history-item:hover {
  border-color: var(--line);
  box-shadow: 0 10px 24px -20px rgba(58, 50, 38, .5);
}

.history-thumb {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: #fff;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 10px;
  color: var(--muted-2);
}
.history-thumb img { width: 100%; height: 100%; object-fit: cover; }

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

.history-time {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--muted-2);
}

.history-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 3px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.history-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

.history-tags span {
  padding: 1px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 100px;
  font-size: 10.5px;
  color: var(--muted);
}

.history-del {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-2);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.history-del:hover { color: var(--accent); background: var(--accent-soft); }

.history-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 32px;
  text-align: center;
}
.history-empty strong { font-family: var(--serif); font-weight: 500; font-size: 17px; color: var(--ink-soft); }
.history-empty p { margin: 0; font-size: 12.5px; line-height: 1.8; color: var(--muted-2); }

.history-foot {
  padding: 16px 26px 24px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  transform: translateX(-50%);
  max-width: calc(100vw - 40px);
  padding: 10px 20px;
  border-radius: 100px;
  background: rgba(38, 37, 31, .94);
  color: #F3EDE2;
  font-size: 13px;
  letter-spacing: .02em;
  text-align: center;
  box-shadow: 0 14px 30px -16px rgba(38, 37, 31, .8);
  animation: toast-in .25s ease;
}

@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero-art { justify-content: center; order: -1; }
  .art-card { width: min(78vw, 340px); }
  .hero h1 { font-size: clamp(34px, 8vw, 52px); }
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
  .symbol-grid { grid-template-columns: 1fr; }
  .method { grid-template-columns: 1fr; }
  .privacy-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-nav { display: none; }
  .header-actions { gap: 10px; }
  .history-open { padding: 5px 10px; font-size: 12.5px; }
  .mobile-only { display: inline-flex; }
  .hero { padding-bottom: 24px; }
  .art-card { width: min(86vw, 300px); padding: 14px; }
  .upload-zone { min-height: 240px; }
  .preview { flex-direction: column; }
  .preview-img-wrap img { width: 100%; max-width: 260px; }
  .meta-grid { grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  .panel-actions { align-items: flex-start; flex-direction: column; gap: 14px; }
  .btn-primary { width: 100%; }
  .report-head { align-items: flex-start; }
  .report-thumb { width: 60px; height: 60px; }
  .stream-bar { top: 60px; }
  .report-paper::before { display: none; }
  .report-actions { justify-content: stretch; }
  .report-actions .btn { flex: 1 1 auto; }
  .markdown p { font-size: 15.5px; line-height: 1.95; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .draw { animation: none; stroke-dashoffset: 0; }
  .pulse-dot, .caret { animation: none; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; }
  body::before, .grain, .site-header, .hero, .workspace, .symbols, .method, .privacy, .site-footer,
  .stream-bar, .report-actions, .cancel-row, .report-title-wrap .eyebrow,
  .history-drawer, .toast { display: none !important; }
  main { max-width: none; padding: 0; }
  .report { padding: 0; }
  .report-head { margin-bottom: 12px; }
  .report-paper { border: 0; box-shadow: none; padding: 0; background: #fff; }
  .report-paper::before { display: none; }
  .report-foot { border: 0; padding: 12px 0 0; }
  .markdown h2 { break-after: avoid; }
  .markdown li, .markdown p { break-inside: avoid; }
  .markdown blockquote { background: #F7F3EA; }
  .tag { border-color: #ccc; }
}
