/* ================================================================
   设计系统：明亮极简 × 科技质感 (Notion / Stripe 风格)
   ================================================================ */

/* ============== 设计令牌 ============== */
:root {
  /* 间距 */
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-20: 20px;
  --sp-24: 24px;

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.08);
  --shadow-xl: 0 16px 48px rgba(0,0,0,.12);

  /* 色彩 */
  --primary: #4F6AF0;
  --primary-dark: #3B52CC;
  --primary-light: #EEF1FE;
  --bg: #F8F9FC;
  --card: #FFFFFF;
  --text: #1A1D26;
  --muted: #6B7280;
  --border: #E5E7EB;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;

  /* 布局 */
  --header-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* 字体 */
  --font-sans: -apple-system, "Inter", "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* 过渡 */
  --ease-out: .15s ease;
  --ease-out-slow: .2s ease;
}

/* ============== 基础重置 ============== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

/* ============== 精致滚动条 ============== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.2); }

/* ============== 应用骨架 ============== */
.app {
  height: 100vh;
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
}

/* ============== 顶栏 — 毛玻璃 ============== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-16);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 30;
  gap: var(--sp-8);
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  min-width: 0;
}

.topbar h1 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50vw;
  letter-spacing: -.01em;
}

/* ============== 图标按钮 ============== */
.icon-btn {
  background: transparent;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 18px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease-out), color var(--ease-out), transform var(--ease-out);
}
.icon-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.icon-btn:active { transform: scale(.92); }

/* ============== 按钮 — 微交互 ============== */
.btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 7px var(--sp-12);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  font-family: var(--font-sans);
  transition: all var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  background: var(--bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #2E42B3 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,106,240,.3);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-success {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  border-color: #10B981;
}
.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16,185,129,.3);
}
.btn-success:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-sm { padding: var(--sp-4) 10px; font-size: 12px; margin-left: var(--sp-4); }
.nav-btn { padding: 7px 10px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--ease-out);
}
.btn-ghost:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}
.btn-ghost:active { transform: scale(.97); }

/* ============== WebSocket 状态 ============== */
.ws-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px var(--sp-8);
  border-radius: 10px;
  font-size: 11px;
  background: var(--bg);
  color: var(--muted);
  font-weight: 500;
}
.ws-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #9CA3AF; }
.ws-pill.online { color: #047857; background: #D1FAE5; }
.ws-pill.online .dot { background: var(--success); }

/* ============== 用户头像芯片 ============== */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--sp-4) var(--sp-8) var(--sp-4) var(--sp-4);
  border-radius: 20px;
  cursor: pointer;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  transition: background var(--ease-out);
}
.user-chip:hover { background: var(--primary-light); }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; }

/* ============== 内容区 ============== */
.content {
  overflow: auto;
  position: relative;
}

