:root {
  --ink: #102a43;
  --ink-soft: #334e68;
  --muted: #6b7c8f;
  --paper: #f3f0e8;
  --surface: #fffdf8;
  --surface-2: #f8f5ee;
  --line: #e1dacd;
  --accent: #c2410c;
  --accent-light: #fff0e6;
  --accent-bright: #f97316;
  --green: #166534;
  --green-light: #eaf6ee;
  --blue: #1d4ed8;
  --blue-light: #e9f0ff;
  --red: #b91c1c;
  --red-light: #feecec;
  --shadow: 0 18px 50px rgba(16, 42, 67, 0.08);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 85% 4%, rgba(249, 115, 22, 0.09), transparent 24rem),
    var(--paper);
  color: var(--ink);
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.is-hidden {
  display: none !important;
}

.identity-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(16, 42, 67, 0.98), rgba(15, 58, 75, 0.97) 55%, rgba(125, 46, 10, 0.93)),
    #102a43;
}

.identity-gate::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  content: "";
}

.gate-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.gate-orbit-one {
  top: -24vw;
  right: -11vw;
  width: 50vw;
  height: 50vw;
}

.gate-orbit-two {
  bottom: -30vw;
  left: -15vw;
  width: 60vw;
  height: 60vw;
}

.gate-card {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 32px;
  background: rgba(255, 253, 248, 0.97);
  padding: clamp(30px, 5vw, 58px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand-seal {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px 12px 12px 3px;
  background: var(--ink);
  color: white;
  font-family: "Songti SC", "SimSun", serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.gate-kicker {
  margin: 36px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.gate-card h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(36px, 6vw, 54px);
  line-height: 1.22;
}

.gate-copy {
  max-width: 520px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  line-height: 1.85;
}

.gate-form {
  margin-top: 34px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.gate-form label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 750;
}

.gate-input-row {
  display: flex;
  gap: 10px;
}

.gate-second-label {
  margin-top: 16px;
}

.gate-input-row input {
  flex: 1;
  min-width: 0;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  padding: 0 16px;
  outline: none;
}

.gate-input-row input:focus,
.field input:focus,
.textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.1);
}

.gate-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 30px;
  height: 76px;
  border-bottom: 1px solid rgba(225, 218, 205, 0.9);
  background: rgba(243, 240, 232, 0.92);
  padding: 0 clamp(20px, 4vw, 64px);
  backdrop-filter: blur(18px);
}

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

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy strong {
  font-size: 15px;
  line-height: 1.3;
}

.brand-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.primary-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.nav-item {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 9px 17px;
  font-size: 13px;
  font-weight: 700;
  transition: 0.2s ease;
}

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

.nav-item.is-active {
  background: var(--ink);
  color: white;
}

.account-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d97706;
}

.service-dot.is-online {
  background: #22c55e;
}

.service-dot.is-error {
  background: #ef4444;
}

.service-label {
  max-width: 78px;
  color: var(--muted);
  font-size: 11px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-left: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  padding: 4px 12px 4px 5px;
}

