/* ============ 设计令牌 ============ */
:root {
  /* 夜间：冷蓝墨 + 蓝青强调（与官网统一） */
  color-scheme: dark;
  --bg-0: #0b1220;
  --bg-1: #0e1729;
  --bg-2: #101a2e;
  --app-bg-1: #0e1729;
  --app-bg-2: #0b1220;
  --panel: #101a2e;
  --panel-solid: #16223c;
  --stroke: rgba(150, 180, 230, 0.12);
  --stroke-strong: rgba(77, 139, 255, 0.42);
  --text: #eaf2ff;
  --text-strong: #ffffff;
  --text-dim: #9fb2cf;
  --muted: #647691;
  --hover: rgba(77, 139, 255, 0.08);
  --hover-2: rgba(77, 139, 255, 0.13);
  --surface-soft: rgba(150, 180, 230, 0.05);
  --input-bg: #0e1729;
  --input-bg-focus: #0b1220;
  --inset: rgba(0, 0, 0, 0.25);
  --grid-line: rgba(150, 180, 230, 0.05);
  --glow-1: #2f6df6;
  --glow-2: #06b6d4;
  --glow-opacity: 0.12;
  --brand-grad: linear-gradient(135deg, #4d8bff, #22d3ee);
  --bubble-mine-text: #ffffff;
  --cyan: #4d8bff;
  --cyan-2: #2f6df6;
  --violet: #22d3ee;
  --violet-2: #0891b2;
  --green: #8db075;
  --amber: #d4a04f;
  --red: #d8857a;
  --blue: #8da2b8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  --font-display: Georgia, "Times New Roman", "Source Han Serif SC", "Noto Serif SC", "Songti SC", SimSun, serif;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
}

/* 浅色主题（白天） */
html[data-theme="light"] {
  /* 白天：白底 + 蓝青强调（与官网统一） */
  color-scheme: light;
  --bg-0: #ffffff;
  --app-bg-1: #f5f7fb;
  --app-bg-2: #f5f7fb;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --stroke: #e6eaf2;
  --stroke-strong: rgba(47, 109, 246, 0.35);
  --text: #0e1726;
  --text-strong: #0e1726;
  --text-dim: #5b6675;
  --muted: #97a0b0;
  --hover: rgba(47, 109, 246, 0.06);
  --hover-2: rgba(47, 109, 246, 0.10);
  --surface-soft: rgba(47, 109, 246, 0.05);
  --input-bg: #f5f7fb;
  --input-bg-focus: #ffffff;
  --inset: rgba(14, 23, 38, 0.06);
  --grid-line: rgba(14, 23, 38, 0.05);
  --glow-1: #bfdbfe;
  --glow-2: #dbeafe;
  --glow-opacity: 0.30;
  --brand-grad: linear-gradient(135deg, #2f6df6, #06b6d4);
  --bubble-mine-text: #ffffff;
  --cyan: #2f6df6;
  --cyan-2: #1b4fd0;
  --violet: #06b6d4;
  --violet-2: #0891b2;
  --green: #487145;
  --amber: #96621a;
  --red: #ad3a2f;
  --blue: #5d7287;
  --shadow: 0 10px 30px rgba(63, 58, 48, 0.10);
}

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

html, body { height: 100%; }
body {
  background:
    radial-gradient(1200px 700px at 80% -10%, var(--app-bg-1) 0%, transparent 55%),
    radial-gradient(1000px 600px at 0% 110%, var(--app-bg-2) 0%, transparent 50%),
    var(--bg-0);
  background-color: var(--bg-0);
  color: var(--text);
  transition: background-color .3s, color .3s;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============ 背景装饰 ============ */
/* 纸张风格：不再使用科技网格 */
.bg-grid { display: none; }
.bg-glow {
  position: fixed; z-index: 0; pointer-events: none; border-radius: 50%;
  filter: blur(90px); opacity: var(--glow-opacity);
}
.glow-a { width: 460px; height: 460px; background: var(--glow-1); top: -120px; right: -80px; animation: float1 18s ease-in-out infinite; }
.glow-b { width: 420px; height: 420px; background: var(--glow-2); bottom: -140px; left: -100px; animation: float2 22s ease-in-out infinite; }
@keyframes float1 { 50% { transform: translateY(40px) translateX(-30px) scale(1.07); } }
@keyframes float2 { 50% { transform: translateY(-40px) translateX(30px) scale(.93); } }

.glass {
  background: var(--panel);
  border: 1px solid var(--stroke);
}

.hidden { display: none !important; }
.muted { color: var(--text-dim); }

/* ============ 登录 / 注册 ============ */
.auth-screen {
  position: relative; z-index: 2;
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.auth-card {
  position: relative;
  width: 100%; max-width: 420px; border-radius: 22px; padding: 34px 32px;
  box-shadow: var(--shadow);
  animation: rise .6s cubic-bezier(.2,.7,.2,1);
}
.auth-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--stroke-strong), transparent);
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.logo-mark {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px;
  font-size: 24px; color: #3a1d10; font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 8px 24px rgba(47, 109, 246, 0.35);
}
.logo-mark.sm { width: 32px; height: 32px; font-size: 17px; border-radius: 10px; }
.auth-brand h1 { font-size: 22px; letter-spacing: .5px; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-brand p { font-size: 12.5px; margin-top: 2px; }

.auth-tabs { display: flex; gap: 6px; background: var(--inset); padding: 5px; border-radius: 12px; margin-bottom: 22px; }
.auth-tab {
  position: relative; flex: 1; padding: 9px; border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--text-dim); font-size: 14px; font-weight: 600;
  transition: .2s;
}
.auth-tab:not(.active):hover { color: var(--text); background: var(--hover); }
.auth-tab::after {
  content: ""; position: absolute; left: 50%; bottom: 4px; height: 2px; width: 0;
  border-radius: 999px; background: var(--brand-grad);
  transform: translateX(-50%); transition: width .25s cubic-bezier(.2,.7,.2,1);
}
.auth-tab.active { background: linear-gradient(135deg, rgba(47,109,246,.18), rgba(6,182,212,.18)); color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--stroke-strong); }
.auth-tab.active::after { width: 38%; }

.auth-form { display: flex; flex-direction: column; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12.5px; color: var(--text-dim); padding-left: 2px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--text); font-size: 14px;
  border: 1px solid var(--stroke); outline: none; transition: .18s;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 70px; }
