:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;

  /* Airbnb DESIGN.md 色板：纯白画布 + 柔和灰面 + 温暖炭墨 + 标志珊瑚红 */
  --mist-blue: #dddddd;
  --mist-lavender: #ebebeb;
  --mist-mint: #e8f5ec;
  --mist-slate: #f7f7f7;

  --brand: #ff385c;
  --brand-strong: #e00b41;
  --brand-soft: rgba(255, 56, 92, 0.08);
  --accent: #ff385c;
  --accent-soft: rgba(255, 56, 92, 0.08);

  --sidebar-bg: #ffffff;
  --sidebar-hover: #f7f7f7;
  --sidebar-active: rgba(255, 56, 92, 0.08);
  --sidebar-text: #484848;
  --sidebar-muted: #717171;
  --sidebar-online: #008a05;

  --surface-page: #ffffff;
  --surface-card: #ffffff;
  --surface-solid: #ffffff;
  --surface-subtle: #f7f7f7;
  --surface-hover: #f7f7f7;
  --surface-head: #f7f7f7;

  --text-primary: #222222;
  --text-secondary: #484848;
  --text-muted: #717171;

  --border-default: #dddddd;
  --border-subtle: #ebebeb;
  --border-emphasis: #b0b0b0;

  --status-success: #007a4d;
  --status-success-soft: #eef8f2;
  --status-success-border: #bfe3ce;
  --status-warning: #8f5600;
  --status-warning-soft: #fef7e8;
  --status-warning-border: #f3d78a;
  --status-info: #484848;
  --status-info-soft: #f7f7f7;
  --status-info-border: #dddddd;
  --status-muted: #666666;
  --status-muted-soft: #f7f7f7;
  --status-muted-border: #e5e5e5;

  --shadow-card: none;
  --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.08);
  --radius-lg: 14px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--surface-page);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

/* 整体骨架：桌面端左右分栏独立滚动 */
.app-shell {
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}

/* 左侧纯白扁平导航栏 */
.sidebar {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 20px 14px 18px;
  border-right: 1px solid var(--border-default);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand);
  color: #ffffff;
  flex-shrink: 0;
}

.brand-mark svg { width: 18px; height: 18px; }

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

.brand-text span {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.nav-label {
  margin: 14px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--sidebar-muted);
  text-transform: uppercase;
}

.nav-label:first-of-type { margin-top: 6px; }

#navigation {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--sidebar-text);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--brand-strong);
  font-weight: 600;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item.active .nav-icon { opacity: 1; }
.nav-icon svg { width: 17px; height: 17px; }

.sidebar-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 14px 10px 2px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
}

.sidebar-note strong {
  display: block;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12.5px;
}

.sidebar-note span { font-size: 11.5px; }

.note-dot {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--sidebar-online);
  box-shadow: 0 0 0 3px rgba(216, 248, 231, 0.9);
  flex-shrink: 0;
}

/* 右侧主区域（顶部栏固定，内容区独立垂直滚动） */
.main {
  min-width: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex: 0 0 auto;
  position: relative;
  z-index: 20;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 26px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-crumb {
  display: flex;
  align-items: center;
  min-width: 0;
  font-size: 13.5px;
}

.topbar-label, .topbar-separator { color: var(--text-muted); flex-shrink: 0; }
.topbar-separator { padding: 0 8px; opacity: 0.6; }
.topbar strong {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-right {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  flex-shrink: 0;
}

.topbar-period {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-period-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.topbar-period-ctrl {
  display: inline-flex;
  align-items: center;
  height: 34px;
  background: var(--surface-solid);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 0 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 3px 10px rgba(0, 0, 0, 0.04);
}

.topbar-period-ctrl input[type="month"] {
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 0 4px;
  height: 28px;
  font-variant-numeric: tabular-nums;
}

.topbar-period-ctrl input[type="month"]:focus-visible {
  outline: none;
}

.period-step-btn {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}

.period-step-btn:hover {
  background: var(--surface-subtle);
  color: var(--text-primary);
}

.period-today-btn {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.period-today-btn:hover {
  border-color: var(--border-emphasis);
  color: var(--text-primary);
}

.period-today-btn.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: var(--status-info-border);
  font-weight: 600;
}

@media (max-width: 720px) {
  .topbar-period-label, .period-today-btn { display: none; }
}

.demo-tag {
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--status-info);
  background: var(--status-info-soft);
  border: 1px solid var(--status-info-border);
  font-weight: 500;
  white-space: nowrap;
}

.version {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* 页面内容容器（独立滚动，滚动条位于最右侧） */
.page {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 22px max(26px, calc((100% - 1428px) / 2)) 48px;
}

.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-title-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-back-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-default);
  border-radius: 9px;
  background: var(--surface-solid);
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.page-back-btn:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.page-back-btn svg { width: 16px; height: 16px; }

h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(19px, 2vw, 22px); font-weight: 600; color: var(--text-primary); letter-spacing: -0.015em; }
h2 { font-size: 15px; font-weight: 600; color: var(--text-primary); }
h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); }

.subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
}

.page-actions input, .page-actions select {
  height: 34px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface-solid);
  color: var(--text-primary);
  font-size: 13px;
}

.period {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12.5px;
  padding: 6px 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 8px;
}

/* 视角与周期切换胶囊 */
.role-tabs {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 3px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  gap: 2px;
}

.role-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.role-tab:hover { color: var(--text-primary); }
.role-tab.active {
  background: var(--surface-solid);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

.overview-account {
  border: 1px solid var(--border-default);
  border-radius: 7px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
}

.overview-account:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* KPI 指标卡 */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric, .panel {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-lg);
}

.metric {
  position: relative;
  padding: 16px 18px;
  min-width: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.metric:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-label {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
}

.metric-symbol {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-subtle);
  color: var(--text-primary);
  flex-shrink: 0;
}

.metric-symbol svg { width: 16px; height: 16px; }
.metric-symbol.accent { background: var(--brand-soft); color: var(--brand); }

.metric-value {
  display: block;
  margin: 8px 0 4px;
  color: var(--text-primary);
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.25;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-note {
  color: var(--text-muted);
  font-size: 12px;
}

/* 面板与双栏 */
.panel {
  padding: 18px 20px;
  min-width: 0;
}

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

.panel-hint {
  color: var(--text-muted);
  font-size: 12px;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

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

/* 交互按钮与链接 */
.link-button, .text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  text-align: left;
  transition: color 0.15s ease;
}

.link-button { font-weight: 600; font-size: 14px; }
.text-button { font-size: 13px; font-weight: 500; white-space: nowrap; }
.link-button:hover, .text-button:hover { color: var(--brand-strong); text-decoration: underline; }

/* 表格 */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

th, td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-head);
  white-space: nowrap;
}

td { white-space: nowrap; }
td:first-child { white-space: normal; min-width: 130px; }

tbody tr { transition: background-color 0.12s ease; }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }

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

.amount {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 状态徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--status-info-soft);
  color: var(--status-info);
  border: 1px solid var(--status-info-border);
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

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

.badge.amber {
  color: var(--status-warning);
  background: var(--status-warning-soft);
  border-color: var(--status-warning-border);
}

.badge.muted {
  color: var(--status-muted);
  background: var(--status-muted-soft);
  border-color: var(--status-muted-border);
}

/* 列表行与进度条 */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  border-top: 1px solid var(--border-subtle);
  transition: background-color 0.12s ease;
}

.list-row:first-of-type { border-top: 0; }
.list-row:hover { background: var(--surface-hover); }

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

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-subtle);
  margin-top: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
  transition: width 0.3s ease;
}

/* 工具栏 */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 100%;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.toolbar input, .toolbar select {
  height: 34px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text-primary);
  background: var(--surface-solid);
  font-size: 13px;
}

.toolbar input {
  width: 240px;
  max-width: 100%;
  padding-left: 34px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.toolbar input:hover, .toolbar select:hover { border-color: var(--border-emphasis); }

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 12px;
}

/* 返回按钮与详情页 */
.back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 14px;
  padding: 5px 10px 5px 6px;
  border-radius: 8px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
}

.back:hover {
  border-color: var(--border-emphasis);
  color: var(--text-primary);
  text-decoration: none;
}

.back svg { width: 15px; height: 15px; }

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 14px;
}

.field-label {
  color: var(--text-muted);
  font-size: 12px;
}

.field-value {
  display: block;
  margin-top: 4px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* 节点进度条（带连接线） */
.timeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  padding: 8px 0 4px;
}

