/* PowerOps · 苹果风格界面 v3
   对齐 docs/UI设计/macos/app.css 的语义令牌体系：
   浅色、留白、克制、直接；真实后台固定浅色版本。
   规则：组件一律引用语义令牌，禁止再写死颜色。 */

:root {
  color-scheme: light;

  /* 背景与表面 */
  --bg: #f5f5f7;            /* 苹果标志性浅灰 */
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --surface-sink: #f5f5f7;
  --surface-sink2: #e8e8ed; /* 更深一档的凹陷面（按钮底/轨道） */

  /* 玻璃拟态（毛玻璃只用于侧栏/顶栏/卡片高光，内容区保持实底） */
  --glass-hi: rgba(255, 255, 255, 0.9);
  --glass-lo: rgba(255, 255, 255, 0.68);
  --glass-solid-hi: rgba(255, 255, 255, 0.96);
  --glass-solid-lo: rgba(255, 255, 255, 0.86);
  --glass-card: rgba(255, 255, 255, 0.72);
  --glass-overlay: rgba(255, 255, 255, 0.94);
  --hover-fill: rgba(0, 0, 0, 0.045);

  /* 文字 */
  --text: #1d1d1f;          /* 苹果近黑 */
  --text-soft: #424245;
  --muted: #57575a;         /* 次级灰，满足 WCAG AA 4.5:1 */
  --text-3: #a1a1a6;        /* 三级灰：占位/弱辅助 */
  --on-primary: #ffffff;
  --on-primary-dim: rgba(255, 255, 255, 0.85);

  /* 线条 */
  --line: #e3e3e6;
  --line-strong: #d2d2d7;

  /* 主色 */
  --primary: #0071e3;       /* 苹果蓝 */
  --primary-hover: #0077ed;
  --primary-press: #006edb;
  --primary-soft: rgba(0, 113, 227, 0.10);
  --primary-soft-strong: rgba(0, 113, 227, 0.16);
  --grad-primary: linear-gradient(160deg, #0a84ff, #0058c6);
  --focus: #0071e3;

  /* 语义色 */
  --danger: #d93025;
  --danger-soft: #fdecea;
  --danger-press: #c5271d;
  --danger-line: #f1c4bf;
  --success: #1d8a4e;
  --success-soft: #e7f5ec;
  --warn: #9a6700;
  --warn-soft: #fdf3d8;

  /* 页面级渐变（hero） */
  --page-hero-grad: linear-gradient(170deg, #f5f7fa 0%, #e9eef6 55%, #dde6f4 100%);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.12);

  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 980px;

  /* 动效（macOS 手感曲线） */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --fast: 140ms;
  --med: 200ms;

  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-hover);
}

h1,
h2,
h3 {
  letter-spacing: -0.02em;
  font-weight: 600;
}

button,
input,
select {
  font: inherit;
}

::placeholder {
  color: var(--text-3);
}

/* ---------- 表格 ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  background: transparent;
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: var(--surface-soft);
}

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

code {
  border: 0;
  border-radius: 6px;
  padding: 2px 6px;
  background: var(--surface-sink);
  color: var(--text-soft);
  font-size: 12px;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

/* ---------- 整体框架 ---------- */

.app-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 16px;
  /* macOS 侧栏质感：半透明毛玻璃 */
  background: var(--glass-card);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  margin-bottom: 26px;
}

.brand.large {
  margin-bottom: 32px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--grad-primary);
  color: var(--on-primary);
  font-weight: 700;
  font-size: 19px;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.32);
}

.brand strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 侧边导航 ---------- */

.sidebar-search {
  margin: 0 0 14px;
}

