/* ============================================================
   云谷内部管理系统 - 前端设计系统 v2
   黑白灰极简 · 高级灰阶 · 多层阴影 · 零位移微交互
   设计原则：位移是廉价感来源，高级感来自阴影渐变与字重对比
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* ---- 灰阶（冷调纯净灰） ---- */
  --bg: #f5f6f7;
  --bg-deep: #eceef0;
  --surface: #ffffff;
  --surface-alt: #f8f9fa;
  --border: #e6e8eb;
  --border-strong: #cfd3d8;
  --hairline: #f0f1f3;
  --text: #17181a;
  --text-secondary: #53575c;
  --text-hint: #9aa0a6;
  --accent: #17181a;
  --accent-hover: #33363a;
  --accent-light: rgba(23,24,26,.05);
  --danger: #c0392b;
  --success: #27ae60;
  --warning: #b8860b;

  /* ---- 语义色（降饱和 · 莫兰迪调） ---- */
  --c-lead: #6b93c4;
  --c-project: #c9a06a;
  --c-aftersale: #6fb99a;
  --c-finance: #8b9096;
  --c-finance-in: #4a8a6c;
  --c-finance-out: #b56862;

  /* ---- 圆角（收小一档，更利落） ---- */
  --r-sm: 4px;
  --r: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* ---- 阴影（多层低透明度，悬浮感） ---- */
  --shadow-xs: 0 1px 2px rgba(16,17,19,.04);
  --shadow-sm: 0 1px 2px rgba(16,17,19,.04), 0 2px 6px rgba(16,17,19,.05);
  --shadow-md: 0 1px 2px rgba(16,17,19,.05), 0 6px 16px rgba(16,17,19,.07);
  --shadow-lg: 0 2px 4px rgba(16,17,19,.05), 0 12px 32px rgba(16,17,19,.10);
  --shadow-xl: 0 4px 8px rgba(16,17,19,.06), 0 24px 56px rgba(16,17,19,.13);

  /* ---- 过渡 ---- */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.0, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: .16s;
  --t: .24s;
  --t-slow: .4s;

  /* ---- 间距 ---- */
  --sp: 8px;

  --sidebar-w: 208px;
  --header-h: 56px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea {
  font-family: inherit; font-size: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  padding: 7px 12px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  width: 100%;
}
input:hover, select:hover, textarea:hover { border-color: #b8bdc4; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23,24,26,.07);
}
input::placeholder, textarea::placeholder { color: var(--text-hint); }
textarea { resize: vertical; min-height: 80px; }

/* 自定义滚动条（更细更淡） */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d7db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b8bdc4; }

/* ============================================================
   登录页
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(168deg, #eef0f2 0%, #f5f6f7 46%, #ebeced 100%);
  position: relative;
  overflow: hidden;
}
.login-wrap::before, .login-wrap::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(23,24,26,.018); pointer-events: none;
}
.login-wrap::before { width: 560px; height: 560px; top: -180px; right: -160px; }
.login-wrap::after { width: 420px; height: 420px; bottom: -140px; left: -120px; }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 44px 40px;
  width: 360px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: cardIn var(--t-slow) var(--ease-out);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-logo {
  width: 140px; height: auto;
  margin: 0 auto 4px;
  display: block;
}
.login-card .sub { color: var(--text-secondary); font-size: 13px; margin-bottom: 32px; text-align: center; }
.login-card label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.login-card input { width: 100%; margin-bottom: 18px; padding: 10px 13px; }
.login-card .err { color: var(--danger); font-size: 13px; margin-bottom: 12px; min-height: 18px; }
.btn-primary {
  width: 100%; padding: 11px; background: var(--accent); color: #fff;
  border-radius: var(--r); font-size: 14px; font-weight: 600;
  letter-spacing: .2px;
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-md);
}
.btn-primary:active { box-shadow: none; background: #3c4044; }
.login-hint { margin-top: 20px; font-size: 12px; color: var(--text-hint); text-align: center; }

/* ============================================================
   布局
   ============================================================ */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ---- 侧边栏 ---- */
.sidebar {
  width: var(--sidebar-w); background: var(--surface-alt);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
  transition: transform var(--t) var(--ease);
  z-index: 50;
}
.sidebar .brand {
  padding: 20px 20px 16px; font-size: 14px; font-weight: 700;
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -.2px;
}
.brand-logo {
  width: 28px; height: 28px; flex-shrink: 0;
  object-fit: contain;
}
.sidebar .brand span { display: block; font-size: 11px; color: var(--text-hint); font-weight: 400; margin-top: 1px; }