.step {
  position: relative;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 15px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 2px;
  background: var(--border-default);
}

.step.done:not(:last-child)::after {
  background: var(--status-success-border);
}

.step-circle {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-default);
}

.step.done { color: var(--text-primary); }
.step.done .step-circle {
  background: var(--status-success-soft);
  color: var(--status-success);
  border-color: var(--status-success-border);
}

.step.current {
  color: var(--brand-strong);
  font-weight: 600;
}

.step.current .step-circle {
  background: var(--brand);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(255, 56, 92, 0.16);
}

/* 人员/公司/部门卡片 */
.person-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.person-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  padding: 16px 18px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.person-card:hover {
  border-color: var(--mist-blue);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.person-name {
  display: block;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}

.person-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12.5px;
}

.person-extra svg { width: 14px; height: 14px; opacity: 0.6; }

.footnote {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 12px;
}

.snapshot-note {
  padding: 13px 16px;
  margin-top: 16px;
  border: 1px solid var(--status-info-border);
  border-radius: var(--radius-md);
  background: var(--status-info-soft);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.7;
}

.snapshot-note strong { color: var(--text-primary); }
.pagination { margin-top: 12px; }
.toolbar button:disabled { opacity: 0.5; cursor: default; }
.panel-hint { text-align: right; }

/* 档案与片子录入 */
.primary-button, .secondary-button {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 15px;
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-button {
  background: var(--brand);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--brand-strong);
  box-shadow: 0 4px 12px rgba(255, 56, 92, 0.22);
}

.primary-button:disabled { opacity: .6; cursor: wait; }

.secondary-button {
  background: var(--surface-solid);
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.secondary-button:hover {
  border-color: var(--border-emphasis);
  color: var(--text-primary);
}

.entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; align-items: start; }
.form-section-card {
  padding: 16px 18px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  margin-bottom: 14px;
}
.form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.form-section-title h3 { font-size: 14px; font-weight: 600; }
.form-section-title p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.form-span-2 { grid-column: span 2; }
.form-span-3 { grid-column: 1 / -1; }
.form-field { display: grid; gap: 6px; color: var(--text-secondary); font-size: 13px; font-weight: 500; min-width: 0; }
.form-field input, .form-field select { width: 100%; height: 38px; border: 1px solid var(--border-emphasis); border-radius: 8px; background: var(--surface-solid); color: var(--text-primary); padding: 0 11px; font-size: 13.5px; }
.form-field input:disabled, .form-field select:disabled { background: #e9edf3; border-color: #d8dde6; color: #727b8b; cursor: not-allowed; opacity: 1; -webkit-text-fill-color: #727b8b; }
.form-field select { text-overflow: ellipsis; }

/* 统一单选与可搜索下拉控件（参考财域交互，沿用 Serene Mist 色板） */
.choice-select-native,
.searchable-select-native {
  display: none !important;
}

.choice-select-control,
.searchable-select-control {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.toolbar .choice-select-control,
.toolbar .searchable-select-control {
  width: auto;
  min-width: 138px;
}

.page-actions .choice-select-control,
.home-default-wrap .choice-select-control {
  width: auto;
  min-width: 112px;
}

.choice-select-trigger,
.searchable-select-input {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--border-emphasis);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.35;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.toolbar .choice-select-trigger,
.toolbar .searchable-select-input,
.page-actions .choice-select-trigger,
.home-default-wrap .choice-select-trigger {
  height: 34px;
  border-color: var(--border-default);
  font-size: 13px;
}

.choice-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 32px 0 11px;
  text-align: left;
}

.choice-select-label {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-select-caret {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  opacity: 0.68;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.15s ease;
}

.choice-select-trigger[aria-expanded="true"] .choice-select-caret {
  transform: translateY(-50%) rotate(180deg);
}

.searchable-select-input {
  padding: 0 34px 0 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23727b99' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
}

.searchable-select-input:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='7' cy='7' r='4.5' stroke='%23ff385c' stroke-width='1.6'/%3E%3Cpath d='M10.5 10.5L13.5 13.5' stroke='%23ff385c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.choice-select-trigger:hover,
.searchable-select-input:hover {
  border-color: var(--border-emphasis);
}

.choice-select-trigger:focus-visible,
.choice-select-trigger[aria-expanded="true"],
.searchable-select-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 56, 92, 0.14);
}