.sidebar-search input {
  width: 100%;
  height: 36px;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.nav-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  background: var(--danger);
  color: var(--on-primary);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.nav-link.active .nav-badge {
  background: var(--danger);
  color: var(--on-primary);
}

.sidebar nav {
  display: grid;
  gap: 4px;
}

.nav-group {
  display: grid;
  gap: 2px;
  margin-top: 14px;
}

.nav-group:first-child {
  margin-top: 0;
}

.nav-group-title {
  padding: 8px 12px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-link .nav-ic {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: var(--muted);
  transition: stroke 0.12s ease;
}

.nav-letter {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 7px;
  background: var(--surface-sink);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.nav-link .nav-label {
  flex: 1;
}

.nav-link:hover {
  background: var(--hover-fill);
  color: var(--text);
}

.nav-link:hover .nav-ic {
  stroke: var(--text);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.nav-link.active:hover {
  background: var(--primary-soft-strong);
  color: var(--primary);
}

.nav-link.active .nav-ic {
  stroke: var(--primary);
}

.nav-link.active .nav-letter {
  background: var(--primary);
  color: var(--on-primary);
}

/* ---------- 主区域 ---------- */

.main {
  min-width: 0;
  padding: 32px 40px 56px;
}

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

.topbar-title {
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.topbar-search {
  margin: 0;
}

.topbar-search input {
  width: 240px;
  max-width: 38vw;
  height: 36px;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface-sink);
  transition: background 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.topbar-search input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.user-chip {
  display: grid;
  justify-items: end;
  line-height: 1.3;
}

.user-chip span {
  font-weight: 600;
  font-size: 14px;
}

.user-chip small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.ghost-link {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s ease;
}

.ghost-link:hover {
  background: var(--surface-sink);
  color: var(--text);
}

/* ---------- 网格 ---------- */

.stats-grid,
.grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

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

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

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ---------- 卡片 / 面板 ---------- */

.panel,
.stat-card,
.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel {
  margin-bottom: 18px;
  padding: 24px;
  overflow-x: auto;
}

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

.panel-head h2,
.mobile-card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.panel-head a {
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}

.stat-card {
  display: grid;
  gap: 6px;
  padding: 22px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.stat-card strong {
  font-size: 34px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.stat-card small {
  color: var(--muted);
  font-size: 12px;
}

.stat-card.red strong { color: var(--danger); }
.stat-card.green strong { color: var(--success); }
.stat-card.yellow strong { color: var(--warn); }
.stat-card.primary strong { color: var(--primary); }

/* 角色首页 - 快捷操作大按钮 */
.role-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 22px;
  align-items: end;
  margin-bottom: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, var(--glass-hi), var(--glass-lo)),
    radial-gradient(640px 280px at 100% 0%, rgba(0,113,227,.12), transparent 62%);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.role-hero.boss {
  background:
    linear-gradient(135deg, var(--glass-hi), var(--glass-lo)),
    radial-gradient(620px 300px at 100% 0%, rgba(0,113,227,.16), transparent 64%);
}

.role-hero.admin {
  background:
    linear-gradient(135deg, var(--glass-hi), var(--glass-lo)),
    radial-gradient(620px 300px at 100% 0%, rgba(88,86,214,.14), transparent 64%);
}

.role-hero.finance {
  background:
    linear-gradient(135deg, var(--glass-hi), var(--glass-lo)),
    radial-gradient(620px 300px at 100% 0%, rgba(29,138,78,.15), transparent 64%);
}

.role-hero.project,
.role-hero.clerk {
  background:
    linear-gradient(135deg, var(--glass-hi), var(--glass-lo)),
    radial-gradient(620px 300px at 100% 0%, rgba(0,113,227,.12), transparent 64%);
}

.role-hero.employee {
  background:
    linear-gradient(135deg, var(--glass-hi), var(--glass-lo)),
    radial-gradient(620px 300px at 100% 0%, rgba(255,149,0,.14), transparent 64%);
}

.role-hero h2 {
  margin: 6px 0 8px;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 700;
}

.role-hero p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.role-hero.simple {
  grid-template-columns: 1fr;
  align-items: start;
  margin-bottom: 14px;
  padding: 22px 24px;
}

.role-hero.simple h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.role-hero.simple p {
  max-width: 680px;
  line-height: 1.55;
}

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

.role-hero-action {
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass-card);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}

.role-hero-action:hover {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.role-hero-action strong {
  font-size: 14px;
  font-weight: 600;
}

.role-hero-action small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.role-scope-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.role-scope-item {
  min-height: 82px;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.role-scope-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.role-scope-item strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
}

.role-business-entry {
  margin: -4px 0 18px;
}

.role-business-entry .pv-business-guide {
  margin: 0;
}

.role-business-entry .pv-business-head {
  display: none;
}

.role-business-entry .pv-business-card {
  min-height: 68px;
}

.role-action-panel {
  margin-top: 16px;
}

.role-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.role-action {
  display: grid;
  gap: 5px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.role-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.role-action strong { font-size: 16px; font-weight: 600; color: var(--text); }
.role-action small { color: var(--muted); font-size: 13px; }

.role-flowdesk {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.role-flowdesk-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.role-flowdesk-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
  letter-spacing: 0;
}

.role-flowdesk-head p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.role-flow-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.role-flow-map::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 18px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0,113,227,.18), rgba(0,113,227,.72), rgba(52,199,89,.48));
}

.role-flow-node {
  position: relative;
  z-index: 1;
  min-height: 120px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--glass-solid-hi), var(--glass-solid-lo));
}

.role-flow-dot {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 0 0 5px var(--surface);
}

.role-flow-node.warn .role-flow-dot { background: var(--danger); }
.role-flow-node.owner .role-flow-dot { background: var(--warn); color: #1d1d1f; }
.role-flow-node.done .role-flow-dot { background: var(--success); }
.role-flow-node strong { font-size: 14px; font-weight: 650; color: var(--text); }
.role-flow-node small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }

.role-boundary {
  margin-top: 18px;
}

.clean-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  list-style: none;
}

.clean-list li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--glass-card);
  color: var(--text);
  font-size: 14px;
}

.muted-panel {
  background:
    linear-gradient(180deg, rgba(142,142,147,.08), rgba(142,142,147,.03)),
    var(--surface);
}

.muted-panel .clean-list li {
  color: var(--muted);
}

.guide-panel {
  background:
    linear-gradient(180deg, var(--glass-solid-hi), var(--glass-solid-lo)),
    var(--surface);
}

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

.guide-step {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sink);
}

.guide-step b {
  font-size: 13px;
  color: var(--primary);
}

.guide-step span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 1080px) {
  .role-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .role-hero-actions,
  .role-scope-strip,
  .guide-steps,
  .role-flow-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-flowdesk-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .role-flowdesk-head p {
    max-width: none;
  }
}

@media (max-width: 680px) {
  .role-hero {
    padding: 20px;
  }

  .role-hero-actions,
  .role-scope-strip,
  .guide-steps,
  .role-flow-map {
    grid-template-columns: 1fr;
  }

  .role-flow-map::before {
    left: 28px;
    right: auto;
    top: 18px;
    bottom: 18px;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, rgba(0,113,227,.2), rgba(0,113,227,.72), rgba(52,199,89,.48));
  }

  .role-flow-node {
    min-height: auto;
    padding-left: 54px;
  }

  .role-flow-dot {
    position: absolute;
    left: 12px;
    top: 12px;
  }
}

/* 角色首页 - 折叠"全部业务入口" */
.collapsible {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.collapsible > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
}

.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible > summary::before { content: "▸"; margin-right: 8px; font-size: 12px; transition: transform 0.15s ease; display: inline-block; }
.collapsible[open] > summary::before { transform: rotate(90deg); }

