/* ============================================================
 * 周报填报系统 · DEMO v3.0
 * 设计方向：Modern Luxe（现代奢华）
 * —— 深靛蓝渐变 · 琥珀暖色 · 精致阴影 · 大胆排版
 * 
 * 遵循 Impeccable 原则：
 *   ✅ 浅色暖色中性调（避免纯灰）
 *   ✅ 有意多停渐变（避免紫蓝 AI slop）
 *   ✅ 戏剧性阴影层次
 *   ✅ 大胆字重对比
 *   ✅ 克制动效
 * ============================================================ */

:root {
  /* ---- 原色令牌 ---- */
  --indigo-950: #11162b;
  --indigo-900: #1a1f3a;
  --indigo-800: #232b52;
  --indigo-700: #2d366a;
  --indigo-600: #3b4590;
  --indigo-500: #4a55b0;
  --indigo-400: #6b74c9;
  --indigo-200: #c5c9ee;
  --indigo-100: #e4e6f7;
  --indigo-050: #f3f4fb;

  --amber-600: #c87d3c;
  --amber-500: #d4924f;
  --amber-400: #e0a86a;
  --amber-200: #f5dfc4;
  --amber-100: #faefe1;
  --amber-050: #fdf8f2;

  --emerald-600: #2d8a5e;
  --emerald-500: #3ca076;
  --emerald-200: #c5ecd7;
  --emerald-100: #e4f6ed;

  --rose-600: #be3d4f;
  --rose-500: #d44d60;
  --rose-200: #f5cdd3;
  --rose-100: #fae6e9;

  --warm-900: #1f1d1a;
  --warm-700: #3d3a36;
  --warm-500: #6b6761;
  --warm-400: #918c85;
  --warm-300: #b8b2a9;
  --warm-200: #d9d4cc;
  --warm-100: #ede9e2;
  --warm-050: #f7f5f1;
  --warm-025: #fbfaf7;

  /* ---- 语义令牌 ---- */
  --bg: var(--warm-025);
  --surface: #fff;
  --surface-2: var(--warm-050);
  --text: var(--warm-900);
  --text-2: var(--warm-500);
  --text-3: var(--warm-400);
  --primary: var(--indigo-600);
  --primary-light: var(--indigo-500);
  --primary-dark: var(--indigo-800);
  --accent: var(--amber-500);
  --accent-light: var(--amber-400);
  --accent-dark: var(--amber-600);
  --success: var(--emerald-600);
  --danger: var(--rose-600);
  --border: var(--warm-200);
  --border-light: var(--warm-100);

  /* ---- 阴影系统（从精致到戏剧性） ---- */
  --shadow-xs: 0 1px 2px rgba(26, 31, 58, 0.04);
  --shadow-sm: 0 2px 4px rgba(26, 31, 58, 0.05), 0 4px 12px rgba(26, 31, 58, 0.04);
  --shadow-md: 0 4px 8px rgba(26, 31, 58, 0.07), 0 12px 28px rgba(26, 31, 58, 0.06);
  --shadow-lg: 0 8px 16px rgba(26, 31, 58, 0.08), 0 20px 48px rgba(26, 31, 58, 0.08);
  --shadow-xl: 0 16px 32px rgba(26, 31, 58, 0.10), 0 32px 64px rgba(26, 31, 58, 0.08);

  /* ---- 渐变 ---- */
  --grad-sidebar: linear-gradient(175deg, #151a30 0%, #1e2547 40%, #232e5e 100%);
  --grad-primary: linear-gradient(135deg, var(--indigo-700) 0%, var(--indigo-600) 50%, var(--indigo-500) 100%);
  --grad-primary-hover: linear-gradient(135deg, var(--indigo-800) 0%, var(--indigo-700) 50%, var(--indigo-600) 100%);
  --grad-accent: linear-gradient(135deg, var(--amber-600) 0%, var(--amber-500) 60%, var(--amber-400) 100%);
  --grad-card: linear-gradient(180deg, #fff 0%, #fdfcf9 100%);
  --grad-hero: linear-gradient(135deg, var(--indigo-900) 0%, var(--indigo-800) 30%, var(--indigo-700) 100%);
  --grad-kpi-blue: linear-gradient(135deg, rgba(59, 69, 144, 0.05) 0%, rgba(74, 85, 176, 0.02) 100%);
  --grad-kpi-amber: linear-gradient(135deg, rgba(200, 125, 60, 0.06) 0%, rgba(212, 146, 79, 0.03) 100%);
  --grad-kpi-rose: linear-gradient(135deg, rgba(190, 61, 79, 0.05) 0%, rgba(212, 77, 96, 0.02) 100%);

  /* ---- 字体 ---- */
  --font-cn: "PingFang SC", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", -apple-system, sans-serif;
  --font-num: "SF Mono", "Cascadia Code", "JetBrains Mono", ui-monospace, Consolas, monospace;
  --font-display: "PingFang SC", "Source Han Sans SC", "Noto Sans CJK SC", system-ui, sans-serif;

  /* ---- 尺寸 ---- */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  font-family: var(--font-cn);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgba(74, 85, 176, 0.15); color: var(--indigo-900); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ============================================================
 * 布局骨架
 * ============================================================ */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}

/* ---------- 顶部栏（精致白色 + 模糊底） ---------- */
#topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border-light);
  padding: 14px 16px;
}
#topbar .app-name {
  font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 10px;
  color: var(--text); letter-spacing: -0.01em;
}
#topbar .app-name .logo {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: var(--grad-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-num); font-size: 14px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(59, 69, 144, 0.25);
}
#roleSwitch {
  background: rgba(59, 69, 144, 0.06);
  border: 1px solid rgba(59, 69, 144, 0.12);
  color: var(--primary); border-radius: 999px;
  padding: 6px 14px; font-size: 12.5px; cursor: pointer;
  font-weight: 550; transition: all 0.2s ease;
}
#roleSwitch:hover {
  background: rgba(59, 69, 144, 0.10);
  border-color: rgba(59, 69, 144, 0.25);
}
#roleSwitch b { color: var(--primary-dark); font-weight: 650; }
.top-right { display: flex; align-items: center; gap: 10px; }
.date-badge { display: none; }