input:hover:not(:focus):not(:disabled), select:hover:not(:focus):not(:disabled), textarea:hover:not(:focus):not(:disabled) { border-color: var(--stroke-strong); }
input:focus, select:focus, textarea:focus {
  border-color: var(--cyan-2);
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.14), 0 8px 24px rgba(47, 109, 246, 0.08);
  background-color: var(--input-bg-focus);
}
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
select option { background: var(--panel-solid); }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .55; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover { opacity: .9; }

.hint { font-size: 11.5px; text-align: center; margin-top: 2px; }
.auth-back-row { text-align: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--stroke); }
.auth-back { font-size: 13px; text-decoration: none; transition: color .15s; }
.auth-back:hover { color: var(--cyan); }
.form-msg { font-size: 13px; color: var(--red); min-height: 0; }
.form-msg.show { min-height: 18px; }
.form-msg.ok { color: var(--green); }

/* ============ 按钮 ============ */
.btn {
  border: 0; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 14px; font-weight: 600; padding: 11px 18px; color: #fff;
  transition: transform .15s cubic-bezier(.2,.7,.2,1), box-shadow .2s, background .2s, border-color .2s, color .2s, opacity .2s; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; filter: saturate(.7); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-primary {
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0) 48%), linear-gradient(135deg, var(--cyan-2), var(--violet));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 24px rgba(6, 182, 212, 0.32);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.30), 0 12px 30px rgba(6, 182, 212, 0.5); }
.btn-ghost { background: var(--hover-2); border: 1px solid var(--stroke); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text-strong); border-color: var(--stroke-strong); background: var(--hover-2); box-shadow: 0 4px 14px rgba(47, 109, 246, 0.10); }
.btn-danger { background: rgba(181, 90, 78, 0.14); color: var(--red); border: 1px solid rgba(181,90,78,.3); }
.btn-danger:hover { background: rgba(181, 90, 78, 0.24); border-color: rgba(181,90,78,.5); box-shadow: 0 4px 14px rgba(181, 90, 78, 0.14); }
.btn-soft { background: rgba(122,138,158,.12); color: var(--blue); border: 1px solid var(--stroke); }
.btn-soft:hover { background: rgba(122,138,158,.2); border-color: var(--stroke-strong); box-shadow: 0 4px 14px rgba(122, 138, 158, 0.16); }

/* ============ 应用外壳 ============ */
.app-screen { position: relative; z-index: 2; display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  margin: 14px; border-radius: var(--radius); padding: 18px 14px;
  display: flex; flex-direction: column; position: sticky; top: 14px; height: calc(100vh - 28px);
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 6px 8px 18px; letter-spacing: .4px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -6px; padding: 0 6px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--stroke-strong); border-radius: 999px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 11px;
  color: var(--text-dim); cursor: pointer; font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.nav-item::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 3px; height: 0; border-radius: 999px;
  background: var(--brand-grad);
  transform: translateY(-50%); opacity: 0;
  transition: height .22s cubic-bezier(.2,.7,.2,1), opacity .18s ease;
}
.nav-item.active::before { height: 58%; opacity: 1; }
.nav-item .ico { width: 20px; text-align: center; font-size: 16px; opacity: .9; transition: opacity .18s ease, transform .18s ease; }
.nav-item:hover { color: var(--text-strong); background: var(--hover); }
.nav-item:hover .ico { opacity: 1; transform: translateX(1px); }
.nav-item.active {
  color: var(--text-strong); background: linear-gradient(135deg, rgba(47,109,246,.16), rgba(6,182,212,.16));
  border-color: var(--stroke-strong); box-shadow: inset 0 0 18px rgba(6,182,212,.1);
}
.nav-item.active .ico { color: var(--cyan); }

/* 菜单分组（二级菜单） */
.nav-group { display: flex; flex-direction: column; }
.nav-group-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none;
  padding: 9px 13px; margin-top: 6px; border-radius: 9px; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  color: var(--muted); text-transform: uppercase; transition: color .18s ease, background-color .18s ease; }
.nav-group-head:hover { color: var(--text-dim); background: var(--hover); }
.nav-group.open .nav-group-head { color: var(--text-dim); }
.nav-group-head .ng-arrow { font-size: 10px; opacity: .7; transition: transform .25s cubic-bezier(.2,.7,.2,1), opacity .18s ease; }
.nav-group-head:hover .ng-arrow { opacity: 1; }
.nav-group:not(.open) .ng-arrow { transform: rotate(-90deg); }
.nav-sub { display: none; flex-direction: column; gap: 4px; margin: 2px 0 2px 10px; padding-left: 8px; border-left: 1px solid var(--stroke); border-image: linear-gradient(180deg, var(--stroke-strong), var(--stroke) 40%, transparent) 1; }
.nav-group.open .nav-sub { display: flex; }
.nav-sub .nav-item { font-size: 13.5px; padding: 9px 12px; }

/* 空状态/图标按钮里的自绘 SVG 尺寸 */
.empty .big svg { width: 46px; height: 46px; opacity: .55; }
#theme-toggle svg, #auth-theme svg, .icon-btn svg { width: 18px; height: 18px; display: block; }

.sidebar-foot { border-top: 1px solid var(--stroke); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  font-weight: 700; color: #371c0f; flex-shrink: 0;
  background: linear-gradient(135deg, var(--cyan), var(--violet-2));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 6px 14px var(--stroke-strong);
}
.user-name { font-size: 14px; font-weight: 600; }
.user-role { font-size: 12px; }

/* ============ 主区域 ============ */
.main { padding: 18px 26px 40px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--stroke); border-image: linear-gradient(90deg, var(--stroke-strong), var(--stroke) 30%, transparent 85%) 1; }
.topbar h2 { font-size: 24px; font-weight: 600; font-family: var(--font-display); letter-spacing: 0; }
.auth-brand h1 { font-family: var(--font-display); }
.topbar p { font-size: 13px; margin-top: 3px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
#theme-toggle { width: 38px; height: 38px; font-size: 17px; }
.clock { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--text-dim); padding: 8px 14px; border-radius: 10px; background: var(--hover); border: 1px solid var(--stroke); }