/* ============== 项目列表 ============== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-12);
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-16);
  display: flex;
  gap: var(--sp-12);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--ease-out-slow), transform var(--ease-out-slow), border-color var(--ease-out-slow);
}
.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--primary);
}

.project-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.project-info { flex: 1; min-width: 0; }
.project-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: var(--sp-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: var(--sp-8);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-meta {
  display: flex;
  gap: var(--sp-12);
  font-size: 11px;
  color: #9CA3AF;
  align-items: center;
}

/* ============== 管理后台 ============== */
.admin-tabs {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 18px;
  background: #F1F3F8;
  border-radius: 10px;
  padding: 3px;
}
.admin-tabs button {
  border: 0;
  background: transparent;
  padding: 7px 16px;
  cursor: pointer;
  font-size: 13px;
  color: #6B7280;
  font-family: var(--font-sans);
  border-radius: 8px;
  transition: all .2s ease;
}
.admin-tabs button:hover { color: #374151; }
.admin-tabs button.active {
  color: var(--primary);
  background: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

.data-table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: auto;
  box-shadow: var(--shadow-sm);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.data-table td {
  padding: var(--sp-12) 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: var(--primary-light); }
.data-table tr.row-disabled td { opacity: .55; }

/* 用户管理 */
.user-toolbar {
  margin-bottom: var(--sp-12);
}
.bulk-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: var(--sp-12);
  padding: var(--sp-4) var(--sp-8) var(--sp-4) var(--sp-12);
  background: var(--primary-light);
  border-radius: var(--r-sm);
  flex-wrap: wrap;
}
.bulk-count {
  font-size: 12px;
  color: var(--primary-dark);
  margin-right: var(--sp-4);
}
.bulk-count b { font-weight: 700; }

/* ============== Grid 表格输入弹窗 ============== */
.ui-dialog:has(.grid-table-wrap) {
  max-width: 720px;
}
.grid-table-wrap {
  overflow-x: auto;
  max-height: 50vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.grid-table th {
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: var(--sp-8) 6px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
.grid-table td {
  padding: var(--sp-4);
  border-bottom: 1px solid #F3F4F6;
}
.grid-rownum {
  font-size: 11px;
  color: #D1D5DB;
  text-align: center;
}
.grid-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 7px var(--sp-8);
  font-size: 13px;
  outline: none;
  border-radius: 5px;
  font-family: var(--font-sans);
  color: var(--text);
  transition: border-color var(--ease-out), box-shadow var(--ease-out), background var(--ease-out);
}
.grid-input:focus {
  background: var(--card);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79,106,240,.12);
}
.grid-cb {
  margin: 0 auto;
  display: block;
  cursor: pointer;
  accent-color: var(--primary);
}
.grid-del {
  border: 0;
  background: transparent;
  color: #D1D5DB;
  cursor: pointer;
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: var(--sp-4);
  transition: color var(--ease-out), background var(--ease-out);
}
.grid-del:hover { color: var(--danger); background: #FEF2F2; }

html.is-mobile .ui-dialog:has(.grid-table-wrap) { max-width: 100%; }
html.is-mobile .grid-table th,
html.is-mobile .grid-table td { padding: 6px var(--sp-4); }
html.is-mobile .grid-input { padding: 6px; font-size: 12px; }

/* ============== 数据库管理面板 ============== */
.db-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-12);
}
.db-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.03);
}
.db-card-wide {
  grid-column: 1 / -1;
}
.db-card-head {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.db-card-body {
  padding: 14px;
}
.db-mode-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: var(--sp-8);
  letter-spacing: .02em;
}
.db-mode-sqlite { background: #FEF9EE; color: #B45309; border: 1px solid #FDE68A; }
.db-mode-mysql { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.db-ok { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.db-fail { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.db-meta {
  font-size: 12px;
  color: var(--muted);
  margin: 3px 0;
}
.db-meta code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: var(--sp-4);
  font-size: 11px;
  font-family: var(--font-mono);
}
.db-meta-error {
  font-size: 11px;
  color: #B91C1C;
  background: #FEF2F2;
  padding: 6px var(--sp-8);
  border-radius: 6px;
  margin-top: 6px;
  word-break: break-all;
}
.db-stat {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: #4B5563;
}
.db-warning {
  margin-top: 10px;
  padding: var(--sp-8) 10px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 6px;
  font-size: 12px;
  color: #92400E;
}
.db-tip {
  margin-top: 10px;
  font-size: 12px;
  color: #9CA3AF;
}
.db-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}
.db-table-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 12px;
  transition: background var(--ease-out);
}
.db-table-cell:hover { background: var(--primary-light); }
.db-table-name {
  font-family: var(--font-mono);
  color: #4B5563;
}
.db-table-count {
  font-weight: 600;
  color: var(--text);
}

/* ============== 材料表 ============== */
.materials-wrap { margin-top: 6px; }
.materials-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
}
.materials-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.materials-table th, .materials-table td {
  border-bottom: 1px solid #F3F4F6;
  padding: var(--sp-4) 6px;
  text-align: left;
  vertical-align: top;
}
.materials-table th {
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  position: sticky;
  top: 0;
}
.materials-table th.seq, .materials-table td.seq {
  width: 30px;
  text-align: center;
  color: #D1D5DB;
}
.materials-table th.ops, .materials-table td.ops { width: 32px; text-align: center; }
.mat-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 5px 6px;
  font-size: 12px;
  outline: none;
  border-radius: var(--sp-4);
  font-family: var(--font-sans);
  color: var(--text);
  transition: border-color var(--ease-out), box-shadow var(--ease-out), background var(--ease-out);
}
.mat-input:focus {
  background: var(--card);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79,106,240,.12);
}
.mat-suggest {
  position: absolute;
  z-index: 90;
  min-width: 160px;
  max-height: 180px;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  padding: var(--sp-4);
  display: none;
}
.mat-suggest.open { display: block; }
.mat-suggest-item {
  padding: 6px var(--sp-8);
  border-radius: var(--sp-4);
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
  transition: background var(--ease-out), color var(--ease-out);
}
.mat-suggest-item:hover,
.mat-suggest-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.btn-mini {
  border: 0;
  background: transparent;
  color: #D1D5DB;
  cursor: pointer;
  font-size: 16px;
  width: 24px;
  height: 24px;
  border-radius: 3px;
  transition: color var(--ease-out), background var(--ease-out);
}
.btn-mini:hover { color: var(--danger); background: #FEF2F2; }

html.is-mobile .materials-table th,
html.is-mobile .materials-table td { padding: 3px var(--sp-4); }
html.is-mobile .mat-input { font-size: 12px; padding: var(--sp-4); }

/* 材料表图片单元格 */
.mat-img-cell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border: 1px dashed var(--border);
  border-radius: var(--sp-4);
  outline: none;
  cursor: pointer;
  transition: border-color var(--ease-out), background var(--ease-out);
}
.mat-img-cell:focus,
.mat-img-cell:hover {
  border-color: var(--primary);
  background: rgba(79,106,240,.04);
}
.mat-img-add {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #D1D5DB;
  cursor: pointer;
  transition: color var(--ease-out);
}
.mat-img-cell:focus .mat-img-add,
.mat-img-cell:hover .mat-img-add { color: var(--primary); }
.mat-img-thumb {
  max-width: 100%; max-height: 100%;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 3px;
  cursor: zoom-in;
}
.mat-img-del {
  position: absolute;
  top: -6px; right: -6px;
  width: 18px !important;
  height: 18px !important;
  font-size: 12px !important;
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 50% !important;
  color: var(--danger) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--ease-out);
}
.mat-img-del:hover { transform: scale(1.15); }
.mat-img-uploading {
  font-size: 10px;
  color: #9CA3AF;
  text-align: center;
}