.choice-select-trigger[aria-invalid="true"],
.searchable-select-input[aria-invalid="true"] {
  border-color: #dc2626;
}

.choice-select-trigger:disabled,
.searchable-select-input:disabled {
  background-color: #e9edf3;
  border-color: #d8dde6;
  color: #727b8b;
  cursor: not-allowed;
}

.choice-popup {
  position: fixed;
  z-index: 1500;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--surface-solid);
  color: var(--text-primary);
  box-shadow: 0 10px 28px rgba(36, 43, 66, 0.12), 0 2px 6px rgba(36, 43, 66, 0.05);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.choice-option {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.choice-option:hover,
.choice-option.is-active {
  background: var(--surface-hover);
  color: var(--brand-strong);
}

.choice-option.is-selected {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 600;
}

.choice-option.is-selected::after {
  content: "✓";
  font-size: 12.5px;
  flex-shrink: 0;
}

.choice-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.searchable-select-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.searchable-select-option.is-selected {
  grid-template-columns: minmax(0, 1fr) auto 16px;
}

.searchable-select-option span {
  order: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-option small {
  order: 2;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 190px;
}

.searchable-select-option.is-selected::after {
  order: 3;
}

.choice-select-group-label {
  padding: 6px 10px 3px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
}

.searchable-select-empty {
  padding: 16px 10px;
  color: var(--text-muted);
  font-size: 12.5px;
  text-align: center;
}

.required, .form-error { color: #b91c1c; }
.form-error { padding: 10px 12px; background: #fef2f2; border-radius: 8px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
[hidden] { display: none !important; }

/* 总览紧凑行与标签 */
.person-overview-row { align-items: flex-start; }
.person-overview-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.person-overview-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.person-overview-stat { text-align: right; white-space: nowrap; }
.person-overview-stat strong { font-size: 13.5px; color: var(--text-primary); }
.role-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-subtle);
  border: 1px solid var(--border-default);
}
.source-pill {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--brand);
  background: var(--brand-soft);
}
.stage-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sub-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.sub-section .panel-head { margin-bottom: 10px; }
.timeline-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* 登录与账号权限管理 */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--surface-subtle);
}
.login-card {
  width: 100%;
  max-width: 390px;
  background: var(--surface-solid);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: var(--shadow-hover);
  display: grid;
  gap: 16px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.login-submit { width: 100%; margin-top: 4px; padding: 11px 16px; }
.user-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
}
.logout-btn { padding: 5px 11px; font-size: 12.5px; font-weight: 500; }
.perm-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--surface-head);
}
.perm-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--text-primary); cursor: pointer; }
.perm-check input { width: auto; min-height: auto; }

/* 响应式屏幕尺寸适配 */
@media (max-width: 1280px) {
  .app-shell { grid-template-columns: 198px minmax(0, 1fr); }
  .topbar { padding: 8px 20px; }
  .page { padding: 20px 20px 40px; }
}

@media (max-width: 1120px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .person-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-span-2 { grid-column: 1 / -1; }
  .grid-two, .grid-even { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app-shell { display: block; height: auto; overflow: visible; }
  .main { height: auto; overflow: visible; }
  .sidebar {
    position: static;
    height: auto;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border-default);
  }
  .brand { padding: 0 0 10px; margin-bottom: 8px; }
  .nav-label, .sidebar-note { display: none; }
  #navigation {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 2px;
  }
  .nav-item { padding: 7px 12px; font-size: 13px; flex-shrink: 0; }
  .nav-icon { width: 15px; height: 15px; }
  .nav-icon svg { width: 15px; height: 15px; }
  .topbar { position: sticky; top: 0; min-height: 48px; padding: 6px 14px; }
  .demo-tag { display: none; }
  .page { flex: none; overflow-y: visible; padding: 16px 14px 32px; }
  .page-title { align-items: stretch; }
  .page-actions { width: 100%; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .timeline-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .timeline .step::after { display: none; }
}

