/* =========================================================
   中弈抽检服务平台 · 业务样式
   依赖 tokens.css
   ========================================================= */

/* ---------- 通用按钮 ---------- */
.btn-brand,
.btn-ghost,
.btn-danger-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn-brand {
  background: var(--brand-600);
  border: 1px solid var(--brand-600);
  color: #fff;
}

.btn-brand:hover {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #fff;
}

.btn-ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-700);
}

.btn-ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--ink-900);
}

.btn-danger-ghost {
  background: #fff;
  border: 1px solid #fecaca;
  color: var(--danger);
}

.btn-danger-ghost:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-600);
  cursor: pointer;
}

.btn-icon:hover {
  background: #f1f5f9;
  color: var(--ink-900);
}

.menu-toggle {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(15, 23, 42, 0.42);
}

/* ---------- 表单 ---------- */
.input-soft {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--ink-900);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-soft::placeholder {
  color: var(--ink-400);
}

.input-soft:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  outline: none;
}

textarea.input-soft {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}

.field {
  margin-bottom: 16px;
}

.field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--ink-600);
}

.field-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-400);
}

/* ---------- 应用骨架 ---------- */
.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 64px;
  padding: 0 20px;
}

.brand-mark {
  display: block;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.brand-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.2;
}

.brand-sub {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-400);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 20px;
}

.nav-section + .nav-section {
  margin-top: 18px;
}

.nav-section-title {
  padding: 0 10px 6px;
  font-size: 11px;
  color: var(--ink-400);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--ink-600);
  font-size: 13.5px;
}

.nav-item + .nav-item {
  margin-top: 2px;
}

.nav-item i {
  font-size: 16px;
  color: var(--ink-400);
}

.nav-item:hover {
  background: #f8fafc;
  color: var(--ink-900);
}

.nav-item.active {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 500;
  box-shadow: inset 3px 0 0 var(--brand-600);
}

.nav-item.active i {
  color: var(--brand-600);
}

.sidebar-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-400);
}

.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: 240px;
}

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

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  color: var(--ink-400);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.breadcrumb b {
  color: var(--ink-700);
  font-weight: 500;
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 13px;
  color: var(--ink-700);
}

.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 600;
}

.content {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 24px 32px 48px;
}

/* ---------- 页头 ---------- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-900);
}

.page-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-400);
}

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

/* ---------- 卡片 ---------- */
.card-soft {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
}

.card-title i {
  color: var(--ink-400);
  font-size: 16px;
}

.card-body {
  padding: 20px;
}

.card-body-tight {
  padding: 0;
  overflow-x: auto;
}

.card-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.stack-gap > * + * {
  margin-top: 20px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(340px, 1fr);
  gap: 20px;
  align-items: start;
}

/* ---------- 指标卡 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  padding: 18px 20px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.stat-label {
  font-size: 12px;
  color: var(--ink-400);
}

.stat-value {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-value small {
  margin-left: 4px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-400);
}

.stat-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-400);
}

a.stat-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}

a.stat-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

a.stat-link:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

/* ---------- 徽章 ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.7;
  white-space: nowrap;
}

.status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.badge-warning {
  background: #fef3c7;
  color: #b45309;
}

.badge-info {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-brand {
  background: #eef2ff;
  color: #4338ca;
}

.badge-success {
  background: #dcfce7;
  color: #15803d;
}

.badge-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-neutral {
  background: #f1f5f9;
  color: #475569;
}

.badge-sky {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-teal {
  background: #ccfbf1;
  color: #0f766e;
}

.badge-purple {
  background: #f3e8ff;
  color: #6b21a8;
}

.badge-orange {
  background: #ffedd5;
  color: #c2410c;
}

/* ---------- 表格 ---------- */
.table-soft {
  width: 100%;
  border-collapse: collapse;
}

.table-soft th {
  padding: 12px 20px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
  color: var(--ink-400);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.table-soft td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-700);
  vertical-align: middle;
}

.table-soft tbody tr:last-child td {
  border-bottom: 0;
}

.table-soft tbody tr:hover td {
  background: #fafbff;
}

.table-soft .num {
  font-variant-numeric: tabular-nums;
}

.cell-title {
  font-weight: 500;
  color: var(--ink-900);
}

.cell-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-400);
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab {
  padding: 12px 0;
  border-bottom: 2px solid transparent;
  color: var(--ink-600);
  font-size: 14px;
  white-space: nowrap;
}

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

.tab.active {
  border-bottom-color: var(--brand-600);
  color: var(--brand-700);
  font-weight: 500;
}

/* ---------- 时间轴 ---------- */
.timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 20px;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 8px;
  left: 5px;
  width: 1px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  top: 5px;
  left: -19px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #fff;
}

.timeline-item.done .timeline-dot {
  border-color: var(--brand-600);
  background: var(--brand-600);
}

.timeline-item.current .timeline-dot {
  border-color: var(--brand-600);
  background: #fff;
  box-shadow: 0 0 0 4px var(--brand-50);
}

.timeline-item.rejected .timeline-dot {
  border-color: var(--danger);
  background: var(--danger);
}

.timeline-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-900);
}

.timeline-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-400);
}

.timeline-desc {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-600);
}

/* ---------- 进度条 ---------- */
.progress-soft {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef1f6;
}

.progress-soft > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--brand-500);
}

.progress-soft > span.tone-success {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.progress-soft > span.tone-warning {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.progress-soft > span.tone-danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-400);
}

/* ---------- 键值列表 ---------- */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}

.kv-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kv-label {
  font-size: 12px;
  color: var(--ink-400);
}

.kv-value {
  margin-top: 2px;
  font-size: 14px;
  color: var(--ink-900);
  word-break: break-all;
}

/* ---------- 服务项 ---------- */
.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.service-item:last-child {
  border-bottom: 0;
}

.service-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-700);
}

.service-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 14px;
}

.service-item.off .service-icon {
  background: #f1f5f9;
  color: var(--ink-400);
}

.service-item.off .service-name {
  color: var(--ink-400);
}

/* ---------- 空状态 ---------- */
.empty-state {
  padding: 48px 24px;
  text-align: center;
}