/* ============== 项目设置 / 通用卡片 ============== */
.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-16) 18px;
  box-shadow: var(--shadow-sm);
}
.settings-card h2 {
  font-size: 15px;
  margin: 0 0 6px;
  color: var(--text);
}
.settings-card .muted {
  font-size: 12px;
  color: #9CA3AF;
  margin: 0 0 var(--sp-12);
  line-height: 1.5;
}
.mc-wrap { margin-top: 6px; }

/* ============== 看板 / 列表 ============== */
.board-wrap {
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}
.board {
  display: flex;
  gap: var(--sp-12);
  padding: 14px;
  height: 100%;
  min-width: max-content;
}
.kanban-column {
  width: 300px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  background: #F1F3F8;
  border-radius: var(--r-md);
  max-height: 100%;
  transition: background var(--ease-out);
}
.kanban-column-header {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid;
}
.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  min-height: 60px;
}

.list-view {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.list-view.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--sp-8);
}

/* ============== 看板卡片 — 悬浮交互 ============== */
.kanban-card {
  background: var(--card);
  border-radius: var(--r-sm);
  padding: var(--sp-12);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--ease-out-slow), transform var(--ease-out-slow);
  border-left: 3px solid transparent;
}
.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.kanban-card.priority-low .card-priority-dot { background: var(--success); }
.kanban-card.priority-normal .card-priority-dot { background: #3B82F6; }
.kanban-card.priority-high .card-priority-dot { background: var(--warning); }
.kanban-card.priority-urgent .card-priority-dot { background: var(--danger); }

.card-priority-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: #D1D5DB;
}

