/* ============================================================
   赛场通讯生成台 — 视觉方向：铅印时代的编辑部
   纸色为底、墨色为字、朱红作印；细线分栏，印章点睛。
   ============================================================ */

@font-face {
  font-family: 'DispatchSerif';
  src: local('Songti SC'), local('STSong'), local('SimSun'), local('Noto Serif CJK SC'), local('Source Han Serif SC');
  font-display: swap;
}

:root {
  /* 纸与墨 */
  --paper: #f3eee2;
  --paper-hi: #fbf8f0;
  --paper-lo: #e9e2d3;
  --ink: #211c17;
  --ink-soft: #4a4136;
  --ink-mute: #746857;
  --rule: #cec4b1;
  --rule-soft: #e0d8c7;

  /* 朱印 */
  --seal: #b4341f;
  --seal-deep: #8c2515;
  --seal-wash: #f0ddd6;

  --shadow-paper: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 18px 40px -28px rgba(51, 38, 24, .55), 0 2px 6px -3px rgba(51, 38, 24, .2);

  --serif: 'DispatchSerif', 'Songti SC', 'STSong', 'Noto Serif CJK SC', 'Source Han Serif SC', Georgia, serif;
  --sans: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', -apple-system, sans-serif;
  --mono: 'SF Mono', 'JetBrains Mono', 'Roboto Mono', ui-monospace, monospace;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}

* { box-sizing: border-box; }

/* 组件自身的 display 会盖掉 [hidden] 的默认样式，这里统一兜住 */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 80% at 12% -10%, #fbf7ee 0%, transparent 55%),
    radial-gradient(100% 70% at 100% 0%, #efe7d7 0%, transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 纸张颗粒：极轻的噪点，避免大面积纯色发假 */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  mix-blend-mode: multiply;
  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='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

/* ───────────────────────────── 报头 ───────────────────────────── */

.masthead {
  position: relative;
  z-index: 1;
  padding: 0 clamp(20px, 5vw, 64px);
  max-width: 1360px;
  margin: 0 auto;
}

.masthead__rule {
  height: 1px;
  background: var(--ink);
  opacity: .75;
}

.masthead__rule--thick {
  height: 3px;
  margin-top: 3px;
  background: linear-gradient(to right, var(--ink) 0 62%, var(--rule) 62% 100%);
  opacity: .9;
}

.masthead__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 14px;
  flex-wrap: wrap;
}

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

.brand__seal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 3px;
  background: var(--seal);
  color: #fdf6ec;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .18), 0 0 0 1px rgba(140, 37, 21, .5) inset;
  transform: rotate(-2deg);
}

.brand__text h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.15;
}

.brand__text p {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--ink-mute);
  text-transform: uppercase;
}

.masthead__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-mute);
  padding-bottom: 4px;
}

.model-tag {
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .4);
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-mute);
  opacity: .6;
}

/* ───────────────────────────── 桌面 ───────────────────────────── */

.desk {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(20px, 5vw, 64px) 80px;
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

/* ───────────────────────── 稿签（左栏） ───────────────────────── */

.slip {
  position: sticky;
  top: 28px;
  padding: 26px 26px 22px;
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: var(--shadow-paper);
  /* 打孔装订的暗示：左侧一排小点 */
  background-image: radial-gradient(circle, var(--rule) 1px, transparent 1.2px);
  background-size: 100% 22px;
  background-repeat: repeat-y;
  background-position: 9px 0;
}

.slip::before {
  content: '';
  position: absolute;
  inset: 6px 0 auto 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--seal) 0 14px, transparent 14px 22px);
  opacity: .55;
}

.slip__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.slip__head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .14em;
}

.slip__no {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--ink-mute);
}

.field { margin-bottom: 18px; }

.field label,
.field legend {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 7px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink);
}

.req { color: var(--seal); font-size: 13px; }
.opt {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .08em;
  color: var(--ink-mute);
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  padding: 0 4px;
  transform: translateY(-1px);
}

input[type='text'],
input[type='number'],
textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 9px 2px;
  transition: border-color .2s var(--ease-io), background-color .2s;
}

textarea {
  border: 1px solid var(--rule);
  padding: 10px 12px;
  resize: vertical;
  min-height: 76px;
  line-height: 1.65;
  background: rgba(255, 255, 255, .45);
  border-radius: 2px;
}