.empty-state i {
  display: block;
  margin-bottom: 10px;
  font-size: 32px;
  color: var(--ink-400);
}

.empty-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-700);
}

.empty-desc {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-400);
}

/* ---------- 提示条 ---------- */
.flash {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.flash-success {
  background: #ecfdf5;
  color: #047857;
}

.flash-error {
  background: #fef2f2;
  color: #b91c1c;
}

/* ---------- 阶段标签 ---------- */
.stage-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--ink-400);
  font-size: 12px;
}

.stage-chip.done {
  background: var(--brand-50);
  color: var(--brand-700);
}

.stage-chip.current {
  background: var(--brand-600);
  color: #fff;
}

[x-cloak] {
  display: none !important;
}

/* ---------- 机构门户 ---------- */
.portal-body {
  background: var(--bg);
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.portal-topbar .title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
}

.portal-topbar .spacer {
  flex: 1;
}

.portal-content {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px 96px;
}

.portal-greeting {
  padding: 4px 2px 14px;
}

.portal-greeting h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-900);
}

.portal-greeting p {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-400);
}

.order-card {
  display: block;
  margin-bottom: 12px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  color: inherit;
}

.order-card:hover {
  color: inherit;
  box-shadow: var(--shadow-pop);
}

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

.order-no {
  font-size: 12px;
  color: var(--ink-400);
  font-variant-numeric: tabular-nums;
}

.order-name {
  margin-top: 2px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-900);
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-400);
}

.order-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-400);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: none;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.bottom-nav a {
  flex: 1;
  padding: 8px 0 6px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-400);
}

.bottom-nav a i {
  display: block;
  margin-bottom: 2px;
  font-size: 18px;
}

.bottom-nav a.active {
  color: var(--brand-600);
}

.bottom-nav .nav-more {
  flex: 1;
  padding: 8px 0 6px;
  border: 0;
  background: transparent;
  color: var(--ink-400);
  font-size: 11px;
  text-align: center;
  cursor: pointer;
}

.bottom-nav .nav-more i {
  display: block;
  margin-bottom: 2px;
  font-size: 18px;
}

/* ---------- 机构门户详情 ---------- */
.detail-hero {
  margin-bottom: 12px;
  padding: 18px 16px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.detail-hero .order-no {
  margin-bottom: 2px;
}

.detail-hero h1 {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.4;
}

.detail-hero .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.info-list {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 12px 0 0;
  font-size: 13px;
}

.info-list dt {
  color: var(--ink-400);
}

.info-list dd {
  margin: 0;
  color: var(--ink-700);
}

.ship-card {
  margin-bottom: 12px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

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

.tracking-no {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: 0.02em;
}

/* ---------- 交付报告 ---------- */
.report-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.report-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 1180px;
  height: 56px;
  margin: 0 auto;
  padding: 0 16px;
}

.report-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.report-side {
  position: sticky;
  top: 76px;
}

.report-main {
  min-width: 0;
}

.summary-card {
  padding: 18px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.summary-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.4;
}

.summary-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-400);
  font-variant-numeric: tabular-nums;
}

.summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.summary-stat {
  padding: 10px 12px;
  background: #fafbff;
  border-radius: 10px;
}

.summary-stat .v {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.summary-stat .l {
  font-size: 11px;
  color: var(--ink-400);
}

.summary-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.summary-actions .btn-brand,
.summary-actions .btn-ghost {
  width: 100%;
}

.hash-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: var(--ink-400);
  word-break: break-all;
}

.batch-block {
  margin-bottom: 16px;
}

.batch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
}

.batch-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
}

.batch-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-400);
}

.batch-head .chevron {
  flex: none;
  color: var(--ink-400);
  transition: transform 0.15s ease;
}

.batch-head[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.batch-items {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.item-card {
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.item-head {
  display: flex;
  gap: 14px;
  padding: 16px;
}

.item-thumb {
  display: grid;
  place-items: center;
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background: #f1f5f9;
  font-size: 30px;
}

.item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.45;
}

.item-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-400);
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-400);
}

.price {
  font-size: 15px;
  font-weight: 600;
  color: var(--danger);
  font-variant-numeric: tabular-nums;
}

.item-section {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
}

.section-name .idx {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 600;
}

.section-hint {
  font-size: 12px;
  color: var(--ink-400);
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.link-pill.valid {
  background: #dcfce7;
  color: #15803d;
}

.link-pill.warning {
  background: #fef3c7;
  color: #b45309;
}

.link-pill.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.kv-list {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 10px 0 0;
  font-size: 13px;
}

.kv-list dt {
  color: var(--ink-400);
}

.kv-list dd {
  margin: 0;
  color: var(--ink-700);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.nutrition {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.nutrition th {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-400);
  font-weight: 500;
  text-align: left;
}

.nutrition td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--ink-700);
}

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

.nutrition .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.evidence-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.evidence-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink-600);
  font-size: 12px;
}

.callback-box {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
}

.callback-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 12.5px;
}

.callback-row .k {
  color: var(--ink-400);
}

.callback-row .v {
  color: var(--ink-700);
  text-align: right;
}

.item-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-600);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.item-more {
  display: none;
}

.item-more.open {
  display: block;
}

.report-actions {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 45;
  display: flex;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.report-actions .btn-brand {
  flex: 2;
}

.report-actions .btn-ghost {
  flex: 1;
}

/* ---------- 登录页 ---------- */
.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 28px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

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

.auth-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink-900);
}

.auth-sub {
  margin-top: 6px;
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--ink-400);
}

.auth-foot {
  margin-top: 18px;
  font-size: 12px;
  color: var(--ink-400);
  text-align: center;
}

/* ---------- 响应式 ---------- */
@media (max-width: 991px) {
  .sidebar {
    display: flex;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-pop);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-flex;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    padding: 0 12px;
    gap: 8px;
  }

  .content {
    padding: 16px 16px 88px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .report-layout {
    grid-template-columns: 1fr;
    padding: 12px 12px 96px;
  }

  .report-side {
    position: static;
  }

  .summary-actions {
    display: none;
  }

  .report-actions {
    display: flex;
  }

  .bottom-nav {
    display: flex;
  }

  .demo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .topbar .btn-icon[aria-label="帮助"] {
    display: none;
  }
}