.view { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

/* ============ 卡片 / 网格 ============ */
.card {
  background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius);
  padding: 20px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* 统计卡 */
.stat {
  border-radius: var(--radius); padding: 18px 20px; position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--stroke);
}
.stat::after { display: none; }
.stat .num { font-size: 28px; font-weight: 800; letter-spacing: .3px; margin: 7px 0 0; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: 12.5px; color: var(--text-dim); letter-spacing: .3px; }
.stat.c-cyan .num { color: var(--cyan); }
.stat.c-green .num { color: var(--green); }
.stat.c-amber .num { color: var(--amber); }
.stat.c-red .num { color: var(--red); }
.stat.c-violet .num { color: var(--blue); }

/* ============ 考勤打卡 ============ */
.punch-card { text-align: center; padding: 26px; }
.punch-time { font-size: 52px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1.5px; line-height: 1.1;
  background: linear-gradient(90deg, var(--cyan), var(--violet-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
 }
.punch-date { color: var(--muted); font-size: 13px; margin: 6px 0 20px; }
.punch-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.punch-status { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.punch-slot { text-align: center; padding: 10px 18px; min-width: 112px; border-radius: var(--radius-sm); background: var(--surface-soft); border: 1px solid var(--stroke); transition: background .2s, border-color .2s; }
.punch-slot .t { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.punch-slot .l { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.punch-slot.done { background: rgba(109, 154, 102, 0.08); border-color: rgba(109, 154, 102, 0.32); }
.punch-slot.done .t { color: var(--green); }
.punch-slot.done .t::after { content: " ✓"; font-size: 13px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--stroke); }
th { color: var(--text-dim); font-weight: 700; font-size: 12px; white-space: nowrap; letter-spacing: .06em; text-transform: uppercase; }
thead th { border-bottom-color: var(--stroke-strong); }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--hover); }
tbody tr:last-child td { border-bottom-color: transparent; }
td .name { font-weight: 600; }

/* ============ 徽章 ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
  border: 1px solid transparent;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge.role-super_admin { background: var(--brand-grad); color: #fff; border-color: transparent; }
.badge.role-director { background: rgba(122,138,158,.14); color: var(--blue); border-color: rgba(122,138,158,.3); }
.badge.role-leader { background: rgba(47,109,246,.13); color: var(--cyan); border-color: rgba(47,109,246,.3); }
.badge.role-programmer { background: rgba(135,134,127,.13); color: var(--text-dim); border-color: var(--stroke); }

.badge.st-todo { background: rgba(135,134,127,.13); color: var(--text-dim); border-color: rgba(135,134,127,.28); }
.badge.st-doing { background: rgba(122,138,158,.15); color: var(--blue); border-color: rgba(122,138,158,.3); }
.badge.st-done { background: rgba(109,154,102,.14); color: var(--green); border-color: rgba(109,154,102,.3); }
.badge.st-paused { background: rgba(196,148,72,.15); color: var(--amber); border-color: rgba(196,148,72,.3); }
.badge.st-blocked { background: rgba(181,90,78,.15); color: var(--red); border-color: rgba(181,90,78,.3); }
.badge.on { background: rgba(109,154,102,.14); color: var(--green); }
.badge.off { background: rgba(135,134,127,.13); color: var(--text-dim); }

/* ============ 我的任务卡片 ============ */
.task-list { display: flex; flex-direction: column; gap: 12px; }
.task-item {
  background: var(--panel); border: 1px solid var(--stroke); border-radius: 14px;
  padding: 15px 16px; display: flex; gap: 14px; align-items: flex-start; transition: .18s;
  position: relative; overflow: hidden;
}
.task-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--text-dim); opacity: .8; }
.task-item.st-doing::before { background: var(--blue); }
.task-item.st-done::before { background: var(--green); }
.task-item.st-paused::before { background: var(--amber); }
.task-item.st-blocked::before { background: var(--red); }
.task-item.st-todo::before { background: var(--muted); }
.task-item:hover { border-color: var(--stroke-strong); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.22); }
html[data-theme="light"] .task-item:hover { box-shadow: 0 10px 26px rgba(63,58,48,.10); }
.task-item.is-done { opacity: .7; }
.task-item.is-done:hover { opacity: 1; }
.task-item.is-done .task-title { text-decoration: line-through; text-decoration-color: var(--muted); color: var(--text-dim); }
.task-check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--stroke-strong);
  cursor: pointer; flex-shrink: 0; margin-top: 2px; display: grid; place-items: center;
  transition: .16s cubic-bezier(.2,.7,.2,1); color: transparent; font-size: 13px;
}
.task-check:hover { border-color: var(--green); transform: scale(1.08); }
.task-check:active { transform: scale(.92); }
.task-check.checked { background: var(--green); border-color: transparent; color: #fff; box-shadow: 0 2px 10px rgba(109,154,102,.35); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.task-meta { font-size: 12px; color: var(--text-dim); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.task-detail { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; }
.task-issue { margin-top: 8px; font-size: 12.5px; background: rgba(181,90,78,.08); border: 1px solid rgba(181,90,78,.22); color: var(--red); padding: 8px 10px; border-radius: 9px; }
.task-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.status-select { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; width: auto; }

/* ============ 任务树 ============ */
.tree { display: flex; flex-direction: column; gap: 6px; }
.tree-node { }
.tree-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--stroke); background: var(--panel); transition: .15s;
}
.tree-row:hover { border-color: var(--stroke-strong); background: var(--surface-soft); }
.tree-toggle { width: 18px; cursor: pointer; color: var(--text-dim); user-select: none; flex-shrink: 0; text-align: center; }
.tree-toggle.leaf { opacity: .25; cursor: default; }
.tree-main { flex: 1; min-width: 0; }
.tree-title { font-size: 14px; font-weight: 600; }
.tree-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.tree-ops { display: flex; gap: 6px; opacity: 0; transform: translateX(6px); transition: opacity .18s, transform .18s; }
.tree-row:hover .tree-ops, .tree-row:focus-within .tree-ops { opacity: 1; transform: translateX(0); }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--stroke);
  background: var(--hover); color: var(--text-dim); cursor: pointer; font-size: 14px;
  display: grid; place-items: center; transition: .15s;
}
.icon-btn:hover { color: var(--text-strong); border-color: var(--stroke-strong); }
.icon-btn.danger:hover { color: var(--red); border-color: rgba(181,90,78,.4); }
.tree-children { margin-left: 22px; padding-left: 12px; border-left: 1px solid var(--stroke); margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.tree-children > .tree-node { position: relative; }
.tree-children > .tree-node::before { content: ""; position: absolute; left: -12px; top: 20px; width: 9px; height: 1px; background: var(--stroke); }
.tree-children > .tree-node:hover::before { background: var(--stroke-strong); }

/* ============ 弹窗 ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(20, 18, 14, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
  animation: fade .2s ease;
}
.modal {
  width: 100%; max-width: 460px; border-radius: 18px; padding: 24px;
  background: var(--panel-solid); border: 1px solid var(--stroke-strong); box-shadow: var(--shadow);
  animation: modal-in .26s cubic-bezier(.2,.9,.3,1.08);
  max-height: calc(100vh - 40px); overflow-y: auto; overscroll-behavior: contain;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.modal::-webkit-scrollbar { width: 7px; }
.modal::-webkit-scrollbar-thumb { background: var(--stroke-strong); border-radius: 999px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal h3 { font-size: 17px; margin-bottom: 18px; position: sticky; top: -24px; z-index: 1;
  background: var(--panel-solid); margin-top: -24px; padding: 24px 0 14px; }
.modal-form { display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--stroke); flex-wrap: wrap; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ============ Toast ============ */
.toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 11px 18px; border-radius: 11px; font-size: 13.5px; font-weight: 500; color: var(--text-strong);
  background: var(--panel-solid); border: 1px solid var(--stroke-strong); box-shadow: var(--shadow);
  animation: toast-in .3s cubic-bezier(.2,.9,.3,1.1); max-width: 90vw;
  border-left-width: 3px; border-left-color: var(--cyan); pointer-events: auto;
}
.toast.ok { border-color: rgba(109,154,102,.5); border-left-color: var(--green); }
.toast.err { border-color: rgba(181,90,78,.5); border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.97); } }