input::placeholder,
textarea::placeholder { color: #a99e8d; }

input:hover, textarea:hover { border-color: #b3a794; }

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--seal);
  background: rgba(180, 52, 31, .03);
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
.chip input:focus-visible + span {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

input[aria-invalid='true'],
textarea[aria-invalid='true'] { border-color: var(--seal); }

.field-row {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 16px;
}

.field__hint {
  margin: 5px 0 0;
  min-height: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--seal-deep);
}

.field__hint:empty { display: none; }

.field__foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.counter {
  flex: none;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-mute);
}

.stepper {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stepper input {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: .02em;
  text-align: right;
  padding-right: 2px;
  -moz-appearance: textfield;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.stepper__unit {
  font-size: 12px;
  color: var(--ink-mute);
  padding-bottom: 9px;
}

.field--format { border: 0; padding: 0; margin: 0 0 22px; }

.chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.chip { position: relative; cursor: pointer; }

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

.chip span {
  display: block;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ink-soft);
  padding: 7px 0;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: rgba(255, 255, 255, .35);
  transition: all .18s var(--ease-io);
}

.chip:hover span { border-color: #b3a794; }

.chip input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-hi);
}

/* ───────────────────────── 分页：生稿 / 取稿 ───────────────────────── */

.tabs {
  display: flex;
  gap: 2px;
  margin: 0 0 22px;
  padding: 3px;
  background: var(--paper-lo);
  border-radius: 2px;
}

.tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: 1px;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .12em;
  cursor: pointer;
  transition: background-color .18s var(--ease-io), color .18s var(--ease-io), box-shadow .18s;
}

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

.tab.is-active {
  background: var(--paper-hi);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 1px 3px -1px rgba(51, 38, 24, .35);
}

.tab__badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--seal);
  color: #fdf6ec;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 16px;
  text-align: center;
}

.tab__badge[hidden] { display: none; }

.tab-panel { animation: rise .3s var(--ease-out) both; }

/* ─────────────────────────── 取稿面板 ─────────────────────────── */

#panelClaim .claim { margin: 0 0 24px; padding-top: 0; border-top: 0; }

#panelClaim .claim__label {
  font-size: 14px;
  margin-bottom: 9px;
}

.task-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4px;
}

.task-list-head__title {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
}

.task-list-head__clear {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 11px;
  color: var(--ink-mute);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.task-list-head__clear:hover { color: var(--seal); }

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 46vh;
  overflow-y: auto;
}

.task-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule-soft);
  animation: rise .3s var(--ease-out) both;
}

.task-item__main { min-width: 0; }

.task-item__title {
  display: block;
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item__id {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .02em;
  color: var(--ink-mute);
}

.task-item__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute);
  margin-top: 4px;
}

.task-item__state {
  padding: 1px 6px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink-soft);
}

.task-item__state--done { border-color: #a9bda9; color: #3f6b45; }
.task-item__state--gone { border-color: var(--rule-soft); color: var(--ink-mute); }

.task-item__actions {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  grid-row: 1 / span 2;
  grid-column: 2;
}

.task-item__actions button {
  font-size: 11.5px;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s var(--ease-io);
}

.task-item__actions button:hover:not(:disabled) {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(255, 255, 255, .55);
}

.task-item__actions button:disabled { opacity: .45; cursor: not-allowed; }

.task-item__actions .is-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-hi);
}

.task-item__actions .is-primary:hover:not(:disabled) { background: #322a22; color: var(--paper-hi); }

.task-list__empty {
  margin: 14px 0 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-mute);
}

.task-list__empty[hidden] { display: none; }

/* 主按钮：像一枚待盖的印章 */
.submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--seal-deep);
  border-radius: 2px;
  background: var(--seal);
  color: #fdf6ec;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .18em;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--seal-deep), 0 10px 22px -14px rgba(140, 37, 21, .9);
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), background-color .2s;
}

.submit:hover:not(:disabled) { background: #bd3a23; }
.submit:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 var(--seal-deep); }

.submit:disabled {
  cursor: progress;
  background: #b9a99b;
  border-color: #a3947f;
  box-shadow: 0 2px 0 #a3947f;
}

.submit__kbd {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  opacity: .6;
}

