/* ==========================================================================
   SOP 订单流转 · 全站样式
   只做两件事：把字排干净，把边界划清楚。不用任何框架。
   ========================================================================== */

:root {
  --bg:       #f1f5f9;
  --card:     #ffffff;
  --ink:      #0f172a;
  --ink-2:    #475569;
  --ink-3:    #94a3b8;
  --line:     #e2e8f0;
  --line-2:   #cbd5e1;
  --brand:    #1d4ed8;
  --brand-d:  #1e40af;
  --brand-l:  #eff6ff;
  --danger:   #dc2626;
  --danger-l: #fef2f2;
  --ok:       #059669;
  --radius:   12px;
  --shadow:   0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--ink-2); }

/* ==========================================================================
   登录页
   ========================================================================== */

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 10% -10%, #e0eaff 0%, transparent 55%),
    radial-gradient(900px 500px at 110% 110%, #dbeafe 0%, transparent 50%),
    var(--bg);
}

.login-wrap {
  display: grid;
  grid-template-columns: 380px 400px;
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .06);
  max-width: 100%;
}

/* ---- 左侧品牌 ---- */

.login-brand {
  position: relative;
  padding: 40px 36px;
  color: #fff;
  background: linear-gradient(155deg, #0f172a 0%, #16233f 48%, #1d4ed8 130%);
  display: flex;
  flex-direction: column;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: auto -40% -40% auto;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, .35), transparent 70%);
  pointer-events: none;
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 44px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
}

.brand-mark.sm {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--brand);
  border: 0;
  color: #fff;
  font-size: 11px;
}

.brand-ver {
  font-size: 11px;
  color: rgba(255, 255, 255, .55);
  letter-spacing: .08em;
}

.login-brand h1 {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -.01em;
  margin-bottom: 8px;
}

.brand-sub {
  font-size: 13.5px;
  color: rgba(255, 255, 255, .62);
  margin-bottom: 34px;
}

.brand-points { display: grid; gap: 13px; }

.brand-points li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  color: rgba(255, 255, 255, .72);
  line-height: 1.5;
}

.brand-points li b {
  color: #fff;
  font-weight: 600;
}

.brand-points li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #60a5fa;
}

.brand-foot {
  margin-top: auto;
  padding-top: 36px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .38);
  letter-spacing: .02em;
}

/* ---- 右侧表单 ---- */

.login-panel {
  padding: 44px 40px;
  display: flex;
  align-items: center;
}

.login-form { width: 100%; }