.collapsible-body {
  padding: 8px 20px 20px;
  border-top: 1px solid var(--line);
}

.role-help .collapsible-body {
  display: grid;
  gap: 14px;
}

.role-help .panel,
.role-help .role-flowdesk {
  margin: 0;
  box-shadow: none;
}

/* ---------- 按钮 ---------- */

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 9px 20px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.13s ease, transform 0.08s ease, opacity 0.13s ease;
}

.button:hover,
button:hover {
  background: var(--primary-hover);
  color: var(--on-primary);
}

.button:active,
button:active {
  transform: scale(0.98);
}

.button.secondary {
  background: var(--surface-sink);
  color: var(--text);
}

.button.secondary:hover {
  background: var(--surface-sink2);
  color: var(--text);
}

.button.ghost {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--primary);
}

.button.ghost:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.button.small,
.inline-form button {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
}

button.danger,
.button.danger,
.danger {
  background: var(--danger);
  color: var(--on-primary);
}

button.danger:hover,
.button.danger:hover {
  background: var(--danger-press);
  color: var(--on-primary);
}

/* ---------- 徽标 ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: var(--radius-pill);
  padding: 3px 11px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.info {
  background: var(--surface-sink);
  color: var(--muted);
}

.badge.success {
  background: var(--success-soft);
  color: var(--success);
}

.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* 跳过导航链接：键盘聚焦时才显示 */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 18px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  z-index: 100;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  outline: 3px solid var(--primary-soft);
}

.pager {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.page-link:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.page-link.current {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.page-link.disabled {
  color: var(--muted);
  opacity: 0.45;
  pointer-events: none;
}

.pin-label {
  display: block;
  margin: 0 0 14px;
}

.pin-label span {
  display: block;
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
  margin-bottom: 6px;
}

/* 搜索结果列表 */
.search-list {
  display: grid;
  gap: 6px;
}

.search-result {
  display: grid;
  grid-template-columns: 1.4fr 2fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.search-result:hover {
  background: var(--surface-soft);
  border-color: var(--primary);
}

.search-result strong {
  font-size: 14px;
  font-weight: 600;
}

.search-result span {
  color: var(--muted);
  font-size: 13px;
}

.search-result em {
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

/* ---------- 表单 ---------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.form-grid label,
.compact-form label,
.mobile-upload label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
}

input,
select {
  min-width: 0;
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.13s ease, box-shadow 0.13s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

input[type="file"] {
  padding: 7px 12px;
  background: var(--surface-soft);
  cursor: pointer;
}

textarea {
  min-width: 0;
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.13s ease, box-shadow 0.13s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.file-field {
  grid-column: span 2;
}

.form-grid .button,
.form-grid button {
  height: 40px;
}

.compact-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.compact-form.stacked {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.checkbox input {
  width: auto;
  height: auto;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.inline-form input {
  min-width: 150px;
  height: 32px;
}

.review-form {
  display: grid;
  grid-template-columns: minmax(170px, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.review-form select {
  height: 34px;
}

.review-form select,
.review-form button {
  width: 100%;
}

/* ---------- 项目卡片 / 进度 ---------- */

.project-list,
.quick-actions {
  display: grid;
  gap: 12px;
}

.quick-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
  display: grid;
  gap: 9px;
  padding: 18px;
  color: var(--text);
  box-shadow: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.project-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.project-card small {
  color: var(--muted);
  font-size: 12px;
}

.project-card strong {
  font-size: 16px;
  font-weight: 600;
}

.progress {
  height: 7px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-sink2);
}

.progress i {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--success);
}

/* ---------- 时间线 ---------- */

.timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}

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

.timeline li strong {
  font-size: 14px;
  font-weight: 600;
}

.timeline small,
.timeline span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

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

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

.project-hero h2 {
  margin: 8px 0 8px;
  font-size: 26px;
  font-weight: 600;
}

.project-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.eyebrow {
  color: var(--primary);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.completion {
  min-width: 200px;
  display: grid;
  gap: 7px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface-sink);
}

.completion strong {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.completion span {
  color: var(--muted);
  font-size: 13px;
}

.contract-money {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.check-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--text-soft);
  font-size: 14px;
}

.check-list li {
  padding-left: 4px;
}

/* ---------- 登录页 ---------- */

.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 480px;
  min-height: 100vh;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
}

.login-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7vw;
  background: var(--page-hero-grad);
}

.login-hero .brand strong {
  color: var(--text);
}

.login-hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
}

.login-hero p {
  max-width: 560px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  background: var(--surface);
  border-left: 1px solid var(--line);
}

.login-panel h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
}

.login-panel p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.login-grid {
  display: grid;
  gap: 10px;
}

.login-card {
  display: grid;
  justify-items: start;
  justify-content: start;
  gap: 3px;
  min-height: 66px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 18px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.13s ease, background 0.13s ease, transform 0.08s ease;
}

.login-card:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--text);
}

.login-card:active {
  transform: scale(0.99);
}

.login-card strong {
  font-size: 15px;
  font-weight: 600;
}

