/* ==========================================================================
   NOVAIX 交付中台 · 样式
   基于 NOVAIX Console Design System（2026-09-23）
   规则：科技蓝单主色 / 藏青中性底 / 分组色标识业务域 / 不用竖条做装饰
   ========================================================================== */

:root {
  --primary: #146BFF;
  --primary-600: #0F56D6;
  --primary-700: #0B41A8;
  --blue-50: #EBF3FF;
  --blue-100: #D6E4FF;
  --navy: #0A1B3D;

  --bg: #F2F4F8;
  --panel: #FFFFFF;

  --border-card: #E4E9F2;
  --border-control: #D4DBE6;
  --border-divider: #EDF1F7;

  --t-primary: #0A1B3D;
  --t-body: #3C4A5C;
  --t-muted: #6B7280;
  --t-weak: #7B8798;
  --t-faint: #A9B4C2;
  --t-placeholder: #A5AEBD;

  --danger: #DC2626;
  --danger-bg: #FDECEC;
  --success: #059669;
  --success-bg: #E7F6EF;
  --warn-bg: #FFF9EC;
  --warn-border: #FDE7C7;
  --warn-text: #8A6A1F;
  --lock-bg: #FDF3E3;
  --lock-text: #A56A12;

  --r-xs: 4px;
  --r-icon: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  --sh-card: 0 4px 24px rgba(10, 27, 61, .08);
  --sh-hover: 0 12px 40px rgba(10, 27, 61, .14);
  --sh-cta: 0 8px 24px rgba(20, 107, 255, .28);
  --sh-drawer: 0 25px 50px -12px rgba(10, 27, 61, .35);
  --sh-pop: 0 16px 44px rgba(10, 27, 61, .16);

  --sb-w: 264px;
  --top-h: 64px;
  --content-max: 1280px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--t-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
button { font-family: inherit; }
::selection { background: var(--blue-100); color: var(--navy); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D3DAE5; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #B9C3D2; background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   布局骨架
   ========================================================================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sb-w);
  flex: none;
  background: var(--panel);
  border-right: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px;
  border-bottom: 1px solid var(--border-divider);
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--blue-50);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-size: 15px; font-weight: 700; color: var(--t-primary); letter-spacing: .2px; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: var(--t-muted); }

/* 导航：条目高度按两倍做，图标与字号同步放大 */
.nav { flex: 1; overflow-y: auto; padding: 14px 12px 18px; }
.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  color: var(--t-faint);
  padding: 18px 12px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 14px;
  border-radius: var(--r-md);
  color: var(--t-body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background .12s ease, color .12s ease;
  position: relative;
}
.nav-item + .nav-item { margin-top: 2px; }
.nav-item:hover { background: rgba(10, 27, 61, .045); }
.nav-item .nav-ico {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex: none;
}
.nav-item .nav-ico svg { width: 15px; height: 15px; stroke-width: 2.2; }
.nav-item .nav-count {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--t-muted);
  min-width: 22px;
  text-align: center;
}
.nav-item.active { background: var(--soft, var(--blue-50)); color: var(--text-c, var(--primary-600)); font-weight: 700; }
.nav-item.active .nav-count { color: var(--text-c, var(--primary-600)); }
.nav-item .nav-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dot, var(--primary));
  margin-left: auto;
}

.sidebar-foot {
  margin: auto 10px 12px;
  padding: 12px;
  border: 1px solid var(--border-card);
  border-radius: var(--r-md);
}
.service-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--t-body); font-weight: 600; }
.service-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.service-dot.off { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.service-meta { font-size: 11.5px; color: var(--t-faint); margin-top: 4px; line-height: 1.5; word-break: break-all; }

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgba(242, 244, 248, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-card);
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--t-primary); white-space: nowrap; }
.crumb .crumb-sub { font-size: 12.5px; font-weight: 500; color: var(--t-muted); }

.searchbox { flex: 1; max-width: 440px; position: relative; }
.searchbox svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--t-faint); }
.searchbox input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border-control);
  border-radius: var(--r-md);
  background: var(--panel);
  padding: 0 14px 0 36px;
  font-size: 13.5px;
  color: var(--t-primary);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.searchbox input::placeholder { color: var(--t-placeholder); }
.searchbox input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--blue-100); }

/* 搜索结果：行式列表，靠间距和字重分层，不用装饰线 */
.sr-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.sr-item {
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--r-md);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.sr-item:hover { border-color: var(--blue-100); box-shadow: var(--sh-card); transform: translateY(-1px); }
.sr-head { display: flex; align-items: baseline; gap: 12px; }
.sr-title { font-size: 14.5px; font-weight: 650; color: var(--t-primary); line-height: 1.4; }
.sr-score { margin-left: auto; font-size: 11.5px; color: var(--t-faint); font-variant-numeric: tabular-nums; }
.sr-sum {
  margin-top: 6px; font-size: 13px; color: var(--t-body); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sr-outline {
  margin-top: 6px; font-size: 12.5px; color: var(--t-weak); line-height: 1.6;
  word-break: break-word;
}
.sr-meta { margin-top: 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--t-muted); }
.sr-sep { color: var(--t-faint); }
.sr-tag {
  padding: 1px 7px; border-radius: var(--r-xs);
  background: var(--bg); color: var(--t-weak); font-size: 11.5px;
}
.sr-date { margin-left: auto; color: var(--t-faint); font-size: 11.5px; }