/* ---------- 内容区 ---------- */
#view { flex: 1; padding: 16px 16px 80px; overflow-y: auto; }

/* ---------- 提示条 ---------- */
.tip {
  background: var(--indigo-050);
  border: 1px solid var(--indigo-100);
  border-radius: var(--radius);
  padding: 12px 14px; font-size: 13px; margin-bottom: 16px;
  line-height: 1.55; color: var(--indigo-700);
}

/* ============================================================
 * 卡片 / 面板（精致多层次阴影 + 微妙渐变底）
 * ============================================================ */
.card, .panel {
  background: var(--grad-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.panel:hover { box-shadow: var(--shadow-md); }
.card h3, .panel .p-head h5 {
  font-size: 16px; font-weight: 650; letter-spacing: -0.01em;
  margin-bottom: 14px; color: var(--warm-900);
}
.card h3 .more, .panel .p-head .link {
  font-size: 13px; color: var(--primary); font-weight: 500; cursor: pointer;
  transition: color 0.15s;
}
.card h3 .more:hover, .panel .p-head .link:hover {
  color: var(--indigo-500); text-decoration: none;
}

/* ============================================================
 * KPI 指标卡（渐变底 + 精致阴影）
 * ============================================================ */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--grad-kpi-blue);
  border: 1px solid var(--indigo-100);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--grad-primary);
  border-radius: 4px 0 0 4px;
}
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi .k-lab { font-size: 12px; color: var(--text-3); letter-spacing: 0.03em; font-weight: 500; }
.kpi .k-val {
  font-family: var(--font-num); font-size: 28px;
  font-weight: 700; letter-spacing: -0.02em; margin-top: 6px;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.kpi .k-delta { font-size: 11.5px; color: var(--emerald-600); margin-top: 4px; font-weight: 550; }

/* 琥珀/温暖变体 */
.kpi.accent { background: var(--grad-kpi-amber); border-color: var(--amber-200); }
.kpi.accent::before { background: var(--grad-accent); }
.kpi.accent .k-val {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 风险变体 */
.kpi.risk { background: var(--grad-kpi-rose); border-color: var(--rose-200); }
.kpi.risk::before { background: linear-gradient(135deg, var(--rose-600), var(--rose-500)); }
.kpi.risk .k-val {
  background: linear-gradient(135deg, var(--rose-600), var(--rose-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
 * 流程步进器
 * ============================================================ */
.stepper { display: flex; align-items: flex-start; gap: 0; margin-top: 6px; }
.stepper .st { flex: 1; position: relative; padding-top: 26px; text-align: center; }
.stepper .st::before {
  content: ""; position: absolute; top: 8px; left: 0; right: 0;
  height: 2px; background: var(--warm-200);
}
.stepper .st:first-child::before { left: 50%; }
.stepper .st:last-child::before { right: 50%; }
.stepper .st.done::before { background: var(--indigo-400); }
.stepper .dot {
  position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid var(--warm-200); z-index: 1;
  transition: all 0.2s ease;
}
.stepper .st.done .dot {
  background: var(--grad-primary); border-color: transparent;
  box-shadow: 0 2px 6px rgba(59, 69, 144, 0.3);
}
.stepper .st.now .dot {
  background: var(--grad-accent); border-color: transparent;
  box-shadow: 0 0 0 4px rgba(212, 146, 79, 0.2), 0 2px 8px rgba(200, 125, 60, 0.3);
}
.stepper .st span { font-size: 11.5px; color: var(--text-3); font-weight: 500; margin-top: 4px; display: block; }
.stepper .st.now span { color: var(--accent-dark); font-weight: 600; }

/* ============================================================
 * 表格
 * ============================================================ */
.table-wrap { overflow-x: auto; margin-bottom: 2px; }
.tbl-wrap {
  border: 1px solid var(--border-light); border-radius: var(--radius);
  overflow-x: auto; background: var(--surface);
}
table.tbl {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
table.tbl th, table.tbl td {
  text-align: left; padding: 11px 14px;
  border-bottom: 1px solid var(--border-light); vertical-align: middle;
  white-space: nowrap;
}
table.tbl thead th {
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
  letter-spacing: 0.05em; background: var(--warm-050);
  text-transform: uppercase;
}
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--indigo-050); }

/* ============================================================
 * 标签 Tag（精致药丸 + 微妙阴影）
 * ============================================================ */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 550;
  padding: 3px 10px; border-radius: 999px; line-height: 1.5;
}
.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag-normal, .tag.green { background: var(--emerald-100); color: var(--emerald-600); }
.tag-warn, .tag.amber { background: var(--amber-100); color: var(--amber-600); }
.tag-risk, .tag.red { background: var(--rose-100); color: var(--rose-600); }
.tag-muted, .tag.gray { background: var(--warm-100); color: var(--warm-500); }
.tag-blue { background: var(--indigo-100); color: var(--indigo-600); }
.badge {
  font-size: 11px; background: var(--grad-primary);
  color: #fff; border-radius: 999px; padding: 3px 9px; font-weight: 600;
  box-shadow: 0 1px 4px rgba(59, 69, 144, 0.2);
}

/* ============================================================
 * 按钮 Button（渐变 + 微妙阴影）
 * ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; border: none;
  border-radius: var(--radius-sm); padding: 10px 20px;
  font-size: 13.5px; font-weight: 580;
  font-family: var(--font-cn); cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.97); }
.btn-primary, .btn.primary {
  background: var(--grad-primary); color: #fff;
  box-shadow: 0 2px 8px rgba(59, 69, 144, 0.25), 0 1px 2px rgba(26, 31, 58, 0.15);
}
.btn-primary:hover, .btn.primary:hover {
  background: var(--grad-primary-hover);
  box-shadow: 0 4px 16px rgba(59, 69, 144, 0.35), 0 2px 6px rgba(26, 31, 58, 0.2);
  transform: translateY(-1px);
}
.btn-ghost, .btn.ghost {
  background: #fff; color: var(--text); border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover, .btn.ghost:hover {
  border-color: var(--indigo-300); color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.btn-danger, .btn.warn {
  background: var(--rose-100); color: var(--rose-600);
  border: 1px solid var(--rose-200);
}
.btn-danger:hover, .btn.warn:hover {
  background: var(--rose-200); color: var(--rose-600);
  box-shadow: 0 2px 8px rgba(190, 61, 79, 0.15);
}
.btn-sm, .btn.sm { padding: 6px 14px; font-size: 12px; font-weight: 550; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }
.btn:disabled, .btn[disabled] {
  opacity: 0.45; cursor: not-allowed; pointer-events: none;
  filter: grayscale(0.3);
}

/* ============================================================
 * 表单字段
 * ============================================================ */
.field, .form-group { margin-bottom: 14px; }
.field label, .form-group label {
  display: block; font-size: 13px; font-weight: 580;
  color: var(--warm-700); margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.field label b, .form-group label b { font-style: normal; color: var(--rose-600); }
.field input,
.field select,
.field textarea,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13.5px;
  font-family: var(--font-cn); background: #fff; color: var(--text);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--indigo-400);
  box-shadow: 0 0 0 3px rgba(74, 85, 176, 0.10), var(--shadow-xs);
}
.field textarea, .form-group textarea {
  min-height: 80px; resize: vertical; line-height: 1.6;
}
.hint { font-size: 12px; color: var(--text-3); margin-top: 5px; font-weight: 450; }
/* v1.4 项目搜索下拉（下拉+模糊搜索） */
.proj-combo { position: relative; }
.combo-input {
  width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13.5px;
  font-family: var(--font-cn); background: #fff; color: var(--text);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
  box-sizing: border-box;
}
.combo-input:focus {
  outline: none; border-color: var(--indigo-400);
  box-shadow: 0 0 0 3px rgba(74, 85, 176, 0.10), var(--shadow-xs);
}
.combo-list {
  position: absolute; top: calc(100% + 5px); left: 0; right: 0;
  max-height: 264px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(30, 35, 60, 0.16);
  z-index: 60; display: none;
}
.combo-list.open { display: block; }
.combo-item { padding: 8px 13px; cursor: pointer; border-bottom: 1px solid #f2f3f7; }
.combo-item:last-of-type { border-bottom: none; }
.combo-item:hover, .combo-item.on { background: #eef1fb; }
.combo-item .ci-main { font-size: 13.5px; color: var(--text); font-weight: 500; display: flex; align-items: center; }
.combo-item .ci-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.combo-empty { padding: 16px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.combo-more { padding: 8px 13px; font-size: 11.5px; color: var(--text-3); text-align: center; border-top: 1px dashed var(--border); background: #fafbfd; }
.warn-tip {
  font-size: 12.5px; color: var(--rose-600);
  background: var(--rose-100); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-top: 12px;
}
.field-line { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 状态 chip */
.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip, .chip {
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; font-size: 12.5px; cursor: pointer;
  background: #fff; color: var(--text-2);
  transition: all 0.2s ease; user-select: none;
  font-weight: 500;
}
.check-chip:hover, .chip:hover { border-color: var(--indigo-300); }
.check-chip.on, .chip.on {
  background: var(--indigo-050); border-color: var(--indigo-400);
  color: var(--indigo-700); font-weight: 600;
  box-shadow: 0 1px 4px rgba(59, 69, 144, 0.08);
}

/* v1.7 关联图（员工×项目 / 项目×人员，本周突出） */
.link-row { padding: 9px 0; border-bottom: 1px dashed var(--border); }
.link-row:last-child { border-bottom: none; }
.link-row .lr-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.link-row .lr-head b { font-size: 13.5px; }
.link-row .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.link-row .chip { padding: 3px 10px; font-size: 12px; cursor: default; }

/* 自动填充提示 */
.auto-hint {
  font-size: 12.5px; color: var(--text-2);
  background: var(--indigo-050); border: 1px solid var(--indigo-100);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px;
  line-height: 1.5;
}

/* ============================================================
 * 审批分段切换器
 * ============================================================ */
.seg {
  display: flex; background: var(--warm-050); border-radius: var(--radius);
  padding: 3px; margin-bottom: 14px; border: 1px solid var(--border-light);
}
.seg div {
  flex: 1; text-align: center; padding: 9px 0; border-radius: 8px;
  font-size: 13.5px; color: var(--text-2); cursor: pointer;
  transition: all 0.2s ease; font-weight: 500;
}
.seg div.on {
  background: #fff; color: var(--text); font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ============================================================
 * 列表项 + 审批卡
 * ============================================================ */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.list-item:hover { background: rgba(0,0,0,0.01); }
.list-item:last-child { border-bottom: none; }
.list-item .main { flex: 1; min-width: 0; }
.list-item .title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.list-item .desc { font-size: 12.5px; color: var(--text-2); line-height: 1.55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.approve-card {
  border-left: unset;
  border-radius: var(--radius);
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border-light);
  margin-bottom: 8px;
  box-shadow: var(--shadow-xs);
}
.approve-card:last-child { margin-bottom: 0; }
.reason-box {
  background: var(--rose-050); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 12.5px; color: var(--rose-600); margin-top: 8px;
  border: 1px solid var(--rose-100);
}
.reason-box .lab { color: var(--text-3); }

/* ============================================================
 * 报表统计
 * ============================================================ */
/* v1.7.2：报表页两列网格布局——压缩页面纵向长度，窄屏回退单列 */
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; margin-bottom: 16px; }
.report-grid .panel { margin-bottom: 0; display: flex; flex-direction: column; min-width: 0; max-width: 100%; overflow: hidden; }
.report-grid .panel .tbl-wrap { flex: 1; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: #fff; border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 16px 10px; text-align: center;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s ease;
}
.stat-card:hover { box-shadow: var(--shadow-sm); }
.stat-card .n {
  font-family: var(--font-num); font-size: 24px; font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-card .t { font-size: 11.5px; color: var(--text-3); margin-top: 4px; font-weight: 500; }

/* 柱状图 */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12.5px; }
.bar-row .b-lab { width: 48px; color: var(--text-2); flex-shrink: 0; font-weight: 500; }
.bar-row .b-track {
  flex: 1; background: var(--warm-050);
  border-radius: 6px; height: 22px; overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
}
.bar-row .b-fill {
  height: 100%; border-radius: 6px;
  background: var(--grad-primary);
  min-width: 4px; transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 4px rgba(59, 69, 144, 0.15);
}
.bar-row .b-val {
  width: 38px; text-align: right; font-weight: 600; flex-shrink: 0;
  font-family: var(--font-num); font-size: 12.5px; color: var(--text-2);
}

/* ============================================================
 * AI 摘要（深色渐变 + 星光纹理）
 * ============================================================ */
.ai-hero {
  background: var(--grad-hero);
  color: rgba(255,255,255,0.92);
  border-radius: var(--radius-lg);
  padding: 24px 22px; margin-bottom: 16px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.ai-hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(224,168,106,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(107,116,201,0.12) 0%, transparent 50%);
}
.ai-hero .t1 {
  position: relative; font-size: 11px; letter-spacing: 0.14em; opacity: 0.7;
  font-weight: 600; text-transform: uppercase;
  color: var(--amber-400);
}
.ai-hero .t2 {
  position: relative; font-size: 16px; font-weight: 550;
  margin-top: 10px; line-height: 1.6; max-width: 56ch;
}
.ai-hero .nums {
  position: relative; display: flex; gap: 24px; margin-top: 18px; flex-wrap: wrap;
}
.ai-hero .nums div { font-size: 12px; opacity: 0.7; font-weight: 500; }
.ai-hero .nums b {
  display: block; font-family: var(--font-num);
  font-size: 22px; font-weight: 700; opacity: 1; color: #fff;
  margin-top: 2px;
}

/* 风险项 */
.risk-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-light); font-size: 13.5px; }
.risk-item:last-child { border-bottom: none; }
.risk-item .dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; }
.risk-item .dot.r { background: var(--rose-500); box-shadow: 0 0 6px rgba(212,77,96,0.3); }
.risk-item .dot.a { background: var(--amber-500); box-shadow: 0 0 6px rgba(212,146,79,0.3); }

/* ============================================================
 * 系统管理
 * ============================================================ */
.tree .node { margin-bottom: 2px; }
.tree .node .head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 550;
  transition: background 0.12s;
}
.tree .node .head:hover { background: var(--indigo-050); }
.tree .depth-1 { padding-left: 22px; }
.tree .depth-2 { padding-left: 42px; }
.tree .arrow { display: inline-block; width: 14px; color: var(--text-3); font-size: 11px; }
.tree .people { color: var(--text-3); font-size: 12px; margin-left: 6px; }
.person-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--warm-050); border-radius: 999px;
  padding: 4px 12px 4px 5px; margin: 3px 6px 3px 0; font-size: 12.5px;
  border: 1px solid var(--border-light);
  font-weight: 500;
}
.avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--grad-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700;
  box-shadow: 0 1px 4px rgba(59,69,144,0.2);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }

/* ============================================================
 * 底部 Tab 导航
 * ============================================================ */
#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  max-width: 480px; margin: 0 auto;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--border-light);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
#tabbar .tab {
  flex: 1; text-align: center; padding: 8px 0 6px;
  font-size: 10.5px; color: var(--text-3); cursor: pointer;
  transition: color 0.15s; font-weight: 500;
}
#tabbar .tab .ic { display: block; font-size: 19px; line-height: 1.2; margin-bottom: 1px; }
#tabbar .tab.on { color: var(--indigo-600); font-weight: 600; }
#tabbar .tab.on .ic { transform: scale(1.06); }

