/* ============================================================
   小厂协作 · 设计系统 v3 · Linear 蓝白
   方向：极简克制、留白优先、低饱和蓝 + 近白底
   原则：零 emoji、零杂图标；用留白、字重、色彩与细线
        建立层级；优先级用色点，不用重胶囊。
   ============================================================ */

:root {
  /* 品牌 */
  --brand: #1E5FD0;
  --brand-d: #174FB5;
  --brand-l: #E9F1FC;

  /* 中性 */
  --bg: #F4F7FB;
  --card: #FFFFFF;
  --t1: #172033;
  --t2: #5C6779;
  --t3: #8B96A8;
  --line: #E3E9F2;
  --line-l: #F0F3F9;
  --hover: #F7F9FC;

  /* 语义 */
  --ok: #12A150;
  --ok-l: #E6F6EE;
  --warn: #E08A1E;
  --warn-l: #FFF4E5;
  --danger: #D8443C;
  --danger-l: #FBECEA;
  --purple: #7C5CE0;

  /* 形状 */
  --r-l: 10px;
  --r-m: 8px;
  --r-s: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-h: 0 8px 28px rgba(16, 24, 40, .10);

  /* 动效 */
  --ease: cubic-bezier(.22, .8, .28, 1);
  --d-fast: .16s;
  --d-mid: .24s;

  /* 布局 */
  --nav-h: 46px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--t1);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .005em;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

::selection { background: var(--brand-l); color: var(--brand-d); }

/* ============================ 登录 ============================ */

.login-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  width: 100%; max-width: 380px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(16, 24, 40, .10);
  overflow: hidden;
}

.login-brand { padding: 40px 36px 28px; }
.login-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 11px;
  background: var(--brand); color: #fff;
  font-size: 20px; font-weight: 700; margin-bottom: 18px;
  letter-spacing: -.02em;
}
.login-title { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.login-sub {
  font-size: 12.5px; color: var(--t3); margin-top: 8px;
  letter-spacing: .06em;
}

.login-form { padding: 0 36px 36px; }

.field { display: block; margin-bottom: 18px; }
.field-label {
  display: block; font-size: 12.5px; color: var(--t2);
  margin-bottom: 7px; font-weight: 500;
}
.field-input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: #fff; font-size: 14.5px;
  transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
}
.field-input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(51, 112, 255, .12);
}
.field-input::placeholder { color: #C4C9D2; }

/* 记住账号密码 */
.remember-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--t2);
  cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
  margin: -6px 0 18px;
}
.remember-row:hover { color: var(--t1); }
.remember-check {
  width: 15px; height: 15px; flex-shrink: 0;
  accent-color: var(--brand); cursor: pointer;
}

.login-err {
  background: var(--danger-l); color: var(--danger);
  font-size: 12.5px; padding: 10px 12px; border-radius: var(--r-s);
  margin-bottom: 16px; line-height: 1.5;
}

/* ============================ 顶栏 ============================ */

.topbar {
  height: 52px; background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 100;
}
.topbar-menu {
  display: none; background: none; border: none;
  color: var(--t1); cursor: pointer; padding: 6px 8px;
  border-radius: var(--r-s); line-height: 1;
}
.topbar-menu span { display: block; width: 18px; height: 2px; background: currentColor; margin: 4px 0; border-radius: 1px; }

.topbar-logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 28px; height: 28px; background: var(--brand);
  border-radius: 7px; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff; letter-spacing: -.02em;
}
.logo-text { font-size: 15px; font-weight: 650; letter-spacing: .01em; }

/* 命令面板入口 */
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  height: 32px; min-width: 240px; padding: 0 10px;
  margin-left: 10px; background: var(--hover);
  border: 1px solid transparent; border-radius: var(--r-m);
  color: var(--t3); font-size: 12.5px; cursor: pointer;
  transition: background var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease);
}
.topbar-search:hover { background: #EFF1F4; border-color: var(--line); }
.topbar-search .kbd {
  margin-left: auto; font-size: 11px; color: var(--t3);
  border: 1px solid #DFE1E5; background: #fff;
  border-radius: 4px; padding: 0 5px; line-height: 17px;
}
.topbar-spacer { flex: 1; }

.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--t2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600; color: #fff; letter-spacing: 0;
}
.topbar-bell {
  position: relative; background: none; border: none;
  color: var(--t2); cursor: pointer; padding: 6px 9px;
  border-radius: var(--r-s); font-size: 13px; font-weight: 500;
  transition: background var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}
