/* ==========================================================================
   Document Overlay & Certificate Printing Design System
   SaaS / Desktop Tool: Sub-millimeter Form Alignment & Batch Issuance Engine
   Style: Linear / VS Code Clean Slate Tool Paradigm (No Emojis)
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Color System */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;

  --border-subtle: #f1f5f9;
  --border-default: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-disabled: #94a3b8;

  --brand-primary: #0f172a;
  --brand-primary-hover: #1e293b;
  --brand-accent: #2563eb;
  --brand-accent-hover: #1d4ed8;
  --brand-accent-subtle: #eff6ff;

  --danger-surface: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #b91c1c;

  --success-surface: #f0fdf4;
  --success-border: #bbf7d0;
  --success-text: #15803d;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

  --sidebar-width: 344px;
  --header-height: 52px;

  /* Kungfu ID Pro 会员身份族：墨 + 香槟金。会员/订阅表面专用，功能 UI 一律不取用。
     单一真值：所有 Pro 视觉只引用这里，禁止在这些区域再写裸色值。 */
  --pro-ink-deep: #0f172a;
  --pro-ink: #1e293b;
  --pro-gold: #a16207;          /* 主金：浅底上的文字/图标 */
  --pro-gold-deep: #854d0e;     /* 深金：强调文字、CTA 底 */
  --pro-gold-border: #d8c39a;   /* 金色发丝描边 */
  --pro-gold-soft: #faf5ec;     /* 金调浅底 */
  --pro-ink-gradient: linear-gradient(160deg, #1e293b 0%, #0f172a 72%);
  --pro-gold-bright: #f2c14e;   /* 亮金：墨底上的文字/图标/描边 */
  --pro-gold-cta: linear-gradient(135deg, #f7d472 0%, #e8ae3c 55%, #d9941f 100%);  /* 香槟金 CTA，配墨字 */
  --pro-on-gold: #1a1408;       /* 金底上的文字 */
  --pro-ink-border: rgba(242, 193, 78, 0.4);  /* 墨底卡片上的金色发丝描边 */
  --pro-ink-glow: rgba(242, 193, 78, 0.2);    /* 墨底卡片右上角的柔金光晕 */
  --pro-on-ink-muted: #b6c2d6;  /* 墨底上的次级文字 */
  /* 表面与控件规范（全站唯一出处）：
     形靠底色、不靠描边——卡片、分组、按钮、分段控件都用填充表达轮廓与层级，不画边框线；
     只有输入控件保留 1px 边框，阴影只给浮层与分段滑块。
     层级三层为限：页面灰底 → 白卡（11px）→ 卡内浅灰分组（8px）→ 控件。
     按钮三种：主按钮实心蓝；次按钮浅灰芯片（--bg-subtle，悬停 --bg-hover）；幽灵按钮只给纯图标钮与行内弱操作。
     破坏性确认是实心红，行内删除是红字幽灵钮。
     标签：徽标/计数/状态是「文字 + 语义色」。
     会员徽标是唯一例外：实底胶囊（Pro 金、Free 灰），无描边、轻投影取立体感；字面固定 Free / Pro，不走语言包。
     圆角：浮层 12px / 卡片 11px / 分组 8px / 控件 6px；纯图标圆钮与色点 50%；胶囊只用于会员徽标。 */
  --surface-sidebar: #f4f5f7;
  --surface-track: #e9ecf1;      /* 分段控件轨道 */
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-thumb: 0 1px 2px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ----------------- Header Navigation ----------------- */
.app-header {
  height: var(--header-height);
  min-height: var(--header-height);
  flex: 0 0 auto;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  position: relative;
  z-index: 450;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-home-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-home-link:hover .brand-title {
  color: var(--brand-accent);
}

.global-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.global-nav-link {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.global-nav-link:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.brand-product-sep {
  width: 1px;
  height: 16px;
  background: var(--border-default);
  margin: 0 2px;
  flex-shrink: 0;
}

/* 品牌旁「全部工具」下拉：快捷预览 + 直达工具主页 + 平台扩展叙事 */
.brand-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.brand-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.brand-switcher-btn:hover,
.brand-switcher-btn.is-open {
  background: var(--bg-subtle);
  border-color: var(--border-default);
  color: var(--text-main);
}

.brand-switcher-grid {
  width: 13px;
  height: 13px;
  color: var(--text-muted);
}

.brand-switcher-btn:hover .brand-switcher-grid,
.brand-switcher-btn.is-open .brand-switcher-grid {
  color: var(--brand-accent);
}

.brand-switcher-chevron {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  transition: transform 0.14s ease;
}

.brand-switcher-btn.is-open .brand-switcher-chevron {
  transform: rotate(180deg);
}

.brand-switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 480;
  width: 304px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-menu-heading {
  padding: 4px 8px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.brand-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.brand-menu-item:hover {
  background: var(--bg-subtle);
  border-color: var(--border-default);
}

.brand-menu-item.is-current {
  background: var(--brand-accent-subtle);
  border-color: #dbeafe;
  cursor: default;
}

.brand-menu-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-menu-icon.is-workbench {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 65%, #60a5fa 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

.brand-menu-hub-link {
  color: var(--brand-accent) !important;
  font-weight: 600 !important;
}

.brand-menu-app-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}

.brand-menu-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-menu-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-menu-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-main);
}

.brand-menu-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 650;
  line-height: 16px;
  color: var(--brand-accent);
}

.brand-menu-tag.is-active {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.brand-menu-desc {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-muted);
}

.brand-menu-arrow {
  width: 14px;
  height: 14px;
  color: var(--text-disabled);
  flex-shrink: 0;
}

.brand-menu-item:hover .brand-menu-arrow {
  color: var(--brand-accent);
}

.brand-menu-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 7px 9px 4px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

.brand-menu-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.brand-menu-footer a:hover {
  color: var(--brand-accent);
  text-decoration: underline;
}

/* Distinctive Geometric Brand Mark */
.brand-logo-badge {
  width: 28px;
  height: 28px;
  /* 品牌蓝渐变（弃用黑底）：与主题色//favicon 同源 */
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 60%, #60a5fa 100%);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.35);
}

/* 侧栏 hero：克制的工具简介，与桌面 agent 侧栏节奏对齐 */
.sidebar-hero {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 3px 2px;
}
.sidebar-hero strong {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text-main);
  line-height: 1.4;
}
.sidebar-hero .sidebar-hero-sub {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
}

/* 工作区文档状态栏防抖：保存状态紧凑槽位 */
.workbench-doc-right [data-stable-slot] { transition: none; }
.save-status[data-stable-slot] {
  max-width: 96px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.brand-title {
  font-size: 16px;
  font-weight: 750;
  color: #0f172a;
  letter-spacing: -0.4px;
  white-space: nowrap;
  flex-shrink: 0;
}
/* 品牌字标：Kungfu 墨色 + .md 用应用主题蓝（同一视觉体系，不另设品牌色） */
.brand-title b {
  font-weight: inherit;
  color: var(--brand-accent);
}

/* Empty State Upload Dropzone (Level-2 inset well) */
.bg-empty-dropzone {
  border: 1.5px dashed #cfd6e2;
  border-radius: 8px;
  padding: 16px 12px;
  background: #f7f8fa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  gap: 6px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.bg-empty-dropzone:hover {
  border-color: var(--brand-accent);
  background: #f8faff;
}

.bg-empty-dropzone-icon {
  width: 28px;
  height: 28px;
  color: var(--text-muted);
}

.bg-empty-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

/* Header Right: Global Account Passport & Styled Language Switcher (文/A) */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-login-btn {
  height: 32px;
  padding: 0 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
}

/* 顶栏用户通行证胶囊与用户信息浮层 */
.header-user-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* 顶栏用户区：去胶囊外壳（手机下不再鼓包），头像/用户名/tier 裸排 */
.header-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 12.5px;
  cursor: pointer;
}

/* 用户首字母填充位统一规格族：品牌蓝平底、白字、按尺寸比例的圆角方；
   尺寸随所在容器（顶栏胶囊/侧栏用户区 24，账户侧轨 34，浮层头部 38）。 */
.header-user-avatar,
.user-zone-avatar,
.account-rail-avatar,
.header-user-pop-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--brand-accent);
  color: #ffffff;
  font-weight: 700;
}
.header-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 11.5px;
}
.header-user-name {
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.header-user-tier {
  font-size: 10px;
  padding: 0 6px;
  line-height: 17px;
}
.header-user-chevron {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  transition: transform 0.14s ease;
}
.header-user-pill.is-open .header-user-chevron {
  transform: rotate(180deg);
}

.header-user-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 480;
  width: 284px;
  max-width: calc(100vw - 24px);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.15), 0 2px 8px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.header-user-pop-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 14px 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border-subtle);
}
.header-user-pop-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 16px;
}
.header-user-pop-meta {
  flex: 1 1 auto;
  min-width: 0;
}
.header-user-pop-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-user-pop-title-row strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-user-pop-email {
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.header-user-pop-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
}
.header-user-pop-footer {
  padding: 6px;
  border-top: 1px solid var(--border-subtle);
}
.header-user-pop-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.header-user-pop-item .icon-svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.header-user-pop-item:hover {
  background: var(--bg-subtle);
  color: var(--brand-accent);
}
.header-user-pop-item:hover .icon-svg {
  color: var(--brand-accent);
}
.header-user-pop-item.is-danger {
  color: var(--danger-text);
}
.header-user-pop-item.is-danger .icon-svg {
  color: var(--danger-text);
}
.header-user-pop-item.is-danger:hover {
  background: var(--danger-surface);
  color: var(--danger-text);
}

.tenant-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  white-space: nowrap;
}

.tenant-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success-text);
  box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.2);
  flex-shrink: 0;
}

.tenant-text {
  font-weight: 600;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

/* 语言切换器：收起为 文/A 图标，点开语言菜单（当前语言带勾标，菜单盖过画布工具条） */
.lang-picker-pill {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.lang-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  border-radius: 50%;
}
.lang-picker-btn:hover,
.lang-picker-pill.is-open .lang-picker-btn { background: var(--bg-hover); color: var(--text-main); }
.lang-picker-btn[aria-expanded="true"] { border-color: var(--border-default); background: var(--bg-surface); }
.lang-picker-btn:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.lang-picker-icon { width: 15px; height: 15px; pointer-events: none; }
.lang-picker-pill.is-open .lang-picker-icon { color: var(--brand-accent); }
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 480;
  min-width: 136px;
  padding: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}
.lang-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.lang-menu-item:hover { background: var(--bg-subtle); }
.lang-menu-item.is-current { color: var(--brand-accent-hover); font-weight: 600; }
.lang-menu-check { width: 13px; height: 13px; flex-shrink: 0; visibility: hidden; }
.lang-menu-item.is-current .lang-menu-check { visibility: visible; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: var(--text-ui, 14px);
  font-weight: 500;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.12s ease;
  white-space: nowrap;
  outline: none;
  gap: 6px;
}

.btn-primary {
  background: var(--brand-accent);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--brand-accent-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-secondary);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.btn-danger {
  background: var(--danger-text);
  border-color: transparent;
  color: #ffffff;
}
.btn-danger:hover { background: var(--danger-text); filter: brightness(0.9); }

.btn-sm {
  height: 28px;
  padding: 0 8px;
  font-size: var(--text-ui-small, 12px);
}

/* 满宽按钮：表单/区块内的单一主动作（登录、打开字体库、下载模板、加载更多）。
   之前是 4 处内联 width:100%，收敛到这一个类。 */
.btn-block {
  width: 100%;
}

.btn:active:not(:disabled) {
  transform: translateY(0.5px);
}

.btn:focus-visible,
.brand-switcher-btn:focus-visible,
.project-history-btn:focus-visible,
.billing-offer-card:focus-visible,
.user-zone-main:focus-visible,
.user-entitlements-strip:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 1px;
}

/* 本地软件质感：UI 骨架禁止误选文本，拖拽与双击只作用于画布和输入框 */
.app-header,
.sidebar-mode-switcher,
.section-header,
.canvas-control-bar,
.canvas-common-controls,
.layout-action-toolbar,
.btn,
.brand-switcher-menu {
  user-select: none;
  -webkit-user-select: none;
}