/* ============================================================
 * 角色切换弹层
 * ============================================================ */
.mask {
  position: fixed; inset: 0;
  background: rgba(26, 31, 58, 0.35); z-index: 30;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-width: 480px; margin: 0 auto;
  background: #fff; border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 31; padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 32px rgba(26, 31, 58, 0.12);
}
.sheet .st { font-size: 16px; font-weight: 650; margin-bottom: 14px; text-align: center; color: var(--text); }
.role-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 8px; border-bottom: 1px solid var(--border-light); cursor: pointer;
  transition: background 0.12s; border-radius: var(--radius-sm);
}
.role-item:hover { background: var(--indigo-050); }
.role-item:last-child { border-bottom: none; }
.role-item .ri-name { font-size: 14.5px; font-weight: 550; }
.role-item .ri-name small { color: var(--text-3); font-size: 12px; margin-left: 8px; }
.role-item .ri-mark { color: var(--primary); font-weight: 650; font-size: 12.5px; }
.hidden { display: none !important; }

/* ============================================================
 * 弹窗
 * ============================================================ */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(26, 31, 58, 0.35); z-index: 40;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal {
  background: #fff; border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); width: 100%; max-width: 400px;
  padding: 24px; box-shadow: var(--shadow-xl);
}
.modal h4 { font-size: 17px; font-weight: 650; margin-bottom: 16px; letter-spacing: -0.01em; }
.modal .close-row { text-align: right; margin-top: 16px; }
.toast {
  position: fixed; left: 50%; top: 40%;
  transform: translate(-50%, -50%);
  background: var(--indigo-900); color: #fff;
  font-size: 13px; padding: 12px 22px; border-radius: var(--radius);
  z-index: 60; max-width: 280px; text-align: center;
  font-weight: 550; box-shadow: var(--shadow-lg);
}

