/* ==========================================================================
   筑造工作流 · 组件层（v2 改版）：外壳 / 导航 / 按钮 / 卡片 / 徽标 / 进度
   / 弹窗 / 表单 / 提示 / 表格
   --------------------------------------------------------------------------
   改版要点：
   1. 侧栏 → qianwen 式：64px 纯图标为默认，展开 220px 显示文字；激活项浅蓝底
      + 左侧 3px 蓝条；分组标题仅在展开态显示
   2. 顶栏 → 48px 固定，左侧面包屑，右侧图标区；不再有大块毛玻璃
   3. 卡片 → 去边框，靠 14px 圆角 + 一档轻投影分层
   4. 按钮 → 40px（sm 34 / xs 28），圆角 8px，主色纯蓝无渐变
   5. pill-tabs → 分段控件：浅灰底槽 + 白底激活块
   ========================================================================== */

/* ============================ 应用外壳 ============================ */
.app-shell { display: flex; min-height: 100vh; }

/* ---------------------------- 侧栏 ---------------------------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: 8px 0 12px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: width var(--dur) var(--ease);
}
/* 收起态：纯图标 */
.sidebar.mini {
  width: var(--sidebar-w-mini);
  align-items: center;
}
.sidebar.mini .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar.mini .nav-text,
.sidebar.mini .nav-label,
.sidebar.mini .brand-text,
.sidebar.mini .nav-count { display: none; }
.sidebar.mini .nav-group { width: 100%; align-items: center; }

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px 14px;
  min-height: 38px;
}
.sidebar.mini .brand { justify-content: center; padding: 6px 0 14px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  background: linear-gradient(135deg, #4684ff, #2b5fd9);
  box-shadow: 0 1px 2px rgba(70, 132, 255, 0.28);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.brand-text { min-width: 0; }
.brand-name {
  font-size: 13.5px; font-weight: 600; letter-spacing: 0.11em;
  color: var(--text);
  white-space: nowrap;
}
.brand-tag {
  font-size: 9.5px; color: var(--text-3); letter-spacing: 0.16em;
  text-transform: uppercase; margin-top: 1px;
}

.nav-group {
  display: flex; flex-direction: column; gap: 2px;
  padding: 0 8px; width: 100%;
}
.nav-scroll { flex: 1; overflow-y: auto; scrollbar-width: none; }
.nav-scroll::-webkit-scrollbar { display: none; }
.nav-label {
  font-size: 10.5px; letter-spacing: 0.08em;
  color: var(--text-3); padding: 14px 12px 5px; font-weight: 500;
  white-space: nowrap;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 12px; border-radius: var(--r-md);
  color: var(--text); font-size: 13px; font-weight: 500;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  position: relative; width: 100%;
  background: none; border: none; cursor: pointer;
  font-family: inherit; text-align: left;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item .nav-ico { color: #4b5563; opacity: 0.9; }
.nav-item.active .nav-ico { color: var(--brand-1); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-1); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--brand-1);
}
.nav-item .nav-ico { color: currentColor; opacity: 0.9; }
.nav-item .nav-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .nav-count {
  margin-left: auto; font-size: 10.5px; font-family: var(--font-num);
  background: var(--surface-3); color: var(--text-2);
  padding: 1px 6px; border-radius: var(--r-full);
}
.nav-item.active .nav-count { background: var(--brand-1); color: #fff; }

.sidebar-foot {
  margin-top: auto; padding: 10px 8px 0;
  display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid var(--border);
}

.avatar {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px; color: #fff;
  background: var(--brand-1);
}
.avatar.cool { background: #3b82f6; }
.avatar.violet { background: #8b5cf6; }
.avatar.sm { width: 24px; height: 24px; border-radius: 7px; font-size: 11px; }
.avatar.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 18px; }

/* ---------------------------- 主区 / 顶栏 ---------------------------- */
.main {
  flex: 1; min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  transition: margin-left var(--dur) var(--ease);
}
.app-shell.nav-mini .main { margin-left: var(--sidebar-w-mini); }

.topbar {
  position: fixed; top: 0; right: 0; z-index: 40;
  left: var(--sidebar-w);
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: left var(--dur) var(--ease);
}
.app-shell.nav-mini .topbar { left: var(--sidebar-w-mini); }

.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
/* 面包屑可点击项：button 化后要重置浏览器默认样式（v2 导航不再依赖 <a> 默认导航） */
.crumb {
  background: none; border: none; padding: 2px 4px; margin: 0;
  font: inherit; color: inherit; cursor: pointer;
  border-radius: var(--r-xs);
  max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crumb:hover { color: var(--brand-1); background: var(--brand-soft); }
.crumbs .sep { opacity: 0.55; display: flex; }
.crumbs .cur { color: var(--text); font-weight: 600; }

.topbar > .crumb-holder { min-width: 0; }
.topbar-actions {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  flex: 0 0 auto; overflow-x: auto; scrollbar-width: none;
}
.topbar-actions::-webkit-scrollbar { display: none; }
.topbar-actions > * { flex-shrink: 0; }
@media (max-width: 720px) {
  /* 顶栏右侧现在是用户区，右缘渐隐遮罩会把头像裁掉，移动端直接去掉 */
  .topbar-actions { overflow-x: visible; }
}

/* 顶栏用户区（hub：28px 圆头像 + 姓名 + 下拉箭头，左侧细分隔线） */
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 14px; margin-left: 6px;
  border-left: 1px solid var(--border);
  border-radius: var(--r-sm); cursor: pointer;
  color: var(--text); font-size: 12.5px; font-weight: 500;
  transition: background var(--dur) var(--ease);
}
.topbar-user:hover { background: var(--surface-3); }
.topbar-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--brand-1); color: #fff;
  font-size: 12px; font-weight: 600;
}
.topbar-user .u-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user .u-chev { color: var(--text-3); display: flex; }
@media (max-width: 720px) {
  .topbar-user { padding-left: 10px; }
  .topbar-user .u-name, .topbar-user .u-chev { display: none; }
}

.content {
  padding: calc(var(--topbar-h) + 20px) 24px 40px;
  flex: 1;
}
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.page-desc { color: var(--text-3); font-size: 12px; margin-top: 5px; max-width: 64ch; }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  /* 用纵向内边距 + 行高撑高度，避免写死 height 在中文/高 DPI 下裁字 */
  min-height: 40px; padding: 0 16px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; line-height: 1.4; white-space: nowrap;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
.btn:active { transform: scale(0.98); }
.btn-label { white-space: nowrap; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--brand-1); color: #fff; border-color: var(--brand-1);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn-outline { background: transparent; border-color: var(--border-strong); }
.btn-danger { color: var(--st-block); border-color: #fecaca; background: var(--st-block-soft); }
.btn-danger:hover { background: #fee2e2; border-color: #fca5a5; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-xs { min-height: 28px; padding: 0 10px; font-size: 11.5px; border-radius: var(--r-sm); gap: 4px; }
.btn-lg { min-height: 44px; padding: 0 20px; font-size: 14px; border-radius: var(--r-md); }
.btn-block { width: 100%; }

.icon-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--r-sm); color: var(--text-2);
  background: transparent; border: 1px solid transparent;
  transition: all var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: var(--r-sm); }
.icon-btn.xs { width: 22px; height: 22px; border-radius: var(--r-xs); }
.icon-btn.danger:hover { color: var(--st-block); background: var(--st-block-soft); }

/* ============================ 卡片 ============================ */
/* hub 风格：无边框，只靠 14px 圆角 + 一档轻投影分层 */
.card {
  background: var(--surface);
  border: none;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.card-pad { padding: 18px; }
.card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-bd { padding: 16px 18px; }
.card-ft { padding: 12px 18px; border-top: 1px solid var(--border); }
.card-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.card-hover { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(305px, 1fr)); }

/* ============================ 统计卡（hub：左侧彩条 + 图标块在左 + 底部脚注线） ============================ */
.stat {
  padding: 20px 22px 15px; border-radius: var(--r-lg);
  background: var(--surface); border: none;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  display: block;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.stat.clickable { cursor: pointer; }
.stat.clickable:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--st-color, var(--brand-1));
}
.stat-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.stat-main { min-width: 0; }
.stat-label { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.stat-value {
  font-size: 26px; font-weight: 700; letter-spacing: -0.03em;
  margin-top: 0; line-height: 1.1;
}
.stat-foot {
  font-size: 11.5px; color: var(--text-3);
  margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--surface-3);
}
.stat-ico {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--st-ico-bg, var(--brand-soft)); color: var(--st-color, var(--brand-1));
}
/* 状态色映射：加 .stat-blue / .stat-orange / .stat-green / .stat-red / .stat-gray */
.stat-blue   { --st-color: #2563eb; --st-ico-bg: #eff6ff; }
.stat-orange { --st-color: #e8834a; --st-ico-bg: #fff7ed; }
.stat-green  { --st-color: #22c55e; --st-ico-bg: #f0fdf4; }
.stat-red    { --st-color: #ef4444; --st-ico-bg: #fef2f2; }
.stat-purple { --st-color: #8b5cf6; --st-ico-bg: #f5f3ff; }
.stat-gray   { --st-color: #94a3b8; --st-ico-bg: #f1f5f9; }
/* 历史遗留的色调别名（数据页 / 模板页在用），映射到同一套状态色 */
.stat.cool   { --st-color: #3b82f6; --st-ico-bg: #eff6ff; }
.stat.warm   { --st-color: #e8834a; --st-ico-bg: #fff7ed; }
.stat.violet { --st-color: #8b5cf6; --st-ico-bg: #f5f3ff; }

/* ============================ 徽标 / 标签 ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 500; line-height: 1.7;
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid transparent; white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.st-todo { background: var(--st-todo-soft); color: var(--st-todo); }
.badge.st-doing { background: var(--st-doing-soft); color: var(--st-doing); }
.badge.st-review { background: var(--st-review-soft); color: var(--st-review); }
.badge.st-done { background: var(--st-done-soft); color: var(--st-done); }
.badge.st-block { background: var(--st-block-soft); color: var(--st-block); }
.badge.brand { background: var(--brand-soft); color: var(--brand-1); }
.badge.outline { background: transparent; border-color: var(--border); color: var(--text-2); }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 1px 7px; border-radius: var(--r-xs);
  background: var(--surface-3); color: var(--text-3);
}

/* ---- 分段控件（替代原 pill-tabs）：浅灰槽 + 白底激活块 ---- */
.pill-tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-3); border-radius: var(--r-md);
}
.pill-tab {
  height: 32px; padding: 0 14px; border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 500;
  color: var(--text-2); transition: all var(--dur) var(--ease);
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.pill-tab:hover { color: var(--text); }
.pill-tab.active {
  background: var(--brand-1); color: #fff; font-weight: 600;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}
.pill-tab.active .nav-count { color: rgba(255, 255, 255, 0.85); }
.pill-tab .nav-count { font-size: 10.5px; font-family: var(--font-num); color: var(--text-3); }

/* ---- 二级导航（v2）：一级 Tab 内部的排布方式切换 ----
   和一级 pill-tabs 视觉上区分开——这里用「描边按钮组」而不是灰槽，
   让人一眼看出「这是同一个页面里的另一种看法」。 */
.subnav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.subnav-seg {
  display: inline-flex; gap: 8px;
}
.subnav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: var(--r-md);
  font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  transition: all var(--dur) var(--ease);
}
.subnav-btn:hover { border-color: var(--border-strong); color: var(--text); }
.subnav-btn.active {
  border-color: var(--brand-1); color: var(--brand-1);
  background: var(--brand-soft); font-weight: 600;
}
.subnav .search-box .input,
.subnav .select { min-height: 34px; height: auto; padding-top: 5px; padding-bottom: 5px; font-size: 12.5px; }

/* 侧栏「查看全部项目」入口 */
.nav-more {
  display: block; padding: 7px 12px 4px;
  font-size: 11.5px; color: var(--text-3);
}
.nav-more:hover { color: var(--brand-1); }
.nav-empty { padding: 6px 12px 4px; }
/* 侧栏底部成员头像组 */
.side-people { padding: 2px 4px 4px; flex-wrap: wrap; }

/* ============================ 进度 ============================ */
.bar { height: 6px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: var(--r-full); background: var(--brand-1); transition: width 0.5s var(--ease); }
.bar.thin { height: 4px; }
.bar.cool > i { background: #3b82f6; }
.bar.done > i { background: var(--st-done); }

.ring { position: relative; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring-track { stroke: var(--surface-3); }
.ring-bar { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 0.7s var(--ease); }
.ring-label {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.ring-num { font-family: var(--font-num); font-weight: 700; letter-spacing: -0.04em; }
.ring-sub { font-size: 10px; color: var(--text-3); letter-spacing: 0.04em; }

/* ============================ 表单 ============================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; font-weight: 500; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.label .req { color: var(--st-block); }
.input, .select, .textarea {
  width: 100%; padding: 8px 12px; min-height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 13px; color: var(--text);
  /* 显式行高：<select> 不设 line-height 在高 DPI 下会裁掉中文上下笔画 */
  line-height: 1.5;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.textarea { min-height: 80px; resize: vertical; line-height: 1.65; }
.select {
  appearance: none; cursor: pointer; padding-right: 32px;
  min-height: 40px; padding-top: 8px; padding-bottom: 8px;
  line-height: 1.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }

.search-box { position: relative; width: 100%; max-width: 320px; }
.search-box .input { padding-left: 34px; }
.search-box .s-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }

.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; padding: 3px 0; font-size: 13.5px; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0; margin-top: 1.5px;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; color: #fff;
  transition: all var(--dur) var(--ease);
}
.check .box svg { opacity: 0; transform: scale(0.6); transition: all var(--dur) var(--ease); }
.check input:checked + .box { background: var(--brand-1); border-color: var(--brand-1); }
.check input:checked + .box svg { opacity: 1; transform: none; }
.check:hover .box { border-color: var(--brand-1); }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14); }
.check-text { color: var(--text-2); transition: color var(--dur); }
.check input:checked ~ .check-text { color: var(--text-3); text-decoration: line-through; }
/* 就地编辑时 input 被包在 label 内，兄弟选择器失效，用 :has 兜底 */
.check:has(input:checked) .check-text { color: var(--text-3); text-decoration: line-through; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 38px; height: 22px; border-radius: 999px; padding: 2px;
  background: var(--surface-hi); border: 1px solid var(--border);
  transition: all var(--dur) var(--ease);
}
.switch .knob {
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .track { background: var(--brand-1); border-color: var(--brand-1); }
.switch input:checked + .track .knob { transform: translateX(16px); }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-opt {
  height: 34px; padding: 0 14px; border-radius: var(--r-full); font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--border); color: var(--text-2); background: var(--surface);
  transition: all var(--dur) var(--ease);
}
.seg-opt:hover { border-color: var(--border-strong); color: var(--text); }
.seg-opt.active { background: var(--brand-1); color: #fff; border-color: var(--brand-1); font-weight: 600; }

/* ============================ 弹窗 ============================ */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 22px; animation: fadeIn 0.18s var(--ease);
}
.modal {
  width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  animation: popIn 0.26s var(--ease);
  overflow: hidden;
}
.modal.lg { max-width: 780px; }
.modal.xl { max-width: 1080px; }
.modal.sm { max-width: 420px; }
.modal-hd {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-hd h3 { font-size: 15px; font-weight: 600; }
.modal-bd { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-ft {
  display: flex; align-items: center; gap: 10px; justify-content: flex-end;
  padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.modal-ft .left { margin-right: auto; }

/* ============================ 抽屉 ============================ */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 210;
  width: min(560px, 100vw);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: drawerIn 0.28s var(--ease);
}
@keyframes drawerIn { from { transform: translateX(20px); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* ============================ Toast ============================ */
.toast-root {
  position: fixed; z-index: 400; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px; border-radius: var(--r-md);
  background: var(--text); color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 400;
  animation: popIn 0.26s var(--ease);
  pointer-events: auto; max-width: min(92vw, 480px);
}
.toast .t-ico { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; flex-shrink: 0; }
.toast.success .t-ico { background: var(--st-done); }
.toast.error .t-ico { background: var(--st-block); }
.toast.info .t-ico { background: var(--brand-1); }
.toast.warn .t-ico { background: var(--st-review); }

/* ============================ 空态 / 骨架 ============================ */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 52px 24px; text-align: center; color: var(--text-3);
}
.empty-ico {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-3);
}
.empty-title { font-size: 15px; font-weight: 600; color: var(--text); }
.empty-desc { font-size: 13px; max-width: 42ch; }

.skel {
  border-radius: var(--r-sm); background: var(--skeleton);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}

/* ============================ 分隔 / 提示条 ============================ */
.divider { height: 1px; background: var(--border); margin: 14px 0; border: 0; }
.vdivider { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }

.hint {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-md);
  font-size: 12.5px; line-height: 1.65;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.hint .h-ico { color: var(--brand-1); margin-top: 1px; }
.hint.warn { background: var(--st-review-soft); border-color: #fed7aa; color: #7c2d12; }
.hint.warn .h-ico { color: var(--st-review); }
.hint.cool { background: var(--st-doing-soft); border-color: var(--brand-soft-2); color: #1e3a8a; }
.hint.cool .h-ico { color: var(--brand-1); }

/* ============================ 表格 ============================ */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--text-2);
  padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--surface-2);
  position: sticky; top: 0; z-index: 1;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr { transition: background var(--dur) var(--ease); }
.tbl tbody tr:hover { background: var(--brand-soft); }
.tbl tbody tr.dragging { opacity: 0.4; }
.tbl-wrap { overflow: auto; max-height: 70vh; border-radius: var(--r-lg); }

/* ============================ 同步状态指示 ============================ */
.sync-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: var(--surface-3); color: var(--text-3);
  border: 1px solid transparent;
}
.sync-chip.ok { color: var(--st-done); background: var(--st-done-soft); }
.sync-chip.syncing { color: var(--brand-1); background: var(--brand-soft); }
.sync-chip.syncing svg { animation: spin 1.1s linear infinite; }
.sync-chip.error { color: var(--st-block); background: var(--st-block-soft); }
@media (max-width: 620px) { .sync-chip { padding: 0 8px; } }

/* ============================ 响应式 ============================ */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s var(--ease);
    box-shadow: var(--shadow-lg);
    width: 240px; align-items: stretch;
  }
  .sidebar.mini { width: 240px; align-items: stretch; }
  /* 移动端抽屉里始终显示文字，即使收起态也展开 */
  .sidebar.mini .nav-item { justify-content: flex-start; padding-left: 12px; padding-right: 12px; }
  .sidebar.mini .nav-item .nav-text,
  .sidebar.mini .nav-label,
  .sidebar.mini .brand-text,
  .sidebar.mini .nav-count { display: revert; }
  .sidebar.mini .nav-text { display: inline-block; }
  .sidebar.mini .nav-label,
  .sidebar.mini .brand-text { display: block; }
  .sidebar.mini .nav-count { display: inline-block; }
  .sidebar.mini .brand { justify-content: flex-start; padding: 6px 16px 14px; }
  .sidebar.mini .nav-item { width: 100%; }
  body.nav-open .sidebar { transform: none; }
  .main, .app-shell.nav-mini .main { margin-left: 0; }
  .topbar, .app-shell.nav-mini .topbar { left: 0; }
  .nav-scrim { display: none; }
  body.nav-open .nav-scrim {
    display: block;
    position: fixed; inset: 0; z-index: 55; background: rgba(15, 23, 42, 0.4);
    animation: fadeIn 0.18s var(--ease);
  }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-auto { grid-template-columns: minmax(0, 1fr); }
  .content { padding: calc(var(--topbar-h) + 16px) 14px 48px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .modal, .modal.lg, .modal.xl { max-width: 100%; border-radius: var(--r-lg); }
  .overlay { padding: 10px; align-items: flex-end; }
  .toast-root { bottom: 14px; }
}
@media (min-width: 981px) {
  .nav-scrim, body.nav-open .nav-scrim { display: none !important; }
  .only-mobile { display: none !important; }
  /* 桌面端顶栏上不显示移动端菜单按钮 */
}
@media (max-width: 980px) { .only-desktop { display: none !important; } }
/* ============================== 项目动态铃铛 ============================== */
/* 面板用 fixed 定位：topbar-actions 是 overflow 滚动容器，absolute 会被裁掉 */
.feed-wrap { position: relative; display: flex; }
.bell-btn { position: relative; }
.bell-badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  pointer-events: none;
}
.feed-panel {
  position: fixed; top: calc(var(--topbar-h) + 10px); right: 10px; z-index: 80;
  width: min(380px, 92vw); max-height: min(70vh, 520px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  padding: 8px; overscroll-behavior: contain;
}
.feed-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px 8px; font-weight: 700; font-size: 13px; color: var(--text);
  border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.feed-close {
  background: none; border: none; cursor: pointer; color: var(--text-2);
  display: flex; padding: 4px; border-radius: 8px;
}
.feed-close:hover { background: var(--hover, rgba(15, 23, 42, 0.06)); color: var(--text); }
.feed-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 8px; border-radius: 10px; cursor: pointer;
}
.feed-item:hover { background: var(--hover, rgba(15, 23, 42, 0.05)); }
.feed-ico {
  flex: none; width: 28px; height: 28px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft, rgba(98, 71, 232, 0.1)); color: var(--brand-1);
}
.feed-main { min-width: 0; flex: 1; }
.feed-line1 {
  font-size: 13px; color: var(--text-2); line-height: 1.5;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.feed-line1 b { color: var(--text); }
.feed-sub { font-size: 11px; color: var(--text-3, var(--text-2)); opacity: 0.8; margin-top: 2px; }
.feed-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #6247E8; }
.feed-empty { padding: 24px 8px; text-align: center; font-size: 13px; color: var(--text-2); }

/* ============================== 节点现场照片 ============================== */
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
.photo-cell {
  position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: rgba(15, 23, 42, 0.05);
}
.photo-cell img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.photo-del {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px;
  border: none; border-radius: 8px; cursor: pointer;
  background: rgba(15, 23, 42, 0.62); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.photo-del:hover { background: #ef4444; }
.photo-meta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px;
  font-size: 11px; color: #fff;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.72));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