.login-card span {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 提示 / 错误 ---------- */

.alert,
.danger-panel {
  border: 1px solid var(--danger-line);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 14px;
}

.danger-panel h2 {
  margin: 0 0 6px;
  color: var(--danger);
}

/* ---------- 企业微信员工端 ---------- */

.m-body {
  margin: 0;
  background: var(--surface-sink2);
  display: flex;
  justify-content: center;
}

.m-app {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.m-topbar {
  padding: 24px 20px 18px;
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

.m-eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.m-topbar h1 {
  margin: 9px 0 3px;
  font-size: 23px;
  font-weight: 600;
  color: var(--text);
}

.m-topbar p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.m-main {
  flex: 1;
  padding: 16px;
  display: grid;
  gap: 14px;
  align-content: start;
}

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

.m-card h2 {
  margin: 0 0 13px;
  font-size: 15px;
  font-weight: 600;
}

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

.m-card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.m-card-head a {
  color: var(--primary);
  font-size: 13px;
  font-weight: 650;
}

.m-next-card {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
  background: linear-gradient(180deg, #fff, var(--surface-soft));
}

.m-next-card h2 {
  margin-bottom: 14px;
  font-size: 20px;
  line-height: 1.25;
}

.m-next-grid {
  display: grid;
  gap: 8px;
}

.m-next-grid div {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.m-next-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.m-next-grid strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.m-alert {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.m-alert strong {
  font-size: 15px;
  font-weight: 700;
}

.m-alert span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.m-alert.success {
  border-color: color-mix(in srgb, var(--success) 24%, var(--line));
  background: var(--success-soft);
}

.m-alert.success strong {
  color: var(--success);
}

.m-alert.danger {
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.m-alert.danger strong {
  color: var(--danger);
}

.m-alert .button.small {
  width: fit-content;
  margin-top: 4px;
}

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

.m-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.m-kpi {
  display: grid;
  gap: 6px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  min-width: 0;
}

.m-kpi span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.m-kpi strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.m-kpi small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.m-today-list {
  display: grid;
  gap: 9px;
}

.m-today-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-soft);
}

.m-today-item strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.m-today-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.m-today-item.risk {
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.m-today-item.todo {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
  background: var(--primary-soft);
}

.m-mobile-rule p,
.m-form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.m-form-note {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.m-action {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
  color: var(--text);
  transition: background 0.12s ease;
}

.m-action:active {
  background: var(--surface-sink);
}

.m-action .m-ic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
}

.m-action strong {
  font-size: 14px;
  font-weight: 600;
}

.m-action small {
  color: var(--muted);
  font-size: 12px;
}

.m-scope {
  display: grid;
  gap: 12px;
}

.m-scope ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.65;
}

.m-scope .m-muted {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.m-upload {
  display: grid;
  gap: 10px;
}

.m-upload .button {
  width: 100%;
}

.m-form {
  display: grid;
  gap: 13px;
}

.m-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
}

.m-form .button {
  width: 100%;
  margin-top: 4px;
}

.m-status {
  display: block;
  border-radius: var(--radius);
  padding: 18px;
}

.m-status.todo {
  background: var(--primary);
  color: var(--on-primary);
}

.m-status.done {
  background: var(--success-soft);
}

.m-status-line {
  font-size: 16px;
  font-weight: 600;
}

.m-status.done .m-status-line {
  color: var(--success);
}

.m-status-sub {
  margin-top: 4px;
  font-size: 13px;
}

.m-status.todo .m-status-sub {
  color: var(--on-primary-dim);
}

.m-status.done .m-status-sub {
  color: var(--success);
}

.m-task {
  display: grid;
  gap: 6px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.m-task:first-child {
  padding-top: 0;
}

.m-task:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.m-task strong {
  font-size: 14px;
  font-weight: 600;
}

.m-task span {
  color: var(--muted);
  font-size: 12px;
}

.m-task-context {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-soft);
}

.m-task-context small {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.m-task-link {
  display: block;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  background: var(--surface-soft);
}

.m-task-form {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.m-task-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.m-task-btns button {
  width: 100%;
}

.m-item {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.m-item:first-child {
  padding-top: 0;
}

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

.m-item strong {
  font-size: 14px;
  font-weight: 600;
}

.m-item span {
  color: var(--muted);
  font-size: 12px;
}

.m-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 6px 0;
}

.m-link-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.m-link {
  display: grid;
  gap: 3px;
  align-content: center;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  text-align: center;
}

.m-link strong {
  font-size: 13px;
  font-weight: 600;
}

.m-link span {
  color: var(--muted);
  font-size: 11px;
}

.m-tabbar {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--glass-overlay);
  border-top: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(12px);
}

.m-tab {
  padding: 13px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.m-tab.active {
  color: var(--primary);
}

/* ---------- 文件预览 ---------- */

.preview-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-sink);
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: 72vh;
}

.watermark {
  position: absolute;
  right: 14px;
  bottom: 14px;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--on-primary);
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.watermark.inline {
  position: static;
  display: inline-block;
  margin-top: 12px;
  background: var(--surface-sink);
  color: var(--muted);
}

.text-preview {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface-sink);
  color: var(--text);
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  white-space: pre-wrap;
}

.empty-state {
  display: grid;
  gap: 12px;
  justify-items: start;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 32px;
  background: var(--surface-soft);
}

.empty-state h2 {
  margin: 0;
  font-size: 18px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

/* ---------- 表单分区 ---------- */

.form-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 14px;
}

.form-grid + .form-section-title {
  margin-top: 24px;
}

.form-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.review-list {
  margin-bottom: 8px;
}

.review-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

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

.review-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
}

.review-item select {
  width: 96px;
  flex-shrink: 0;
}

.review-remark {
  width: 220px;
  flex-shrink: 0;
}

.review-item-detailed {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

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

.review-item-detailed .review-text {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 10px;
}

.review-item-detailed .review-controls {
  display: grid;
  grid-template-columns: 110px 1fr 1.4fr;
  gap: 10px;
}

.matrix-list {
  margin-bottom: 8px;
}

.matrix-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: var(--surface-soft);
}

.matrix-item:last-child {
  margin-bottom: 0;
}

.matrix-item-text {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 10px;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}

.matrix-table th {
  background: var(--surface-sink);
  font-size: 12px;
  padding: 7px 8px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.matrix-table td {
  padding: 6px 5px;
  border-top: 1px solid var(--line);
}

.matrix-table tr:first-child td {
  border-top: 0;
}

.matrix-table td.matrix-dept {
  text-align: center;
  font-weight: 500;
  color: var(--text-soft);
  width: 80px;
  background: var(--surface-soft);
}

.matrix-table input,
.matrix-table select {
  height: 30px;
  padding: 4px 8px;
  font-size: 13px;
}

.matrix-table td:nth-child(2) {
  width: 100px;
}

.sig-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.line-items-wrap {
  overflow-x: auto;
  margin-bottom: 14px;
}

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

.line-items th {
  background: var(--surface-soft);
  font-size: 12px;
  padding: 9px 8px;
  text-align: center;
}

.line-items td {
  padding: 5px 4px;
  border-bottom: 1px solid var(--line);
}

.line-items td.row-no {
  width: 36px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.line-items input {
  height: 32px;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 7px;
}

.type-tabs {
  display: flex;
  gap: 6px;
  background: var(--surface-sink);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  width: fit-content;
}

.type-tab {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.type-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ---------- 阶段进度条 ---------- */

.stage-track {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stage-chip {
  flex: 1;
  min-width: 130px;
  display: grid;
  gap: 3px;
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  background: var(--surface-sink);
  text-decoration: none;
}

.stage-chip span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.stage-chip small {
  color: var(--muted);
  font-size: 12px;
}

.stage-chip.done {
  background: var(--success-soft);
}

.stage-chip.done span {
  color: var(--success);
}

.stage-chip.active {
  background: var(--primary-soft);
}

.stage-chip.active span {
  color: var(--primary);
}

.node-title-link {
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

.node-title-link:hover {
  color: var(--primary);
}

/* ---------- 业务流程卡片 ---------- */

.op-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
  gap: 12px;
}

.op-stage {
  margin-bottom: 22px;
}

.op-stage:last-child {
  margin-bottom: 0;
}

.op-stage-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}

.op-stage-badge {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--text);
  color: var(--on-primary);
  font-size: 13px;
  font-weight: 700;
}

.op-stage-head strong {
  font-size: 15px;
  font-weight: 600;
}

.op-card {
  display: grid;
  gap: 7px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-soft);
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease, background 0.15s ease;
}

.op-card:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.op-card-readonly {
  cursor: default;
}

.op-card-readonly:hover {
  background: var(--surface-soft);
  border-color: var(--line);
  transform: none;
  box-shadow: none;
}

.op-card strong {
  font-size: 15px;
  font-weight: 600;
}

.op-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.op-card .tag {
  justify-self: start;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
}

.op-card .op-letter {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.business-stage-hero {
  align-items: flex-start;
}

.business-stage-map {
  overflow: visible;
}

.business-map-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-soft);
}

.business-map-letter {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 20px;
  font-weight: 800;
}

.business-map-row strong {
  display: block;
  font-size: 17px;
  font-weight: 650;
}

.business-map-row p,
.business-map-row small {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
}

.process-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.process-control-card {
  display: grid;
  gap: 8px;
  min-height: 122px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--surface-soft);
}

.process-control-card strong {
  font-size: 15px;
  font-weight: 650;
}

.process-control-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .nav-group {
    margin-top: 6px;
  }

  .main {
    padding: 24px 20px 44px;
  }

  .stats-grid,
  .grid.two,
  .grid.three,
  .form-grid,
  .login-page {
    grid-template-columns: 1fr;
  }

  .file-field {
    grid-column: auto;
  }

  .login-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 700px) {
  .main {
    padding: 20px 16px 36px;
  }

  .topbar,
  .project-hero,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-form.stacked {
    grid-template-columns: 1fr;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .login-panel,
  .login-hero {
    padding: 32px 22px;
  }
}

/* ---------- 手机端浮动按钮 FAB ---------- */

.m-fab {
  position: fixed;
  bottom: 78px;
  right: 16px;
  z-index: 20;
}

.m-fab-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 30px;
  font-weight: 300;
  line-height: 56px;
  text-align: center;
  list-style: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.45);
  user-select: none;
  transition: transform 0.18s ease;
}