.topbar-bell:hover { background: var(--bg); color: var(--t1); }
.bell-dot {
  position: absolute; top: 4px; right: 3px;
  width: 7px; height: 7px; background: var(--danger);
  border-radius: 50%; border: 2px solid #fff;
}
.topbar-logout {
  background: none; border: none; color: var(--t3);
  font-size: 13px; padding: 6px 4px; cursor: pointer;
  transition: color var(--d-fast) var(--ease);
}
.topbar-logout:hover { color: var(--t1); }

/* ============================ 布局 ============================ */

/* 顶部横向导航 */
.topnav {
  height: var(--nav-h);
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 52px; z-index: 90;
}
.topnav-scroll {
  display: flex; align-items: stretch;
  gap: 2px; padding: 0 14px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.topnav-scroll::-webkit-scrollbar { display: none; }

.nav-group { display: none; }

.nav-item {
  display: flex; align-items: center; gap: 7px;
  height: var(--nav-h);
  padding: 0 11px;
  color: var(--t2); cursor: pointer;
  font-size: 13.5px; font-weight: 450;
  border-bottom: 2px solid transparent;
  white-space: nowrap; flex-shrink: 0;
  transition: color var(--d-fast) var(--ease);
}
.nav-item:hover { color: var(--t1); }
.nav-item.active { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }
.nav-item .nav-no {
  font-size: 10.5px; color: var(--t3);
  font-variant-numeric: tabular-nums; font-weight: 500;
}
.nav-item.active .nav-no { color: var(--brand); opacity: .65; }
.nav-item .cnt {
  margin-left: 2px; font-size: 10.5px;
  background: var(--danger); color: #fff;
  border-radius: 10px; padding: 1px 6px;
  min-width: 16px; text-align: center; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.main { padding: 22px 26px 70px; min-height: calc(100vh - 52px - var(--nav-h)); }

/* ============================ 通用组件 ============================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--r-m);
  border: none; cursor: pointer; font-size: 13.5px; font-weight: 550;
  transition: background var(--d-fast) var(--ease),
              box-shadow var(--d-fast) var(--ease),
              transform var(--d-fast) var(--ease);
  white-space: nowrap; letter-spacing: .01em;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(51,112,255,.3); }
.btn-primary:hover { background: var(--brand-d); }
.btn-ghost { background: #fff; color: var(--t2); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg); color: var(--t1); border-color: #D5D9E0; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC3D31; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #0FA45C; }
.btn-block { width: 100%; height: 44px; font-size: 14.5px; }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.card {
  background: var(--card); border-radius: var(--r-l);
  border: 1px solid var(--line);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.card-h {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.card-h h2 { font-size: 16px; font-weight: 600; letter-spacing: -.005em; }
.card-h .more { font-size: 12.5px; color: var(--t3); cursor: pointer; font-weight: 500; }
.card-h .more:hover { color: var(--brand); }

.page-title { font-size: 22px; font-weight: 650; letter-spacing: -.015em; }
.page-sub { font-size: 13.5px; color: var(--t2); margin-top: 6px; margin-bottom: 22px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }

.tag {
  display: inline-block; font-size: 11.5px; font-weight: 550;
  padding: 2px 8px; border-radius: 5px; white-space: nowrap;
  letter-spacing: .02em;
}
.tag-p0 { background: var(--danger-l); color: var(--danger); }
.tag-p1 { background: var(--warn-l); color: var(--warn); }
.tag-p2 { background: var(--ok-l); color: var(--ok); }
.tag-p3 { background: var(--line-l); color: var(--t2); }

/* 优先级：色点 + 文字（Linear 式轻量标记） */
.pri {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500; color: var(--t2);
  letter-spacing: .01em; white-space: nowrap;
}
.pri i { width: 7px; height: 7px; border-radius: 50%; background: var(--t3); flex-shrink: 0; }
.pri-p0 { color: var(--danger); }
.pri-p0 i { background: var(--danger); }
.pri-p1 { color: #B54708; }
.pri-p1 i { background: #F79009; }
.pri-p2 i { background: var(--ok); }
.pri-p3 i { background: var(--t3); }

.st-done { color: var(--ok); font-weight: 550; }
.st-rejected { color: var(--danger); font-weight: 550; }
.st-progress { color: var(--brand); font-weight: 550; }
.st-pending { color: var(--warn); font-weight: 550; }

/* 督办横幅 */
.urge {
  background: linear-gradient(100deg, #FFF7ED 0%, #FFFBF3 100%);
  border: 1px solid #FDE3BF;
  border-left: 3px solid var(--danger);
  border-radius: var(--r-m);
  padding: 14px 18px; margin-bottom: 22px;
  display: flex; align-items: center; gap: 14px;
}
.urge-label {
  flex-shrink: 0; font-size: 11px; font-weight: 650;
  color: #fff; background: var(--danger);
  padding: 3px 9px; border-radius: 4px; letter-spacing: .1em;
}
.urge-text { flex: 1; font-size: 13px; line-height: 1.6; min-width: 0; color: var(--t1); }
.urge-text b { color: var(--danger); }
.urge-text .code { font-family: "SF Mono", Consolas, monospace; font-size: 12px; font-weight: 600; }

/* 两栏栅格 */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* 指标列表 */
.metric-list { display: flex; flex-direction: column; }

/* 需求行 */
.req-list { display: flex; flex-direction: column; }
.req-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--line-l);
  cursor: pointer; transition: background var(--d-fast) var(--ease);
  border-radius: var(--r-s);
}
.req-row:last-child { border-bottom: none; }
.req-row:hover { background: #FAFBFC; }
.req-row .r-main { flex: 1; min-width: 0; }
.req-row .r-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.req-row .r-meta { font-size: 12px; color: var(--t3); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.req-row .r-code { font-family: "SF Mono", Consolas, monospace; font-size: 11.5px; }

/* 指标 */
.metric { padding: 14px 0; border-bottom: 1px solid var(--line-l); }
.metric:last-child { border-bottom: none; padding-bottom: 0; }
.metric:first-child { padding-top: 0; }
.metric .mlabel { font-size: 12.5px; color: var(--t2); display: flex; justify-content: space-between; margin-bottom: 6px; }
.metric .mval { font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }
.metric .mval small { font-size: 12px; color: var(--t3); font-weight: 400; margin-left: 4px; letter-spacing: 0; }
.metric .mdelta { font-size: 11.5px; font-weight: 550; }

/* 大数字看板 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 20px; box-shadow: var(--shadow);
}
.stat .slabel { font-size: 12.5px; color: var(--t2); margin-bottom: 10px; font-weight: 500; }
.stat .sval { font-size: 30px; font-weight: 650; letter-spacing: -.025em; line-height: 1; }
.stat .sval small { font-size: 13px; color: var(--t3); font-weight: 450; margin-left: 4px; letter-spacing: 0; }
.stat .sfoot { font-size: 12px; color: var(--t3); margin-top: 10px; }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; color: var(--t3); font-weight: 550;
  font-size: 12px; letter-spacing: .04em;
  padding: 11px 13px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: #FAFBFC;
}
table.data td {
  padding: 13px; border-bottom: 1px solid var(--line-l);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background var(--d-fast) var(--ease); cursor: pointer; }
table.data tbody tr:hover { background: #FAFBFC; }

/* 表单 */
.form-grid { display: grid; gap: 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label { display: block; font-size: 12.5px; color: var(--t2); margin-bottom: 7px; font-weight: 500; }
.form-label .req-mark { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: #fff; font-size: 14px;
  transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
}
.form-textarea { min-height: 84px; resize: vertical; line-height: 1.65; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(51, 112, 255, .12);
}
.form-hint { font-size: 12px; color: var(--t3); margin-top: 6px; }
.form-hint.warn { color: var(--warn); }
.form-hint.ok { color: var(--ok); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  z-index: 200; display: grid; place-items: center; padding: 20px;
  animation: fadeIn .18s var(--ease);
}
.modal {
  background: #fff; border-radius: 14px;
  width: 100%; max-width: 640px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(16, 24, 40, .24);
  animation: slideUp var(--d-mid) var(--ease);
}
.modal-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line); gap: 12px;
}
.modal-h h3 { font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; }
.modal-close {
  background: none; border: none; font-size: 18px;
  color: var(--t3); cursor: pointer; padding: 4px 8px;
  line-height: 1; border-radius: var(--r-s);
  transition: background var(--d-fast) var(--ease);
}
.modal-close:hover { background: var(--bg); color: var(--t1); }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-f {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 15px 22px; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.modal-f-left { margin-right: auto; display: flex; gap: 8px; }
.btn.is-danger { color: var(--danger); border-color: #F0CBC7; }
.btn.is-danger:hover { background: #FDF4F3; border-color: #E8B4AE; }

/* 评审建议 */
.sugg-list { display: flex; flex-direction: column; gap: 8px; }
.sugg-item {
  background: #F7F9FC; border: 1px solid #EDF0F5;
  border-radius: 8px; padding: 10px 12px;
}
.sugg-h {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11.5px; color: var(--t3); margin-bottom: 5px;
}
.sugg-h b { color: var(--t1); font-weight: 600; font-size: 12px; }
.sugg-b { font-size: 12.5px; line-height: 1.65; color: var(--t2); white-space: pre-wrap; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(.985) }
  to { opacity: 1; transform: none }
}

/* 页面切换淡入 */
.main-inner { animation: pageIn var(--d-mid) var(--ease); }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px) }
  to { opacity: 1; transform: none }
}

/* 时间轴 */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 9px; top: 10px; bottom: 10px;
  width: 2px; background: var(--line); border-radius: 1px;
}
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -28px; top: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line);
  display: grid; place-items: center;
  font-size: 9.5px; color: var(--t3); font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.tl-item.passed .tl-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tl-item.current .tl-dot {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 0 0 4px rgba(51, 112, 255, .15);
}
.tl-item.rejected .tl-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.tl-name { font-size: 14px; font-weight: 550; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-role { font-size: 12px; color: var(--t3); margin-top: 3px; }
.tl-comment {
  font-size: 13px; color: var(--t2); margin-top: 8px;
  background: var(--bg); padding: 10px 13px; border-radius: var(--r-m);
  line-height: 1.65;
}
.tl-time { font-size: 11.5px; color: var(--t3); margin-top: 6px; }

/* 通知抽屉 */
.drawer { position: fixed; inset: 0; z-index: 300; }
.drawer-mask { position: absolute; inset: 0; background: rgba(16,24,40,.45); backdrop-filter: blur(2px); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 400px; background: #fff;
  display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(16,24,40,.16);
  animation: slideLeft var(--d-mid) var(--ease);
}
@keyframes slideLeft { from { transform: translateX(100%) } to { transform: none } }
.drawer-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 17px 20px; border-bottom: 1px solid var(--line);
}
.drawer-h h3 { font-size: 16px; font-weight: 600; }
.drawer-close {
  background: none; border: none; font-size: 17px;
  color: var(--t3); cursor: pointer; padding: 4px 8px; border-radius: var(--r-s);
}
.drawer-close:hover { background: var(--bg); }
.drawer-body { flex: 1; overflow-y: auto; }

.notice-item {
  padding: 14px 20px; border-bottom: 1px solid var(--line-l);
  cursor: pointer; transition: background var(--d-fast) var(--ease);
}
.notice-item:hover { background: #FAFBFC; }
.notice-item.unread { background: var(--brand-l); }
.notice-item.unread .n-title::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  background: var(--brand); border-radius: 50%; margin-right: 8px;
  vertical-align: middle; position: relative; top: -1px;
}
.notice-item .n-title { font-size: 13.5px; font-weight: 550; margin-bottom: 4px; }
.notice-item .n-body { font-size: 12.5px; color: var(--t2); line-height: 1.6; }
.notice-item .n-time { font-size: 11.5px; color: var(--t3); margin-top: 6px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 36px;
  transform: translateX(-50%);
  background: rgba(16, 24, 40, .94); color: #fff;
  padding: 11px 22px; border-radius: 8px;
  font-size: 13.5px; z-index: 400;
  max-width: 88vw; text-align: center; line-height: 1.55;
  animation: slideUp .22s var(--ease);
  box-shadow: 0 10px 30px rgba(16,24,40,.2);
}
.toast.err { background: rgba(240, 68, 56, .96); }
.toast.ok { background: rgba(18, 183, 106, .96); }

/* 空状态 */
.empty { text-align: center; padding: 52px 20px; color: var(--t3); }
.empty .e-mark {
  width: 44px; height: 44px; margin: 0 auto 16px;
  border: 1.5px dashed var(--line); border-radius: 12px;
  display: grid; place-items: center; font-size: 16px; font-weight: 650; color: var(--t3);
}
.empty .e-title { font-size: 14px; color: var(--t2); font-weight: 550; margin-bottom: 4px; }
.empty .e-text { font-size: 12.5px; }

/* 进度条 */
.progress { height: 6px; background: var(--line-l); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); border-radius: 3px; transition: width .4s var(--ease); }