.card-row1 { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8); }
.card-code { font-family: var(--font-mono); font-size: 11px; color: #B0B8C9; letter-spacing: .02em; }
.card-title {
  font-size: 14px; font-weight: 500;
  color: var(--text);
  margin: 6px 0;
  line-height: 1.4;
  word-break: break-word;
}
.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: var(--sp-8); font-size: 12px; color: var(--muted); gap: var(--sp-8);
}
.card-due { display: inline-flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.card-due.due-soon { color: var(--warning); font-weight: 500; }
.card-due.overdue { color: var(--danger); font-weight: 600; }
.card-due.completed { color: #059669; font-weight: 600; }

.due-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--sp-8);
  line-height: 1.5;
  white-space: nowrap;
}
.badge-overdue { background: #FEE2E2; color: #B91C1C; }
.badge-today { background: #FEF3C7; color: #B45309; }
.badge-tomorrow { background: #FDE68A; color: #92400E; }
.badge-after { background: var(--primary-light); color: var(--primary-dark); }
.badge-completed { background: #D1FAE5; color: #047857; }

.avatars { display: inline-flex; align-items: center; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: white; font-weight: 600; flex-shrink: 0;
}
.avatar-sm { width: 20px; height: 20px; font-size: 9px; }
.avatar-md { width: 28px; height: 28px; font-size: 12px; }
.avatar-lg { width: 36px; height: 36px; font-size: 14px; }
.avatars .avatar + .avatar { margin-left: -5px; border: 2px solid var(--card); }
.avatar-more { background: #D1D5DB; color: #4B5563; }

.card-thumbs { display: flex; gap: var(--sp-4); margin-top: var(--sp-8); flex-wrap: wrap; }
.thumb-tag {
  font-size: 10px; padding: 2px 7px; border-radius: var(--sp-4);
  background: var(--bg); color: var(--muted);
  display: inline-flex; align-items: center; gap: 3px;
}
.thumb-tag.before { background: #FEF3C7; color: #92400E; }
.thumb-tag.after { background: #D1FAE5; color: #065F46; }

.sortable-ghost { opacity: .35; background: var(--primary-light) !important; }
.sortable-chosen { cursor: grabbing; }
.sortable-drag { transform: rotate(1.5deg); box-shadow: var(--shadow-xl) !important; }

/* 列拖拽手柄 */
.col-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 22px;
  font-size: 12px;
  color: #D1D5DB;
  cursor: grab;
  user-select: none;
  letter-spacing: -2px;
  flex-shrink: 0;
  border-radius: var(--sp-4);
  transition: color var(--ease-out), background var(--ease-out);
}
.col-drag-handle:hover { color: #4B5563; background: rgba(79,106,240,.08); }
.col-drag-handle:active { cursor: grabbing; color: var(--primary); }

/* 列拖拽中样式 */
.col-ghost {
  opacity: .4;
  background: var(--primary-light) !important;
}
.col-chosen { cursor: grabbing; }
.col-drag {
  transform: rotate(1deg);
  box-shadow: var(--shadow-xl) !important;
  opacity: .95;
}

.kanban-cards::-webkit-scrollbar,
.content::-webkit-scrollbar {
  width: 5px; height: 5px;
}
.kanban-cards::-webkit-scrollbar-thumb,
.content::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.1);
  border-radius: 3px;
}
.kanban-cards::-webkit-scrollbar-thumb:hover,
.content::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,.18);
}

/* ============== 浮动新建按钮 ============== */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(18px + var(--safe-bottom));
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-size: 28px;
  border: 0;
  box-shadow: 0 8px 28px rgba(79,106,240,.45);
  cursor: pointer;
  z-index: 25;
  display: none;
  transition: transform var(--ease-out), box-shadow var(--ease-out);
}
.fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(79,106,240,.55);
}
.fab:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(79,106,240,.35);
}

