/* 课题组工作台样式
 * 1 设计变量（浅色 / 深色） 2 基础 3 布局 4 通用组件 5 各视图 6 浮层 7 登录页 8 响应式
 */

/* ---------- 1. 设计变量 ---------- */
:root {
  color-scheme: light;
  --bg: #F5F4F0;
  --sidebar: #FBFAF7;
  --surface: #FFFFFF;
  --surface-2: #FAF9F6;
  --surface-3: #EFEDE7;
  --border: #E6E3DB;
  --border-strong: #D3CFC4;
  --text: #1E2026;
  --text-2: #4A4E57;
  --muted: #6C7079;

  --accent: #2F54C8;
  --accent-solid: #2F54C8;
  --accent-solid-hover: #2646AC;
  --accent-soft: #EAEFFC;
  --accent-ink: #2443A8;
  --focus: rgba(47, 84, 200, .28);

  --green: #1E9A5E;  --green-soft: #E4F4EB;  --green-ink: #166F45;
  --amber: #D48806;  --amber-soft: #FCF2DD;  --amber-ink: #8A5606;
  --red: #D2453C;    --red-soft: #FBEAE8;    --red-ink: #AE2F27;
  --purple: #7556DB; --purple-soft: #EFEBFC; --purple-ink: #583AB5;
  --cyan: #1590B5;   --cyan-soft: #E2F3F9;   --cyan-ink: #0D6B88;
  --gray-soft: #EEEDE8; --gray-ink: #5C6069;

  /* 图表：单序列用 chart-1，「计划」用同色相的浅一级 chart-2；任务状态色固定 */
  --chart-1: #2F54C8;
  --chart-2: #94A9E6;
  --chart-grid: #ECEAE3;
  --chart-base: #CFCBC0;
  --st-todo: #868C98;
  --st-doing: #2F54C8;
  --st-done: #1E9A5E;
  --st-delayed: #D2453C;
  --heat-0: #EFEDE7; --heat-1: #C9D5F5; --heat-2: #97AEEC; --heat-3: #5F82E0; --heat-4: #2F54C8;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(30, 32, 38, .05);
  --shadow-md: 0 6px 20px rgba(30, 32, 38, .08);
  --shadow-lg: 0 24px 64px rgba(30, 32, 38, .2);
  --mask: rgba(28, 30, 36, .42);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101114;
  --sidebar: #141518;
  --surface: #1A1B1F;
  --surface-2: #202227;
  --surface-3: #141518;
  --border: #2A2C33;
  --border-strong: #3B3E48;
  --text: #ECEDF0;
  --text-2: #BDC0C8;
  --muted: #8E929C;

  --accent: #8AA4F8;
  --accent-solid: #4A6BE0;
  --accent-solid-hover: #5C7BEA;
  --accent-soft: rgba(115, 145, 245, .16);
  --accent-ink: #AFC2FB;
  --focus: rgba(138, 164, 248, .4);

  --green: #3DBB7E;  --green-soft: rgba(61, 187, 126, .15);  --green-ink: #7FD9AC;
  --amber: #E0A32E;  --amber-soft: rgba(224, 163, 46, .15);  --amber-ink: #EDC272;
  --red: #E8695F;    --red-soft: rgba(232, 105, 95, .16);    --red-ink: #F3A199;
  --purple: #9B84EE; --purple-soft: rgba(155, 132, 238, .17); --purple-ink: #C0B1F6;
  --cyan: #3DB1D4;   --cyan-soft: rgba(61, 177, 212, .15);   --cyan-ink: #86D2EA;
  --gray-soft: rgba(255, 255, 255, .07); --gray-ink: #B3B7C0;

  --chart-1: #6486EE;
  --chart-2: #3A4A82;
  --chart-grid: #26282E;
  --chart-base: #3B3E48;
  --st-todo: #7A808C;
  --st-doing: #6486EE;
  --st-done: #2FA56C;
  --st-delayed: #E0584E;
  --heat-0: #23252B; --heat-1: #2B3A6E; --heat-2: #3D55A8; --heat-3: #5A78DD; --heat-4: #9BB1FA;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55);
  --mask: rgba(0, 0, 0, .6);
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font);
  font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