.nav { padding: 10px 10px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 2px;
  color: var(--text-secondary);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  border-radius: var(--r);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  position: relative;
}
.nav-item svg { flex-shrink: 0; opacity: .75; transition: opacity var(--t-fast) var(--ease); }
.nav-item:hover {
  background: rgba(23,24,26,.04); color: var(--text);
}
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  color: var(--text); font-weight: 600;
  background: var(--surface);
  box-shadow: var(--shadow-xs), 0 0 0 1px var(--border);
}
.nav-item.active svg { opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 600;
  color: var(--text-hint); font-variant-numeric: tabular-nums;
}

.sidebar .user-box {
  padding: 16px 20px; border-top: 1px solid var(--hairline);
  font-size: 13px; color: var(--text-secondary);
}
.sidebar .user-box .actions {
  margin-top: 8px; display: flex; gap: 12px; font-size: 12px;
}
.sidebar .user-box .actions span {
  cursor: pointer; color: var(--text-hint);
  transition: color var(--t-fast) var(--ease);
}
.sidebar .user-box .actions span:hover { color: var(--text); }

/* ---- 移动端侧边栏切换 ---- */
.sidebar-toggle {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 60;
  width: 38px; height: 38px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  align-items: center; justify-content: center;
  font-size: 18px; color: var(--text);
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(16,17,19,.32); z-index: 45;
  opacity: 0; transition: opacity var(--t) var(--ease);
  pointer-events: none;
}
.sidebar-overlay.show {
  display: block; opacity: 1; pointer-events: auto;
}

/* ---- 主区域 ---- */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.main-header {
  height: var(--header-h); background: rgba(255,255,255,.86);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 32px; flex-shrink: 0;
  position: relative; z-index: 10;
}
.main-header h2 { font-size: 16px; font-weight: 700; letter-spacing: -.3px; }
.main-content {
  flex: 1; overflow-y: auto; padding: 28px 32px 40px;
  animation: pageIn var(--t) var(--ease-out);
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   看板
   ============================================================ */
.cards {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 16px;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px 20px 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
  position: relative; overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.card .num {
  font-size: 32px; font-weight: 700;
  letter-spacing: -.8px; line-height: 1.15;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 8px;
}
.card .lbl {
  font-size: 12px; color: var(--text-hint);
  margin-top: 6px; font-weight: 500;
  letter-spacing: .3px;
}
.card .sub {
  font-size: 11px; color: var(--text-hint); margin-top: 1px;
}
/* 卡片身份色：左上角短色条（含蓄表达，替代通栏色条） */
.card::before {
  content: ''; position: absolute; top: 0; left: 20px;
  width: 22px; height: 2.5px; border-radius: 0 0 2px 2px;
  background: var(--hairline);
}
.card.lead::before     { background: var(--c-lead); }
.card.project::before  { background: var(--c-project); }
.card.aftersale::before{ background: var(--c-aftersale); }
.card.total::before    { background: var(--accent); }
.card.finance::before  { background: var(--c-finance); }
.card.finance-in::before  { background: var(--c-finance-in); }
.card.finance-out::before { background: var(--c-finance-out); }

/* ---- 财务/警示卡片 ---- */
.cards.finance-cards { grid-template-columns: repeat(3, 1fr); }
.cards.finance-cards .card .num { font-size: 28px; }
/* 货币符号小号前缀（hero 数字排版规范） */
.num .cur { font-size: 15px; font-weight: 600; color: var(--text-hint); letter-spacing: 0; }
.cards.alert-cards { grid-template-columns: repeat(5, 1fr); margin-bottom: 16px; }
.alert-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px 14px; position: relative;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
  cursor: default; overflow: hidden;
}
.alert-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.alert-card .num { font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.alert-card .lbl { font-size: 12.5px; color: var(--text); margin-top: 5px; font-weight: 600; }
.alert-card .sub { font-size: 11px; color: var(--text-hint); margin-top: 1px; }
.alert-card::before {
  content: ''; position: absolute; top: 0; left: 18px;
  width: 22px; height: 2.5px; border-radius: 0 0 2px 2px;
}
.alert-card.overdue-card::before   { background: var(--danger); }
.alert-card.delayed-card::before  { background: #d98a4e; }
.alert-card.launch-card::before   { background: var(--c-lead); }
.alert-card.aftersale-card::before{ background: #967bb0; }

/* ---- 面板网格 ---- */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 20px 22px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t) var(--ease);
}
.panel:hover { box-shadow: var(--shadow-sm); }
.panel h3 {
  font-size: 13.5px; font-weight: 600; margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
  letter-spacing: -.1px;
}
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 8px; margin: 0 -8px; border-bottom: 1px solid var(--hairline);
  font-size: 13px; transition: background var(--t-fast) var(--ease);
  border-radius: var(--r-sm);
}
.stat-row:last-child { border-bottom: none; }
.stat-row:hover { background: var(--surface-alt); }
.stat-row .v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================================================
   列表工具条
   ============================================================ */
.toolbar {
  display: flex; gap: 10px; margin-bottom: 16px;
  flex-wrap: wrap; align-items: center;
}
.toolbar input[type=text] { width: 240px; }
.toolbar select { min-width: 110px; width: auto; }
.toolbar .spacer { flex: 1; }

/* ---- 按钮系统（零位移 · 阴影渐变） ---- */
.btn {
  padding: 8px 18px; background: var(--accent); color: #fff;
  border-radius: var(--r); font-size: 13.5px; font-weight: 600;
  letter-spacing: .2px;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.1);
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.btn:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-md);
}
.btn:active { box-shadow: none; background: #3c4044; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  padding: 7px 16px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r); font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--t-fast) var(--ease);
}
.btn-ghost:hover {
  background: var(--surface-alt);
  border-color: #b0b6bd;
}
.btn-ghost:active { background: var(--bg-deep); }