/* ============ 内部聊天 ============ */
.chat { display: grid; grid-template-columns: 210px 1fr; gap: 16px; height: calc(100vh - 156px); min-height: 460px; }
.chat-channels { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 14px; }
.chat-ch-title { font-size: 11.5px; color: var(--text-dim); letter-spacing: 1px; margin-bottom: 10px; padding-left: 6px; }
.chat-ch { padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--text-dim); font-size: 13.5px; font-weight: 500; transition: .15s; margin-bottom: 4px; border: 1px solid transparent; }
.chat-ch:hover { background: var(--hover); color: var(--text-strong); }
.chat-ch.active { background: linear-gradient(135deg, rgba(47,109,246,.16), rgba(6,182,212,.16)); color: var(--text-strong); border-color: var(--stroke-strong); }
.chat-main { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius); overflow: hidden; }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--stroke); font-weight: 600; font-size: 14.5px; flex-shrink: 0; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 78%; }
.msg.mine { flex-direction: row-reverse; align-self: flex-end; }
.msg-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; color: #371c0f; flex-shrink: 0; background: linear-gradient(135deg, var(--cyan), var(--violet-2)); font-size: 14px; }
.msg-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg.mine .msg-col { align-items: flex-end; }
.msg-meta { font-size: 11.5px; color: var(--text-dim); padding: 0 2px; }
.msg-bubble { padding: 10px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; background: var(--hover-2); border: 1px solid var(--stroke); border-top-left-radius: 3px; }
.msg.mine .msg-bubble { background: linear-gradient(135deg, rgba(47,109,246,.18), rgba(6,182,212,.18)); border-color: var(--stroke-strong); border-top-left-radius: 12px; border-top-right-radius: 3px; color: var(--bubble-mine-text); }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--stroke); flex-shrink: 0; align-items: center; }
.chat-input input[type="text"], .chat-input #chat-text { flex: 1; }
.chat-input .btn { flex-shrink: 0; }
.chat-input #chat-attach { flex-shrink: 0; width: 42px; height: 42px; font-size: 18px; }

/* 聊天文件 / 图片 */
.msg-img { display: block; max-width: 240px; border-radius: 10px; overflow: hidden; }
.msg-img img { display: block; max-width: 100%; border-radius: 10px; }
.msg-bubble.bubble-media { padding: 4px; background: transparent; border: 0; }
.msg.mine .msg-bubble.bubble-media { background: transparent; }
.msg-file { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; min-width: 210px; }
.msg-file-ico { font-size: 24px; flex-shrink: 0; }
.msg-file-meta { display: flex; flex-direction: column; min-width: 0; }
.msg-file-name { font-size: 13px; font-weight: 600; color: var(--text-strong); word-break: break-all; }
.msg-file-size { font-size: 11px; color: var(--text-dim); }
.msg-file-dl { margin-left: auto; font-size: 12px; color: var(--cyan); flex-shrink: 0; font-weight: 600; }