.search-tips { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.search-tip { font-size: 13px; color: var(--t-muted); line-height: 1.7; }
.search-tip code {
  padding: 1px 6px; border-radius: var(--r-xs);
  background: var(--blue-50); color: var(--primary-600); font-size: 12px;
}
@media (max-width: 768px) {
  .sr-item { padding: 14px; }
  .sr-score { display: none; }
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* 内容区 */
.content { flex: 1; width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 24px; }

/* ==========================================================================
   通用组件
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--t-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--sh-cta); }
.btn-primary:hover { background: var(--primary-600); }
.btn-primary:disabled { opacity: .55; box-shadow: none; cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--panel); border-color: var(--border-control); color: var(--t-primary); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-600); }
.btn-subtle { color: var(--t-body); }
.btn-subtle:hover { background: rgba(10, 27, 61, .05); color: var(--t-primary); }
.btn-danger { background: var(--panel); border-color: var(--border-control); color: var(--t-muted); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-icon { width: 36px; padding: 0; }

.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: var(--r-sm);
  color: var(--t-muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: rgba(10, 27, 61, .06); color: var(--t-primary); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }

/* 页头 */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head-main { min-width: 0; }
.page-title { font-size: 20px; font-weight: 700; color: var(--t-primary); line-height: 1.3; }
.page-desc { font-size: 13px; color: var(--t-muted); margin-top: 3px; }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }

/* 卡片 / 面板 */
.panel {
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-divider);
}
.panel-title { font-size: 14px; font-weight: 700; color: var(--t-primary); }
.panel-title .muted { font-weight: 500; color: var(--t-faint); margin-left: 6px; font-size: 12.5px; }
.panel-body { padding: 18px 20px; }
.panel-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* 徽标 / 标签 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--r-full);
  white-space: nowrap;
}
.badge-soft { background: var(--soft, var(--blue-50)); color: var(--text-c, var(--primary-600)); }
.badge-neutral { background: rgba(10, 27, 61, .055); color: var(--t-muted); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-lock { background: var(--lock-bg); color: var(--lock-text); }
.badge-outline { background: var(--panel); color: var(--t-muted); border: 1px solid var(--border-card); }

.tag { font-size: 11.5px; color: var(--t-weak); background: rgba(10, 27, 61, .04); padding: 3px 8px; border-radius: var(--r-sm); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--t-faint)); flex: none; }

/* 分段控件（Tab） */
.tabs-wrap {
  position: sticky;
  top: var(--top-h);
  z-index: 20;
  background: rgba(242, 244, 248, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 0 12px;
  margin-bottom: 4px;
}
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #E8ECF3;
  border-radius: var(--r-md);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--t-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.tab:hover { color: var(--t-primary); }
.tab.active { background: var(--panel); color: var(--t-primary); box-shadow: 0 1px 3px rgba(10, 27, 61, .12); }
.tab .tab-count { font-size: 11.5px; font-weight: 500; color: var(--t-faint); }
.tab.active .tab-count { color: var(--primary); }

/* 区块 */
.section { margin-bottom: 28px; scroll-margin-top: calc(var(--top-h) + 68px); }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-ico {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  background: var(--soft, var(--blue-50));
  color: var(--text-c, var(--primary-600));
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.section-ico svg { width: 15px; height: 15px; }
.section-title { font-size: 14.5px; font-weight: 700; color: var(--t-primary); }
.section-count { font-size: 12px; color: var(--t-faint); font-weight: 500; }
.section-hint { font-size: 12.5px; color: var(--t-muted); }
.section-head .btn { margin-left: auto; }
.section-divider { height: 1px; background: var(--border-divider); margin: 0 0 24px; }

/* 空态 */
.empty {
  background: var(--panel);
  border: 1px dashed var(--border-control);
  border-radius: var(--r-lg);
  padding: 34px 24px;
  text-align: center;
}
.empty-ico {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--blue-50);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.empty-ico svg { width: 20px; height: 20px; }
.empty h3 { font-size: 14.5px; font-weight: 700; color: var(--t-primary); margin-bottom: 4px; }
.empty p { font-size: 12.5px; color: var(--t-muted); margin-bottom: 14px; }

/* ==========================================================================
   总览
   ========================================================================== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: 16px 18px;
}
.stat-label { font-size: 12.5px; color: var(--t-muted); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--t-primary); line-height: 1.15; margin-top: 6px; letter-spacing: -.5px; }
.stat-hint { font-size: 11.5px; color: var(--t-faint); margin-top: 2px; }

.overview-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.mod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mod-card {
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: 18px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.mod-card:hover { transform: translateY(-2px); box-shadow: var(--sh-hover); border-color: var(--border-control); }
.mod-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mod-card-ico {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: var(--soft); color: var(--text-c);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.mod-card-ico svg { width: 16px; height: 16px; }
.mod-card-title { font-size: 14.5px; font-weight: 700; color: var(--t-primary); }
.mod-card-count { margin-left: auto; font-size: 12px; color: var(--t-faint); font-weight: 600; }
.mod-card-desc { font-size: 12.5px; color: var(--t-muted); line-height: 1.55; min-height: 38px; }
.mod-card-foot { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--text-c); font-weight: 600; }
.mod-card-foot svg { width: 13px; height: 13px; }

/* 提醒 */
.alert-panel {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.alert-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--warn-text); margin-bottom: 8px; }
.alert-head svg { width: 15px; height: 15px; }
.alert-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid rgba(253, 231, 199, .8); font-size: 13px; cursor: pointer; }
.alert-item:first-of-type { border-top: none; }
.alert-item .t { color: var(--t-primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-item .t:hover { color: var(--primary-600); }
.alert-item .src { margin-left: auto; font-size: 11.5px; color: var(--warn-text); white-space: nowrap; }

/* 侧栏小列表 */
.mini-list { display: flex; flex-direction: column; }
.mini-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-divider); cursor: pointer; }
.mini-item:last-child { border-bottom: none; }
.mini-item:hover .mini-title { color: var(--primary-600); }
.mini-title { font-size: 13px; font-weight: 600; color: var(--t-primary); line-height: 1.45; }
.mini-meta { font-size: 11.5px; color: var(--t-faint); margin-top: 2px; }
.mini-item .badge { margin-left: auto; flex: none; }

/* ==========================================================================
   条目卡片
   ========================================================================== */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--sh-hover); border-color: var(--border-control); }
.card-title { font-size: 14.5px; font-weight: 700; color: var(--t-primary); line-height: 1.4; }
.card-sub { font-size: 12.5px; color: var(--t-muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; padding-top: 4px; }
.card-foot { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--t-faint); padding-top: 8px; border-top: 1px solid var(--border-divider); }
.card-foot .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--t-faint); }