.submit__note {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-mute);
  text-align: center;
}

/* ─────────────────────────── 稿纸（右栏） ─────────────────────────── */

.paper-wrap { min-width: 0; }

.paper-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--ink);
  flex-wrap: wrap;
}

.paper-toolbar__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .14em;
}

.paper-toolbar__stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--ink-mute);
}

.paper-toolbar__stats[hidden] { display: none; }

.paper-toolbar__actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn {
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: .04em;
  padding: 8px 14px;
  border-radius: 2px;
  cursor: pointer;
  transition: all .18s var(--ease-io);
  white-space: nowrap;
}

.btn[hidden] { display: none; }

.btn--ghost {
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-soft);
}

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

.btn--solid {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper-hi);
}

.btn--solid:hover { background: #322a22; }

.btn__fmt { font-family: var(--mono); font-size: 11px; opacity: .7; }

.paper {
  position: relative;
  margin-top: 18px;
  min-height: 62vh;
  padding: clamp(28px, 4.4vw, 56px) clamp(24px, 4.6vw, 62px) clamp(40px, 5vw, 64px);
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  border-radius: 1px;
  box-shadow: var(--shadow-paper);
  overflow: hidden;
}

/* 稿纸的装订红线 */
.paper::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: clamp(14px, 2.4vw, 30px);
  width: 1px;
  background: var(--seal);
  opacity: .22;
}

/* ───────────────────────────── 空态 ───────────────────────────── */

.empty {
  max-width: 44ch;
  margin: clamp(8px, 3vw, 32px) auto 0;
  text-align: left;
  animation: rise .6s var(--ease-out) both;
}

.empty__stamp {
  display: inline-flex;
  gap: 6px;
  padding: 9px 11px;
  border: 2px solid var(--seal);
  border-radius: 2px;
  color: var(--seal);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  transform: rotate(-3deg);
  opacity: .82;
  margin-bottom: 26px;
}

.empty__stamp span { display: block; }

.empty h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 700;
  letter-spacing: .03em;
}

.empty > p {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.empty__tips {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  border-top: 1px solid var(--rule-soft);
}

.empty__tips li {
  position: relative;
  padding: 10px 0 10px 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule-soft);
}

.empty__tips li::before {
  content: '·';
  position: absolute;
  left: 2px;
  color: var(--seal);
  font-weight: 700;
}

.empty__tips b { color: var(--ink); font-weight: 600; }

.empty__sample {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  letter-spacing: .02em;
  color: var(--ink-mute);
  background: transparent;
  border: 0;
  border-left: 2px solid var(--rule);
  padding: 2px 0 2px 12px;
  cursor: pointer;
  transition: color .18s var(--ease-io), border-color .18s var(--ease-io);
}

.empty__sample:hover {
  color: var(--seal);
  border-left-color: var(--seal);
}

/* ─────────────────────── 取稿凭证 / 载入态 ─────────────────────── */

.ticket {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 36px);
  animation: rise .45s var(--ease-out) both;
  align-items: start;
}

.ticket__stub {
  position: relative;
  padding: 20px 20px 18px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--seal);
  background: linear-gradient(to bottom, rgba(180, 52, 31, .035), transparent 62%);
  border-radius: 1px;
}

/* 凭证的齿孔边 */
.ticket__stub::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: -7px;
  width: 7px;
  background-image: radial-gradient(circle at 3px 4px, var(--paper-hi) 2px, transparent 2.2px);
  background-size: 7px 11px;
}

.ticket__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ticket__kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--seal);
  text-transform: uppercase;
}

.ticket__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--seal);
  animation: pulse 1.4s var(--ease-io) infinite;
}

.pulse--done {
  background: #3f6b45;
  animation: none;
}

/* 少字重写中：用琥珀色，和「正在写稿」区分开 */
.pulse--rewrite {
  background: #b07a1e;
  animation: pulse 0.9s var(--ease-io) infinite;
}

