/* =========================================================
   项目对接工作台 · 主样式
   简约高级浅色风：灰白底 + 白色圆角卡片 + 单一主色点缀 + 大留白 + 细边框
   ========================================================= */

:root {
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-soft: #EEF0FF;
  --border: #E5E6EB;
  --border-strong: #D5D8DE;
  --text: #1F2329;
  --text-2: #4E5969;
  --text-3: #86909C;
  --danger: #F53F3F;
  --danger-soft: #FFECE8;
  --warning: #FF7D00;
  --warning-soft: #FFF7E8;
  --success: #00B42A;
  --success-soft: #E8FFEA;
  --info: #165DFF;
  --info-soft: #E8F3FF;
  --purple: #722ED1;
  --purple-soft: #F5EBFF;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .04);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, .12);
  --sidebar-w: 224px;
  --topbar-h: 64px;
  /* 表面色（供夜间模式统一覆盖） */
  --surface-2: #FAFBFC;
  --surface-3: #F2F3F5;
  --surface-4: #F7F8FA;
  --surface-5: #FCFCFD;
  --topbar-bg: rgba(255, 255, 255, .86);
  --scrollbar: #D5D8DE;
  --scrollbar-hover: #C0C4CC;
  --placeholder: #C0C4CC;
  --overdue-bg: #FFF6F5;
  --overdue-border: #FDCDC5;
}

/* ==================== 夜间模式 ==================== */
[data-theme="dark"] {
  --bg: #16181D;
  --card: #1E2128;
  --primary: #6366F1;
  --primary-hover: #818CF8;
  --primary-soft: #262A44;
  --border: #2C3038;
  --border-strong: #3A3F49;
  --text: #E5E6EB;
  --text-2: #A9AEB8;
  --text-3: #767B85;
  --danger: #F76965;
  --danger-soft: #3A2325;
  --warning: #FF9A2E;
  --warning-soft: #3A2E1E;
  --success: #27C346;
  --success-soft: #1E3524;
  --info: #4080FF;
  --info-soft: #1E2B44;
  --purple: #9254DE;
  --purple-soft: #2E2340;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .28);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, .5);
  --surface-2: #232730;
  --surface-3: #2A2E37;
  --surface-4: #232730;
  --surface-5: #23262E;
  --topbar-bg: rgba(30, 33, 40, .86);
  --scrollbar: #3A3F49;
  --scrollbar-hover: #4A505A;
  --placeholder: #6B7280;
  --overdue-bg: #332325;
  --overdue-border: #5A3A38;
}
[data-theme="dark"] img { opacity: .92; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }
::-webkit-scrollbar-track { background: transparent; }

/* ==================== 布局骨架 ==================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
}

.brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand-logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
}
.brand-logo svg { width: 18px; height: 18px; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { font-size: 15px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 网站图标预览框（系统设置 · 网站信息） */
.site-logo-preview { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; }
.site-logo-preview img { width: 100%; height: 100%; object-fit: cover; }
.site-logo-empty { font-size: 11px; color: var(--text-3); }

.nav { padding: 14px 12px; flex: 1 1 auto; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item .nav-ico { display: flex; align-items: center; }
.nav-item .nav-ico svg { width: 19px; height: 19px; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex: 0 0 auto;
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
}
.user-chip:hover { background: var(--surface-3); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex: 0 0 auto;
}
.user-meta { flex: 1 1 auto; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-3); }
.logout-btn {
  background: none; border: none; cursor: pointer; color: var(--text-3);
  display: flex; align-items: center; padding: 4px; border-radius: 6px;
}
.logout-btn:hover { color: var(--danger); background: var(--danger-soft); }
.logout-btn svg { width: 18px; height: 18px; }

.main {
  flex: 1 1 auto;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 40;
  gap: 16px;
}
.page-title { font-size: 18px; font-weight: 700; margin: 0; }
.page-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* 主题切换按钮（日 / 夜图标互斥显示） */
.theme-toggle span { display: flex; align-items: center; justify-content: center; }
.theme-toggle .th-sun { display: none; }
[data-theme="dark"] .theme-toggle .th-sun { display: flex; }
[data-theme="dark"] .theme-toggle .th-moon { display: none; }

.content { padding: 24px 28px 48px; flex: 1 1 auto; }

/* 移动端侧栏抽屉 */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text-2); padding: 4px; }
.menu-toggle svg { width: 22px; height: 22px; }
.scrim { display: none; }