.m-fab-btn::-webkit-details-marker { display: none; }
.m-fab-btn::marker { content: ""; }

.m-fab[open] .m-fab-btn {
  transform: rotate(45deg);
  background: var(--danger);
  box-shadow: 0 8px 24px rgba(214, 58, 58, 0.45);
}

.m-fab-menu {
  position: absolute;
  bottom: 64px;
  right: 0;
  display: grid;
  gap: 10px;
  min-width: 168px;
  padding: 12px;
  background: var(--glass-overlay);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.m-fab-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

.m-fab-menu a:hover,
.m-fab-menu a:active {
  background: var(--surface-sink);
}

.m-fab-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-sink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* ---------- 表内章节锚点导航（1.1 投标评审等长表） ---------- */

.form-step-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px 0;
  padding: 12px 14px;
  background: var(--surface-sink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: sticky;
  top: 0;
  z-index: 5;
}

.form-step-nav a {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--line);
}

.form-step-nav a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 锚点定位时给标题留一点呼吸 */
.form-section-title[id] {
  scroll-margin-top: 80px;
}

/* ---------- 电子签名画板 ---------- */

.sig-block {
  margin: 12px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.sig-block-head {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}

.sig-pad-wrap {
  margin-top: 12px;
  padding: 12px;
  background: var(--surface-sink);
  border-radius: 10px;
}

.sig-pad-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.sig-pad-label small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.sig-pad {
  display: block;
  width: 100%;
  max-width: 380px;
  height: 120px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  cursor: crosshair;
  touch-action: none;
}

.sig-pad-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.ghost-btn {
  font-size: 12px;
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--text);
  cursor: pointer;
}