.ticket__lead {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.ticket__id {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: var(--ink);
  border-radius: 2px;
}

.ticket__id code {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--paper-hi);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.ticket__id code::-webkit-scrollbar { display: none; }

.ticket__copy {
  flex: none;
  font-family: var(--sans);
  font-size: 11px;
  padding: 4px 9px;
  border: 1px solid rgba(251, 248, 240, .35);
  border-radius: 2px;
  background: transparent;
  color: var(--paper-hi);
  cursor: pointer;
  transition: background-color .18s var(--ease-io), border-color .18s var(--ease-io);
}

.ticket__copy:hover { background: rgba(251, 248, 240, .16); border-color: rgba(251, 248, 240, .6); }

.ticket__meta {
  display: flex;
  gap: 22px;
  margin: 14px 0 16px;
}

.ticket__meta dt {
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--ink-mute);
  margin-bottom: 2px;
}

.ticket__meta dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}

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

.ticket__actions .btn { flex: 1; text-align: center; }

.ticket__actions .btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.ticket__note {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-mute);
}

.ticket__skeleton {
  padding-top: 6px;
  min-width: 0;
}

/* 空态里的取稿入口 */
.claim {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--rule-soft);
}

.claim__label {
  display: block;
  margin-bottom: 7px;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink);
}

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

.claim__row input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .03em;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: rgba(255, 255, 255, .45);
}

.claim__row input:focus { outline: none; border-color: var(--seal); }

.claim__row .btn { flex: none; }

.claim__hint {
  margin: 7px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-mute);
}

.claim__hint.is-error { color: var(--seal-deep); }

.skeleton__title {
  height: 26px;
  width: 62%;
  margin: 0 auto 34px;
  background: var(--paper-lo);
  border-radius: 2px;
  animation: shimmer 1.8s var(--ease-io) infinite;
}

.skeleton__line {
  height: 12px;
  width: var(--w, 100%);
  margin-bottom: 13px;
  background: var(--paper-lo);
  border-radius: 2px;
  animation: shimmer 1.8s var(--ease-io) infinite;
}

.skeleton__line--gap { margin-top: 28px; }

/* ───────────────────────────── 成稿 ───────────────────────────── */

.draft {
  position: relative;
  animation: rise .55s var(--ease-out) both;
}

.draft__meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--ink-mute);
  text-align: center;
  margin-bottom: 18px;
}

.draft__meta:empty { display: none; }

.draft__title {
  margin: 0 0 clamp(24px, 3vw, 34px);
  font-family: var(--serif);
  font-size: clamp(22px, 3.1vw, 31px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: .02em;
  text-align: center;
  text-wrap: balance;
  padding: 4px 6px;
  border-radius: 2px;
  transition: background-color .2s, box-shadow .2s;
}

.draft__title:hover { background: rgba(180, 52, 31, .04); }
.draft__title:focus { outline: none; background: rgba(180, 52, 31, .05); box-shadow: 0 0 0 1px var(--rule-soft); }

.draft__body p {
  margin: 0 0 1.1em;
  font-family: var(--serif);
  font-size: clamp(15.5px, 1.35vw, 17px);
  line-height: 2;
  text-align: justify;
  text-indent: 2em;
  letter-spacing: .01em;
  color: #262019;
  padding: 3px 6px;
  margin-left: -6px;
  margin-right: -6px;
  border-radius: 2px;
  transition: background-color .2s, box-shadow .2s;
}

.draft__body p:hover { background: rgba(180, 52, 31, .035); }
.draft__body p:focus { outline: none; background: rgba(180, 52, 31, .05); box-shadow: 0 0 0 1px var(--rule-soft); }

.draft__body p:last-child { margin-bottom: 0; }

.draft__end {
  margin-top: clamp(28px, 3.4vw, 42px);
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .3em;
  color: var(--ink-mute);
}

/* 发稿章：盖在稿纸右下角 */
.seal-mark {
  position: absolute;
  right: clamp(-6px, -.5vw, 2px);
  bottom: -6px;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--seal);
  border-radius: 50%;
  color: var(--seal);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.1;
  text-align: center;
  transform: rotate(-11deg);
  opacity: .5;
  mix-blend-mode: multiply;
  pointer-events: none;
  animation: stamp .5s .35s var(--ease-out) both;
}

.seal-mark::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid var(--seal);
  border-radius: 50%;
  opacity: .6;
}

/* 印章文字用伪元素渲染：纯装饰，不进无障碍树，也不参与对比度审计 */
.seal-mark::after {
  content: '发稿';
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: .06em;
}

/* ─────────────────────── 导出文件名 ─────────────────────── */