/* 项目卡 */
.project-card { gap: 10px; }
.project-top { display: flex; align-items: flex-start; gap: 10px; }
.project-name { font-size: 15px; font-weight: 700; color: var(--t-primary); line-height: 1.4; }
.project-client { font-size: 12px; color: var(--t-muted); margin-top: 1px; }
.project-top .badge { margin-left: auto; flex: none; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress { flex: 1; height: 6px; background: #EBEFF5; border-radius: var(--r-full); overflow: hidden; }
.progress-bar { height: 100%; border-radius: var(--r-full); background: var(--primary); transition: width .4s ease; }
.progress-num { font-size: 12px; font-weight: 700; color: var(--t-primary); min-width: 34px; text-align: right; }
.project-foot { display: flex; align-items: center; gap: 12px; font-size: 11.5px; color: var(--t-weak); }
.project-foot span { display: inline-flex; align-items: center; gap: 4px; }
.project-foot svg { width: 12px; height: 12px; }
.next-step {
  font-size: 12.5px;
  color: var(--t-body);
  background: rgba(10, 27, 61, .035);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.next-step b { font-weight: 600; color: var(--t-muted); flex: none; }

/* 筛选条 */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip {
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-control);
  background: var(--panel);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--t-body);
  cursor: pointer;
  transition: all .15s;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary-600); }
.filter-chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.filter-spacer { flex: 1; }

/* ==========================================================================
   详情页
   ========================================================================== */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--t-muted); cursor: pointer; margin-bottom: 12px; }
.back-link:hover { color: var(--primary-600); }
.back-link svg { width: 14px; height: 14px; }

.detail-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.detail-title { font-size: 22px; font-weight: 700; color: var(--t-primary); line-height: 1.35; letter-spacing: -.2px; }
.detail-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--t-muted); }
.detail-head .page-actions { margin-left: auto; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.detail-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--top-h) + 16px); }

.kv { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--border-divider); }
.kv:first-child { padding-top: 0; }
.kv:last-child { border-bottom: none; padding-bottom: 0; }
.kv-key { font-size: 11.5px; color: var(--t-faint); }
.kv-val { font-size: 13px; color: var(--t-primary); font-weight: 600; word-break: break-word; line-height: 1.5; }
.kv-val a { font-weight: 600; }
.kv-val.mono { font-family: ui-monospace, Menlo, "SF Mono", monospace; font-size: 12px; font-weight: 500; }

/* 正文排版 */
.prose { font-size: 14px; color: var(--t-body); line-height: 1.75; }
.prose > *:first-child { margin-top: 0; }
.prose h1 { font-size: 20px; font-weight: 700; color: var(--t-primary); margin: 26px 0 10px; }
.prose h2 { font-size: 16px; font-weight: 700; color: var(--t-primary); margin: 24px 0 8px; }
.prose h3 { font-size: 14px; font-weight: 700; color: var(--t-primary); margin: 18px 0 6px; }
.prose p { margin: 9px 0; }
.prose ul, .prose ol { margin: 9px 0 9px 22px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--t-faint); }
.prose a { border-bottom: 1px solid var(--blue-100); }
.prose a:hover { border-bottom-color: var(--primary); }
.prose code {
  background: rgba(10, 27, 61, .055);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: ui-monospace, Menlo, "SF Mono", monospace;
  font-size: 12.5px;
  color: var(--navy);
}
.prose pre { background: #0A1B3D; color: #E6ECF5; padding: 16px 18px; border-radius: var(--r-md); overflow-x: auto; margin: 14px 0; }
.prose pre code { background: none; color: inherit; padding: 0; font-size: 12.5px; line-height: 1.65; }
.prose blockquote {
  margin: 14px 0;
  padding: 10px 14px;
  background: rgba(10, 27, 61, .035);
  border-radius: var(--r-sm);
  color: var(--t-body);
}
.prose blockquote p { margin: 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 13px; }
.prose th, .prose td { border: 1px solid var(--border-card); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: #FAFBFD; color: var(--t-muted); font-weight: 600; }
.prose img { max-width: 100%; border-radius: var(--r-md); }
.prose hr { border: none; height: 1px; background: var(--border-divider); margin: 22px 0; }
.prose .wikilink { color: var(--primary); border-bottom: 1px dashed var(--primary); }
.prose input[type="checkbox"] { margin-right: 6px; }

/* 任务清单 */
.task-list { display: flex; flex-direction: column; }
.task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-divider);
}
.task:last-child { border-bottom: none; }
.task-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-control);
  background: var(--panel);
  cursor: pointer;
  flex: none;
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  transition: all .15s;
}
.task-check:hover { border-color: var(--primary); }
.task.done .task-check { background: var(--success); border-color: var(--success); color: #fff; }
.task-check svg { width: 11px; height: 11px; stroke-width: 3; }
.task-body { min-width: 0; flex: 1; }
.task-title { font-size: 13.5px; color: var(--t-primary); font-weight: 500; line-height: 1.5; }
.task.done .task-title { color: var(--t-faint); text-decoration: line-through; }
.task-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--t-faint); margin-top: 2px; }
.task-meta .overdue { color: var(--danger); font-weight: 600; }
.task-form { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-divider); margin-top: 2px; }
.task-form input { flex: 1 1 140px; min-width: 0; }
.task-form input[name="owner"] { flex: 0 0 96px; min-width: 96px; }
.task-form input[type="date"] { flex: 0 0 136px; min-width: 136px; }

/* 进展时间线 */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 4px; top: 14px; bottom: 0;
  width: 1px;
  background: var(--border-divider);
}
.tl-item:last-child::before { display: none; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--panel); border: 2px solid var(--border-control); margin-top: 5px; flex: none; position: relative; z-index: 1; }
.tl-item:first-child .tl-dot { border-color: var(--primary); }
.tl-body { min-width: 0; }
.tl-date { font-size: 11.5px; color: var(--t-faint); }
.tl-text { font-size: 13px; color: var(--t-body); line-height: 1.6; margin-top: 1px; }