/* ============ 杂项 ============ */
.empty { text-align: center; padding: 54px 20px; color: var(--text-dim); font-size: 13.5px; line-height: 1.9; }
.empty .big {
  font-size: 40px; opacity: .9; margin-bottom: 14px;
  width: 80px; height: 80px; margin-left: auto; margin-right: auto;
  display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(135deg, rgba(47,109,246,.10), rgba(6,182,212,.12));
  border: 1px solid var(--stroke);
}
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-gap { margin-top: 20px; }
.inline { display: inline-flex; align-items: center; gap: 8px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ============ 响应式 ============ */
@media (max-width: 720px) {
  .app-screen { grid-template-columns: 1fr; }
  .sidebar {
    position: relative; height: auto; flex-direction: row; flex-wrap: wrap;
    align-items: center; gap: 10px; padding: 12px 14px;
  }
  .sidebar-brand { padding: 0; flex: 0 0 auto; }
  .nav { flex-direction: row; flex: 1 1 100%; order: 3; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .nav-item { white-space: nowrap; padding: 9px 13px; }
  /* 移动端：分组扁平化，所有菜单项横向铺开 */
  .nav-group, .nav-sub { display: contents; }
  .nav-group-head { display: none; }
  .sidebar-foot {
    border-top: 0; padding-top: 0; flex-direction: row; align-items: center;
    margin-left: auto; gap: 10px; order: 2;
  }
  .user-meta { white-space: nowrap; }
  .user-role { white-space: nowrap; }
  #logout-btn { width: auto; }
  .main { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; height: auto; }
  .chat-channels { display: flex; gap: 6px; overflow-x: auto; }
  .chat-ch { white-space: nowrap; margin-bottom: 0; }
  .chat-ch-title { display: none; }
  .chat-msgs { min-height: 360px; max-height: 56vh; }
}

/* ============ C 阶段：视频会议 ============ */
.meet-setup { display: flex; gap: 14px; align-items: flex-end; }
.meet-setup .btn { flex-shrink: 0; }
.meet-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.meet-room-name { font-weight: 700; font-size: 15px; }
.meet-count { font-size: 13px; }
.meet-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.meet-grid[data-n="2"] { grid-template-columns: repeat(2, 1fr); }
.meet-grid[data-n="3"], .meet-grid[data-n="4"] { grid-template-columns: repeat(2, 1fr); }
.meet-grid[data-n="5"], .meet-grid[data-n="6"] { grid-template-columns: repeat(3, 1fr); }
.meet-tile {
  position: relative; aspect-ratio: 4/3; border-radius: 14px; overflow: hidden;
  background: #14110d; border: 1px solid var(--stroke); display: grid; place-items: center;
}
.meet-tile.mine { border-color: var(--stroke-strong); }
.meet-tile video { width: 100%; height: 100%; object-fit: cover; background: #14110d; }
.meet-tile .meet-novideo { position: absolute; font-size: 54px; opacity: .35; display: none; }
.meet-tile.audio-only video { display: none; }
.meet-tile.audio-only .meet-novideo { display: block; }
.meet-name {
  position: absolute; left: 10px; bottom: 9px; font-size: 12.5px; font-weight: 600;
  color: #fff; background: rgba(0,0,0,.45); padding: 3px 10px; border-radius: 8px; backdrop-filter: blur(4px);
}
.meet-tip { font-size: 12.5px; margin-top: 12px; }

/* ============ C 阶段：协同文档 ============ */
.doc-card { position: relative; cursor: pointer; transition: .16s; }
.doc-card:hover { border-color: var(--stroke-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.doc-card-title { font-size: 15px; font-weight: 700; font-family: var(--font-display); margin-bottom: 8px; }
.doc-card-meta { font-size: 12.5px; }
.doc-online { color: var(--green); font-weight: 600; }
.doc-card-time { font-size: 11.5px; margin-top: 4px; }
.doc-del { position: absolute; top: 12px; right: 12px; opacity: 0; }
.doc-card:hover .doc-del { opacity: 1; }

.doc-presence { display: flex; align-items: center; gap: 6px; }
.pres-chip {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #371c0f; margin-left: -8px;
  background: linear-gradient(135deg, var(--cyan), var(--violet-2)); border: 2px solid var(--panel-solid);
}
.pres-chip.me { background: linear-gradient(135deg, var(--green), var(--cyan)); }
.pres-label { margin-left: 8px; font-size: 12.5px; }

.doc-editor-card { padding: 0; overflow: hidden; }
.doc-editor-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--stroke); }
.doc-editor-title { font-weight: 700; font-size: 14.5px; }
.doc-status { font-size: 12.5px; }
.doc-editor {
  width: 100%; min-height: calc(100vh - 320px); border: 0; border-radius: 0; resize: vertical;
  padding: 20px; font-size: 14.5px; line-height: 1.8; background: transparent;
  font-family: "SF Mono", "Cascadia Code", "Consolas", "Microsoft YaHei", monospace;
}
.doc-editor:focus { box-shadow: none; background: var(--surface-soft); }
.doc-foot { padding: 10px 18px; border-top: 1px solid var(--stroke); font-size: 12.5px; min-height: 18px; }

@media (max-width: 720px) {
  .meet-setup { flex-direction: column; align-items: stretch; }
  .meet-grid[data-n] { grid-template-columns: 1fr !important; }
}

/* ============ 可注册名单（白名单）行 ============ */
.wl-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-bottom: 1px solid var(--stroke); }
.wl-row:last-child { border-bottom: 0; }
.wl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wl-idc { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.wl-main .muted { font-size: 12px; }

/* 员工多部门 */
.dept-checks { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.dept-check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 6px 11px; border: 1px solid var(--stroke); border-radius: 9px; cursor: pointer; color: var(--text-dim); transition: .15s; }
.dept-check:hover { border-color: var(--stroke-strong); color: var(--text); }
.dept-check input { width: auto; }
.dept-check:has(input:checked) { background: rgba(6,182,212,.12); color: var(--cyan); border-color: var(--stroke-strong); }
.dept-main { font-size: 10.5px; color: var(--cyan); border: 1px solid var(--stroke-strong); border-radius: 5px; padding: 0 4px; margin-left: 3px; vertical-align: middle; }
.dept-dir { font-size: 10.5px; color: var(--amber); border: 1px solid rgba(196,148,72,.4); background: rgba(196,148,72,.12); border-radius: 5px; padding: 0 4px; margin-left: 3px; vertical-align: middle; }
.dir-flag { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; font-size: 11px; color: var(--text-dim); padding: 1px 6px; border-radius: 6px; border: 1px dashed var(--stroke); }
.dir-flag input { width: auto; }
.pos-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-dim); background: var(--inset); border: 1px solid var(--stroke); border-radius: 6px; padding: 1px 8px; }
.pos-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pos-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.pos-del:hover { color: var(--red); }
.pos-group { padding: 8px 0; border-top: 1px dashed var(--stroke); }
.pos-group:first-child { border-top: 0; }
.pos-group-h { font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.sm { font-size: 12px; }

/* 危险提示框（删除确认/受限提示） */
.danger-note { display: flex; gap: 10px; align-items: flex-start; background: rgba(181,90,78,.08); border: 1px solid rgba(181,90,78,.3); border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.6; color: var(--text); }
.danger-note .ico { color: var(--red); flex: 0 0 auto; margin-top: 1px; }
.danger-note .ico svg { width: 20px; height: 20px; }
.dept-card { transition: border-color .15s, transform .1s; }
.dept-card:hover { border-color: var(--stroke-strong); transform: translateY(-1px); }
.roster-wrap .table-wrap { max-height: 56vh; overflow: auto; }

/* 通讯录 / 好友 */
.ct-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .ct-cols { grid-template-columns: 1fr; } }
.ct-card { padding: 16px 18px; }
.card-h { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card-h .muted { font-weight: 500; }
.ct-list { display: flex; flex-direction: column; gap: 6px; }
.ct-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--stroke); border-radius: 10px; }
.ct-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ct-av { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: var(--brand-grad); flex: 0 0 auto; }
.ct-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.ct-search { width: 100%; margin-bottom: 10px; padding: 8px 11px; border: 1px solid var(--stroke); border-radius: 9px; background-color: var(--inset); color: var(--text); font-family: inherit; font-size: 13px; }
.badge.warn-b { background: rgba(196,148,72,.16); color: var(--amber); border: 1px solid rgba(196,148,72,.35); }