.ghost-btn:hover { border-color: var(--primary); color: var(--primary); }

.sig-pad-status {
  font-size: 12px;
  color: var(--muted);
}

.sig-pad-status.signed {
  color: var(--success);
  font-weight: 500;
}

/* 列表里电子签名缩略 */

.sig-cell {
  white-space: nowrap;
}

.sig-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-right: 6px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  vertical-align: middle;
}

.sig-chip img {
  width: 48px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.sig-chip span {
  font-size: 10px;
  color: var(--muted);
  line-height: 1;
}

.sig-chip:hover { border-color: var(--primary); }

/* 多人接力评审进度 chip */

.progress-chips {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

.progress-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--line);
}

.progress-chip.on {
  background: var(--success-soft);
  color: var(--success);
  border-color: var(--success-soft);
}

.progress-chip.off {
  background: var(--surface);
  color: var(--muted);
}

.dept-fill-form {
  margin-top: 16px;
  padding: 16px;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary-soft);
}

.sig-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ============================================================
   PV · 项目流程 / 阶段详情 网页版（pv- 前缀，独立命名，不影响其它页面）
   ============================================================ */
/* pv 命名空间并轨全局浅色语义令牌（v3） */
.pv{--pv-primary:var(--primary);--pv-primary-soft:var(--primary-soft);--pv-primary-press:var(--primary-press);
  --pv-ok:var(--success);--pv-ok-soft:var(--success-soft);--pv-warn:var(--warn);--pv-warn-soft:var(--warn-soft);
  --pv-danger:var(--danger);--pv-danger-soft:var(--danger-soft);--pv-text:var(--text);--pv-text2:var(--muted);--pv-text3:var(--text-3);
  --pv-border:var(--line);--pv-line:var(--line);--pv-surface:var(--surface);--pv-r:12px;--pv-shadow:var(--shadow-sm);
  color:var(--pv-text);font-size:14px;line-height:1.5}