/* 文件列表 */
.file-list { display: flex; flex-direction: column; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-divider); }
.file-row:last-child { border-bottom: none; }
.file-ico {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: rgba(10, 27, 61, .04);
  color: var(--t-muted);
  display: flex; align-items: center; justify-content: center;
  flex: none;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
}
.file-ico svg { width: 15px; height: 15px; }
.file-body { min-width: 0; flex: 1; }
.file-name { font-size: 13px; color: var(--t-primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name:hover { color: var(--primary-600); }
.file-meta { font-size: 11.5px; color: var(--t-faint); }
.file-actions { display: flex; align-items: center; gap: 2px; flex: none; }

.dropzone {
  border: 1.5px dashed var(--border-control);
  border-radius: var(--r-md);
  padding: 18px;
  text-align: center;
  color: var(--t-muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s;
  background: #FAFBFD;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--blue-50); color: var(--primary-600); }
.dropzone svg { width: 20px; height: 20px; display: block; margin: 0 auto 6px; }
.dropzone b { color: var(--primary); font-weight: 600; }

/* KPI 行 */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--border-card); border-radius: var(--r-md); padding: 12px 14px; }
.kpi-k { font-size: 11.5px; color: var(--t-muted); }
.kpi-v { font-size: 18px; font-weight: 700; color: var(--t-primary); margin-top: 2px; }
.kpi-v small { font-size: 12px; font-weight: 500; color: var(--t-faint); }

/* ==========================================================================
   抽屉 / 弹层
   ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 27, 61, .42);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.overlay.show { opacity: 1; pointer-events: auto; }

.form-section { margin-bottom: 18px; }
.form-section-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--t-faint);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; color: var(--t-body); }
.field label .req { color: var(--danger); margin-left: 2px; }
.field .help { font-size: 11.5px; color: var(--t-faint); line-height: 1.5; }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--border-control);
  border-radius: var(--r-md);
  background: var(--panel);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--t-primary);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--t-placeholder); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--blue-100); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.textarea { resize: vertical; min-height: 220px; line-height: 1.7; font-family: ui-monospace, Menlo, "SF Mono", monospace; font-size: 12.5px; }
.textarea.short { min-height: 80px; font-family: inherit; font-size: 13.5px; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 38px; height: 22px;
  border-radius: var(--r-full);
  background: #D8DEE8;
  position: relative;
  transition: background .18s;
  flex: none;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(10, 27, 61, .25);
  transition: transform .18s;
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch-text { font-size: 13px; color: var(--t-body); }

.chip-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--border-control); border-radius: var(--r-md); padding: 6px 8px; background: var(--panel); }
.chip-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--blue-100); }
.chip-input .tag { display: inline-flex; align-items: center; gap: 4px; }
.chip-input .tag button { border: none; background: none; color: var(--t-faint); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.chip-input .tag button:hover { color: var(--danger); }
.chip-input input { flex: 1; min-width: 90px; border: none; outline: none; font-size: 13px; padding: 3px 2px; background: transparent; color: var(--t-primary); }

.attach-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.attach-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--panel); border: 1px solid var(--border-card); border-radius: var(--r-sm); font-size: 12.5px; }
.attach-row .nm { color: var(--t-primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.attach-row .sz { color: var(--t-faint); font-size: 11.5px; }
.attach-row .icon-btn { width: 24px; height: 24px; }
.attach-row .icon-btn svg { width: 13px; height: 13px; }

/* 弹层菜单 */
.menu {
  position: fixed;
  z-index: 90;
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--r-md);
  box-shadow: var(--sh-pop);
  padding: 6px;
  min-width: 168px;
}
.menu-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--r-sm); font-size: 13px; color: var(--t-body); cursor: pointer; }
.menu-item:hover { background: rgba(10, 27, 61, .05); color: var(--t-primary); }
.menu-item .menu-ico { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; color: var(--t-muted); }
.menu-item .menu-ico svg { width: 15px; height: 15px; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .menu-ico { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-bg); }
.menu-sep { height: 1px; background: var(--border-divider); margin: 4px 0; }