/* 甘特 */
.gantt { overflow-x: auto; }
.gantt-axis { padding: 0 0 8px; border-bottom: 1px solid var(--line-l); margin-bottom: 4px; }
.gantt-axis .ax {
  display: flex; justify-content: space-between;
  font-size: 11.5px; color: var(--t3); font-variant-numeric: tabular-nums;
}
.gantt-row {
  display: grid; grid-template-columns: 220px 1fr;
  align-items: center; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--line-l);
  min-width: 640px;
}
.gantt-row:last-child { border-bottom: none; }
.gantt-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-label .code { font-family: "SF Mono", Consolas, monospace; font-size: 11.5px; color: var(--t3); margin-right: 8px; }
.gantt-bar-wrap { position: relative; height: 24px; background: var(--line-l); border-radius: 5px; }
.gantt-bar {
  position: absolute; top: 4px; height: 16px;
  background: var(--brand); border-radius: 5px;
  display: flex; align-items: center; padding: 0 9px;
  font-size: 11px; color: #fff; white-space: nowrap; overflow: hidden;
  font-weight: 550;
}
.gantt-bar.ok { background: var(--ok); }
.gantt-bar.warn { background: var(--warn); }
.gantt-bar.danger { background: var(--danger); }

/* ============================ 消息中心 ============================ */