kbd {
  font-family: var(--font); font-size: 11px; line-height: 1; color: var(--muted);
  padding: 3px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface);
}
.visually-hidden, .experiment-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; }

.site-filing {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-size: 12px;
  text-align: center;
}
.site-filing a { color: var(--muted); }
#auth-root.visible { min-height: calc(100vh - 44px); }

/* ---------- 3. 布局 ---------- */
.app { display: flex; min-height: 100vh; }
body.auth-mode .app { display: none; }
.sidebar {
  width: 256px; flex: 0 0 256px; background: var(--sidebar);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  padding: 20px 14px 14px; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 16px; }
.brand-mark {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px;
  background: #fff; color: var(--accent-solid); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 600;
}
.brand-text { min-width: 0; }
.brand-title { font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 14px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted);
  font-size: 13px; text-align: left; transition: border-color .15s, color .15s;
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-trigger .st-text { flex: 1; }

.nav { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.nav-group { margin-bottom: 16px; }
.nav-group-title { font-size: 12px; color: var(--muted); padding: 0 11px 6px; letter-spacing: .5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 11px; border: 0; background: transparent; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px; margin-bottom: 2px; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-item .ni-icon { flex: 0 0 17px; opacity: .9; }
.nav-item .ni-count {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; text-align: center;
  font-size: 11px; line-height: 18px; font-weight: 500; color: var(--muted); background: var(--surface-3);
}
.nav-item.active .ni-count { color: var(--accent-ink); background: transparent; }

.member-switch { margin-top: 10px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.member-switch:empty { display: none; }
.ms-label { font-size: 11px; color: var(--muted); margin-bottom: 7px; }
.ms-account { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ms-who { display: grid; gap: 1px; min-width: 0; flex: 1; line-height: 1.35; }
.ms-who strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-who small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-account select { flex: 1; min-width: 0; padding: 5px 24px 5px 8px; font-size: 12.5px; }
.ms-hint { font-size: 11px; color: var(--muted); margin-top: 7px; }
.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 68px; flex: 0 0 68px;
  background: var(--bg); background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 32px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title { min-width: 0; }
.crumb { font-size: 12px; color: var(--muted); line-height: 1.3; }
.topbar h1 { font-size: 19px; font-weight: 600; letter-spacing: .2px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.topbar .today { font-size: 12.5px; color: var(--muted); margin-right: 6px; white-space: nowrap; }
.icon-btn.menu-btn, .icon-btn.search-btn { display: none; }

.view { padding: 26px 32px 64px; max-width: 1400px; width: 100%; }
.view-enter { animation: view-in .22s ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.boot-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 120px 0; color: var(--muted); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 4. 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  padding: 7px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 500; line-height: 1.5;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(.5px); }
.btn-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
.btn-primary:hover { background: var(--accent-solid-hover); border-color: var(--accent-solid-hover); color: #fff; }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-solid:hover { background: var(--red); border-color: var(--red); color: #fff; filter: brightness(.94); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { color: var(--red-ink); }
.btn-danger:hover { color: var(--red-ink); background: var(--red-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 auto;
  border: 0; border-radius: 9px; background: transparent; color: var(--text-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 7px; color: var(--muted); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red-ink); }
.link { display: inline-flex; align-items: center; gap: 3px; border: 0; padding: 0; background: none; color: var(--accent); font-size: 12.5px; font-weight: 500; }
.link:hover { text-decoration: underline; }
.chips { display: inline-flex; gap: 3px; padding: 3px; border-radius: 9px; background: var(--surface-3); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 4px 12px; border-radius: 7px;
  background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.chip-count { font-size: 11px; color: var(--muted); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.section-title { font-size: 15.5px; font-weight: 600; }
.section-note { font-size: 12.5px; color: var(--muted); margin-top: 1px; font-weight: 400; }
.section-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.block { margin-bottom: 20px; }
.block-top { margin-top: 20px; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar select { width: auto; max-width: 220px; }
.search-box { position: relative; flex: 0 1 260px; min-width: 180px; }
.search-box.wide { flex-basis: 420px; }
.search-box .ni-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input[type] { padding-left: 32px; }
.push { margin-left: auto; }
.grow { flex: 1; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: 16px; align-content: start; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); min-width: 0;
}
.card.tight { padding: 14px 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ct-main { min-width: 0; }
.card-top h3 { font-size: 15.5px; font-weight: 600; margin: 8px 0 2px; line-height: 1.45; overflow-wrap: anywhere; }
.badge-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.row-actions { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--focus); } 100% { box-shadow: 0 0 0 3px transparent; } }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero-title { font-size: 22px; font-weight: 600; letter-spacing: .2px; }
.hero-sub { color: var(--text-2); margin-top: 2px; }
.hero-sub b { font-weight: 600; color: var(--text); }
.hero-side { display: flex; align-items: center; gap: 12px; }
.report-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.report-state.done { color: var(--green-ink); background: var(--green-soft); padding: 6px 12px; border-radius: 20px; font-weight: 500; }

.metric { display: flex; flex-direction: column; align-items: stretch; text-align: left; width: 100%; transition: border-color .15s, box-shadow .15s, transform .15s; }
.metric:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.metric .m-top { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.metric .m-label { font-size: 13px; color: var(--text-2); }
.metric .m-icon { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.metric .m-value { font-size: 28px; font-weight: 600; line-height: 1.25; margin: 6px 0 2px; letter-spacing: -.3px; }
.metric .m-hint { font-size: 12px; color: var(--muted); }
.stat-value { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 600; line-height: 1.3; margin-top: 2px; }

.tone-blue, .b-blue { background: var(--accent-soft); color: var(--accent-ink); }
.tone-cyan, .b-cyan { background: var(--cyan-soft); color: var(--cyan-ink); }
.tone-amber, .b-amber { background: var(--amber-soft); color: var(--amber-ink); }
.tone-green, .b-green { background: var(--green-soft); color: var(--green-ink); }
.tone-purple, .b-purple { background: var(--purple-soft); color: var(--purple-ink); }
.tone-red, .b-red { background: var(--red-soft); color: var(--red-ink); }
.tone-gray, .b-gray { background: var(--gray-soft); color: var(--gray-ink); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; line-height: 1.5; padding: 1px 8px; border-radius: 20px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.strong > .badge, .stat-value > .badge { margin-left: 6px; vertical-align: 1px; }
.tag { display: inline-block; font-size: 11.5px; line-height: 1.5; padding: 1px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; color: var(--text-2); }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.avatar { border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex: 0 0 26px; }
.status-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--st-todo); }
.dot-doing { background: var(--st-doing); }
.dot-done { background: var(--st-done); }
.dot-delayed { background: var(--st-delayed); }
.text-red { color: var(--red-ink); }
.text-green { color: var(--green-ink); }
.struck { text-decoration: line-through; color: var(--muted); }

.progress-track { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 6px; background: var(--accent-solid); transition: width .3s ease; }
.progress-fill.done { background: var(--green); }
.progress-head { margin: 16px 0 7px; }
.progress-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.progress-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.progress-row .pr-main { flex: 1; min-width: 0; }
.progress-row .pr-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-row .pr-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-row .pr-track { width: 120px; flex: 0 0 120px; }
.progress-row .pr-num { width: 40px; text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.list-row .lr-main, .lr-main { flex: 1; min-width: 0; }
.lr-title { font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.lr-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.list-more { padding-top: 12px; text-align: center; font-size: 12px; color: var(--muted); }
.check, .milestone input { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; accent-color: var(--accent-solid); cursor: pointer; }
.check:disabled, .milestone input:disabled { cursor: not-allowed; }

.timeline-item { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.timeline-item > .avatar { margin-top: 1px; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--purple); margin-top: 7px; flex: 0 0 9px; }
.tl-main { flex: 1; min-width: 0; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 28px; }
.tl-actions { margin-left: auto; display: inline-flex; }
.tl-body { font-size: 13.5px; color: var(--text-2); margin-top: 3px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl-ai { display: flex; gap: 7px; margin-top: 8px; background: var(--accent-soft); border-radius: 8px; padding: 8px 11px; font-size: 12.5px; color: var(--accent-ink); }
.tl-ai .ni-icon { flex: 0 0 auto; margin-top: 3px; }
.timeline-item .tag-row { margin-top: 8px; }
.note-box { margin-top: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 30px 12px; color: var(--muted); font-size: 13px; }
.empty-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--muted); }
.hr { height: 1px; background: var(--border); margin: 16px 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mono { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 2px 6px; border-radius: 5px; overflow-wrap: anywhere; }

/* 表单 */
.field, input[type=text], input[type=search], input[type=email], input[type=number], input[type=date], input[type=password], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px;
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; line-height: 1.5;
}
label.field { border: 0; padding: 0; background: none; border-radius: 0; display: grid; gap: 6px; align-content: start; }
label.field > span { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.req { color: var(--red); font-style: normal; margin-left: 3px; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); outline: none; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23868A93' stroke-width='1.5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
select.mini { font-size: 12.5px; padding: 4px 24px 4px 8px; width: auto; background-position: right 8px center; }
textarea { resize: vertical; min-height: 84px; line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field-hint { font-size: 12px; color: var(--muted); }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.form-actions.wrap { flex-wrap: wrap; margin-top: 0; }
.form-lead { margin-bottom: 12px; }
.status-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.switch-list { display: grid; margin-top: 8px; }
.switch { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.switch:last-child { border-bottom: 0; padding-bottom: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-track { position: relative; width: 36px; height: 20px; flex: 0 0 36px; border-radius: 20px; background: var(--border-strong); transition: background .15s; }
.sw-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + .sw-track { background: var(--accent-solid); }
.switch input:checked + .sw-track::after { transform: translateX(16px); }
.switch input:focus-visible + .sw-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .sw-track { opacity: .45; }
.sw-text { display: grid; line-height: 1.45; }
.sw-text strong { font-size: 13.5px; font-weight: 500; }
.sw-text small { font-size: 12px; color: var(--muted); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; column-gap: 12px; }
.steps li::before { content: counter(step); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); }
.steps strong { font-size: 13.5px; font-weight: 600; }
.steps span { font-size: 13px; color: var(--text-2); }

/* 图表 */
.chart { width: 100%; overflow: hidden; }
.chart-note { margin-top: 8px; }
.ch-grid { stroke: var(--chart-grid); stroke-width: 1; }
.ch-base { stroke: var(--chart-base); stroke-width: 1; }
.ch-tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.ch-value { font-size: 11.5px; font-weight: 600; fill: var(--text-2); }
.ch-center { font-size: 24px; font-weight: 600; fill: var(--text); }
.ch-dot { stroke: var(--surface); stroke-width: 2; }
.ch-guide { stroke: var(--chart-base); stroke-width: 1; }
.ch-hover { opacity: 0; transition: opacity .1s; }
.ch-hit:hover .ch-hover { opacity: 1; }
.ch-bar, .ch-arc { transition: opacity .12s; }
.ch-bar:hover, .ch-arc:hover { opacity: .78; }
.ch-empty { stroke: var(--surface-3); }
.ch-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 4px; font-size: 12px; color: var(--text-2); }
.ch-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ch-legend i, .swatch { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 3px; }
.donut-wrap { display: flex; align-items: center; gap: 28px; }
.donut { flex: 0 0 auto; }
.donut-legend { flex: 1; min-width: 0; }
.legend-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.legend-row:last-child { border-bottom: 0; }
.legend-row .strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.hbars { display: grid; gap: 12px; padding: 4px 0; }
.hbar { display: grid; grid-template-columns: 76px 1fr 28px; align-items: center; gap: 12px; font-size: 13px; }
.hbar-label { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 14px; }
.hbar-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--chart-1); }
.hbar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.heat { display: flex; gap: 8px; }
.heat-days { display: grid; grid-template-rows: repeat(7, 18px); gap: 4px; font-size: 11px; line-height: 18px; color: var(--muted); }
.heat-grid { display: flex; gap: 4px; flex: 1; min-width: 0; }
.heat-col { display: grid; grid-template-rows: repeat(7, 18px); gap: 4px; flex: 1; min-width: 0; }
.heat-cell { display: block; height: 18px; border-radius: 4px; background: var(--heat-0); }
.heat-cell.l1 { background: var(--heat-1); }
.heat-cell.l2 { background: var(--heat-2); }
.heat-cell.l3 { background: var(--heat-3); }
.heat-cell.l4 { background: var(--heat-4); }
.heat-cell.future { background: transparent; border: 1px dashed var(--border); }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.heat-legend span:first-child { margin-right: 3px; }
.heat-legend span:last-child { margin-left: 3px; }
.heat-legend .heat-cell { width: 14px; height: 14px; border-radius: 3px; }
.tip {
  position: fixed; z-index: 400; pointer-events: none; opacity: 0; max-width: 260px;
  padding: 6px 10px; border-radius: 7px; background: #1E2026; color: #fff; font-size: 12px; line-height: 1.5; box-shadow: var(--shadow-md);
}
:root[data-theme="dark"] .tip { background: #33363F; }
.tip.show { opacity: 1; }

/* ---------- 5. 各视图 ---------- */
/* 每日上报 */
.ai-result { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ai-result-head { background: var(--accent-soft); padding: 11px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.arh-title { font-size: 13.5px; font-weight: 600; color: var(--accent-ink); display: flex; align-items: center; gap: 8px; }
.ai-result-body { padding: 16px; }
.ai-summary { font-size: 14px; line-height: 1.75; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; overflow-wrap: anywhere; }
.ai-section { margin-top: 16px; min-width: 0; }
.ai-section h4 { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.ai-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 4px 10px; margin: 0 6px 6px 0; }
.chip-lock { font-size: 11.5px; color: var(--amber-ink); background: var(--amber-soft); padding: 0 7px; border-radius: 10px; }
.ai-bullet { font-size: 13px; color: var(--text-2); padding: 3px 0 3px 16px; position: relative; overflow-wrap: anywhere; }
.ai-bullet::before { content: ''; position: absolute; left: 3px; top: 12px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.ai-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.ai-warn { font-size: 12px; color: var(--muted); }
.fold { border-bottom: 1px solid var(--border); }
.fold:last-child { border-bottom: 0; }
.fold summary { display: flex; align-items: center; gap: 10px; padding: 11px 0; cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin: 0 4px 0 2px; }
.fold[open] summary::before { transform: rotate(45deg); }
.fold summary .muted { margin-left: auto; }
.fold-body { padding: 0 0 14px 22px; font-size: 13.5px; color: var(--text-2); }
.fold-actions { margin-top: 10px; }

/* 项目 */
.meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.meta-row .sep { color: var(--border-strong); }
.milestones { margin-top: 6px; }
.milestone { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 13px; color: var(--text-2); border-radius: 7px; }
.milestone label { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; padding: 4px 0; cursor: pointer; }
.milestone.done .ms-title { text-decoration: line-through; color: var(--muted); }
.ms-title { overflow-wrap: anywhere; }
.ms-due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ms-del { opacity: 0; }
.milestone:hover .ms-del, .ms-del:focus-visible { opacity: 1; }
.ms-empty { margin-top: 10px; }

/* 任务看板 */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.board-col { background: var(--surface-3); border: 1px solid transparent; border-radius: var(--radius); padding: 10px; min-height: 200px; transition: background .15s, border-color .15s; }
.board-col.drop { background: var(--accent-soft); border-color: var(--accent); }
.board-col-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 8px 4px; font-size: 13px; font-weight: 600; }
.board-col-head .cnt { font-size: 12px; color: var(--muted); font-weight: 500; }
.board-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 12px; margin-bottom: 8px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s, opacity .15s; }
.board-card[draggable] { cursor: grab; }
.board-card[draggable]:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.board-card.dragging { opacity: .4; }
.bc-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 28px; }
.bc-top .row-actions { opacity: 0; transition: opacity .12s; }
.board-card:hover .row-actions, .board-card:focus-within .row-actions { opacity: 1; }
.bc-title { font-size: 13.5px; font-weight: 500; line-height: 1.5; margin-top: 4px; overflow-wrap: anywhere; }
.bc-project { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-foot { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.bc-advance { width: 100%; margin-top: 10px; border-color: transparent; background: var(--surface-3); color: var(--text-2); }
.bc-advance:hover { background: var(--accent-soft); color: var(--accent-ink); }
.board-empty { padding: 26px 8px; text-align: center; font-size: 12.5px; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 10px; }

/* 文献 */
.table-card { padding: 4px 8px; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .td-title { font-weight: 500; line-height: 1.5; }
.table .td-title a { color: var(--text); }
.table .td-title a:hover { color: var(--accent); }
.table .td-title a .ni-icon { display: inline-block; margin-left: 4px; vertical-align: -1px; color: var(--muted); }
.table .td-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.td-note { max-width: 240px; font-size: 12.5px; line-height: 1.55; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stars { display: inline-flex; white-space: nowrap; }
.star { border: 0; background: none; padding: 0 1px; font-size: 15px; line-height: 1.4; color: var(--border-strong); }
.star.on { color: var(--amber); }
.star:not(:disabled):hover { transform: scale(1.15); }
.star:disabled { cursor: default; }

/* 实验记录 */
.experiment-list { display: grid; gap: 14px; }
.experiment-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin-top: 16px; }
.experiment-details section { min-width: 0; }
.experiment-details h4, .experiment-attachments h4 { font-size: 12.5px; margin: 0 0 4px; font-weight: 600; color: var(--muted); }
.experiment-details p { color: var(--text-2); font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.experiment-attachments { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.attachment-list { display: grid; margin-top: 6px; }
.attachment-row { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.attachment-row:last-child { border-bottom: 0; }
.attachment-icon { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.attachment-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

/* 日历 */
.cal-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.cal-title { font-size: 15px; font-weight: 600; margin-left: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { font-size: 12px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-cell { min-height: 124px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px; min-width: 0; }
.cal-grid.month .cal-cell { min-height: 96px; }
.cal-cell.today { border-color: var(--accent); background: var(--accent-soft); }
.cal-cell.outside { background: transparent; border-style: dashed; }
.cal-cell.outside .cc-num, .cal-cell.outside .cal-ev { opacity: .5; }
.cc-head { display: flex; align-items: center; justify-content: space-between; height: 24px; margin-bottom: 4px; }
.cc-num { font-size: 12.5px; color: var(--text-2); padding-left: 3px; font-variant-numeric: tabular-nums; }
.cc-num em { font-style: normal; margin-left: 5px; font-size: 11px; }
.cc-wd { display: none; }
.cal-cell.today .cc-num { color: var(--accent-ink); font-weight: 600; }
.cc-add { width: 22px !important; height: 22px !important; opacity: 0; }
.cal-cell:hover .cc-add, .cc-add:focus-visible { opacity: 1; }
.cal-ev {
  display: block; width: 100%; border: 0; text-align: left; font-size: 12px; line-height: 1.4; padding: 3px 7px; border-radius: 6px; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
button.cal-ev:hover { filter: brightness(.96); }
.cal-ev.done { opacity: .6; text-decoration: line-through; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 3px; }

/* 数据分析 */
.kv-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 13px; }
.kv-list dt { color: var(--muted); }
.kv-list dd { margin: 0; min-width: 0; }

/* 成员 */
.invite { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; background: var(--accent-soft); border-color: transparent; }
.invite > div:first-child { flex: 1 1 280px; }
.invite-code { display: flex; align-items: center; gap: 8px; }
.invite-code .mono { font-size: 16px; letter-spacing: 1.5px; padding: 5px 12px; background: var(--surface); border: 1px solid var(--border); }
.member-head { gap: 12px; }
.member-card.is-disabled .avatar, .member-card.is-disabled .member-stats { opacity: .45; }
.member-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.stat-num { font-size: 19px; font-weight: 600; line-height: 1.3; }

/* ---------- 6. 浮层 ---------- */
.modal-mask, .palette-mask { position: fixed; inset: 0; background: var(--mask); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; animation: fade .15s ease; }
#confirm-root .modal-mask { z-index: 120; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 580px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-sm { max-width: 420px; }
.modal-form { display: flex; flex-direction: column; min-height: 0; }
.modal-head { padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--border); }
.confirm-body { display: flex; gap: 14px; padding: 22px 22px 18px; }
.confirm-body h3 { font-size: 15.5px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.confirm-body p { margin-top: 5px; font-size: 13.5px; color: var(--text-2); }
.confirm-icon { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-ink); }
.confirm-icon.danger { background: var(--red-soft); color: var(--red-ink); }
.modal-sm .modal-foot { border-top: 0; padding-top: 0; padding-bottom: 18px; }

.palette-mask { align-items: flex-start; padding-top: 12vh; z-index: 110; }
.palette { width: 100%; max-width: 600px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .16s ease; }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 4px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.pal-input input { border: 0; padding: 12px 0; font-size: 15px; background: transparent; box-shadow: none; }
.pal-input input:focus { box-shadow: none; }
.pal-list { max-height: min(52vh, 420px); overflow-y: auto; padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; text-align: left; }
.pal-item.active { background: var(--accent-soft); }
.pal-item:hover:not(.active) { background: var(--surface-2); }
.pal-icon { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--text-2); }
.pal-item.active .pal-icon { background: var(--surface); color: var(--accent-ink); }
.pal-text { flex: 1; min-width: 0; display: grid; line-height: 1.4; }
.pal-label { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-hint { font-size: 11.5px; color: var(--muted); flex: 0 0 auto; }
.pal-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); background: var(--surface-2); }
.pal-foot kbd { margin-right: 3px; }

#toast-root { position: fixed; right: 24px; bottom: 24px; z-index: 300; display: grid; gap: 8px; justify-items: end; }
.toast { display: flex; align-items: center; gap: 8px; max-width: min(420px, calc(100vw - 32px)); background: #1E2026; color: #fff; font-size: 13.5px; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-md); animation: tin .2s ease; transition: opacity .2s, transform .2s; }
:root[data-theme="dark"] .toast { background: #33363F; }
.toast .ni-icon { flex: 0 0 auto; }
.toast-success .ni-icon { color: #6FD9A5; }
.toast-error .ni-icon { color: #F59B93; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 7. 登录页 ---------- */
#auth-root { display: none; }
#auth-root.visible { display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); width: min(940px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-md); overflow: hidden; }
.auth-aside { padding: 40px; background: var(--accent-solid); color: #fff; display: flex; flex-direction: column; }
:root[data-theme="dark"] .auth-aside { background: #263A80; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.auth-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--accent-solid); background: #fff; font-weight: 700; font-size: 17px; }
.school-crest { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-mark, .auth-mark { overflow: hidden; }
.brand-mark.has-school, .auth-mark.has-school { padding: 2px; }
.school-picker { display: grid; gap: 12px; min-width: 0; }
.school-picker .field { margin: 0; }
.school-preview { display: flex; align-items: center; gap: 12px; min-width: 0; }
.school-preview-mark { flex: 0 0 52px; width: 52px; height: 52px; padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; }
.school-preview-text { min-width: 0; display: grid; gap: 3px; }
.school-preview-text strong { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.school-preview-text span, .school-error { font-size: 12px; line-height: 1.5; color: var(--muted); }
.school-custom { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.school-custom[hidden], .school-error[hidden] { display: none; }
.school-picker [hidden] { display: none; }
.school-upload { cursor: pointer; position: relative; }
.school-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.school-error { color: var(--red-ink); }
.workspace-school { margin-top: 18px; }
.auth-form .school-upload { display: inline-flex; font-weight: 500; }
.auth-aside h1 { font-size: 26px; font-weight: 600; line-height: 1.45; margin: 44px 0 30px; letter-spacing: .3px; }
.auth-features { list-style: none; margin: auto 0 0; padding: 0; display: grid; gap: 18px; }
.auth-features li { display: flex; gap: 12px; }
.auth-features strong { display: block; font-size: 14px; font-weight: 600; }
.auth-features span { font-size: 13px; line-height: 1.6; opacity: .82; }
.auth-check { width: 22px; height: 22px; flex: 0 0 22px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2); opacity: 1 !important; }
.auth-card { padding: 40px 36px; }
.auth-title { font-size: 22px; font-weight: 600; }
.auth-sub { margin-top: 4px; color: var(--muted); font-size: 13px; }
.auth-tabs { display: flex; gap: 3px; padding: 3px; margin: 22px 0 16px; border-radius: 10px; background: var(--surface-3); }
.auth-tab { flex: 1; border: 0; padding: 7px 0; border-radius: 8px; color: var(--text-2); background: none; font-weight: 500; font-size: 13.5px; }
.auth-tab.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.auth-form { display: grid; gap: 13px; }
.auth-form label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.auth-form input, .auth-form select { font-size: 14px; font-weight: 400; color: var(--text); }
.auth-password { position: relative; display: block; }
.auth-password input { padding-right: 54px; }
.auth-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: 4px 8px; font-size: 12px; color: var(--muted); border-radius: 6px; }
.auth-eye:hover { color: var(--text); background: var(--surface-3); }
.auth-submit { width: 100%; margin-top: 6px; padding: 9px 14px; }
.auth-error { margin-bottom: 14px; padding: 10px 12px; color: var(--red-ink); background: var(--red-soft); border-radius: 9px; font-size: 13px; }
.auth-hint { color: var(--muted); font-size: 12px; line-height: 1.6; }

/* ---------- 8. 协作模块 ---------- */
.subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.subhead h3 { margin: 0; font-size: 15px; font-weight: 600; }
.nudge-columns { align-items: start; }
.nudge-columns > div { min-width: 0; }
.nudge-card { margin-bottom: 12px; padding: 16px; }
.nudge-card.nudge-open { border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); }
.nudge-card h3 { margin: 8px 0 5px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.nudge-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.nudge-contact { display: inline-flex; gap: 9px; }
.nudge-contact a { color: var(--accent-solid); text-decoration: none; }
.nudge-contact a:hover { text-decoration: underline; }
.nudge-actions { margin-top: 12px; padding-top: 12px; }
.protocol-card { min-height: 220px; }
.protocol-card.is-archived { opacity: .72; }
.protocol-card h3 { margin: 8px 0 5px; }
.protocol-content { margin-top: 16px; padding: 13px 14px; min-height: 96px; white-space: pre-wrap; line-height: 1.75; font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; overflow-wrap: anywhere; }
.protocol-foot { margin-top: 12px; }

/* ---------- 9. 响应式 ---------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { display: flex; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
  .board-col { flex: 0 0 272px; scroll-snap-align: start; }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
  .nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: var(--mask); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .icon-btn.menu-btn, .icon-btn.search-btn { display: inline-flex; }
  .topbar { padding: 0 20px; }
  .view { padding: 20px 20px 56px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .g3.block { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topbar { padding: 0 12px 0 8px; height: 60px; flex-basis: 60px; }
  .topbar h1 { font-size: 17px; }
  .crumb, .topbar .today { display: none; }
  .view { padding: 16px 16px 56px; }
  .card { padding: 16px; }
  .g4 { gap: 12px; }
  .g3.block { gap: 10px; }
  .metric .m-value { font-size: 24px; }
  .hero-title { font-size: 20px; }
  .section-head { flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .form-actions { flex-wrap: wrap; }
  .donut-wrap { flex-direction: column; align-items: stretch; gap: 12px; }
  .donut { align-self: center; }
  .progress-row .pr-track { width: 72px; flex-basis: 72px; }
  .experiment-details { grid-template-columns: 1fr; }
  .attachment-row { flex-wrap: wrap; }
  .attachment-name { flex-basis: calc(100% - 42px); }
  .table { min-width: 820px; }
  .search-box, .search-box.wide { flex: 1 1 100%; }
  .toolbar .push { margin-left: 0; }
  .row-actions, .bc-top .row-actions, .ms-del, .cc-add { opacity: 1; }
  .cal-grid.week { grid-template-columns: 1fr; }
  .cal-grid.week .cal-head { display: none; }
  .cal-grid.week .cal-cell { min-height: 0; }
  .cal-grid.week .cc-wd { display: inline; }
  .cal-grid.month { gap: 3px; }
  .cal-grid.month .cal-cell { min-height: 58px; padding: 3px; border-radius: 7px; }
  .cal-grid.month .cc-add, .cal-grid.month .cc-num em, .cal-grid.month .cal-more { display: none; }
  .cal-grid.month .cal-ev { font-size: 0; height: 5px; padding: 0; margin-bottom: 3px; border-radius: 3px; }
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 18px 18px 0 0; }
  #confirm-root .modal-mask { padding: 16px; align-items: center; }
  #confirm-root .modal { border-radius: 16px; }
  .palette-mask { padding: 12px; }
  #toast-root { right: 16px; left: 16px; bottom: 16px; justify-items: center; }
  .auth-shell { grid-template-columns: 1fr; border-radius: 18px; }
  .auth-aside { display: none; }
  .auth-card { padding: 28px 22px; }
  #auth-root.visible { padding: 16px; }
}
@media (hover: none) {
  .row-actions, .bc-top .row-actions, .ms-del, .cc-add { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .topbar, #toast-root, .section-actions, .row-actions { display: none !important; }
  .view { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