/* Toast */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  box-shadow: var(--sh-pop);
  animation: toast-in .24s ease;
  max-width: 90vw;
}
.toast svg { width: 15px; height: 15px; flex: none; }
.toast.error { background: #8F1D1D; }
.toast.success svg { color: #6EE7B7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* 搜索高亮 */
mark { background: #FFF0BF; color: var(--t-primary); padding: 0 2px; border-radius: 3px; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen { display: flex; align-items: center; justify-content: center; height: 60vh; color: var(--t-muted); font-size: 13px; gap: 10px; }
.loading-screen .spinner { border-color: rgba(10, 27, 61, .15); border-top-color: var(--primary); }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1180px) {
  .mod-grid { grid-template-columns: repeat(2, 1fr); }
  .cards.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: minmax(0, 1fr) 270px; }
}

@media (max-width: 1024px) {
  .overview-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 920px) {
  .cards, .cards.three { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--sh-drawer);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar .crumb { display: none; }
  .content { padding: 16px; }
  .mod-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .page-head { flex-wrap: wrap; }
  .page-actions { margin-left: 0; width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .tabs-wrap { top: var(--top-h); margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .detail-title { font-size: 19px; }
  /* 详情页里工具条不能吃满整行，否则标题被挤成一字一行 */
  .detail-head { flex-wrap: wrap; }
  .detail-head .page-actions { width: auto; margin-left: auto; }
  /* 窄屏添加任务：标题、负责人各占一行，两个日期并排，按钮独占一行 */
  .task-form { flex-wrap: wrap; }
  .task-form input[name="title"] { flex: 1 1 100%; }
  .task-form input[name="owner"] { flex: 1 1 100%; min-width: 0; max-width: none !important; }
  .task-form input[type="date"] { flex: 1 1 44%; min-width: 128px; }
  .task-form button { flex: 1 1 100%; justify-content: center; }
  .searchbox input { font-size: 16px; }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 18px; }
}

/* 多选清单（知识 → 用在哪些项目） */
.check-list {
  border: 1px solid var(--border-control);
  border-radius: var(--r-md);
  background: var(--panel);
  padding: 6px;
  max-height: 148px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--t-body);
  cursor: pointer;
}
.check-row:hover { background: rgba(10, 27, 61, .04); }
.check-row input { width: 14px; height: 14px; accent-color: var(--primary); }

/* 顶栏汉堡：仅移动端出现，具体显隐由脚本控制 */
@media (min-width: 769px) { .topbar #hamburger { display: none !important; } }

/* ---------------------------------------------------------------- 登录 */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 120px); padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; background: #fff;
  border: 1px solid var(--border-card); border-radius: var(--r-lg);
  padding: 30px 28px 26px; box-shadow: 0 18px 50px -24px rgba(10, 27, 61, .28);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-logo { width: 40px; height: 40px; border-radius: 11px; background: #EEF4FF; display: flex; align-items: center; justify-content: center; }
.login-logo svg { width: 26px; height: 26px; }
.login-title { font-size: 19px; font-weight: 650; color: var(--t-title); margin: 0 0 6px; }
.login-desc { font-size: 13px; color: var(--t-muted); margin: 0 0 20px; line-height: 1.6; }
.login-tip { font-size: 12.5px; color: var(--t-body); background: var(--surface-2, #F4F6FA); border: 1px solid var(--border-soft); border-radius: 8px; padding: 8px 10px; margin: -8px 0 18px; line-height: 1.6; }
.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-form label { font-size: 12.5px; font-weight: 600; color: var(--t-body); margin-top: 6px; }
.login-form .input { width: 100%; }
.login-form .btn-block { margin-top: 18px; }
.login-err { color: var(--danger); font-size: 12.5px; min-height: 16px; margin-top: 4px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------------------------------------------------------------- 账户菜单 */
.topbar-actions { position: relative; }
.account-btn { gap: 7px; max-width: 190px; }
.account-btn svg { width: 17px; height: 17px; flex: none; }
.account-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  min-width: 210px; background: #fff; border: 1px solid var(--border-card);
  border-radius: 12px; box-shadow: 0 16px 40px -18px rgba(10, 27, 61, .32);
  padding: 6px; opacity: 0; transform: translateY(-6px) scale(.98);
  pointer-events: none; transition: opacity .14s, transform .14s;
}
.account-menu.show { opacity: 1; transform: none; pointer-events: auto; }
.acct-menu-head { padding: 9px 11px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 5px; }
.acct-name { font-size: 13.5px; font-weight: 650; color: var(--t-title); }
.acct-role { font-size: 11.5px; color: var(--t-faint); margin-top: 2px; }
.acct-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 8px;
  font-size: 13px; color: var(--t-body); cursor: pointer; user-select: none;
}
.acct-item svg { width: 16px; height: 16px; color: var(--t-muted); }
.acct-item:hover { background: rgba(20, 107, 255, .07); color: var(--primary); }
.acct-item.danger { color: var(--danger); }
.acct-item.danger svg { color: var(--danger); }
.acct-item.danger:hover { background: var(--danger-bg); }

/* ---------------------------------------------------------------- 我的账号 / 账户管理 */
.kv { font-size: 13.5px; color: var(--t-body); padding: 8px 0; font-weight: 600; }
.token-box {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #F5F8FE; border: 1px solid var(--border-soft); border-radius: 10px;
  padding: 10px 12px; margin-top: 4px;
}
.token-box code { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12.5px; color: #0F56D6; word-break: break-all; flex: 1; min-width: 0; }
.token-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.token-bar .help { margin: 0; }
.token-state {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--t-muted);
}
.token-state .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.token-state.ok { color: #0E8F53; }
.token-state.expired { color: var(--t-faint); }
.token-timer {
  font-size: 12px; color: var(--t-muted);
  font-variant-numeric: tabular-nums;
  min-width: 92px;
}
.token-timer.urgent { color: var(--danger, #D93F3F); font-weight: 600; }
.code-block { background: #0A1B3D; border-radius: 12px; padding: 16px 18px; max-width: 900px; }
.code-title { font-size: 12px; color: #9FB2D6; font-weight: 600; margin-bottom: 6px; }
.code-block pre {
  margin: 0; color: #E6ECF5; font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
/* Agent 接入说明：一键复制 + 折叠预览 */
.prompt-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prompt-note { font-size: 12.5px; color: var(--t-faint); line-height: 1.6; }
.prompt-long {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 14px 16px; border-radius: 12px;
  background: #F5F8FE; border: 1px solid var(--border-soft);
}
.prompt-long .input { max-width: 240px; }
.prompt-long .prompt-note { flex: 1 1 100%; }
.prompt-long[hidden] { display: none; }

/* Agent 接入页：全文常驻，凭证与按钮在同一块里 */
.agent-cred {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.agent-cred-who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.agent-cred-who b { font-size: 14px; color: var(--t-primary); }
.agent-doc {
  margin: 0; padding: 18px 20px; border-radius: 12px;
  background: #0A1B3D; color: #E6ECF5;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12.5px; line-height: 1.85; white-space: pre-wrap; word-break: break-word;
}
.inline-link { color: #0F56D6; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.acct-table td.wrap { white-space: normal; line-height: 1.6; }
.acct-table code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px; background: #F1F5FC; color: #0F56D6; padding: 1px 6px; border-radius: 5px;
}
.prompt-preview {
  margin: 14px 0 0; padding: 16px 18px; border-radius: 12px;
  background: #0A1B3D; color: #E6ECF5;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
  max-height: 460px; overflow: auto;
}
.code-block { max-width: 900px; }
.code-block[open] { padding-bottom: 16px; }
.code-summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: #C7D5EE;
  list-style: none; outline: none;
}
.code-summary::-webkit-details-marker { display: none; }
.code-summary::before { content: '▸ '; color: #7E92B8; }
.code-block[open] .code-summary::before { content: '▾ '; }
.code-summary:hover { color: #fff; }
.code-body { margin-top: 14px; }

/* 折叠速查：收起时是浅色细条，展开后里面才是深色代码块 */
.code-fold { background: transparent; padding: 0; }
.code-fold .code-summary {
  color: var(--t-body); padding: 12px 16px; border-radius: 12px;
  background: #F5F8FE; border: 1px solid var(--border-soft);
}
.code-fold .code-summary::before { color: var(--t-faint); }
.code-fold .code-summary:hover { color: #0F56D6; background: #EEF4FE; }
.code-fold[open] .code-summary { border-radius: 12px 12px 0 0; border-bottom-color: transparent; }
.code-fold .code-body {
  margin-top: 0; padding: 16px 18px; border-radius: 0 0 12px 12px;
  background: #0A1B3D;
}
.code-fold[open] { padding-bottom: 0; }

.acct-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.acct-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.acct-scroll .acct-table { min-width: 760px; }
.acct-table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--t-faint);
  text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--border-soft);
}
.acct-table td { padding: 10px; border-bottom: 1px solid var(--border-soft); color: var(--t-body); vertical-align: middle; }
.acct-table th, .acct-table td { white-space: nowrap; }
.acct-table tr:last-child td { border-bottom: none; }
.acct-table tr.acct-row:hover td { background: rgba(20, 107, 255, .03); }
.acct-edit-row td { background: #F5F8FE; padding: 14px 12px 12px; }
.acct-pw-head { font-size: 13px; font-weight: 600; color: var(--t-primary); margin-bottom: 10px; }
.acct-pw-head b { color: #0F56D6; }
.acct-pw-fields { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acct-pw-fields .input { max-width: 320px; }
.acct-pw-help { margin-top: 8px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tag.ok { background: var(--success-bg, #E8F7EF); color: #0E8F53; }
.tag.danger { background: var(--danger-bg, #FDECEC); color: var(--danger, #D93F3F); }
.folder-tag { display: inline-flex; align-items: center; gap: 3px; }
.folder-tag svg { width: 12px; height: 12px; }

/* ==========================================================================
   知识目录（文件夹 / 文件混排）
   ========================================================================== */
.section-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.kb-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: -2px 0 12px; }
.kb-crumb {
  border: none; background: none; padding: 2px 5px; border-radius: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--t-muted); cursor: pointer;
}
.kb-crumb:hover { background: rgba(20, 107, 255, .08); color: var(--primary-600); }
.kb-crumb.current { color: var(--t-primary); cursor: default; }
.kb-crumb-sep { color: var(--t-faint); font-size: 12px; }

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.folder-tile {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border-card);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.folder-tile:hover { border-color: var(--border-control); box-shadow: var(--sh-card); transform: translateY(-1px); }
.folder-tile-ico {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: var(--soft); color: var(--text-c);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.folder-tile-ico svg { width: 15px; height: 15px; }
.folder-tile-name {
  font-size: 13.5px; font-weight: 600; color: var(--t-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.folder-tile-count { margin-left: auto; font-size: 11.5px; color: var(--t-faint); flex: none; }

/* ==========================================================================
   行内编辑（原地改，不弹窗）
   ========================================================================== */
.edit-bar {
  position: sticky;
  top: calc(var(--top-h) + 10px);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 16px;
  background: var(--blue-50);
  border: 1px solid #CFE0FF;
  border-radius: var(--r-md);
}
.edit-bar-tag {
  background: var(--primary); color: #fff;
  font-size: 11.5px; font-weight: 700;
  padding: 2px 9px; border-radius: var(--r-full);
}
.edit-bar-hint { font-size: 12.5px; color: var(--primary-600); }
.edit-bar .spacer { flex: 1; }

.inline-title {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.2px;
  color: var(--t-primary);
  background: #FBFDFF;
  border: 1px solid #D3E2FB;
  border-radius: var(--r-md);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.inline-title:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px var(--blue-100); }
.inline-title::placeholder { color: var(--t-placeholder); font-weight: 600; }

.edit-fields { display: flex; flex-direction: column; gap: 11px; padding-top: 2px; }
.edit-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.edit-field label { font-size: 11.5px; font-weight: 600; color: var(--t-faint); }
.edit-field .input,
.edit-field .select,
.edit-field .textarea { background: #FBFDFF; border-color: #D3E2FB; }
.edit-field .input:focus,
.edit-field .select:focus,
.edit-field .textarea:focus { background: #fff; }
.edit-field .textarea { min-height: 84px; }
.edit-switch { margin-top: 2px; }
.edit-hint { font-size: 11.5px; color: var(--t-faint); font-weight: 500; }

.inline-body {
  display: block;
  width: 100%;
  min-height: 460px;
  padding: 16px 18px;
  font-family: ui-monospace, Menlo, "SF Mono", monospace;
  font-size: 13px;
  line-height: 1.85;
  color: var(--t-body);
  background: #FBFDFF;
  border: 1px solid #D3E2FB;
  border-radius: var(--r-md);
  outline: none;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.inline-body:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px var(--blue-100); }
.inline-body::placeholder { color: var(--t-placeholder); }

.mono-path {
  font-family: ui-monospace, Menlo, "SF Mono", monospace;
  font-size: 11.5px;
  color: var(--t-faint);
  word-break: break-all;
}

@media (max-width: 768px) {
  .section-head { flex-wrap: wrap; }
  .section-tools { width: 100%; margin-left: 0; justify-content: flex-end; }
  .folder-grid { grid-template-columns: 1fr 1fr; }
  .inline-body { min-height: 320px; }
  .edit-bar { flex-wrap: wrap; }
}

/* 未登录（登录页）：收起业务侧栏与顶栏操作，入口页只留登录卡片 */
body.is-guest .sidebar,
body.is-guest .searchbox,
body.is-guest .topbar-actions,
body.is-guest .crumb { display: none; }
body.is-guest .topbar { justify-content: flex-end; }

/* 知识就绪度：分数 + 维度条。条形是数据，不是装饰 */
.audit-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.audit-score {
  font-size: 34px; font-weight: 700; color: var(--t-primary); line-height: 1;
  letter-spacing: -0.5px; font-variant-numeric: tabular-nums;
}
.audit-score span { font-size: 13px; font-weight: 500; color: var(--t-faint); margin-left: 2px; }
.audit-total { font-size: 13.5px; color: var(--t-body); }
.audit-bars { margin-top: 16px; display: grid; gap: 9px; }
.audit-row { display: grid; grid-template-columns: 96px 1fr 48px; align-items: center; gap: 10px; }
.audit-label { font-size: 12.5px; color: var(--t-muted); }
.audit-bar { height: 6px; border-radius: 3px; background: var(--border-divider); overflow: hidden; }
.audit-bar i { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
.audit-num { font-size: 12px; color: var(--t-weak); text-align: right; font-variant-numeric: tabular-nums; }
.audit-sub { margin-top: 16px; font-size: 12.5px; color: var(--t-muted); }
.audit-worst {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-top: 1px solid var(--border-divider);
  font-size: 13px; color: var(--t-body);
}
.audit-worst .kv { color: var(--t-faint); font-size: 12.5px; white-space: nowrap; }
@media (max-width: 640px) {
  .audit-row { grid-template-columns: 78px 1fr 44px; }
  .audit-score { font-size: 28px; }
}

/* ==========================================================================
   项目详情：可点 KPI · 瀑布流 · 资料树 / 备注 / 一键复制下载
   ========================================================================== */
.kpi-btn {
  display: block; width: 100%; text-align: left; font: inherit; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.kpi-btn:hover { border-color: var(--blue-100); box-shadow: var(--sh-card); }
.kpi-btn.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20, 107, 255, .10); }
.kpi-foot { font-size: 11.5px; color: var(--t-faint); margin-top: 7px; }
.kpi-btn.is-active .kpi-foot { color: var(--primary-600); }

.focus-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.focus-tag {
  font-size: 12px; font-weight: 600; color: var(--primary-700);
  background: var(--blue-50); padding: 4px 11px; border-radius: var(--r-full);
}

.proj-flow { column-count: 2; column-gap: 18px; }
.proj-flow > .panel {
  break-inside: avoid; -webkit-column-break-inside: avoid;
  margin: 0 0 18px; display: inline-block; width: 100%; vertical-align: top;
}
.proj-single { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 1100px) { .proj-flow { column-count: 1; } }

.files-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 0 10px; border-bottom: 1px solid var(--border-divider); margin-bottom: 2px;
}
.files-bar-info { font-size: 11.5px; color: var(--t-faint); }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--t-muted); cursor: pointer; user-select: none; }
.chk input { width: 14px; height: 14px; accent-color: var(--primary); cursor: pointer; }

.file-tree { display: flex; flex-direction: column; }
.file-row { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--border-divider); }
.file-row:last-child { border-bottom: none; }
.file-row.is-picked { background: linear-gradient(90deg, rgba(20, 107, 255, .06), transparent 70%); }
.file-check { width: 14px; height: 14px; margin-top: 8px; accent-color: var(--primary); flex: none; cursor: pointer; }
.file-ico.zip { background: rgba(20, 107, 255, .10); color: var(--primary-700); }
.file-note {
  font-size: 11.5px; color: var(--t-muted); background: #FAFBFD;
  border-radius: var(--r-sm); padding: 5px 9px; margin-top: 5px; line-height: 1.55;
}
.note-edit { margin-top: 7px; }
.note-edit .textarea { min-height: 54px; font-size: 12.5px; }
.note-edit-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }

.folder-row { display: flex; align-items: center; gap: 7px; padding: 7px 0; cursor: pointer; border-bottom: 1px solid var(--border-divider); }
.folder-row:hover .folder-name { color: var(--primary-600); }
.folder-row .file-ico { width: 22px; height: 22px; background: transparent; color: var(--t-weak); }
.folder-row .file-ico svg { width: 15px; height: 15px; }
.fold-caret {
  width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--t-faint); transform: rotate(90deg); transition: transform .15s; flex: none;
}
.fold-caret svg { width: 12px; height: 12px; }
.folder-row.is-closed .fold-caret { transform: rotate(0); }
.folder-name { font-size: 12.5px; font-weight: 600; color: var(--t-primary); }
.folder-count { font-size: 11px; color: var(--t-faint); margin-left: 2px; }
.files-empty { font-size: 12.5px; color: var(--t-muted); padding: 12px 0; }
.uploads-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.uploads-row .select { flex: 1; }

.big-progress { display: flex; align-items: center; gap: 16px; }
.big-progress-num { font-size: 32px; font-weight: 700; color: var(--t-primary); line-height: 1; letter-spacing: -.5px; }
.big-progress-num span { font-size: 14px; color: var(--t-faint); margin-left: 2px; }
.progress-form { display: flex; gap: 8px; margin-top: 16px; }
.progress-form .input { width: 110px; }
.progress-hint { font-size: 11.5px; color: var(--t-faint); margin-top: 10px; }

.dl-mask {
  position: fixed; inset: 0; background: rgba(10, 27, 61, .42);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 90;
}
.dl-dialog {
  width: min(780px, 100%); max-height: 86vh; display: flex; flex-direction: column;
  background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--sh-drawer);
  padding: 18px 20px; gap: 12px;
}
.dl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dl-title { font-size: 15px; font-weight: 700; color: var(--t-primary); }
.dl-hint { font-size: 12px; color: var(--t-muted); margin-top: 3px; }
.dl-text {
  flex: 1; min-height: 220px; resize: vertical; line-height: 1.6; font-size: 12px;
  font-family: ui-monospace, Menlo, "SF Mono", Consolas, monospace; color: var(--t-body);
  background: #FAFBFD; border: 1px solid var(--border-control); border-radius: var(--r-md); padding: 12px;
}
.dl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dl-count { font-size: 11.5px; color: var(--t-faint); }
.note-add {
  margin-top: 4px; font-size: 11.5px; color: var(--t-faint); background: none; border: none;
  padding: 0; cursor: pointer; font-family: inherit;
}
.note-add:hover { color: var(--primary-600); }

/* 任务行：点标题改名 · 下拉指派负责人 */
.panel-hint { font-size: 11.5px; color: var(--t-faint); }
.task-title { cursor: pointer; border-radius: var(--r-xs, 4px); padding: 0 3px; margin: 0 -3px; transition: background .12s; }
.task-title:hover { background: rgba(20, 107, 255, .06); }
.task-title-input { font-size: 13.5px; font-weight: 500; height: 28px; padding: 3px 8px; }
.task-owner {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px 1px 6px; border-radius: var(--r-full);
  border: 1px dashed var(--border-control); color: var(--t-faint);
  transition: border-color .12s, background .12s, color .12s;
}
.task-owner:hover { border-color: var(--primary); color: var(--primary-600); background: rgba(20, 107, 255, .05); }
.task-owner.has { border-style: solid; border-color: var(--border-card); background: #F7F9FC; color: var(--t-body); }
.task-owner svg { width: 11px; height: 11px; flex: none; opacity: .85; }
.task-owner select {
  appearance: none; -webkit-appearance: none;
  border: none; background: transparent; font: inherit; color: inherit;
  padding: 0; cursor: pointer; line-height: 1.7;
  max-width: 150px; text-overflow: ellipsis;
}
.task-owner select:focus { outline: none; }
.task-owner select option { color: var(--t-primary); background: var(--panel); }
.task.done .task-owner { opacity: .72; }

.task-dates { color: var(--t-faint); white-space: nowrap; }
.task-dates.overdue { color: var(--danger); font-weight: 600; }
.task-certainty {
  font-size: 11px; padding: 0 6px; border-radius: var(--r-full); cursor: pointer;
  border: 1px solid var(--border-card); color: var(--t-weak); background: var(--panel);
  user-select: none; transition: background .12s, border-color .12s;
}
.task-certainty:hover { border-color: var(--primary); color: var(--primary-600); }
.task-certainty.is-guess { border-style: dashed; border-color: var(--warn-border); background: var(--lock-bg); color: var(--lock-text); }
.task-check { transition: background .12s, border-color .12s, transform .08s; }
.task-check:active { transform: scale(.86); }

/* ---- 进度页：下一步任务 ---- */
.next-block {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--border-card); background: #FAFBFD;
}
.next-empty { font-size: 12.5px; color: var(--t-muted); }
.next-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.next-label { font-size: 11.5px; color: var(--t-muted); flex: none; }
.next-title { font-size: 13.5px; font-weight: 600; color: var(--t-primary); }
.next-pick {
  flex: 1; min-width: 0; appearance: none; -webkit-appearance: none;
  border: 1px solid transparent; background: transparent; font-family: inherit;
  font-size: 13.5px; font-weight: 600; color: var(--t-primary); cursor: pointer;
  padding: 2px 4px; border-radius: var(--r-sm); text-overflow: ellipsis;
}
.next-pick:hover { background: var(--panel); border-color: var(--border-control); }
.next-pick:focus { outline: none; border-color: var(--primary); background: var(--panel); }
.next-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-top: 12px; }
.next-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.next-field > span { font-size: 11px; color: var(--t-faint); }
.next-input {
  font-family: inherit; font-size: 12.5px; color: var(--t-body); width: 100%;
  border: 1px solid var(--border-card); border-radius: var(--r-sm);
  background: var(--panel); padding: 5px 8px;
}
.next-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--blue-100); }
.ct-toggle {
  display: inline-flex; gap: 2px; width: fit-content; padding: 2px;
  border: 1px solid var(--border-card); border-radius: var(--r-sm); background: var(--panel);
}
.ct-chip {
  font-family: inherit; font-size: 11.5px; padding: 3px 10px; border: none; background: none;
  color: var(--t-weak); border-radius: 6px; cursor: pointer; transition: background .12s, color .12s;
}
.ct-chip:hover { color: var(--primary-600); }
.ct-chip.active { background: var(--blue-50); color: var(--primary-600); font-weight: 600; }

/* ---- 工作记录 / 留言 ---- */
.log-form { margin-bottom: 16px; }
.log-editor { position: relative; }
.log-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.log-as { margin-right: auto; font-size: 11.5px; color: var(--t-faint); }
.mention-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  background: var(--panel); border: 1px solid var(--border-card); border-radius: var(--r-md);
  box-shadow: var(--sh-card); padding: 4px; max-height: 190px; overflow: auto;
}
.mention-item {
  display: block; width: 100%; text-align: left; font-family: inherit; font-size: 12.5px;
  padding: 6px 8px; border: none; background: none; border-radius: var(--r-sm);
  color: var(--t-body); cursor: pointer;
}
.mention-item:hover { background: var(--blue-50); color: var(--primary-600); }
.log-list {
  display: flex; flex-direction: column; gap: 13px;
  border-top: 1px solid var(--border-divider); padding-top: 14px;
}
.log-item { display: flex; gap: 9px; }
.log-avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: none; margin-top: 1px;
  background: var(--blue-50); color: var(--primary-600);
  font-size: 11.5px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.log-main { min-width: 0; flex: 1; }
.log-head { display: flex; align-items: baseline; gap: 8px; }
.log-name { font-size: 12.5px; font-weight: 600; color: var(--t-primary); }
.log-time { font-size: 11px; color: var(--t-faint); }
.log-text { font-size: 13px; color: var(--t-body); line-height: 1.62; margin-top: 2px; word-break: break-word; }
.mention { color: var(--primary-600); font-weight: 600; }

/* ---- 未读提醒 ---- */
.bell-btn { position: relative; }
.bell-btn.has-unread { color: var(--primary-600); }
.bell-count {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-full); background: var(--danger); color: #fff; text-align: center;
  font-size: 10px; font-weight: 700; line-height: 16px; box-shadow: 0 0 0 2px var(--panel);
}
.notify-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 70;
  width: min(360px, calc(100vw - 28px));
  background: var(--panel); border: 1px solid var(--border-card);
  border-radius: var(--r-md); box-shadow: var(--sh-drawer); overflow: hidden;
}
.notify-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border-divider);
  font-size: 12px; color: var(--t-muted);
}
.link-btn {
  font-family: inherit; font-size: 11.5px; color: var(--primary-600);
  background: none; border: none; padding: 0; cursor: pointer;
}
.link-btn:hover { color: var(--primary-700); }
.notify-list { max-height: 380px; overflow: auto; }
.notify-item {
  display: flex; gap: 8px; width: 100%; text-align: left; padding: 10px 14px;
  border: none; border-bottom: 1px solid var(--border-divider); background: none;
  font-family: inherit; cursor: pointer;
}
.notify-item:last-child { border-bottom: none; }
.notify-item:hover { background: #F7F9FC; }
.notify-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; margin-top: 6px; background: transparent; }
.notify-item.unread .notify-dot { background: var(--primary); }
.notify-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.notify-line { font-size: 12.5px; color: var(--t-body); }
.notify-line b { color: var(--t-primary); }
.notify-text {
  font-size: 12px; color: var(--t-muted); overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.notify-time { font-size: 10.5px; color: var(--t-faint); }
.notify-empty { padding: 22px 14px; text-align: center; font-size: 12.5px; color: var(--t-faint); }

@media (max-width: 640px) {
  .next-grid { grid-template-columns: 1fr; }
  .log-as { display: none; }
}