@media (max-width: 600px) {
  .entry-grid { grid-template-columns: 1fr; }
  .form-span-2, .form-span-3 { grid-column: auto; }
  .toolbar { width: 100%; }
  .search-box { flex: 1 1 100%; }
  .toolbar input { width: 100%; }
  .toolbar select { flex: 1 1 140px; }
  .panel { padding: 14px; border-radius: 12px; }
  th, td { padding: 9px 10px; font-size: 13px; }
}

@media (max-width: 520px) {
  .metrics { gap: 10px; }
  .metric { padding: 13px 14px; }
  .metric-value { font-size: 18px; }
  .person-list { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .user-chip { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 390px) {
  .metrics { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* 商单轻建单折叠区、详情快捷补录与看板视图 */
.fold-section, .quick-panel {
  margin-top: 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-head);
  padding: 12px 14px;
}

.fold-section summary, .quick-panel summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
}

.fold-section[open] summary, .quick-panel[open] summary {
  color: var(--brand-strong);
}

.quick-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.quick-panel { margin-top: 0; background: var(--surface-solid); }
.quick-form { margin-top: 12px; }

.step.clickable {
  border: 0;
  background: transparent;
  padding: 4px 2px;
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.step.clickable:hover { background: var(--sidebar-hover); }

.kanban-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.kanban-col {
  position: relative;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--border-emphasis);
  border-radius: var(--radius-md);
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 196px;
  min-width: 0;
}

.kanban-col:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 15px;
  right: -13px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  opacity: 0.65;
  pointer-events: none;
}

.kanban-col:nth-child(2), .kanban-col:nth-child(3) { border-top-color: #93c5fd; }
.kanban-col:nth-child(4), .kanban-col:nth-child(5) { border-top-color: #fcd34d; }
.kanban-col:nth-child(6) { border-top-color: #6ee7b7; }

.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.kanban-col-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.kanban-step-num {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--surface-solid);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.kanban-col-metrics {
  display: grid;
  gap: 8px;
}

.kanban-col-kpi {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 2px 2px 0;
}

.kanban-col-kpi strong {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.kanban-col-kpi span {
  font-size: 12.5px;
  color: var(--text-muted);
}

.kanban-col-amount {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-solid);
  border: 1px solid var(--border-subtle);
}

.kanban-col-amount span {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.kanban-col-amount strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kanban-col-sub {
  display: grid;
  gap: 3px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  padding: 0 2px;
}

.kanban-detail-btn {
  margin-top: auto;
  width: 100%;
  border: 1px dashed var(--border-emphasis);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-secondary);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.kanban-detail-btn:hover {
  border-style: solid;
  border-color: var(--brand);
  color: var(--brand-strong);
  background: var(--brand-soft);
}

@media (max-width: 1380px) {
  .kanban-board { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .kanban-col:not(:last-child)::after { display: none; }
}

@media (max-width: 820px) {
  .quick-panels { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .kanban-board { grid-template-columns: 1fr; }
}

/* 全局弹窗 */
.app-modal {
  border: 0;
  padding: 0;
  margin: auto;
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  border-radius: 16px;
  background: var(--surface-solid);
  color: var(--text-primary);
  box-shadow: 0 24px 60px rgba(24, 32, 60, 0.22);
  overflow: hidden;
}

.app-modal::backdrop {
  background: rgba(24, 32, 56, 0.36);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-shell {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-head);
}

.modal-head h2 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  border: 1px solid var(--border-default);
  background: var(--surface-solid);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}

.modal-close:hover {
  border-color: var(--border-emphasis);
  color: var(--text-primary);
}

.modal-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
}

.modal-body .ledger-form {
  margin-top: 0;
}

.cash-panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cash-account-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

/* 现金流看板与行内表单自适应 */
.cash-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.cash-account-card {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  padding: 13px 14px;
  display: grid;
  gap: 6px;
}

.cash-account-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.cash-account-top strong {
  font-size: 14px;
  color: var(--text-primary);
}

.cash-account-balance {
  font-size: 19px;
  font-weight: 600;
  color: var(--brand-strong);
  font-variant-numeric: tabular-nums;
}

.cash-account-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.cash-actions-cell {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px 12px;
  white-space: nowrap;
}

.cash-top-grid > .panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cash-top-grid > .panel .empty {
  margin: auto 0;
}

.cash-actions-cell details[open] {
  flex: 1 1 100%;
  background: var(--surface-head);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 4px;
}

.cash-actions-cell details summary,
.cash-account-card details summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--brand);
}

.ledger-form {
  margin-top: 10px;
}

.ledger-form .entry-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px 12px;
}

.ledger-form .form-actions {
  margin-top: 12px;
}

/* 工作台与经营概览双首页视图（借鉴财域双首页设计） */
.home-default-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.home-default-wrap select {
  height: 34px;
  font-size: 12.5px;
}

.home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  background: var(--surface-subtle);
}

.home-kicker {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-strong);
  background: var(--brand-soft);
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.home-hero-copy h2 { font-size: 18px; }
.home-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.home-section { margin-bottom: 18px; }

.home-quick-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.home-quick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-primary);
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.home-quick-item:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
}