.export-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .45);
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.export-bar[hidden] { display: none; }

.export-bar__label {
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.export-bar__field {
  display: flex;
  align-items: center;
  min-width: 0;
  border-bottom: 1px solid var(--rule);
  transition: border-color .18s var(--ease-io);
}

.export-bar__field:focus-within { border-color: var(--seal); }

.export-bar__field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  padding: 6px 2px;
}

.export-bar__field input:focus { outline: none; background: transparent; }

.export-bar__ext {
  flex: none;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-mute);
  padding-left: 4px;
  user-select: none;
}

.export-bar__reset {
  flex: none;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s var(--ease-io);
}

.export-bar__reset:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(255, 255, 255, .6);
}

.export-bar__hint {
  grid-column: 2 / -1;
  margin: 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-mute);
}

.export-bar__hint.is-error { color: var(--seal-deep); }

/* ─────────────────────────── 批量生稿 ─────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.batch__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.batch__title {
  margin: 0 0 3px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .08em;
}

.batch__sub {
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-mute);
}

.batch__quota {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: rgba(255, 255, 255, .4);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  white-space: nowrap;
}

.batch__quota-num { font-size: 15px; color: var(--ink); }
.batch__quota-num.is-empty { color: var(--seal); }
.batch__quota-lim { font-size: 12px; }
.batch__quota-unit { font-family: var(--sans); font-size: 10px; }

.batch__label-row { margin-bottom: 16px; }

.batch__label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-soft);
}

.batch__label-row input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  padding: 7px 2px;
}

.batch__label-row input:focus {
  outline: none;
  border-color: var(--seal);
}

.batch__rows-head {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr .8fr 64px 28px;
  gap: 6px;
  padding: 0 0 6px;
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--ink-mute);
  border-bottom: 1px solid var(--rule-soft);
}

.batch__rows {
  display: flex;
  flex-direction: column;
}

.batch__row {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr .8fr 64px 28px;
  gap: 6px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule-soft);
}

.batch__row input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  padding: 5px 2px;
}

.batch__row input:hover { border-bottom-color: var(--rule-soft); }

.batch__row input:focus {
  outline: none;
  border-bottom-color: var(--seal);
}

.batch__row input[aria-invalid='true'] { border-bottom-color: var(--seal); }

.batch__row input::placeholder { color: #b3a897; }

.batch__row-del {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--ink-mute);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all .15s var(--ease-io);
}

.batch__row-del:hover:not(:disabled) {
  border-color: var(--rule);
  color: var(--seal);
  background: rgba(255, 255, 255, .6);
}

.batch__row-del:disabled { opacity: .3; cursor: not-allowed; }

.batch__row-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0 20px;
  flex-wrap: wrap;
}

.batch__row-actions .btn {
  font-size: 11.5px;
  padding: 6px 12px;
}

/* 验证码 */

.captcha {
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: rgba(255, 255, 255, .45);
}

.captcha__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.captcha__label {
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-soft);
}

.captcha__refresh {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 11px;
  color: var(--ink-mute);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.captcha__refresh:hover { color: var(--seal); }

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

.captcha__img-wrap {
  flex: none;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #f9f6ee;
  line-height: 0;
  cursor: pointer;
  overflow: hidden;
}

.captcha__img {
  display: block;
  width: 124px;
  height: 44px;
  object-fit: cover;
}

.captcha__img-wrap:disabled { opacity: .5; cursor: wait; }

.captcha__row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper-hi);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 9px 10px;
}

.captcha__row input:focus {
  outline: none;
  border-color: var(--seal);
}

.captcha__row input[aria-invalid='true'] { border-color: var(--seal); }

.captcha__hint {
  margin: 8px 0 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-mute);
}

.captcha__hint.is-error { color: var(--seal-deep); }

/* 密钥通道 */

.secret {
  margin: -6px 0 18px;
  border: 1px dashed var(--rule);
  border-radius: 2px;
  background: rgba(255, 255, 255, .28);
}

.secret[open] { background: rgba(255, 255, 255, .5); }

.secret__summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  font-size: 11.5px;
  color: var(--ink-mute);
  cursor: pointer;
  list-style: none;
}

.secret__summary::-webkit-details-marker { display: none; }