.user-avatar {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.user-chevron {
  color: var(--muted);
  font-size: 13px;
}

.main {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 54px 0 80px;
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  margin-bottom: 38px;
}

.eyebrow,
.mini-label {
  margin: 0;
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.2em;
}

.page-hero h1,
.section-hero h1 {
  margin: 10px 0 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(38px, 5.6vw, 72px);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.hero-copy,
.section-hero > div > p:last-child {
  max-width: 720px;
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.9;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 1px;
  overflow: hidden;
  min-width: 360px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--line);
}

.hero-stats div {
  display: flex;
  min-height: 102px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(255, 253, 248, 0.78);
}

.hero-stats strong {
  font-family: "Songti SC", serif;
  font-size: 32px;
  line-height: 1;
}

.hero-stats span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 22px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.editor-panel {
  padding: clamp(24px, 4vw, 46px);
}

.side-column {
  display: grid;
  gap: 18px;
}

.side-column .panel {
  padding: 26px;
  box-shadow: none;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-heading.compact {
  align-items: center;
}

.panel-heading h2 {
  margin: 0;
  font-size: 19px;
}

.step-tag {
  display: inline-grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
}

.subtle-note {
  color: var(--muted);
  font-size: 11px;
}

.stage-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.stage-option {
  display: flex;
  min-height: 142px;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 18px;
  text-align: left;
  transition: 0.2s ease;
}

.stage-option:hover {
  transform: translateY(-2px);
  border-color: #b8ae9f;
}

.stage-option.is-active {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.stage-option span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
}

.stage-option strong {
  margin-top: 8px;
  font-size: 17px;
}

.stage-option small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.tone-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}

.tone-caption {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.tone-selector {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 3px;
}

.tone-option {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 7px 13px;
  font-size: 11px;
  font-weight: 650;
}

.tone-option.is-active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(16, 42, 67, 0.08);
}

.form-divider {
  height: 1px;
  margin: 28px 0;
  background: var(--line);
}

.source-tabs {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 3px;
}

.source-tabs button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 700;
}

.source-tabs button.is-active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(16, 42, 67, 0.08);
}

.source-panel {
  margin-top: 18px;
}

.dropzone {
  display: flex;
  min-height: 196px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #bfb4a5;
  border-radius: 18px;
  background: #fbf8f2;
  padding: 28px;
  text-align: center;
  transition: 0.2s ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-light);
}

.dropzone input {
  display: none;
}

.dropzone.has-file {
  border-style: solid;
  border-color: var(--green);
  background: var(--green-light);
}

.upload-symbol {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 13px;
  background: var(--ink);
  color: white;
  font-size: 25px;
  font-weight: 300;
}

.dropzone strong {
  margin-top: 15px;
  font-size: 15px;
}

.dropzone small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.textarea {
  width: 100%;
  min-height: 250px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  color: var(--ink);
  padding: 18px;
  outline: none;
  line-height: 1.75;
}

.fact-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  font-size: 12px;
  font-weight: 700;
}

.field input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 0 14px;
  outline: none;
}

.field-wide,
.signature-field {
  margin-top: 14px;
}

.compact-textarea {
  min-height: 104px;
  border-radius: 12px;
  font-size: 12px;
}

.default-signature {
  display: block;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 9px 11px;
  font-size: 9px;
  line-height: 1.65;
  white-space: pre-line;
}

.range-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 17px;
}

.range-field {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
  padding: 17px;
}

.range-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 750;
}

.range-title b {
  display: grid;
  width: 31px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 11px;
}

.range-field input {
  width: 100%;
  margin: 12px 0 4px;
  accent-color: var(--accent);
}