@media (max-width: 575px) {
  .page-title {
    font-size: 18px;
  }

  .user-chip {
    display: none;
  }

  .table-soft {
    min-width: 640px;
  }

  .kv-grid {
    grid-template-columns: 1fr;
  }

  .kv-grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-head {
    gap: 12px;
  }

  .item-thumb {
    width: 60px;
    height: 60px;
    font-size: 26px;
  }

  .table-soft th,
  .table-soft td {
    padding-right: 12px;
    padding-left: 12px;
  }
}

@media (min-width: 992px) {
  .report-actions {
    display: none;
  }
}

/* ---------- 登录页扩展 ---------- */
.auth-tabs { margin-bottom: 18px; }
.auth-tab { border: 0; background: transparent; padding: 8px 2px; margin-right: 20px; color: var(--ink-400); border-bottom: 2px solid transparent; cursor: pointer; font-size: 14px; }
.auth-tab.active { color: var(--brand-700); border-bottom-color: var(--brand-600); font-weight: 500; }
/* ---------- 表单面板 ---------- */
.form-panel { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 20px; margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-section-title { font-size: 14px; font-weight: 600; color: var(--ink-900); margin-bottom: 14px; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--ink-600); cursor: pointer; }
.check-chip input { accent-color: var(--brand-600); }
details.panel > summary { list-style: none; cursor: pointer; }
details.panel > summary::-webkit-details-marker { display: none; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; }
.inline-form .input-soft { height: 32px; font-size: 13px; }

@media (max-width: 991px) {
  .form-grid, .form-grid.cols-2 { grid-template-columns: 1fr; }
}

/* ---------- 登录页 ---------- */
.login-body {
  background: var(--surface);
}

.login-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  overflow: hidden;
  padding: 56px 64px;
  color: #fff;
  background: linear-gradient(160deg, #141735 0%, #252b63 58%, #0f5f5a 100%);
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 78%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 78%);
  pointer-events: none;
}

.login-brand-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-name {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.brand-tag {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

.brand-name-dark {
  color: var(--ink-900);
}

.brand-tag-dark {
  color: var(--ink-400);
}

.login-brand-main {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.login-brand-main h1 {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.38;
}

.brand-lead {
  max-width: 450px;
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.68);
}

.brand-points {
  display: grid;
  gap: 16px;
  max-width: 450px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.brand-points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.point-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 15px;
}

.brand-points b {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
}

.brand-points small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.login-brand-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.52);
}

.login-brand-foot span {
  opacity: 0.6;
}

.brand-watermark {
  position: absolute;
  right: -72px;
  bottom: -48px;
  z-index: 0;
  width: 340px;
  opacity: 0.05;
  pointer-events: none;
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--surface);
}

.login-form {
  width: 100%;
  max-width: 380px;
}

.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.login-tab {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--ink-600);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.login-tab.active {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 500;
}

.panel-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink-900);
}

.panel-sub {
  margin: 6px 0 24px;
  font-size: 13px;
  color: var(--ink-400);
}

.wecom-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 0 4px;
}

.wecom-qr iframe {
  width: 300px;
  height: 360px;
  border: 0;
  border-radius: 12px;
  background: #fff;
}

.wecom-qr-hint {
  font-size: 12.5px;
  color: var(--ink-400);
  text-align: center;
  line-height: 1.7;
}

.wecom-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 42px 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  text-align: center;
}

.wecom-empty i {
  font-size: 30px;
  color: var(--ink-400);
}

.wecom-empty b {
  font-size: 13.5px;
  color: var(--ink-700);
  font-weight: 500;
}

.wecom-empty small {
  font-size: 12px;
  color: var(--ink-400);
  line-height: 1.7;
}

@media (max-width: 991px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-brand {
    display: none;
  }

  .login-main {
    min-height: 100vh;
    padding: 32px 20px;
  }

  .login-mobile-brand {
    display: flex;
  }
}


/* ---------- 验收函签署 ---------- */
.sign-canvas-wrap {
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  overflow: hidden;
}

.sign-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 180px;
  touch-action: none;
  cursor: crosshair;
}