.msg-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.msg-tabs .tab {
  font-size: 13px; padding: 6px 13px; border-radius: 7px;
  background: #fff; border: 1px solid var(--line); color: var(--t2); cursor: pointer;
  font-weight: 500;
  transition: background var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}
.msg-tabs .tab:hover { background: var(--bg); }
.msg-tabs .tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.msg-tabs .tab .t-cnt { font-size: 11px; opacity: .7; margin-left: 2px; }

.msg-item {
  display: flex; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--line-l); cursor: pointer;
  transition: background var(--d-fast) var(--ease);
}
.msg-item:last-child { border-bottom: none; }
.msg-item:hover { background: #FAFBFC; }
.msg-item .msg-indicator { width: 10px; flex-shrink: 0; padding-top: 5px; }
.msg-item .unread-dot { display: block; width: 8px; height: 8px; background: var(--brand); border-radius: 50%; }
.msg-item .msg-body { flex: 1; min-width: 0; }
.msg-item .msg-title { font-size: 13.5px; font-weight: 550; margin-bottom: 3px; }
.msg-item .msg-text { font-size: 12.5px; color: var(--t2); line-height: 1.6; }
.msg-item .msg-meta { font-size: 11.5px; color: var(--t3); margin-top: 5px; }

/* ============================ 我的 ============================ */

.profile-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.profile-head {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 18px; border-bottom: 1px solid var(--line-l);
}
.profile-avatar {
  width: 58px; height: 58px; border-radius: 14px;
  display: grid; place-items: center; color: #fff;
  font-size: 22px; font-weight: 650; flex-shrink: 0;
}
.profile-name { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.profile-meta { font-size: 13px; color: var(--t2); margin-top: 4px; }
.av-picks { display: flex; gap: 9px; flex-wrap: wrap; padding-top: 4px; }
.av-pick {
  width: 30px; height: 30px; border-radius: 50%;
  border: none; cursor: pointer; position: relative;
  transition: transform var(--d-fast) var(--ease);
}
.av-pick:hover { transform: scale(1.1); }
.av-pick.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px currentColor; }

/* ============================ 命令面板 ============================ */

.cmdk { position: fixed; inset: 0; z-index: 300; display: grid; place-items: start center; padding-top: 14vh; }
.cmdk-mask { position: absolute; inset: 0; background: rgba(17, 20, 26, .38); backdrop-filter: blur(2px); }
.cmdk-panel {
  position: relative; width: min(560px, calc(100vw - 32px));
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 20px 56px rgba(16, 24, 40, .20), 0 0 0 1px rgba(16, 24, 40, .06);
  animation: cmdkIn .16s var(--ease);
}
@keyframes cmdkIn { from { opacity: 0; transform: translateY(-6px) scale(.99); } }
.cmdk-input {
  width: 100%; border: none; outline: none;
  padding: 16px 18px; font-size: 15px; color: var(--t1);
  border-bottom: 1px solid var(--line-l);
}
.cmdk-input::placeholder { color: var(--t3); }
.cmdk-list { max-height: 46vh; overflow-y: auto; padding: 6px; }
.cmdk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-s); cursor: pointer; font-size: 13.5px;
}
.cmdk-item.on { background: var(--brand-l); color: var(--brand); }
.cmdk-item .k { font-size: 11px; color: var(--t3); margin-left: auto; font-family: ui-monospace, monospace; }
.cmdk-item.on .k { color: var(--brand); }
.cmdk-empty { padding: 22px; text-align: center; color: var(--t3); font-size: 13px; }
.cmdk-foot {
  display: flex; gap: 16px; padding: 8px 14px;
  border-top: 1px solid var(--line-l); background: #FBFBFC;
  font-size: 11.5px; color: var(--t3);
}