/* ==================== 卡片 ==================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-title .nav-ico svg, .card-title svg { width: 17px; height: 17px; }
.card-head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text);
  font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #E02E2E; border-color: #E02E2E; 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-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn-soft:hover { background: #E2E5FF; border-color: transparent; color: var(--primary-hover); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 7px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 44px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }

.link-btn { background: none; border: none; cursor: pointer; color: var(--primary); font-size: 13px; padding: 0; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

/* ==================== 表单 ==================== */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.label .req { color: var(--danger); margin-left: 2px; }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386909C' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.hint { font-size: 12px; color: var(--text-3); }
.input[readonly] { background: var(--surface-4); color: var(--text-2); }

.checkbox, .radio { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.checkbox input, .radio input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

.search-box { position: relative; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.search-box .input { padding-left: 34px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .spacer { flex: 1 1 auto; }

/* ==================== 表格 ==================== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 11px 14px; font-weight: 600; color: var(--text-3);
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12px;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .strong { color: var(--text); font-weight: 600; }

/* ==================== 徽章 / 状态胶囊 ==================== */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-gray { background: var(--surface-3); color: var(--text-2); }
.pill-blue { background: var(--info-soft); color: var(--info); }
.pill-indigo { background: var(--primary-soft); color: var(--primary); }
.pill-orange { background: var(--warning-soft); color: var(--warning); }
.pill-green { background: var(--success-soft); color: var(--success); }
.pill-red { background: var(--danger-soft); color: var(--danger); }
.pill-purple { background: var(--purple-soft); color: var(--purple); }

.badge {
  display: inline-block; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

.tag { display: inline-block; padding: 1px 8px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); font-size: 12px; }

/* ==================== 页签 ==================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
  padding: 10px 16px; cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab svg { width: 16px; height: 16px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .2s; }

/* ==================== 弹窗 ==================== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 100; padding: 40px 16px; overflow-y: auto;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; animation: pop .18s;
}
.modal.lg { max-width: 760px; }
.modal.sm { max-width: 400px; }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 700; margin: 0; }
.modal-close { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--text-3); padding: 4px; border-radius: 6px; display: flex; }
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 22px; max-height: 68vh; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

@keyframes pop { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ==================== Toast ==================== */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 11px 18px; font-size: 14px; font-weight: 500;
  animation: toastIn .22s; max-width: 90vw;
}
.toast svg { width: 18px; height: 18px; flex: 0 0 auto; }
.toast-success { color: var(--success); }
.toast-error { color: var(--danger); }
.toast-info { color: var(--info); }
.toast-success svg { color: var(--success); }
.toast-error svg { color: var(--danger); }
.toast-info svg { color: var(--info); }
.toast.hide { animation: toastOut .2s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-16px); } }