.login-form h2 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.form-hint {
  font-size: 13px;
  color: var(--ink-3);
  margin: 4px 0 26px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 7px;
  letter-spacing: .01em;
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.field input::placeholder { color: #b6c2d1; }

.field input:hover { border-color: #b6c2d1; }

.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .14);
}

.field-pw { position: relative; }

.field-pw input { padding-right: 62px; }

.pw-toggle {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  height: 32px;
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.pw-toggle:hover { background: var(--bg); color: var(--ink); }

.remember {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-2);
  user-select: none;
  cursor: pointer;
  margin: 2px 0 18px;
}

.remember input {
  width: 15px; height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
}

.msg {
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 9px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.msg.error {
  color: var(--danger);
  background: var(--danger-l);
  border-color: #fecaca;
}

.msg.ok {
  color: var(--ok);
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.btn-primary {
  position: relative;
  width: 100%;
  height: 44px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, transform .05s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

.btn-primary:hover { background: var(--brand-d); }
.btn-primary:active { transform: translateY(1px); }

.btn-primary:disabled {
  background: #93a8d6;
  cursor: default;
  transform: none;
}

.btn-primary.loading { color: transparent; pointer-events: none; }

.btn-primary.loading::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.form-foot {
  margin-top: 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
}

/* ==========================================================================
   工作台
   ========================================================================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-l, .topbar-r {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.who { font-size: 13.5px; color: var(--ink-2); }

.chip {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-l);
  border: 1px solid #dbeafe;
  border-radius: 999px;
  line-height: 1.6;
}

.btn-ghost {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--ink);
  border-color: #b6c2d1;
}

.home-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 20px 60px;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.card-title {
  font-size: 15px;
  font-weight: 650;
  margin-bottom: 4px;
  letter-spacing: -.005em;
}

.welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.welcome h1 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.01em;
  margin-bottom: 4px;
}

.welcome-r {
  display: flex;
  gap: 10px;
}

.stat {
  min-width: 92px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
}

.stat b {
  display: block;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1.3;
}

.stat span {
  font-size: 11.5px;
  color: var(--ink-3);
}

.flow-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 18px;
}

.flow-line li {
  position: relative;
  flex: 1 1 0;
  min-width: 92px;
  padding: 12px 8px 0;
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: center;
  border-top: 2px solid var(--line);
}

.flow-line li:first-child { border-top-color: var(--brand); }
.flow-line li:last-child  { border-top-color: var(--ok); }

.flow-line .dot {
  position: absolute;
  top: -5px; left: 50%;
  width: 8px; height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--line-2);
}

.flow-line li:first-child .dot { background: var(--brand); }
.flow-line li:last-child .dot  { background: var(--ok); }

.next-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.next-item {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--ink-2);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.next-item b { color: var(--brand); font-weight: 600; }

/* ==========================================================================
   附件（图片走 <img>，PDF 走文件块，绝不用 img 装 PDF）
   ========================================================================== */

.attach { min-width: 0; }

.attach-img {
  display: inline-block;
  max-width: 280px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
  transition: border-color .15s, box-shadow .15s;
}

.attach-img:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .1);
}

.attach-img img { display: block; width: 100%; height: auto; }

.attach-pdf {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  padding: 9px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.pdf-badge {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 32px; height: 38px;
  border-radius: 5px;
  background: #dc2626;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .04em;
}

.pdf-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pdf-meta b {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-meta span { font-size: 11.5px; color: var(--ink-3); }

/* 当前角色没有下载权限的附件：只报「有这个附件」，不给按钮 */
.attach-nope {
  border-style: dashed;
  background: #fafbfc;
  opacity: .75;
}

.attach-nope .pdf-meta { color: var(--ink-3); }

.btn-ghost.sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 860px) {
  .login-wrap {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 420px;
  }

  .login-brand {
    padding: 26px 26px 22px;
  }

  .brand-top { margin-bottom: 20px; }
  .login-brand h1 { font-size: 23px; }
  .brand-sub { margin-bottom: 0; font-size: 13px; }
  .brand-points, .brand-foot { display: none; }

  .login-panel { padding: 26px 26px 30px; }
  .login-form h2 { font-size: 19px; }
}

@media (max-width: 620px) {
  .home-main { padding: 16px 14px 48px; }
  .card { padding: 18px 16px; }
  .topbar { padding: 0 14px; }
  .topbar-title { display: none; }
  .welcome { gap: 16px; }
  .welcome-r { width: 100%; }
  .stat { flex: 1; min-width: 0; }
  .flow-line li { min-width: 0; font-size: 11.5px; padding: 10px 2px 0; }
}

/* ==========================================================================
   v2.3 · 订单列表页 / 详情页
   两页共用同一套原子：页面容器、卡片、标签、行、表单。
   窄屏不横向滚动：桌面是 grid 行，手机把同一行折成卡片、表格折成块。
   ========================================================================== */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 20px 64px;
  display: grid;
  gap: 14px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}

.topbar-nav a {
  padding: 5px 10px;
  font-size: 13px;
  color: var(--ink-2);
  border-radius: 7px;
}

.topbar-nav a:hover { background: var(--bg); text-decoration: none; }
.topbar-nav a.on { color: var(--brand); background: var(--brand-l); }

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.card-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -.005em; }
.card-head .sub { font-size: 12px; color: var(--ink-3); }

/* ---- 筛选条 ---- */

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.seg { display: flex; flex-wrap: wrap; gap: 6px; }

.seg button {
  height: 30px;
  padding: 0 11px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}

.seg button:hover { border-color: #b6c2d1; color: var(--ink); }

.seg button.on {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 600;
}

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

.searchbar input {
  width: 200px;
  height: 34px;
  padding: 0 11px;
  font-size: 13.5px;
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  outline: none;
}

.searchbar input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}

.btn {
  height: 34px;
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn:disabled { background: #93a8d6; border-color: #93a8d6; cursor: default; }

.btn.ghost {
  color: var(--ink-2);
  background: #fff;
  border-color: var(--line-2);
  font-weight: 500;
}

.btn.ghost:hover { background: var(--bg); color: var(--ink); }
.btn.danger { color: var(--danger); background: #fff; border-color: #fecaca; font-weight: 500; }
.btn.danger:hover { background: var(--danger-l); }

.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }

/* ---- 列表 ---- */

.olist { display: grid; }

.olist .ohead,
.olist .orow {
  display: grid;
  grid-template-columns: 186px minmax(0, 1fr) 116px 86px 92px 128px;
  gap: 12px;
  align-items: center;
}

.olist .ohead {
  padding: 0 12px 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}

.orow {
  padding: 12px;
  color: inherit;
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}

.orow:hover { background: #f8fafc; text-decoration: none; }
.orow:last-child { border-bottom: 0; }

.orow .no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orow .cust {
  min-width: 0;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orow .amt {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
}

.orow .who-cell,
.orow .when {
  font-size: 12.5px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orow .when { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12px; }

.tag {
  display: inline-block;
  padding: 1px 9px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.7;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tag.s-wait_purchase { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.tag.s-purchased     { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.tag.s-delivered     { color: #0369a1; background: #f0f9ff; border-color: #bae6fd; }
.tag.s-wait_invoice  { color: #7c3aed; background: #f5f3ff; border-color: #ddd6fe; }
.tag.s-invoiced      { color: #0f766e; background: #f0fdfa; border-color: #99f6e4; }
.tag.s-wait_pay      { color: #b45309; background: #fff7ed; border-color: #fed7aa; }
.tag.s-closed        { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.tag.s-void          { color: var(--danger); background: var(--danger-l); border-color: #fecaca; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  font-size: 12.5px;
  color: var(--ink-2);
  flex-wrap: wrap;
}

.pager .btns { display: flex; gap: 8px; }

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--ink-2);
}

.empty b { display: block; font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* ---- 详情头部 ---- */

.dhead { display: grid; gap: 10px; }

.dtitle {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.dtitle h1 {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.dmeta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--ink-2);
}

.dmeta b { color: var(--ink); font-weight: 600; }
.dmeta .k { color: var(--ink-3); margin-right: 4px; }

/* ---- 七步轨道 ---- */

.dtrack {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-top: 4px;
}

.dtrack .step {
  position: relative;
  padding: 14px 4px 0;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  border-top: 2px solid var(--line);
}

.dtrack .step::before {
  content: "";
  position: absolute;
  top: -6px; left: 50%;
  width: 10px; height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--line-2);
}

.dtrack .step.done { color: var(--ink-2); border-top-color: #93c5fd; }
.dtrack .step.done::before { background: #93c5fd; border-color: #93c5fd; }

.dtrack .step.cur {
  color: var(--brand);
  font-weight: 650;
  border-top-color: var(--brand);
}

.dtrack .step.cur::before {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, .15);
}

.dactions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.dactions .hint { font-size: 12.5px; color: var(--ink-3); }

/* ---- 合计区 ---- */

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

.sbox {
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.sbox .k { font-size: 11.5px; color: var(--ink-3); }

.sbox .v {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.sbox .v.pos { color: var(--ok); }
.sbox .v.neg { color: var(--danger); }
.sbox .u { font-size: 11.5px; color: var(--ink-3); margin-left: 2px; font-weight: 400; }

/* ---- 明细表 ---- */

.dtable { width: 100%; border-collapse: collapse; font-size: 13px; }

.dtable th {
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.dtable td {
  padding: 9px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

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

.dtable .num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.dtable .neg { color: var(--danger); }
.dtable .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.dtable .dim { color: var(--ink-3); font-size: 12px; }

.locked-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 12px;
  margin-top: 10px;
  font-size: 12.5px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.locked-note b { font-weight: 650; }

/* ---- 行内表单 ---- */

.form-inline {
  margin-top: 12px;
  padding: 14px;
  background: #f8fafc;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
}

.form-grid .f { display: grid; gap: 4px; min-width: 0; }

.form-grid label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }

.form-grid input,
.form-grid select {
  height: 34px;
  padding: 0 10px;
  font-size: 13.5px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  outline: none;
  min-width: 0;
  width: 100%;
}

.form-grid input:focus,
.form-grid select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}

.form-grid .full { grid-column: 1 / -1; }

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 11px;
}

/* 预览文字单独占一行，别把按钮挤成竖排 */
.form-actions .preview { flex: 1 1 100%; }
.form-actions .btn { flex: 0 0 auto; }

.preview {
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.preview b { color: var(--ink); font-weight: 650; }
.preview.bad { color: var(--danger); }
.preview.bad b { color: var(--danger); }

/* ---- 附件区 ---- */

.attach-list { display: grid; gap: 10px; }

.attach-item {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  background: #fcfdff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.attach-item .cap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.attach-item .cap .tag { font-size: 11px; padding: 0 7px; }

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.file-row input[type="file"] {
  font-size: 12.5px;
  max-width: 100%;
}

/* ---- 流转记录 ---- */

.flowlist { display: grid; margin-top: 4px; }

.flowitem {
  position: relative;
  padding: 0 0 16px 22px;
  border-left: 2px solid var(--line);
  margin-left: 6px;
}

.flowitem:last-child { border-left-color: transparent; padding-bottom: 0; }

.flowitem::before {
  content: "";
  position: absolute;
  left: -6px; top: 3px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--line-2);
}

.flowitem.reject::before { border-color: var(--danger); background: var(--danger-l); }
.flowitem.forward::before { border-color: var(--brand); background: var(--brand-l); }
.flowitem.void::before { border-color: var(--ink-3); background: var(--bg); }

.flowitem .line1 {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 13px;
}

.flowitem .line1 b { font-weight: 650; }
.flowitem .line1 .arrow { color: var(--ink-3); }
.flowitem .line2 { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.flowitem .reason {
  margin-top: 5px;
  padding: 7px 10px;
  font-size: 12.5px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 7px;
  overflow-wrap: anywhere;
}

.flowitem .reason.void { color: var(--danger); background: var(--danger-l); border-color: #fecaca; }

/* ---- 提示条 ---- */

.flash {
  padding: 10px 13px;
  font-size: 13px;
  border-radius: 9px;
  border: 1px solid transparent;
}

.flash.err { color: var(--danger); background: var(--danger-l); border-color: #fecaca; }
.flash.ok  { color: var(--ok); background: #ecfdf5; border-color: #a7f3d0; }
.flash.info { color: var(--ink-2); background: #f8fafc; border-color: var(--line); }

/* ---- 窄屏 ---- */

@media (max-width: 860px) {
  .olist .ohead { display: none; }

  .olist .orow {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "no   amt"
      "cust st"
      "who  when";
    gap: 4px 10px;
    padding: 13px 12px;
  }

  .orow .no { grid-area: no; }
  .orow .amt { grid-area: amt; }
  .orow .cust { grid-area: cust; font-size: 13px; }
  .orow .st-cell { grid-area: st; text-align: right; }
  .orow .who-cell { grid-area: who; }
  .orow .when { grid-area: when; text-align: right; }

  .sumbox { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .page { padding: 14px 14px 56px; }
  .card { padding: 16px 14px; }
  .searchbar { width: 100%; }
  .searchbar input { flex: 1; width: auto; min-width: 0; }
  .toolbar { gap: 10px; }
  .seg { gap: 5px; }
  .seg button { height: 28px; padding: 0 9px; font-size: 12px; }

  .dtrack { grid-template-columns: repeat(2, 1fr); }
  .dtrack .step:nth-child(n+3) { margin-top: 12px; }

  .dtitle h1 { font-size: 16px; }
  .dmeta { font-size: 12.5px; gap: 4px 12px; }
  .sbox .v { font-size: 17px; }

  /* 明细表折成块，表头隐藏，用 data-l 当标签，杜绝横向滚动 */
  .dtable thead { display: none; }
  .dtable, .dtable tbody, .dtable tr, .dtable td { display: block; width: 100%; }
  .dtable tr { padding: 9px 0; border-bottom: 1px solid var(--line); }
  .dtable td {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 0;
    border: 0;
    text-align: left;
  }
  .dtable td::before {
    content: attr(data-l);
    flex: 0 0 auto;
    font-size: 11.5px;
    color: var(--ink-3);
  }
  .dtable td.num { justify-content: flex-end; }
  .dtable td.num::before { margin-right: auto; }
  .dtable td .v { text-align: right; overflow-wrap: anywhere; }

  .form-grid { grid-template-columns: 1fr; }
  .attach-img { max-width: 100%; }
  .attach-pdf { max-width: 100%; }
}