/* ============================ 工作台 · 指挥台 ============================ */

.home-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 26px;
  align-items: start;
}
.home-main { min-width: 0; }
.home-side { border-left: 1px solid var(--line); padding-left: 22px; position: sticky; top: 80px; }

.side-h {
  font-size: 11px; letter-spacing: .09em; color: var(--t3);
  font-weight: 600; margin-bottom: 12px;
}
.kpi-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--line-l);
}
.kpi-row:last-child { border-bottom: none; }
.kpi-row .k { font-size: 12.5px; color: var(--t2); }
.kpi-row .v { font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.kpi-row .v small { font-size: 11px; font-weight: 400; color: var(--t3); margin-left: 2px; }

.ring-block { display: flex; align-items: center; gap: 13px; margin-top: 18px; }
.ring-block .rt { font-size: 12px; color: var(--t3); line-height: 1.6; }
.ring-block .rt b { display: block; font-size: 13px; color: var(--t1); font-weight: 600; margin-bottom: 2px; }

.q-head { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 12px; }
.q-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.q-count { font-size: 12px; color: var(--t3); }
.q-head .more { margin-left: auto; }

.q-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.q-card .empty { padding: 34px 20px; }
.q-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-bottom: 1px solid var(--line-l);
  position: relative; cursor: pointer;
  transition: background var(--d-fast) var(--ease);
}
.q-row:last-child { border-bottom: none; }
.q-row:hover { background: #FBFCFD; }
.q-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: transparent;
}
.q-row.p0::before { background: var(--danger); }
.q-row.p1::before { background: var(--warn); }
.q-row.p2::before { background: var(--ok); }
.q-main { flex: 1; min-width: 0; }
.q-title { font-size: 14px; font-weight: 600; margin-bottom: 5px; line-height: 1.45; }
.q-meta { font-size: 12px; color: var(--t3); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.q-due { font-size: 12px; color: var(--t2); white-space: nowrap; }
.q-due.ok { color: var(--t3); }

.mini-list { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px; }
.mini-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line-l);
  font-size: 13px; cursor: pointer;
}
.mini-row:last-child { border-bottom: none; }
.mini-row:hover .t { color: var(--brand); }
.mini-row .c { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--t3); flex-shrink: 0; }
.mini-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-prog { width: 72px; flex-shrink: 0; }
.mini-row .pct { font-size: 11.5px; color: var(--t3); width: 62px; text-align: right; flex-shrink: 0; }