/* ============== 卡片详情 ============== */
.detail-mask {
  position: fixed; inset: 0;
  background: rgba(26,29,38,.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 35;
  display: flex; justify-content: flex-end; align-items: stretch;
  opacity: 0;
  transition: opacity var(--ease-out-slow);
}
.detail-mask.show { opacity: 1; }
.detail-panel {
  background: var(--card);
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  border-radius: 16px 0 0 16px;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,.12);
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.detail-mask.show .detail-panel { transform: translateX(0); }

.detail-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.detail-head .left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.detail-body {
  padding: var(--sp-16) 18px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.detail-foot {
  padding: var(--sp-12) 18px calc(var(--sp-12) + var(--safe-bottom));
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 10px;
  background: var(--bg);
}

/* ============== 表单字段 — 微渐变边框 ============== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 500; color: var(--muted); }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--card);
  outline: none;
  color: var(--text);
  transition: border-color var(--ease-out), box-shadow var(--ease-out);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,106,240,.1), inset 0 0 0 1px rgba(79,106,240,.05);
  background: linear-gradient(to bottom, rgba(79,106,240,.01), var(--card));
}
.textarea { resize: vertical; min-height: 70px; }
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-12);
}

.tag-button {
  border: 1px solid var(--border);
  background: var(--card);
  padding: var(--sp-8) 11px;
  border-radius: var(--r-sm);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  width: 100%;
  font-family: var(--font-sans);
  color: var(--text);
  transition: background var(--ease-out), border-color var(--ease-out);
}
.tag-button:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary);
}
.tag-button:disabled { cursor: not-allowed; opacity: .6; }
.tag-button .dot { width: 8px; height: 8px; border-radius: 50%; }

.assignee-display {
  display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap;
  min-height: 32px;
}
.assignee-display .placeholder { color: #9CA3AF; font-size: 13px; }

.image-zones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-12);
}
@media (max-width: 600px) {
  .image-zones { grid-template-columns: 1fr; }
}
.image-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r-sm);
  padding: 10px;
  background: var(--bg);
  transition: border-color var(--ease-out);
}
.image-zone:hover { border-color: var(--primary); }
.image-zone-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: #4B5563;
  margin-bottom: var(--sp-8);
}
.image-zone-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.image-zone .upload-btn { font-size: 12px; color: var(--primary); cursor: pointer; transition: color var(--ease-out); }
.image-zone .upload-btn:hover { color: var(--primary-dark); }
.image-list {
  display: flex; flex-direction: column; gap: 6px;
  min-height: 80px;
}
.image-list .empty {
  text-align: center; font-size: 12px; color: #9CA3AF;
  padding: var(--sp-16) 0;
}

/* 上传进度 */
.upload-progress {
  margin-top: var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upload-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  transition: opacity var(--ease-out-slow);
}
.upload-item.done { background: #ECFDF5; border-color: #A7F3D0; }
.upload-item.done .upload-fill { background: var(--success); }
.upload-item.failed { background: #FEF2F2; border-color: #FECACA; }
.upload-item.failed .upload-fill { background: var(--danger); }
.upload-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-8);
  margin-bottom: var(--sp-4);
}
.upload-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4B5563;
}
.upload-pct {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.upload-item.done .upload-pct { color: #047857; }
.upload-item.failed .upload-pct { color: #B91C1C; }
.upload-track {
  height: 4px;
  background: #E5E7EB;
  border-radius: 2px;
  overflow: hidden;
}
.upload-fill {
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: 2px;
  transition: width var(--ease-out) linear;
}
.image-item {
  position: relative;
  background: var(--card);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  display: flex;
  gap: var(--sp-8);
  padding: 6px;
  transition: border-color var(--ease-out);
}
.image-item:hover { border-color: var(--primary); }
.image-item img {
  width: 70px; height: 70px;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
  flex-shrink: 0;
}
.image-item .info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
}
.image-item .info .name {
  font-size: 12px; color: #4B5563;
  word-break: break-all; line-height: 1.3;
}
.image-item .info .meta { font-size: 11px; color: #9CA3AF; margin-top: 2px; }
.image-item .del {
  position: absolute; top: var(--sp-4); right: var(--sp-4);
  width: 22px; height: 22px;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.95);
  color: var(--danger);
  cursor: pointer;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease-out);
}
.image-item .del:hover { transform: scale(1.1); }
.receipt-printed-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 500;
}

/* ============== 图片放大查看 ============== */
.image-viewer {
  position: fixed; inset: 0;
  background: rgba(26,29,38,.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-16) var(--sp-16) 96px;
  cursor: zoom-out;
}
.image-viewer img {
  max-width: 100%;
  max-height: calc(100vh - 128px);
  object-fit: contain;
  border-radius: 6px;
}
.image-viewer .close-x {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  width: 40px; height: 40px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: background var(--ease-out), transform var(--ease-out);
  display: flex; align-items: center; justify-content: center;
}
.image-viewer .close-x:hover { background: rgba(255,255,255,.22); transform: scale(1.05); }

.viewer-bar {
  position: absolute;
  bottom: max(42px, calc(env(safe-area-inset-bottom, 0px) + 42px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  padding: var(--sp-8) 16px;
  background: rgba(26,29,38,.55);
  border-radius: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.08);
}
.viewer-hint {
  color: rgba(255,255,255,.6);
  font-size: 12px;
  font-weight: 400;
}
.viewer-btn {
  color: white;
  font-size: 12px;
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.1);
  cursor: pointer;
  transition: background var(--ease-out);
  font-weight: 500;
}
.viewer-btn:hover { background: rgba(255,255,255,.2); }

/* ============== UI 组件库 — 毛玻璃弹窗 ============== */
.ui-mask {
  position: fixed; inset: 0;
  background: rgba(26,29,38,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-16);
  opacity: 0;
  transition: opacity var(--ease-out);
}
.ui-mask.show { opacity: 1; }
.ui-dialog {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  width: 100%;
  max-width: 420px;
  max-height: 86vh;
  border-radius: var(--r-md);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255,255,255,.3);
  transform: scale(.96);
  transition: transform var(--ease-out);
}
.ui-mask.show .ui-dialog { transform: scale(1); }
.ui-head { padding: 14px 18px 6px; }
.ui-head h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.ui-body {
  padding: var(--sp-8) 18px 14px;
  overflow-y: auto;
  flex: 1;
}
.ui-body p {
  margin: 0 0 10px;
  font-size: 14px;
  color: #4B5563;
  line-height: 1.5;
  white-space: pre-wrap;
}
.ui-body .ui-msg { font-size: 13px; color: var(--muted); margin-bottom: var(--sp-8); }
.ui-body-list {
  padding: var(--sp-4) var(--sp-8) 14px;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ui-search { padding: 0 var(--sp-12) var(--sp-8); }
.ui-foot {
  padding: 10px var(--sp-16) calc(10px + var(--safe-bottom));
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-8);
  border-top: 1px solid var(--border);
  background: rgba(248,249,252,.85);
}
.ui-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  font-size: 14px;
  outline: none;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--card);
  transition: border-color var(--ease-out), box-shadow var(--ease-out);
}
.ui-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,106,240,.1);
}
.ui-btn {
  border: 1px solid var(--border);
  background: var(--card);
  padding: var(--sp-8) var(--sp-16);
  border-radius: var(--r-sm);
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  font-family: var(--font-sans);
  transition: all var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.ui-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.ui-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}