.secret__summary::before {
  content: '＋';
  margin-right: 6px;
  font-family: var(--mono);
  font-size: 10px;
}

.secret[open] .secret__summary::before { content: '－'; }

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

.secret__tag {
  flex: none;
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--ink-mute);
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  padding: 1px 6px;
}

.secret__tag.is-active {
  color: var(--seal-deep);
  border-color: var(--seal);
  background: var(--seal-wash);
}

.secret__body { padding: 0 13px 12px; }

.secret__label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--serif);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-soft);
}

.secret__row { display: flex; gap: 6px; }

.secret__row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper-hi);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  padding: 8px 10px;
}

.secret__row input:focus {
  outline: none;
  border-color: var(--seal);
}

.secret__row input[aria-invalid='true'] { border-color: var(--seal); }

.secret__toggle {
  flex: none;
  padding: 6px 11px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.secret__toggle:hover { border-color: var(--ink); color: var(--ink); }

.secret__hint {
  margin: 7px 0 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-mute);
}

.secret__hint.is-error { color: var(--seal-deep); }
.secret__hint.is-ok { color: #3f6b45; }

/* 批量进度 */

.batch-result {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.batch-result__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.batch-result__title {
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .06em;
}

.batch-result__id {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-mute);
}

.progress {
  height: 4px;
  background: var(--paper-lo);
  border-radius: 2px;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 0;
  background: var(--seal);
  border-radius: 2px;
  transition: width .4s var(--ease-out);
}

.batch-result__status {
  margin: 7px 0 0;
  font-size: 11.5px;
  color: var(--ink-mute);
}

/* ─────────────────────────── 批量成稿 ─────────────────────────── */

.batch-drafts {
  padding: 4px 0 8px;
}

.batch-drafts__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--rule);
}

.batch-drafts__title {
  margin: 0 0 3px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .06em;
}

.batch-drafts__meta {
  margin: 0;
  font-size: 11px;
  color: var(--ink-mute);
}

.batch-drafts__actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.batch-drafts__actions .btn {
  font-size: 11.5px;
  padding: 6px 12px;
  white-space: nowrap;
}

.batch-drafts__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.batch-draft {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
  animation: rise .3s var(--ease-out) both;
}

.batch-draft__main { min-width: 0; }

.batch-draft__index {
  display: inline-block;
  margin-right: 7px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute);
  vertical-align: 2px;
}

.batch-draft__title {
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
}

.batch-draft__meta {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--ink-mute);
}

.batch-draft__excerpt {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.batch-draft__actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
}

.batch-draft__actions button {
  padding: 5px 11px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s var(--ease-io);
}

.batch-draft__actions button:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(255, 255, 255, .6);
}

.batch-draft__actions button.is-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-hi);
}