.feed { padding-left: 2px; }
.feed-item {
  display: flex; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--line-l);
  font-size: 12.5px; color: var(--t2); line-height: 1.6; cursor: pointer;
}
.feed-item:last-child { border-bottom: none; }
.feed-item .ft { font-size: 11.5px; color: var(--t3); width: 46px; flex-shrink: 0; padding-top: 2px; }
.feed-item .fd { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); opacity: .45; margin-top: 7px; flex-shrink: 0; }
.feed-item b { color: var(--t1); font-weight: 600; }
.feed-detail { color: var(--t3); }

.side-note { display: flex; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--line-l); cursor: pointer; }
.side-note:last-child { border-bottom: none; }
.side-note .nd { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); margin-top: 7px; flex-shrink: 0; }
.side-note .nt { font-size: 12.5px; line-height: 1.5; color: var(--t2); }
.side-note .nm { font-size: 11px; color: var(--t3); margin-top: 3px; }

.sep { display: flex; align-items: center; gap: 10px; margin: 24px 0 12px; }
.sep span { font-size: 12.5px; color: var(--t3); white-space: nowrap; }
.sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ============================ 响应式 ============================ */

@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .matrix { grid-template-columns: repeat(3, 1fr); }
  .home-cols { grid-template-columns: 1fr; gap: 20px; }
  .home-side { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; position: static; }
}