.ui-btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-color: var(--primary);
}
.ui-btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #2E42B3 100%);
  box-shadow: 0 4px 12px rgba(79,106,240,.3);
}
.ui-btn-ghost { background: var(--card); color: #4B5563; }
.ui-btn-ghost:hover { background: var(--bg); }
.ui-btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
  color: white;
  border-color: var(--danger);
}
.ui-btn-danger:hover {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
  box-shadow: 0 4px 12px rgba(239,68,68,.3);
}

.ui-option {
  display: flex; align-items: center; gap: 10px;
  padding: 9px var(--sp-12);
  border-radius: var(--r-sm);
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  transition: background var(--ease-out);
}
.ui-option:hover { background: var(--primary-light); }
.ui-option.selected { background: var(--primary-light); }
.ui-option input[type="radio"],
.ui-option input[type="checkbox"] {
  margin: 0; width: 16px; height: 16px;
  cursor: pointer; accent-color: var(--primary);
}
.ui-option-dot { width: 10px; height: 10px; border-radius: 50%; background: #D1D5DB; flex-shrink: 0; }
.ui-option-label { flex: 1; }
.ui-option-hint { font-size: 11px; color: var(--muted); }

/* ============== Toast — 图标区分 ============== */
#ui-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: 14px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  pointer-events: none;
}
.ui-toast-item {
  background: var(--text);
  color: white;
  padding: 10px var(--sp-16);
  border-radius: var(--r-sm);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  max-width: 300px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity var(--ease-out-slow), transform var(--ease-out-slow);
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}
.ui-toast-item::before {
  font-size: 15px;
  flex-shrink: 0;
}
.ui-toast-item.show { opacity: 1; transform: translateY(0); }
.ui-toast-success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}
.ui-toast-success::before { content: "✓"; }
.ui-toast-error {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
}
.ui-toast-error::before { content: "✕"; }
/* 默认 toast 图标 */
.ui-toast-item:not(.ui-toast-success):not(.ui-toast-error)::before { content: "ℹ"; }