/* 代码主树 */
.repo-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .repo-cols { grid-template-columns: 1fr; } }
.repo-pane { padding: 16px 18px 14px; min-width: 0; }
.repo-pane > .card-h { position: relative; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--stroke); }
.repo-pane > .card-h::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 52px; height: 2px; border-radius: 999px; background: var(--brand-grad); }
.tf-list { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow: auto; padding: 2px 4px 2px 2px; scrollbar-width: thin; }
.tf-list::-webkit-scrollbar { width: 6px; }
.tf-list::-webkit-scrollbar-thumb { background: var(--stroke-strong); border-radius: 999px; }
.tf-list::-webkit-scrollbar-track { background: transparent; }
.tf-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 13px; transition: background .12s, border-color .15s; }
.tf-row:hover { background: var(--hover-2); border-color: var(--stroke); }
.tf-row:hover .tf-ico { color: var(--cyan); }
.tf-row:hover .tf-path { color: var(--text-strong); }
.tf-ico { color: var(--text-dim); display: inline-flex; }
.tf-ico svg { width: 15px; height: 15px; }
.tf-path { flex: 1; font-family: var(--font-mono, ui-monospace, monospace); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-list { display: flex; flex-direction: column; gap: 6px; }
.mr-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border: 1px solid var(--stroke); border-radius: 10px; }
.code-area { width: 100%; min-height: 320px; resize: vertical; font-family: var(--font-mono, ui-monospace, "Cascadia Code", Consolas, monospace); font-size: 12.5px; line-height: 1.55; tab-size: 2; background: var(--inset); color: var(--text); border: 1px solid var(--stroke); border-radius: 9px; padding: 12px; white-space: pre; overflow: auto; }
.att-bar { height: 8px; border-radius: 999px; background: var(--inset); overflow: hidden; margin-top: 5px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18); }
.att-bar > div { height: 100%; background: var(--brand-grad); border-radius: 999px; transition: width .6s cubic-bezier(.22, 1, .36, 1); }
.punch-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.punch-timeline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; justify-content: center; }
.pt-item { font-size: 11.5px; color: var(--text-dim); background: var(--inset); border: 1px solid var(--stroke); border-radius: 999px; padding: 3px 11px; font-variant-numeric: tabular-nums; transition: color .15s, border-color .15s; }
.pt-item:hover { color: var(--text); border-color: var(--stroke-strong); }
.ar-grp .row-2 { margin-bottom: 0; }
.es-card { transition: border-color .15s, transform .1s; }
.es-card:hover { border-color: var(--stroke-strong); transform: translateY(-1px); }
.es-info { border: 1px solid var(--stroke); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.es-chat { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--inset); border: 1px solid var(--stroke); border-radius: 10px; }
.es-msg { font-size: 13px; padding: 6px 9px; border-radius: 8px; background: var(--surface-soft); align-self: flex-start; max-width: 88%; }
.es-msg.me { align-self: flex-end; background: rgba(47,109,246,.14); }
.verify-log { margin: 6px 0 0; padding: 9px 11px; background: var(--input-bg); border: 1px solid var(--stroke); border-radius: 8px; font-family: var(--font-mono, ui-monospace, Consolas, monospace); font-size: 11px; line-height: 1.55; max-height: 120px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: var(--text-dim); box-shadow: inset 0 1px 5px rgba(0, 0, 0, .15); scrollbar-width: thin; }
.verify-log::-webkit-scrollbar { width: 6px; }
.verify-log::-webkit-scrollbar-thumb { background: var(--stroke-strong); border-radius: 999px; }
.verify-log::-webkit-scrollbar-track { background: transparent; }
.prereq-card { padding: 12px 16px; margin-bottom: 14px; border-left: 3px solid var(--cyan); }
.prereq-body { font-size: 13px; line-height: 1.6; color: var(--text-dim); }
.link-btn { color: var(--cyan); font-size: 12px; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }
.node-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
.node-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(109,154,102,.18); }
.node-dot.off { background: var(--muted); }
.tok-line { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.tok { font-family: var(--font-mono, ui-monospace, Consolas, monospace); font-size: 11.5px; background: var(--inset); border: 1px solid var(--stroke); border-radius: 6px; padding: 2px 7px; color: var(--text-dim); word-break: break-all; }
.agent-steps { margin: 4px 0 0; padding-left: 20px; font-size: 12.5px; line-height: 2; color: var(--text-dim); }
.agent-steps code.tok { font-size: 11px; }
/* AI 任务树预览 */
.ai-pv-h { font-size: 13px; font-weight: 700; color: var(--cyan); margin: 14px 0 8px; padding-top: 12px; border-top: 1px dashed var(--stroke); }
.ai-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed var(--stroke); }
.ai-sub .ai-s-title { flex: 1 1 140px; }
.ai-sub .ai-s-detail { flex: 2 1 200px; }
.ai-sub .ai-s-assignee { flex: 0 0 auto; width: auto; }
.ai-sub input, .ai-sub select { padding: 6px 9px; border: 1px solid var(--stroke); border-radius: 8px; background-color: var(--inset); color: var(--text); font-size: 12.5px; font-family: inherit; }