@media (max-width: 768px) {
  .topbar-search { display: none; }
  .profile-grid { grid-template-columns: 1fr; }
  .msg-tabs { gap: 6px; }
  .msg-tabs .tab { font-size: 12.5px; padding: 5px 11px; }
  .logo-text { display: none; }
  .topbar-user .u-name { display: none; }
  .topbar { padding: 0 14px; gap: 10px; }

  /* 顶部导航横滑 */
  .topnav { top: 52px; }
  .topnav-scroll { padding: 0 10px; gap: 0; }
  .nav-item { padding: 0 9px; font-size: 13px; }
  .nav-item .nav-no { display: none; }

  .main { padding: 18px 16px 72px; }
  .grid-2 { grid-template-columns: 1fr; }
  .page-title { font-size: 20px; }
  .page-head { margin-bottom: 18px; flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head .btn { width: 100%; }
  .page-head .page-sub { margin-bottom: 0; }
  .matrix { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
  .tile { padding: 12px 13px; }
  .tile .v { font-size: 22px; }
  .empty { padding: 34px 12px; }
  .empty .e-mark { width: 38px; height: 38px; margin-bottom: 12px; }
  .stat-grid { grid-template-columns: 1fr; gap: 12px; }
  .stat { padding: 16px; }
  .card { padding: 16px; border-radius: var(--r-m); }
  .card-h h2 { font-size: 15px; }
  .form-row-2 { grid-template-columns: 1fr; gap: 12px; }
  .form-grid { gap: 14px; }

  .modal-mask { padding: 0; place-items: end center; }
  .modal { max-height: 94vh; border-radius: 16px 16px 0 0; max-width: 100%; animation: slideInM var(--d-mid) var(--ease); }
  @keyframes slideInM { from { transform: translateY(30px); opacity: 0 } to { transform: none; opacity: 1 } }

  .urge { flex-wrap: wrap; gap: 10px; }
  .urge-text { font-size: 12.5px; }

  .q-row { flex-wrap: wrap; gap: 10px; padding: 13px 14px; }
  .q-main { flex: 1 1 100%; order: 1; }
  .q-due { order: 2; font-size: 12px; }
  .q-row .btn { order: 3; margin-left: auto; }
  .mini-row .pct { display: block; width: auto; font-size: 12px; }
  .mini-prog { display: none; }
  .feed-item .ft { width: 42px; font-size: 11px; }

  /* 甘特：手机上改为「标题 / 整行时间条」纵向堆叠，不再横向裁切 */
  .gantt { overflow-x: visible; }
  .gantt-row {
    grid-template-columns: 1fr; gap: 8px;
    min-width: 0; padding: 12px 0;
  }
  .gantt-label { white-space: normal; line-height: 1.45; }
  .gantt-bar-wrap { height: 26px; }
  .gantt-bar { top: 5px; height: 16px; }
  .gantt-axis { padding: 0 0 8px; }
  .gantt-axis > div:first-child { display: none; }

  table.data.stack thead { display: none; }
  table.data.stack tr {
    display: grid; grid-template-columns: 1fr 1fr;
    column-gap: 14px; row-gap: 2px;
    border: 1px solid var(--line);
    border-radius: var(--r-m); margin-bottom: 12px;
    padding: 12px 14px; background: #fff;
    cursor: pointer;
  }
  table.data.stack td {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    padding: 4px 0; border: none; font-size: 13px;
  }
  table.data.stack td::before {
    content: attr(data-label); color: var(--t3);
    font-size: 11px; font-weight: 500;
  }
  table.data.stack td.td-main::before { display: none; }
  table.data.stack td.td-main {
    grid-column: 1 / -1;
    display: block; font-size: 14px; font-weight: 550;
    padding-bottom: 9px; border-bottom: 1px solid var(--line-l);
    margin-bottom: 3px;
  }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================ 总览矩阵 · KPI 网格 ============================ */

.matrix {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 12px; margin-bottom: 18px;
}
.tile {
  background: #fff; border: 1px solid #E7EDF6;
  border-radius: 9px; padding: 14px 15px;
  position: relative; overflow: hidden;
}
.tile .k {
  font-size: 11.5px; color: var(--t3);
  display: flex; align-items: center; gap: 6px;
}
.tile .dot { width: 6px; height: 6px; border-radius: 50%; }
.tile .v {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 25px; font-weight: 600; letter-spacing: -.02em; margin-top: 8px;
  font-variant-numeric: tabular-nums; color: var(--t1); line-height: 1.1;
}
.tile .v small { font-size: 12px; font-weight: 400; color: var(--t3); margin-left: 3px; }
.tile .trend { font-size: 11.5px; margin-top: 6px; color: var(--t3); }
.tile.hero {
  background: linear-gradient(160deg, var(--brand), #3F7FE4);
  border-color: var(--brand); color: #fff;
}
.tile.hero .k { color: rgba(255, 255, 255, .82); }
.tile.hero .v { color: #fff; }
.tile.hero .v small { color: rgba(255, 255, 255, .72); }
.tile.hero .trend { color: rgba(255, 255, 255, .85); }

/* 主内容两栏（总览矩阵） */
.home-cols {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 16px; align-items: start;
}
.home-side { padding-left: 0; }

/* 卡片式表格 */
.table-card { background: #fff; border: 1px solid #E7EDF6; border-radius: var(--r-l); overflow: hidden; }
.table-card .table-wrap { overflow-x: auto; }
.table-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--line-l);
}
.table-h h2 { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.table-h .more { font-size: 12px; color: var(--t2); cursor: pointer; }
.table-h .more:hover { color: var(--brand); }

/* 状态分布条形图 */
.dist-bars { padding: 14px 16px; }
.dist-row {
  display: flex; align-items: center; gap: 12px; padding: 7px 0;
}
.dist-row .dk { font-size: 12.5px; color: var(--t2); width: 78px; flex-shrink: 0; }
.dist-row .bar { flex: 1; height: 8px; background: #EDF1F7; border-radius: 4px; overflow: hidden; }
.dist-row .bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.dist-row .dv {
  font-family: ui-monospace, monospace; font-size: 11.5px;
  color: var(--t3); width: 34px; text-align: right; font-variant-numeric: tabular-nums;
}

/* 闭环环图区块 */
.ring-wrap {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px 16px; border-top: 1px solid var(--line-l);
}
.ring-wrap .rt { font-size: 12px; color: var(--t3); line-height: 1.6; }
.ring-wrap .rt b { display: block; font-size: 13px; color: var(--t1); font-weight: 600; }

/* 侧栏小标题 */
.side-h {
  font-size: 13px; font-weight: 650; color: var(--t1);
  letter-spacing: -.01em; margin-bottom: 12px;
}

@media (max-width: 768px) {
  .dist-row .dk { width: 64px; font-size: 12px; }
  .dist-row .dv { width: 28px; }
  .dist-bars { padding: 12px 14px; }
  .ring-wrap { padding: 12px 14px 14px; }
  .table-h { padding: 12px 14px; }
}
