/* ============================================================
   proto-style.css — 设计令牌 + Tailwind 风格工具类 + 通用组件
   遵循 web-prototype-shell-spec.md 第 5 章页面区块规范
   模块页面一律使用 var(--xxx) 令牌，随壳层主题自动换肤
   统一前缀：stl-（shell style）
   ============================================================ */

/* ---------- 通用工具类 ---------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.ml-2 { margin-left: 8px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: 12px; } .text-sm { font-size: 13px; } .text-base { font-size: 14px; } .text-lg { font-size: 16px; } .text-xl { font-size: 20px; } .text-2xl { font-size: 24px; }
.font-semibold { font-weight: 600; }
.text-secondary { color: var(--text-secondary); }
.text-weak { color: var(--text-weak); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.num { font-family: 'SF Mono', 'Monaco', 'Consolas', monospace; }

/* ============================================================
   5.1 视觉基线（所有模块统一）
   卡片：白底/1px 边框/圆角 8px/无阴影
   间距：区块间 12px / 卡片内边距 14px / 栅格 gap 12px
   字号：页标题 20px/700 · 卡片标题 14px/700 · 正文 13px · 辅助 12px
   尺寸：输入框 32px · 表头 38px · 行高 46px · 按钮 32px
   ============================================================ */

/* ---------- 页面容器 ---------- */
.stl-page { padding: 24px; max-width: 1440px; }
.stl-page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.stl-page-title { font-size: 20px; font-weight: 700; color: var(--text); }
.stl-page-sub { font-size: 12px; color: var(--text-weak); margin-top: 4px; }

/* ---------- 卡片（区块间 12px） ---------- */
.stl-card { background: var(--card-bg); border: 1px solid var(--border-default); border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.stl-card-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.stl-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stl-card-head-title { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.stl-card-head-title span { font-size: 12px; font-weight: 400; color: var(--text-weak); }
.stl-card-body { }
.stl-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-default); }
.stl-foot-count { font-size: 12px; color: var(--text-weak); }

/* ---------- 按钮（高 32px） ---------- */
.stl-btn { display: inline-flex; align-items: center; justify-content: center; height: 32px; min-width: 64px; padding: 0 16px; border-radius: 6px; font-size: 13px; cursor: pointer; border: none; gap: 6px; }
.stl-btn-primary { background: var(--primary); color: #fff; }
.stl-btn-primary:hover { background: var(--primary-hover); }
.stl-btn-secondary { background: var(--card-bg); color: var(--primary); border: 1px solid var(--primary); }
.stl-btn-secondary:hover { background: var(--primary-subtle); }
.stl-btn-danger { background: var(--danger); color: #fff; }
.stl-btn-text { background: transparent; color: var(--primary); }
.stl-btn-sm { height: 26px; min-width: 48px; padding: 0 10px; font-size: 12px; }

/* ---------- 表单控件（高 32px，正文 13px） ---------- */
.stl-input, .stl-select { height: 32px; padding: 0 12px; border: 1px solid var(--border-default); border-radius: 6px; font-size: 13px; background: var(--card-bg); color: var(--text); min-width: 130px; }
.stl-input:focus, .stl-select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--ring); }
.stl-input[disabled], .stl-select[disabled] { background: var(--bg); color: var(--text-disabled); }

/* ---------- 表单栅格（5.3：grid-4 一行最多 4 字段） ---------- */
.stl-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stl-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stl-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stl-span-2 { grid-column: span 2; }
.stl-span-3 { grid-column: span 3; }
.stl-span-4 { grid-column: span 4; }
.stl-field { display: flex; flex-direction: column; gap: 4px; }
.stl-field > label { font-size: 12px; color: var(--text-secondary); }
.stl-required::before { content: '*'; color: var(--danger); margin-right: 2px; }
.stl-field .stl-input, .stl-field .stl-select { width: 100%; }
.stl-readonly { background: var(--bg); border: 1px solid var(--border-default); border-radius: 6px; padding: 6px 12px; font-size: 13px; color: var(--text); min-height: 32px; display: flex; align-items: center; }
.stl-amount-box { background: var(--primary-subtle); border: 1px solid var(--primary); border-radius: 8px; padding: 12px 16px; display: flex; align-items: baseline; gap: 12px; }
.stl-amount-box .amount { font-size: 22px; font-weight: 700; color: var(--primary); font-family: 'SF Mono', 'Monaco', 'Consolas', monospace; }
.stl-amount-box .desc { font-size: 12px; color: var(--text-weak); }