.btn-success {
  background: var(--success); color: #fff; border: none;
  padding: 10px 22px; border-radius: var(--r); font-size: 13.5px; font-weight: 600;
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.btn-success:hover { background: #229954; box-shadow: 0 4px 14px rgba(39,174,96,.22); }
.btn-success:active { box-shadow: none; }

.btn-warning {
  background: var(--warning); color: #fff; border: none;
  padding: 10px 22px; border-radius: var(--r); font-size: 13.5px; font-weight: 600;
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.btn-warning:hover { background: #9a7300; box-shadow: 0 4px 14px rgba(184,134,11,.22); }
.btn-warning:active { box-shadow: none; }

.btn-danger {
  background: var(--surface); color: var(--danger);
  border: 1px solid rgba(192,57,43,.35);
  padding: 8px 18px; border-radius: var(--r); font-size: 13px;
  transition: all var(--t-fast) var(--ease);
}
.btn-danger:hover { background: #fbf0ef; border-color: var(--danger); }

/* ============================================================
   表格
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-xs); }
.table {
  width: 100%; background: var(--surface);
  border-collapse: collapse;
  table-layout: auto;
}
.table th, .table td {
  text-align: left; padding: 11px 18px; font-size: 13px;
  border-bottom: 1px solid var(--hairline);
  min-width: 80px;
}
/* 列表页表格内单元格间竖线分隔（解决「商机录入时间」「负责人」列挨在一起视觉错位）*/
.table-wrap .table th + th, .table-wrap .table td + td {
  box-shadow: inset 1px 0 0 var(--hairline);
}
/* 列表页表格最小列宽 */
.table-wrap .table th:nth-child(1), .table-wrap .table td:nth-child(1) { min-width: 180px; }
.table-wrap .table th:nth-last-child(2), .table-wrap .table td:nth-last-child(2) { min-width: 130px; white-space: nowrap; }
.table-wrap .table th:last-child, .table-wrap .table td:last-child { min-width: 100px; }
.table th {
  background: var(--surface-alt); color: var(--text-hint);
  font-weight: 600; white-space: nowrap;
  font-size: 12px; letter-spacing: .4px;
  position: sticky; top: 0; z-index: 1;
  border-bottom: 1px solid var(--border);
}
.table tbody tr {
  transition: background var(--t-fast) var(--ease);
  cursor: pointer;
}
.table tbody tr:hover { background: var(--surface-alt); }
.table tbody tr:last-child td { border-bottom: none; }

/* 阶段流转历史行：置灰 + 流转标记 */
.table tbody tr.hist-row td { color: var(--text-hint); }
.table tbody tr.hist-row .badge { opacity: .75; }
.mcard.hist-row { opacity: .82; }
.mcard.hist-row .mcard-name { color: var(--text-secondary); }
.hist-tag {
  display: inline-block; margin-left: 8px; padding: 1px 8px;
  border: 1px solid var(--hairline); border-radius: 9px;
  font-size: 10.5px; color: var(--text-hint); font-weight: 400;
  white-space: nowrap; vertical-align: 1px;
}

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 10px;
  font-size: 11.5px; font-weight: 500;
  letter-spacing: .2px;
  background: var(--bg-deep); color: var(--text-secondary);
  transition: all var(--t-fast) var(--ease);
}
.badge.won, .badge.accepted { background: #e9f4ec; color: #1e7b3c; }
.badge.lost { background: #faefee; color: var(--danger); }
.badge.warning { background: #faf3e6; color: #9c7509; }
.badge.overdue { background: var(--danger) !important; color: #fff !important; }

.amount { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.muted { color: var(--text-hint); font-size: 12px; }
.empty {
  text-align: center; color: var(--text-hint);
  padding: 56px 0; font-size: 13px;
}
.empty::before {
  content: ''; display: block; width: 44px; height: 44px;
  margin: 0 auto 14px; border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  position: relative;
}
.empty::after {
  content: ''; display: block; margin-top: -31px; margin-bottom: 17px;
  width: 44px; height: 44px; margin-left: auto; margin-right: auto;
  border: 1.5px solid var(--border-strong); border-radius: 50%;
  opacity: .25;
}

/* ============================================================
   弹窗
   ============================================================ */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(16,17,19,.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  animation: maskIn var(--t-fast) var(--ease);
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes maskOut { from { opacity: 1; } to { opacity: 0; } }

.modal {
  background: var(--surface); border-radius: var(--r-lg);
  width: 560px; max-width: 92vw;
  max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn var(--t) var(--ease-out);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-lg { width: 820px; max-height: 92vh; }
.modal-lg .modal-body { max-height: calc(92vh - 120px); overflow-y: auto; }

/* 收款计划：4 列布局（期次 / 名称 / 金额 / 日期），勿与旧 6 列 install-row 混用 */
.modal-body .install-grid-plan {
  display: grid;
  grid-template-columns: 72px minmax(140px, 1.2fr) 160px 170px;
  gap: 10px;
  padding: 0 10px 6px;
  font-size: 11.5px;
  color: var(--text-hint);
  letter-spacing: .3px;
  white-space: nowrap;
}
.modal-body .install-grid-plan span:nth-child(1) { text-align: center; }
.modal-body .install-row-plan {
  display: grid;
  grid-template-columns: 72px minmax(140px, 1.2fr) 160px 170px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
}
.modal-body .install-row-plan .tag {
  display: inline-flex; align-items: center; justify-content: center;
  height: 22px; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 12px; font-weight: 500;
  border-radius: 10px; white-space: nowrap;
}
.modal-body .install-row-plan .amt-field {
  display: flex; align-items: center; gap: 4px; min-width: 0;
}
.modal-body .install-row-plan .currency {
  color: var(--text-hint); font-size: 13px; flex-shrink: 0;
}
.modal-body .install-row-plan input[type=text],
.modal-body .install-row-plan input[type=number],
.modal-body .install-row-plan input[type=date] {
  height: 32px; padding: 4px 8px; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); width: 100%; box-sizing: border-box;
  min-width: 0;
}

/* 附件预览 / 操作 */
.link-btn {
  background: none; border: none; padding: 0;
  font-size: 12px; color: var(--accent, #378add);
  cursor: pointer; text-decoration: none;
}
.link-btn:hover { text-decoration: underline; }
.attach-chip {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 4px 12px; background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 12px; color: var(--text-secondary);
}
.attach-row .ops .sep { color: var(--text-hint); margin: 0 4px; }
.preview-wrap { text-align: center; }
.preview-wrap img { max-width: 100%; max-height: 70vh; border-radius: var(--r-sm); }
.preview-wrap.preview-pdf iframe { width: 100%; height: 70vh; border: none; border-radius: var(--r-sm); background: #f5f5f5; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-header h3 { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.modal-close {
  cursor: pointer; color: var(--text-hint); font-size: 22px;
  line-height: 1; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); transition: all var(--t-fast) var(--ease);
}
.modal-close:hover { color: var(--text); background: var(--bg-deep); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 14px 24px; border-top: 1px solid var(--hairline);
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: var(--surface);
}

/* ============================================================
   表单
   ============================================================ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-item { display: flex; flex-direction: column; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; letter-spacing: .2px; }
.form-item .req { color: var(--danger); margin-right: 2px; }

/* 表单控件统一外观（用于 modal 里的表单，让线框尺寸一致） */
.modal-body .form-item input,
.modal-body .form-item select,
.modal-body .form-item textarea {
  width: 100%;
  height: 36px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-sizing: border-box;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.modal-body .form-item textarea { height: auto; min-height: 64px; padding: 8px 10px; resize: vertical; }
.modal-body .form-item select { padding-right: 28px; }
.modal-body .form-item input:focus,
.modal-body .form-item select:focus,
.modal-body .form-item textarea:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}
.modal-body .form-item input:disabled,
.modal-body .form-item select:disabled { opacity: .4; cursor: not-allowed; }

/* 期次行：6 列固定网格（[期次 ¥ 金额 比例 不按比例 日期]）——线框对齐一致 */
.modal-body .install-row {
  display: grid;
  grid-template-columns: 64px 20px 130px 92px 110px 170px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
}
.modal-body .install-row .tag {
  display: inline-flex; align-items: center; justify-content: center;
  height: 22px; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 12px; font-weight: 500;
  border-radius: 10px; white-space: nowrap;
}
.modal-body .install-row .currency { color: var(--text-hint); font-size: 13px; text-align: center; }
.modal-body .install-row input,
.modal-body .install-row select {
  height: 32px; padding: 4px 8px; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); width: 100%; box-sizing: border-box;
}
.modal-body .install-row input:focus,
.modal-body .install-row select:focus { outline: none; border-color: var(--text); }
.modal-body .install-row label.manual {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; color: var(--text-secondary); cursor: pointer;
  white-space: nowrap; justify-content: center;
}
.modal-body .install-row label.manual input[type=checkbox] { width: 14px; height: 14px; margin: 0; }
/* 比例联动提示和日期标签 */
.modal-body .install-grid-hint {
  display: grid; grid-template-columns: 64px 20px 130px 92px 110px 170px;
  gap: 8px; padding: 0 12px 6px;
  font-size: 11.5px; color: var(--text-hint); letter-spacing: .3px;
}
.modal-body .install-grid-hint span:nth-child(1) { grid-column: 1; text-align: center; }
.modal-body .install-grid-hint span:nth-child(2) { grid-column: 2; }
.modal-body .install-grid-hint span:nth-child(3) { grid-column: 3; }
.modal-body .install-grid-hint span:nth-child(4) { grid-column: 4; text-align: center; }
.modal-body .install-grid-hint span:nth-child(5) { grid-column: 5; text-align: center; }
.modal-body .install-grid-hint span:nth-child(6) { grid-column: 6; }
.modal-body .install-sum {
  font-size: 12.5px; color: var(--text-secondary); margin-top: 6px; padding: 0 4px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.modal-body .install-sum .ok { color: #27ae60; font-weight: 500; }
.modal-body .install-sum .fail { color: #c0392b; font-weight: 500; }
.modal-body .install-sum .hint { color: var(--text-hint); }

/* ============================================================
   详情页
   ============================================================ */
.detail-top { display: flex; gap: 14px; margin-bottom: 14px; align-items: flex-start; }
.detail-main { flex: 1; min-width: 0; }
.detail-side { width: 360px; flex-shrink: 0; }
.detail-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 20px 22px; margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t) var(--ease);
  animation: cardSlideIn var(--t) var(--ease-out);
}
.detail-card:hover { box-shadow: var(--shadow-sm); }
@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.detail-card h3 {
  font-size: 13.5px; font-weight: 600; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
  letter-spacing: -.1px;
  padding-bottom: 10px; border-bottom: 1px solid var(--hairline);
}
.detail-card h3 .add-btn {
  font-size: 12.5px; color: var(--text-secondary); cursor: pointer;
  font-weight: 500; padding: 3px 10px; border-radius: var(--r-sm);
  transition: all var(--t-fast) var(--ease);
}
.detail-card h3 .add-btn:hover {
  color: var(--text); background: var(--accent-light);
}

.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 28px; }
.kv .item { font-size: 13px; }
.kv .item .k { color: var(--text-hint); margin-right: 8px; }
.kv .item .v { font-weight: 500; }

.owner-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--hairline);
  font-size: 13px;
}
.owner-row:last-child { border-bottom: none; }
.owner-row .tag { width: 52px; color: var(--text-hint); flex-shrink: 0; }
.owner-row select { flex: 1; width: auto; }

/* ---- 时间线 ---- */
.timeline { list-style: none; }
.timeline li {
  position: relative; padding: 0 0 18px 22px;
  border-left: 1.5px solid var(--border);
  margin-left: 6px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -5px; top: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  box-shadow: 0 0 0 3px var(--surface);
}
.timeline li:first-child::before {
  border-color: var(--accent); background: var(--accent);
}
.timeline .t { color: var(--text-hint); font-size: 11.5px; letter-spacing: .2px; }
.timeline .c { font-size: 13px; margin-top: 3px; white-space: pre-wrap; line-height: 1.6; }
.timeline .op { color: var(--text-hint); font-size: 11.5px; }

/* ---- 附件行 ---- */
.attach-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--hairline); font-size: 13px;
}
.attach-row:last-child { border-bottom: none; }
.attach-row .fname { display: flex; align-items: center; gap: 8px; }
.attach-row .fname a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; transition: all var(--t-fast) var(--ease); }
.attach-row .fname a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.attach-row .ops {
  display: flex; gap: 8px; font-size: 12px; align-items: center; flex-wrap: wrap;
}
.attach-row .ops .link-btn { color: var(--accent, #378add); }
.attach-row .ops .del { cursor: pointer; color: var(--text-hint); }
.attach-row .ops .del:hover { color: var(--danger); }
.attach-row .ops .sep { color: var(--text-hint); margin: 0 2px; }
.attach-chip .link-btn { color: var(--accent, #378add); margin-left: 2px; }

/* ---- 流转按钮区 ---- */
.flow-actions { display: flex; gap: 12px; margin-top: 4px; flex-wrap: wrap; }

/* ---- 上传区 ---- */
.upload-box {
  border: 1.5px dashed var(--border-strong); border-radius: var(--r);
  padding: 22px; text-align: center; color: var(--text-hint);
  font-size: 13px; margin-bottom: 10px;
  cursor: pointer; transition: all var(--t-fast) var(--ease);
  background: var(--surface-alt);
}
.upload-box:hover {
  border-color: var(--accent); color: var(--text);
  background: var(--surface);
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  padding: 10px 22px; border-radius: var(--r);
  font-size: 13px; font-weight: 500; letter-spacing: .2px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: toastIn var(--t) var(--ease-out);
}
.toast.err { background: var(--danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -14px) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translate(-50%, 0) scale(1); }
  to   { opacity: 0; transform: translate(-50%, -14px) scale(.96); }
}

/* ============================================================
   回款管理
   ============================================================ */
.progress {
  height: 5px; background: var(--bg-deep); border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%; background: var(--accent);
  transition: width var(--t-slow) var(--ease);
  border-radius: 3px;
}
.plan-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; border-bottom: 1px dashed var(--hairline);
  font-size: 13px; flex-wrap: wrap;
}
.plan-row:last-of-type { border-bottom: none; }
.plan-row .tag {
  background: var(--bg-deep); border-radius: var(--r-sm);
  padding: 2px 10px; font-size: 12px; white-space: nowrap; font-weight: 500;
}
.spacer { flex: 1; }

/* ---- 跟进记录附件 ---- */
.fu-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fu-file, .attach-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 12px; color: var(--text-secondary);
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: all var(--t-fast) var(--ease);
  text-decoration: none;
}
.fu-file:hover {
  background: var(--bg-deep); color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

/* ============================================================
   上线倒计时表盘
   ============================================================ */
.launch-wrap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.launch-dial { position: relative; flex-shrink: 0; }
.launch-svg { width: 180px; height: 180px; display: block; }
.launch-progress { transition: stroke-dasharray var(--t-slow) linear; }
.launch-glow { filter: drop-shadow(0 0 6px rgba(55,138,221,.5)); }
.launch-ended { filter: drop-shadow(0 0 6px rgba(226,75,74,.5)); }
.launch-sec { transition: transform .3s linear; }
.launch-label { font-size: 12px; fill: var(--text-hint); letter-spacing: 1px; }
.launch-days { font-size: 40px; fill: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.launch-sub { font-size: 12px; fill: var(--text-hint); }
.launch-blocks { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.lb {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: var(--r); padding: 13px 16px; text-align: center;
  min-width: 64px; display: flex; flex-direction: column;
  justify-content: center; gap: 3px;
  transition: all var(--t-fast) var(--ease);
}
.lb:hover { box-shadow: var(--shadow-xs); border-color: var(--border-strong); }
.lb-num { font-size: 24px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.lb-t { font-size: 11.5px; color: var(--text-hint); letter-spacing: .3px; }
.lb-full { min-width: 120px; }
.lb-v { font-size: 13px; color: var(--text-secondary); }
.launch-banner {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(226,75,74,.92); color: #fff;
  font-size: 14px; font-weight: 600; padding: 6px 16px;
  letter-spacing: .5px;
  border-radius: 20px; animation: launchPop .6s ease infinite alternate;
  white-space: nowrap;
}
@keyframes launchPop {
  from { transform: translate(-50%, -50%) scale(1); opacity: .85; }
  to   { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

/* ============================================================
   加载骨架
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-deep) 25%, var(--surface-alt) 50%, var(--bg-deep) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.skeleton-card { height: 92px; border-radius: var(--r-md); }
.skeleton-row { height: 40px; margin-bottom: 8px; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1024px) {
  .cards.alert-cards { grid-template-columns: repeat(3, 1fr); }
  .cards.finance-cards { grid-template-columns: repeat(3, 1fr); }
  .detail-side { width: 320px; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.show { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  /* 切勿把 overlay 设为常驻 display:block，否则会挡住滚动与所有点击 */

  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards.alert-cards { grid-template-columns: repeat(2, 1fr); }
  .cards.finance-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .panels { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }

  .detail-top { flex-direction: column; }
  .detail-side { width: 100%; }

  .main-header { padding: 0 16px 0 60px; }
  .main-header h2 { font-size: 15px; }
  .main-content {
    padding: 14px 14px calc(72px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .toolbar input[type=text] { width: 100%; }
  .toolbar select { flex: 1; min-width: calc(50% - 8px); }

  .modal { width: 94vw; max-width: 94vw; border-radius: var(--r-md); }
  .modal-lg { width: 94vw; }

  .app, .main {
    height: 100dvh;
    height: 100vh;
    max-height: 100dvh;
  }
  .main { min-height: 0; }
  .main-content { min-height: 0; }

  .card { padding: 14px 14px 12px; }
  .card .num { font-size: 26px; }
  .cards.finance-cards .card .num { font-size: 20px; }
  .alert-card { padding: 12px 14px; }
  .alert-card .num { font-size: 22px; }
}

@media (max-width: 560px) {
  /* 看板保持双列，避免首页卡片过高过空 */
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cards.alert-cards { grid-template-columns: repeat(2, 1fr); }
  .cards.finance-cards { grid-template-columns: 1fr; }

  .launch-wrap { flex-direction: column; align-items: flex-start; }
  .launch-svg { width: 150px; height: 150px; }
  .launch-blocks { width: 100%; }
  .lb { flex: 1; min-width: 0; padding: 10px 8px; }
  .lb-full { min-width: 0; }

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

  .login-card { width: calc(100vw - 32px); padding: 32px 24px; }
}

/* ---- 工具类 ---- */
.fade-in { animation: pageIn var(--t) var(--ease-out); }
.no-scroll { overflow: hidden; }

/* ============================================================
   无障碍与交互降级
   ============================================================ */
/* 尊重系统「减弱动态效果」偏好：关闭所有动画与过渡 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 触屏设备：禁用 hover 阴影/高亮增强，避免点击后「粘滞」 */
@media (hover: none) {
  .card:hover, .alert-card:hover, .panel:hover, .detail-card:hover,
  .lb:hover, .fu-file:hover, .stat-row:hover,
  .table tbody tr:hover {
    box-shadow: var(--shadow-xs);
  }
  .btn:hover, .btn-ghost:hover, .btn-primary:hover,
  .btn-success:hover, .btn-warning:hover, .btn-danger:hover {
    box-shadow: none;
  }
  .nav-item:hover { background: transparent; }
  .btn:active, .btn-ghost:active { background: var(--bg-deep); }
}

/* ============================================================
   移动端交互增强（触摸优先）
   ============================================================ */
/* 手机（含刘海屏）安全区 */
@supports (padding: max(0px)) {
  .sidebar .user-box { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .modal-footer { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
}

@media (max-width: 768px) {
  /* 触摸目标 ≥44px */
  .btn, .btn-ghost, .btn-success, .btn-warning, .btn-danger, .btn-primary {
    min-height: 44px;
  }
  .nav-item { min-height: 44px; padding: 12px 14px; }
  .modal-close { width: 44px; height: 44px; }
  input, select, textarea { min-height: 44px; }
  .detail-card h3 .add-btn { min-height: 36px; display: inline-flex; align-items: center; }
  .attach-row .ops span, .sidebar .user-box .actions span { padding: 8px 4px; }
  .sidebar .user-box .actions { gap: 8px; }

  /* 表格：移动端收紧单元格内边距，横向滑动更顺 */
  .table th, .table td { padding: 12px 12px; }
}

/* ============================================================
   AI 模型配置 / 智能建档
   ============================================================ */
.ai-intro { margin-bottom: 16px; }
.ai-provider-list { display: flex; flex-direction: column; gap: 16px; }
.ai-provider-card .ai-provider-title {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap;
}
.ai-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.ai-slots { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.ai-slot {
  padding: 12px; background: var(--surface-alt); border: 1px solid var(--hairline); border-radius: var(--r-sm);
}
.ai-slot-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.ai-slot-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ai-slot-body select, .ai-slot-body input { width: 100%; }
.ai-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.ai-create-wrap { max-width: 820px; }
.ai-create-hero textarea {
  width: 100%; box-sizing: border-box; margin-top: 12px; min-height: 120px;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--r); font-size: 16px; line-height: 1.6;
  -webkit-user-select: text; user-select: text;
  pointer-events: auto; touch-action: manipulation;
}
.ai-create-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ai-status-line { font-size: 13px; padding: 8px 12px; border-radius: var(--r-sm); }
.ai-status-line.ok { background: #eaf7ef; color: #1e7a3c; }
.ai-status-line.bad { background: #fdeeee; color: #c0392b; }
@media (max-width: 768px) {
  .ai-slot-body { grid-template-columns: 1fr; }
  .ai-create-actions .btn, .ai-create-actions .btn-ghost { flex: 1; }
}

/* ============================================================
   手机端：底部 Tab + 列表卡片
   ============================================================ */
.mobile-tabbar { display: none; }
.mobile-only { display: none !important; }
.desktop-only { display: block; }
.cards.desktop-only, .cards.finance-cards.desktop-only, .cards.alert-cards.desktop-only {
  display: grid;
}

.mcard-list { display: flex; flex-direction: column; gap: 10px; }
.mcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-xs);
  -webkit-tap-highlight-color: transparent;
}
.mcard:active { background: var(--surface-alt); }
.mcard-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 6px;
}
.mcard-name { font-weight: 650; font-size: 15px; line-height: 1.35; word-break: break-word; }
.mcard-line { font-size: 13px; color: var(--text-secondary); line-height: 1.45; margin-top: 2px; }
.mcard-line.muted, .mcard-actions .muted { color: var(--text-hint); font-size: 12px; }
.mcard-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--hairline);
}
.mcard-call {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 14px;
  background: var(--accent); color: #fff; border-radius: var(--r);
  font-size: 13px; font-weight: 600;
}

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
  .dash-metrics.mobile-only { display: grid !important; }
  .dash-fin.mobile-only { display: grid !important; }

  .mobile-tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding: 0 4px env(safe-area-inset-bottom, 0px);
    background: rgba(255,255,255,.96);
    border-top: 1px solid var(--border);
    backdrop-filter: saturate(1.2) blur(10px);
    -webkit-backdrop-filter: saturate(1.2) blur(10px);
  }
  .mtab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; min-width: 0; background: transparent; color: var(--text-hint);
    font-size: 10px; font-weight: 500; padding: 6px 2px; border-radius: var(--r-sm);
  }
  .mtab-ico { display: flex; line-height: 0; }
  .mtab-ico svg { width: 20px; height: 20px; }
  .mtab-txt { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mtab.active { color: var(--text); font-weight: 650; }
  .mtab.active .mtab-ico { color: var(--accent); }

  .toolbar { gap: 8px; }
  .toolbar .spacer { display: none; }
  .toolbar #btnAdd { width: 100%; justify-content: center; order: -1; }
  .toolbar #btnSearch, .toolbar #btnReset { flex: 1; justify-content: center; }

  .detail-top .actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .detail-top .actions .btn, .detail-top .actions .btn-ghost { flex: 1; min-width: 40%; justify-content: center; }

  .modal { max-height: calc(100dvh - 24px); overflow: auto; }

  .mcard-call {
    background: transparent; color: var(--text);
    border: 1px solid var(--border-strong);
    min-height: 34px; font-weight: 550;
  }

  /* 看板首页：更紧凑、更有层次 */
  .dash-hero {
    background: linear-gradient(145deg, #1a1b1e 0%, #2c2f34 55%, #3a3e45 100%);
    color: #fff; border-radius: var(--r-lg);
    padding: 18px 16px 14px; margin-bottom: 12px;
    box-shadow: var(--shadow-md);
  }
  .dash-hello { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
  .dash-sub { font-size: 12px; color: rgba(255,255,255,.62); margin-top: 4px; }
  .dash-quick {
    display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
  }
  .dash-qbtn {
    flex: 1; min-width: 0; min-height: 40px;
    background: rgba(255,255,255,.12); color: #fff;
    border: 1px solid rgba(255,255,255,.18); border-radius: var(--r);
    font-size: 13px; font-weight: 600;
  }
  .dash-qbtn:active { background: rgba(255,255,255,.22); }
  .dash-metrics {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px;
  }
  .dash-metric {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 12px 12px 10px;
    box-shadow: var(--shadow-xs);
  }
  .dash-metric .n { font-size: 22px; font-weight: 700; letter-spacing: -.4px; line-height: 1.15; }
  .dash-metric .l { font-size: 11px; color: var(--text-hint); margin-top: 4px; font-weight: 500; }
  .dash-metric.accent .n { color: var(--c-project); }
  .dash-metric.warn .n { color: var(--danger); }
  .dash-fin {
    display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px;
  }
  .dash-fin-row {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 12px 14px;
  }
  .dash-fin-row .l { font-size: 12px; color: var(--text-hint); }
  .dash-fin-row .n { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .dash-fin-row .n.ok { color: var(--success); }
  .dash-fin-row .n.bad { color: var(--danger); }
  .panel h3 { font-size: 14px; }
  .stat-row { padding: 10px 0; font-size: 13px; }
}

@supports (padding: max(0px)) {
  .mobile-tabbar { padding-bottom: max(env(safe-area-inset-bottom), 0px); }
}

.ai-help-box {
  margin-top: 12px; padding: 12px 14px;
  background: #f7fafc; border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 13px;
}
.ai-help-box code {
  background: #fff; border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px; font-size: 12px;
}
.ai-slot .ai-model-input {
  width: 100%; height: 36px; padding: 6px 10px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
}
.ai-slot-speech {
  border-color: #9ec5fe;
  background: #f3f8ff;
}