.range-field small {
  color: var(--muted);
  font-size: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 750;
  transition: 0.2s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-accent {
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 24px rgba(194, 65, 12, 0.18);
}

.button-accent:hover:not(:disabled) {
  background: #a63709;
}

.button-dark {
  background: var(--ink);
  color: white;
}

.button-ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button-generate {
  width: 100%;
  min-height: 58px;
  margin-top: 22px;
  border-radius: 15px;
  font-size: 15px;
}

.button-generate span {
  font-size: 20px;
  font-weight: 400;
}

.full-width {
  width: 100%;
}

.quota-line {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-badge {
  border-radius: 999px;
  background: var(--blue-light);
  color: var(--blue);
  padding: 4px 9px;
  font-size: 9px;
  font-weight: 800;
}

.status-badge.local {
  background: #fff7e7;
  color: #a16207;
}

.status-panel h3,
.format-panel h3,
.upload-panel h2,
.list-toolbar h2 {
  margin: 13px 0 0;
  font-size: 19px;
}

.status-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.usage-meter {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

.meter-label strong {
  color: var(--ink);
}

.meter-track,
.progress-track {
  overflow: hidden;
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: #e8e2d8;
}

.meter-track span,
.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.3s ease;
}

.ai-setup-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
}

.format-panel h3 {
  margin-bottom: 15px;
}

.format-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.format-chips span {
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: 6px 10px;
  font-size: 10px;
}

.quality-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.quality-row span {
  border-radius: 8px;
  background: var(--green-light);
  color: var(--green);
  padding: 6px 4px;
  font-size: 9px;
  font-weight: 750;
  text-align: center;
}

.principle-panel ol {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.principle-panel li {
  display: flex;
  gap: 11px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  color: var(--ink-soft);
  font-family: "Songti SC", serif;
  font-size: 13px;
}

.principle-panel li span {
  color: var(--accent);
  font-family: sans-serif;
  font-size: 9px;
  font-weight: 800;
}

.result-panel {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 38px;
}

.result-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.result-header h2 {
  margin: 9px 0 0;
  max-width: 920px;
  font-family: "Songti SC", serif;
  font-size: clamp(28px, 3vw, 43px);
  line-height: 1.35;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.result-meta span {
  border-radius: 999px;
  background: var(--surface-2);
  padding: 5px 10px;
}

.result-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.warning-box {
  margin-top: 22px;
  border: 1px solid #f3cc62;
  border-radius: 15px;
  background: #fffbeb;
  color: #854d0e;
  padding: 16px 18px;
  font-size: 12px;
}

.warning-box strong {
  display: block;
  margin-bottom: 7px;
}

.warning-box ul {
  margin: 0;
  padding-left: 18px;
}

.process-summary {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 22px;
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.process-step {
  border-radius: 14px;
  background: var(--surface-2);
  padding: 16px;
}

.process-step-number {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 9px;
  font-weight: 850;
}

.process-step strong {
  display: block;
  margin-top: 10px;
  font-size: 12px;
}

.process-step p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.research-details {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.research-details h4 {
  margin: 0 0 8px;
  font-size: 11px;
}

.quality-checks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.quality-check {
  border-radius: 10px;
  background: var(--surface-2);
  padding: 10px;
}

.quality-check strong {
  font-size: 10px;
}

.quality-check span {
  float: right;
  border-radius: 999px;
  background: #fff7e7;
  color: #a16207;
  padding: 1px 6px;
  font-size: 8px;
}

.quality-check.pass span {
  background: var(--green-light);
  color: var(--green);
}

.quality-check.review span {
  background: var(--blue-light);
  color: var(--blue);
}

.quality-check p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.reference-list,
.fact-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.reference-item,
.fact-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.reference-item i,
.fact-item i {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 6px;
  font-size: 8px;
  font-style: normal;
  font-weight: 750;
}

.source-quality {
  display: inline-block;
  margin-left: 7px;
  border-radius: 999px;
  background: var(--green-light);
  color: var(--green);
  padding: 2px 7px;
  font-size: 8px;
  font-weight: 750;
}

.result-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  margin-top: 22px;
}

.outline-panel {
  position: sticky;
  top: 92px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  padding: 22px;
}

.outline-panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.outline-item {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 11px 0;
}

.outline-item:first-child {
  border-top: 0;
}

.outline-item.level-2 {
  padding-left: 14px;
}

.outline-item.level-2 strong {
  font-weight: 700;
}

.outline-item span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
}

.outline-item strong {
  display: block;
  font-size: 12px;
}

.outline-item small {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.paper {
  min-height: 600px;
  border: 1px solid #dcd3c6;
  background: white;
  padding: clamp(32px, 6vw, 76px);
  box-shadow: 0 20px 55px rgba(16, 42, 67, 0.08);
}

.paper-title {
  margin: 0 0 36px;
  font-family: "Songti SC", "SimSun", serif;
  font-size: clamp(24px, 2.4vw, 31px);
  font-weight: 800;
  line-height: 1.55;
  text-align: center;
}

.paper-heading {
  margin: 30px 0 12px;
  font-family: "Songti SC", "SimSun", serif;
  font-size: 17px;
  font-weight: 800;
}

.paper-heading.level-2 {
  margin: 22px 0 9px;
  font-size: 15px;
  font-weight: 800;
}

.paper-paragraph {
  margin: 0 0 4px;
  font-family: "Songti SC", "SimSun", serif;
  font-size: 16px;
  line-height: 1.95;
  text-align: justify;
  text-indent: 2em;
}

.paper-paragraph strong {
  font-weight: 800;
}

.paper-paragraph.lead {
  font-size: 17px;
  line-height: 2;
  text-align: center;
  text-indent: 0;
}

.paper-image-note {
  margin: 15px 0;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 11px;
  font-size: 10px;
  text-align: center;
}

.paper-signature {
  margin-top: 42px;
  font-family: "Songti SC", "SimSun", serif;
  font-size: 14px;
  line-height: 1.9;
  text-align: center;
}

.section-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 34px;
}

.section-hero h1 {
  font-size: clamp(38px, 5vw, 62px);
}

.library-summary {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.library-summary span {
  border-left: 1px solid var(--line);
  padding: 16px 20px;
  color: var(--muted);
  font-size: 11px;
}

.library-summary span:first-child {
  border-left: 0;
}

.library-summary b {
  color: var(--ink);
  font-size: 19px;
}

.library-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.upload-panel {
  position: sticky;
  top: 94px;
  padding: 26px;
}

.choice-row {
  display: flex;
  gap: 6px;
  margin-top: 20px;
}

.choice {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 8px 5px;
  font-size: 10px;
}

.choice.is-active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 750;
}

.stage-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.stage-mini-row span {
  color: var(--muted);
  font-size: 10px;
}

.stage-mini-row select {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  padding: 0 10px;
  outline: none;
}

.compact-drop {
  min-height: 138px;
  margin: 16px 0;
  padding: 18px;
}

.compact-drop .upload-symbol {
  width: 34px;
  height: 34px;
  font-size: 19px;
}

.library-list-panel {
  padding: 26px;
}

.list-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.record-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.knowledge-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  padding: 17px;
}

.knowledge-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.knowledge-mark {
  display: grid;
  flex: 0 0 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.knowledge-mark.plan {
  background: #fff7e7;
  color: #a16207;
}

.knowledge-mark.format {
  background: var(--green-light);
  color: var(--green);
}

.knowledge-kind {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.knowledge-title {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.knowledge-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
  color: var(--muted);
  font-size: 9px;
}

.usage-hero {
  align-items: center;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.summary-grid article {
  min-height: 125px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 20px;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.summary-grid strong {
  display: inline-block;
  margin-top: 14px;
  font-family: "Songti SC", serif;
  font-size: 37px;
  line-height: 1;
}

.summary-grid small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 10px;
}

.usage-table-panel {
  padding: 26px;
}

.refresh-note {
  color: var(--muted);
  font-size: 10px;
}

.usage-table-wrap {
  overflow-x: auto;
  margin-top: 22px;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}

.usage-table th {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  padding: 10px 12px;
  font-size: 9px;
  font-weight: 750;
  text-align: left;
}

.usage-table td {
  border-bottom: 1px solid #eee9df;
  padding: 14px 12px;
  font-size: 11px;
  vertical-align: middle;
}

.usage-table tr:last-child td {
  border-bottom: 0;
}

.usage-person {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.mini-avatar {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
}

.usage-title {
  max-width: 280px;
}

.usage-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-title small {
  color: var(--muted);
  font-size: 9px;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: 4px 8px;
  font-size: 9px;
  white-space: nowrap;
}

.pill.ai {
  background: var(--blue-light);
  color: var(--blue);
}

.pill.local {
  background: #fff7e7;
  color: #a16207;
}

.pill.success {
  background: var(--green-light);
  color: var(--green);
}

.pill.failed {
  background: var(--red-light);
  color: var(--red);
}

.pill.running {
  background: var(--blue-light);
  color: var(--blue);
}

.empty-state {
  padding: 70px 20px;
  color: var(--muted);
  text-align: center;
}

.footer {
  display: flex;
  justify-content: space-between;
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 24px 0 34px;
  font-size: 10px;
}

.busy-overlay {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(16, 42, 67, 0.62);
  padding: 24px;
  backdrop-filter: blur(8px);
}

.busy-card {
  width: min(430px, 100%);
  border-radius: 24px;
  background: var(--surface);
  padding: 34px;
  text-align: center;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.25);
}

.loader-lines {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 22px;
}

.loader-lines span {
  width: 6px;
  height: 30px;
  border-radius: 999px;
  background: var(--accent);
  animation: pulse 1s infinite ease-in-out;
}

.loader-lines span:nth-child(2) {
  animation-delay: 0.12s;
}

.loader-lines span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes pulse {
  0%,
  100% {
    transform: scaleY(0.5);
    opacity: 0.35;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.busy-card h2 {
  margin: 0;
  font-family: "Songti SC", serif;
  font-size: 28px;
}

.busy-card p {
  margin: 10px 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100% - 48px));
  border-radius: 13px;
  background: var(--ink);
  color: white;
  padding: 13px 17px;
  font-size: 12px;
  box-shadow: 0 18px 50px rgba(16, 42, 67, 0.24);
}

@media (max-width: 1120px) {
  .workspace-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .library-layout {
    grid-template-columns: 290px minmax(0, 1fr);
  }

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

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
    height: auto;
    min-height: 66px;
    padding: 12px 20px;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    order: 3;
  }

  .brand-copy small,
  .service-label {
    display: none;
  }

  .main {
    width: min(100% - 30px, 760px);
    padding-top: 32px;
  }

  .page-hero,
  .section-hero {
    grid-template-columns: 1fr;
    display: grid;
    gap: 24px;
    align-items: start;
  }

  .hero-stats {
    min-width: 0;
    width: 100%;
  }

  .workspace-layout,
  .library-layout {
    grid-template-columns: 1fr;
  }

  .side-column {
    grid-template-columns: 1fr 1fr;
  }

  .principle-panel {
    grid-column: 1 / -1;
  }

  .upload-panel {
    position: static;
  }

  .result-layout {
    grid-template-columns: 1fr;
  }

  .outline-panel {
    position: static;
  }

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

  .process-steps,
  .research-details,
  .quality-checks {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .identity-gate {
    padding: 14px;
  }

  .gate-card {
    border-radius: 24px;
    padding: 28px 22px;
  }

  .gate-input-row {
    flex-direction: column;
  }

  .gate-input-row .button {
    min-height: 50px;
  }

  .account-area .service-dot,
  .account-area .service-label {
    display: none;
  }

  .user-pill {
    margin-left: 0;
  }

  .page-hero h1 {
    font-size: 38px;
  }

  .hero-copy {
    font-size: 14px;
  }

  .stage-selector,
  .form-grid,
  .range-grid,
  .side-column,
  .library-summary {
    grid-template-columns: 1fr;
  }

  .tone-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .tone-selector {
    width: 100%;
  }

  .tone-option {
    flex: 1;
  }

  .library-summary {
    display: grid;
  }

  .library-summary span {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .library-summary span:first-child {
    border-top: 0;
  }

  .stage-option {
    min-height: auto;
  }

  .panel-heading {
    flex-direction: column;
  }

  .panel-heading.compact {
    align-items: flex-start;
  }

  .source-tabs {
    width: 100%;
  }

  .source-tabs button {
    flex: 1;
  }

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

  .summary-grid article {
    min-height: 110px;
  }

  .paper {
    padding: 28px 20px;
  }

  .paper-title {
    font-size: 23px;
  }

  .paper-paragraph {
    font-size: 15px;
  }

  .result-actions {
    width: 100%;
  }

  .result-actions .button {
    flex: 1;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
    width: calc(100% - 30px);
  }
}