/* ---------- 机构等级 ---------- */
.level-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.level-a-plus { background: #dcfce7; color: #15803d; }
.level-a { background: #d1fae5; color: #047857; }
.level-a-minus { background: #ccfbf1; color: #0f766e; }
.level-b-plus { background: #dbeafe; color: #1d4ed8; }
.level-b { background: #e0f2fe; color: #0369a1; }
.level-b-minus { background: #eef2ff; color: #4338ca; }
.level-c-plus { background: #fef3c7; color: #b45309; }
.level-c { background: #fef9c3; color: #a16207; }
.level-c-minus { background: #ffedd5; color: #c2410c; }
.level-d-plus { background: #fee2e2; color: #b91c1c; }
.level-d { background: #fecaca; color: #991b1b; }
.level-d-minus { background: #e5e7eb; color: #6b7280; }

/* ---------- 权限矩阵 ---------- */
.perm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.perm-table th,
.perm-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

.perm-table th:first-child,
.perm-table td:first-child {
  text-align: left;
  white-space: normal;
}

.perm-table td input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand-600);
}

/* ---------- 样品物流轨迹 ---------- */
.ship-block {
  padding: 8px 0;
  border-top: 1px dashed var(--line);
}

.ship-block:first-of-type {
  border-top: 0;
}

.ship-timeline {
  margin: 8px 0 4px;
  padding: 0 0 0 14px;
  border-left: 1px solid var(--line);
  list-style: none;
}

.ship-timeline li {
  position: relative;
  padding: 0 0 12px 12px;
  font-size: 12.5px;
  color: var(--ink-700, #334155);
}

.ship-timeline li:last-child {
  padding-bottom: 0;
}

.ship-dot {
  position: absolute;
  top: 5px;
  left: -5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-600);
}

.track-form {
  margin-top: 4px;
}

.track-form summary {
  color: var(--brand-600);
  cursor: pointer;
  list-style: none;
}

.track-form summary::-webkit-details-marker {
  display: none;
}

.ship-card .ship-timeline {
  margin-left: 16px;
  margin-right: 16px;
  margin-bottom: 14px;
}


/* ---------- 下单任务要求明细 ---------- */
.req-table td {
  padding: 6px 8px;
}

.req-table .input-soft {
  width: 100%;
  min-width: 0;
  font-size: 12.5px;
  padding: 7px 9px;
}

.req-table th {
  white-space: nowrap;
}

/* ---------- 任务进度看板 ---------- */
.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.metric-row:last-child {
  border-bottom: 0;
}

.metric-row b {
  font-variant-numeric: tabular-nums;
  color: var(--ink-900);
}


/* ---------- 进度预警 ---------- */
.alertbar {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  line-height: 1.8;
}

/* ---------- 交付卡图片 ---------- */
.pc-thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.pc-thumb-row > div,
.pc-thumb-row > a {
  width: 96px;
  font-size: 11px;
  color: var(--ink-400);
  text-decoration: none;
}

.pc-thumb-row img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.pc-thumb-row span {
  display: block;
  margin-top: 3px;
}

/* ===== 任务进度看板：按演示页面风格 ===== */
.progress-dash { --dz-blue:#0082ef; --dz-blue-deep:#0b57c2; --dz-line:#e6eaf2; --dz-sub:#6b7280; }
.progress-dash .browser {
  background:#fff; border-radius:16px; border:1px solid var(--dz-line);
  overflow:hidden; box-shadow:0 10px 30px rgba(10,30,80,.10);
}
.progress-dash .browser .bar {
  height:40px; background:#f0f2f6; display:flex; align-items:center;
  gap:8px; padding:0 16px; border-bottom:1px solid var(--dz-line);
}
.progress-dash .browser .bar .c { width:11px; height:11px; border-radius:50%; }
.progress-dash .browser .url {
  flex:1; background:#fff; border-radius:8px; font-size:11.5px;
  color:#9aa3b2; padding:5px 14px; margin:0 8px;
}
.progress-dash .dash { padding:20px; background:#f7f9fc; }
.progress-dash .stat-row { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; }
.progress-dash .stat { background:#fff; border:1px solid var(--dz-line); border-radius:12px; padding:14px 16px; }
.progress-dash .stat .l { font-size:12px; color:var(--dz-sub); }
.progress-dash .stat .v { font-size:24px; font-weight:800; margin-top:4px; color:#1f2937; }
.progress-dash .stat .v small { font-size:12px; font-weight:400; color:#9aa3b2; }
.progress-dash .stat .d { font-size:11px; margin-top:3px; color:var(--dz-sub); }
.progress-dash .dash-2col { display:grid; grid-template-columns:1.35fr 1fr; gap:14px; margin-top:14px; }
.progress-dash .panel { background:#fff; border:1px solid var(--dz-line); border-radius:12px; padding:16px; }
.progress-dash .panel h4 { font-size:13.5px; margin-bottom:12px; display:flex; align-items:center; gap:7px; color:#1f2937; }
.progress-dash .panel h4 .bar { width:4px; height:13px; border-radius:2px; background:var(--dz-blue); }
.progress-dash table.task { width:100%; border-collapse:collapse; font-size:12px; }
.progress-dash table.task th { color:var(--dz-sub); font-weight:600; text-align:left; padding:7px 8px; background:#f7f9fc; font-size:11.5px; }
.progress-dash table.task td { padding:9px 8px; border-bottom:1px solid #f0f2f6; vertical-align:middle; }
.progress-dash .prog { height:7px; background:#edf1f7; border-radius:99px; overflow:hidden; min-width:90px; }
.progress-dash .prog i { display:block; height:100%; border-radius:99px; background:linear-gradient(90deg,#0082ef,#38bdf8); }
.progress-dash .hbar { display:flex; align-items:center; gap:10px; margin:8px 0; font-size:11.5px; }
.progress-dash .hbar .n { min-width:100px; color:var(--dz-sub); text-align:right; }
.progress-dash .hbar .t { flex:1; height:13px; background:#f0f3f8; border-radius:99px; overflow:hidden; }
.progress-dash .hbar .t i { display:block; height:100%; background:linear-gradient(90deg,#0082ef,#5eb3ff); border-radius:99px; }
.progress-dash .hbar .t i.tone-success { background:linear-gradient(90deg,#10b981,#34d399); }
.progress-dash .hbar .t i.tone-warning { background:linear-gradient(90deg,#f59e0b,#fbbf24); }
.progress-dash .hbar .t i.tone-danger { background:linear-gradient(90deg,#ef4444,#f87171); }
.progress-dash .hbar .v { min-width:30px; color:#1f2937; font-weight:600; }
.progress-dash .tag { display:inline-block; font-size:11px; padding:2px 9px; border-radius:999px; line-height:1.6; white-space:nowrap; }
.progress-dash .tag.blue { background:#eaf4fe; color:#0b57c2; }
.progress-dash .tag.green { background:#e7f8f1; color:#047857; }
.progress-dash .tag.orange { background:#fef4e2; color:#b45309; }
.progress-dash .tag.red { background:#fdeaea; color:#b91c1c; }
.progress-dash .tag.gray { background:#eef1f6; color:#6b7280; }
.progress-dash .alertbar {
  margin:14px 0; padding:12px 16px; border:1px solid #fcd34d;
  border-radius:10px; background:#fffbeb; color:#92400e; font-size:12.5px; line-height:1.8;
}
.progress-dash .timeline { margin:0; }
@media (max-width: 1100px) {
  .progress-dash .stat-row { grid-template-columns:repeat(2,1fr); }
  .progress-dash .dash-2col { grid-template-columns:1fr; }
}
@media (max-width: 640px) {
  .progress-dash .dash { padding:12px; }
  .progress-dash .stat-row { grid-template-columns:1fr 1fr; }
  .progress-dash .stat .v { font-size:20px; }
}


/* 登录页演示账号 */
.demo-accounts { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.demo-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 13px; color: var(--ink-900); margin-bottom: 10px; }
.demo-title span { margin-left: auto; font-weight: 400; color: var(--ink-600); font-size: 12px; }
.demo-title b { color: var(--brand-700); }
.demo-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.demo-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 7px 7px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; text-align: left; min-width: 0; }
.demo-item:hover { border-color: var(--brand-500); background: var(--brand-50); }
.demo-role { font-size: 9.5px; line-height: 1.35; color: var(--brand-700); font-weight: 700; }
.demo-dept { font-size: 9px; line-height: 1.35; color: var(--ink-400); }
.demo-actions { font-size: 9px; line-height: 1.45; color: var(--ink-500); }
.demo-account { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; color: var(--ink-600); }
@media (max-width: 1100px) { .demo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .demo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.demo-hint { margin-top: 8px; font-size: 11px; color: var(--ink-400); }
@media (max-width: 480px) { .demo-grid { grid-template-columns: 1fr; } }


/* 任务生命周期阶段条 */
.lifecycle-bar { display:flex; align-items:flex-start; gap:0; padding:18px 18px 14px; background:#fff; border:1px solid var(--line); border-radius:var(--radius-card); overflow-x:auto; }
.lc-step { display:flex; flex-direction:column; align-items:center; min-width:126px; flex:1; position:relative; }
.lc-label { font-size:12.5px; font-weight:700; color:#334155; line-height:1.4; text-align:center; white-space:nowrap; margin-bottom:10px; }
.lc-track { width:100%; height:26px; position:relative; display:flex; align-items:center; justify-content:center; }
.lc-track::before { content:""; position:absolute; left:0; right:0; top:50%; height:2px; transform:translateY(-50%); background:#e8ecf3; z-index:0; }
.lc-step:first-child .lc-track::before { left:50%; }
.lc-step:last-child .lc-track::before { right:50%; }
.lc-step.done .lc-track::before { background:#86efac; }
.lc-step.current .lc-track::before { background:linear-gradient(90deg,#86efac 0 50%,#e8ecf3 50% 100%); }
.lc-dot { width:26px; height:26px; border-radius:50%; display:grid; place-items:center; flex:0 0 26px; font-size:12px; font-weight:700; background:#eef1f6; color:#94a3b8; z-index:1; position:relative; }
.lc-step.done .lc-dot { background:#16a34a; color:#fff; }
.lc-step.current .lc-dot { background:var(--brand-600); color:#fff; box-shadow:0 0 0 4px var(--brand-50); }
.lc-step.objected .lc-dot { background:#d97706; color:#fff; }
.lc-meta { margin-top:9px; font-size:10.5px; color:#94a3b8; text-align:center; line-height:1.45; max-width:130px; white-space:normal; }
.lc-step.current .lc-label { color:var(--brand-700); }
@media (max-width: 900px) { .lc-step { min-width:108px; } .lc-label { font-size:11.5px; } .lc-meta { font-size:9.5px; max-width:104px; } }

.pager-bar { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding:14px 4px 2px; }
.pager-links { display:flex; gap:6px; flex-wrap:wrap; }
.pager-links a { padding:4px 10px; border:1px solid var(--line); border-radius:7px; color:var(--brand-700); text-decoration:none; background:#fff; font-size:12px; }
.pager-links a.active { background:var(--brand-600); color:#fff; border-color:var(--brand-600); }


.nav-badge { margin-left:auto; min-width:20px; height:20px; padding:0 6px; border-radius:999px; background:var(--brand-600); color:#fff; font-size:10.5px; display:inline-flex; align-items:center; justify-content:center; }

/* ---------- 工作台统计配色 ---------- */
.stat-tone-brand   { --tone-bg:#EEF2FF; --tone-line:#6366F1; --tone-ink:#4338CA; }
.stat-tone-warning { --tone-bg:#FFFBEB; --tone-line:#D97706; --tone-ink:#B45309; }
.stat-tone-info    { --tone-bg:#F0F9FF; --tone-line:#0EA5E9; --tone-ink:#0369A1; }
.stat-tone-success { --tone-bg:#F0FDF4; --tone-line:#16A34A; --tone-ink:#15803D; }
.stat-tone-violet  { --tone-bg:#F5F3FF; --tone-line:#8B5CF6; --tone-ink:#6D28D9; }
.stat-tone-cyan    { --tone-bg:#ECFEFF; --tone-line:#0891B2; --tone-ink:#0E7490; }
.stat-tone-orange  { --tone-bg:#FFF7ED; --tone-line:#EA580C; --tone-ink:#C2410C; }
.stat-tone-slate   { --tone-bg:#F8FAFC; --tone-line:#94A3B8; --tone-ink:#475569; }

.stat {
  background: var(--tone-bg, var(--surface));
  border-left: 4px solid var(--tone-line, transparent);
}

.stat .stat-value {
  color: var(--tone-ink, var(--ink-900));
}

.lifecycle-flow {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

.lifecycle-flow::-webkit-scrollbar {
  height: 6px;
}

.lifecycle-flow::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 999px;
}

.lc-flow-item {
  flex: 1 1 80px;
  min-width: 80px;
  display: block;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--tone-line, var(--line));
  border-radius: 10px;
  background: var(--tone-bg, #fff);
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}

a.lc-flow-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

a.lc-flow-item:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

.lc-flow-item-static {
  cursor: default;
}

.lc-flow-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--tone-ink, var(--ink-600));
  white-space: nowrap;
}

.lc-flow-value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--tone-ink, var(--ink-900));
  font-variant-numeric: tabular-nums;
}

.lc-flow-value small {
  margin-left: 3px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-400);
}

.lc-flow-arrow {
  position: relative;
  flex: 0 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-400);
}

.lc-flow-arrow::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 7px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: var(--line);
}

.lc-flow-arrow i {
  position: relative;
  padding-left: 2px;
  font-size: 13px;
  background: var(--surface);
}

@media (max-width: 720px) {
  .lc-flow-item { flex-basis: 88px; min-width: 88px; }
  .lc-flow-arrow { flex-basis: 20px; }
}

.stage-tone-issue            { --tone-bg:#F1F5F9; --tone-line:#475569; --tone-ink:#334155; }
.stage-tone-receive          { --tone-bg:#EEF2FF; --tone-line:#6366F1; --tone-ink:#4338CA; }
.stage-tone-evaluate         { --tone-bg:#F5F3FF; --tone-line:#8B5CF6; --tone-ink:#6D28D9; }
.stage-tone-produce          { --tone-bg:#ECFDF5; --tone-line:#10B981; --tone-ink:#047857; }
.stage-tone-deliver          { --tone-bg:#EEF2FF; --tone-line:#6366F1; --tone-ink:#4338CA; }
.stage-tone-customer_receive { --tone-bg:#ECFEFF; --tone-line:#06B6D4; --tone-ink:#0E7490; }
.stage-tone-adopt            { --tone-bg:#ECFEFF; --tone-line:#0891B2; --tone-ink:#155E75; }
.stage-tone-settle           { --tone-bg:#FFFBEB; --tone-line:#F59E0B; --tone-ink:#B45309; }
.stage-tone-settled          { --tone-bg:#ECFDF5; --tone-line:#047857; --tone-ink:#065F46; }

/* 生命周期组件按 8 大流程着色 */
.lc-stage-issue            { --stage-color:#475569; --stage-bg:#F1F5F9; --stage-track:#CBD5E1; }
.lc-stage-receive          { --stage-color:#6366F1; --stage-bg:#EEF2FF; --stage-track:#C7D2FE; }
.lc-stage-evaluate         { --stage-color:#8B5CF6; --stage-bg:#F5F3FF; --stage-track:#DDD6FE; }
.lc-stage-produce          { --stage-color:#10B981; --stage-bg:#ECFDF5; --stage-track:#A7F3D0; }
.lc-stage-deliver          { --stage-color:#6366F1; --stage-bg:#EEF2FF; --stage-track:#C7D2FE; }
.lc-stage-customer_receive { --stage-color:#06B6D4; --stage-bg:#ECFEFF; --stage-track:#A5F3FC; }
.lc-stage-adopt            { --stage-color:#0891B2; --stage-bg:#ECFEFF; --stage-track:#A5F3FC; }
.lc-stage-settle           { --stage-color:#F59E0B; --stage-bg:#FFFBEB; --stage-track:#FDE68A; }

.lc-step.done .lc-dot { background: var(--stage-color, #16a34a); color:#fff; }
.lc-step.current .lc-dot {
  background: var(--stage-color, var(--brand-600));
  color:#fff;
  box-shadow: 0 0 0 4px var(--stage-bg, var(--brand-50));
}
.lc-step.current .lc-label { color: var(--stage-color, var(--brand-700)); }
.lc-step.done .lc-track::before { background: var(--stage-track, #86efac); }
.lc-step.current .lc-track::before {
  background: linear-gradient(90deg, var(--stage-track, #86efac) 0 50%, #e8ecf3 50% 100%);
}

/* 任务列表阶段彩色标记 */
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--tone-bg, #F1F5F9);
  color: var(--tone-ink, #334155);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.stage-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tone-line, #475569);
  flex: none;
}

/* ---------- 预检规则 ---------- */
.wf-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.wf-rule-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--tone-line, #6366f1);
  border-radius: 10px;
  padding: 12px 14px;
}
.wf-rule-card h3 { font-size: 13px; margin: 0 0 6px; color: var(--ink-900); }
.wf-rule-card p { font-size: 11.5px; color: var(--ink-600); line-height: 1.8; margin: 0; }


/* ---------- 角色权限说明 ---------- */
.role-desc-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
@media (max-width: 1200px) { .role-desc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .role-desc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .role-desc-grid { grid-template-columns: 1fr; } }
.role-desc {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-500);
  border-radius: 8px;
  padding: 8px 10px;
}
.role-desc b { font-size: 11.5px; color: var(--ink-900); line-height: 1.35; }
.role-desc span { display: block; font-size: 10px; color: var(--ink-400); margin-top: 2px; }
.role-desc p { font-size: 10px; color: var(--ink-500); line-height: 1.5; margin: 3px 0 0; }
.role-desc-position { font-size: 10px; color: var(--ink-600); line-height: 1.45; margin-top: 3px; }
.role-desc-interface { font-size: 9.5px; color: var(--ink-400); line-height: 1.4; margin-top: 3px; }
.role-matrix-title { font-size: 13px; color: var(--ink-900); margin: 4px 0 8px; }
.role-matrix { width: 100%; border-collapse: collapse; font-size: 10.5px; margin-bottom: 18px; }
.role-matrix th, .role-matrix td { padding: 5px 4px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.role-matrix th:first-child, .role-matrix td:first-child { text-align: left; }
.role-matrix .yes { color: var(--brand-600); font-weight: 700; }
.th-sub { font-size: 9.5px; color: var(--ink-400); font-weight: 400; margin-top: 2px; }


.perm-all {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 400;
  color: var(--ink-400);
  cursor: pointer;
  white-space: nowrap;
}

/* 登录页演示说明 */
.demo-intro {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #eef2ff;
  color: var(--ink-600);
  font-size: 11px;
  line-height: 1.7;
}
.demo-intro b { color: var(--brand-700); }
.demo-intro a { color: var(--brand-700); font-weight: 600; text-decoration: none; }
.demo-intro a:hover { text-decoration: underline; }


/* ---------- 手机端任务委托下单 ---------- */
.req-add-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 767px) {
  .req-add-row { flex-direction: column; }
  .req-add-row .btn-ghost { width: 100%; }
  .req-table thead { display: none; }
  .req-table,
  .req-table tbody,
  .req-table tr,
  .req-table td { display: block; width: 100%; }
  .req-table tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fff;
  }
  .req-table td {
    border: none;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .req-table td::before {
    content: attr(data-label);
    flex: 0 0 78px;
    font-size: 11px;
    color: var(--ink-400);
  }
  .req-table td input { flex: 1; min-width: 0; }
  .req-table td[data-label="操作"] { justify-content: flex-end; }
  .req-table td[data-label="操作"]::before { display: none; }
}

/* =========================================================
   移动端响应式 2.0
   仅在 ≤991 / ≤767 生效，桌面端样式保持不变
   ========================================================= */
.mobile-only { display: none; }
.sidebar-close { display: none; margin-left: auto; }

@media (max-width: 991px) {
  .sidebar {
    height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sidebar-backdrop {
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-close {
    display: inline-flex;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .bottom-nav {
    display: none !important;
  }

  .content {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 767px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    overflow-wrap: anywhere;
  }

  .mobile-only { display: block; }

  .app-shell {
    min-height: 100dvh;
  }

  .content {
    padding: 14px 12px calc(88px + env(safe-area-inset-bottom));
  }

  .topbar {
    height: 52px;
    padding: 0 10px;
  }

  .breadcrumb {
    font-size: 12px;
  }

  .topbar-right {
    gap: 4px;
  }

  .page-head {
    gap: 10px;
    margin-bottom: 14px;
  }

  .page-title {
    font-size: 17px;
    line-height: 1.35;
  }

  .page-sub {
    font-size: 12px;
    line-height: 1.6;
  }

  .page-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .page-actions > * {
    min-width: 0;
  }

  .page-actions .btn-brand,
  .page-actions .btn-ghost,
  .page-actions .btn-danger-ghost {
    flex: 1 1 140px;
  }

  .btn-brand,
  .btn-ghost,
  .btn-danger-ghost {
    min-height: 42px;
    white-space: normal;
    text-align: center;
  }

  .btn-sm {
    min-height: 38px;
  }

  .btn-icon {
    width: 40px;
    height: 40px;
  }

  .card-head {
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 16px;
  }

  .card-body {
    padding: 16px;
  }

  .card-body-tight {
    padding: 12px;
    overflow: visible;
  }

  .card-foot {
    padding: 12px 16px;
  }

  .card-title {
    font-size: 14px;
  }

  .stack-gap > * + * {
    margin-top: 14px;
  }

  .two-col {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .main,
  .content,
  .two-col > *,
  .stack-gap,
  .stack-gap > *,
  .card-soft,
  .card-head,
  .card-body,
  .form-grid,
  .field {
    min-width: 0;
  }

  .req-table {
    min-width: 0 !important;
  }

  .form-grid,
  .form-grid.cols-2 {
    grid-template-columns: 1fr;
  }

  .form-panel {
    padding: 16px;
  }

  .field {
    margin-bottom: 14px;
  }

  .field > label {
    font-size: 12.5px;
  }

  .field-hint {
    font-size: 11.5px;
    line-height: 1.55;
  }

  /* iOS 微信/企微输入框小于 16px 会自动放大页面 */
  .input-soft,
  select.input-soft,
  textarea.input-soft,
  input[type="text"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  input[type="password"],
  input[type="file"],
  textarea {
    font-size: 16px !important;
  }

  .card-body .input-soft,
  .card-body select.input-soft,
  .card-body textarea.input-soft,
  .form-panel .input-soft {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none;
  }

  .inline-form {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .inline-form > * {
    flex: 1 1 100%;
    min-width: 0;
    width: 100% !important;
  }

  .inline-form > .btn-brand,
  .inline-form > .btn-ghost,
  .inline-form > .btn-danger-ghost {
    flex: 0 0 auto;
    width: 100% !important;
  }

  .card-body form.d-flex,
  .card-body .d-flex {
    flex-wrap: wrap;
  }

  .card-body form.d-flex > .input-soft,
  .card-body form.d-flex > select,
  .card-body form.d-flex > input {
    flex: 1 1 100%;
    width: 100% !important;
    min-width: 0;
  }

  .card-body form.d-flex > .btn-brand,
  .card-body form.d-flex > .btn-ghost,
  .card-body form.d-flex > .btn-danger-ghost {
    flex: 0 0 auto;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat {
    padding: 13px 14px;
  }

  .stat-value {
    font-size: 21px;
  }

  .stat-label,
  .stat-meta {
    font-size: 11px;
    line-height: 1.45;
  }

  .tabs {
    flex-wrap: wrap;
    gap: 2px 18px;
    overflow: visible;
    margin-bottom: 14px;
  }

  .tab {
    padding: 9px 0;
    font-size: 13px;
    white-space: normal;
  }

  .service-item,
  .ship-row,
  .metric-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .service-item > .btn-brand,
  .service-item > .btn-ghost,
  .service-item > .btn-danger-ghost,
  .ship-row > .btn-brand,
  .ship-row > .btn-ghost {
    flex: 0 0 auto;
  }

  .kv-grid,
  .kv-grid.cols-4 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .kv-value {
    font-size: 13.5px;
  }

  .timeline {
    padding-left: 16px;
  }

  /* 生命周期：手机端改纵向时间轴，不横向滚动 */
  .lifecycle-bar {
    flex-direction: column;
    gap: 0;
    overflow: visible;
    padding: 12px 16px;
  }

  .lc-step {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-areas:
      "track label"
      "track meta";
    width: 100%;
    min-width: 0;
    flex: none;
    padding: 7px 0;
  }

  .lc-label {
    grid-area: label;
    margin: 0 0 2px;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
  }

  .lc-track {
    grid-area: track;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 34px;
    height: auto;
    align-self: stretch;
  }

  .lc-track::before {
    top: 0;
    right: auto;
    bottom: 0;
    left: 50%;
    width: 2px;
    height: auto;
    transform: translateX(-50%);
    background: #e8ecf3;
  }

  .lc-step:first-child .lc-track::before {
    top: 13px;
  }

  .lc-step:last-child .lc-track::before {
    bottom: calc(100% - 13px);
  }

  .lc-step.done .lc-track::before {
    background: #86efac;
  }

  .lc-step.current .lc-track::before {
    background: linear-gradient(180deg, #86efac 0 50%, #e8ecf3 50% 100%);
  }

  .lc-dot {
    z-index: 1;
  }

  .lc-meta {
    grid-area: meta;
    max-width: none;
    margin: 2px 0 0;
    font-size: 11px;
    line-height: 1.45;
    text-align: left;
  }

  /* 宽表在手机端全部改为卡片，不横向滚动 */
  .table-responsive {
    overflow: visible;
  }

  .table-soft:not(.req-table),
  .role-matrix,
  .perm-table,
  .progress-dash table.task {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .table-soft:not(.req-table) thead,
  .role-matrix thead,
  .perm-table thead,
  .progress-dash table.task thead {
    display: none;
  }

  .table-soft:not(.req-table) tbody,
  .table-soft:not(.req-table) tr,
  .table-soft:not(.req-table) td,
  .role-matrix tbody,
  .role-matrix tr,
  .role-matrix td,
  .perm-table tbody,
  .perm-table tr,
  .perm-table td,
  .progress-dash table.task tbody,
  .progress-dash table.task tr,
  .progress-dash table.task td {
    display: block;
    width: 100%;
  }

  .table-soft:not(.req-table) tbody tr,
  .role-matrix tbody tr,
  .perm-table tbody tr,
  .progress-dash table.task tbody tr {
    margin-bottom: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  }

  .table-soft:not(.req-table) td,
  .role-matrix td,
  .perm-table td,
  .progress-dash table.task td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border: 0;
    font-size: 13.5px;
    text-align: right;
    vertical-align: top;
  }

  .table-soft:not(.req-table) td::before,
  .role-matrix td::before,
  .perm-table td::before,
  .progress-dash table.task td::before {
    content: attr(data-label);
    flex: 0 0 82px;
    color: var(--ink-400);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
    text-align: left;
  }

  .table-soft:not(.req-table) td:first-child,
  .role-matrix td:first-child,
  .perm-table td:first-child,
  .progress-dash table.task td:first-child {
    display: block;
    margin-bottom: 6px;
    padding: 0 0 8px;
    border-bottom: 1px dashed var(--line);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
  }

  .table-soft:not(.req-table) td:first-child::before,
  .role-matrix td:first-child::before,
  .perm-table td:first-child::before,
  .progress-dash table.task td:first-child::before {
    display: none;
  }

  .table-soft:not(.req-table) td[colspan],
  .role-matrix td[colspan],
  .perm-table td[colspan],
  .progress-dash table.task td[colspan] {
    display: block;
    padding: 10px 0;
    text-align: center;
  }

  .table-soft:not(.req-table) td[colspan]::before,
  .role-matrix td[colspan]::before,
  .perm-table td[colspan]::before,
  .progress-dash table.task td[colspan]::before {
    display: none;
  }

  .table-soft:not(.req-table) td:empty,
  .role-matrix td:empty,
  .perm-table td:empty {
    display: none;
  }

  .table-soft:not(.req-table) td > .input-soft,
  .table-soft:not(.req-table) td > select,
  .table-soft:not(.req-table) td > input,
  .perm-table td > .input-soft,
  .role-matrix td > .input-soft {
    flex: 1 1 auto;
    width: 100% !important;
    min-width: 0;
  }

  .table-soft:not(.req-table) td .d-flex,
  .table-soft:not(.req-table) td .table-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .table-soft:not(.req-table) td .btn-brand,
  .table-soft:not(.req-table) td .btn-ghost,
  .table-soft:not(.req-table) td .btn-danger-ghost {
    flex: 0 0 auto;
  }

  .lifecycle-flow {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding: 0;
  }

  .lc-flow-item {
    min-width: 0;
    flex: none;
    padding: 10px 12px;
  }

  .lc-flow-label {
    white-space: normal;
  }

  .lc-flow-arrow {
    display: none;
  }

  .pager-bar {
    align-items: flex-start;
  }

  .pager-links a {
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .req-add-row {
    flex-direction: column;
  }

  .req-add-row .btn-ghost {
    width: 100%;
  }

  .progress-dash .browser .bar {
    height: 34px;
    padding: 0 10px;
  }

  .progress-dash .browser .url {
    margin: 0 4px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .progress-dash .dash {
    padding: 12px;
  }

  .progress-dash .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .progress-dash .stat {
    padding: 12px;
  }

  .progress-dash .stat .v {
    font-size: 20px;
  }

  .progress-dash .dash-2col {
    grid-template-columns: 1fr;
  }

  .progress-dash .hbar {
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .progress-dash .hbar .n {
    min-width: 72px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .progress-dash .hbar .t {
    flex: 1 1 100%;
    order: 3;
  }

  .role-desc-grid {
    grid-template-columns: 1fr;
  }

  .role-matrix th,
  .role-matrix td,
  .perm-table th,
  .perm-table td {
    white-space: normal;
  }

  .perm-mobile-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
  }

  .perm-mobile-tools .check-chip {
    flex: 1 1 140px;
    justify-content: center;
  }

  .summary-actions,
  .report-actions {
    gap: 8px;
  }

  .report-actions .btn-brand,
  .report-actions .btn-ghost {
    flex: 1 1 140px;
  }
}

@media (max-width: 420px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .progress-dash .stat-row {
    grid-template-columns: 1fr !important;
  }

  .page-actions .btn-brand,
  .page-actions .btn-ghost,
  .page-actions .btn-danger-ghost {
    flex: 1 1 100%;
  }
}

/* ---------- 监管计划看板 ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.checklist li:last-child { border-bottom: 0; }
.checklist .ck {
  display: grid;
  place-items: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
  font-weight: 700;
}
.checklist b { display: block; font-size: 12.5px; color: var(--ink-900); line-height: 1.4; }
.checklist span { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-400); line-height: 1.6; }

/* ---------- 工作台功能入口 ---------- */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.entry-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.entry-card:hover {
  border-color: var(--brand-500);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  color: inherit;
}

.entry-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: #eef4ff;
  color: var(--brand-600);
  font-size: 18px;
}

.entry-body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.entry-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
}

.entry-desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-400);
}

.entry-count {
  flex: none;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--brand-600);
}

@media (max-width: 767px) {
  .entry-grid {
    grid-template-columns: 1fr;
  }
  .entry-card {
    padding: 14px;
  }
}

/* ---------- 监管视图：无侧边栏，内容直接铺满 ---------- */
.regulator-main {
  margin-left: 0;
}

@media (max-width: 991px) {
  .regulator-main {
    margin-left: 0;
  }
}