.batch-draft__actions button.is-primary:hover { background: #322a22; }

.paper-foot {
  margin: 14px 2px 0;
  font-size: 11.5px;
  color: var(--ink-mute);
  text-align: right;
}

/* ───────────────────────────── Toast ───────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 50;
  transform: translate(-50%, 18px);
  padding: 11px 20px;
  background: var(--ink);
  color: var(--paper-hi);
  font-size: 13px;
  letter-spacing: .03em;
  border-radius: 2px;
  box-shadow: 0 16px 40px -20px rgba(0, 0, 0, .8);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s var(--ease-out), transform .32s var(--ease-out);
  max-width: min(88vw, 460px);
  text-align: center;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.toast.is-error { background: var(--seal-deep); }

/* ───────────────────────────── 动效 ───────────────────────────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

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

@keyframes shimmer {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

@keyframes stamp {
  from { opacity: 0; transform: rotate(-11deg) scale(1.5); }
  to { opacity: .5; transform: rotate(-11deg) scale(1); }
}

/* ───────────────────────────── 响应式 ───────────────────────────── */

@media (max-width: 1020px) {
  .desk {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .slip {
    position: static;
    background-image: none;
  }
  .paper { min-height: 46vh; }
}

@media (max-width: 780px) {
  .ticket {
    grid-template-columns: 1fr;
  }
  .ticket__stub::after { display: none; }
  .ticket__skeleton { display: none; }

  /* 任务记录：操作按钮独占一行，避免挤压标题 */
  .task-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .task-item__actions {
    grid-row: auto;
    grid-column: 1;
    width: 100%;
  }
  .task-item__actions button {
    flex: 1;
    min-height: 40px;
  }
  .task-list { max-height: none; }
}

/* ── 触屏 / 移动端 ── */

@media (max-width: 620px) {
  body {
    font-size: 14px;
    /* iPhone 刘海屏留白 */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .masthead { padding-inline: 16px; }
  .masthead__inner {
    padding: 14px 0 12px;
    align-items: center;
    gap: 10px;
  }
  .masthead__meta {
    font-size: 10px;
    width: 100%;
    padding-bottom: 0;
    justify-content: space-between;
  }
  .brand { gap: 12px; }
  .brand__seal { width: 38px; height: 38px; font-size: 22px; }
  .brand__text h1 { font-size: 21px; letter-spacing: .06em; }
  .brand__text p { font-size: 9px; letter-spacing: .16em; }

  .desk {
    padding: 18px 16px calc(56px + env(safe-area-inset-bottom));
    gap: 22px;
  }

  /* 分页吸顶：滚动长表单时也能切换 */
  .slip {
    padding: 18px 16px 16px;
    overflow: visible;
  }
  .slip::before { inset: 5px 0 auto 0; }
  .slip__head { margin-bottom: 14px; padding-bottom: 10px; }

  .tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: 0 -4px 18px;
    padding: 4px;
    background: var(--paper-lo);
    box-shadow: 0 6px 12px -10px rgba(51, 38, 24, .6);
  }
  .tab {
    min-height: 40px;
    font-size: 14px;
  }

  /* 聚焦/锚点跳转时留出吸顶分页的高度，避免输入框被压在下面 */
  .field,
  input,
  textarea,
  button {
    scroll-margin-top: 76px;
  }

  /* 输入框 16px：避免 iOS 聚焦时自动放大页面 */
  input[type='text'],
  input[type='number'],
  textarea {
    font-size: 16px;
    padding: 10px 2px;
  }
  .stepper input { font-size: 17px; }
  .field { margin-bottom: 16px; }
  .field-row { grid-template-columns: 1fr 92px; gap: 12px; }

  .chips { gap: 8px; }
  .chip span { padding: 11px 0; font-size: 13px; }

  .submit {
    min-height: 50px;
    font-size: 16px;
    letter-spacing: .14em;
  }
  .submit__kbd { display: none; }
  .submit__note { font-size: 11px; }

  .batch__head { flex-direction: column; gap: 8px; }
  .batch__quota { align-self: flex-start; }
  .batch__row-actions .btn { flex: 1; min-height: 40px; }
  .batch__label-row input { font-size: 16px; padding: 9px 2px; }

  .captcha { padding: 12px; }
  .captcha__row { flex-direction: column; align-items: stretch; }
  .captcha__img-wrap { align-self: flex-start; }
  .captcha__row input {
    font-size: 16px;
    padding: 11px 10px;
    letter-spacing: .24em;
  }

  .claim__row { flex-direction: column; }
  .claim__row .btn { min-height: 44px; }
  .claim__row input { font-size: 16px; padding: 11px 10px; }

  /* 稿纸 */
  .paper-wrap { margin-top: 2px; }
  .paper-toolbar {
    gap: 10px;
    padding-bottom: 10px;
  }
  .paper-toolbar__stats { font-size: 10.5px; }
  .paper-toolbar__actions {
    margin-left: 0;
    width: 100%;
    gap: 6px;
  }
  .paper-toolbar__actions .btn {
    flex: 1;
    min-height: 42px;
    text-align: center;
    font-size: 12.5px;
  }
  .paper {
    padding: 24px 18px calc(34px + env(safe-area-inset-bottom));
    margin-top: 14px;
  }
  .paper::before { left: 9px; opacity: .18; }

  .empty { margin-top: 6px; max-width: none; }
  .empty__stamp { font-size: 15px; padding: 8px 10px; margin-bottom: 20px; }
  .empty h3 { font-size: 19px; }
  .empty > p { font-size: 13px; }
  .empty__tips li { font-size: 12.5px; padding: 9px 0 9px 16px; }
  .empty__sample { font-size: 11px; }

  .draft__title {
    font-size: 20px;
    line-height: 1.5;
    margin-bottom: 20px;
  }
  .draft__body p {
    font-size: 15.5px;
    line-height: 1.95;
    text-indent: 2em;
    margin-bottom: 1em;
  }
  .draft__meta { font-size: 10px; line-height: 1.7; }
  .draft__end { margin-top: 26px; }

  /* 印章缩小，避免压住正文 */
  .seal-mark {
    width: 56px;
    height: 56px;
    font-size: 12px;
    right: 2px;
    bottom: 0;
    opacity: .38;
  }

  .paper-foot { text-align: left; font-size: 11px; margin-top: 10px; }

  /* 导出文件名：窄屏下标签与按钮同行，输入框独占一行 */
  .export-bar {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 10px 12px;
  }
  .export-bar__label { grid-column: 1; }
  .export-bar__reset { grid-column: 2; grid-row: 1; min-height: 32px; }
  .export-bar__field {
    grid-column: 1 / -1;
    grid-row: 2;
    border: 1px solid var(--rule);
    border-radius: 2px;
    padding: 0 8px;
  }
  .export-bar__field:focus-within { border-color: var(--seal); }
  .export-bar__field input { font-size: 16px; padding: 9px 2px; }
  .export-bar__hint { grid-column: 1 / -1; grid-row: 3; font-size: 10px; }

  /* 凭证 */
  .ticket__stub { padding: 16px 14px; }
  .ticket__id { padding: 10px; }
  .ticket__id code {
    font-size: 12px;
    white-space: normal;
    word-break: break-all;
    overflow: visible;
  }
  .ticket__copy { min-height: 34px; padding: 6px 12px; }
  .ticket__actions { flex-direction: column; }
  .ticket__actions .btn { min-height: 46px; }
  .ticket__meta { gap: 18px; margin: 12px 0 14px; }

  .toast {
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 16px;
    right: 16px;
    transform: translateY(18px);
    max-width: none;
    font-size: 12.5px;
    padding: 12px 16px;
  }
  .toast.is-visible { transform: translateY(0); }
}

/* 批量面板在窄屏：行改成两列堆叠，验证码图片与输入框竖排 */
@media (max-width: 780px) {
  .batch__rows-head { display: none; }

  .batch__row {
    grid-template-columns: 1fr 1fr 26px;
    gap: 6px 8px;
    padding: 10px 0;
    align-items: start;
  }
  .batch__row input[data-field='name'] { grid-column: 1; }
  .batch__row input[data-field='project'] { grid-column: 2; }
  .batch__row input[data-field='time'] { grid-column: 1; }
  .batch__row input[data-field='wordCount'] { grid-column: 2; }
  .batch__row-del {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    width: 26px;
    height: 26px;
  }
  .batch__row input {
    border-bottom-color: var(--rule-soft);
    font-size: 16px;
    padding: 7px 2px;
  }
  .batch__row input::placeholder { font-size: 12.5px; }

  .batch-drafts__head { flex-direction: column; gap: 10px; }
  .batch-drafts__actions { width: 100%; }
  .batch-drafts__actions .btn { flex: 1; min-height: 40px; }

  .batch-draft {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .batch-draft__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .batch-draft__actions button {
    flex: 1;
    min-height: 38px;
    font-size: 12px;
  }
}

/* 更窄的屏：字数与时间各占一行 */
@media (max-width: 400px) {
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .stepper { max-width: 120px; }
  .brand__text p { display: none; }
  .draft__title { font-size: 18.5px; }
}

/* 触屏设备：加大点击热区，去掉点击高亮与 300ms 延迟 */
@media (hover: none), (pointer: coarse) {
  button,
  .chip,
  .tab,
  a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .btn { min-height: 40px; }
  .task-item__actions button { min-height: 40px; }
  .ticket__copy { min-height: 34px; }
  .chip span { padding-block: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* 打印：只留稿纸 */
@media print {
  body { background: #fff; }
  .grain, .masthead, .slip, .paper-toolbar, .paper-foot, .toast { display: none !important; }
  .desk { display: block; padding: 0; max-width: none; }
  .paper { box-shadow: none; border: 0; padding: 0; min-height: 0; }
  .paper::before { display: none; }
  .draft__title { font-size: 20pt; }
  .draft__body p { font-size: 12pt; }
  .seal-mark { display: none; }
}