/* ============ 协作工单 ============ */
.seg { display: inline-flex; gap: 4px; background: var(--inset); padding: 4px; border-radius: 10px; }
.seg-btn { border: 0; background: transparent; color: var(--text-dim); font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 7px; cursor: pointer; font-family: inherit; transition: .15s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--panel-solid); color: var(--cyan); box-shadow: inset 0 0 0 1px var(--stroke-strong); }
.ticket-list { display: flex; flex-direction: column; gap: 12px; }
.ticket-card { cursor: pointer; transition: .16s; padding: 16px 18px; }
.ticket-card:hover { border-color: var(--stroke-strong); transform: translateX(2px); }
.t-title { font-size: 15px; font-weight: 600; }
.t-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 12.5px; margin-top: 8px; }
.t-type { padding: 2px 9px; border-radius: 999px; background: var(--hover-2); border: 1px solid var(--stroke); font-size: 11.5px; color: var(--text-dim); }

/* 工单详情 */
.td-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.td-title { font-size: 17px; font-weight: 700; font-family: var(--font-display); }
.td-route { font-size: 12.5px; margin-bottom: 12px; }
.td-content { background: var(--surface-soft); border: 1px solid var(--stroke); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; margin-bottom: 14px; }
.td-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.td-timeline { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 0; border-top: 1px solid var(--stroke); padding-top: 14px; }
.tl-sys { text-align: center; }
.tl-sys span { font-size: 11.5px; color: var(--muted); background: var(--hover); padding: 3px 12px; border-radius: 999px; }
.tl-msg { background: var(--hover-2); border: 1px solid var(--stroke); border-radius: 10px; padding: 9px 12px; }
.tl-head { font-size: 11.5px; color: var(--text-dim); margin-bottom: 3px; }
.tl-body { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.td-reply { display: flex; gap: 10px; margin-top: 14px; }
.td-reply input { flex: 1; }

/* ============ 客户与项目管理（CRM） ============ */
.crm-row { cursor: pointer; }
.progress { height: 7px; border-radius: 999px; background: var(--inset); overflow: hidden; margin-top: 8px; }
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cyan), var(--violet-2)); transition: width .4s; }
.crm-proj { padding: 14px 16px; }
.crm-delivs { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.crm-deliv { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; background: var(--surface-soft); border: 1px solid var(--stroke); border-radius: 8px; padding: 6px 10px; }
.crm-deliv .muted { font-size: 11px; }
.crm-chat { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.crm-msg { max-width: 85%; }
.crm-msg.mine { align-self: flex-end; }
.crm-msg-name { font-size: 11px; color: var(--text-dim); margin-bottom: 2px; }
.crm-msg.mine .crm-msg-name { text-align: right; }
.crm-msg-bubble { display: inline-block; padding: 8px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5; background: var(--hover-2); border: 1px solid var(--stroke); white-space: pre-wrap; word-break: break-word; }
.crm-msg.mine .crm-msg-bubble { background: linear-gradient(135deg, rgba(47,109,246,.18), rgba(6,182,212,.18)); border-color: var(--stroke-strong); color: var(--bubble-mine-text); }

/* ============ 费用报销 ============ */
.reimb-review { margin-top: 8px; font-size: 12.5px; background: var(--surface-soft); border: 1px solid var(--stroke); border-radius: 8px; padding: 8px 10px; color: var(--text-dim); }
.reimb-actions { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; flex-wrap: wrap; }

/* ============ 人事 · 招聘 ============ */
.hr-stages { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.cand-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.cand-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 11px; border: 1px solid var(--stroke); border-radius: 9px; background: var(--surface-soft); }

/* ============ 售后 · SLA ============ */
.sla-over { color: var(--red); font-weight: 700; }

/* ============ 系统更新 ============ */
.sys-files { font-family: "SF Mono", Consolas, monospace; font-size: 11.5px; color: var(--text-dim); background: var(--surface-soft); border: 1px solid var(--stroke); border-radius: 8px; padding: 8px 10px; margin-top: 4px; max-height: 160px; overflow: auto; line-height: 1.7; }
.sys-files.ok-files { color: var(--green); }

/* ============ 数据报表 ============ */
.rep-bars { display: flex; flex-direction: column; gap: 10px; }
.rep-bar-row { display: grid; grid-template-columns: 64px 1fr 32px; align-items: center; gap: 10px; font-size: 13px; }
.rep-bar-label { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-track { height: 10px; background: var(--inset); border-radius: 999px; overflow: hidden; }
.rep-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet-2)); border-radius: 999px; transition: width .5s; }
.rep-bar-num { text-align: right; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.rep-task { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.rep-task-row { display: flex; align-items: center; gap: 8px; }
.rep-task-num { margin-left: auto; font-weight: 700; }
.rep-stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin-top: 14px; background: var(--inset); }
.rep-stack > div { height: 100%; }
.rep-mod { background: var(--panel); border: 1px solid var(--stroke); border-radius: 14px; padding: 16px; }
.rep-mod-t { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.rep-mod-b { font-size: 12.5px; color: var(--text-dim); }
.rep-mod-b b { color: var(--text-strong); font-size: 15px; }

/* ============ 下拉框自定义箭头（双渐变绘制 V 形，颜色走主题变量） ============ */
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
select:focus {
  background-image: linear-gradient(45deg, transparent 50%, var(--cyan-2) 50%), linear-gradient(135deg, var(--cyan-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.ai-sub select { padding-right: 26px; background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; }
.ai-sub select:focus { background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; }

/* ============ 任务状态下拉：小药丸 ============ */
.status-select {
  border-radius: 999px; padding: 6px 28px 6px 13px; font-weight: 600; cursor: pointer;
  background-color: var(--hover); border-color: var(--stroke);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
}
.status-select:focus { background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; }
.status-select:hover { color: var(--text-strong); background-color: var(--hover-2); border-color: var(--stroke-strong); }

/* ============ 全局细滚动条 / 文本选中 / 键盘焦点可达性 ============ */
::selection { background: rgba(47, 109, 246, 0.28); color: var(--text-strong); }
::selection { background: color-mix(in srgb, var(--cyan-2) 28%, transparent); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--stroke-strong); border: 2px solid transparent; background-clip: padding-box; }
.btn:focus-visible, .icon-btn:focus-visible, .auth-tab:focus-visible, .seg-btn:focus-visible, .nav-item:focus-visible, .chat-ch:focus-visible, .task-check:focus-visible, .link-btn:focus-visible, .auth-back:focus-visible { outline: 2px solid var(--cyan-2); outline-offset: 2px; }

/* 侧栏品牌区：底部渐隐分隔 + 呼吸感 */
.sidebar-brand { position: relative; margin-bottom: 12px; }
.sidebar-brand::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 1px; background: linear-gradient(90deg, var(--stroke-strong), var(--stroke) 40%, transparent); }
@media (max-width: 720px) { .sidebar-brand { margin-bottom: 0; } .sidebar-brand::after { display: none; } }

/* ===== 打磨：统计卡层次（hover 升起 + 顶部渐变细线 + 左侧色条） ===== */
.stat { transition: transform .2s ease, box-shadow .25s ease, border-color .2s ease; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px; background: var(--brand-grad); opacity: 0; transition: opacity .25s ease; }
.stat:hover { transform: translateY(-3px); border-color: var(--stroke-strong); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28); }
.stat:hover::before { opacity: .85; }
html[data-theme="light"] .stat:hover { box-shadow: 0 14px 30px rgba(63, 58, 48, 0.12); }
.stat.c-cyan { border-left: 3px solid var(--cyan); background: linear-gradient(135deg, color-mix(in srgb, var(--cyan) 8%, var(--panel)), var(--panel) 58%); }
.stat.c-green { border-left: 3px solid var(--green); background: linear-gradient(135deg, color-mix(in srgb, var(--green) 8%, var(--panel)), var(--panel) 58%); }
.stat.c-amber { border-left: 3px solid var(--amber); background: linear-gradient(135deg, color-mix(in srgb, var(--amber) 8%, var(--panel)), var(--panel) 58%); }
.stat.c-red { border-left: 3px solid var(--red); background: linear-gradient(135deg, color-mix(in srgb, var(--red) 8%, var(--panel)), var(--panel) 58%); }
.stat.c-violet { border-left: 3px solid var(--blue); background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 8%, var(--panel)), var(--panel) 58%); }

