:root {
  color-scheme: light;
  --ink: oklch(22% 0.035 64);
  --muted: oklch(46% 0.035 64);
  --paper: oklch(97% 0.02 82);
  --surface: oklch(92% 0.035 82);
  --line: oklch(78% 0.035 82);
  --accent: oklch(52% 0.13 38);
  --accent-deep: oklch(37% 0.11 38);
  --green: oklch(55% 0.12 150);
  --shadow: 0 18px 50px oklch(22% 0.04 64 / 13%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, oklch(78% 0.035 82 / 18%) 1px, transparent 1px),
    linear-gradient(0deg, oklch(78% 0.035 82 / 16%) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
  color: var(--ink);
  font-family: Avenir Next, ui-sans-serif, system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--ink);
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(24px, 4vw, 56px) 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(28px, 5vw, 56px);
}

.brand {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.language-switch {
  display: inline-flex;
  border: 1px solid var(--ink);
  background: oklch(98% 0.015 82);
}

.lang-button {
  min-width: 54px;
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  border-right: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.lang-button:last-child {
  border-right: 0;
}

.lang-button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: clamp(28px, 6vw, 92px);
  align-items: end;
  min-height: min(560px, 70vh);
}

.eyebrow {
  width: fit-content;
  margin: 0 0 24px;
  padding: 7px 10px;
  border: 1px solid var(--ink);
  background: oklch(86% 0.07 128);
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-family: Georgia, ui-serif, serif;
  font-size: clamp(2.35rem, 5.7vw, 5.4rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0;
}

html[lang="zh-Hans"] h1 {
  max-width: 700px;
  font-family: Songti SC, Noto Serif CJK SC, STSong, Georgia, ui-serif, serif;
  font-size: clamp(2.25rem, 5.2vw, 5rem);
  line-height: 1.08;
}

.lede {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.8vw, 1.35rem);
  line-height: 1.55;
}

.specimen {
  position: relative;
  min-height: 360px;
}

.paper {
  position: absolute;
  inset: auto 0 0 auto;
  width: min(100%, 360px);
  aspect-ratio: 0.77;
  border: 1px solid var(--ink);
  background: oklch(99% 0.015 90);
  box-shadow: var(--shadow);
}

.paper-back {
  transform: translate(-34px, -32px) rotate(-7deg);
  background:
    repeating-linear-gradient(
      0deg,
      oklch(84% 0.035 78),
      oklch(84% 0.035 78) 1px,
      transparent 1px,
      transparent 26px
    ),
    oklch(94% 0.03 82);
}

.paper-front {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 42px 34px;
  transform: rotate(2.5deg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
}

.paper-front span {
  display: block;
  min-height: 13px;
  border-bottom: 2px solid oklch(78% 0.045 82);
  color: var(--accent-deep);
}

.tool {
  margin-top: 42px;
}

.dropzone {
  position: relative;
  display: grid;
  min-height: 190px;
  place-items: center;
  border: 2px dashed var(--ink);
  background: oklch(96% 0.018 82 / 92%);
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.dropzone.is-dragging {
  background: oklch(89% 0.08 128);
  transform: translateY(-2px);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.dropzone-inner {
  padding: 28px;
  text-align: center;
}

.drop-title {
  margin-bottom: 4px;
  font-family: Georgia, ui-serif, serif;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1;
}

.drop-copy,
.status {
  color: var(--muted);
}

.choose-button,
.convert-button,
.actions button {
  min-height: 44px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.choose-button:hover,
.convert-button:hover,
.actions button:hover {
  transform: translateY(-1px);
  box-shadow: 5px 5px 0 var(--accent);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  margin-top: 18px;
}

.queue-panel,
.result-panel,
.seo-band {
  border: 1px solid var(--ink);
  background: oklch(98% 0.015 82);
}

.queue-panel,
.result-panel {
  padding: clamp(18px, 3vw, 28px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-family: Georgia, ui-serif, serif;
  font-size: 1.55rem;
}

#limit-chip {
  padding: 5px 9px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.file-list {
  display: grid;
  gap: 8px;
  min-height: 168px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.file-list small {
  color: var(--muted);
  white-space: nowrap;
}

.convert-button {
  width: 100%;
  background: var(--accent);
}

.status {
  min-height: 24px;
  margin: 14px 0 0;
  font-size: 0.95rem;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  min-height: 38px;
  padding: 7px 11px;
  background: transparent;
  color: var(--ink);
}

.result-select {
  width: 100%;
  min-height: 42px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.result-output {
  min-height: 330px;
  max-height: 560px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  background: oklch(22% 0.025 64);
  color: oklch(94% 0.025 90);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.seo-band {
  margin-top: 18px;
  padding: clamp(24px, 4vw, 42px);
  columns: 2 340px;
  column-gap: 60px;
}

.seo-band h2 {
  break-after: avoid;
  font-family: Georgia, ui-serif, serif;
  font-size: clamp(1.75rem, 3vw, 3rem);
  line-height: 1.05;
}

.seo-band p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

@media (max-width: 820px) {
  .topbar {
    margin-bottom: 28px;
  }

  .hero,
  .workbench {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .specimen {
    min-height: 250px;
  }

  .paper {
    width: min(78vw, 300px);
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