/* ==================== 看板概览 ==================== */
.ov-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.ov-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: all .15s; position: relative; overflow: hidden;
}
.ov-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.ov-card .ov-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.ov-num { font-size: 26px; font-weight: 700; line-height: 1.2; }
.ov-label { font-size: 13px; color: var(--text-2); margin-top: 2px; font-weight: 500; }
.ov-amt { font-size: 12px; color: var(--text-3); margin-top: 6px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-main { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.mt { margin-top: 18px; }

/* ==================== 交付节点泳道 ==================== */
.kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: start; }
.lane { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; min-height: 120px; display: flex; flex-direction: column; }
.lane.overdue { background: var(--overdue-bg); border-color: var(--overdue-border); }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--border); }
.lane.overdue .lane-head { border-bottom-color: var(--overdue-border); }
.lane-count { margin-left: auto; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 0 8px; font-size: 12px; color: var(--text-2); line-height: 20px; }
.lane-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.lane-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px;
  cursor: pointer; transition: all .15s;
}
.lane-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.lane-card.is-overdue { border-left: 3px solid var(--danger); }
.lc-name { font-size: 13px; font-weight: 600; color: var(--text); }
.lc-proj { font-size: 12px; color: var(--text-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-date { font-size: 11px; color: var(--text-3); margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.lc-date.over { color: var(--danger); font-weight: 600; }

/* ==================== 时间轴（沟通跟进） ==================== */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -24px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 3px solid var(--primary); }
.tl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-date { font-size: 13px; font-weight: 600; }
.tl-content { font-size: 13px; color: var(--text-2); margin-top: 6px; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.tl-follow { font-size: 12px; color: var(--warning); margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.tl-follow.over { color: var(--danger); }
.tl-ops { margin-left: auto; display: flex; gap: 6px; }

/* ==================== 列表项（待办/动态） ==================== */
.list-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--surface-2); }
.li-check { flex: 0 0 auto; margin-top: 2px; }
.li-check input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.li-main { flex: 1 1 auto; min-width: 0; }
.li-title { font-size: 14px; font-weight: 500; color: var(--text); }
.li-title.done { text-decoration: line-through; color: var(--text-3); }
.li-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.li-ops { flex: 0 0 auto; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.list-item:hover .li-ops { opacity: 1; }
.due-over { color: var(--danger); font-weight: 600; }
.due-today { color: var(--warning); font-weight: 600; }

/* 待办项：按钮式勾选圆点 / 高亮定位 / 详情行 */
.li-check {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid var(--border-strong); background: var(--card); cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center; color: transparent; transition: all .15s;
}
.li-check:hover { border-color: var(--primary); }
.li-check.checked { background: var(--primary); border-color: var(--primary); color: #fff; }
.li-check svg { width: 13px; height: 13px; }
.todo-item.is-done { opacity: .62; }
.todo-item.is-focus { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.li-detail { margin-top: 5px; white-space: pre-wrap; word-break: break-word; }
.li-ico { width: 13px; height: 13px; vertical-align: -2px; }
.li-sub .proj-link { display: inline-flex; align-items: center; gap: 3px; }
.li-sub .proj-link:hover { color: var(--primary); }

/* ==================== 网址导航 ==================== */
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.cat-tab {
  padding: 6px 15px; border-radius: 20px; background: var(--card); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-2); cursor: pointer; transition: all .15s; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.cat-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.cat-tab .cnt { font-size: 11px; opacity: .8; }

.nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.nav-grid.sortable .nav-card { cursor: grab; }
.nav-grid.sortable .nav-card:active { cursor: grabbing; }
.nav-card {
  display: flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--border); border-radius: 11px;
  padding: 10px 12px; cursor: pointer; transition: all .15s; position: relative;
}
.nav-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.nav-card.dragging { opacity: .4; }
.nav-card.drag-over { border-color: var(--primary); border-style: dashed; }
.nav-ico-box { width: 24px; height: 24px; border-radius: 6px; flex: 0 0 auto; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--surface-3); }
.nav-ico-box img { width: 100%; height: 100%; object-fit: cover; }
.nav-letter { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 12px; }
.nav-info { flex: 1 1 auto; min-width: 0; }
.nav-title { display: block; max-width: 100%; font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 卡片右键浮动菜单 */
.nav-ctx {
  position: absolute; z-index: 200; min-width: 118px; padding: 5px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); display: none;
}
.nav-ctx.show { display: block; }
.nav-ctx button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: none; background: none; cursor: pointer;
  border-radius: 7px; font-size: 13px; color: var(--text-2); font-family: inherit; text-align: left;
}
.nav-ctx button:hover { background: var(--primary-soft); color: var(--primary); }
.nav-ctx button.danger:hover { background: var(--danger-soft); color: var(--danger); }
.nav-ctx button svg { width: 15px; height: 15px; flex: 0 0 auto; }

.cat-manage-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cat-manage-item:last-child { border-bottom: none; }
.cat-drag { cursor: grab; color: var(--text-3); display: flex; }
.cat-drag svg { width: 16px; height: 16px; }

/* ==================== 服务项明细表（协议） ==================== */
.item-row { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; background: var(--surface-5); }
.item-seq { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.item-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.item-fields .full { grid-column: 1 / -1; }
.amount-total { display: flex; align-items: baseline; gap: 8px; justify-content: flex-end; padding: 14px 4px; font-size: 14px; }
.amount-total .big { font-size: 24px; font-weight: 700; color: var(--primary); }
.amount-upper { color: var(--text-2); font-size: 13px; }

/* ==================== 交付节点表 ==================== */
.ms-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ms-row:last-child { border-bottom: none; }
.ms-row.overdue { background: var(--overdue-bg); }
.ms-name { font-weight: 600; font-size: 14px; }
.ms-dates { font-size: 12px; color: var(--text-3); }

/* ==================== 空状态 / 加载 ==================== */
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty svg { width: 46px; height: 46px; color: var(--border-strong); margin-bottom: 12px; }
.empty-text { font-size: 14px; }
.empty-sub { font-size: 12px; margin-top: 6px; }
.loading { text-align: center; padding: 40px; color: var(--text-3); font-size: 13px; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== 登录页 ==================== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(1200px 600px at 50% -10%, var(--primary-soft) 0%, var(--bg) 55%); }
.login-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 40px 36px; }
.login-logo { width: 54px; height: 54px; border-radius: 14px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.login-logo svg { width: 30px; height: 30px; }
.login-title { text-align: center; font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.login-sub { text-align: center; font-size: 13px; color: var(--text-3); margin: 0 0 28px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.captcha-row { display: flex; gap: 10px; }
.captcha-row .input { flex: 1 1 auto; }
.captcha-img { width: 116px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); cursor: pointer; flex: 0 0 auto; background: var(--surface-3); object-fit: cover; }
.login-tip { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 20px; }
.login-err { background: var(--danger-soft); border: 1px solid var(--overdue-border); color: var(--danger); border-radius: 8px; padding: 9px 12px; font-size: 13px; display: none; }
.login-err.show { display: block; }

/* ==================== 工具类 ==================== */
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-16 { font-size: 16px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.pointer { cursor: pointer; }
.center { text-align: center; }
.right { text-align: right; }

.detail-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.detail-title { font-size: 22px; font-weight: 700; margin: 0; }
.detail-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--text-3); }
.detail-head-ops { margin-left: auto; display: flex; gap: 8px; flex: 0 0 auto; }

.kv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; }
.kv { display: flex; flex-direction: column; gap: 3px; }
.kv .k { font-size: 12px; color: var(--text-3); }
.kv .v { font-size: 14px; color: var(--text); font-weight: 500; word-break: break-word; }
.kv .v.money { color: var(--primary); font-weight: 700; }

.status-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.flow-step { padding: 5px 12px; border-radius: 8px; background: var(--surface-3); color: var(--text-3); font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all .15s; }
.flow-step:hover { border-color: var(--primary); color: var(--primary); }
.flow-step.active { background: var(--primary); color: #fff; }
.flow-arrow { color: var(--text-3); display: flex; }
.flow-arrow svg { width: 14px; height: 14px; }

/* ==================== 响应式 ==================== */
@media (max-width: 1100px) {
  .ov-grid { grid-template-columns: repeat(3, 1fr); }
  .kanban { grid-template-columns: repeat(3, 1fr); }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .22s; width: 240px; flex-basis: 240px; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 45; }
  .scrim.show { display: block; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 0 16px; }
  .grid-2, .grid-3, .form-grid, .kv-grid, .item-fields { grid-template-columns: 1fr; }
  .ov-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban { grid-template-columns: 1fr; }
  .nav-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 520px) {
  .ov-grid { grid-template-columns: 1fr 1fr; }
  .detail-head { flex-direction: column; }
  .detail-head-ops { margin-left: 0; }
}

/* ==================== 外部首页 ==================== */
body.home { background: var(--bg); }
.home-layout { display: flex; height: 100vh; overflow: hidden; }

/* 左栏：品牌 + 看板数据 */
.home-side {
  flex: 0 0 340px; width: 340px; display: flex; flex-direction: column;
  background: var(--card); border-right: 1px solid var(--border); min-height: 0;
}
.side-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.side-brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: 1 1 auto; min-width: 0; }
.side-brand:hover { color: var(--text); }
.side-logo {
  width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden;
}
.side-logo svg { width: 20px; height: 20px; }
.side-logo img { width: 100%; height: 100%; object-fit: cover; }
.side-name { font-size: 16px; font-weight: 700; letter-spacing: .3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-admin {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-2); transition: all .15s;
}
.side-admin svg { width: 18px; height: 18px; }
.side-admin:hover { background: var(--primary-soft); color: var(--primary); }

/* 侧栏快捷新增（项目 / 待办 / 网址） */
.side-adds { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.side-add {
  flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 6px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2);
  color: var(--text-2); font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all .15s;
}
.side-add svg { width: 15px; height: 15px; }
.side-add:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.side-scroll { flex: 1 1 auto; overflow-y: auto; padding: 4px 16px 20px; min-height: 0; }
.side-sec { padding: 14px 0; border-bottom: 1px solid var(--border); }
.side-sec:last-child { border-bottom: none; }
.side-sec-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.side-sec-h svg { width: 16px; height: 16px; color: var(--primary); flex: 0 0 auto; }
.side-sec-h .side-more { margin-left: auto; font-size: 12px; font-weight: 500; }

/* 概览小格 */
.side-ov { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.side-ov-item {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px;
  padding: 9px 10px 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
  color: var(--text); transition: all .15s;
}
.side-ov-item:hover { border-color: var(--primary); transform: translateY(-1px); color: var(--text); }
.sov-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.sov-num { font-size: 20px; font-weight: 700; line-height: 1.1; }
.sov-label { font-size: 12px; color: var(--text-2); }

/* 今日提醒统计 */
.side-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.side-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.side-stat:hover { border-color: var(--primary); }
.side-stat b { font-size: 18px; font-weight: 700; line-height: 1.1; }
.side-stat i { font-size: 11px; font-style: normal; color: var(--text-3); }
.side-stat.danger b { color: var(--danger); }
.side-stat.warning b { color: var(--warning); }
.side-stat.info b { color: var(--info); }

/* 紧凑列表 */
.side-list { display: flex; flex-direction: column; gap: 2px; }
.side-li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 9px; color: var(--text); transition: background .15s; }
.side-li:hover { background: var(--surface-3); color: var(--text); }
.sli-t { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sli-s { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sli-s em { font-style: normal; }
.sli-s .pill { padding: 0 8px; line-height: 18px; font-size: 11px; }
.sli-c { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-empty { font-size: 12px; color: var(--text-3); padding: 10px; text-align: center; }

/* 侧栏全部待办（快捷勾选完成） */
.side-todo-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--text-2); margin: 14px 0 8px; }
.side-todo-head .stc {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-3);
  color: var(--text-2); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.side-todos { display: flex; flex-direction: column; gap: 2px; }
.side-todo { display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px; border-radius: 9px; transition: background .15s; }
.side-todo:hover { background: var(--surface-3); }
.st-check { flex: 0 0 auto; margin-top: 1px; }
.st-main { flex: 1 1 auto; min-width: 0; }
.st-title { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-sub { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.st-sub em { font-style: normal; }
.st-sub .pill { padding: 0 8px; line-height: 18px; font-size: 11px; }
.st-proj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }

/* 左栏底部 */
.side-foot { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.sf-hi { font-size: 13px; font-weight: 600; white-space: nowrap; }
.sf-date { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-theme {
  margin-left: auto; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--card); color: var(--text-2); display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex: 0 0 auto; transition: all .15s;
}
.sf-theme:hover { color: var(--primary); border-color: var(--primary); }
.sf-theme svg { width: 18px; height: 18px; }

/* 主区：搜索 + 分类网址卡片 */
.home-main { flex: 1 1 auto; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; }
.home-hero {
  padding: 40px 32px 20px; text-align: center; flex: 0 0 auto;
  background: radial-gradient(900px 320px at 50% -20%, var(--primary-soft) 0%, transparent 70%);
}
.hero-search {
  display: flex; align-items: center; gap: 8px; max-width: 640px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 6px 6px 6px 18px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.hero-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.hero-ico { display: flex; color: var(--text-3); flex: 0 0 auto; }
.hero-ico svg { width: 20px; height: 20px; }
.hero-search input {
  flex: 1 1 auto; min-width: 0; border: none; outline: none; background: none;
  font-size: 15px; color: var(--text); font-family: inherit; padding: 8px 4px;
}
.hero-search input::placeholder { color: var(--placeholder); }
.hero-go {
  flex: 0 0 auto; height: 38px; padding: 0 22px; border: none; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.hero-go:hover { background: var(--primary-hover); }
.hero-tip { font-size: 12px; color: var(--text-3); margin-top: 12px; min-height: 18px; }

.home-body { padding: 8px 32px 24px; flex: 1 1 auto; }
.home-body .cat-tabs { margin-bottom: 18px; }
.home-foot { text-align: center; color: var(--text-3); font-size: 12px; padding: 20px; flex: 0 0 auto; }

/* 右下浮动快捷操作 */
.fab-stack { position: fixed; right: 22px; bottom: 22px; z-index: 70; display: flex; flex-direction: column; gap: 12px; }
.fab {
  width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border); color: var(--text-2);
  box-shadow: var(--shadow-lg); cursor: pointer; transition: all .15s; text-decoration: none;
}
.fab svg { width: 20px; height: 20px; }
.fab:hover { color: #fff; background: var(--primary); border-color: var(--primary); transform: translateY(-2px); }

@media (max-width: 1100px) {
  .home-side { flex: 0 0 300px; width: 300px; }
}
@media (max-width: 860px) {
  .home-layout { flex-direction: column; height: auto; overflow: visible; }
  .home-side { flex: 0 0 auto; width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .side-scroll { overflow: visible; }
  .home-main { overflow: visible; }
  .home-hero { padding: 28px 16px 16px; }
  .home-body { padding: 8px 16px 24px; }
  .fab-stack { right: 14px; bottom: 14px; gap: 10px; }
  .fab { width: 42px; height: 42px; }
}

/* ==================== 协议服务项列表 ==================== */
#itemRows { display: flex; flex-direction: column; gap: 6px; }
.svc-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); transition: border-color .15s;
}
.svc-row:hover { border-color: var(--primary); }
.svc-seq {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.svc-title { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-amt { flex: 0 0 auto; font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.svc-ops { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; }
.svc-empty { padding: 18px 12px; text-align: center; border: 1px dashed var(--border); border-radius: 10px; }