/* 细窄原生感滚动条 */
.sidebar-pane::-webkit-scrollbar,
.project-list::-webkit-scrollbar {
  width: 6px;
}
.sidebar-pane::-webkit-scrollbar-thumb,
.project-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}
.sidebar-pane::-webkit-scrollbar-thumb:hover,
.project-list::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.55);
}

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

/* SVG Icons in Buttons */
.icon-svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ----------------- Layout & Sidebar ----------------- */
.app-viewport {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  overflow: hidden;
}

.sidebar-pane {
  position: relative;
  /* sr-only 等绝对定位子元素的容器；声明在抽屉媒体查询之前，≤960px 的 fixed 覆盖不被压 */
  min-height: 0;
  border-right: 1px solid #e2e6ee;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--surface-sidebar);
  padding: 12px;
  gap: 10px;
}

.sidebar-drawer-backdrop {
  display: none;
}
/* 左侧栏边沿收起/呼出箭头手柄：宽屏停靠在侧栏右缘，收起及窄屏自动停靠在左缘，点击展开呼出 */
.sidebar-edge-handle {
  position: fixed;
  top: calc(var(--header-height) + (100dvh - var(--header-height)) / 2);
  left: var(--sidebar-width);
  transform: translateY(-50%);
  z-index: 425;
  width: 22px;
  height: 54px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-left: none;
  border-radius: 0 8px 8px 0;
  box-shadow: 2px 2px 10px rgba(15, 23, 42, 0.12);
  color: var(--text-secondary);
  cursor: pointer;
  transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.sidebar-edge-handle:hover {
  /* 收起/展开手柄不做 hover 变色：常驻定位元素，悬停变色会被误读为可点击内容 */
}
.sidebar-edge-handle:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 1px;
}
.sidebar-edge-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}
.sidebar-edge-handle.is-collapsed .sidebar-edge-chevron {
  transform: rotate(180deg);
}

/* Sidebar Top Primary Mode Navigation (Claude / Cursor segmented control) */
.sidebar-mode-switcher {
  display: flex;
  width: 100%;
  background: var(--surface-track);
  padding: 3px;
  border: none;
  border-radius: 9px;
  gap: 2px;
}

.sidebar-mode-tab {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
  border-radius: 7px;
  padding: 6px 10px;
}

.sidebar-mode-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.45);
}

.sidebar-mode-tab.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 650;
  box-shadow: var(--shadow-thumb);
}
.sidebar-mode-tab.active svg {
  stroke: var(--brand-accent);
}

/* 左栏背景随模式微调：打印态微暖，排版态冷静中性 */
body.mode-fill .sidebar-pane { background: #f8f5f0; }
body.mode-fill .sidebar-mode-switcher { background: #ede6dc; border-color: transparent; }
.tab-content-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
}
.tab-content-panel.active {
  display: flex;
}

/* 一级功能卡片：纯白浮于灰石底轨，清晰标题带细底线表达功能归属 */
.section-block,
.project-tool-card {
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 11px;
  background: #ffffff;
  padding: 12px;
  box-shadow: var(--shadow-card);
  gap: 10px;
}
.section-block.project-area {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  gap: 10px;
}
.section-block:not(.project-area) > .section-header,
.project-tool-card > .section-header { padding-bottom: 2px; }
.project-area-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.section-title {
  line-height: 1.4;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text-main);
}
/* 桌面 agent 密度：侧栏内输入与次级按钮更紧凑克制 */
.sidebar-pane .input-text,
.sidebar-pane .input-select {
  height: 32px;
  border-radius: 7px;
  border-color: #dde1e9;
  font-size: 13px;
}
.sidebar-pane .input-text:focus,
.sidebar-pane .input-select:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.sidebar-pane .btn-sm {
  border-radius: 7px;
}
/* 次级小按钮是浅灰芯片：填充成形、不描边，悬停加深 */
.sidebar-pane .btn-secondary { border-color: transparent; background: var(--bg-subtle); color: var(--text-secondary); }
.sidebar-pane .btn-secondary:hover:not(:disabled) { border-color: transparent; background: var(--bg-hover); color: var(--text-main); }
.workspace-toolbar-dock .btn-secondary { box-shadow: none; background: var(--bg-subtle); border-color: transparent; color: var(--text-secondary); }
.workspace-toolbar-dock .btn-secondary:hover:not(:disabled) { background: var(--bg-hover); border-color: transparent; color: var(--text-main); }

.field-control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.input-text, .input-select {
  height: 36px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: var(--text-ui, 14px);
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--bg-surface);
  outline: none;
  transition: border-color 0.12s;
  width: 100%;
}

.input-text:focus, .input-select:focus {
  border-color: var(--border-focus);
}

.input-with-affix {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-affix input {
  padding-right: 32px;
  font-family: var(--font-mono);
}
.input-with-affix .affix {
  position: absolute;
  right: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  pointer-events: none;
}

.layout-cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ==========================================================================
   统一组件层（工作台收口批）
   上传组件 / 字体选择按钮 / 徽标 / 筛选 chip / 字体库对话框 / 标记字体状态。
   新控件一律使用这里的原语；不要在各分区再写覆盖补丁。
   ========================================================================== */

/* ---- 统一上传组件：按钮 + 文件名 + 规格 + 状态 ---- */
.upload-field {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px; border: 1px dashed var(--border-default); border-radius: var(--radius-md);
  background: var(--bg-subtle);
}
.upload-field-btn { align-self: flex-start; min-height: 34px; }
.upload-field-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.upload-file-name {
  font-size: var(--text-ui-small); color: var(--text-main);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.upload-file-spec { font-size: var(--text-ui-caption); color: var(--text-muted); }
.upload-status { font-size: var(--text-ui-caption); color: var(--text-secondary); min-height: 14px; }
.upload-field.is-busy { border-color: var(--brand-accent); }
.upload-field.is-busy .upload-status { color: var(--brand-accent); }
.upload-field.is-error { border-color: var(--danger-text); }
.upload-field.is-error .upload-status { color: var(--danger-text); }
.upload-field.is-ok .upload-status { color: #15803d; }

/* ---- 字体选择按钮（外观与下拉一致，点击打开字体库） ---- */
.font-select-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 38px; padding: 0 10px;
  background: var(--bg-surface); color: var(--text-main);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  cursor: pointer; text-align: left; font-size: var(--text-ui-small);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.font-select-btn::after {
  content: ''; flex: 0 0 auto; width: 8px; height: 8px;
  border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted);
  transform: translateY(-2px) rotate(45deg); margin-left: 4px;
}
.font-select-btn:hover:not(:disabled) { border-color: var(--border-strong); }
.font-select-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.font-select-btn-sm { min-height: 32px; }
/* 快捷栏内字体按钮按内容自适应：width:100% 供属性面板块级布局使用，
   放进 flex 组会与组内在宽度互相依赖（内在按内容算、渲染却撑满），
   导致整组被错误解析、步进器与颜色块被挤压。 */
.quick-style-group .font-select-btn { width: auto; }

/* ---- 徽标（内置/我的/使用中/不可用） ---- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  white-space: nowrap;
  line-height: 1.4;
  font-weight: 600;
}
.badge-builtin { color: var(--brand-accent); }
.badge-mine { color: #047857; }
.badge-inuse { color: #1d4ed8; }
.badge-unavailable { color: #b91c1c; }
.badge-pro, .pro-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: var(--pro-on-gold);
  background: var(--pro-gold-cta);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 2px rgba(133, 77, 14, 0.28);
}
.pro-badge { margin-left: 5px; }
.pro-feature-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 10px;
  background: var(--pro-gold-soft); border: 1px solid var(--pro-gold-border); border-radius: var(--radius-sm, 6px);
}
.pro-feature-banner-text { margin: 0; font-size: 12px; line-height: 1.5; color: var(--pro-gold-deep); flex: 1 1 160px; }
.billing-reason-notice {
  margin: 0 0 10px; padding: 9px 12px; font-size: 12.5px; line-height: 1.5; font-weight: 500;
  color: var(--pro-gold-deep); background: var(--pro-gold-soft); border: 1px solid var(--pro-gold-border); border-radius: var(--radius-sm, 6px);
  display: flex; flex-direction: column; gap: 8px;
}
.billing-reason-text { margin: 0; }
.billing-reason-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- 筛选 chip ---- */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: var(--text-ui-caption);
  cursor: pointer;
  border-radius: var(--radius-md);
}
.chip:hover { border-color: var(--border-strong); color: var(--text-main); }
.chip.active { background: var(--brand-accent-subtle); border-color: var(--brand-accent); color: var(--brand-accent); font-weight: 600; }

/* ---- 字体库对话框 ---- */
.dialog-backdrop.font-picker-backdrop { z-index: 9500; align-items: center; justify-content: center; padding: 24px; }
.font-picker-dialog {
  display: flex; flex-direction: column; width: min(880px, 96vw); max-height: min(86vh, 760px);
  background: var(--bg-surface); border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22); overflow: hidden;
}
.font-picker-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border-subtle);
}
.font-picker-title { font-size: 15px; font-weight: 700; color: var(--text-main); }
.font-picker-quota { margin-top: 0; white-space: nowrap; }
.font-picker-head-actions { display: flex; gap: 6px; }
.font-picker-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 18px; border-bottom: 1px solid var(--border-subtle);
}
.font-picker-search { flex: 1 1 200px; min-width: 160px; }
.font-picker-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.font-picker-body { display: flex; flex: 1 1 auto; min-height: 0; }
.font-picker-list {
  flex: 1 1 58%; min-width: 0; overflow-y: auto; padding: 8px 10px 8px 14px;
  border-right: 1px solid var(--border-subtle);
}
.font-picker-list-inner { display: flex; flex-direction: column; gap: 2px; }
.font-picker-more { margin: 8px auto 4px; display: block; }
.font-picker-empty { padding: 18px 6px; }
.font-group-head {
  font-size: var(--text-ui-caption); font-weight: 600; color: var(--text-muted);
  padding: 10px 6px 4px; text-transform: none;
}
.font-face-row {
  display: flex; align-items: center; gap: 4px; width: 100%;
  border: 1px solid transparent; border-radius: var(--radius-md);
  background: transparent;
}
.font-face-row:hover:not(.is-disabled) { background: var(--bg-subtle); }
.font-face-row.selected {
  border-color: var(--brand-accent); background: var(--brand-accent-subtle);
  box-shadow: inset 3px 0 0 var(--brand-accent); font-weight: 600;
}
.font-face-row.is-disabled { opacity: 0.5; }
.font-face-select {
  display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0;
  padding: 8px 10px; border: none; background: transparent; text-align: left; cursor: pointer;
}
.font-face-select:disabled { cursor: not-allowed; }
.font-face-select:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; border-radius: var(--radius-md); }
.font-face-name { font-size: var(--text-ui-small); color: var(--text-main); font-weight: 500; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-face-sub { font-size: var(--text-ui-caption); color: var(--text-secondary); flex: 0 0 auto; }
.font-face-badges { display: flex; gap: 4px; margin-left: auto; flex: 0 0 auto; }
.font-picker-detail { flex: 1 1 42%; min-width: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.font-picker-specimen-box {
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: 14px 12px; background: #fff;
}
.font-picker-specimen { font-size: 20px; line-height: 1.6; color: var(--text-main); word-break: break-all; }
.font-picker-specimen-status { margin-top: 8px; }
.font-picker-meta { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.font-meta-row { display: flex; gap: 8px; font-size: var(--text-ui-caption); }
.font-meta-row dt { flex: 0 0 88px; color: var(--text-muted); }
.font-meta-row dd { margin: 0; color: var(--text-main); word-break: break-all; }
.font-picker-note { display: flex; flex-direction: column; gap: 4px; }
.font-picker-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--border-subtle);
}
.font-picker-scope { font-size: var(--text-ui-caption); }

/* ---- 标记上的字体状态提示（未就绪/失败不得冒充最终效果） ---- */
.marker-font-flag {
  position: absolute;
  left: 4px;
  bottom: -16px;
  z-index: 6;
  font-size: 10px;
  line-height: 14px;
  padding: 0 6px;
  white-space: nowrap;
  pointer-events: none;
  border-radius: 4px;
}
.paper-field-marker.font-loading .marker-font-flag { background: #fffbeb; color: #b45309; border: 1px solid #fcd34d; }
.paper-field-marker.font-failed .marker-font-flag { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ---- 键盘可达性：统一 focus-visible ---- */
.btn:focus-visible, .chip:focus-visible, .font-select-btn:focus-visible,
.upload-field-btn:focus-visible, .font-face-row:focus-visible, .sub-tab-btn:focus-visible,
.sidebar-mode-tab:focus-visible, .tool-btn:focus-visible {
  outline: 2px solid var(--brand-accent); outline-offset: 2px;
}

/* ----------------- Image Component (Level-2 inset sub-card) ----------------- */
.image-upload-card {
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  background: var(--bg-subtle);
}

.image-upload-card:hover {
  border-color: #cbd5e1;
  background: #f3f5f9;
}

.image-preview-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.image-thumbnail-box {
  width: 72px;
  height: 92px;
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.image-thumbnail-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-thumbnail-placeholder {
  font-size: 12px;
  color: var(--text-disabled);
  text-align: center;
  line-height: 1.3;
  padding: 4px;
}

.image-upload-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.image-name-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  word-break: break-all;
}

.image-meta-text {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.source-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding-top: 2px;
}
.source-action-grid .btn {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
}
.source-primary-act {
  border-color: #bfdbfe;
  background: #ffffff;
  color: var(--brand-primary);
  font-weight: 500;
}
.source-primary-act:hover:not(:disabled) {
  border-color: var(--brand-accent);
  background: var(--brand-accent-subtle);
  color: var(--brand-accent);
}

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

@keyframes uiSpin {
  to { transform: rotate(360deg); }
}
.ui-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(37, 99, 235, 0.22);
  border-top-color: var(--brand-accent);
  border-radius: 50%;
  animation: uiSpin 0.7s linear infinite;
  flex-shrink: 0;
}
.image-thumbnail-box.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(248, 250, 252, 0.78);
}
.paper-bg-layer.is-loading {
  opacity: 0.08 !important;
  transition: opacity 0.12s ease;
}

/* Multi-page Navigation & Quick Jump */
.page-nav-header {
  margin-bottom: 8px;
}
.page-nav-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
/* 计数徽章（页数/条数）：同一语义单一规则，两处类名共用 */
.page-total-badge,
.section-count-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  white-space: nowrap;
  color: var(--text-muted);
}
.page-nav-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.page-step-btn {
  flex: 0 0 30px;
  padding: 0;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}