/* ===== 打磨：打卡按钮主视觉 ===== */
.att-btn { min-width: 104px; padding: 12px 20px; font-size: 14.5px; border-radius: 12px;
  transition: transform .15s ease, box-shadow .25s ease, background-position .35s ease, background .2s, opacity .2s, filter .2s; }
.att-btn.btn-primary { background: var(--brand-grad); background-size: 180% 100%; background-position: 0% 0; box-shadow: 0 10px 26px rgba(6, 182, 212, 0.35); }
.att-btn.btn-primary:hover:not(:disabled) { background-position: 90% 0; transform: translateY(-1px); box-shadow: 0 14px 34px rgba(6, 182, 212, 0.5); }
.att-btn:active:not(:disabled) { transform: translateY(1px) scale(.97); }
.att-btn:disabled { opacity: .45; cursor: default; box-shadow: none; filter: saturate(.5); transform: none; }

/* 待处理橙色态（待确认接受 / 完成待审核），取代原行内 border-color:var(--amber) */
.task-item.is-pending { border-color: rgba(212,160,79,.5); }
.task-item.is-pending::before { background: var(--amber); }
.task-item.is-pending:hover { border-color: var(--amber); }
.task-item.is-pending .task-check { border-color: var(--amber); color: var(--amber); }
html[data-theme="light"] .task-item.is-pending { border-color: rgba(176,122,42,.45); }
html[data-theme="light"] .task-item.is-pending:hover { border-color: var(--amber); }

/* 代码主树：分支下拉与 btn-sm 等高对齐 */
.repo-pane .card-h select.ct-search { padding: 7px 30px 7px 10px; margin-bottom: 0; font-size: 12.5px; font-weight: 600; border-radius: var(--radius-sm); background-color: var(--input-bg); cursor: pointer; transition: border-color .15s, box-shadow .15s; background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; }
.repo-pane .card-h select.ct-search:hover { border-color: var(--stroke-strong); }
.repo-pane .card-h select.ct-search:focus { outline: none; border-color: var(--stroke-strong); box-shadow: 0 0 0 3px rgba(47, 109, 246, .14); }

/* 代码主树：项目卡 hover 反馈 */
.repo-card { transition: transform .16s ease, border-color .16s, box-shadow .2s; }
.repo-card:hover { transform: translateY(-2px); border-color: var(--stroke-strong); box-shadow: 0 14px 30px rgba(0, 0, 0, .28); }
html[data-theme="light"] .repo-card:hover { box-shadow: 0 14px 30px rgba(63, 58, 48, .14); }

/* 代码主树：文件行元信息、合并请求行细节 */
.tf-row > .muted.sm { flex: 0 0 auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mr-row { transition: border-color .15s, background .15s; }
.mr-row:hover { border-color: var(--stroke-strong); background: var(--surface-soft); }
a.btn { text-decoration: none; }

/* 亮色主题：日期/时间控件图标不再反色（否则白图标落在白底输入框上不可见） */
html[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator { filter: none; opacity: .6; }
html[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator:hover,
html[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator:hover { opacity: .95; }

/* ============ 移动端补充打磨（≤860px） ============ */
@media (max-width: 860px) {
  .repo-cols, .ct-cols { gap: 12px; }
  .task-item { flex-wrap: wrap; }
  .task-actions { width: 100%; justify-content: flex-start; padding-left: 36px; }
  .punch-actions .btn { flex: 1 1 auto; min-width: 132px; }
  .modal-actions .btn { flex: 1 1 auto; }
  .tree-ops { opacity: 1; }
  .doc-card .doc-del { opacity: .9; }
}

/* ============ Anthropic 风格补充：衬线标题 ============ */
.card-title, .modal h3, .auth-brand h1 { font-family: var(--font-display); letter-spacing: 0; }
.topbar h2 { font-weight: 500; }
.stat .num { font-weight: 700; }

/* 暗色主按钮：加深渐变保证白字对比度（亮色保持品牌橙不动） */
html:not([data-theme="light"]) .btn-primary { background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,0) 48%), linear-gradient(135deg, #b85a39, #9c4a2e); }
/* 亮色表单控件边界加深（卡片发丝线保持轻盈） */
html[data-theme="light"] input:not(:focus), html[data-theme="light"] select:not(:focus), html[data-theme="light"] textarea:not(:focus) { border-color: rgba(63,58,48,.30); }