/* ============== 用户菜单 / 板菜单 ============== */
.user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  width: 200px;
  padding: 6px;
  z-index: 50;
  margin-top: var(--sp-4);
}
.user-menu .header {
  padding: 10px var(--sp-12);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-4);
}
.user-menu .header .name { font-size: 14px; font-weight: 600; }
.user-menu .header .username { font-size: 11px; color: var(--muted); margin-top: 2px; }
.user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 9px var(--sp-12);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-sans);
  transition: background var(--ease-out), color var(--ease-out);
}
.user-menu button:hover { background: var(--primary-light); color: var(--primary); }

/* ============== 移动端断点 ============== */
@media (max-width: 768px) {
  :root { --header-h: 52px; }
  .topbar { padding: 0 10px; }
  .topbar h1 { font-size: 15px; max-width: 40vw; }
  .desktop-only { display: none !important; }

  .board { padding: 10px; gap: 10px; }
  .kanban-column { width: 84vw; min-width: 84vw; }

  .list-view { grid-template-columns: 1fr; gap: var(--sp-8); }
  .project-grid { grid-template-columns: 1fr; }

  .fab { display: flex; align-items: center; justify-content: center; }

  /* 详情抽屉变底部上滑 */
  .detail-mask { justify-content: center; align-items: flex-end; padding: 0; }
  .detail-panel {
    width: 100%;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-height: 92vh;
    height: auto;
    transform: translateY(100%);
  }
  .detail-mask.show .detail-panel { transform: translateY(0); }

  .ui-dialog { max-width: 100%; border-radius: var(--r-md); }

  /* 表格在手机端横滚 */
  .data-table-wrap { overflow-x: auto; }
  .data-table th, .data-table td { white-space: nowrap; padding: 10px var(--sp-12); }
}

@media (min-width: 769px) {
  .mobile-only { display: none !important; }
}

/* ============== 设备识别强制覆盖 ============== */
html.is-mobile :root { --header-h: 52px; }
html.is-mobile .topbar { padding: 0 10px; }
html.is-mobile .topbar h1 { font-size: 15px; max-width: 40vw; }
html.is-mobile .desktop-only { display: none !important; }
html.is-desktop .mobile-only { display: none !important; }

html.is-mobile .board { padding: 10px; gap: 10px; flex-direction: column; min-width: 0; }
html.is-mobile .board-wrap { overflow-x: hidden; overflow-y: auto; }
html.is-mobile .kanban-column { width: 100%; min-width: 0; max-height: none; }
html.is-mobile .kanban-cards { max-height: 60vh; }