/* ============================================================
 * PC 版（≥900px）：侧栏导航 + 宽屏布局
 * ============================================================ */
#sidebar { display: none; }

@media (min-width: 900px) {
  #app {
    max-width: 100%; flex-direction: row;
    background: var(--bg);
  }

  /* ---- 侧边导航（浅色精致风格） ---- */
  #sidebar {
    display: flex; flex-direction: column;
    width: 224px; flex-shrink: 0;
    background: #fff;
    color: var(--text);
    min-height: 100vh; position: sticky; top: 0; height: 100vh;
    border-right: 1px solid var(--border-light);
  }
  .side-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 22px 18px; font-size: 15px; font-weight: 650;
    border-bottom: 1px solid var(--border-light);
    letter-spacing: -0.01em;
    color: var(--text);
  }
  .side-logo .mark {
    width: 28px; height: 28px; border-radius: var(--radius-sm);
    background: var(--grad-primary); color: #fff;
    display: grid; place-items: center;
    font-family: var(--font-num); font-size: 14px; font-weight: 700;
    box-shadow: 0 2px 8px rgba(59, 69, 144, 0.25);
  }
  .side-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
  .side-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 20px; margin: 2px 10px; font-size: 13.5px;
    color: var(--text-2);
    border-radius: var(--radius-sm); cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
  }
  .side-item:hover {
    background: var(--indigo-050);
    color: var(--indigo-700);
  }
  .side-item.on {
    background: var(--indigo-050);
    color: var(--indigo-700);
    font-weight: 600;
  }
  .side-item .ic { width: 18px; text-align: center; font-size: 14px; opacity: 0.65; }
  .side-item.on .ic { opacity: 1; }
  .side-item .cnt {
    margin-left: auto; font-family: var(--font-num); font-size: 10.5px;
    background: var(--grad-primary); color: #fff;
    padding: 2px 8px; border-radius: 999px; font-weight: 700;
    box-shadow: 0 1px 4px rgba(59, 69, 144, 0.2);
  }
  .side-foot {
    padding: 16px 18px; font-size: 10.5px;
    color: var(--text-3);
    border-top: 1px solid var(--border-light);
    font-family: var(--font-num); letter-spacing: 0.06em;
  }

  /* 主区域 */
  #maincol { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  #topbar {
    position: static;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    padding: 14px 28px;
  }
  .date-badge { display: inline; font-size: 12.5px; color: var(--text-3); }
  #view { padding: 24px 28px 28px; overflow: visible; }

  /* PC 端指标卡：四列 */
  .kpis { grid-template-columns: repeat(4, 1fr); gap: 16px; }

  /* 隐藏移动端 Tab */
  #tabbar { display: none; }

  /* PC 表格增强 */
  table.tbl { font-size: 13.5px; }
  table.tbl th, table.tbl td { padding: 12px 16px; }

  /* PC 端大表单两列 */
  .modal-lg { max-width: 880px; }
  .modal { max-width: 520px; }
  .grid2 { grid-template-columns: 1fr 1fr; }

  /* PC 端角色切换弹层：底部抽屉 → 居中弹窗 */
  .sheet {
    position: fixed;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    bottom: auto; right: auto;
    max-width: 440px; width: calc(100% - 48px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
  }
}

