/* ==========================================================================
   摆渡人 · 外贸单证工作台 UI —— trade-ui.css
   方向：「单证台」— 深墨蓝工具栏 + 暖白纸面 + 渡橙仅用于品牌与当前焦点。
   订单级单证（SC/PI）= 青墨色；批次级单证（CI/PL/CD）= 琥珀色。
   仅作用于 .td-workspace 及其 .td- / .te- 后代；无外部字体与图片。
   在 workspace.css、editor.css 之后加载即可生效。
   ========================================================================== */
.td-workspace {
  --td-ink: #16232a;
  --td-muted: #4c5a60;          /* 7.0:1 on paper */
  --td-faint: #6b777c;          /* 4.6:1 on paper */
  --td-accent: #1d4f5c;         /* 主操作：墨青 */
  --td-accent-hover: #123843;
  --td-accent-soft: #e4eef0;
  --td-order: #1d5f6b;          /* 整笔订单 */
  --td-order-soft: #e2eff0;
  --td-batch: #8a5a12;          /* 出货批次 */
  --td-batch-soft: #f7ecd8;
  --td-brand: #d9541a;          /* 渡橙 */
  --td-focus: #d9541a;
  --td-border: #d5d9d4;
  --td-border-strong: #a9b2ae;
  --td-paper: #ffffff;
  --td-bg: #f3f1ec;
  --td-bar: #14232b;
  --td-radius: 8px;
  --td-shadow: 0 1px 2px rgb(20 35 43 / .06), 0 6px 18px -8px rgb(20 35 43 / .18);
  --td-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --td-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Times New Roman", Georgia, serif;
  font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px; line-height: 1.6; color: var(--td-ink); background: var(--td-bg);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
.td-workspace :focus-visible { outline: 2px solid var(--td-focus); outline-offset: 2px; border-radius: 4px; }
.td-workspace a { color: inherit; text-decoration: none; }
.td-workspace .td-skip { background: var(--td-ink); color: #fff; border-radius: 0 0 6px 0; left: 0; }

/* ---------- 顶栏 ---------- */
.td-workspace .td-top { background: var(--td-bar); border-bottom: 3px solid var(--td-brand); position: sticky; top: 0; z-index: 6; }
.td-workspace .td-top-inner { min-height: 58px; gap: 14px; }
.td-workspace .td-brand { color: #fff; }
.td-workspace .td-brand img { width: 30px; height: 30px; border-radius: 6px; box-shadow: 0 0 0 2px rgb(255 255 255 / .12); }
.td-workspace .td-brand b { font-size: 16px; letter-spacing: .04em; }
.td-workspace .td-divider { background: rgb(255 255 255 / .22); }
.td-workspace .td-brand-tool { color: #c6d0d3; font-weight: 500; letter-spacing: .06em; }
.td-workspace .td-tabs { gap: 4px; align-self: center; }
.td-workspace .td-tabs a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 0; border-radius: 6px; color: #d3dbdd; font-weight: 500; }
.td-workspace .td-tabs a:hover { background: rgb(255 255 255 / .08); color: #fff; }
.td-workspace .td-tabs a[aria-current] { background: #fff; color: var(--td-ink); font-weight: 700; }
.td-workspace .td-site-link { color: #c6d0d3; border-left-color: rgb(255 255 255 / .2); }
.td-workspace .td-site-link:hover { color: #fff; }

/* ---------- 页头 ---------- */
.td-workspace .td-main { width: min(100% - 64px, 1280px); padding: 32px 0 64px; }
.td-workspace .td-top-inner { width: min(100% - 64px, 1280px); }
.td-workspace .td-heading { align-items: center; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--td-border); }
.td-workspace .td-heading h1 { font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -.01em; font-weight: 700; line-height: 1.25; }
.td-workspace .td-heading p { margin-top: 6px; color: var(--td-muted); font-size: 14px; }

/* ---------- 按钮 ---------- */
.td-workspace :is(.td-primary,.td-secondary,.td-close) {
  min-height: 40px; padding: 8px 16px; gap: 8px; border-radius: 6px; font-weight: 600; font-size: 14px;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.td-workspace .td-primary { background: var(--td-accent); border-color: var(--td-accent); color: #fff; box-shadow: 0 1px 0 rgb(0 0 0 / .15), inset 0 1px 0 rgb(255 255 255 / .1); }
.td-workspace .td-primary:hover:not(:disabled) { background: var(--td-accent-hover); border-color: var(--td-accent-hover); }
.td-workspace .td-primary:active:not(:disabled) { transform: translateY(1px); }
.td-workspace .td-secondary, .td-workspace .td-close { background: var(--td-paper); border: 1px solid var(--td-border-strong); color: var(--td-ink); }
.td-workspace :is(.td-secondary,.td-close):hover:not(:disabled) { border-color: var(--td-accent); color: var(--td-accent); background: var(--td-accent-soft); }
.td-workspace :is(.td-primary,.td-secondary):disabled { opacity: 1; cursor: not-allowed; background: #e7e9e6; border-color: #d3d7d3; color: #7a8487; box-shadow: none; }
.td-workspace .td-text-btn { color: var(--td-accent); font-weight: 600; text-underline-offset: 3px; }
.td-workspace .td-save-status { font-size: 12px; color: var(--td-muted); display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 首页：目录 + 纸样 ---------- */
.td-workspace .td-gallery { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 28px; }
.td-workspace .td-catalog { padding: 0; }
.td-workspace .td-section-heading { border-bottom: 0; padding-bottom: 4px; }
.td-workspace .td-catalog h2 { font-size: 15px; font-weight: 700; color: var(--td-muted); letter-spacing: .04em; }
.td-workspace .td-template-group {
  margin-top: 12px; padding: 6px; background: var(--td-paper); border: 1px solid var(--td-border);
  border-top: 3px solid var(--td-order); border-radius: var(--td-radius); box-shadow: var(--td-shadow);
  --grp: var(--td-order); --grp-soft: var(--td-order-soft);
}
.td-workspace .td-template-group + .td-template-group { border-top-color: var(--td-batch); --grp: var(--td-batch); --grp-soft: var(--td-batch-soft); }
.td-workspace .td-template-group h3 {
  display: flex; align-items: center; gap: 8px; margin: 4px 8px 6px; color: var(--grp);
  font-size: 12px; font-weight: 700; letter-spacing: .1em;
}
.td-workspace .td-template {
  min-height: 58px; gap: 12px; padding: 9px 10px; margin: 0; border: 1px solid transparent; border-radius: 6px;
  background: transparent; transition: background-color .15s, border-color .15s;
}
.td-workspace .td-template + .td-template { margin-top: 2px; }
.td-workspace .td-template:hover:not([aria-pressed=true]) { background: #f4f5f2; }
.td-workspace .td-template[aria-pressed=true] { background: var(--grp-soft); border: 1px solid var(--grp); border-left: 1px solid var(--grp); padding-left: 10px; box-shadow: inset 4px 0 0 var(--grp); }
.td-workspace .td-template-text strong { font-size: 15.5px; font-weight: 650; line-height: 1.4; }
.td-workspace .td-template-text > span { color: var(--td-muted); font-size: 12px; }
.td-workspace .td-chevron { color: var(--td-faint); font-size: 20px; transition: transform .15s, color .15s; }
.td-workspace .td-template[aria-pressed=true] .td-chevron { color: var(--grp); transform: translateX(2px); }
.td-workspace .td-symbol { width: 34px; height: 40px; border-radius: 3px; color: var(--td-order); background: var(--td-order-soft); border: 1px solid currentColor; }
.td-workspace .td-symbol::before { background: linear-gradient(45deg, transparent 47%, currentColor 49% 54%, var(--td-paper) 56%); }
.td-workspace .td-symbol b { font: 700 10.5px/1 var(--td-mono); letter-spacing: .02em; }
.td-workspace :is(.td-symbol-ci,.td-symbol-pl,.td-symbol-customs) { color: var(--td-batch); background: var(--td-batch-soft); }
.td-workspace .td-symbol-pi { color: var(--td-order); background: var(--td-order-soft); }

.td-workspace .td-sample { position: sticky; top: 82px; border: 1px solid var(--td-border); border-radius: var(--td-radius); background: var(--td-paper); box-shadow: var(--td-shadow); }
.td-workspace .td-sample-head { padding: 12px 18px; border-bottom: 1px solid var(--td-border); font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.td-workspace .td-sample-head span:last-child { padding: 2px 8px; border-radius: 999px; background: var(--td-accent-soft); color: var(--td-accent); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.td-workspace .td-board {
  padding: clamp(20px, 3vw, 40px) clamp(20px, 5vw, 72px); background-color: #e7e4dc;
  background-image: radial-gradient(rgb(20 35 43 / .09) 1px, transparent 1.2px); background-size: 14px 14px;
}
.td-workspace .td-sample-paper { background: #fffefb; color: #1d2a2f; border: 1px solid #d9d6cc; border-radius: 2px; box-shadow: 0 1px 1px rgb(0 0 0 / .05), 0 18px 32px -16px rgb(20 35 43 / .35); min-height: 280px; }
.td-workspace .td-paper-line { background: var(--td-brand); width: 40px; }
.td-workspace .td-specimen-brand { color: var(--td-faint); }
.td-workspace .td-paper-title { font-family: var(--td-serif); font-weight: 700; letter-spacing: .01em; font-size: clamp(22px, 2.4vw, 34px); }
.td-workspace .td-paper-sub { color: var(--td-muted); letter-spacing: .1em; }
.td-workspace .td-sample-metadata { border-top: 1.5px solid #1d2a2f; }
.td-workspace .td-sample-table { border-top: 1.5px solid #1d2a2f; border-bottom: 1px solid #1d2a2f; }
.td-workspace .td-sample-table > div:first-child { background: #eef0ec; }
.td-workspace .td-sample-action { min-height: 68px; padding: 12px 18px; background: #fafaf8; border-top: 1px solid var(--td-border); }
.td-workspace .td-sample-action > span { font: 600 12px/1.5 var(--td-mono); color: var(--td-muted); letter-spacing: .04em; }
.td-workspace .td-sample-action i { color: var(--td-faint); }
.td-workspace .td-sample-action .td-primary { min-height: 44px; padding-inline: 22px; font-size: 15px; }

/* ---------- 编辑：批次栏 + 表单 ---------- */
.td-workspace .td-main[data-screen=order] .td-heading { position: sticky; top: 61px; z-index: 5; margin: -32px 0 20px; padding: 14px 0; background: rgb(243 241 236 / .94); backdrop-filter: blur(6px); }
.td-workspace .td-main[data-screen=order] .td-heading h1 { font-size: 22px; }
.td-workspace .td-edit-grid { grid-template-columns: 248px minmax(0, 1fr); gap: 20px; }
.td-workspace :is(.td-rail,.td-form-area,.td-empty,.td-order-list) { border: 1px solid var(--td-border); border-radius: var(--td-radius); background: var(--td-paper); box-shadow: var(--td-shadow); }
.td-workspace .td-rail { position: sticky; top: 140px; padding: 6px 14px; max-height: calc(100vh - 160px); overflow: auto; }
.td-workspace .td-rail-group h2 { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; color: var(--td-order); }
.td-workspace .td-rail-group + .td-rail-group h2 { color: var(--td-batch); }
.td-workspace .td-nav-doc { min-height: 40px; padding: 6px 8px; border-radius: 6px; color: var(--td-ink); font-size: 14px; }
.td-workspace .td-nav-doc:hover { background: #f2f3f0; }
.td-workspace .td-nav-doc[aria-pressed=true] { background: var(--td-ink); color: #fff; font-weight: 700; }
.td-workspace .td-nav-doc[aria-pressed=true] .td-symbol { background: #fff; }
.td-workspace .td-nav-doc .td-symbol { width: 22px; height: 26px; }
.td-workspace .td-nav-doc .td-symbol b { font-size: 7.5px; }
.td-workspace .td-batch-label { margin: 4px 0 10px; padding: 10px; border-radius: 6px; background: var(--td-batch-soft); border: 1px solid #e3c995; color: var(--td-batch); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.td-workspace :is(.td-batch-label select,.td-search input) { min-height: 40px; border: 1px solid var(--td-border-strong); border-radius: 6px; background: #fff; color: var(--td-ink); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.td-workspace .td-batch-label select:focus, .td-workspace .td-search input:focus { outline: none; border-color: var(--td-accent); box-shadow: 0 0 0 3px rgb(29 79 92 / .18); }
.td-workspace .td-personal { color: var(--td-muted); }
.td-workspace .td-archive summary { font-weight: 600; }
.td-workspace .td-archive button { color: var(--td-accent); border-radius: 4px; }
.td-workspace .td-archive button:hover { background: var(--td-accent-soft); }
.td-workspace .td-form-area { padding: clamp(16px, 2.4vw, 32px); }

.td-workspace .te-editor { gap: 22px; --te-ink: var(--td-ink); --te-muted: var(--td-muted); --te-accent: var(--td-accent); --te-border: var(--td-border); }
.td-workspace .te-section { gap: 14px; padding: 0 0 22px; border-bottom: 1px dashed var(--td-border); }
.td-workspace .te-section:last-child { border-bottom: 0; padding-bottom: 0; }
.td-workspace .te-editor .te-section-title { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; font-size: 16px; font-weight: 700; }
.td-workspace .te-editor .te-section-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--td-accent); flex: none; }
.td-workspace .te-grid { gap: 14px 18px; }
.td-workspace .te-party + .te-party { border-left-color: var(--td-border); }
.td-workspace .te-subtitle { font-size: 13.5px; }
.td-workspace .te-label { font-size: 13px; font-weight: 600; color: var(--td-ink); gap: 2px 6px; }
.td-workspace .te-translation, .td-workspace .te-role-en { color: var(--td-faint); font-size: 11px; font-family: var(--td-mono); letter-spacing: .01em; }
.td-workspace .te-field:focus-within .te-label { color: var(--td-accent); }
.td-workspace .te-editor .te-input { height: 40px; padding: 8px 11px; border: 1px solid var(--td-border-strong); border-radius: 6px; background: #fff; color: var(--td-ink); font-size: 14.5px; transition: border-color .12s, box-shadow .12s; }
.td-workspace .te-editor textarea.te-input { height: auto; min-height: 76px; line-height: 1.5; }
.td-workspace .te-editor .te-input:hover:not(:focus):not(:disabled) { border-color: #7f8b88; }
.td-workspace .te-editor .te-input:focus { outline: none; border-color: var(--td-accent); box-shadow: 0 0 0 3px rgb(29 79 92 / .18); }
.td-workspace .te-editor .te-input:disabled, .td-workspace .te-editor .te-input[readonly] { background: #f2f3f0; color: var(--td-muted); }
.td-workspace .te-editor .te-input::placeholder { color: #8a9497; }
.td-workspace .te-editor .te-input[aria-invalid="true"] { border-color: #b3261e; box-shadow: 0 0 0 3px rgb(179 38 30 / .12); }
.td-workspace .te-input[type=number], .td-workspace .te-computed { font-variant-numeric: tabular-nums; }
.td-workspace .te-details { border: 1px solid var(--td-border); border-radius: 6px; background: #fafaf8; }
.td-workspace .te-summary { padding: 10px 12px; font-weight: 600; font-size: 13.5px; cursor: pointer; border-radius: 6px; }
.td-workspace .te-summary:hover { background: #f1f2ee; }
.td-workspace .te-details[open] > .te-summary { border-bottom: 1px solid var(--td-border); border-radius: 6px 6px 0 0; }
.td-workspace .te-details > :not(summary) { margin: 12px; }
.td-workspace .te-item { border: 1px solid var(--td-border); border-left: 4px solid var(--td-batch); border-radius: 6px; background: #fff; }
.td-workspace .te-item-head { background: #faf8f3; border-bottom: 1px solid var(--td-border); border-radius: 0 6px 0 0; }
.td-workspace .te-item-number { font-family: var(--td-mono); color: var(--td-batch); }
.td-workspace .te-computed { color: var(--td-ink); font-weight: 700; }
.td-workspace .te-editor .te-add { border: 1px dashed var(--td-accent); border-radius: 6px; color: var(--td-accent); background: var(--td-accent-soft); font-weight: 600; min-height: 42px; }
.td-workspace .te-editor .te-add:hover { background: #d5e5e8; }
.td-workspace .te-editor .te-remove { color: #a12a1f; }
.td-workspace .te-editor :is(button, summary, .te-select input, .te-logo-file):focus-visible { outline: 2px solid var(--td-focus); outline-offset: 2px; }

/* ---------- 我的订单 ---------- */
.td-workspace .td-search { gap: 10px; margin-bottom: 14px; font-weight: 600; color: var(--td-muted); }
.td-workspace .td-search input { flex: 1; max-width: 420px; padding: 8px 12px 8px 34px; font-weight: 500;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%234c5a60' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") no-repeat 11px 50%; }
.td-workspace .td-order-list { overflow: hidden; }
.td-workspace .td-order-row { padding: 14px 20px; gap: 16px; transition: background-color .12s; }
.td-workspace .td-order-row:hover { background: #fafaf7; }
.td-workspace .td-order-row + .td-order-row { border-top-color: var(--td-border); }
.td-workspace .td-order-row h2 { font-size: 16px; font-weight: 700; }
.td-workspace .td-order-row p { color: var(--td-muted); font-size: 13px; }
.td-workspace .td-date { font-family: var(--td-mono); font-size: 12px; color: var(--td-muted); }
.td-workspace .td-empty { padding: 56px 24px; border-style: dashed; border-color: var(--td-border-strong); box-shadow: none; }
.td-workspace .td-empty-folder, .td-workspace .td-empty-folder::before { background: var(--td-batch-soft); border-color: var(--td-batch); }
.td-workspace .td-empty h2 { font-size: 18px; }
.td-workspace .td-empty p, .td-workspace .td-list-none { color: var(--td-muted); }
.td-workspace .td-list-none { padding: 28px 20px; text-align: center; }

/* ---------- 预览弹层 ---------- */
.td-workspace #td-dialog { border: 0; border-radius: 10px; background: #dedbd3; box-shadow: 0 30px 80px -20px rgb(0 0 0 / .5); width: min(1040px, 94vw); }
.td-workspace #td-dialog::backdrop { background: rgb(14 24 30 / .62); backdrop-filter: blur(2px); }
.td-workspace .td-dialog-head { background: var(--td-bar); color: #fff; border-bottom: 3px solid var(--td-brand); padding: 12px 18px; }
.td-workspace .td-dialog-head h2 { font-size: 17px; color: #fff; }
.td-workspace .td-dialog-head p { color: #c6d0d3; }
.td-workspace .td-dialog-head .td-close { background: transparent; border-color: rgb(255 255 255 / .3); color: #fff; }
.td-workspace .td-dialog-head .td-close:hover { background: rgb(255 255 255 / .12); color: #fff; border-color: #fff; }
.td-workspace .td-dialog-foot { background: var(--td-paper); border-top: 1px solid var(--td-border); padding: 12px 18px; }
.td-workspace #td-dialog-status { color: var(--td-muted); }
.td-workspace .td-errors { background: #fdf0e6; color: #7a3410; border-bottom: 1px solid #f0c9a8; font-size: 13px; }
.td-workspace .td-preview-scroll { padding: 28px 20px; }
.td-workspace .td-sheet { background: #fff; color: #111b20; border: 0; border-radius: 2px; box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 12px 30px -12px rgb(0 0 0 / .3); font-size: 13px; line-height: 1.55; }
.td-workspace .td-sheet-title { border-bottom: 2px solid #111b20; }
.td-workspace .td-sheet-title h3 { font-family: var(--td-serif); font-weight: 700; }
.td-workspace .td-sheet-refs { font-family: var(--td-mono); font-size: 12px; color: #3d4a50; }
.td-workspace .td-sheet-parties h4, .td-workspace .td-sheet dt { color: #4c5a60; font-size: 11.5px; letter-spacing: .03em; }
.td-workspace .td-sheet-parties > div { border-top-color: #9aa5a3; }
.td-workspace .td-sheet th, .td-workspace .td-sheet td { border-color: #b8c0bd; padding: 6px 8px; }
.td-workspace .td-sheet th { background: #eef0ec; font-weight: 700; font-size: 11.5px; }
.td-workspace .td-sheet tbody tr:nth-child(even) td { background: #fafbf9; }
.td-workspace .td-sheet .td-number { font-variant-numeric: tabular-nums; font-family: var(--td-mono); font-size: 12px; }
.td-workspace .td-sheet-totals { padding: 8px 10px; background: #f3f4f1; border-top: 1.5px solid #111b20; }
.td-workspace .td-sheet-totals dd { font-family: var(--td-mono); }

.td-workspace .td-notice { background: var(--td-ink); color: #fff; border-radius: 8px; border-left: 4px solid var(--td-brand); box-shadow: 0 12px 30px -10px rgb(0 0 0 / .45); }

/* ---------- 平板 ---------- */
@media (max-width: 960px) {
  .td-workspace .td-gallery { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 18px; }
  .td-workspace .td-edit-grid { grid-template-columns: 210px minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 850px) { .td-workspace :is(.td-top-inner,.td-main) { width: calc(100% - 40px); } }

/* ---------- 手机 ---------- */
@media (max-width: 650px) {
  .td-workspace :is(.td-top-inner,.td-main) { width: calc(100% - 24px); }
  .td-workspace .td-top-inner { min-height: 52px; gap: 8px; }
  .td-workspace .td-brand b { font-size: 14px; }
  .td-workspace .td-brand img { width: 26px; height: 26px; }
  .td-workspace .td-tabs { gap: 2px; margin-left: auto; }
  .td-workspace .td-tabs a { padding: 0 10px; min-height: 34px; font-size: 13.5px; }
  .td-workspace .td-main { padding: 18px 0 40px; }
  .td-workspace .td-heading { padding-bottom: 14px; margin-bottom: 14px; }
  .td-workspace .td-heading h1 { font-size: 22px; }
  .td-workspace .td-gallery { gap: 14px; }
  .td-workspace .td-template-group { margin-top: 8px; padding: 8px; gap: 6px; }
  .td-workspace .td-template-group h3 { margin: 0 2px 2px; }
  .td-workspace .td-template { flex: 1 1 calc(50% - 6px); min-height: 44px; padding: 6px 10px; background: #fff; border: 1px solid var(--td-border); border-radius: 6px; margin: 0; }
  .td-workspace .td-template + .td-template { margin-top: 0; }
  .td-workspace .td-template[aria-pressed=true] { padding-left: 10px; }
  .td-workspace .td-template-text strong { font-size: 14px; }
  .td-workspace .td-sample { position: static; }
  .td-workspace .td-board { padding: 14px; }
  .td-workspace .td-sample-paper { min-height: 0; }
  .td-workspace .td-sample-action { flex-wrap: wrap; }
  .td-workspace .td-sample-action .td-primary { flex: 1 1 100%; }

  .td-workspace .td-main[data-screen=order] .td-heading { position: static; margin: 0 0 12px; padding: 0 0 12px; background: none; backdrop-filter: none; }
  .td-workspace .td-main[data-screen=order] .td-heading h1 { font-size: 19px; }
  .td-workspace .td-main[data-screen=order] .td-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; margin: 0; gap: 8px; flex-wrap: nowrap;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom)); background: var(--td-paper);
    border-top: 1px solid var(--td-border); box-shadow: 0 -8px 20px -12px rgb(20 35 43 / .3);
  }
  .td-workspace .td-main[data-screen=order] .td-actions :is(.td-primary,.td-secondary) { min-height: 44px; padding-inline: 12px; flex: 1 1 0; min-width: 0; white-space: nowrap; }
  .td-workspace .td-main[data-screen=order] .td-actions { flex-wrap: wrap; row-gap: 6px; }
  .td-workspace .td-main[data-screen=order] .td-save-status { flex: 1 1 100%; order: -1; margin: 0; font-size: 12px; line-height: 1.4; color: var(--td-muted); }
  .td-workspace .td-main[data-screen=order] { padding-bottom: 130px; }
  .td-workspace .td-rail { position: static; max-height: none; padding: 4px 10px; }
  .td-workspace .td-rail-toggle { min-height: 44px; color: var(--td-ink); font-weight: 700; }
  .td-workspace .td-nav-doc { min-height: 36px; font-size: 13px; padding: 4px 6px; }
  .td-workspace .td-form-area { padding: 14px; }
  .td-workspace .te-section { padding-bottom: 18px; }
  .td-workspace .td-order-row { padding: 14px; }
  .td-workspace .td-order-row button { flex: 1 1 auto; }
  .td-workspace .td-search input { max-width: none; }
  .td-workspace #td-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .td-workspace .td-preview-scroll { padding: 12px 8px; }
  .td-workspace .td-dialog-foot { flex-wrap: wrap; }
  .td-workspace .td-dialog-foot :is(.td-primary,.td-secondary) { flex: 1 1 auto; }
  .td-workspace .td-notice { bottom: 84px; }
}
@media (max-width: 360px) {
  .td-workspace .td-brand b { display: none; }
}
/* 手机：选择后立即看到「制作」，表单 16px 防 iOS 放大 */
@media (max-width: 650px) {
  .td-workspace .td-main:not([data-screen]) .td-heading p,
  .td-workspace .td-main[data-screen=home] .td-heading p { font-size: 13px; margin-top: 2px; }
  .td-workspace .td-catalog .td-section-heading { display: none; }
  .td-workspace .td-template-group { display: grid; grid-template-columns: 1fr 1fr; }
  .td-workspace .td-template-group h3 { grid-column: 1 / -1; }
  .td-workspace .td-template { min-height: 44px; }
  .td-workspace .td-template-group + .td-template-group .td-template:last-child { grid-column: 1 / -1; }
  .td-workspace .td-sample { display: flex; flex-direction: column; }
  .td-workspace .td-sample-action { order: -1; min-height: 0; padding: 10px 12px; border-top: 0; border-bottom: 1px solid var(--td-border); }
  .td-workspace .td-sample-head { order: -2; padding: 8px 12px; }
  .td-workspace .td-sample-action .td-primary { min-height: 48px; }
  .td-workspace :is(.te-editor .te-input, .te-editor select, .te-editor textarea, .te-select input, .td-search input, .td-batch-label select) { font-size: 16px; }
  .td-workspace .td-main[data-screen=order] .td-actions :is(.td-primary,.td-secondary) { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .td-workspace * { transition: none !important; } }