/* ---------- 表单页结构（5.3） ---------- */
.stl-back { font-size: 13px; color: var(--primary); cursor: pointer; margin-bottom: 12px; display: inline-flex; align-items: center; gap: 4px; }
.stl-form-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stl-form-head h1 { font-size: 20px; font-weight: 700; color: var(--text); }
.stl-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; color: var(--text-weak); }
.stl-step { display: flex; align-items: center; gap: 6px; }
.stl-step .dot { width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border-default); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-weak); }
.stl-step.done .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.stl-step.done { color: var(--text); }
.stl-step.current .dot { background: var(--primary-subtle); border-color: var(--primary); color: var(--primary); font-weight: 700; }
.stl-step.current { color: var(--primary); font-weight: 600; }
.stl-step-line { width: 32px; height: 1px; background: var(--border-default); }
.stl-form-tips { font-size: 12px; color: var(--text-weak); margin-top: 6px; line-height: 1.6; }

/* 吸底操作栏 */
.stl-form-footer { position: sticky; bottom: 0; background: var(--card-bg); border: 1px solid var(--border-default); border-radius: 8px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 12px; box-shadow: 0 -2px 8px rgba(0,0,0,.04); }
.stl-form-footer .hint { font-size: 12px; color: var(--text-weak); }
.stl-form-footer .actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 上传卡（5.3） */
.stl-upload-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stl-upload-card { border: 1px dashed var(--border-default); border-radius: 8px; height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-size: 12px; color: var(--text-weak); }
.stl-upload-card:hover { border-color: var(--primary); color: var(--primary); }
.stl-upload-card.required-card { border-color: var(--primary); color: var(--primary); }
.stl-upload-card .icon { font-size: 20px; }
.stl-upload-done { border-style: solid; border-color: var(--success); color: var(--success); }

/* ============================================================
   5.2 列表页结构
   页头 → 筛选卡 → 表格卡（toolbar / table-wrap / empty / foot）
   ============================================================ */