/* ============================================================
 * v4.0 新增组件样式
 * ============================================================ */

/* 周报提醒进度条（首页） */
.reminder-bar {
  background: var(--grad-card);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}
.rm-main { display: flex; align-items: center; gap: 10px; }
.rm-ic { font-size: 18px; }
.rm-t { font-size: 13.5px; font-weight: 600; color: var(--text); }
.rm-s { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.rm-prog {
  margin-top: 8px; height: 6px; background: var(--warm-050);
  border-radius: 999px; overflow: hidden;
}
.rm-prog-fill {
  height: 100%; background: var(--grad-accent);
  border-radius: 999px; transition: width 0.5s ease;
}

/* 小尺寸分段器 */
.seg-sm { padding: 2px; }
.seg-sm div { padding: 6px 0; font-size: 12.5px; }

/* 维度条形图副信息 */
.bar-sub {
  font-size: 11px; color: var(--text-3);
  margin: -4px 0 8px 58px; padding-left: 0;
  font-family: var(--font-num);
}

/* 加班色柱（区别于主柱） */
.b-fill.ot {
  background: var(--grad-accent);
  box-shadow: 0 1px 4px rgba(212, 146, 79, 0.2);
}

/* 强度趋势柱状图 */
.trend-chart {
  display: flex; align-items: flex-end; gap: 6px;
  height: 120px; padding: 12px 4px 0;
  border-bottom: 1px solid var(--border-light);
  margin-top: 8px;
}
.trend-col {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  height: 100%; justify-content: flex-end;
}
.trend-bar {
  width: 60%; min-height: 4px;
  background: var(--grad-primary);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
  box-shadow: 0 -1px 6px rgba(59, 69, 144, 0.15);
}
.trend-lab {
  font-size: 10.5px; color: var(--text-3); margin-top: 6px;
  font-family: var(--font-num);
}
.trend-v {
  font-size: 11px; color: var(--primary); font-weight: 600;
  font-family: var(--font-num);
}

/* AI 月报卡 */
.ai-monthly { background: linear-gradient(180deg, var(--indigo-050) 0%, #fff 60%); }
.monthly-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 10px 0;
}
.m-cell {
  background: #fff; border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 14px 8px; text-align: center;
  box-shadow: var(--shadow-xs);
}
.m-n {
  font-family: var(--font-num); font-size: 22px; font-weight: 700;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.m-t { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* 操作日志列表 */
.log-list { max-height: 480px; overflow-y: auto; }
.log-row {
  padding: 11px 0; border-bottom: 1px solid var(--border-light);
  font-size: 12.5px;
}
.log-row:last-child { border-bottom: none; }
.log-time {
  font-family: var(--font-num); font-size: 11px;
  color: var(--text-3); margin-bottom: 3px;
}
.log-main { color: var(--text); line-height: 1.5; }
.log-detail { color: var(--text-2); font-size: 11.5px; margin-top: 2px; }

/* 大表单（完整字段） */
.modal-lg {
  width: min(1120px, 94vw); max-width: 94vw;
  max-height: 92vh; overflow-y: auto;
  padding: 26px 30px;
}
.modal-lg > h4 { font-size: 16.5px; margin-bottom: 14px; }
.modal-lg .field-line { gap: 0 22px; }
.modal-lg .tbl { font-size: 13px; }
.form-section {
  padding: 14px 0; border-top: 1px dashed var(--border-light);
}
.form-section:first-of-type { border-top: none; padding-top: 0; }
.fs-title {
  font-size: 12px; font-weight: 650; color: var(--accent-dark);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 10px;
}

/* 定量填报模块 */
.module {
  background: var(--warm-050);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 10px;
}
.mod-head {
  display: flex; align-items: center;
  margin-bottom: 8px;
}
.mod-type { font-size: 13px; font-weight: 600; color: var(--primary-dark); }
.mod-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 0; border-top: 1px solid var(--border-light);
}
.mod-item:first-of-type { border-top: none; }
.mod-name {
  flex: 1; min-width: 140px;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 10px; font-size: 12.5px; background: #fff;
}
.mod-hours {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 8px; font-size: 12.5px; background: #fff;
  font-family: var(--font-num);
}
.mod-check {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--text-2); cursor: pointer;
}
.mod-check input { margin: 0; }
.mid-fields input {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 8px; font-size: 11.5px; background: #fff;
  font-family: var(--font-num);
}
.mod-del, .mod-add {
  font-size: 11px; padding: 4px 10px;
}

/* 模态框内表单滚动优化 */
.modal-mask { align-items: flex-start; padding-top: 32px; }
.modal { max-height: 88vh; overflow-y: auto; }

/* ============================================================
 * v4.1 WorkBuddy AI 助手视图
 * ============================================================ */

/* Hero */
.wb-hero {
  background: var(--grad-hero); color: rgba(255,255,255,0.95);
  border-radius: var(--radius-lg); padding: 28px 26px; margin-bottom: 16px;
  position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
}
.wb-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 15% 50%, rgba(224,168,106,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(107,116,201,0.15) 0%, transparent 50%);
}
.wb-hero-t1 { position: relative; font-size: 11px; letter-spacing: 0.14em; font-weight: 600;
  text-transform: uppercase; color: var(--amber-400); margin-bottom: 8px; }
.wb-hero-h { position: relative; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; }
.wb-hero-sub { position: relative; font-size: 13.5px; opacity: 0.82; line-height: 1.65; max-width: 60ch; }
.wb-hero-stats { position: relative; display: flex; gap: 24px; margin-top: 18px; flex-wrap: wrap; }
.wb-hero-stats div { font-size: 11.5px; opacity: 0.7; }
.wb-hero-stats b { display: block; font-family: var(--font-num); font-size: 20px; font-weight: 700;
  opacity: 1; color: #fff; margin-top: 2px; }

/* 三种接入方式 */
.wb-connect { background: var(--grad-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.wb-c-title { font-size: 13px; font-weight: 650; color: var(--accent-dark);
  letter-spacing: 0.04em; margin-bottom: 12px; }
.wb-c-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wb-c-card { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 14px; }
.wb-c-tag { display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; margin-bottom: 8px; }
.wb-c-tag.blue { background: var(--indigo-100); color: var(--indigo-600); }
.wb-c-tag.amber { background: var(--amber-100); color: var(--amber-600); }
.wb-c-tag.green { background: var(--emerald-100); color: var(--emerald-600); }
.wb-c-card h4 { font-size: 13.5px; font-weight: 600; margin-bottom: 5px; color: var(--text); }
.wb-c-card p { font-size: 12px; color: var(--text-2); line-height: 1.55; }

/* 场景卡 */
.wb-scene-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.wb-scene {
  background: var(--grad-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  display: flex; flex-direction: column;
}
.wb-scene:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.wb-head { display: flex; gap: 12px; margin-bottom: 12px; }
.wb-num { flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; color: #fff;
  display: grid; place-items: center; font-family: var(--font-num); font-size: 14px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(59, 69, 144, 0.25); }
.wb-num.blue { background: var(--grad-primary); }
.wb-num.amber { background: var(--grad-accent); box-shadow: 0 2px 8px rgba(200, 125, 60, 0.25); }
.wb-info { flex: 1; min-width: 0; }
.wb-info h3 { font-size: 15.5px; font-weight: 650; margin-bottom: 4px; letter-spacing: -0.005em; }
.wb-trig { font-size: 11.5px; color: var(--text-3); margin-bottom: 6px; }
.wb-trig b { color: var(--text-2); font-weight: 550; }
.wb-sub { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.wb-abilities { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.wb-abilities li { font-size: 12px; color: var(--warm-700); padding-left: 18px; position: relative; line-height: 1.5; }
.wb-abilities li::before { content: "✓"; position: absolute; left: 0; color: var(--emerald-600); font-weight: 700; font-size: 12.5px; }

/* 提示词卡（轻量，无深色代码块） */
.wb-prompt {
  background: var(--warm-050); border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px;
  transition: border-color 0.2s;
}
.wb-prompt:hover { border-left-color: var(--amber-600); }
.wb-prompt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.wb-prompt-lab { font-size: 11.5px; font-weight: 600; color: var(--accent-dark); letter-spacing: 0.03em; }
.wb-copy { font-size: 11.5px; color: var(--indigo-600); background: #fff;
  border: 1px solid var(--indigo-200); padding: 4px 11px; border-radius: 6px;
  cursor: pointer; font-weight: 550; transition: all 0.15s; font-family: var(--font-cn); }
.wb-copy:hover { background: var(--indigo-050); border-color: var(--indigo-400); }
.wb-copy.copied { background: var(--emerald-100); color: var(--emerald-600); border-color: var(--emerald-100); }
.wb-prompt-text {
  font-size: 12.5px; color: var(--warm-700); line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}

/* 效果提示 */
.wb-effect {
  font-size: 12px; color: var(--warm-700); background: var(--emerald-100);
  border-radius: var(--radius-sm); padding: 8px 12px;
  border-left: 3px solid var(--emerald-500);
}
.wb-effect b { color: var(--emerald-600); }

/* 落地路径 */
.wb-roadmap { background: var(--grad-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.wb-r-title { font-size: 13px; font-weight: 650; color: var(--accent-dark);
  letter-spacing: 0.04em; margin-bottom: 12px; }
.wb-r-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.wb-r-step { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 14px; position: relative; }
.wb-r-n { font-family: var(--font-num); font-size: 11px; color: var(--amber-600);
  font-weight: 700; letter-spacing: 0.06em; }
.wb-r-step h5 { font-size: 13px; font-weight: 600; margin: 6px 0 5px; }
.wb-r-step p { font-size: 11.5px; color: var(--text-2); line-height: 1.55; }

/* PC 端布局 */
@media (min-width: 900px) {
  .wb-c-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .wb-scene-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .wb-hero { padding: 36px 32px; }
  .wb-hero-h { font-size: 28px; }
}

/* ---- 网格子项防撑破（审批卡片/流程条在窄列不溢出） ---- */
.grid2 > * { min-width: 0; max-width: 100%; }
.approve-card .fl-track { max-width: 100%; }
.desc, .tv-meta, .title { overflow-wrap: anywhere; }

/* ---- 中屏（721–899px：平板竖屏/窄窗口）：双栏列表一律单列，避免卡片挤压 ---- */
@media (max-width: 899px) {
  .grid2 { grid-template-columns: 1fr; }
  /* 报表页：中屏即降单列/双列，避免图表面板被挤出屏幕（v1.10.1） */
  .report-grid { grid-template-columns: 1fr; gap: 10px; }
  .stat-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 14px 12px; }
  .stat-card .n { font-size: 22px; }
}

/* ---- 平板/窄窗口（641–899px）：放开手机壳 480px 限宽，避免整页挤成一条（v1.10.1） ---- */
@media (min-width: 641px) and (max-width: 899px) {
  #app { max-width: 100%; }
  #topbar { padding: 12px 20px; }
}

@media (max-width: 720px) {
  .wb-scene-grid { grid-template-columns: 1fr; }
  .wb-c-grid { grid-template-columns: 1fr; }
  .wb-r-grid { grid-template-columns: 1fr 1fr; }
  .wb-abilities { grid-template-columns: 1fr; }
}
/* ============================================================
 * H5 移动端全面适配（v0.9.5）
 * 断点 ≤720px；触屏设备 hover 类操作改为常显
 * ============================================================ */
@media (max-width: 720px) {
  /* ---- 骨架 ---- */
  #view { padding: 12px 12px calc(76px + env(safe-area-inset-bottom)); }
  .topbar { padding: 10px 12px; }
  .card { padding: 14px 14px; border-radius: 12px; }
  .panel { padding: 12px 12px; }
  .auto-hint { font-size: 12px; padding: 8px 10px; }

  /* ---- 统计卡片 2 列、双栏 1 列 ---- */
  .stat-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card .n { font-size: 22px; }
  .grid2 { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; gap: 10px; }

  /* ---- 分段器：横向可滑 ---- */
  .seg { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg > div { white-space: nowrap; padding: 7px 14px; font-size: 12.5px; }

  /* ---- 报表面板头：控件行可换行、触屏高度加大（v1.10.1） ---- */
  .p-head > div { flex-wrap: wrap; }
  .p-head select { flex: 1 1 45%; min-width: 130px; height: 38px; font-size: 14px; padding: 4px 10px; }
  .p-head .btn { flex: 1 1 auto; justify-content: center; }
  .p-head h5 { width: 100%; margin-bottom: 10px; }

  /* ---- 表格：横向滚动（保留表头吸左） ---- */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
  .tbl { min-width: 640px; }
  .tbl th { position: sticky; top: 0; background: var(--bg-soft, #f6f7fb); }

  /* ---- 筛选条：纵向堆叠、控件全宽 ---- */
  .hist-filters { flex-direction: column; align-items: stretch; gap: 10px; }
  .hf-item { width: 100%; }
  .hf-item select, .hf-item input { width: 100%; height: 40px; font-size: 16px; }
  .hf-item label { font-size: 12px; }
  .hist-filters .btn { align-self: stretch; height: 40px; }

  /* ---- 弹层：全宽底部卡片化 ---- */
  .modal, .modal-lg {
    width: 100vw !important; max-width: 100vw !important;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    margin: auto 0 0;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .modal-mask { align-items: flex-end; }
  .field-line { grid-template-columns: 1fr; display: grid; gap: 10px; }
  .field input, .field select, .field textarea { font-size: 16px; }

  /* ---- 表单定量行：换行堆叠 ---- */
  .mod-item { flex-wrap: wrap; }
  .mod-name { flex: 1 1 100%; }
  .mod-lab { flex: 1 1 40%; }
  .mod-lab input { width: 100% !important; }

  /* ---- 组织树：缩进减半，操作按钮触屏常显 ---- */
  .tv-kids { margin-left: 8px; padding-left: 8px; }
  .tv-ops { opacity: 1; }
  .tv-leaf { flex-wrap: wrap; }
  .tv-op { padding: 5px 10px !important; font-size: 12px !important; }

  /* ---- 审批/列表卡片 ---- */
  .list-item { flex-direction: column; align-items: stretch; gap: 10px; }
  .list-item > div[style*="flex-shrink:0"] { flex-wrap: wrap; }
  .list-item .btn { min-height: 38px; flex: 1 1 auto; }

  /* ---- 流程进度条：可横滑 ---- */
  .fl-track { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }

  /* ---- 按钮：触屏高度 ---- */
  .btn-sm { min-height: 36px; }
  .btn-block { min-height: 44px; font-size: 14.5px; }

  /* ---- 提醒条 ---- */
  .reminder-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ---- 触屏设备：hover 才显示的操作一律常显（组织树/表格行按钮等） ---- */
@media (hover: none) {
  .tv-ops, .row-ops { opacity: 1 !important; }
}

/* ---- 极窄屏（<360px） ---- */
@media (max-width: 359px) {
  .stat-cards { grid-template-columns: 1fr; }
  .pt-ex-grid { grid-template-columns: 1fr; }
}

/* ---- v1.1.1 自定义字段：企微式拖拽排序列表 ---- */
.cf-list { display: flex; flex-direction: column; gap: 8px; }
.cf-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg, #fff);
  cursor: grab;
  transition: box-shadow .15s, border-color .15s, opacity .15s;
}
.cf-card:hover { border-color: var(--primary, #4a7cf7); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.cf-grip {
  flex: 0 0 auto; color: var(--text-3); display: flex; padding: 4px 2px;
  cursor: grab; user-select: none;
}
.cf-card:active .cf-grip { cursor: grabbing; }
.cf-main { flex: 1 1 auto; min-width: 0; }
.cf-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }
.cf-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-ops { flex: 0 0 auto; display: flex; gap: 4px; }
.cf-ops .btn { padding: 4px 8px; }
.cf-ops .btn[disabled] { opacity: .35; cursor: default; }
.cf-card-off { opacity: .55; }
/* 拖拽中 */
.cf-card.cf-dragging { opacity: .35; cursor: grabbing; }
.cf-card.cf-over-top { box-shadow: 0 -3px 0 0 var(--primary, #4a7cf7); border-radius: 10px 10px 0 0; }
.cf-card.cf-over-bottom { box-shadow: 0 3px 0 0 var(--primary, #4a7cf7); border-radius: 0 0 10px 10px; }
/* H5：操作按钮换行到底部 */
@media (max-width: 640px) {
  .cf-card { flex-wrap: wrap; }
  .cf-main { flex: 1 1 calc(100% - 40px); }
  .cf-ops { flex: 1 1 100%; justify-content: flex-end; padding-top: 4px; border-top: 1px dashed var(--border); }
  .cf-ops .btn-sm { min-height: 32px; }
}

/* ---- v1.2 项目类型管理弹窗（企微风） ---- */
.ptype-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 2px; }
.ptype-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border-light, #eef1f6);
  border-radius: 10px;
  background: var(--bg-soft, #f9fafc);
  transition: border-color .15s, box-shadow .15s;
}
.ptype-row:hover { border-color: var(--primary, #4a7cf7); background: #fff; box-shadow: 0 1px 6px rgba(30, 80, 180, .07); }
.ptype-grip { color: var(--text-3, #98a1b3); flex: 0 0 auto; }
.ptype-inp {
  flex: 1 1 auto; min-width: 0;
  border: none; background: transparent; outline: none;
  font-size: 13.5px; color: var(--ink, #1c2333); padding: 3px 2px;
  border-bottom: 1px dashed transparent;
}
.ptype-inp:focus { border-bottom-color: var(--primary, #4a7cf7); }
.ptype-del {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--border-light, #eef1f6); background: #fff;
  color: var(--text-3, #98a1b3); font-size: 13px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.ptype-del:hover { border-color: #f0a0a0; color: #d24b4b; background: #fdf0f0; }
.ptype-add {
  width: 100%; padding: 9px 0; margin-top: 2px;
  border: 1px dashed var(--border, #dfe3ea); border-radius: 10px;
  background: transparent; color: var(--text-2, #5b6472);
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.ptype-add:hover { border-color: var(--primary, #4a7cf7); color: var(--primary, #4a7cf7); background: #f5f8ff; }

/* ---- v1.3.2 字段模板库 ---- */
.cf-tpl-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; margin-bottom: 8px; }
.cf-tpl-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border-light, #eef1f6); border-radius: 10px;
  background: var(--bg-soft, #f9fafc);
  cursor: pointer; transition: border-color .15s, background .15s;
  font-size: 13px;
}
.cf-tpl-item:hover { border-color: var(--primary, #4a7cf7); background: #fff; }
