:root {
  --bg: #0c0d0f;
  --surface: #141517;
  --surface-2: #191a1d;
  --surface-3: #202125;
  --ink: #f6f6f4;
  --ink-soft: #c4c4c1;
  --muted: #85868a;
  --line: #2c2d31;
  --line-soft: #242529;
  --green: #77c6a4;
  --green-deep: #173f34;
  --gold: #f0a66f;
  --accent-a: #ff825e;
  --accent-b: #f4c5cf;
  --accent-c: #b9d0ff;
  --danger: #ff8f88;
  --shadow: 0 28px 80px rgba(0,0,0,.34);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 76px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(12,13,15,.90);
  backdrop-filter: blur(18px);
}
.nav-inner {
  width: min(100% - 48px, 1440px);
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 11px;
  color: #fff;
  font-family: "Songti SC", STSong, serif;
  font-size: 16px;
  letter-spacing: .08em;
  background: linear-gradient(135deg, rgba(255,130,94,.26), rgba(185,208,255,.18));
}
.brand-copy { min-width: 0; }
.eyebrow { margin: 0 0 2px; color: #929397; letter-spacing: .19em; font-size: 8px; }
h1 { margin: 0; font-size: 17px; font-weight: 680; letter-spacing: -.01em; }
.main-nav { margin-left: 34px; display: flex; gap: 26px; }
.main-nav a { color: #999a9e; font-size: 12px; font-weight: 570; transition: color .16s; }
.main-nav a:hover { color: #fff; }
.local-badge {
  margin-left: auto;
  min-height: 42px;
  padding: 7px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #efefed;
  background: #1b1c1f;
}
.local-badge > span { width: 7px; height: 7px; border-radius: 50%; background: #72d49d; box-shadow: 0 0 16px rgba(114,212,157,.9); }
.local-badge div { display: grid; gap: 1px; }
.local-badge strong { font-size: 10px; font-weight: 650; }
.local-badge small { color: #77797d; font-size: 8px; }

.shell {
  position: relative;
  isolation: isolate;
  max-width: 1500px;
  margin: 0 auto 80px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: minmax(420px, .86fr) minmax(600px, 1.14fr);
  gap: 18px;
  align-items: start;
}
.shell::before, .shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .13;
  pointer-events: none;
}
.shell::before { top: 170px; left: 9%; background: #8e4dff; }
.shell::after { top: 340px; right: 6%; background: #ff744c; }
.workspace-intro {
  grid-column: 1 / -1;
  min-height: 530px;
  padding: 86px 0 34px;
  display: grid;
  place-items: center;
  text-align: center;
}
.hero-copy { max-width: 980px; }
.page-kicker {
  width: max-content;
  margin: 0 auto 22px;
  padding: 6px 12px;
  border: 1px solid rgba(255,156,105,.6);
  border-radius: 999px;
  color: #ffc09d;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .13em;
}
.workspace-intro h2 {
  margin: 0;
  color: #f8f8f6;
  font-size: clamp(58px, 7vw, 104px);
  font-weight: 900;
  line-height: .91;
  letter-spacing: -.065em;
  text-transform: uppercase;
}
.workspace-intro h2 span {
  color: transparent;
  background: linear-gradient(90deg, var(--accent-a) 8%, var(--accent-b) 51%, var(--accent-c) 92%);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 10px 18px rgba(230,160,171,.22));
}
.workspace-intro .hero-copy > p:not(.page-kicker) {
  max-width: 640px;
  margin: 26px auto 0;
  color: #8f9094;
  font-size: 15px;
  line-height: 1.7;
}
.hero-actions { margin-top: 28px; display: flex; justify-content: center; gap: 10px; }
.hero-actions a { min-height: 50px; padding: 0 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 12px; font-weight: 720; transition: transform .18s, border-color .18s; }
.hero-actions a:hover { transform: translateY(-2px); }
.hero-primary { color: #111214; background: linear-gradient(180deg, #fff, #d7e4ff); box-shadow: 0 12px 30px rgba(185,208,255,.14); }
.hero-secondary { border: 1px solid #35363a; color: #cacacd; background: #17181a; }
.workflow {
  width: min(100%, 620px);
  margin: 48px auto 0;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 999px;
  list-style: none;
  background: rgba(20,21,23,.76);
}
.workflow li { min-height: 52px; padding: 0 14px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #77787c; border-radius: 999px; }
.workflow li > span { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #38393e; border-radius: 50%; font-size: 9px; font-weight: 700; }
.workflow li div { display: grid; gap: 1px; text-align: left; }
.workflow li strong { font-size: 10px; font-weight: 650; }
.workflow li small { color: #626367; font-size: 8px; }
.workflow li.active { color: white; background: #202125; }
.workflow li.active > span { border-color: transparent; color: #111; background: linear-gradient(135deg, var(--accent-a), var(--accent-c)); }

.editor-panel, .preview-panel, .history-panel {
  scroll-margin-top: 92px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(20,21,23,.95);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-heading {
  min-height: 78px;
  padding: 17px 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,.012);
}
.panel-heading > div:first-child { display: flex; align-items: flex-start; gap: 11px; }
.panel-heading h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.panel-heading p { margin: 4px 0 0; color: #6f7074; font-size: 9px; }
.step { padding-top: 3px; color: var(--gold); font: 700 10px/1 Georgia, serif; letter-spacing: .12em; }
.text-button { min-height: 36px; border: 0; padding: 6px 8px; color: #c4d7ff; background: transparent; cursor: pointer; font-size: 10px; font-weight: 650; }
.text-button:hover { color: white; }
.danger { color: var(--danger); }

form { padding: 4px 21px 21px; }
.form-section { padding: 17px 0 9px; border-bottom: 1px solid var(--line-soft); }
.form-section h3 { margin: 0 0 12px; color: #bdbec1; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
label { display: grid; gap: 6px; color: #9d9ea2; font-size: 10px; font-weight: 560; }
label.wide { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%;
  border: 1px solid #303136;
  border-radius: 10px;
  padding: 10px 11px;
  color: #f2f2f0;
  background: #101113;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
  color-scheme: dark;
}
input::placeholder, textarea::placeholder { color: #57585c; }
input:hover, select:hover, textarea:hover { border-color: #44454a; }
input:focus, select:focus, textarea:focus { border-color: #8d9fd0; background: #121316; box-shadow: 0 0 0 3px rgba(143,167,225,.12); }
form.was-submitted input:invalid { border-color: #d06f68; }
textarea { min-height: 62px; resize: vertical; }

.english-adjust { margin: 15px 0 0; border: 1px solid #303136; border-radius: 11px; background: #18191c; overflow: hidden; }
.english-adjust summary { min-height: 46px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; color: #cbd8f2; cursor: pointer; font-size: 11px; font-weight: 650; }
.english-adjust summary small { color: #67686c; font-weight: 400; }
.english-adjust .form-grid { padding: 0 14px 14px; }
.form-summary { margin-top: 14px; padding: 12px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border: 1px solid #2b2c30; border-radius: 11px; background: #111214; }
.form-summary div { display: grid; gap: 3px; }
.form-summary small { color: #616267; font-size: 8px; }
.form-summary strong { color: #c9c9c7; font-size: 10px; font-weight: 650; }
.form-actions { display: flex; gap: 9px; margin-top: 14px; }
.button { min-height: 43px; border: 1px solid transparent; border-radius: 10px; padding: 0 15px; cursor: pointer; font-size: 10px; font-weight: 700; transition: transform .16s, border-color .16s, box-shadow .16s; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .text-button:focus-visible, .segmented button:focus-visible, .preview-utility button:focus-visible, .hero-actions a:focus-visible { outline: 3px solid rgba(185,208,255,.25); outline-offset: 2px; }
.button.primary { color: #111214; background: linear-gradient(180deg, #fff, #d7e4ff); box-shadow: 0 8px 22px rgba(185,208,255,.10); }
.button.dark { color: white; border-color: #3b3c40; background: #202125; }
.button.secondary { color: #d8d9dc; border-color: #333439; background: #1b1c1f; }
.form-actions .button { flex: 1; }

.segmented { display: flex !important; gap: 0 !important; padding: 4px; border: 1px solid #303136; border-radius: 999px; background: #0f1012; }
.segmented button { min-height: 31px; border: 0; border-radius: 999px; padding: 0 12px; color: #6e6f73; background: transparent; cursor: pointer; font-size: 9px; }
.segmented button.active { color: #111214; background: #f3f3f1; font-weight: 700; }
.preview-stage { position: relative; height: 690px; padding: 50px 23px 27px; overflow: auto; background: radial-gradient(circle at 30% 10%, rgba(100,72,170,.18), transparent 36%), radial-gradient(circle at 85% 25%, rgba(255,111,78,.12), transparent 31%), #0c0d0f; scrollbar-color: #3e3f44 transparent; }
.preview-utility { position: sticky; top: -39px; z-index: 3; width: max-content; margin: 0 0 13px auto; padding: 5px; display: flex; align-items: center; gap: 5px; border: 1px solid #313237; border-radius: 999px; background: rgba(24,25,28,.92); backdrop-filter: blur(14px); box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.preview-utility button { min-height: 29px; border: 0; border-radius: 999px; padding: 0 10px; color: #e7e7e5; background: #2a2b2f; cursor: pointer; font-size: 9px; font-weight: 600; }
.preview-utility label { grid-auto-flow: column; align-items: center; gap: 6px; color: #77787c; font-size: 8px; }
.preview-utility select { width: auto; min-height: 29px; padding: 4px 24px 4px 8px; border: 0; background: #191a1d; font-size: 9px; }
.paper { position: relative; width: min(100%, 650px); margin: 0 auto; background: white; box-shadow: 0 28px 70px rgba(0,0,0,.42); transform-origin: top center; }
.paper img { display: block; width: 100%; height: auto; }
#overlay { position: absolute; inset: 0; pointer-events: none; }
.overlay-text { position: absolute; overflow: hidden; color: #111; font-family: Arial, "PingFang SC", sans-serif; font-size: 10px; line-height: 1.18; white-space: nowrap; text-overflow: ellipsis; }
.overlay-text.multiline { white-space: normal; }
.export-row { padding: 14px 16px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); background: #151618; }
.quality-note { margin-right: auto; display: grid; gap: 3px; }
.quality-note strong { font-size: 10px; }
.quality-note span { color: #66676b; font-size: 8px; }

.history-panel { grid-column: 1 / -1; margin-top: 2px; }
.count-badge { min-width: 22px; height: 19px; margin-left: 4px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 10px; color: #111; background: linear-gradient(135deg, var(--accent-a), var(--accent-c)); font-size: 9px; vertical-align: 1px; }
.history-tools { display: flex !important; align-items: center !important; gap: 8px !important; }
.history-tools input { width: 220px; padding: 8px 10px; font-size: 10px; }
.history-empty { padding: 42px; color: #696a6e; text-align: center; font-size: 11px; }
.history-list { display: grid; }
.history-card { padding: 14px 20px; display: grid; grid-template-columns: 1.2fr .9fr .9fr auto; align-items: center; gap: 16px; border-top: 1px solid var(--line-soft); transition: background .14s; }
.history-card:hover { background: #191a1d; }
.history-card:first-child { border-top: 0; }
.history-card strong { display: block; margin-bottom: 3px; font-size: 12px; }
.history-card span, .history-card time { display: block; color: #6d6e72; font-size: 9px; }
.history-actions { display: flex; gap: 6px; }
.history-actions button { min-height: 31px; border: 1px solid #34353a; border-radius: 999px; padding: 0 10px; color: #d5dcf0; background: #1b1c1f; cursor: pointer; font-size: 9px; }
.history-actions button:last-child { color: var(--danger); }

.toast { position: fixed; left: 50%; bottom: 26px; z-index: 12; transform: translate(-50%, 18px); padding: 10px 17px; border: 1px solid #393a3f; border-radius: 999px; color: white; background: #1c1d20; opacity: 0; pointer-events: none; transition: .22s; box-shadow: 0 12px 32px rgba(0,0,0,.36); font-size: 10px; }
.toast.show { transform: translate(-50%,0); opacity: 1; }

@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; max-width: 880px; }
  .history-panel, .workspace-intro { grid-column: auto; }
  .editor-panel { order: 1; }
  .preview-panel { order: 2; }
  .history-panel { order: 3; }
  .preview-stage { height: 620px; }
  .workspace-intro { min-height: 500px; }
}
@media (max-width: 760px) {
  .main-nav { display: none; }
  .workspace-intro { min-height: 490px; padding-top: 64px; }
  .workflow { width: 100%; }
  .workflow li small { display: none; }
}
@media (max-width: 620px) {
  .nav-inner { width: min(100% - 28px, 1440px); min-height: 68px; }
  .topbar { min-height: 68px; }
  .brand-mark { width: 40px; height: 40px; font-size: 14px; }
  .eyebrow { font-size: 6px; }
  h1 { font-size: 14px; }
  .local-badge { min-height: 37px; padding: 6px 9px; }
  .local-badge small { display: none; }
  .shell { padding: 0 10px; margin-bottom: 44px; }
  .workspace-intro { min-height: 500px; padding: 68px 4px 30px; }
  .workspace-intro h2 { font-size: clamp(46px, 15vw, 68px); line-height: .94; }
  .workspace-intro .hero-copy > p:not(.page-kicker) { font-size: 12px; line-height: 1.65; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions a { width: min(100%, 260px); }
  .workflow { margin-top: 38px; border-radius: 18px; }
  .workflow li { min-height: 48px; padding: 0 6px; gap: 5px; }
  .workflow li strong { font-size: 9px; }
  .editor-panel, .preview-panel, .history-panel { border-radius: 18px; }
  .panel-heading { padding: 14px 16px; }
  form { padding: 3px 16px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  label.wide { grid-column: auto; }
  .form-summary { grid-template-columns: 1fr; gap: 10px; }
  .preview-heading { align-items: flex-start; gap: 12px; }
  .preview-stage { height: 540px; padding: 46px 12px 20px; }
  .preview-utility { margin-right: 0; }
  .export-row { flex-wrap: wrap; }
  .quality-note { width: 100%; margin-bottom: 3px; }
  .export-row .button { flex: 1; padding: 0 10px; }
  .history-panel .panel-heading { align-items: flex-start; gap: 12px; }
  .history-tools { display: grid !important; justify-items: end; }
  .history-tools input { width: 150px; }
  .history-card { grid-template-columns: 1fr 1fr; }
  .history-actions { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