.stl-filter-card { background: var(--card-bg); border: 1px solid var(--border-default); border-radius: 8px; padding: 14px; margin-bottom: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.stl-filter-actions { display: flex; gap: 8px; }
.stl-filter-actions .stl-btn { min-width: 72px; }
.stl-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stl-toolbar-title { font-size: 14px; font-weight: 700; color: var(--text); }
.stl-toolbar-title span { font-size: 12px; font-weight: 400; color: var(--text-weak); margin-left: 8px; }
.stl-toolbar-actions { display: flex; gap: 8px; }

/* 表格：外层 overflow-auto + min-width，窄屏横向滚动；表头 38px、行 46px */
.stl-table-wrap { overflow-x: auto; }
.stl-table { width: 100%; border-collapse: collapse; min-width: 1000px; }
.stl-table th { background: var(--bg); color: var(--text); font-weight: 600; text-align: left; padding: 0 16px; height: 38px; border-bottom: 1px solid var(--border-default); font-size: 13px; white-space: nowrap; }
.stl-table td { padding: 0 16px; height: 46px; border-bottom: 1px solid var(--border-default); font-size: 13px; color: var(--text); white-space: nowrap; }
.stl-table tbody tr:nth-child(even) { background: var(--bg); }
.stl-table tbody tr:hover { background: var(--bg-active); }
.stl-table .amount { text-align: right; font-weight: 700; font-family: 'SF Mono', 'Monaco', 'Consolas', monospace; }
.stl-table .ops { text-align: right; }
.stl-table .ops .stl-link { margin-left: 12px; }
.stl-link { color: var(--primary); cursor: pointer; }
.stl-link:hover { text-decoration: underline; }

/* 空状态 */
.stl-empty { padding: 48px 24px; text-align: center; color: var(--text-weak); font-size: 13px; }

/* 分页：左「共 N 条」右页码 */
.stl-pagination { display: flex; gap: 4px; justify-content: flex-end; }
.stl-page-num { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid var(--border-default); background: var(--card-bg); color: var(--text-secondary); cursor: pointer; font-size: 13px; }
.stl-page-num.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.stl-page-num:hover { background: var(--bg-active); }

/* ============================================================
   5.4 详情页（方案 A）
   detail-hero → description-grid → linear-tabs → 卡片堆叠
   ============================================================ */
.stl-detail-hero { background: var(--card-bg); border: 1px solid var(--border-default); border-radius: 8px; padding: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.stl-detail-hero .title { font-size: 20px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stl-detail-hero .meta { font-size: 12px; color: var(--text-weak); margin-top: 4px; }
.stl-detail-hero .ops { display: flex; gap: 8px; flex-shrink: 0; }
.stl-description-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stl-desc-item .label { font-size: 12px; color: var(--text-weak); margin-bottom: 2px; }
.stl-desc-item .value { font-size: 13px; color: var(--text); }
.stl-linear-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border-default); margin-bottom: 12px; overflow-x: auto; }
.stl-linear-tab { padding: 8px 16px; cursor: pointer; font-size: 13px; color: var(--text-weak); border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.stl-linear-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ============================================================
   5.5 弹窗与抽屉（z-index ≥ 壳层，壳层 overlay=1000，模块用 2000）
   ============================================================ */
.stl-modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 16px; }
.stl-modal-mask.open { display: flex; }
.stl-modal { background: var(--card-bg); border-radius: 8px; width: min(640px, 100vw - 32px); max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,.16); }
.stl-modal.small { width: 440px; }
.stl-modal-head { padding: 14px 16px; border-bottom: 1px solid var(--border-default); font-size: 15px; font-weight: 700; color: var(--text); display: flex; justify-content: space-between; align-items: center; }
.stl-modal-close { border: none; background: none; font-size: 16px; color: var(--text-weak); cursor: pointer; line-height: 1; }
.stl-modal-body { padding: 16px; overflow-y: auto; font-size: 13px; color: var(--text); }
.stl-modal-foot { padding: 12px 16px; border-top: 1px solid var(--border-default); display: flex; justify-content: flex-end; gap: 8px; }
.stl-error-bar { background: #fee2e2; color: #991b1b; border-radius: 6px; padding: 6px 12px; font-size: 12px; margin-bottom: 12px; }

/* ============================================================
   5.6 状态标签语义色（浅底 + 深字 + 同色系浅边框，高 22px）
   ============================================================ */
.stl-badge { display: inline-block; height: 22px; line-height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; white-space: nowrap; border: 1px solid transparent; }
.stl-badge-blue { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.stl-badge-green { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.stl-badge-orange { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.stl-badge-red { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.stl-badge-gray { background: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }
.stl-badge-purple { background: var(--primary-subtle); color: var(--primary); border-color: var(--primary); }
/* 旧类名兼容（语义映射） */
.stl-badge-active { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.stl-badge-done { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.stl-badge-warn { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.stl-badge-danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.stl-badge-draft { background: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }

/* ============================================================
   其余组件
   ============================================================ */
/* 统计卡片 */
.stl-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.stl-stat-card { background: var(--card-bg); border: 1px solid var(--border-default); border-radius: 8px; padding: 16px; }
.stl-stat-label { font-size: 12px; color: var(--text-weak); }
.stl-stat-value { font-size: 26px; font-weight: 700; margin: 8px 0; font-family: 'SF Mono', 'Monaco', 'Consolas', monospace; color: var(--text); }
.stl-stat-value.warn { color: var(--warning); }
.stl-stat-value.success { color: var(--success); }
.stl-stat-value.danger { color: var(--danger); }
.stl-stat-trend { font-size: 12px; color: var(--text-weak); }

/* 进度条 */
.stl-progress { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; margin-top: 8px; min-width: 120px; }
.stl-progress-bar { height: 100%; border-radius: 4px; background: var(--primary); }
.stl-progress-bar.warn { background: var(--warning); }
.stl-progress-bar.danger { background: var(--danger); }
.stl-progress-bar.success { background: var(--success); }

/* 预警横幅 */
.stl-alert { display: flex; align-items: center; gap: 8px; background: #fef3c7; border: 1px solid #f59e0b; color: #92400e; border-radius: 6px; padding: 8px 16px; margin-bottom: 12px; font-size: 13px; }
.stl-alert.danger { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.stl-alert.info { background: #dbeafe; border-color: #3b82f6; color: #1e40af; }

/* 待办条目 */
.stl-todo-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 8px; border-bottom: 1px solid var(--border-default); gap: 12px; }
.stl-todo-item:last-child { border-bottom: none; }
.stl-todo-item:hover { background: var(--bg); }
.stl-todo-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.stl-todo-title { font-weight: 600; color: var(--text); font-size: 13px; }
.stl-todo-desc { font-size: 12px; color: var(--text-weak); margin-top: 2px; }

/* 页签（页面内） */
.stl-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border-default); margin-bottom: 12px; }
.stl-tab { padding: 8px 16px; cursor: pointer; font-size: 13px; color: var(--text-weak); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.stl-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 审批时间线 */
.stl-timeline { padding-left: 16px; border-left: 2px solid var(--border-default); }
.stl-tl-item { position: relative; padding: 8px 0 8px 24px; }
.stl-tl-item::before { content: ''; position: absolute; left: -7px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); }
.stl-tl-item.done::before { background: var(--success); }
.stl-tl-item.reject::before { background: var(--danger); }
.stl-tl-name { font-weight: 600; color: var(--text); font-size: 13px; }
.stl-tl-time { font-size: 11px; color: var(--text-weak); margin-left: 8px; }
.stl-tl-comment { font-size: 12px; color: var(--text-weak); margin-top: 4px; background: var(--bg); padding: 8px; border-radius: 6px; }

/* 摊销卡片 */
.stl-amort-card { background: var(--primary-subtle); border: 1px solid var(--primary); border-radius: 8px; padding: 14px; margin: 12px 0; }
.stl-amort-card .stl-title { font-weight: 600; color: var(--primary); margin-bottom: 8px; font-size: 13px; }

/* 权限锁定提示 */
.stl-lock-tip { font-size: 13px; color: var(--text-secondary); background: var(--bg); padding: 8px 16px; border-radius: 6px; border-left: 3px solid var(--primary); }
.stl-lock-tip b { color: var(--primary); }

/* 占位提示 */
.stl-placeholder { padding: 80px 24px; text-align: center; color: var(--text-weak); }
.stl-placeholder .icon { font-size: 48px; margin-bottom: 16px; }
.stl-placeholder .text { font-size: 15px; }

/* ============================================================
   5.8 响应式
   断点 1100px：栅格降为 2 列；断点 680px：全部单列
   ============================================================ */
@media (max-width: 1100px) {
  .stl-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stl-span-3, .stl-span-4 { grid-column: span 2; }
  .stl-description-grid { grid-template-columns: repeat(2, 1fr); }
  .stl-upload-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .stl-grid-4, .stl-grid-3, .stl-grid-2 { grid-template-columns: 1fr; }
  .stl-span-2, .stl-span-3, .stl-span-4 { grid-column: span 1; }
  .stl-description-grid { grid-template-columns: 1fr; }
  .stl-upload-grid { grid-template-columns: 1fr; }
  .stl-form-footer { flex-direction: column; align-items: stretch; }
  .stl-form-footer .actions { justify-content: flex-end; }
  .stl-detail-hero { flex-direction: column; }
  .stl-filter-card { grid-template-columns: 1fr; }
}

/* ============================================================
   6.0 成熟 ERP 单据工作台视觉基线（PRD v2.1）
   参考金蝶等主流财务产品的信息架构：稳定命令区、紧凑指标带、
   主表头 + 表体、线性页签、弱装饰/强层级。覆盖旧组件外观但保留结构。
   ============================================================ */
html, body { background: var(--bg); }
.stl-page { max-width: none; padding: 16px 20px 72px; }
.stl-page-head {
  position: sticky; top: 0; z-index: 12; min-height: 52px;
  align-items: center; margin: -16px -20px 14px; padding: 8px 20px;
  background: color-mix(in srgb, var(--card-bg) 94%, transparent);
  border-bottom: 1px solid var(--border-default);
  box-shadow: 0 3px 12px rgba(15,23,42,.05); backdrop-filter: blur(10px);
}
.stl-page-title { font-size: 17px; line-height: 1.25; }
.stl-page-sub { margin-top: 3px; max-width: 980px; }
.stl-page-head > .stl-btn,
.stl-page-head > .flex { flex-shrink: 0; }

.stl-card { border-radius: 8px; box-shadow: none; }
.stl-card-title { margin-bottom: 10px; }
.stl-card-head { min-height: 30px; }
.stl-card-head-title { font-size: 14px; }

.stl-stat-grid {
  grid-template-columns: repeat(4,minmax(150px,1fr)); gap: 1px;
  padding: 0; background: var(--border-default); border: 1px solid var(--border-default);
  border-radius: 8px; overflow: hidden;
}
.stl-stat-card { border: 0; border-radius: 0; padding: 12px 16px; }
.stl-stat-value { margin: 4px 0; font-size: 20px; line-height: 1.25; }
.stl-stat-trend { line-height: 1.45; }

.stl-filter-card { padding: 12px 14px; gap: 10px; }
.stl-input, .stl-select, .stl-readonly { border-radius: 4px; }
.stl-btn { border-radius: 4px; font-weight: 500; }
.stl-btn-primary { box-shadow: 0 1px 2px color-mix(in srgb, var(--primary) 28%, transparent); }
.stl-btn-text:hover { background: var(--primary-subtle); }

.stl-toolbar { min-height: 34px; margin-bottom: 8px; }
.stl-table-wrap { border: 1px solid var(--border-default); border-radius: 6px; }
.stl-table th { height: 40px; background: color-mix(in srgb, var(--bg) 86%, var(--card-bg)); border-right: 1px solid var(--border-default); }
.stl-table th:last-child { border-right: 0; }
.stl-table td { height: 46px; }
.stl-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg) 55%, var(--card-bg)); }
.stl-table tbody tr:hover { background: var(--primary-subtle); }
.stl-table .amount { font-size: 12px; letter-spacing: .1px; }

.stl-tabs, .stl-linear-tabs, .sy-tabs, .wh-tabs {
  gap: 22px; padding: 0 2px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border-default); overflow-x: auto;
}
.stl-tab, .stl-linear-tab, .sy-tab, .wh-tab {
  position: relative; padding: 10px 2px 9px; margin: 0; border: 0; border-radius: 0;
  background: transparent; color: var(--text-secondary); white-space: nowrap;
}
.stl-tab.active, .stl-linear-tab.active, .sy-tab.active, .wh-tab.active {
  border: 0; background: transparent; color: var(--primary); font-weight: 700;
}
.stl-tab.active::after, .stl-linear-tab.active::after, .sy-tab.active::after, .wh-tab.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary);
}

.stl-form-head {
  position: sticky; top: 0; z-index: 12; min-height: 52px;
  margin: -44px -20px 14px 64px; padding: 8px 20px 8px 0;
  background: color-mix(in srgb, var(--card-bg) 94%, transparent);
  border-bottom: 1px solid var(--border-default);
}
.stl-form-head h1 { font-size: 17px; }
.stl-back { position: sticky; top: 0; z-index: 13; min-height: 52px; margin: -16px 0 14px -20px; padding: 17px 0 0 20px; background: transparent; }
.stl-steps { padding: 0 4px 10px; border-bottom: 1px solid var(--border-default); }
.stl-form-footer { border-radius: 4px; box-shadow: 0 -4px 14px rgba(15,23,42,.08); }

.stl-detail-hero {
  position: sticky; top: 0; z-index: 12; min-height: 52px;
  margin: -44px -20px 14px 64px; padding: 8px 20px 8px 0;
  border: 0; border-bottom: 1px solid var(--border-default); border-radius: 0;
  background: color-mix(in srgb, var(--card-bg) 94%, transparent);
  box-shadow: 0 3px 12px rgba(15,23,42,.05); backdrop-filter: blur(10px);
}
.stl-detail-hero .title { font-size: 17px; }
.stl-description-grid { gap: 14px 18px; }
.stl-desc-item .value { min-height: 22px; font-weight: 500; }

.stl-alert { border-width: 0 0 0 3px; border-radius: 4px; }
.stl-upload-card { border-radius: 6px; background: var(--card-bg); }
.stl-amount-box { border-radius: 6px; }
.stl-amort-card { border-radius: 6px; }

@media (max-width: 1100px) {
  .stl-stat-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 680px) {
  .stl-page { padding: 12px 12px 72px; }
  .stl-page-head { margin: -12px -12px 12px; padding: 8px 12px; align-items: flex-start; }
  .stl-stat-grid { grid-template-columns: 1fr; }
  .stl-form-head, .stl-detail-hero { position: static; margin: 0 0 12px; padding: 8px 0; }
  .stl-back { position: static; min-height: auto; margin: 0 0 8px; padding: 0; }
}

/* 7.0 ERP 制单工作台：主表单 + 任务页签 + 右侧摘要 */
.erp-document-bar { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:54px; padding:8px 16px; margin:0 -16px 12px; background:var(--card-bg); border-bottom:1px solid var(--border-default); box-shadow:0 2px 8px rgba(15,23,42,.04); }
.erp-document-id { display:flex; align-items:center; gap:10px; min-width:0; }
.erp-document-id h1 { margin:0; font-size:18px; line-height:1.2; }
.erp-document-meta { margin-top:3px; color:var(--text-secondary); font-size:12px; }
.erp-command-actions { display:flex; align-items:center; gap:8px; flex:none; }
.erp-command-link { border:0; background:transparent; color:var(--text-secondary); padding:6px 8px; cursor:pointer; }
.erp-command-link:hover { color:var(--primary); background:var(--primary-subtle); border-radius:4px; }
.erp-form-workspace { display:grid; grid-template-columns:minmax(0,1fr) 276px; gap:12px; align-items:start; }
.erp-form-main { min-width:0; }
.erp-form-aside { position:sticky; top:68px; display:grid; gap:10px; }
.erp-side-card { background:var(--card-bg); border:1px solid var(--border-default); border-radius:6px; overflow:hidden; }
.erp-side-title { padding:11px 12px; border-bottom:1px solid var(--border-default); font-size:13px; font-weight:600; }
.erp-side-body { padding:12px; }
.erp-money-total { color:var(--primary); font-size:25px; font-weight:700; font-variant-numeric:tabular-nums; line-height:1.2; }
.erp-money-label { color:var(--text-secondary); font-size:12px; margin-bottom:4px; }
.erp-money-row,.erp-check-row { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 0; border-bottom:1px dashed var(--border-default); font-size:12px; }
.erp-money-row:last-child,.erp-check-row:last-child { border-bottom:0; }
.erp-check-ok { color:#16835b; }
.erp-check-warn { color:#b7791f; }
.erp-section-tabs { display:flex; align-items:center; gap:2px; margin-bottom:10px; border-bottom:1px solid var(--border-default); background:var(--card-bg); padding:0 8px; }
.erp-section-tab { position:relative; padding:11px 14px 10px; border:0; background:transparent; color:var(--text-secondary); cursor:pointer; font-size:13px; }
.erp-section-tab.active { color:var(--primary); font-weight:600; }
.erp-section-tab.active::after { content:''; position:absolute; left:12px; right:12px; bottom:-1px; height:2px; background:var(--primary); }
.erp-pane { display:none; }
.erp-pane.active { display:block; }
.erp-compact-help { margin-top:8px; }
.erp-compact-help summary { color:var(--primary); font-size:12px; cursor:pointer; }
.erp-editor-mode .erp-list-only { display:none!important; }
.erp-list-mode .erp-editor-only { display:none!important; }
.erp-editor-mode .stl-card-head-title > span { display:none; }
.erp-editor-mode .stl-card-head-title { min-width:140px; }
@media (max-width:1100px) { .erp-form-workspace { grid-template-columns:1fr; } .erp-form-aside { position:static; grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:720px) { .erp-document-bar { align-items:flex-start; flex-direction:column; margin-left:-12px; margin-right:-12px; } .erp-command-actions { width:100%; overflow-x:auto; } .erp-form-aside { grid-template-columns:1fr; } .erp-section-tabs { overflow-x:auto; } .erp-section-tab { white-space:nowrap; } }