.page-jump-select {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  height: 28px;
  padding: 2px 24px 2px 8px;
  text-overflow: ellipsis;
}
.page-quick-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 6px 1px 2px;
  scrollbar-width: thin;
}
.page-pill {
  position: relative;
  flex: 0 0 auto;
  min-width: 28px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
  transition: all 0.12s ease;
}
.page-pill:hover {
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}
.page-pill.active {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #ffffff;
  font-weight: 600;
}
.page-pill-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}
.page-order-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}
.page-order-bar .btn {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
}
.page-del-btn {
  color: var(--danger-text);
}

.batch-pager-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: nowrap;
}
.batch-pager-bar .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.batch-page-select {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Section count badge */
/* 二级内嵌卡：字段预置分组 */
.field-preset-groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-preset-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field-preset-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.field-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Field Layer Table */
.field-table-list {
  max-height: 220px;
  overflow-y: auto;
  border-radius: 8px;
}

.field-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 12px;
  transition: background 0.1s;
}

.field-row-item:last-child {
  border-bottom: none;
}

.field-row-item:hover {
  background: var(--bg-subtle);
}

.field-row-item.active {
  background: var(--brand-accent-subtle);
  border-left: 3px solid var(--brand-accent);
  padding-left: 7px;
  font-weight: 600;
}