.pv a{color:inherit;text-decoration:none}
.pv-head{margin-bottom:16px}
.pv-eyebrow{font-size:12px;font-weight:600;letter-spacing:.04em;color:var(--pv-text3);text-transform:uppercase}
.pv-head h1{font-size:24px;font-weight:700;letter-spacing:-.01em;margin:5px 0 0;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.pv-head .pv-sub{font-size:13.5px;color:var(--pv-text2);margin-top:6px}
.pv-card{background:var(--pv-surface);border:1px solid var(--pv-border);border-radius:var(--pv-r);box-shadow:var(--pv-shadow)}
.pv-sec{font-size:12.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--pv-text3);margin:22px 2px 9px}
.pv-business-guide{display:grid;gap:12px;margin:14px 0 4px}
.pv-business-head{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.pv-business-head strong{font-size:15px;font-weight:700}
.pv-business-head small{color:var(--pv-text2);font-size:12px}
.pv-business-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.pv-business-card{display:grid;grid-template-columns:36px minmax(0,1fr);grid-template-rows:auto auto;column-gap:10px;align-items:center;border:1px solid var(--pv-border);border-radius:var(--pv-r);padding:12px;background:var(--pv-surface);box-shadow:var(--pv-shadow);color:var(--pv-text)}
.pv-business-card:hover{border-color:var(--pv-primary);background:var(--pv-primary-soft)}
.pv-business-card.active{border-color:var(--pv-primary);box-shadow:0 0 0 3px var(--pv-primary-soft)}
.pv-business-letter{grid-row:1/3;display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:var(--pv-primary-soft);color:var(--pv-primary);font-size:15px;font-weight:800}
.pv-business-card.active .pv-business-letter{background:var(--pv-primary);color:#fff}
.pv-business-card strong{font-size:13.5px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pv-business-card small{font-size:11.5px;color:var(--pv-text2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* pills */
.pv-pill{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 9px;border-radius:7px;font-size:11.5px;font-weight:600;white-space:nowrap;vertical-align:middle}
.pv-pill.primary{background:var(--pv-primary-soft);color:var(--pv-primary)}
.pv-pill.ok{background:var(--pv-ok-soft);color:var(--pv-ok)}
.pv-pill.danger{background:var(--pv-danger-soft);color:var(--pv-danger)}
.pv-pill.warn{background:var(--pv-warn-soft);color:var(--pv-warn)}
.pv-pill.mute{background:#eef1f5;color:var(--pv-text2)}
/* buttons */
.pv-btn{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 13px;border-radius:8px;background:var(--pv-primary);color:#fff;font-size:12.5px;font-weight:600;border:none;cursor:pointer}
.pv-btn:hover{background:var(--pv-primary-press)}
.pv-btn.ghost{background:#f1f3f6;color:var(--pv-text)}
.pv-btn.ghost:hover{background:var(--hover-fill)}
.pv-btn.sm{height:27px;padding:0 10px;font-size:12px}
/* stepper */
.pv-stepper-card{padding:18px 22px 22px}
.pv-stepper-cap{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;flex-wrap:wrap;gap:8px}
.pv-cap-now{font-size:13px;color:var(--pv-text2)}
.pv-cap-now b{color:var(--pv-text);font-weight:600}
.pv-stepper{position:relative;display:flex;justify-content:space-between;gap:4px}
.pv-stepper-line{position:absolute;left:16px;right:16px;top:16px;height:3px;background:var(--surface-sink2);border-radius:99px;overflow:hidden}
.pv-stepper-line i{display:block;height:100%;background:linear-gradient(90deg,var(--pv-ok),var(--pv-primary))}
.pv-step{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:8px;flex:1;background:none;border:none;cursor:pointer;text-align:center;min-width:0}
.pv-step-dot{position:relative;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;font-size:13px;font-weight:700;background:var(--pv-surface);border:2px solid #d7dce4;color:var(--pv-text3);transition:all .2s}
.pv-step.done .pv-step-dot{background:var(--pv-ok);border-color:var(--pv-ok);color:#fff}
.pv-step.overdue .pv-step-dot{background:var(--pv-danger);border-color:var(--pv-danger);color:#fff}
.pv-step.now .pv-step-dot{background:var(--pv-primary);border-color:var(--pv-primary);color:#fff;transform:scale(1.12);box-shadow:0 4px 12px rgba(37,99,235,.3)}
.pv-step:hover .pv-step-dot{border-color:var(--pv-primary)}
.pv-step.sel .pv-step-dot{box-shadow:0 0 0 4px var(--pv-primary-soft);border-color:var(--pv-primary)}
.pv-step-name{font-size:12px;color:var(--pv-text2);max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pv-step.now .pv-step-name,.pv-step.sel .pv-step-name{color:var(--pv-primary);font-weight:600}
.pv-step-tag{font-size:10.5px;font-weight:600;color:var(--pv-text3)}
.pv-step.done .pv-step-tag{color:var(--pv-ok)}.pv-step.overdue .pv-step-tag{color:var(--pv-danger)}.pv-step.now .pv-step-tag,.pv-step.sel .pv-step-tag{color:var(--pv-primary)}
/* compliance */
.pv-compliance{display:flex;align-items:center;gap:18px;padding:16px 20px;margin-top:14px;flex-wrap:wrap}
.pv-compliance .pv-c-main{flex:1;min-width:180px}
.pv-compliance .pv-c-main b{font-size:13px;font-weight:600}
.pv-progress{height:7px;border-radius:4px;background:var(--surface-sink2);overflow:hidden;margin-top:9px}
.pv-progress i{display:block;height:100%;background:var(--pv-ok);border-radius:4px}
.pv-c-score{text-align:center}
.pv-c-score b{font-size:22px;font-weight:700;color:var(--pv-ok)}
.pv-c-score.low b{color:var(--pv-danger)}
.pv-c-score small{display:block;font-size:11.5px;color:var(--pv-text2)}
/* tabs */
.pv-tabs{display:flex;gap:4px;border-bottom:1px solid var(--pv-border);margin:22px 0 4px;overflow-x:auto}
.pv-tabs a{padding:9px 13px;font-size:13.5px;color:var(--pv-text2);border-bottom:2px solid transparent;white-space:nowrap}
.pv-tabs a:hover{color:var(--pv-text)}
.pv-tabs a.active{color:var(--pv-primary);border-bottom-color:var(--pv-primary);font-weight:600}
/* stage head */
.pv-stage-head{display:flex;align-items:center;gap:13px;padding:14px 18px;margin-top:14px}
.pv-stage-ic{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;flex-shrink:0;background:#eef1f5;color:var(--pv-text2);font-weight:700}
.pv-stage-ic.done{background:var(--pv-ok-soft);color:var(--pv-ok)}.pv-stage-ic.now{background:var(--pv-primary-soft);color:var(--pv-primary)}.pv-stage-ic.overdue{background:var(--pv-danger-soft);color:var(--pv-danger)}
.pv-stage-h-tx{flex:1}.pv-stage-h-tx b{font-size:15px;font-weight:600;display:block}.pv-stage-h-tx small{font-size:12px;color:var(--pv-text2)}
/* list */
.pv-list .pv-item{display:flex;align-items:center;gap:12px;padding:13px 18px;border-top:1px solid var(--pv-line)}
.pv-list .pv-item:first-child{border-top:none}
.pv-item-ic{width:34px;height:34px;border-radius:9px;background:#f1f3f6;color:var(--pv-text2);display:grid;place-items:center;flex-shrink:0;font-weight:700;font-size:13px}
.pv-item-ic.ok{background:var(--pv-ok-soft);color:var(--pv-ok)}.pv-item-ic.danger{background:var(--pv-danger-soft);color:var(--pv-danger)}
.pv-item-tx{flex:1;min-width:0}
.pv-item-tx b{font-size:13.5px;font-weight:500;display:block}
.pv-item-tx b.dim{color:var(--pv-text3)}
.pv-item-tx small{font-size:12px;color:var(--pv-text2)}
.pv-item-act{display:flex;gap:7px;flex-shrink:0;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.pv-item-act .inline-form{display:inline-flex;gap:5px;align-items:center}
.pv-item-act select{height:27px;border:1px solid var(--pv-border);border-radius:7px;font-size:12px;padding:0 6px;background:#fff;color:var(--pv-text)}
/* timeline */
.pv-tl-card{padding:18px 20px}
.pv-timeline{list-style:none;margin:0;padding:0}
.pv-timeline li{position:relative;display:flex;align-items:flex-start;gap:11px;padding-bottom:17px}
.pv-timeline li::before{content:'';position:absolute;left:5px;top:16px;bottom:-1px;width:2px;background:var(--pv-line)}
.pv-timeline li:last-child{padding-bottom:0}
.pv-timeline li:last-child::before{display:none}
.pv-tl-dot{width:12px;height:12px;border-radius:50%;background:#fff;border:2px solid var(--pv-primary);margin-top:3px;flex-shrink:0;z-index:1}
.pv-tl-dot.sys{border-color:var(--pv-warn)}
.pv-tl-tx{flex:1}.pv-tl-tx b{font-size:13.5px;font-weight:500}.pv-tl-tx small{display:block;font-size:11.5px;color:var(--pv-text3);margin-top:1px}
.pv-ava{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;color:var(--on-primary);font-size:11px;font-weight:600;flex-shrink:0;background:var(--muted)}
.pv-empty{text-align:center;padding:30px 20px;color:var(--pv-text3);font-size:13.5px}
.pv-pad0{padding:0}
.pv-table{width:100%;border-collapse:collapse}
.pv-table th{text-align:left;font-size:11.5px;font-weight:600;color:var(--pv-text3);text-transform:uppercase;letter-spacing:.03em;padding:11px 18px;border-bottom:1px solid var(--pv-line)}
.pv-table td{padding:12px 18px;border-top:1px solid var(--pv-line);font-size:13px}
.pv-table tr:first-child td{border-top:none}
.pv-nav-back{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--pv-primary);margin-bottom:14px}
@media(max-width:860px){.pv-business-grid{grid-template-columns:1fr 1fr}}
@media(max-width:680px){.pv-step-name,.pv-step-tag{display:none}.pv-business-grid{grid-template-columns:1fr}.pv-business-card strong,.pv-business-card small{white-space:normal}}

/* pv 工作台 KPI 卡片 + 两栏 */
.pv-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:4px}
.pv-kpi{background:var(--pv-surface);border:1px solid var(--pv-border);border-radius:var(--pv-r);box-shadow:var(--pv-shadow);padding:14px 16px}
.pv-kpi-lab{font-size:12.5px;color:var(--pv-text2);display:flex;align-items:center;gap:6px}
.pv-kpi-dot{width:7px;height:7px;border-radius:50%;background:var(--pv-text3)}
.pv-kpi-dot.r{background:var(--pv-danger)}.pv-kpi-dot.g{background:var(--pv-ok)}.pv-kpi-dot.b{background:var(--pv-primary)}.pv-kpi-dot.y{background:var(--pv-warn)}
.pv-kpi-num{font-size:27px;font-weight:700;letter-spacing:-.02em;margin-top:6px}
.pv-kpi-num.r{color:var(--pv-danger)}.pv-kpi-num.g{color:var(--pv-ok)}.pv-kpi-num.b{color:var(--pv-primary)}.pv-kpi-num.y{color:var(--pv-warn)}
.pv-kpi-note{font-size:11.5px;color:var(--pv-text3);margin-top:2px}
.pv-grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}
@media(max-width:760px){.pv-kpis{grid-template-columns:1fr 1fr}.pv-grid2{grid-template-columns:1fr}}

/* 让 pv- 组件在 .pv 容器外也能用（stat_card 等共享组件）：把设计令牌挂到 :root */
:root{
  --pv-primary:#2563eb;--pv-primary-soft:#eef4ff;--pv-primary-press:#1d4ed8;
  --pv-ok:#15a05a;--pv-ok-soft:#e8f6ee;--pv-warn:#b7791f;--pv-warn-soft:#fbf3e1;
  --pv-danger:#e0342b;--pv-danger-soft:#fdecea;--pv-text:#1a2230;--pv-text2:#5b6676;--pv-text3:#9aa3b2;
  --pv-border:#e7eaef;--pv-line:#eef1f5;--pv-surface:#fff;--pv-r:12px;
  --pv-shadow:0 1px 2px rgba(16,24,40,.04),0 1px 3px rgba(16,24,40,.06);
}
/* 长文本型 KPI（如项目名、状态文案）不溢出 */
.pv-kpi-num{overflow-wrap:anywhere}
.stats-grid .pv-kpi,.grid .pv-kpi{margin:0}

/* ============================================================
   v3 新增组件（2026-06-11）：分页器 / 作废 / 状态条 / 利润卡 / 提示条
   ============================================================ */

/* ---------- 通用分页器（数据可见性修复配套） ---------- */
.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13px;
  text-decoration: none;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

a.page-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.page-link.current {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

.page-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.page-summary {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- 单据作废 ---------- */
.voided-row td {
  opacity: 0.55;
}

.voided-row td:first-child {
  text-decoration: line-through;
  text-decoration-color: var(--danger);
  text-decoration-thickness: 1.5px;
}

.void-form {
  display: inline-block;
}

.void-form .button {
  color: var(--danger);
  border-color: var(--danger-line);
}

.void-form .button:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

/* ---------- 项目状态条（项目详情顶部） ---------- */
.pv-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 13.5px;
}

.pv-status-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pv-status-form select {
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  padding: 0 8px;
  font-size: 13px;
}

/* ---------- 成本与利润卡 ---------- */
.pv-profit {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--text-soft);
}

.pv-profit strong.pv-pill {
  font-size: 14px;
  padding: 4px 12px;
}

.pv-profit small {
  flex-basis: 100%;
  color: var(--text-3);
}

/* ---------- 警示条（安责险缺失等） ---------- */
.pv-warnbar {
  padding: 11px 14px;
  margin-bottom: 10px;
  font-size: 13.5px;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn-soft);
  border-left: 3px solid var(--warn);
}

.panel.callout.warn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 4px solid var(--warn);
  background: var(--warn-soft);
}

.panel.callout.warn strong { color: var(--warn); }
.panel.callout.warn span { color: var(--text-soft); font-size: 13.5px; }

/* ---------- 行内「标记已付」微表单（合同详情付款节点） ---------- */
.inline-mark-paid {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.inline-mark-paid input[type="date"] {
  height: 30px;
  padding: 0 6px;
  font-size: 12.5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

tr.row-paid td {
  background: color-mix(in srgb, var(--success-soft) 45%, transparent);
}

/* ---------- v3 全局质感细节 ---------- */

/* 键盘可达性：统一的 macOS 风格聚焦环 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 安静的 macOS 滚动条 */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.4);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(128, 128, 128, 0.6); }
::-webkit-scrollbar-track { background: transparent; }

/* 文本选区用主色弱底 */
::selection { background: var(--primary-soft-strong); }

/* 减少动效偏好：尊重系统设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