.home-quick-item span { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.home-quick-item strong { font-size: 20px; font-weight: 600; color: var(--brand-strong); font-variant-numeric: tabular-nums; }

.home-work-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.home-work-group h3 { margin-bottom: 10px; font-size: 14px; color: var(--text-secondary); }
.home-work-rows { display: grid; gap: 8px; }

.home-work-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  text-align: left;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.home-work-row:hover {
  background: var(--surface-hover);
  border-color: var(--mist-blue);
}

.home-work-row strong { display: block; font-size: 13.5px; color: var(--text-primary); }
.home-work-row small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.home-work-row span { font-size: 16px; color: var(--text-muted); }

.home-chain-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.home-chain-node {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  text-align: left;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.home-chain-node:hover {
  border-color: var(--brand);
  background: var(--surface-hover);
}

.home-chain-node span { font-size: 12px; color: var(--text-muted); }
.home-chain-node strong { font-size: 18px; color: var(--text-primary); font-variant-numeric: tabular-nums; }

.home-overview-grid {
  align-items: stretch;
}

.home-trend-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.home-trend-bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  height: 170px;
  padding: 12px 6px 4px;
}

.home-trend-card .home-trend-bars {
  flex: 1;
  height: auto;
  min-height: 200px;
}

.home-trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.home-trend-summary > div {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-head);
}

.home-trend-summary span {
  font-size: 11.5px;
  color: var(--text-muted);
}

.home-trend-summary strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.home-trend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.home-trend-pair {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
}

.home-trend-pair span {
  width: 14px;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}

.home-trend-pair .bar-ord { background: var(--brand); }
.home-trend-pair .bar-paid { background: #008a05; }
.home-trend-col small { font-size: 12px; color: var(--text-muted); }

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

.home-attention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--status-warning-border);
  border-radius: var(--radius-sm);
  background: var(--status-warning-soft);
  text-align: left;
  transition: transform 0.12s ease;
}

.home-attention-item:hover { transform: translateY(-1px); }
.home-attention-item strong { display: block; font-size: 13.5px; color: var(--status-warning); }
.home-attention-item span { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.home-attention-item em { font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--brand-strong); white-space: nowrap; }

@media (max-width: 1120px) {
  .home-quick-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-chain-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .home-work-groups { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .home-quick-strip { grid-template-columns: 1fr; }
  .home-chain-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 管理中心（01/02 分组卡片布局，借鉴财域账套资料） */
.hub-sections {
  display: grid;
  gap: 20px;
}

.hub-section {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.hub-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.hub-section-aside {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.hub-step {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.hub-section-aside h2 { font-size: 15px; font-weight: 600; }
.hub-section-aside p { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

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

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

.hub-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  text-align: left;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.hub-card-body {
  flex: 1;
  min-width: 0;
}

.hub-card-arrow {
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

button.hub-card:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  box-shadow: var(--shadow-hover);
}

button.hub-card:hover .hub-card-arrow {
  color: var(--brand-strong);
}

.hub-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  flex-shrink: 0;
}

.hub-card-icon svg { width: 18px; height: 18px; display: block; }
.hub-card strong { display: block; font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.hub-card span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }

.subpage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.subpage-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-primary);
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: border-color 0.14s ease, transform 0.14s ease;
}

button.subpage-stat:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

button.subpage-stat.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.subpage-stat span { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.subpage-stat strong { font-size: 20px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }

@media (max-width: 1120px) {
  .hub-cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subpage-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .hub-section { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 520px) {
  .hub-cards, .hub-cards-3, .subpage-summary { grid-template-columns: 1fr; }
}