/* 手机端：列标题可点击折叠 */
html.is-mobile .kanban-column-header {
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: rgba(79,106,240,.08);
}
html.is-mobile .kanban-column-header:active { background: #E8EBF3; }
html.is-mobile .kanban-column.collapsed { background: #E8EBF3; }
html.is-mobile .kanban-column.collapsed .kanban-column-header {
  border-bottom-color: transparent !important;
}
.col-caret {
  font-size: 10px;
  color: #9CA3AF;
  width: 12px;
  flex-shrink: 0;
}
.collapsed-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  color: #4B5563;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  padding: 2px var(--sp-8);
  border-radius: 10px;
  white-space: nowrap;
}

html.is-mobile .list-view { grid-template-columns: 1fr; gap: var(--sp-8); }
html.is-mobile .project-grid { grid-template-columns: 1fr; }
html.is-mobile .fab { display: flex; align-items: center; justify-content: center; }

html.is-mobile .detail-mask { justify-content: center; align-items: flex-end; padding: 0; }
html.is-mobile .detail-panel {
  width: 100%;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  max-height: 92vh;
  height: auto;
  transform: translateY(100%);
}
html.is-mobile .detail-mask.show .detail-panel { transform: translateY(0); }
html.is-mobile .ui-dialog { max-width: 100%; border-radius: var(--r-md); }
html.is-mobile .data-table-wrap { overflow-x: auto; }
html.is-mobile .data-table th,
html.is-mobile .data-table td { white-space: nowrap; padding: 10px var(--sp-12); }

html.is-mobile .field-grid { grid-template-columns: 1fr; }
html.is-mobile .image-zones { grid-template-columns: 1fr; }
html.is-mobile .topbar-right { gap: var(--sp-4); }
html.is-mobile .btn { padding: 6px 10px; font-size: 12px; }
html.is-mobile .topbar-right .user-chip .avatar { width: 30px; height: 30px; }

/* ============== 通讯录卡片 — 悬浮交互 ============== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
html.is-mobile .contact-grid { grid-template-columns: 1fr; }

.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  cursor: pointer;
  transition: box-shadow var(--ease-out-slow), transform var(--ease-out-slow), border-color var(--ease-out-slow);
}
.contact-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary);
}
.contact-head {
  display: flex; align-items: center; gap: var(--sp-12);
}
.contact-main { min-width: 0; flex: 1; }
.contact-name {
  font-size: 15px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.contact-role { font-size: 12px; color: var(--muted); margin-top: 2px; }
.contact-rows {
  margin-top: 10px;
  display: flex; flex-direction: column; gap: var(--sp-4);
}
.contact-row {
  font-size: 12px;
  color: #4B5563;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  word-break: break-all;
  transition: color var(--ease-out);
}
.contact-row:hover { color: var(--primary); }
.contact-notes {
  margin-top: 10px;
  padding: var(--sp-8) 10px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 12px;
  color: #4B5563;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ============== 卡片详情：联系人区 ============== */
.contact-list {
  display: flex; flex-direction: column; gap: 6px;
}
.contact-list .empty {
  text-align: center;
  font-size: 12px;
  color: #9CA3AF;
  padding: 14px 0;
}
.contact-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--sp-8) 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color var(--ease-out);
}
.contact-chip:hover { border-color: var(--primary); }
.contact-chip .chip-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.contact-chip .chip-name {
  font-size: 13px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.contact-chip .chip-meta {
  font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.contact-chip .chip-note {
  font-size: 11px;
  color: #B45309;
  background: #FEF3C7;
  padding: 2px 6px;
  border-radius: var(--sp-4);
  margin-top: 2px;
  display: inline-block;
}
.contact-chip-actions {
  display: flex; gap: 2px;
}
.contact-chip-actions .icon-btn { width: 28px; height: 28px; font-size: 14px; }

.contact-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--bg);
  color: #4B5563;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  margin-right: var(--sp-4);
  margin-bottom: 2px;
  transition: background var(--ease-out);
}
.contact-tag:hover { background: var(--primary-light); }
.contact-tag .dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0;
}

/* ============== Ghost 导航按钮 ============== */
.nav-btn-ghost {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  font-family: var(--font-sans);
  transition: background var(--ease-out), color var(--ease-out);
}
.nav-btn-ghost:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* ============== 详情面板 Pill 标签 ============== */
.detail-code-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: .02em;
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* ============== 详情面板字段标签 ============== */
.detail-field-label {
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
}

/* ============== 详情面板保存按钮渐变 ============== */
.detail-save-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-color: var(--primary);
  padding: 7px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--ease-out);
  box-shadow: 0 2px 8px rgba(79,106,240,.25);
}
.detail-save-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #2E42B3 100%);
  box-shadow: 0 4px 14px rgba(79,106,240,.35);
  transform: translateY(-1px);
}
.detail-save-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(79,106,240,.2);
}

/* ============== 详情面板完成按钮精致状态 ============== */
.detail-complete-btn {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  border-color: #10B981;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--ease-out);
  box-shadow: 0 2px 8px rgba(16,185,129,.25);
}
.detail-complete-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 14px rgba(16,185,129,.35);
  transform: translateY(-1px);
}
.detail-complete-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
  color: #047857;
  border-color: #A7F3D0;
}

/* ============== 列头菜单圆点 ============== */
.col-menu-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0;
  cursor: pointer;
  flex-shrink: 0;
  gap: 2px;
  transition: background var(--ease-out);
}
.col-menu-dot span {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #B0B8C9;
  transition: background var(--ease-out);
}
.col-menu-dot:hover { background: var(--primary-light); }
.col-menu-dot:hover span { background: var(--primary); }