.field-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.field-row-title {
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-row-item.active .field-row-title {
  color: var(--brand-primary, #1d4ed8);
}

.field-row-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.field-type-tag {
  display: inline-flex;
  align-items: center;
  line-height: 16px;
  color: var(--text-muted);
  font-size: 11px;
}

.field-source-tag {
  display: inline-flex;
  align-items: center;
  line-height: 16px;
}

.field-source-tag.is-bound {
  color: #1d4ed8;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-pos-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ----------------- Canvas Viewport & Unified Docked Toolbar ----------------- */
.canvas-viewport {
  background: #dce3ec;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  min-width: 0;
  min-height: 0;
  width: 100%;
  gap: 0;
}

.workspace-toolbar-dock {
  width: 100%;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  flex-shrink: 0;
  z-index: 50;
}

.canvas-stage-shell {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 10px;
  position: relative;
}

.quick-delete-btn {
  width: 28px;
  padding: 0 !important;
  color: var(--danger-text);
}
.quick-delete-btn:hover:not(:disabled) {
  background: var(--danger-surface);
  border-color: var(--danger-border);
  color: var(--danger-text);
}
.toolbar-action-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Strip 1: Document, History, View Toggles, Zoom, Print & Save */
.workbench-doc-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  flex-wrap: wrap;
  padding: 6px 12px;
  min-height: 40px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.workbench-doc-left,
.workbench-doc-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
@media (min-width: 961px) {
  body.sidebar-collapsed .sidebar-pane { display: none !important; }
  body.sidebar-collapsed .app-viewport { grid-template-columns: minmax(0, 1fr); }
  body.sidebar-collapsed .sidebar-edge-handle { left: 0; }
}

.canvas-view-toggles {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}
.pdf-check-group:not(:has(#pdfVectorToggle:checked)) #btnRefreshPdfOverlay,
.pdf-check-group:not(:has(#pdfVectorToggle:checked)) #pdfOverlayStatus {
  display: none;
}

.mode-fill .workbench-doc-bar .editor-history-controls,
.mode-fill .workbench-doc-bar .editor-snap-label {
  display: none;
}
.mode-fill:not(.is-image-editing) .canvas-control-bar {
  display: none;
}

/* Strip 2: Insert Tools & Typography Formatting (or Retouch Tools) */
.canvas-control-bar {
  background: var(--bg-surface);
  padding: 4px 12px;
  min-height: 36px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 8px;
  flex-wrap: wrap;
  width: 100%;
}

.canvas-submode-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  justify-content: flex-start;
  width: 100%;
}

.zoom-indicator {
  font-size: 12px;
  font-family: var(--font-mono);
  min-width: 44px;
  text-align: center;
  color: var(--text-main);
}

.canvas-bar-divider {
  width: 1px;
  height: 16px;
  background: var(--border-default);
}

/* True Physical Paper (A4: 210mm x 297mm) */
.paper-frame {
  position: relative;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.2);
  background: #ffffff;
  transform-origin: top center;
  user-select: none;
}

.paper-sheet {
  width: 210mm;
  height: 297mm;
  position: relative;
  background: #ffffff;
  overflow: hidden;
}

.paper-bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  z-index: 1;
}

.paper-grid-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-size: 10mm 10mm;
  background-image: 
    linear-gradient(to right, rgba(37, 99, 235, 0.1) 0.5px, transparent 0.5px),
    linear-gradient(to bottom, rgba(37, 99, 235, 0.1) 0.5px, transparent 0.5px);
  z-index: 2;
}

/* Interactive Field Markers on Paper */
.paper-field-marker {
  position: absolute;
  cursor: move;
  border: none;
  outline: 1.5px dashed rgba(220, 38, 38, 0.75);
  background: rgba(254, 242, 242, 0.35);
  box-sizing: border-box;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 0;
  margin: 0;
  line-height: 1;
  transition: outline-color 0.1s, background-color 0.1s;
}

.paper-field-marker:hover {
  outline-color: #b91c1c;
  background: rgba(254, 242, 242, 0.55);
}
/* 多行文字：画布标记与编辑器按段落排布（顶对齐 + 自然换行） */
.paper-field-marker.type-multiline { align-items: flex-start; }
.marker-text-editor-multiline {
  display: block; width: 100%; height: 100%;
  resize: none; overflow: hidden; white-space: pre-wrap; word-break: break-word;
  text-align: left;
}
textarea.input-text { height: auto; min-height: 76px; resize: vertical; font: inherit; }

.paper-field-marker.active {
  outline: 2px solid var(--brand-accent);
  background: rgba(239, 246, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  z-index: 30;
}

/* 8 Resize Handles on Active Field Marker */
.resize-handle {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #ffffff;
  border: 1.5px solid var(--brand-accent);
  border-radius: 1px;
  box-sizing: border-box;
  z-index: 35;
}
.handle-nw { top: -4px; left: -4px; cursor: nwse-resize; }
.handle-n  { top: -4px; left: calc(50% - 3.5px); cursor: ns-resize; }
.handle-ne { top: -4px; right: -4px; cursor: nesw-resize; }
.handle-e  { top: calc(50% - 3.5px); right: -4px; cursor: ew-resize; }
.handle-se { bottom: -4px; right: -4px; cursor: nwse-resize; }
.handle-s  { bottom: -4px; left: calc(50% - 3.5px); cursor: ns-resize; }
.handle-sw { bottom: -4px; left: -4px; cursor: nesw-resize; }
.handle-w  { top: calc(50% - 3.5px); left: -4px; cursor: ew-resize; }

/* Quick corner delete button on active field */
.marker-delete-handle {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  z-index: 40;
  transition: all 0.1s ease;
  line-height: 1;
}
.marker-delete-handle:hover {
  background: var(--danger-text);
  color: #ffffff;
  border-color: var(--danger-text);
}

.marker-tag-label {
  position: absolute;
  top: -16px;
  left: 0;
  background: var(--brand-accent);
  color: #ffffff;
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 1px 4px;
  border-radius: 2px;
  white-space: nowrap;
  pointer-events: none;
  font-weight: 500;
}

.paper-vector-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
  mix-blend-mode: multiply;
  transition: opacity 0.15s ease-out;
}

.paper-field-marker.type-photo {
  border-style: solid;
  border-color: #0284c7;
  background: rgba(240, 249, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.paper-field-marker.type-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.paper-field-marker.type-photo .marker-tag-label {
  background: #0284c7;
}

/* ----------------- Modal ----------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 960px;
  max-width: 95vw;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-dialog-header {
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-dialog-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.modal-dialog-body {
  flex: 1;
  background: #f8fafc;
  position: relative;
}

.modal-dialog-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ==========================================================================
   Canvas Tool Group & Interactive Drawing Tools
   ========================================================================== */
.canvas-tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tool-btn.active {
  background: var(--brand-accent);
  color: #ffffff;
  border-color: var(--brand-accent);
}

.tool-btn.active svg { stroke: #ffffff; }

/* ----------------- Contextual Field Quick Styling Bar ----------------- */
.quick-style-group {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-app);
  padding: 2px 5px;
  border-radius: 6px;
  border: 1px solid var(--border-default);
  flex-shrink: 0;
}
.quick-style-group > .btn { flex-shrink: 0; height: 26px; }

.input-select-sm {
  height: 26px;
  padding: 0 6px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.stepper-control {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  height: 26px;
  overflow: hidden;
  flex-shrink: 0;
}

.stepper-btn {
  width: 22px;
  height: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}

.stepper-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.stepper-input {
  width: 38px;
  height: 100%;
  border: none;
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-main);
  outline: none;
  -moz-appearance: textfield;
}
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.quick-color-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 1px;
  cursor: pointer;
  background: transparent;
  flex-shrink: 0;
}

.align-btn-group {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.align-btn {
  padding: 0 6px !important;
  height: 26px !important;
}

.align-btn.active {
  background: #ffffff !important;
  border-color: var(--brand-accent) !important;
  color: var(--brand-accent) !important;
  box-shadow: var(--shadow-sm);
}
.align-btn.active svg {
  stroke: var(--brand-accent) !important;
}

/* ----------------- Retouch Eyedropper & Color Tint ----------------- */
.eyedropper-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.retouch-color-preview-box {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: #ffffff;
  height: 28px;
}

.retouch-color-input {
  width: 18px;
  height: 18px;
  border: none;
  cursor: pointer;
  border-radius: 2px;
  background: transparent;
}

/* Paper size indicator badge in header */
#headerPaperBadge {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ==========================================================================
   Direct Image Editing (Background / Photo Retouching)
   ========================================================================== */
/* 图像编辑态工作区着色：暖底明确"你在图像编辑"，与排版态的中性画布区分 */
body.is-image-editing #canvasStage { background: #f4efe9; }
body.is-image-editing .canvas-control-bar { background: #f8f3ed; border-color: #e7ddd1; }

/* In-situ Paper Retouch Canvas: Superimposed exactly on #paper */
.paper-retouch-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 25;
  cursor: crosshair;
  background: transparent;
  pointer-events: auto;
}

/* Sub-tab segmented control for Fill/Print mode */
.sub-tab-btn {
  transition: all 0.15s ease;
}
.sub-tab-btn.active {
  color: var(--brand-accent) !important;
  font-weight: 600 !important;
  background: #ffffff;
  box-shadow: var(--shadow-thumb);
}

/* Responsive System & Layout Affordance */
@media (max-width: 1200px) {
  :root {
    --sidebar-width: 324px;
  }
}

@media (max-width: 900px) {
  .brand-title {
    font-size: 14px;
  }
}

/* ==========================================================================
   Modern In-App Toast & Modal Dialog System (Replacing Native Alerts)
   ========================================================================== */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  min-width: 300px;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--border-default);
  border-left-width: 4px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-main);
  animation: toastSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-success {
  border-left-color: #16a34a;
}
.toast-success .toast-icon {
  color: #16a34a;
}

.toast-error {
  border-left-color: #dc2626;
}
.toast-error .toast-icon {
  color: #dc2626;
}

.toast-warning {
  border-left-color: #ea580c;
}
.toast-warning .toast-icon {
  color: #ea580c;
}

.toast-info {
  border-left-color: #2563eb;
}
.toast-info .toast-icon {
  color: #2563eb;
}

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-body {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-main);
}

.toast-msg {
  color: var(--text-secondary);
}

.toast-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  padding: 0;
  margin-left: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast-close-btn:hover {
  color: var(--text-main);
}

/* In-App Confirmation & Prompt Dialog */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

/* 通用确认/输入框会被业务浮层（如历史记录）里的操作触发：须盖过它们；
   仍低于登录引导层（.auth-backdrop 10100）。 */
#appUniversalModal { z-index: 10050; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dialog-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 440px;
  max-width: 95vw;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-default);
  overflow: hidden;
  animation: dialogPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dialogPop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dialog-header {
  padding: 16px 18px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.dialog-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-accent-subtle);
  color: var(--brand-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dialog-icon-badge.danger {
  background: var(--danger-surface);
  color: var(--danger-text);
}

.dialog-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.dialog-body {
  padding: 16px 18px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.dialog-footer {
  padding: 12px 18px;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 统一浮层关闭钮：右上角圆形悬停态，全部模态（登录/账户/冲突/字体库）共用。
   卡片头部为 flex 时放 dialog-header 末位；无头卡片（登录）绝对定位到卡片右上。 */
.dialog-close {
  margin-left: auto;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: transparent; color: var(--text-muted, #94a3b8);
  font-size: 18px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.dialog-close:hover { background: var(--bg-subtle, #f1f5f9); color: var(--text-main, #0f172a); }
.dialog-card > .dialog-close { position: absolute; top: 10px; right: 10px; }
.dialog-card { position: relative; }

/* ==========================================================================
   WYSIWYG Field Elements: Inline Editing, Choice Buttons, Comb Grids
   ========================================================================== */
.marker-text-editor {
  width: 100%;
  height: 100%;
  outline: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  line-height: 1;
  display: flex;
  align-items: center;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  cursor: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.marker-text-editor:focus {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px var(--brand-accent);
}

/* Scenario Field: Choice / Options */
.marker-choice-group {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  justify-content: center;
}

.marker-choice-item {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.12s ease;
}

.marker-choice-item:hover {
  background: rgba(37, 99, 235, 0.08);
}

/* 未设置选项的占位引导：选项是用户内容，空缺时画布给出可点击入口（仅渲染层） */
.marker-choice-empty {
  border: 1.5px dashed var(--border-strong, #cbd5e1);
  border-radius: var(--radius-sm);
  padding: 2px 10px;
  color: var(--text-muted);
  font-size: var(--text-ui-small);
  cursor: pointer;
}

.marker-choice-item.active.style-circle {
  border: 1.5px solid currentColor;
  border-radius: 14px;
  padding: 1px 7px;
  font-weight: 700;
}

.marker-choice-item.active.style-bracket {
  font-weight: 700;
  color: var(--brand-accent);
}

/* Scenario Field: Comb / Boxes */
.marker-comb-grid {
  display: flex;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.marker-comb-cell {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: inherit;
  border-right: 1px dashed rgba(15, 23, 42, 0.25);
  box-sizing: border-box;
}

.marker-comb-cell:last-child {
  border-right: none;
}

.marker-comb-grid.border-box {
  border: 1px solid currentColor;
}
.marker-comb-grid.border-box .marker-comb-cell {
  border-right: 1px solid currentColor;
}

.marker-comb-grid.border-bottom .marker-comb-cell {
  border-bottom: 1.5px solid currentColor;
}

/* Photo Field Overlay Controls */
.marker-photo-bar {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  padding: 2px 6px;
  border-radius: 4px;
  gap: 4px;
  z-index: 45;
}

.paper-field-marker.type-photo:hover .marker-photo-bar,
.paper-field-marker.type-photo.active .marker-photo-bar {
  display: flex;
}

.marker-photo-action-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 12px;
  padding: 2px 5px;
  cursor: pointer;
  border-radius: 2px;
  white-space: nowrap;
}
.marker-photo-action-btn:hover {
  background: var(--brand-accent);
}

/* Batch Validation Warning Table Highlights */
.batch-error-row {
  background-color: #fff1f2 !important;
}

/* Workflow states and output feedback. */
.save-status { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.save-status[data-dirty="true"] { color: #b45309; }
.workbench-hint { color: var(--text-secondary); font-size: 12px; line-height: 1.6; margin-top: 10px; }
.field-error { display: block; color: #b91c1c; font-size: 12px; line-height: 1.5; margin-top: 4px; overflow-wrap: anywhere; }
/* 计算字段：只读联动值，灰底弱化提示“由其他输入计算”。 */
.computed-field-input { background: var(--bg-subtle); color: var(--text-muted); cursor: default; }
[aria-invalid="true"] { border-color: #dc2626; box-shadow: 0 0 0 1px #dc2626; }
.batch-record-row { display: flex; flex-direction: column; gap: 4px; text-align: left; width: 100%; padding: 8px; border: 0; border-bottom: 1px solid var(--border-default); background: transparent; cursor: pointer; font: inherit; color: var(--text-secondary); overflow-wrap: anywhere; }
.batch-record-row.active { outline: 1px solid var(--brand-accent); outline-offset: -1px; background: #eff6ff; }
.batch-record-edit { align-self: flex-start; font-size: 11.5px; font-weight: 600; color: var(--brand-accent, #2563eb); cursor: pointer; }
.batch-record-edit:hover { text-decoration: underline; }
.batch-record-card { width: 420px; }
.batch-record-fields { display: flex; flex-direction: column; gap: 10px; max-height: min(56vh, 480px); overflow-y: auto; }
.batch-record-row:hover { background: #f1f5f9; }
.pdf-preview-meta { padding: 8px 16px; font-size: 12px; color: var(--text-secondary); background: var(--bg-subtle); margin: 0; flex-shrink: 0; }
.mode-fill #canvasDrawTools, .mode-fill #quickStyleBar, .mode-fill .marker-photo-bar, .mode-fill .marker-tag-label { display: none !important; }
.mode-fill .paper-field-marker { cursor: default; }
.mode-fill .paper-field-marker.active { box-shadow: none; }
.mode-fill #subpane-batch ~ .section-block { margin-top: 12px; }
.mode-fill #canvasFieldsToolbar { min-height: 30px; }
.mode-fill .marker-text-editor:read-only { cursor: default; }
.sidebar-mode-switcher {
  position: sticky;
  top: 0;
  z-index: 15;
  flex-shrink: 0;
  /* 悬浮条只保留向下的层次投影；不再用负向阴影向上喷底色带——
     那条带常驻糊在 hero 副标题上，正是"内容被吃掉一点"的来源。
     滚动内容由滚动容器上缘自然裁切，无需向上色带遮罩；左右两块与侧栏同色的延伸填充只盖住两侧内边距，白卡滚到条下时不从缝隙透出。 */
  box-shadow: 0 6px 14px -8px rgba(15, 23, 42, 0.14);
  box-shadow: -12px 0 0 var(--surface-sidebar), 12px 0 0 var(--surface-sidebar), 0 6px 14px -8px rgba(15, 23, 42, 0.14);
}
body.mode-fill .sidebar-mode-switcher { box-shadow: -12px 0 0 #f8f5f0, 12px 0 0 #f8f5f0, 0 6px 14px -8px rgba(15, 23, 42, 0.12); }
button:focus-visible, select:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
@media (max-width: 768px) {
  .header-right { gap: 6px; min-width: 0; }
  .tenant-chip { display: none; }
  .save-status { display: none; }
}
@media (max-width: 480px) {
  .modal-dialog-header { flex-wrap: wrap; gap: 8px; }
}

[hidden] { display: none !important; }

/* Shared editor viewport: scroll extents follow the displayed image or physical page. */
.canvas-submode-row { width: 100%; justify-content: flex-start; gap: 5px 7px; }
.canvas-submode-row .btn-sm { padding: 0 8px; font-size: 12px; gap: 4px; }
.canvas-submode-row .check-row { font-size: 12px; gap: 5px; white-space: nowrap; }
.canvas-bar-divider { margin: 0 1px; }
.canvas-stage { position: relative; flex: 1 1 0; min-height: 100px; width: 100%; overflow: auto; scrollbar-gutter: stable; contain: size layout; overscroll-behavior: contain; outline: none; touch-action: none; border: 1px solid #b4c0cf; border-radius: 6px; }
.paper-space { position: relative; min-width: 100%; min-height: 100%; }
.paper-frame { position: absolute; transform-origin: 0 0; flex-shrink: 0; }
.paper-sheet { touch-action: none; }
.canvas-common-controls { display: flex; align-items: center; justify-content: space-between; width: 100%; flex-shrink: 0; gap: 6px 8px; flex-wrap: wrap; }
.canvas-page-nav { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; white-space: nowrap; }
.canvas-page-select { width: auto; min-width: 118px; max-width: 210px; height: 28px; padding: 2px 24px 2px 8px; font-family: var(--font-mono); font-size: 12px; }
.canvas-busy-banner {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #bfdbfe;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.18);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  max-width: min(460px, 86%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: var(--radius-md);
}
.retouch-target-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background: var(--brand-accent-subtle);
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: var(--radius-md);
}
.retouch-calib-btn {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
.retouch-calib-btn:hover:not(:disabled) {
  background: #dbeafe;
  border-color: var(--brand-accent);
}
.editor-history-controls, .editor-zoom-controls { display: flex; align-items: center; gap: 2px; }
.zoom-step-btn { width: 24px; padding: 0; justify-content: center; }

/* Strip 3: Selection, Object Arrangement & Alignment (always visible in Design mode) */
.layout-action-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
  padding: 4px 12px;
  min-height: 34px;
  background: #f8fafc;
  flex-shrink: 0;
}
.selection-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 58px;
}
.selection-count-pill.is-active {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.editor-snap-label { display: flex; align-items: center; gap: 4px; color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
.canvas-editor-status { width: 100%; font-size: 12px; color: #475569; min-height: 18px; flex: 0 0 auto; }
.canvas-stage.can-pan, .canvas-stage.can-pan * { cursor: grab !important; }
.canvas-stage.is-panning, .canvas-stage.is-panning * { cursor: grabbing !important; }
.paper-field-marker.is-locked { outline-style: dotted; outline-color: #94a3b8; cursor: not-allowed; }
.paper-field-marker.type-photo, .paper-field-marker.type-image { overflow: visible; }
.paper-field-marker.type-photo img, .paper-field-marker.type-image img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.marker-text-editor:read-only { cursor: move; pointer-events: auto; }
.resize-handle { transform: scale(var(--editor-inverse-scale, 1)); }
.marker-delete-handle { transform: scale(var(--editor-inverse-scale, 1)); transform-origin: top right; cursor: pointer; }
.editor-marquee { position: absolute; z-index: 65; border: 1px solid #2563eb; background: rgba(37,99,235,.10); pointer-events: none; }
.editor-guides { position: absolute; inset: 0; pointer-events: none; z-index: 60; }
.editor-guide { position: absolute; background: #e11d48; }
.editor-guide.axis-x { top: 0; height: 100%; width: calc(1px * var(--editor-inverse-scale, 1)); }
.editor-guide.axis-y { left: 0; width: 100%; height: calc(1px * var(--editor-inverse-scale, 1)); }
.is-image-editing .paper-sheet { background-color: #fff; background-image: conic-gradient(#e2e8f0 25%, transparent 0 50%, #e2e8f0 0 75%, transparent 0); background-size: 20px 20px; }
.is-image-editing #paperRetouchCanvas { width: 100%; height: 100%; touch-action: none; }
.image-selection-rect { position: absolute; z-index: 70; border: calc(1px * var(--editor-inverse-scale, 1)) dashed #2563eb; background: rgba(37,99,235,.08); pointer-events: none; }
.image-selection-rect.is-crop { box-shadow: 0 0 0 20000px rgba(15,23,42,.42); }
.image-brush-cursor { position: absolute; z-index: 80; transform: translate(-50%, -50%); border: calc(1px * var(--editor-inverse-scale, 1)) solid #fff; outline: calc(1px * var(--editor-inverse-scale, 1)) solid rgba(15,23,42,.7); border-radius: 50%; pointer-events: none; }
.image-compare-overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 85; pointer-events: none; background: #f8fafc; }
.image-adjustment-panel { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border-default); background: white; border-radius: 6px; width: 100%; flex-shrink: 0; flex-wrap: wrap; }
.image-adjustment-panel label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.retouch-crop-actions, .retouch-bg-sizing { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }

/* U1: 四角定标覆盖层（坐标 = 修图画布位图像素，随视口缩放） */
.image-calib-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 26;
  pointer-events: none;
}

/* U1: 四角定标面板 */
.image-calibration-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  background: white;
  border-radius: 6px;
  width: 100%;
  flex-shrink: 0;
}

.calib-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.calib-head strong { font-size: 13px; color: var(--text-primary); }
.calib-hint { font-size: 12px; color: var(--text-secondary); }
.calib-paper-note { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.calib-fields label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-secondary); }
.calib-fields input { width: 76px; }
.calib-actions { align-items: center; }
.calib-actions label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-secondary); }
#calibCustomSize input { width: 72px; }
.calib-error { min-height: 0; }
.calib-error:empty { display: none; }
.calib-progress { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-secondary); }
.calib-progress-bar { position: relative; flex: 1; min-width: 160px; height: 6px; border-radius: 3px; background: var(--bg-muted, #e2e8f0); overflow: hidden; }
.calib-progress-fill { position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: 3px; background: var(--brand-primary, #2563eb); transition: width .12s linear; }
.retouch-bg-sizing select { max-width: 170px; }
#retouchBtnCompare[aria-pressed="true"] { color: #1d4ed8; background: #eff6ff; border-color: #93c5fd; }
.mode-fill #layoutActionToolbar { display: none !important; }
@media (max-width: 900px) { .layout-action-toolbar .btn { padding: 0 7px; } }
.has-pdf-preview .marker-text-editor:not(:focus), .has-pdf-preview .marker-comb-grid, .has-pdf-preview .marker-choice-group, .has-pdf-preview .paper-field-marker > img { opacity: 0; }
.has-pdf-preview .marker-text-editor:focus { opacity: 1; }
.mode-fill .canvas-common-controls .editor-history-controls { visibility: hidden; }
.paper-field-marker.is-editing .marker-comb-grid { visibility: hidden; }
.paper-field-marker.is-editing .marker-text-editor { opacity: 1 !important; background: rgba(255,255,255,.95); cursor: text; }
.has-pdf-preview .paper-field-marker { background: transparent; }
.pdf-preview-with-original #paperBgImage { visibility: hidden; }
.toast-stack { top: 60px; bottom: auto; right: 20px; max-width: 360px; }
.brand-section { min-width: 0; flex: 0 1 auto; }
.header-right { flex: 0 1 auto; flex-wrap: nowrap; justify-content: flex-end; }
.header-right #headerPaperBadge { font-size: 12px; }
.sidebar-pane > .section-block, .sidebar-pane > details { flex-shrink: 0; }
.section-block > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-main);
  letter-spacing: -0.01em;
  user-select: none;
}
.section-block > summary::-webkit-details-marker { display: none; }
.section-block > summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.6px solid var(--text-muted);
  border-bottom: 1.6px solid var(--text-muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease, border-color 0.15s ease;
  margin-left: 1px;
  flex-shrink: 0;
}
.section-block[open] > summary::before {
  transform: rotate(45deg);
  border-color: var(--brand-accent);
}
.section-block[open] > summary {
  padding-bottom: 8px;
  margin-bottom: 2px;
}
.dimension-summary {
  margin-left: auto;
  float: none;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-muted);
}
.project-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.input-item-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; border-radius: var(--radius-sm); padding: 8px 10px; width: 100%; cursor: pointer; color: var(--text-main); transition: border-color 0.12s, background-color 0.12s, box-shadow 0.12s; border: 1px solid transparent; background: var(--bg-subtle); }
.input-item-row strong { font-size: 12.5px; font-weight: 600; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.input-item-row span, .input-usage-count { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.input-items-list { display: flex; flex-direction: column; gap: 6px; }
.input-item-row:hover { border-color: transparent; background: var(--bg-hover); }
.input-item-row.active {
  background: var(--brand-accent-subtle, #eff6ff);
  border-color: transparent;
  box-shadow: inset 2px 0 0 var(--brand-accent);
}
.input-item-row.active strong { color: var(--brand-primary, #1d4ed8); }
.input-item-row.active span { color: #1e40af; }

/* 内容属性面板（选中焦点一级卡片）：品牌蓝边框强调，内嵌二级子卡使用中性浅灰底 */
.inspector-card-active {
  gap: 10px;
  background: transparent;
}
.inspector-header {
  padding-bottom: 8px;
  border-bottom: 1px solid #e0ecff;
  gap: 8px;
}
.inspector-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}
.inspector-card-active .section-title {
  color: #1d4ed8;
}
.inspector-active-badge {
  display: inline-flex;
  align-items: center;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
}
.inspector-active-badge:empty { display: none; }
.inspector-zone {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.inspector-source-zone {
}
.inspector-zone-title {
  font-size: 11px;
  font-weight: 700;
  color: #3b82f6;
  letter-spacing: 0.02em;
}
.inspector-input-subcard {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f7f8fa;
  border: 1px solid #e7eaf0;
}
.inspector-subcard-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.inspector-inline-action {
  display: flex;
  gap: 6px;
  align-items: center;
}
.inspector-inline-action .input-select { flex: 1; min-width: 0; }
.inspector-inline-action .btn { flex-shrink: 0; }
.inspector-font-note {
  margin-top: 4px !important;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
}
/* 复选框行组件：整行可点（label 包裹）、统一 accent 与字号；容器内多控件行用 div.check-row */
.check-row {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--text-ui-small); color: var(--text-secondary);
  cursor: pointer; user-select: none;
}
.check-row input[type="checkbox"] {
  margin: 0; flex-shrink: 0;
  accent-color: var(--brand-accent, #2563eb); cursor: pointer;
}
.check-row:hover { color: var(--text-main); }
.inspector-accordion {
  margin-top: 4px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}
/* 折叠摘要统一样式：原生 details（校验规则、高级：字段标识）共用一族 */
.inspector-accordion summary,
.advanced-key-details summary {
  cursor: pointer; user-select: none;
  font-size: 12px; font-weight: 600; color: var(--text-secondary, #64748b);
  display: flex; align-items: center; gap: 4px; list-style: none;
}
.inspector-accordion summary::-webkit-details-marker,
.advanced-key-details summary::-webkit-details-marker { display: none; }
.inspector-accordion summary::before,
.advanced-key-details summary::before {
  content: '▸'; color: var(--text-muted, #94a3b8); font-size: 10px;
  transition: transform 0.15s ease;
}
.inspector-accordion summary:hover, .advanced-key-details summary:hover,
.inspector-accordion[open] summary, .advanced-key-details[open] summary { color: var(--brand-accent, #3b82f6); }
.inspector-accordion[open] summary::before,
.advanced-key-details[open] summary::before { transform: rotate(90deg); }
.inspector-accordion[open] summary { margin-bottom: 10px; }
.advanced-key-details { margin: 4px 0 10px; }
.advanced-key-details[open] summary { margin-bottom: 2px; }
.paper-field-marker.input-linked { outline: 1px dashed var(--brand-accent); outline-offset: 2px; }
#dynamicFormContainer .input-linked { border-left: 2px solid var(--brand-accent); padding-left: 8px; }
.font-library-panel summary, .print-calibration-panel summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-main); }
.font-library-panel[open] > *, .print-calibration-panel[open] > * { margin-bottom: 8px; }
.print-calibration-panel {
  margin-top: 8px;
  padding: 9px 10px;
  background: var(--bg-subtle);
  border-radius: 8px;
}
.field-label { gap: 6px; }
.field-list-search { margin: 6px 0 8px; font-size: 12.5px; padding: 5px 9px; }
/* 常用字段 chips：插入钮 + 删除小钮成组 */
/* 快捷键速查：多列分区 */
.shortcuts-card { width: min(560px, 94vw); }
.shortcuts-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 22px; max-height: min(64vh, 540px); overflow-y: auto; }
.shortcuts-section h4 { margin: 0 0 8px; font-size: 12px; color: var(--text-secondary); }
.shortcut-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; font-size: 12.5px; }
.shortcut-row kbd {
  flex-shrink: 0; min-width: 92px; text-align: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-main);
  background: var(--bg-subtle); border: 1px solid var(--border-default); border-bottom-width: 2px;
  border-radius: 4px; padding: 2px 6px;
}
.shortcut-row span { color: var(--text-secondary); }

/* 纸边标尺：贴纸左/上，细边淡底不抢画布 */
.paper-ruler { position: absolute; z-index: 30; pointer-events: none;
  background: rgba(248, 250, 252, 0.9); border: 1px solid var(--border-default); }
.saved-field-chip { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--border-default); overflow: hidden; border-radius: var(--radius-md); }
.saved-field-chip-btn { border: none; background: transparent; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-secondary); padding: 4px 6px 4px 10px; cursor: pointer; }
.saved-field-chip-btn:hover { color: var(--text-main); }
/* 行内 × 删除钮统一族：圆形幽灵底，悬停才上 danger（常用字段 chip / 字体行 / 输出行） */
.saved-field-chip-del,
.font-face-delete,
.output-delete-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex-shrink: 0;
  border: none; border-radius: 50%; background: transparent;
  color: var(--text-muted); cursor: pointer; font-size: 12px; line-height: 1;
}
.font-face-delete { width: 22px; height: 22px; font-size: 14px; margin-left: auto; }
.saved-field-chip-del:hover,
.font-face-delete:hover,
.output-delete-btn:hover { background: var(--danger-surface); color: var(--danger-text); }
.field-list-search::-webkit-search-cancel-button { cursor: pointer; }
#pdfOverlayStatus { max-width: 140px; }
/* Narrow screen (<=960px): Sidebar is fixed-position, auto-collapsed, and revealed via the left-edge arrow handle */
@media (max-width: 960px) {
  body { height: 100dvh; overflow: hidden; }
  .global-nav-link { display: none; }
  .app-header { gap: 8px; padding: 0 10px; }
  .brand-section { flex: 0 1 auto; gap: 6px; }
  .app-viewport {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
  }
  .sidebar-pane {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    height: calc(100dvh - var(--header-height));
    width: min(352px, 86vw);
    max-width: 100vw;
    z-index: 420;
    border-right: 1px solid var(--border-default);
    box-shadow: 12px 0 36px rgba(15, 23, 42, 0.2);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.22s;
  }
  body.sidebar-drawer-open .sidebar-pane {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .sidebar-edge-handle {
    left: 0;
    z-index: 425;
  }
  body.sidebar-drawer-open .sidebar-edge-handle {
    left: min(352px, 86vw);
  }
  .sidebar-drawer-backdrop {
    display: block;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 410;
    background: rgba(15, 23, 42, 0.36);
  }
  .workbench-doc-bar,
  .canvas-control-bar,
  .layout-action-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    padding: 5px 10px;
    gap: 6px;
    scrollbar-width: none;
  }
  .workbench-doc-bar::-webkit-scrollbar,
  .canvas-control-bar::-webkit-scrollbar,
  .layout-action-toolbar::-webkit-scrollbar { display: none; }
  .workbench-doc-left,
  .workbench-doc-right,
  .canvas-submode-row {
    flex-wrap: nowrap;
    flex-shrink: 0;
    width: auto;
  }
  .canvas-stage-shell { padding: 8px 10px 8px; gap: 6px; }
  .canvas-stage { touch-action: pan-x pan-y; }
}
@media (max-width: 768px) { .header-right { flex-wrap: nowrap; } .sidebar-mode-tab { font-size: 12px; padding: 6px; } }

/* Product UI system: readable controls, stable canvas, and an explicit phone policy. */
:root {
  --text-ui: 14px;
  --text-ui-small: 12px;
  --text-ui-caption: 12px;
  --space-ui: 8px;
  --space-section: 16px;
}
body { font-size: var(--text-ui); line-height: 1.45; }
button, input, select, textarea { font: inherit; }
.field-label { font-size: 12px; line-height: 1.4; }
.section-block > summary { font-size: 13px; line-height: 1.4; }
.font-library-panel summary { font-size: 13px; line-height: 1.4; }
.print-calibration-panel summary { font-size: 12px; line-height: 1.4; }
.field-control-group { gap: 6px; }
.save-status, .workbench-hint, .field-error, .output-meta, .output-status,
.input-item-row span, .input-usage-count, .dimension-summary { font-size: var(--text-ui-caption); line-height: 1.45; }
.mobile-view-notice { display: none; }

@media (max-width: 640px) {
  .app-header { padding: 0 8px; gap: 5px; flex-wrap: nowrap; }
  .brand-section { gap: 5px; flex: 0 1 auto; min-width: 0; }
  .app-header .brand-title { display: block; font-size: 13.5px; }
  .brand-product-sep { display: none; }
  .brand-switcher-btn { padding: 0 6px; font-size: 12px; gap: 3px; }
  .brand-switcher-menu { position: fixed; left: 10px; right: 10px; top: calc(var(--header-height) + 4px); width: auto; max-width: none; }
  .header-right { margin-left: auto; flex-wrap: nowrap; gap: 5px; justify-content: flex-end; flex-shrink: 0; }
  .header-login-btn { height: 30px; padding: 0 8px; font-size: 11.5px; }
  .header-user-pill { height: 30px; padding: 2px 6px 2px 3px; gap: 4px; }
  .header-user-name, .header-user-tier { display: none; }
  .header-user-popover { position: fixed; right: 10px; left: auto; top: calc(var(--header-height) + 4px); width: min(280px, calc(100vw - 20px)); }
  .canvas-stage-shell { padding: 6px 8px 8px; gap: 6px; }
  .toast-stack { left: 10px; right: 10px; top: calc(var(--header-height) + 6px); bottom: auto; max-width: none; }
  .modal-backdrop { padding: 10px; }
}

/* 触控屏：画布拖拽元素禁用浏览器默认滚动手势，并放大缩放控制柄热区 */
.paper-field-marker, .resize-handle, #imageEditorCanvas { touch-action: none; }
@media (pointer: coarse) {
  .resize-handle { width: 14px; height: 14px; }
  .marker-delete-handle { width: 22px; height: 22px; font-size: 14px; }
}

/* ============ Batch A: auth gate / workspace / outputs ============ */
/* ---- 登录/注册引导浮层：复用 dialog 体系视觉（.dialog-backdrop/.dialog-card），
   仅保留差异项：更高的 z（需盖过业务模态）与窄卡片宽度。display 由内联样式管理。 */
.auth-backdrop { z-index: 10100; }
.auth-card { width: 380px; padding: 26px 24px; }
.auth-card .dialog-close { top: 12px; right: 12px; }
.auth-head { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; padding-right: 28px; }
.auth-title { font-size: 16px; font-weight: 700; color: var(--text-main, #0f172a); }
.auth-sub { font-size: 12px; color: var(--text-secondary, #64748b); margin-top: 2px; }
.auth-switch { margin-top: 14px; font-size: 12px; color: var(--text-secondary, #64748b); text-align: center; }
.auth-switch a { color: var(--brand-primary, #2563eb); font-weight: 600; text-decoration: none; margin-left: 4px; }

/* ---- 账户与会员中心（与工作台统一的浅灰白极简视觉） ---- */
.account-card.account-hub-card {
  width: min(860px, 95vw);
  max-height: min(88vh, 720px);
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.account-hub-shell {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.account-hub-shell > * { min-width: 0; }
.account-hub-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px;
  background: var(--bg-app);
  border-right: 1px solid var(--border-default);
}
.account-rail-identity {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  border-radius: 9px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  padding: 8px 44px 8px 10px;
}
.account-rail-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 15px;
}
.account-rail-meta { min-width: 0; flex: 1 1 auto; }
.account-rail-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-rail-email {
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-rail-badge { margin-left: auto; }
.account-rail-nav { display: flex; flex-direction: column; gap: 3px; }
.account-rail-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.account-rail-tab .icon-svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.account-rail-tab:hover { background: var(--bg-subtle); color: var(--text-main); }
.account-rail-tab.is-active {
  color: var(--brand-accent);
  font-weight: 650;
  background: var(--brand-accent-subtle);
  border-color: transparent;
  box-shadow: none;
}
.account-rail-tab.is-active .icon-svg { color: var(--brand-accent); }
.account-rail-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-default);
}
.account-rail-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-secondary);
  text-decoration: none;
}
.account-rail-link:hover { background: var(--bg-subtle); color: var(--brand-accent); }
.account-rail-link .icon-svg { width: 14px; height: 14px; }
.account-hub-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-surface);
}
.account-hub-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.account-hub-topbar .dialog-close { position: static; flex-shrink: 0; }
.account-hub-subtitle { margin: 2px 0 0; font-size: 12.5px; color: var(--text-secondary); }
.account-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.account-hub-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-app);
}
.account-mobile-logout { display: none; }
.account-tab-pane { display: none; flex-direction: column; gap: 12px; }
.account-tab-pane.is-active { display: flex; }
.account-section-title {
  margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .03em;
  color: var(--text-muted); text-transform: uppercase;
}
/* 浅色统一风格：顶部状态摘要条 */
/* 订阅 storefront： hero 金调定调 → 免费版退为弱参照 → Pro 卡为主角 → 年付墨卡带锚点价主导成交 */
.membership-summary-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px 14px 18px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  /* 金色左脊：会员横幅的身份线，比整块染色更干净 */
  border-left: 3px solid var(--pro-gold);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.membership-summary-title {
  font-size: 15px;
  font-weight: 750;
  color: var(--text-main);
  line-height: 1.35;
}
.membership-summary-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary);
  max-width: 460px;
}
/* 订阅浮层双网格同一列缝：左列=Pro/年付（重，商业主导位），右列=免费/月付（轻），竖缝对齐不成散块 */
.membership-tiers-grid,
.billing-offer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}
.membership-tier-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  background: var(--bg-app);
}
.membership-tier-card.is-free .membership-tier-name { font-size: 13px; color: var(--text-secondary); }
.membership-tier-card.is-free .membership-tier-price { font-size: 14px; font-weight: 650; color: var(--text-secondary); }
.membership-tier-card.is-free .membership-perk-list li { font-size: 12px; color: var(--text-muted); }
.membership-tier-card.is-free .membership-perk-list li::before { content: "·"; }
.membership-tier-card.is-pro {
  border: 1px solid var(--pro-gold-border);
  background: var(--bg-surface);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
.membership-tier-card.is-pro .membership-tier-name { color: var(--pro-gold-deep); }
/* 产品字样条：字库权益的可视证据（同字形四体渲染，装饰性） */
.tier-specimen {
  display: flex;
  align-items: baseline;
  gap: 15px;
  padding: 8px 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, #fdf8ec 0%, #f8efd8 100%);
  border: 1px solid var(--pro-gold-border);
}
.tier-specimen span { font-size: 21px; line-height: 1.25; color: var(--pro-gold-deep); }
.ts-serif { font-family: Georgia, "Noto Serif SC", "Songti SC", serif; }
.ts-kai { font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; }
.ts-mono { font-family: var(--font-mono); font-weight: 600; }
.ts-sans { font-family: var(--font-sans); font-weight: 700; }
.membership-tier-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.membership-tier-name { font-size: 14px; font-weight: 700; color: var(--text-main); }
.membership-tier-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; margin-top: 2px; }
.membership-tier-price-box { text-align: right; flex-shrink: 0; }
.membership-tier-price { display: block; font-size: 17px; font-weight: 750; color: var(--text-main); line-height: 1.1; }
.membership-tier-note { font-size: 11px; color: var(--text-muted); }
.membership-perk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.membership-perk-list li {
  position: relative;
  padding-left: 16px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-secondary);
}
.membership-perk-list li::before { content: "✓"; position: absolute; left: 0; font-weight: 700; color: var(--text-muted); }
.membership-perk-list.is-pro li { color: var(--text-main); }
.membership-perk-list.is-pro li::before { color: var(--pro-gold-deep); }
.membership-billing-hint { margin: 0; font-size: 11.5px; color: var(--text-muted); }
.membership-trust-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-muted);
}
.membership-trust-bar a { color: var(--brand-accent); text-decoration: none; }
.membership-trust-bar a:hover { text-decoration: underline; }
.membership-trust-links { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.account-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.account-panel-card {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.account-info-grid {
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px 10px; align-items: baseline;
  margin: 0 0 4px; padding: 10px 12px; font-size: 12.5px; line-height: 1.45;
  background: var(--bg-app); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.account-info-grid dt { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.account-info-grid dd { margin: 0; color: var(--text-main); font-weight: 500; word-break: break-all; }
.account-inline-edit { display: flex; gap: 8px; align-items: center; }
.account-inline-edit .input-text { flex: 1; min-width: 0; }
.account-usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.usage-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 9px;
  border: none;
  background: var(--bg-app);
}
.usage-tile .usage-value {
  font-size: 16px; font-weight: 700; line-height: 1.25; white-space: nowrap;
  color: var(--text-main); font-variant-numeric: tabular-nums;
}
.usage-tile .usage-label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.usage-tile .usage-sub { font-size: 11.5px; color: var(--text-muted); line-height: 1.35; }
.billing-plan-card { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.billing-plan-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.billing-plan-current { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.billing-plan-expiry { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.billing-offer-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 13px 15px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--bg-app);
  text-align: left;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.billing-offer-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.billing-offer-card:hover:not(:disabled) { border-color: var(--brand-accent); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1); }
.billing-offer-card.is-recommended {
  border: 1px solid var(--pro-ink-border);
  background: var(--pro-ink-gradient);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.24);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.billing-offer-card.is-recommended:hover:not(:disabled) { border-color: var(--pro-gold-bright); box-shadow: 0 14px 30px rgba(15, 23, 42, 0.3); transform: translateY(-1px); }
.billing-offer-card.is-recommended .billing-offer-badge { color: var(--pro-gold-bright); }
.billing-offer-card.is-recommended .billing-offer-name { color: #e2e8f0; }
.billing-offer-card.is-recommended .billing-offer-price { font-size: 28px; color: #ffffff; }
.billing-offer-card.is-recommended .billing-offer-price small { color: var(--pro-on-ink-muted); }
.billing-offer-card.is-recommended .billing-offer-sub { color: var(--pro-on-ink-muted); }
.billing-offer-card.is-recommended .billing-offer-anchor { color: #94a3b8; }
/* 划线原价落在价格下一行，不与「/ 年」挤在一起 */
.billing-offer-card.is-recommended .billing-offer-price-row { flex-direction: column; align-items: flex-start; gap: 0; }
.billing-offer-card.is-recommended .billing-offer-cta {
  height: 36px; font-size: 13px; font-weight: 700;
  background: var(--pro-gold-cta); color: var(--pro-on-gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.billing-offer-card.is-recommended .billing-offer-cta.is-secondary { background: transparent; color: #e2e8f0; border: 1px solid #64748b; }
.billing-offer-card:not(.is-recommended) .billing-offer-price { font-size: 17px; }
.billing-offer-card:disabled { opacity: 0.65; cursor: not-allowed; }
.billing-offer-price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.billing-offer-anchor { font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
.billing-offer-badge {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--pro-gold-deep);
  font-size: 11px;
  line-height: 1.4;
}
.billing-offer-name { font-size: 13px; font-weight: 700; color: var(--text-main); }
.billing-offer-price { font-size: 21px; font-weight: 750; letter-spacing: -0.02em; color: var(--text-main); font-variant-numeric: tabular-nums; line-height: 1.15; }
.billing-offer-price small { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.billing-offer-sub { font-size: 11.5px; color: var(--text-muted); line-height: 1.35; }
.billing-offer-cta {
  margin-top: auto;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  border-radius: 7px;
  background: var(--brand-accent);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
}
.billing-offer-cta.is-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
}
@media (max-width: 760px) {
  .account-card.account-hub-card { width: min(100%, calc(100vw - 20px)); max-height: 90dvh; }
  .account-hub-shell { grid-template-columns: minmax(0, 1fr); }
  .account-hub-rail { padding: 10px 12px; border-right: none; border-bottom: 1px solid var(--border-default); gap: 8px; }
  .account-rail-identity { flex-direction: row; align-items: center; padding: 8px 44px 8px 10px; }
  .account-rail-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .account-rail-nav::-webkit-scrollbar { display: none; }
  .account-rail-tab { width: auto; flex-shrink: 0; padding: 6px 10px; font-size: 12.5px; }
  .account-rail-footer { display: none; }
  .account-hub-topbar { display: contents; }
/* 标题块与身份行重复，收起；关闭钮固定到卡片右上角 */
  .account-hub-topbar > div { display: none; }
  .account-hub-topbar .dialog-close { position: absolute; top: 10px; right: 10px; z-index: 2; }
  .account-body { padding: 12px 14px; }
  .account-hub-footer { padding: 10px 14px; justify-content: space-between; }
  .account-mobile-logout { display: inline-flex; }
  .membership-tiers-grid,
  .account-profile-grid,
  .billing-offer-grid,
  .account-usage-grid { grid-template-columns: minmax(0, 1fr); }
}

.outputs-card { width: min(680px, 94vw); }
.outputs-body { max-height: min(68vh, 580px); overflow-y: auto; }
.dialog-head-actions { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.dialog-head-actions .dialog-close { position: static; }
.outputs-manage-hint { margin: 0 0 10px; }
/* 全部项目浮层：与历史浮层同一视觉语言（行卡片 + 右侧操作） */
.projects-card { width: min(680px, 94vw); }
.projects-body { max-height: min(68vh, 580px); overflow-y: auto; }
.projects-hint { margin: 0 0 10px; }
.projects-modal-list { display: flex; flex-direction: column; gap: 8px; }
.project-modal-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 11px; border: 1px solid var(--border-default, #e2e8f0);
  border-radius: var(--radius-md); background: var(--bg-surface);
}
.project-modal-row.is-current { border-color: #bfdbfe; background: var(--brand-accent-subtle, #eff6ff); }
.project-modal-info { display: flex; flex-direction: column; gap: 2px; font-size: 12px; min-width: 0; }
.project-modal-info strong { font-size: 12px; color: var(--text-main, #0f172a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-current-badge {
  align-self: flex-start;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--brand-accent);
}
.project-modal-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }
.outputs-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-weight: 600;
}
.outputs-list { display: flex; flex-direction: column; gap: 8px; }
.output-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 11px; border: 1px solid var(--border-default, #e2e8f0);
  border-radius: var(--radius-sm, 6px); background: var(--bg-card, #fff);
}
.output-row.status-failed { border-color: #fecaca; background: #fef2f2; }
.output-row.status-pending { opacity: .7; }
.output-info { display: flex; flex-direction: column; gap: 2px; font-size: 12px; min-width: 0; }
.output-info strong { font-size: 12px; color: var(--text-main, #0f172a); }
.output-meta { font-size: 12px; color: var(--text-muted, #94a3b8); font-family: var(--font-mono, monospace); }
.output-status { font-size: 12px; font-weight: 600; }
.output-row.status-succeeded .output-status { color: #059669; }
.output-row.status-failed .output-status { color: #dc2626; }
.output-actions { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ============ 工作台三状态：填报控件与工具栏一致性 ============ */
/* 填报方式切换（单张/批量） */
.fill-subtabs {
  display: flex;
  width: 100%;
  overflow: hidden;
  background: var(--surface-track);
  padding: 3px;
  border: none;
  border-radius: 8px;
  gap: 2px;
}
.fill-subtabs .sub-tab-btn {
  flex: 1;
  border: none;
  min-height: 36px;
  padding: 8px 0;
  font-size: var(--text-ui-small);
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  text-align: center;
  border-radius: 6px;
}
.fill-subtabs .sub-tab-btn + .sub-tab-btn { border-left: none; }

/* 输出设置选项（二级可选子卡，选中态清晰高亮） */
.output-option {
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: border-color 0.12s ease, background-color 0.12s ease;
  border: 1px solid transparent;
  background: var(--bg-subtle);
}
.output-option:hover {
  border-color: transparent;
  background: var(--bg-hover);
}
.output-option:has(input:checked) {
  border-color: transparent;
  background: var(--brand-accent-subtle);
}
.output-option input { margin-top: 3px; flex-shrink: 0; accent-color: var(--brand-accent); }
.output-option-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.output-option-body strong { font-size: 12.5px; color: var(--text-main); font-weight: 600; }
.output-option-body span { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }

/* 填报表单：连续字段 8px 分隔；日期输入提示 */
#dynamicFormContainer { display: flex; flex-direction: column; gap: var(--space-ui); }
.fill-date-hint { font-size: var(--text-ui-caption); color: var(--text-muted); }

/* 单选（choice）填报控件 */
.sex-radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.sex-radio-item {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 12px;
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--bg-surface); color: var(--text-secondary);
  cursor: pointer; font-size: var(--text-ui-small);
  transition: all 0.15s ease;
}
.sex-radio-item:hover { border-color: var(--border-strong); color: var(--text-main); }
.sex-radio-item.active {
  border-color: var(--brand-accent); color: var(--brand-accent);
  background: var(--brand-accent-subtle); font-weight: 600;
  box-shadow: 0 0 0 1px var(--brand-accent);
}

/* 照片（image）填报控件 */
.photo-field-widget { display: flex; align-items: center; gap: 10px; }
.photo-field-thumb {
  width: 72px; height: 92px; flex-shrink: 0;
  border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  background: #ffffff; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.photo-empty-hint { font-size: var(--text-ui-caption); color: var(--text-muted); }
.photo-field-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* 批量数据读入状态与记录表 */
.batch-validation-status { font-size: var(--text-ui-small); font-weight: 600; text-align: right; }
.batch-validation-status.field-error { color: #b91c1c; }
.batch-snapshot-notice { color: #92400e; }
.batch-table-snippet { font-family: var(--font-mono); font-size: var(--text-ui-small); }

/* 填报状态画布工具栏：仅保留查看辅助（网格 / PDF 校对），隐藏设计专用分隔线 */
.mode-fill #canvasFieldsToolbar > .canvas-bar-divider { display: none !important; }

/* 预览框输出模式徽标：只读显示套打/整页打印（决策入口唯一在填报页） */
.preview-mode-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--brand-accent);
}

/* 项目区空态：未登录时作为独立白底一级卡呈现引导 */
.project-empty-state {
  display: none; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 14px; margin: 0;
  border: 1px solid #e2e6ee; border-radius: 11px;
  background: #ffffff; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03); text-align: center;
}
.project-empty-state .project-empty-icon { width: 28px; height: 28px; color: var(--text-muted, #94a3b8); }
.project-empty-title { font-size: 13px; font-weight: 700; color: var(--text-main, #0f172a); }
.project-empty-hint { font-size: 12px; color: var(--text-secondary, #64748b); line-height: 1.5; }
.project-empty-state .btn { margin-top: 6px; }

/* 顶栏登录入口：未登录时桌面端与移动端统一展示于顶栏右侧；登录后切换为通行证胶囊 */
#btnHeaderLogin { display: none; }
body.is-guest #btnHeaderLogin { display: inline-flex; }

/* 左侧身份与会员卡：冷灰调独立身份层，明显区别于下方纯白功能操作卡；默认单行折叠 */
.user-zone {
  margin: 0;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  background: #ffffff;
  border-radius: 11px;
  box-shadow: var(--shadow-card);
}
.user-zone.is-expanded {
  border-color: #c5d2e8;
  background: #ffffff;
  box-shadow: var(--shadow-card);
}
.user-zone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
}
.user-zone-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 5px;
  border: none;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.user-zone-main:hover { background: var(--bg-hover); }
.user-zone-avatar {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 11.5px;
}
.user-zone-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* tier 触发器去白底胶囊外壳：只裸露徽标/升级标/箭头本身（卡内不再嵌套胶囊） */
.user-zone-tier-trigger {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 0 0 2px;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.user-zone-tier-trigger:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 1px;
}

/* 会员徽标（唯一出处）：实底胶囊，无描边，轻投影取立体感。Pro 金、Free 灰。
   字面固定为 Free / Pro，不走语言包（产品身份词，三语同形）。 */
.tier-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 14px;
  white-space: nowrap;
  color: var(--text-secondary);
  background: linear-gradient(180deg, #eef2f7, #dfe5ee);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(15, 23, 42, 0.14);
}
.tier-badge.is-pro {
  color: var(--pro-on-gold);
  background: var(--pro-gold-cta);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 2px rgba(133, 77, 14, 0.32);
}
.user-zone-upgrade-tag {
  font-size: 11px;
  font-weight: 650;
  color: var(--pro-gold);
  white-space: nowrap;
}
/* 历史入口随用户行就近暴露：图标 + 「历史」+ 数量徽标，弱底悬停加深 */
.user-zone-history {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 6px;
  border: none; border-radius: var(--radius-md);
  background: transparent; color: var(--text-secondary);
  font: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.user-zone-history:hover { background: var(--bg-hover); color: var(--text-main); }
.user-zone-history .icon-svg { width: 12.5px; height: 12.5px; color: var(--text-muted); }
.user-zone-history:hover .icon-svg { color: var(--brand-accent); }
.user-zone-history span { white-space: nowrap; }
.user-zone-chevron {
  width: 12px; height: 12px; flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.18s ease;
}
.user-zone.is-expanded .user-zone-chevron {
  transform: rotate(180deg);
  color: var(--brand-accent);
}
.user-entitlements-strip {
  display: block;
  width: 100%;
  border: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background-color 0.12s ease;
  background: transparent;
  padding: 6px 10px 8px;
}
.user-entitlements-strip:hover { background: var(--bg-subtle); }
.user-quota-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.user-quota-metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.user-quota-k {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-quota-metric strong {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 会员卡：墨黑底 + 金色发丝描边，是侧栏里唯一的深色块（会员价值的第一落点）；
   右上角柔金光晕给平面一点纵深 */
.user-pro-panel {
  position: relative;
  overflow: hidden;
  margin-top: 8px;
  padding: 10px 11px 11px;
  border: 1px solid var(--pro-ink-border);
  border-radius: 10px;
  background: var(--pro-ink-gradient);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.user-pro-panel::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--pro-ink-glow), transparent 65%);
  pointer-events: none;
}
.user-pro-panel > * { position: relative; }
/* 已是 Pro：回到浅色，只保留身份色 */
.user-pro-panel.is-pro {
  margin-top: 8px;
  border-color: var(--border-default);
  background: var(--bg-surface);
  box-shadow: none;
}
.user-pro-panel.is-pro::after { content: none; }
.user-pro-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.user-pro-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--pro-gold-bright);
}
.user-pro-panel.is-pro .user-pro-title {
  color: var(--pro-gold-deep);
}
.user-pro-expiry {
  font-size: 11px;
  color: var(--pro-on-ink-muted);
  font-variant-numeric: tabular-nums;
}
.user-pro-panel.is-pro .user-pro-expiry { color: var(--text-muted); }
.user-pro-perks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.user-pro-perks li {
  position: relative;
  padding-left: 13px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--pro-on-ink-muted);
}
.user-pro-perks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pro-gold-bright);
}
.user-pro-panel.is-pro .user-pro-perks li { color: var(--text-secondary); }
.user-pro-panel.is-pro .user-pro-perks li::before {
  background: var(--pro-gold);
}
.user-pro-actions {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 6px;
  margin-top: 1px;
}
.user-pro-cta-annual {
  padding: 0 7px;
  gap: 5px;
  font-weight: 600;
}
.user-pro-save-pill {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--pro-on-gold);
  opacity: 0.8;
}
.user-pro-cta-monthly {
  padding: 0 6px;
  font-weight: 600;
}

/* ---- 会员价值第一视图：墨 + 香槟金 ----
   Pro 的视觉语言只有一套：墨黑底、金色发丝描边、香槟金 CTA 配墨字。
   头部入口、侧栏会员卡、折叠行升级标签共用；动效遵守 prefers-reduced-motion。 */
.header-pro-cta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  margin-right: 6px;
  border: 1px solid var(--pro-ink-border);
  background: var(--pro-ink-gradient);
  color: #ffffff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
  transition: box-shadow .15s ease, transform .15s ease, filter .15s ease;
  padding: 0 12px 0 10px;
  border-radius: var(--radius-md);
}
.header-pro-cta .icon-svg { width: 14px; height: 14px; color: var(--pro-gold-bright); fill: currentColor; }
.header-pro-cta:hover { filter: brightness(1.14); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3); text-decoration: none; }
.header-pro-cta:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
/* 高光扫过：付费入口的生命感（头部胶囊与侧栏年付 CTA 同一节奏） */
.header-pro-cta::after,
.user-pro-cta-annual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.22) 50%, transparent 68%);
  transform: translateX(-120%);
  animation: proShine 4.2s ease-in-out 1.2s infinite;
}
@keyframes proShine {
  0%, 58% { transform: translateX(-120%); }
  78%, 100% { transform: translateX(120%); }
}
/* 侧栏年付主 CTA：香槟金配墨字，是会员卡里唯一的重色 */
.user-pro-cta-annual {
  position: relative;
  overflow: hidden;
  padding: 0 7px;
  gap: 5px;
  border-color: transparent;
  background: var(--pro-gold-cta);
  color: var(--pro-on-gold);
  font-weight: 700;
}
.user-pro-cta-annual:hover:not(:disabled) { background: var(--pro-gold-cta); filter: brightness(1.06); }
.user-pro-panel .btn.user-pro-cta-monthly {
  padding: 0 6px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
}
.user-pro-panel .btn.user-pro-cta-monthly:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.5); color: #ffffff; }

/* 侧栏字样条：字库权益的可视证据，金白相间，展开时逐字升起 */
.user-pro-specimen {
  display: flex;
  gap: 9px;
  align-items: baseline;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--pro-ink-border);
}
.user-pro-specimen span {
  font-size: 16px;
  line-height: 1.3;
  color: var(--pro-gold-bright);
  animation: proSpecimenRise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.user-pro-specimen span:nth-child(even) { color: #ffffff; }
.user-pro-specimen span:nth-child(2) { animation-delay: 0.06s; }
.user-pro-specimen span:nth-child(3) { animation-delay: 0.12s; }
.user-pro-specimen span:nth-child(4) { animation-delay: 0.18s; }
.user-pro-specimen span:nth-child(5) { animation-delay: 0.24s; }
.ups-serif { font-family: Georgia, "Noto Serif SC", "Songti SC", serif; }
.ups-kai { font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; }
.ups-mono { font-family: var(--font-mono); font-weight: 600; }
.ups-sans { font-family: var(--font-sans); font-weight: 700; }
@keyframes proSpecimenRise {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

/* 会员中心：购买位前置到第一屏后的段落节奏 */
#billingOfferGrid { margin-top: 12px; }
.membership-tiers-grid { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .header-pro-cta::after,
  .user-pro-cta-annual::after,
  .user-pro-specimen span { animation: none; }
}
.project-list-header { margin-bottom: 4px; }
.project-list-tools { display: flex; gap: 6px; }
.project-list-tools .btn { white-space: nowrap; }
.project-list { display: flex; flex-direction: column; gap: 2px; max-height: 168px; overflow-y: auto; }
.project-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left;
  padding: 6px 8px; border: 1px solid transparent; border-radius: var(--radius-md);
  background: transparent; color: var(--text-secondary); font: inherit; font-size: 12.5px; cursor: pointer;
}
.project-row:hover { background: var(--bg-subtle); color: var(--text-main); }
.project-row.is-current {
  background: var(--brand-accent-subtle, #eff6ff);
  color: var(--brand-accent-hover);
  font-weight: 600;
  border-color: transparent;
}
.project-row-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-row-meta { flex-shrink: 0; font-size: 11.5px; color: var(--text-muted, #94a3b8); font-variant-numeric: tabular-nums; }
.project-list.is-loading .project-row { pointer-events: none; opacity: .6; }
.project-list-empty { margin: 4px 0 0; padding: 6px 2px; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* 删除类次级按钮（项目区/输出行/字体行）：弱底红字，悬停加深，不与主行动抢焦点 */
.btn-danger-ghost { color: var(--danger-text, #dc2626); background: transparent; }
.btn-danger-ghost:hover { background: var(--danger-surface, #fef2f2); border-color: var(--danger-text, #dc2626); }
.output-delete-btn { margin-left: auto; }
.app-footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 12.5px;
}
.app-footer a { color: inherit; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }

/* 游客画布引导卡：未登录时覆盖空白画布，直接呈现三步价值与登录入口；登录后隐藏。 */
.guest-canvas-guide {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  width: min(460px, calc(100% - 32px));
  padding: 24px 26px;
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
  text-align: left;
}
body.is-guest #canvasStage { overflow: hidden; }
body.is-guest .guest-canvas-guide { display: block; }
body.is-guest .paper-space { opacity: 0.35; pointer-events: none; }
.guest-canvas-title { margin: 0 0 6px; font-size: 17px; font-weight: 700; color: var(--text-main); line-height: 1.35; }
.guest-canvas-sub { margin: 0 0 14px; font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.guest-canvas-steps { margin: 0 0 18px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-main); line-height: 1.5; }
.auth-legal-note { margin: 10px 0 0; font-size: 12px; color: var(--text-secondary); text-align: center; line-height: 1.5; }
.auth-legal-note a { color: var(--brand-primary, #2563eb); text-decoration: none; }
.auth-legal-note a:hover { text-decoration: underline; }
.saved-fields-local-hint { margin: 4px 0 0; font-size: 11.5px; }
.canvas-status-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; flex: 0 0 auto; }
.canvas-status-row .canvas-editor-status { width: auto; flex: 1 1 auto; min-width: 0; }
.status-shortcuts-btn {
  flex-shrink: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11.5px;
  padding: 2px 8px;
  cursor: pointer;
}
.status-shortcuts-btn:hover { border-color: var(--brand-accent); color: var(--text-main); background: var(--bg-subtle); }
.sidebar-hero strong, .section-title { overflow-wrap: anywhere; }
html.i18n-boot body { visibility: hidden; /* 首帧翻译前防闪现，i18n.applyTranslations 放行 */ }

/* 工具快捷预览浮层（支持快捷下载，并引导至独立工具主页） */
#toolsModal { backdrop-filter: none; -webkit-backdrop-filter: none; animation: none; background: rgba(15, 23, 42, 0.48); }
.tools-card { width: min(660px, calc(100vw - 32px)); max-height: 85vh; display: flex; flex-direction: column; contain: layout style; }
.tools-modal-footer { justify-content: space-between !important; }
.tools-modal-footer a.btn { text-decoration: none; }
.tools-body { overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.tools-intro { margin: 0; font-size: 13px; color: var(--text-secondary); }
.tools-grid { display: flex; flex-direction: column; gap: 12px; }
.tool-item-card {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px; border: 1px solid var(--border-default);
  border-radius: var(--radius-md, 10px); background: var(--bg-surface);
}
.tool-item-icon {
  width: 64px; height: 64px; flex-shrink: 0;
  border-radius: 14px; object-fit: cover;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
}
.tool-item-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tool-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-item-name { font-size: 15px; font-weight: 700; color: var(--text-main); }
.tool-item-pill {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.tool-item-tagline { font-size: 13px; font-weight: 600; color: var(--text-main); margin: 0; }
.tool-item-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; margin: 0; }
.tool-item-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.tool-item-badge {
  font-size: 11px; padding: 2px 7px; border-radius: 6px;
  background: var(--bg-subtle); color: var(--text-secondary);
}
.tool-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.tool-item-actions a.btn { text-decoration: none; }
.tool-item-meta { font-size: 11px; font-family: var(--font-mono); color: var(--text-muted); margin: 2px 0 0; word-break: break-all; }
.tool-item-hint { font-size: 11.5px; color: var(--text-muted); margin: 2px 0 0; line-height: 1.45; }
.tools-future-note {
  margin: 0; padding: 10px 12px; border: 1px dashed var(--border-default);
  border-radius: var(--radius-sm, 6px); font-size: 12px; color: var(--text-muted); text-align: center;
}
@media (max-width: 560px) {
  .tool-item-card { flex-direction: column; }
}

@media (max-width: 640px) {
  .header-user-pill .header-user-tier,
  .header-user-pill .header-user-name { display: none; }
  .app-header .brand-logo-badge { width: 24px; height: 24px; border-radius: 6px; }
  .app-header .brand-title { font-size: 13.5px; }
  .brand-switcher-btn { padding: 0 6px; font-size: 12px; }
  .header-login-btn { padding: 0 8px; font-size: 11.5px; }
}
/* ---- 走查修订：画布可用性与修图层级 ---- */
/* 修图模式下左栏处于 inert：给出可见的弱化，不再“看着能点、点了没反应”。 */
body.is-image-editing #pane-design { opacity: 0.55; }
/* 画布右上角常驻「编辑底稿」入口：随底稿有无显隐；修图/填报模式隐藏。 */
.canvas-edit-artwork-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
}
.canvas-edit-artwork-btn:hover { color: var(--text-main); border-color: var(--border-strong); }
body.is-image-editing .canvas-edit-artwork-btn,
.mode-fill .canvas-edit-artwork-btn { display: none !important; }
/* 修图工具栏层级：退出是导航（幽灵样式），提交组固定在工具行右缘。 */
.retouch-back-btn { background: transparent; border-color: transparent; color: var(--text-secondary); }
.retouch-back-btn:hover:not(:disabled) { background: var(--bg-subtle); border-color: var(--border-default); color: var(--text-main); }
.retouch-commit-group { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
/* 画布上图片字段的操作条不随纸张缩放：适应缩放下仍可读、可点。 */
.marker-photo-bar { transform: translateX(-50%) scale(var(--editor-inverse-scale, 1)); transform-origin: bottom center; }
/* 定标面板「采样尺寸」标签不折行。 */
.calib-actions label span { white-space: nowrap; }
/* 工具浮层：命令行安装行（命令 + 复制），与工具页同一渠道暴露 */
.tool-cli-row {
  display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap;
}
.tool-cli-row code {
  flex: 1 1 260px; min-width: 0; padding: 7px 11px; border-radius: 7px;
  background: var(--pro-ink-deep); color: #e2e8f0;
  font-family: var(--font-mono); font-size: 11.5px;
  overflow-x: auto; white-space: nowrap;
}
