:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --line: #e6eaf2;
  --line-soft: #f1f4f9;
  --text: #1b2434;
  --text-2: #3d4a61;
  --muted: #78849b;
  --accent: #4f6bff;
  --accent-rgb: 79, 107, 255;
  --accent-2: #6d8cff;
  --accent-soft: #eef2ff;
  --grid-minor: #f2f5fa;
  --hover: #fbfcff;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 35, 66, .04), 0 8px 24px rgba(23, 35, 66, .05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d7ddea; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #c2cadd; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.app { max-width: 1560px; margin: 0 auto; padding: 18px 22px 28px; }

/* ------------------------------------------------------------------ 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 4px 2px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px; height: 42px; border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(var(--accent-rgb), .3);
}
.brand-text h1 { margin: 0; font-size: 19px; letter-spacing: .2px; }
.brand-text p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #0f7a5a; background: #e8f8f1;
  border: 1px solid #c9eedd; border-radius: 999px; padding: 5px 10px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.badge.offline { color: #9a6b09; background: #fff6e3; border-color: #ffe3ab; }
.badge.offline::before { background: var(--warn); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  font-weight: 500; transition: .15s ease; white-space: nowrap;
}
.btn:hover { border-color: #cfd6e6; background: #fbfcff; }
.btn.ghost { background: var(--surface); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), .26);
}
.btn.primary:hover { filter: brightness(1.04); }
.btn.tiny { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.dashed { border-style: dashed; color: var(--muted); background: transparent; width: 100%; }
.btn.dashed:hover { color: var(--accent); border-color: #b9c6ff; background: #f8faff; }
.btn.block { width: 100%; }
.btn.danger-text { color: var(--danger); border-color: #fbd5d5; }
.btn.danger-text:hover { background: #fff5f5; border-color: #f6b8b8; }

/* ------------------------------------------------------------------ 统计卡 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 13px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -22px; top: -22px; width: 74px; height: 74px;
  border-radius: 50%; background: var(--accent-soft); opacity: .7;
}
.stat-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -.4px; margin: 7px 0 4px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub b { color: var(--text-2); font-weight: 600; }
.stat .dot-i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.stat.warn .stat::after { background: #fff3e0; }

/* ------------------------------------------------------------------ 布局 */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 16px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 14px; max-height: calc(100vh - 26px); overflow: auto; padding-right: 2px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 15px 10px; }
.card-head h2 { margin: 0; font-size: 13.5px; font-weight: 600; letter-spacing: .1px; }
.chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px;
  background: #f1f4fb; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums;
}
.chip.danger { background: #ffefef; color: var(--danger); }

/* ------------------------------------------------------------------ 时间轴 */
.tl-card { overflow: hidden; }
.tl-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; flex-wrap: wrap; }
.tl-toolbar .grow { flex: 1; }
.seg { display: inline-flex; background: #f3f5fb; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--muted); font-size: 12.5px;
  height: 26px; padding: 0 11px; border-radius: 7px; transition: .15s;
}
.seg button:hover { color: var(--text-2); }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(24, 36, 66, .1); font-weight: 550; }

.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap svg { position: absolute; left: 9px; color: #a3adc0; pointer-events: none; }
.search-wrap input {
  height: 32px; width: 208px; padding: 0 10px 0 28px; border-radius: 8px;
  border: 1px solid var(--line); background: #fbfcfe; outline: none; transition: .15s;
}
.search-wrap input:focus { border-color: #b6c2ff; background: #fff; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .1); }
.select {
  height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line);
  background: #fbfcfe; color: var(--text-2); outline: none; max-width: 170px;
}
.select:focus { border-color: #b6c2ff; }
.zoom { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; height: 32px; }
.zoom button { width: 26px; height: 30px; border: 0; background: #fbfcfe; color: var(--muted); font-size: 14px; }
.zoom button:hover { background: #f1f4fd; color: var(--accent); }
.zoom span { padding: 0 6px; font-size: 11.5px; color: var(--muted); border-left: 1px solid var(--line); border-right: 1px solid var(--line); line-height: 30px; background: #fff; }

.tl-scroll { overflow: auto; max-height: calc(100vh - 332px); min-height: 240px; border-top: 1px solid var(--line); }
.tl-inner { width: max-content; min-width: 100%; position: relative; }

.tl-head { display: flex; position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.tl-corner {
  width: 244px; flex: 0 0 244px; position: sticky; left: 0; z-index: 22;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; font-size: 11.5px; color: var(--muted);
}
.tl-corner .count { background: #f1f4fb; border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.tl-days { position: relative; flex: 0 0 auto; }
.month-band { display: flex; height: 24px; }
.month-label {
  font-size: 11px; color: var(--text-2); font-weight: 550; line-height: 24px;
  padding-left: 7px; border-left: 1px solid var(--line-soft);
  white-space: nowrap; overflow: hidden;
}
.month-label span { color: #a9b2c4; font-weight: 400; font-size: 10.5px; margin-left: 2px; }
.day-row { display: flex; height: 22px; }
.day-cell {
  flex: 0 0 auto; height: 22px; line-height: 22px; text-align: center;
  font-size: 10.5px; color: #8c96ab; border-left: 1px solid var(--line-soft);
  cursor: pointer; user-select: none; font-variant-numeric: tabular-nums;
  transition: background .12s, color .12s;
}
.day-cell:hover { background: var(--accent-soft); color: var(--accent); }
.day-cell.we { color: #b3bccd; background: #fafbfe; }
.day-cell.today { background: var(--accent); color: #fff; font-weight: 600; }
.day-cell.today:hover { background: var(--accent); filter: brightness(.92); }

.tl-body { position: relative; }
.tl-grid { position: absolute; left: 244px; top: 0; bottom: 0; display: flex; pointer-events: none; z-index: 0; }
.tl-grid .col { flex: 0 0 auto; border-left: 1px solid #f4f6fb; }
.tl-grid .col.we { background: #fafbfe; }
.tl-grid .col.today { background: #f2f5ff; }

.today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, #ff7a7a, #ffb0b0); z-index: 5; pointer-events: none; }
.today-line span {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  background: #ff6b6b; color: #fff; font-size: 9.5px; padding: 2px 5px; border-radius: 4px;
  white-space: nowrap; letter-spacing: .5px;
}

.tl-row { display: flex; height: 62px; border-bottom: 1px solid var(--line-soft); position: relative; }
.tl-row:last-child { border-bottom: 0; }
.tl-row:hover .tl-label { background: #fbfcff; }
.tl-label {
  width: 244px; flex: 0 0 244px; position: sticky; left: 0; z-index: 8;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 11px 12px 8px 14px; cursor: pointer; overflow: hidden;
}
.lbl-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.lbl-top .dot { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 auto; }
.lbl-title { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status {
  flex: 0 0 auto; font-size: 10px; line-height: 16px; padding: 0 6px; border-radius: 5px;
  background: #f1f4fa; color: var(--muted);
}
.status.st-ongoing { background: #e9f8f2; color: #0c8a63; }
.status.st-planned { background: var(--accent-soft); color: var(--accent); }
.status.st-blocked { background: #ffefef; color: #d93b3b; }
.status.st-done { background: #f1f3f8; color: #7d879b; }
.lbl-sub {
  margin-top: 5px; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.tl-track { position: relative; flex: 0 0 auto; height: 100%; }

.bar {
  position: absolute; top: 18px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; padding: 0 9px 0 26px; overflow: hidden;
  color: #fff; font-size: 11px; white-space: nowrap; cursor: grab;
  border: 1px solid transparent; z-index: 2;
  box-shadow: 0 3px 10px rgba(35, 50, 90, .14);
  transition: box-shadow .15s, filter .15s;
}
.bar:hover { filter: brightness(1.03); box-shadow: 0 5px 16px rgba(35, 50, 90, .22); }
.bar.dragging { cursor: grabbing; z-index: 12; box-shadow: 0 8px 22px rgba(35, 50, 90, .28); }
.bar::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 10px;
  cursor: ew-resize; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22));
}
.bar.planned { border-width: 1px; border-style: dashed; box-shadow: none; }
.bar.planned::after { background: none; }
.bar.done { background: #d3dae8 !important; color: #6b7688; border-color: #d3dae8; box-shadow: none; cursor: pointer; }
.bar.blocked { box-shadow: 0 0 0 2px rgba(239, 68, 68, .22), 0 3px 10px rgba(35, 50, 90, .14); }
.bar-text { overflow: hidden; text-overflow: ellipsis; letter-spacing: .1px; }

.bar-out {
  position: absolute; top: 21px; font-size: 10.5px; color: #98a2b6;
  background: #f8fafd; border: 1px dashed #e2e8f3; border-radius: 6px;
  padding: 3px 7px; white-space: nowrap; z-index: 2;
}
.bar-out.left { left: 8px; }
.bar-out.right { right: 8px; }

.ms-wrap { position: absolute; top: 24px; width: 0; height: 22px; z-index: 4; }
.ms {
  position: absolute; left: -6px; top: 1px; width: 12px; height: 12px;
  transform: rotate(45deg); border-radius: 3px;
  border: 2px solid var(--accent); background: #fff; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.ms:hover { transform: rotate(45deg) scale(1.25); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14); }
.ms.ddl { background: var(--danger); border-color: var(--danger); }
.ms.ddl:hover { box-shadow: 0 0 0 4px rgba(239, 68, 68, .16); }
.ms.start { background: var(--ok); border-color: var(--ok); }
.ms.start:hover { box-shadow: 0 0 0 4px rgba(16, 185, 129, .16); }
.ms.other { border-color: #94a3b8; }
.ms.done { background: #cbd5e1; border-color: #cbd5e1; opacity: .85; }
.ms.done:hover { box-shadow: 0 0 0 4px rgba(148, 163, 184, .2); }
.ms-tip {
  position: absolute; left: 0; bottom: 22px; transform: translate(-50%, -2px);
  background: #1e2a3e; color: #fff; font-size: 11px; line-height: 1.4;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: .12s; z-index: 30;
  box-shadow: 0 6px 16px rgba(20, 30, 60, .2);
}
.ms-tip::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%) rotate(45deg);
  width: 8px; height: 8px; background: #1e2a3e;
}
.ms-wrap:hover .ms-tip { opacity: 1; transform: translate(-50%, 0); }

.tl-foot { display: flex; align-items: center; gap: 16px; padding: 10px 14px; border-top: 1px solid var(--line); background: #fcfdff; flex-wrap: wrap; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.lg-bar { width: 14px; height: 8px; border-radius: 3px; background: linear-gradient(100deg, var(--accent), var(--accent-2)); display: inline-block; }
.lg-ms { width: 8px; height: 8px; border: 2px solid var(--accent); background: #fff; transform: rotate(45deg); display: inline-block; }
.lg-ddl { width: 8px; height: 8px; background: var(--danger); transform: rotate(45deg); display: inline-block; border-radius: 2px; }
.tl-foot .hint { margin-left: auto; font-size: 11.5px; color: #9aa4b8; }

.tl-empty { padding: 56px 24px; text-align: center; }
.tl-empty h3 { margin: 0 0 6px; font-size: 15px; }
.tl-empty p { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------------------ 右侧面板 */
.dl-list { padding: 0 10px 10px; max-height: 336px; overflow: auto; }
.dl-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 6px;
  border-radius: 9px; transition: background .12s;
}
.dl-item + .dl-item { border-top: 1px dashed var(--line-soft); }
.dl-item:hover { background: #fafbff; }
.dl-date { flex: 0 0 46px; text-align: center; }
.dl-date .d { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dl-date .w { display: block; font-size: 10px; color: #a3adc0; margin-top: 1px; }
.dl-main { min-width: 0; flex: 1; }
.dl-title { font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-sub { font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-right { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pill { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; background: #f1f4fa; color: var(--muted); font-variant-numeric: tabular-nums; }
.pill.overdue { background: #ffeded; color: #d93b3b; }
.pill.today { background: #fff3e3; color: #b7730a; }
.pill.soon { background: #fff8e6; color: #a97a08; }
.pill.week { background: var(--accent-soft); color: var(--accent); }
.pill.ddl { background: #fdeeee; color: #d93b3b; }
.mini-check {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 10px; height: 20px; padding: 0 7px; border-radius: 5px;
}
.mini-check:hover { border-color: #a9ddc8; color: #0c8a63; background: #f4fdf9; }
.dl-empty { padding: 18px 12px 22px; text-align: center; color: var(--muted); font-size: 12px; }

.cf-list { padding: 0 12px 12px; }
.cf-item { background: #fff8f7; border: 1px solid #ffe1de; border-radius: 9px; padding: 9px 10px; margin-top: 6px; }
.cf-lab { font-size: 11.5px; color: #b4453f; font-weight: 600; }
.cf-body { font-size: 11.5px; color: var(--text-2); margin-top: 4px; line-height: 1.6; }
.cf-body b { font-weight: 600; }
.cf-days { font-size: 11px; color: #b4453f; margin-top: 3px; }

.lab-list { padding: 0 12px 12px; }
.lab-item {
  padding: 9px 10px; border-radius: 9px; border: 1px solid transparent;
  cursor: pointer; transition: .12s;
}
.lab-item:hover { background: #fafbff; border-color: var(--line-soft); }
.lab-item.on { background: var(--accent-soft); border-color: #d5ddff; }
.lab-name { font-size: 12px; font-weight: 550; color: var(--text-2); }
.lab-meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; align-items: center; }
.lab-meta .n { color: var(--accent); font-weight: 600; }

/* ------------------------------------------------------------------ 弹窗 */
.modal {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: 26px; background: rgba(19, 27, 46, .36); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .18s, visibility .18s;
}
.modal.open { opacity: 1; visibility: visible; }
.modal-card {
  width: min(760px, 100%); max-height: 88vh; background: #fff; border-radius: 16px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 28px 70px rgba(16, 26, 50, .24);
  transform: translateY(10px) scale(.995); transition: transform .18s;
}
.modal.open .modal-card { transform: none; }
.modal-card.narrow { width: min(520px, 100%); }
.modal-card.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.modal-body { padding: 16px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line-soft); background: #fcfdff; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: var(--muted); display: grid; place-items: center; font-size: 13px;
}
.icon-btn:hover { background: #f2f4fa; color: var(--text); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); }
.field.span-2 { grid-column: span 2; }
.field input, .field select, .field textarea {
  width: 100%; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: #fbfcfe; padding: 0 10px; outline: none; transition: .15s; resize: vertical;
}
.field textarea { height: auto; padding: 8px 10px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #b6c2ff; background: #fff; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .1);
}

.quick-dur { display: flex; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.quick-dur > span { font-size: 12px; color: var(--muted); margin-right: 2px; }
.quick-dur button {
  height: 26px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line);
  background: #fbfcfe; color: var(--text-2); font-size: 12px;
}
.quick-dur button:hover { border-color: #b9c6ff; color: var(--accent); background: #f8faff; }

.ms-block { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.ms-block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ms-block-head h3 { margin: 0; font-size: 13px; }
.ms-block-head p { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.ms-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.ms-row { display: grid; grid-template-columns: 1.5fr 132px 100px 78px 28px; gap: 8px; align-items: center; }
.ms-row input.ms-title, .ms-row input.ms-date, .ms-row select {
  height: 32px; border-radius: 7px; border: 1px solid var(--line); background: #fbfcfe; padding: 0 8px; outline: none; min-width: 0;
}
.ms-row input:focus, .ms-row select:focus { border-color: #b6c2ff; background: #fff; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .09); }
.ms-done { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ms-done input { accent-color: var(--accent); }
.ms-hint { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); min-height: 0; }

.notice {
  background: #f7f9ff; border: 1px solid #e3e9ff; color: #44507a;
  font-size: 11.5px; line-height: 1.6; padding: 9px 11px; border-radius: 8px; margin-bottom: 14px;
}
.notice.soft { background: #fbfcfe; border-color: var(--line); color: var(--muted); margin: 12px 0 0; }
.notice code, .endpoint-list code { background: #eef2ff; color: #3f55c8; padding: 1px 5px; border-radius: 4px; font-size: 11px; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.muted { color: var(--muted); font-size: 12px; }

.endpoint-list { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.endpoint-list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); }

.kv-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 12px; border-bottom: 1px dashed var(--line-soft); }
.kv-row .k { color: var(--muted); flex: 0 0 96px; }
.kv-row code { flex: 1; background: #f5f7fc; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 11.5px; color: #33436b; overflow: auto; white-space: nowrap; }
.kv-row .v { color: var(--text-2); }

.sec-title { font-size: 12.5px; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.sec-title .chip { font-weight: 400; }
pre.code {
  background: #1c2438; color: #d8e1f2; border-radius: 9px; padding: 12px 14px;
  font-size: 11.5px; line-height: 1.65; overflow: auto; margin: 0 0 8px; max-height: 260px;
  white-space: pre-wrap; word-break: break-word;
}
.code-area {
  width: 100%; border-radius: 9px; border: 1px solid var(--line); background: #fbfcfe;
  padding: 10px 12px; font-family: Consolas, monospace; font-size: 11.5px; line-height: 1.6;
  outline: none; resize: vertical;
}
.code-area:focus { border-color: #b6c2ff; background: #fff; }

.tool-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool-item { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fcfdff; }
.tool-name { font-family: Consolas, monospace; font-size: 11.5px; color: #3f55c8; }
.tool-desc { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* ------------------------------------------------------------------ 抽屉 */
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(430px, 100%);
  background: #fff; z-index: 90; display: flex; flex-direction: column;
  box-shadow: -24px 0 60px rgba(16, 26, 50, .16);
  transform: translateX(102%); transition: transform .22s cubic-bezier(.3, .8, .3, 1);
}
.drawer.open { transform: none; }
.drawer-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.drawer-kicker { font-size: 10.5px; letter-spacing: 1.2px; color: var(--muted); text-transform: uppercase; }
.drawer-head h2 { margin: 6px 0 4px; font-size: 16px; line-height: 1.4; }
.drawer-sub { font-size: 12px; color: var(--muted); }
.drawer-body { padding: 16px 20px; overflow: auto; flex: 1; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.meta-grid > div { background: #fafbfe; border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 10px; }
.meta-grid span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 3px; }
.meta-grid b { font-size: 12px; font-weight: 550; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 11px; background: var(--accent-soft); color: #4157c9; border-radius: 5px; padding: 2px 7px; }
.notes { font-size: 12px; color: var(--text-2); line-height: 1.7; background: #fbfcfe; border-left: 3px solid #dbe2f5; padding: 8px 10px; border-radius: 0 6px 6px 0; margin: 12px 0 0; }
.drawer-sec { margin-top: 18px; }
.drawer-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.drawer-sec-head h3 { margin: 0; font-size: 12.5px; }
.ms-list { display: flex; flex-direction: column; }
.ms-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 4px;
  border-bottom: 1px dashed var(--line-soft); cursor: pointer; font-size: 12px;
}
.ms-item:hover { background: #fafbff; }
.ms-item input { accent-color: var(--accent); }
.ms-item .ms-date { flex: 0 0 40px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.ms-item .ms-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-item.done .ms-name { color: #9aa4b8; text-decoration: line-through; }
.ms-type { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: #f1f4fa; color: var(--muted); }
.ms-type.ddl { background: #fdeeee; color: #d93b3b; }
.ms-type.start { background: #e9f8f2; color: #0c8a63; }
.ms-item .ms-left { flex: 0 0 auto; font-size: 10.5px; color: #a3adc0; }
.ms-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-top: 14px; }
.ms-add input, .ms-add select {
  height: 32px; border-radius: 7px; border: 1px solid var(--line); background: #fbfcfe; padding: 0 8px; outline: none; min-width: 0;
}
.ms-add #msAddTitle { grid-column: 1 / -1; }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line-soft); background: #fcfdff; }

/* ------------------------------------------------------------------ 浮层 / 提示 */
.popover {
  position: fixed; z-index: 100; width: 300px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  box-shadow: 0 18px 44px rgba(18, 28, 52, .18);
}
.pop-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.pop-head b { color: var(--text); font-variant-numeric: tabular-nums; }
.popover .field { margin-bottom: 8px; }
.popover .field > span { font-size: 11px; }
.popover .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.popover .row2 .field { margin-bottom: 10px; }

.toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #1e2a3e; color: #f2f6ff; font-size: 12.5px; padding: 9px 16px; border-radius: 8px;
  box-shadow: 0 10px 30px rgba(16, 26, 50, .24); opacity: 0; transform: translateY(8px);
  animation: toastIn .2s forwards;
}
.toast.ok { background: #0f7a5a; }
.toast.err { background: #b93333; }
@keyframes toastIn { to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ 响应式 */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; overflow: visible; display: grid; grid-template-columns: 1fr 1fr; }
  .side .card:first-child { grid-column: span 2; }
  .tl-scroll { max-height: 62vh; }
}
@media (max-width: 820px) {
  .app { padding: 12px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .side { grid-template-columns: 1fr; }
  .side .card:first-child { grid-column: auto; }
  .search-wrap input { width: 150px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .ms-row { grid-template-columns: 1fr 120px; }
  .ms-row .ms-done, .ms-row .ms-del, .ms-row select { grid-column: span 1; }
  .tool-list { grid-template-columns: 1fr; }
  .brand-text p { display: none; }
}

/* ================================================================ 登录 / 注册 */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 20px; background: radial-gradient(1200px 600px at 15% -10%, #e8edff 0%, transparent 55%), radial-gradient(900px 500px at 100% 110%, #e6f7f4 0%, transparent 50%), var(--bg); }
.auth-screen[hidden] { display: none; }
.auth-inner {
  width: min(980px, 100%); display: grid; grid-template-columns: 1.05fr .95fr;
  background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  box-shadow: 0 32px 80px rgba(22, 36, 70, .12);
}
.auth-side { position: relative; padding: 40px 40px 32px; background: linear-gradient(155deg, #f6f8ff 0%, #eef2ff 55%, #e9f6f6 100%); overflow: hidden; }
.auth-side::after { content: ""; position: absolute; right: -70px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; background: rgba(var(--accent-rgb), .09); }
.auth-side::before { content: ""; position: absolute; right: 30px; top: -60px; width: 150px; height: 150px; border-radius: 50%; background: rgba(14, 165, 165, .08); }
.auth-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-brand .logo { width: 46px; height: 46px; border-radius: 13px; }
.auth-brand h1 { margin: 0; font-size: 21px; letter-spacing: .2px; }
.auth-brand p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.auth-tagline { position: relative; z-index: 1; margin: 30px 0 0; font-size: 15px; line-height: 1.75; color: #33415c; max-width: 340px; }
.auth-features { list-style: none; margin: 30px 0 0; padding: 0; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 15px; }
.auth-features li { padding-left: 18px; position: relative; }
.auth-features li::before { content: ""; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border-radius: 3px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.auth-features b { display: block; font-size: 13px; color: var(--text); font-weight: 600; }
.auth-features span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.auth-foot { position: relative; z-index: 1; margin: 34px 0 0; font-size: 11px; color: #8d97ab; }
.auth-panel { padding: 46px 42px 38px; display: flex; flex-direction: column; justify-content: center; }
.auth-tabs { display: flex; gap: 4px; background: #f3f5fb; border-radius: 10px; padding: 4px; margin-bottom: 22px; }
.auth-tabs button { flex: 1; height: 32px; border: 0; background: transparent; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 500; }
.auth-tabs button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(24, 36, 66, .1); }
.auth-panel .field { margin-bottom: 14px; }
.auth-panel .field input { height: 38px; }
.auth-error { background: #fff3f3; border: 1px solid #ffdada; color: #b93333; font-size: 12px; padding: 8px 10px; border-radius: 8px; margin: 0 0 12px; line-height: 1.5; }
.auth-panel #authSubmit { height: 38px; margin-top: 4px; }
.auth-note { font-size: 11.5px; color: var(--muted); margin: 16px 0 0; text-align: center; line-height: 1.6; }

/* ================================================================ 顶栏协作元素 */
.app[hidden] { display: none; }
.sync-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: #5c6b85; background: #f3f6fc; border: 1px solid #e5eaf4; border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.sync-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: syncPulse 2.4s infinite; }
.sync-badge.err { color: #b4453f; background: #fff5f4; border-color: #ffdcd8; }
.sync-badge.err i { background: var(--danger); animation: none; }
@keyframes syncPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.user-menu { position: relative; }
.user-chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 9px 0 4px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--text-2); }
.user-chip:hover { border-color: #cfd6e6; background: #fbfcff; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex: 0 0 auto; }
.avatar.sm { width: 22px; height: 22px; font-size: 11px; }
.avatar.xs { width: 22px; height: 22px; font-size: 10px; background: #e3e8f4; color: #5a6a85; }
.user-name { font-size: 12.5px; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-pop { position: absolute; right: 0; top: 42px; width: 224px; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 18px 40px rgba(20, 32, 64, .16); padding: 6px; z-index: 60; }
.menu-head { display: flex; gap: 9px; align-items: center; padding: 8px 8px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu-head b { display: block; font-size: 12.5px; }
.menu-head span { display: block; font-size: 11px; color: var(--muted); word-break: break-all; margin-top: 2px; }
.menu-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 9px; border-radius: 7px; font-size: 12.5px; color: var(--text-2); }
.menu-item:hover { background: #f5f7fc; }
.menu-item.danger { color: #c0392b; }

/* ================================================================ 成员与动态 */
.member-strip { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.member { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-soft); background: #fbfcff; border-radius: 999px; padding: 3px 8px 3px 4px; font-size: 11px; color: var(--text-2); }
.member.me { background: var(--accent-soft); border-color: #d5ddff; }
.member-name { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }
.activity-list { padding: 0 8px 10px; max-height: 236px; overflow: auto; }
.activity-item { display: flex; gap: 8px; padding: 7px 6px; border-radius: 8px; align-items: flex-start; }
.activity-item.linkable { cursor: pointer; }
.activity-item.linkable:hover { background: #fafbff; }
.act-main { min-width: 0; }
.act-text { font-size: 11.5px; color: var(--text-2); line-height: 1.55; }
.act-text b { font-weight: 600; }
.act-time { font-size: 10.5px; color: #a3adc0; margin-top: 2px; }
.activity-empty { padding: 2px 14px 14px; margin: 0; }
.drawer-meta { font-size: 11px; color: #a3adc0; margin-top: 10px; }

/* ================================================================ 令牌 */
.token-hint { margin: 0 0 9px; }
.token-create { display: flex; gap: 8px; margin-bottom: 8px; }
.token-create input { flex: 1; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fbfcfe; padding: 0 10px; outline: none; min-width: 0; }
.token-create input:focus { border-color: #b6c2ff; background: #fff; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .09); }
.token-list { display: flex; flex-direction: column; gap: 4px; }
.token-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border: 1px solid var(--line-soft); border-radius: 8px; background: #fcfdff; }
.token-main b { font-size: 12px; font-weight: 600; }
.token-main span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.token-empty { margin: 2px 0 6px; }
.token-new { display: flex; align-items: center; gap: 8px; margin-top: 8px; background: #f4f8ff; border: 1px solid #dbe6ff; border-radius: 8px; padding: 7px 9px; flex-wrap: wrap; }
.token-new span { font-size: 11px; color: var(--muted); }
.token-new code { flex: 1; min-width: 180px; font-size: 11px; color: #33436b; overflow: auto; white-space: nowrap; }

@media (max-width: 1320px) {
  .brand-text p { display: none; }
  .user-name { display: none; }
  .user-chip { padding: 0 6px 0 3px; }
}
@media (max-width: 880px) {
  .auth-inner { grid-template-columns: 1fr; }
  .auth-side { padding: 26px 24px 22px; }
  .auth-tagline { margin-top: 16px; font-size: 13.5px; }
  .auth-features, .auth-foot { display: none; }
  .auth-panel { padding: 26px 24px 30px; }
  .top-actions .sync-badge { display: none; }
}

/* ================================================================ 果冻动效 */
:root {
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --spring-soft: cubic-bezier(.22, .9, .3, 1.08);
}

/* 背景漂浮色块 */
body::before, body::after {
  content: ""; position: fixed; border-radius: 50%; filter: blur(72px);
  z-index: -1; pointer-events: none; opacity: .5;
}
body::before { width: 520px; height: 520px; left: -170px; top: -150px; background: radial-gradient(circle, #dfe6ff 0%, transparent 70%); animation: blobFloat 19s ease-in-out infinite; }
body::after { width: 460px; height: 460px; right: -150px; bottom: -170px; background: radial-gradient(circle, #d8f5ee 0%, transparent 70%); animation: blobFloat 23s ease-in-out infinite reverse; }
@keyframes blobFloat { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(34px, 26px) scale(1.07); } }

/* 按钮 / 卡片 */
.btn { transition: transform .2s var(--spring), background .18s, border-color .18s, box-shadow .22s, filter .18s; }
.btn:active { transform: scale(.94); }
.btn.primary:hover { transform: translateY(-1px); }
.stat { transition: transform .32s var(--spring), box-shadow .32s var(--soft); }
.stat:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(23, 35, 66, .1); }
.card { transition: box-shadow .32s var(--soft); }
.card:hover { box-shadow: 0 3px 6px rgba(23, 35, 66, .05), 0 14px 34px rgba(23, 35, 66, .07); }
.num-pop { display: inline-block; animation: numPop .5s var(--spring); }
@keyframes numPop { 0% { transform: scale(1); } 40% { transform: scale(1.18); color: var(--accent); } 100% { transform: scale(1); } }

/* 时间轴行入场 */
.tl-row.row-in { animation: rowIn .52s var(--spring-soft) backwards; animation-delay: calc(var(--i, 0) * 32ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(12px) scale(.994); } to { opacity: 1; transform: none; } }
.tl-row { transition: background .25s; }
.tl-row:hover { background: rgba(var(--accent-rgb), .028); }

/* 实验条：拖动与回弹 */
.bar { transition: transform .32s var(--spring), box-shadow .32s var(--soft), filter .2s; will-change: left, width, transform; }
.bar:hover { transform: translateY(-2px) scale(1.006); }
.bar::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 12px;
  cursor: ew-resize; z-index: 3;
}
.bar.planned::before { background: none; }
.bar.dragging {
  transform: scaleY(1.12) scaleX(1.008); transition: none; z-index: 16;
  box-shadow: 0 16px 34px rgba(35, 50, 90, .3);
}
.bar.dragging::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35)); }
.bar.settle { animation: barSettle .64s var(--spring); }
@keyframes barSettle {
  0% { transform: scaleY(1.16) scaleX(1.02); }
  32% { transform: scaleY(.9) scaleX(1.012); }
  58% { transform: scaleY(1.07) scaleX(1.004); }
  78% { transform: scaleY(.97); }
  100% { transform: scaleY(1) scaleX(1); }
}
.bar.pulse { animation: barPulse .95s var(--soft); }
@keyframes barPulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .4); }
  60% { box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}
body.dragging { user-select: none; cursor: grabbing; }
body.dragging .bar { cursor: grabbing; }

/* 节点：入场、拖动、落点 */
.ms-wrap { transition: left .26s var(--spring-soft); }
.ms-wrap.ms-in { animation: msIn .5s var(--spring) backwards; animation-delay: calc(var(--i, 0) * 36ms); }
@keyframes msIn { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }
.ms { transition: transform .22s var(--spring), box-shadow .22s; }
.ms:hover { transform: rotate(45deg) scale(1.3); }
.ms-wrap.dragging { transition: none; z-index: 60; }
.ms-wrap.dragging .ms {
  transform: rotate(45deg) scale(1.6); transition: none;
  box-shadow: 0 0 0 7px rgba(var(--accent-rgb), .16), 0 0 18px rgba(var(--accent-rgb), .35);
  cursor: grabbing;
}
.ms-wrap.dragging .ms.ddl { box-shadow: 0 0 0 7px rgba(239, 68, 68, .16), 0 0 18px rgba(239, 68, 68, .35); }
.ms.settle { animation: msSettle .66s var(--spring); }
@keyframes msSettle {
  0% { transform: rotate(45deg) scale(1.65); }
  35% { transform: rotate(38deg) scale(.82); }
  62% { transform: rotate(50deg) scale(1.14); }
  82% { transform: rotate(43deg) scale(.97); }
  100% { transform: rotate(45deg) scale(1); }
}

/* 今天线 */
.today-line { animation: todayGlow 3.4s ease-in-out infinite; }
@keyframes todayGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 107, 107, .28); }
  50% { box-shadow: 0 0 20px rgba(255, 107, 107, .55); }
}
.today-line span { animation: todayBob 2.6s var(--spring-soft) infinite; }
@keyframes todayBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(3px); }
}

/* 弹窗 / 抽屉 / 菜单 / 气泡 */
.modal.open .modal-card { animation: modalJelly .5s var(--spring) both; }
@keyframes modalJelly {
  0% { opacity: 0; transform: translateY(20px) scale(.94); }
  62% { opacity: 1; transform: translateY(-3px) scale(1.012); }
  100% { opacity: 1; transform: none; }
}
.drawer { transition: transform .44s var(--spring); }
.menu-pop { animation: menuJelly .32s var(--spring); transform-origin: top right; }
@keyframes menuJelly {
  from { opacity: 0; transform: translateY(-8px) scale(.9); }
  to { opacity: 1; transform: none; }
}
.popover { animation: popJelly .26s var(--spring); }
@keyframes popJelly {
  from { opacity: 0; transform: translateY(6px) scale(.92); }
  to { opacity: 1; transform: none; }
}
.toast { animation: toastJelly .42s var(--spring) forwards; }
@keyframes toastJelly {
  0% { opacity: 0; transform: translateY(16px) scale(.86); }
  60% { opacity: 1; transform: translateY(-3px) scale(1.03); }
  100% { opacity: 1; transform: none; }
}

/* 拖动日期气泡 */
.drag-tip {
  position: fixed; z-index: 300; background: rgba(30, 42, 62, .95); color: #fff;
  font-size: 11.5px; padding: 6px 11px; border-radius: 9px; white-space: nowrap;
  pointer-events: none; transform: translate(-50%, -150%);
  box-shadow: 0 10px 26px rgba(16, 26, 50, .28);
  animation: tipIn .18s var(--spring);
}
@keyframes tipIn {
  from { opacity: 0; transform: translate(-50%, -120%) scale(.82); }
  to { opacity: 1; transform: translate(-50%, -150%) scale(1); }
}

/* 成员 / 头像 */
.member { transition: transform .26s var(--spring), background .2s, border-color .2s; }
.member:hover { transform: translateY(-2px) scale(1.03); }
.avatar { transition: transform .28s var(--spring); }
.member:hover .avatar, .user-chip:hover .avatar { transform: rotate(-7deg) scale(1.1); }
.activity-item { transition: transform .26s var(--spring), background .2s; }
.activity-item.linkable:hover { transform: translateX(2px); }
.ms-item { transition: background .2s, transform .24s var(--spring); }
.ms-item:hover { transform: translateX(2px); }

/* 侧栏卡片入场（仅首次显示时） */
.side .card { animation: cardIn .55s var(--spring-soft) backwards; }
.side .card:nth-child(1) { animation-delay: .02s; }
.side .card:nth-child(2) { animation-delay: .08s; }
.side .card:nth-child(3) { animation-delay: .14s; }
.side .card:nth-child(4) { animation-delay: .2s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }

/* 空状态 */
.tl-empty { animation: emptyIn .5s var(--spring-soft); }
@keyframes emptyIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* 克制动效 / 系统偏好 */
body.calm *, body.calm *::before, body.calm *::after {
  animation-duration: .001ms !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ================================================================ 交互优化 */
/* 一次性拖拽提示 */
.coach {
  display: flex; align-items: center; gap: 9px; margin: 0 14px 10px;
  padding: 8px 9px 8px 12px; border-radius: 10px;
  background: linear-gradient(100deg, #eef2ff, #f4f9ff);
  border: 1px solid #dfe6ff; color: #42507a; font-size: 11.5px;
  animation: coachIn .5s var(--spring);
}
.coach-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; animation: coachPulse 1.9s infinite; }
.coach-text { flex: 1; line-height: 1.6; }
.coach-text b { color: #33415c; }
.coach-x { border: 0; background: rgba(var(--accent-rgb), .1); color: #3f55c8; font-size: 11px; border-radius: 6px; padding: 4px 9px; white-space: nowrap; transition: background .18s, transform .2s var(--spring); }
.coach-x:hover { background: rgba(var(--accent-rgb), .18); transform: scale(1.04); }
@keyframes coachPulse { 0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .35); } 70% { box-shadow: 0 0 0 7px rgba(var(--accent-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); } }
@keyframes coachIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* 登录密码可见 */
.pw-wrap { position: relative; display: block; }
.pw-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #8b95a9; font-size: 11.5px; padding: 4px 7px; border-radius: 5px; }
.pw-toggle:hover { color: var(--accent); background: #eef2ff; }
.auth-panel .field input#authPassword { padding-right: 54px; }

/* 带操作的 Toast（撤销） */
.toasts { pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; }
.toast-action {
  border: 1px solid rgba(255, 255, 255, .32); background: rgba(255, 255, 255, .14);
  color: #fff; font-size: 11.5px; padding: 3px 10px; border-radius: 6px; white-space: nowrap;
  transition: background .18s, transform .2s var(--spring);
}
.toast-action:hover { background: rgba(255, 255, 255, .26); transform: scale(1.05); }
.toast-action:active { transform: scale(.94); }

/* 行内快捷操作 */
.row-acts {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%) translateX(6px);
  display: flex; gap: 3px; padding: 2px; border-radius: 8px; opacity: 0; pointer-events: none;
  background: rgba(255, 255, 255, .94); box-shadow: 0 4px 14px rgba(23, 35, 66, .14);
  transition: opacity .2s, transform .26s var(--spring);
}
.tl-row:hover .row-acts { opacity: 1; transform: translateY(-50%); pointer-events: auto; }
.row-act {
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: #71809b; font-size: 13px; line-height: 1; display: grid; place-items: center;
  transition: transform .2s var(--spring), background .16s, color .16s;
}
.row-act:hover { color: var(--accent); background: #eef2ff; transform: scale(1.12); }
.row-act:active { transform: scale(.9); }

/* 拖动吸附参考线 */
.snap-line {
  position: absolute; top: 0; bottom: 0; width: 2px; z-index: 4; pointer-events: none;
  background: rgba(var(--accent-rgb), .5); box-shadow: 0 0 14px rgba(var(--accent-rgb), .35);
  opacity: 0; transition: opacity .15s, left .16s var(--spring-soft);
}
.snap-line.on { opacity: 1; }
.snap-line::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 7px; height: 7px;
  transform: translate(-50%, 0) rotate(45deg); background: var(--accent); border-radius: 1px;
}

/* 触摸拖动 */
.bar, .ms-wrap, .ms { touch-action: none; }

/* 边缘手柄悬停提示 */
.bar:hover::before { background: linear-gradient(90deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, 0)); }
.bar:hover::after { background: linear-gradient(270deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0)); }
.bar.planned:hover::before { background: linear-gradient(90deg, rgba(var(--accent-rgb), .2), transparent); }
.bar.planned:hover::after { background: linear-gradient(270deg, rgba(var(--accent-rgb), .28), transparent); }
.bar.done:hover::before { background: linear-gradient(90deg, rgba(120, 132, 155, .2), transparent); }

/* ================================================================ 标尺刻度与新建泳道 */
.scale-seg { margin-left: 2px; }
.scale-seg button { min-width: 26px; padding: 0 8px; }

/* 刻度尺刻度线 */
.day-cell { position: relative; }
.day-cell::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: 4px; background: #e3e8f2; }
.day-cell.we::after { background: #eaeef7; }
.day-cell.today::after { background: rgba(255, 255, 255, .75); }
.week-cell {
  position: relative; flex: 0 0 auto; height: 22px; line-height: 22px;
  font-size: 10.5px; color: #8c96ab; border-left: 1px solid var(--line-soft);
  padding-left: 6px; cursor: pointer; white-space: nowrap; overflow: hidden;
  font-variant-numeric: tabular-nums; transition: background .16s, color .16s;
}
.week-cell span { color: #b6bfd0; font-size: 9.5px; margin-left: 4px; }
.week-cell::after { content: ""; position: absolute; left: 0; bottom: 0; width: 1px; height: 7px; background: #dfe5f0; }
.week-cell:hover { background: var(--accent-soft); color: var(--accent); }
.week-cell.today { background: #f2f5ff; color: #3f55c8; }

/* 月刻度：表头加高 */
.tl-head.scale-month .month-band { height: 46px; }
.tl-head.scale-month .month-label { line-height: 46px; font-size: 12.5px; font-weight: 600; }
.tl-head.scale-month .month-label span { font-size: 11px; }
.tl-head.scale-month .tl-corner { align-items: center; }

/* 周 / 月网格 */
.tl-grid .col.week { border-left: 1px solid #e9edf5; }
.tl-grid .col.month { border-left: 1px solid #dfe5f0; }
.tl-grid .col.week.today, .tl-grid .col.month.today { background: #f6f8ff; }

/* 新建实验泳道 */
.create-row { height: 50px; border-top: 1px dashed #e1e8f5; background: #fbfcff; }
.create-label { cursor: default; background: #fbfcff; }
.create-row:hover .create-label { background: #f8faff; }
.create-plus {
  width: 18px; height: 18px; border-radius: 6px; background: #eef2ff; color: var(--accent);
  display: inline-grid; place-items: center; font-size: 13px; font-weight: 600; flex: 0 0 auto;
}
.create-label .lbl-title { color: #5b6b8c; }
.create-track { cursor: crosshair; }
.create-track::after {
  content: "按住拖拽选择实验周期"; position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); font-size: 11px; color: #aab3c5; pointer-events: none;
  letter-spacing: .2px;
}

/* 拖拽虚影（标尺） */
.range-ghost {
  position: absolute; top: 12px; height: 30px; border-radius: 9px;
  border: 1.5px dashed rgba(var(--accent-rgb), .8);
  background: linear-gradient(100deg, rgba(var(--accent-rgb), .16), rgba(var(--accent-rgb), .05));
  z-index: 8; pointer-events: none; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), .14);
  animation: ghostIn .16s var(--spring);
}
.range-ghost::before, .range-ghost::after {
  content: ""; position: absolute; top: -4px; bottom: -4px; width: 3px; border-radius: 2px; background: #6d84ff;
}
.range-ghost::before { left: -2px; }
.range-ghost::after { right: -2px; }
.rg-label {
  font-size: 10.5px; color: #3f55c8; background: rgba(255, 255, 255, .88);
  border-radius: 4px; padding: 1px 6px; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(63, 85, 200, .12);
}
@keyframes ghostIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* 落点涟漪 */
.ripple {
  position: fixed; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(var(--accent-rgb), .45); background: rgba(var(--accent-rgb), .16);
  transform: translate(-50%, -50%) scale(.4); z-index: 260; pointer-events: none;
  animation: rippleOut .6s ease-out forwards;
}
@keyframes rippleOut { to { transform: translate(-50%, -50%) scale(9); opacity: 0; } }

/* 刻度切换过渡 */
.tl-inner.swap { animation: swapIn .4s var(--spring-soft); }
@keyframes swapIn { from { opacity: .45; transform: translateY(4px) scale(.998); } to { opacity: 1; transform: none; } }

/* 节点移到色块上方，避免遮挡日期文字 */
.ms-wrap { top: 3px; }
.ms-wrap::after {
  content: ""; position: absolute; left: -0.5px; top: 12px; width: 1px; height: 6px;
  background: #e2e8f3;
}
.ms-wrap.dragging::after { background: #b9c6ff; }

/* 月份标签在窄列时裁切，避免挤压相邻月份 */
.month-label { min-width: 0; flex: 0 0 auto; }

/* ================================================================ 时 / 分刻度与时间窗 */
.tl-row { height: 68px; }
.create-row { height: 52px; }
.tl-label { padding: 8px 12px 5px 14px; }
.lbl-time {
  margin-top: 3px; display: flex; align-items: center; gap: 5px;
  font-size: 10px; line-height: 12px; color: #9aa4b8;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden;
}
.lbl-time .lt-clock {
  color: var(--text-2); background: var(--line-soft);
  border-radius: 4px; padding: 0 5px; letter-spacing: .2px;
}
.lbl-time .lt-sep { color: #c3cad8; }
.bar { top: 21px; }

.fine-window {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.fine-window[hidden] { display: none !important; }
.fine-window > span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.fine-window input {
  width: 112px; height: 26px; border: 0; padding: 0; outline: none;
  background: transparent; font-size: 12px; color: var(--text-2);
}
.fine-window input::-webkit-calendar-picker-indicator { opacity: .55; }

.hour-cell {
  position: relative; flex: 0 0 auto; height: 22px; line-height: 22px;
  text-align: center; font-size: 10.5px; color: #8c96ab;
  border-left: 1px solid var(--line-soft); cursor: pointer;
  font-variant-numeric: tabular-nums; user-select: none;
  transition: background .14s, color .14s;
}
.hour-cell.night { background: #f8f9fd; color: #adb6c7; }
.hour-cell.today { background: #fbfcff; }
.hour-cell.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.hour-cell:hover { background: var(--accent-soft); color: var(--accent); }
.tl-head.scale-minute .hour-cell { font-size: 10.5px; letter-spacing: .3px; }
.fine-band .fine-day { font-size: 11.5px; }
.fine-band .fine-day.today { background: var(--accent-soft); color: var(--accent); }

.tl-grid .col.hour { border-left: 1px solid #eef1f7; }
.tl-grid .col.hour.night { background: rgba(23, 35, 66, .028); }
.tl-grid .col.hour.today { background: rgba(var(--accent-rgb), .022); }
.now-line span { background: #1f2b40; color: #fff; }
.now-line { background: linear-gradient(180deg, #ff7a7a, #ffb0b0); }

.bar.clip-l { border-top-left-radius: 2px; border-bottom-left-radius: 2px; }
.bar.clip-r { border-top-right-radius: 2px; border-bottom-right-radius: 2px; }

/* 节点行：日期 / 时间 / 类型 / 完成 / 删除 */
.ms-row { grid-template-columns: 1.6fr 112px 118px 80px 58px 24px; }
.ms-row input.ms-time {
  height: 32px; border-radius: 7px; border: 1px solid var(--line);
  background: #fbfcfe; padding: 0 8px; outline: none; min-width: 0;
  color: var(--text-2); font-variant-numeric: tabular-nums;
}
.ms-row input.ms-time:focus { border-color: #b6c2ff; background: #fff; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .09); }

/* 抽屉节点时间 */
.ms-item .ms-date i { display: block; font-style: normal; font-size: 9.5px; line-height: 1.3; color: #aab3c5; }
.ms-add { grid-template-columns: 1fr 1fr; }
.ms-add input#msAddTime {
  height: 32px; border-radius: 7px; border: 1px solid var(--line);
  background: #fbfcfe; padding: 0 8px; outline: none; min-width: 0; color: var(--text-2);
}
.ms-add #msAddTitle { grid-column: 1 / -1; }
.ms-add > button { grid-column: auto; }
.ms-add #msAddType { grid-column: 1; }
.ms-add > button { grid-column: 2; }

/* 抽屉信息改为单列，容纳日期 + 时间 */
.drawer .meta-grid { grid-template-columns: 1fr; gap: 7px; }
.drawer .meta-grid > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 7px 10px;
}
.drawer .meta-grid span { margin-bottom: 0; white-space: nowrap; }
.drawer .meta-grid b { text-align: right; font-variant-numeric: tabular-nums; }
.drawer-meta + .drawer-sec { margin-top: 12px; }
.meta-grid small { font-size: 10.5px; color: var(--muted); font-weight: 400; margin-left: 2px; }

/* ================================================================ 外观主题 */
html[data-theme="forest"] {
  --bg: #f1f8f4;
  --accent: #0f9d76;
  --accent-rgb: 15, 157, 118;
  --accent-2: #38c59c;
  --accent-soft: #e6f8f0;
  --grid-minor: #edf6f1;
  --hover: #f7fcf9;
}
html[data-theme="sand"] {
  --bg: #faf5ec;
  --accent: #d97706;
  --accent-rgb: 217, 119, 6;
  --accent-2: #f0a44a;
  --accent-soft: #fdf1de;
  --grid-minor: #f6efe2;
  --hover: #fdfaf4;
}
html[data-theme="night"] {
  --bg: #0d1420;
  --surface: #151d2c;
  --line: #263144;
  --line-soft: #1d2737;
  --text: #e8eef9;
  --text-2: #c4cedf;
  --muted: #8b98ad;
  --accent: #5b8cff;
  --accent-rgb: 91, 140, 255;
  --accent-2: #7aa2ff;
  --accent-soft: #1b2740;
  --grid-minor: #222d40;
  --hover: #1b2536;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .28);
}

body { transition: background .35s ease, color .35s ease; }

.menu-sec {
  font-size: 10.5px; color: #a3adc0; padding: 8px 9px 4px;
  letter-spacing: .3px;
}
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 0 3px 6px; }
.theme-item {
  display: flex; align-items: center; gap: 6px; padding: 6px 7px;
  border: 1px solid transparent; border-radius: 7px; background: transparent;
  font-size: 11.5px; color: var(--text-2); text-align: left;
  transition: background .16s, border-color .16s, color .16s;
}
.theme-item:hover { background: var(--hover); }
.theme-item.on { border-color: rgba(var(--accent-rgb), .38); background: var(--accent-soft); color: var(--accent); }
.theme-item i {
  width: 12px; height: 12px; border-radius: 4px; background: var(--sw); flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08) inset;
}

/* 深色主题：覆盖硬编码的浅色表面 */
html[data-theme="night"] body::before { background: radial-gradient(circle, rgba(40, 82, 156, .55) 0%, transparent 70%); }
html[data-theme="night"] body::after { background: radial-gradient(circle, rgba(16, 104, 96, .45) 0%, transparent 70%); }
html[data-theme="night"] .seg { background: #111a28; }
html[data-theme="night"] .sync-badge { background: #16202e; border-color: #263144; color: #a9b6ca; }
html[data-theme="night"] .user-chip { background: #16202e; border-color: #263144; color: var(--text-2); }
html[data-theme="night"] .user-chip:hover { background: #1d2838; border-color: #33415a; }
html[data-theme="night"] .tl-grid .col { border-left-color: #1c2635; }
html[data-theme="night"] .tl-grid .col.hour { border-left-color: #1c2635; }
html[data-theme="night"] .lg-ms { background: var(--surface); }
html[data-theme="night"] .lg-bar { background: linear-gradient(100deg, var(--accent), var(--accent-2)); }
html[data-theme="night"] .tl-toolbar .seg { background: #111a28; }
html[data-theme="night"] .bar-out { color: #8b98ad; }
html[data-theme="night"] .pill.today { background: #3a2c14; color: #f0b45a; }
html[data-theme="night"] .pill.soon { background: #3a3014; color: #e5c05a; }
html[data-theme="night"] .pill.week { background: #1b2740; color: #93acff; }
html[data-theme="night"] .pill.overdue { background: #3a1c1c; color: #f78b8b; }
html[data-theme="night"] .seg button.on { background: #243149; color: var(--text); }
html[data-theme="night"] .btn,
html[data-theme="night"] .zoom span { background: var(--surface); }
html[data-theme="night"] .btn:hover { background: #1d283a; border-color: #33415a; }
html[data-theme="night"] .btn.dashed:hover,
html[data-theme="night"] .quick-dur button:hover { background: #1b2740; border-color: #3a4d72; }
html[data-theme="night"] .search-wrap,
html[data-theme="night"] .search-wrap input,
html[data-theme="night"] .select,
html[data-theme="night"] .zoom button,
html[data-theme="night"] .zoom { background: #121b29; color: var(--text-2); }
html[data-theme="night"] .zoom span { border-color: var(--line); }
html[data-theme="night"] .tl-head,
html[data-theme="night"] .tl-corner,
html[data-theme="night"] .tl-label { background: var(--surface); }
html[data-theme="night"] .tl-row:hover .tl-label { background: #1b2536; }
html[data-theme="night"] .tl-row:hover { background: rgba(var(--accent-rgb), .05); }
html[data-theme="night"] .create-row,
html[data-theme="night"] .create-label,
html[data-theme="night"] .create-row:hover .create-label { background: #121a27; }
html[data-theme="night"] .day-cell.we,
html[data-theme="night"] .tl-grid .col.we,
html[data-theme="night"] .hour-cell.night,
html[data-theme="night"] .tl-grid .col.hour.night { background: #141d2b; }
html[data-theme="night"] .tl-grid .col.hour.today { background: rgba(var(--accent-rgb), .08); }
html[data-theme="night"] .day-cell.today,
html[data-theme="night"] .hour-cell.current { background: var(--accent); color: #fff; }
html[data-theme="night"] .tl-corner .count,
html[data-theme="night"] .status,
html[data-theme="night"] .pill { background: #1e2838; color: var(--muted); }
html[data-theme="night"] .status.st-ongoing { background: #12352c; color: #4ade9f; }
html[data-theme="night"] .status.st-planned { background: #1b2740; color: #93acff; }
html[data-theme="night"] .status.st-blocked,
html[data-theme="night"] .pill.ddl,
html[data-theme="night"] .pill.overdue { background: #3a1c1c; color: #f78b8b; }
html[data-theme="night"] .status.st-done { background: #242c3a; color: #9aa6ba; }
html[data-theme="night"] .tl-foot,
html[data-theme="night"] .modal-foot { background: #121a27; border-color: var(--line); }
html[data-theme="night"] .drawer,
html[data-theme="night"] .modal-card,
html[data-theme="night"] .popover,
html[data-theme="night"] .menu-pop,
html[data-theme="night"] .auth-inner,
html[data-theme="night"] .card { background: var(--surface); border-color: var(--line); }
html[data-theme="night"] .auth-screen {
  background: radial-gradient(1200px 600px at 15% -10%, #1a2740 0%, transparent 55%),
              radial-gradient(900px 500px at 100% 110%, #12312c 0%, transparent 50%), var(--bg);
}
html[data-theme="night"] .auth-side { background: linear-gradient(155deg, #17223a, #141d2c 60%, #11211f); }
html[data-theme="night"] .auth-tabs { background: #111a28; }
html[data-theme="night"] .auth-tabs button.on { background: #243149; color: var(--text); }
html[data-theme="night"] input,
html[data-theme="night"] select,
html[data-theme="night"] textarea,
html[data-theme="night"] .ms-row input,
html[data-theme="night"] .ms-row select,
html[data-theme="night"] .ms-add input,
html[data-theme="night"] .ms-add select,
html[data-theme="night"] .token-create input { background: #101926; border-color: #2a3547; color: var(--text); }
html[data-theme="night"] input:focus,
html[data-theme="night"] select:focus,
html[data-theme="night"] textarea:focus { background: #0d1520; border-color: #49639a; }
html[data-theme="night"] .notice { background: #1a2436; border-color: #2a3a55; color: #b9c6dc; }
html[data-theme="night"] .notice.soft { background: #16202e; }
html[data-theme="night"] .dl-item:hover,
html[data-theme="night"] .activity-item.linkable:hover,
html[data-theme="night"] .lab-item:hover,
html[data-theme="night"] .menu-item:hover,
html[data-theme="night"] .theme-item:hover { background: #1b2536; }
html[data-theme="night"] .member { background: #141d2b; border-color: #253044; }
html[data-theme="night"] .member.me { background: #1b2740; border-color: #2f4470; }
html[data-theme="night"] .month-label span,
html[data-theme="night"] .day-cell,
html[data-theme="night"] .hour-cell,
html[data-theme="night"] .week-cell { color: #8b98ad; }
html[data-theme="night"] .ms { background: var(--surface); }
html[data-theme="night"] .ms.ddl { background: var(--danger); }
html[data-theme="night"] .ms-tip { background: #0b111c; }
html[data-theme="night"] .bar-out { background: #16202e; border-color: #2a3a55; color: var(--muted); }
html[data-theme="night"] .token-item { background: #141d2b; border-color: #243044; }
html[data-theme="night"] .coach { background: linear-gradient(100deg, #18223a, #14232c); border-color: #2a3a55; color: #b9c8de; }
html[data-theme="night"] .coach-text b { color: var(--text); }
html[data-theme="night"] .pw-toggle:hover { background: #1b2740; }
html[data-theme="night"] .toast { background: #223049; }
html[data-theme="night"] .status.st-planned,
html[data-theme="night"] .pill.week { color: #93acff; }
html[data-theme="night"] ::-webkit-scrollbar-thumb { background: #33415a; background-clip: content-box; }

@media (max-width: 880px) {
  .ms-row { grid-template-columns: 1fr 110px 84px; }
  .ms-row .ms-title { grid-column: 1 / -1; }
  .ms-row .ms-done, .ms-row .ms-del { grid-column: span 1; }
  .ms-add { grid-template-columns: 1fr 1fr; }
  .ms-add #msAddTitle { grid-column: 1 / -1; }
  .ms-add button { grid-column: 1 / -1; }
}

/* 细刻度头部信息与工具栏压缩 */
.fine-corner { padding: 6px 12px; align-items: center; }
.fc-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fc-title { font-size: 11px; color: var(--muted); }
.fc-range { font-size: 10.5px; color: var(--accent); font-weight: 600; letter-spacing: .2px; }
.hour-cell.midnight { border-left: 2px solid var(--line); }
.scale-seg button { padding: 0 7px; min-width: 24px; }
.fine-window { padding: 0 6px; }
.fine-window input { width: 98px; }
.tl-toolbar .search-wrap { max-width: 210px; }
#statusFilter { max-width: 108px; }
#labFilter { max-width: 128px; }

/* 分钟视图：单日窗口，日期由左侧角标承担，腾出表头高度 */
.tl-head.scale-minute .fine-band { display: none; }
.tl-head.scale-minute .hour-cell { height: 28px; line-height: 28px; }
.tl-head.scale-minute .day-row { height: 28px; }
.tl-head.scale-minute .tl-corner { min-height: 40px; }
.now-line span { top: 26px; }

/* 深色登录页文字与次要控件 */
html[data-theme="night"] .auth-tagline { color: #aebbd0; }
html[data-theme="night"] .auth-features b { color: var(--text); }
html[data-theme="night"] .auth-features span,
html[data-theme="night"] .auth-brand p,
html[data-theme="night"] .auth-foot,
html[data-theme="night"] .auth-note { color: #8b98ad; }
html[data-theme="night"] .auth-note { color: #8b98ad; }
html[data-theme="night"] .pw-toggle { color: #9aa8bd; }
html[data-theme="night"] .pw-toggle:hover { background: #1b2740; color: var(--accent); }
html[data-theme="night"] .auth-error { background: #331b1b; border-color: #4d2a2a; color: #f0a0a0; }

html[data-theme="night"] .ms-wrap::after { background: #2a3547; }
html[data-theme="night"] .quick-dur button { background: #16202e; border-color: #2a3547; color: var(--text-2); }
html[data-theme="night"] .quick-dur button:hover { background: #1b2740; border-color: #3a4d72; color: var(--accent); }
html[data-theme="night"] .drawer-foot { background: #121a27; border-color: var(--line); }
html[data-theme="night"] .drawer .meta-grid > div { background: #111a28; border-color: #243044; }
html[data-theme="night"] .notes { background: #121b29; border-left-color: #2f4470; color: var(--text-2); }
html[data-theme="night"] .tag { background: #1b2740; color: #93acff; }
html[data-theme="night"] .ms-type { background: #1e2838; color: var(--muted); }
html[data-theme="night"] .ms-type.ddl { background: #3a1c1c; color: #f78b8b; }
html[data-theme="night"] .ms-item .ms-date { color: #8b98ad; }
html[data-theme="night"] .ms.done { background: #475569; border-color: #475569; }
html[data-theme="night"] .ms.start { background: var(--ok); border-color: var(--ok); }

/* 节点行改为两行：标题独占一行，日期/时间/类型/完成在第二行 */
.ms-row {
  grid-template-columns: minmax(0, 1fr) 120px 126px 88px 26px;
  grid-template-rows: auto auto;
  gap: 6px 8px;
  padding: 6px 0;
}
.ms-row .ms-title { grid-column: 1 / 5; grid-row: 1; }
.ms-row .ms-del { grid-column: 5; grid-row: 1; justify-self: end; }
.ms-row .ms-date { grid-column: 1; grid-row: 2; }
.ms-row .ms-time { grid-column: 2; grid-row: 2; }
.ms-row .ms-type { grid-column: 3; grid-row: 2; }
.ms-row .ms-done { grid-column: 4; grid-row: 2; justify-self: start; }

/* 深色主题下保留主按钮填充 */
html[data-theme="night"] .btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-color: transparent;
}

@media (max-width: 880px) {
  .ms-row { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .ms-row .ms-title { grid-column: 1 / -1; grid-row: auto; }
  .ms-row .ms-date, .ms-row .ms-time, .ms-row .ms-type,
  .ms-row .ms-done, .ms-row .ms-del { grid-column: auto; grid-row: auto; justify-self: stretch; }
  .ms-row .ms-del { justify-self: end; }
}

/* ================================================================ 操作效率：命令面板 / 右键 / 快捷键 */
.tl-card { position: relative; }

kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--line-soft);
  color: var(--muted); font-family: inherit; font-size: 10px; font-weight: 500;
  line-height: 1; vertical-align: middle;
}

.today-fab {
  position: absolute; right: 18px; bottom: 58px; z-index: 18;
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), .3);
  background: var(--surface); color: var(--accent);
  font-size: 12px; font-weight: 600; box-shadow: 0 8px 22px rgba(23, 35, 66, .16);
  transition: transform .2s var(--spring), box-shadow .2s, background .18s;
  animation: fabIn .32s var(--spring);
}
.today-fab::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.today-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(23, 35, 66, .22); background: var(--accent-soft); }
.today-fab:active { transform: scale(.95); }
@keyframes fabIn { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: none; } }

.cmd {
  position: fixed; inset: 0; z-index: 250; display: flex; align-items: flex-start; justify-content: center;
  padding: 11vh 20px 30px; background: rgba(12, 19, 32, .42);
  backdrop-filter: blur(3px); animation: fadeIn .16s ease;
}
.cmd-card {
  width: min(620px, 94vw); max-height: 72vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 32px 80px rgba(12, 22, 42, .3); overflow: hidden;
  animation: cmdIn .32s var(--spring);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cmdIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }
.cmd-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 15px;
  border-bottom: 1px solid var(--line-soft); color: var(--muted);
}
.cmd-head input {
  flex: 1; min-width: 0; height: 26px; border: 0; outline: none;
  background: transparent; color: var(--text); font-size: 14.5px;
}
.cmd-head input::placeholder { color: #a3adc0; }
.cmd-list { padding: 6px; overflow: auto; flex: 1; }
.cmd-group { font-size: 10px; color: #a3adc0; letter-spacing: .6px; padding: 8px 9px 4px; }
.cmd-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 9px; border: 0; border-radius: 8px; background: transparent;
  text-align: left; color: var(--text-2);
}
.cmd-item.on { background: var(--accent-soft); }
.cmd-item.on .ci-label { color: var(--accent); }
.ci-icon {
  width: 24px; height: 24px; flex: 0 0 auto; border-radius: 7px;
  display: grid; place-items: center; background: var(--line-soft); color: var(--muted); font-size: 12px;
}
.cmd-item.on .ci-icon { background: rgba(var(--accent-rgb), .14); color: var(--accent); }
.ci-main { flex: 1; min-width: 0; }
.ci-label { display: block; font-size: 12.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-sub { display: block; font-size: 10.8px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-kbd { flex: 0 0 auto; }
.cmd-foot {
  display: flex; align-items: center; gap: 14px; padding: 8px 14px;
  border-top: 1px solid var(--line-soft); background: var(--line-soft);
  font-size: 10.5px; color: var(--muted);
}
.cmd-foot span { display: inline-flex; align-items: center; gap: 4px; }
.cmd-tip { margin-left: auto; color: #a3adc0; }
.cmd-empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 12px; }

.ctx-menu {
  position: fixed; z-index: 260; width: 204px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 18px 44px rgba(16, 26, 50, .22);
  animation: ctxIn .18s var(--spring);
}
@keyframes ctxIn { from { opacity: 0; transform: translateY(-4px) scale(.96); } to { opacity: 1; transform: none; } }
.ctx-item {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border: 0; border-radius: 6px; background: transparent;
  color: var(--text-2); font-size: 12.5px; text-align: left;
}
.ctx-item:hover { background: var(--accent-soft); color: var(--accent); }
.ctx-item.danger { color: #c0392b; }
.ctx-item.danger:hover { background: #fff2f2; color: #b52d20; }
.ctx-item i { width: 16px; text-align: center; font-style: normal; color: var(--muted); }
.ctx-item:hover i { color: inherit; }
.ctx-sep { height: 1px; background: var(--line-soft); margin: 4px 6px; }
.ctx-label { font-size: 10px; color: #a3adc0; padding: 5px 9px 3px; }

.shortcut-grid { display: flex; flex-direction: column; gap: 2px; }
.sc-row {
  display: flex; align-items: center; gap: 5px;
  padding: 9px 10px; border-radius: 7px; background: var(--line-soft);
}
.sc-row > span { flex: 1; font-size: 12.5px; color: var(--text-2); }
.shortcut-note { margin: 14px 2px 0; font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.shortcut-note kbd { margin: 0 2px; }

.menu-item { display: flex; align-items: center; justify-content: space-between; }
.menu-kbd { margin-left: 8px; }
.btn-kbd {
  margin-left: 6px; background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .28); color: #fff;
}
.status { cursor: pointer; transition: filter .16s, box-shadow .16s; }
.status:hover { filter: brightness(1.06); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .16); }
.drawer-foot .btn { flex: 0 0 auto; }

html[data-theme="night"] .cmd { background: rgba(4, 8, 14, .62); }
html[data-theme="night"] .cmd-card,
html[data-theme="night"] .ctx-menu { background: var(--surface); border-color: var(--line); }
html[data-theme="night"] .cmd-foot { background: #111a28; }
html[data-theme="night"] .ci-icon { background: #1e2838; }
html[data-theme="night"] .ctx-item.danger:hover { background: #3a1c1c; color: #f78b8b; }
html[data-theme="night"] kbd { background: #1e2838; border-color: #2a3547; color: #9aa8bd; }
html[data-theme="night"] .btn-kbd { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .26); color: #fff; }

@media (max-width: 720px) {
  .cmd { padding-top: 6vh; }
  .cmd-card { max-height: 82vh; }
  .today-fab { bottom: 52px; right: 12px; }
}

/* 今天线闪烁反馈 */
.today-line.flash { animation: todayFlash .9s ease; }
@keyframes todayFlash {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, .45); }
  45% { box-shadow: 0 0 0 10px rgba(255, 107, 107, .12); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

/* 节点行输入占满网格列，避免中间出现空档 */
.ms-row .ms-title,
.ms-row .ms-date,
.ms-row .ms-time,
.ms-row select,
.ms-add input,
.ms-add select { width: 100%; }
.ms-row .ms-done input { width: auto; }

/* ================================================================ 启动加载屏 */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
  transition: opacity .38s ease, visibility .38s ease;
}
.boot-screen.is-out { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 26px 34px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-width: 220px;
}
.boot-card .logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.boot-card b { font-size: 14px; letter-spacing: .02em; }
.boot-card #bootText { color: var(--muted); font-size: 12px; }
.boot-bar {
  width: 120px;
  height: 3px;
  border-radius: 99px;
  background: var(--line-soft);
  overflow: hidden;
  position: relative;
}
.boot-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: 99px;
  background: var(--accent);
  animation: bootSlide 1.1s ease-in-out infinite;
}
@keyframes bootSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}
@media (prefers-reduced-motion: reduce) {
  .boot-bar i { animation: none; width: 100%; opacity: .5; }
}

/* ================================================================ 多分组工作区 */
.ws-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow: auto;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(var(--accent-rgb), .10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(var(--accent-rgb), .06), transparent 55%),
    var(--bg);
}
.ws-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100%;
}
.ws-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ws-top .brand { display: flex; align-items: center; gap: 10px; }
.ws-top .logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line);
}
.ws-top h1 { font-size: 15px; margin: 0; }
.ws-top p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.ws-top-right { display: flex; align-items: center; gap: 10px; }
.ws-user {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 5px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 12.5px;
}
.ws-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 6px; }
.ws-hero h2 { font-size: 24px; margin: 0 0 6px; }
.ws-hero p { margin: 0; color: var(--muted); font-size: 13px; max-width: 660px; line-height: 1.6; }
.ws-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); gap: 16px; align-items: start; }
.ws-list-card, .ws-create-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.ws-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ws-list-head h3 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.ws-pick-list { display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.ws-card {
  display: flex; gap: 12px; align-items: center; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.ws-card:hover { border-color: rgba(var(--accent-rgb), .45); box-shadow: 0 6px 18px rgba(var(--accent-rgb), .10); transform: translateY(-1px); }
.ws-card.on { border-color: rgba(var(--accent-rgb), .55); background: var(--accent-soft); }
.ws-card.open { border-style: dashed; }
.ws-card-main { flex: 1; min-width: 0; }
.ws-card-title { display: flex; align-items: center; gap: 8px; }
.ws-card-title h4 { margin: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-card-desc { margin: 4px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-card-desc.empty { opacity: .55; font-style: italic; }
.ws-card-meta { display: flex; gap: 10px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.ws-card-act { flex: none; }
.ws-badge {
  font-size: 11px; padding: 2px 7px; border-radius: 999px;
  background: var(--line-soft); color: var(--muted); border: 1px solid var(--line);
}
.ws-badge.owner { background: rgba(var(--accent-rgb), .12); color: var(--accent); border-color: rgba(var(--accent-rgb), .3); }
.ws-badge.muted { opacity: .75; }
.ws-badge.on { background: var(--accent); color: #fff; border-color: transparent; }
.ws-empty {
  display: grid; place-items: center; gap: 6px; text-align: center; padding: 26px 18px;
  border: 1px dashed var(--line); border-radius: 12px; color: var(--muted);
}
.ws-empty-icon { font-size: 22px; color: var(--accent); }
.ws-empty h4 { margin: 0; color: var(--text); font-size: 13.5px; }
.ws-empty p { margin: 0; font-size: 12px; max-width: 320px; line-height: 1.6; }
.ws-loading { display: flex; align-items: center; gap: 8px; padding: 22px; justify-content: center; color: var(--muted); font-size: 12.5px; }
.ws-loading.err { color: var(--danger); flex-wrap: wrap; }
.ws-create-card h3 { margin: 0 0 6px; font-size: 14px; }
.ws-create-card p { margin: 0 0 12px; font-size: 12px; line-height: 1.6; }
.ws-create-card form { display: flex; flex-direction: column; gap: 10px; }
.ws-create-hint { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.ws-foot { font-size: 12px; color: var(--muted); text-align: center; margin: 4px 0 0; }

/* 顶栏分组切换 */
.ws-menu { position: relative; }
.ws-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font-size: 12.5px; cursor: pointer; transition: border-color .18s ease, background .18s ease;
  max-width: 230px;
}
.ws-chip:hover { border-color: rgba(var(--accent-rgb), .45); background: var(--hover); }
.ws-chip .ws-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.ws-role { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: var(--line-soft); color: var(--muted); }
.ws-role.owner { background: rgba(var(--accent-rgb), .12); color: var(--accent); }
.ws-pop { min-width: 272px; padding: 8px; }
.ws-pop-head { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.ws-pop-head span { font-size: 11px; color: var(--muted); }
.ws-pop-head b { font-size: 13px; }
.ws-switch-list { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; margin-bottom: 4px; }
.ws-switch {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text);
  font-size: 12.5px; text-align: left; cursor: pointer;
}
.ws-switch:hover { background: var(--hover); }
.ws-switch.on { background: var(--accent-soft); color: var(--accent); }
.ws-switch-check { width: 14px; flex: none; font-size: 11px; color: var(--accent); }
.ws-switch-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.ws-switch-main b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-switch-main span { font-size: 11px; color: var(--muted); }
.ws-switch-empty { margin: 6px 8px; font-size: 12px; color: var(--muted); }

/* AI 服务商预设 */
.ai-presets { margin-bottom: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--line-soft); }
.preset-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.preset {
  display: inline-flex; flex-direction: column; gap: 1px; padding: 6px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  font-size: 12px; color: var(--text); transition: border-color .16s ease, background .16s ease, color .16s ease;
  text-align: left;
}
.preset:hover { border-color: rgba(var(--accent-rgb), .45); }
.preset.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.preset b { font-size: 12px; }
.preset span { font-size: 10.5px; color: var(--muted); }
.ai-models { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-preset-link { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
.ai-preset-link a { color: var(--accent); }

@media (max-width: 900px) {
  .ws-grid { grid-template-columns: 1fr; }
  .ws-hero { flex-direction: column; align-items: flex-start; }
  .ws-shell { padding: 18px 14px 32px; }
  .ws-chip .ws-name { max-width: 84px; }
}

/* ================================================================ 实验模板 */
.tpl-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--line-soft);
}
.tpl-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tpl-list { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 320px; }
.tpl-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 12px; cursor: pointer; transition: border-color .16s ease, transform .16s ease, background .16s ease;
}
.tpl-chip:hover { border-color: rgba(var(--accent-rgb), .45); transform: translateY(-1px); }
.tpl-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.tpl-chip b { font-weight: 600; }
.tpl-chip i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.tpl-ico { font-size: 13px; line-height: 1; }
.tpl-tip { font-size: 11.5px; color: var(--muted); flex-basis: 100%; }

/* ================================================================ v3.8 外观扩展 */
/* 三个新主题：樱花 / 海盐 / 墨韵（浅色，与现有主题同一套变量） */
html[data-theme="rose"] {
  --bg: #fdf3f7; --surface: #ffffff; --line: #f3e0e9; --line-soft: #fbf0f5;
  --text: #2c1d26; --text-2: #5c4450; --muted: #8f7684;
  --accent: #e0699b; --accent-rgb: 224, 105, 155; --accent-2: #f08cb8;
  --accent-soft: #fdeaf2; --grid-minor: #fbf1f6; --hover: #fff8fb;
}
html[data-theme="ocean"] {
  --bg: #eef7fb; --surface: #ffffff; --line: #dcecf3; --line-soft: #eef7fa;
  --text: #17242d; --text-2: #3f5a68; --muted: #728c9a;
  --accent: #0b84c4; --accent-rgb: 11, 132, 196; --accent-2: #46b6e6;
  --accent-soft: #e3f4fd; --grid-minor: #eaf4f9; --hover: #f7fcfe;
}
html[data-theme="ink"] {
  --bg: #eef1f6; --surface: #ffffff; --line: #e1e6ef; --line-soft: #f0f3f8;
  --text: #1b2334; --text-2: #414c63; --muted: #7a8699;
  --accent: #4b5bd6; --accent-rgb: 75, 91, 214; --accent-2: #7d8bee;
  --accent-soft: #eceffc; --grid-minor: #eef1f7; --hover: #f8f9fd;
}
/* 主题网格：7 个主题自动排布 */
#themeGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.theme-item { transition: transform .2s var(--spring), border-color .18s, background .18s; }
.theme-item:hover { transform: translateY(-2px); }

/* ================================================================ v3.8 动效预设 */
html[data-motion="spring"] { --spring: cubic-bezier(.34, 1.56, .64, 1); --spring-soft: cubic-bezier(.22, .9, .3, 1.08); }
html[data-motion="smooth"] { --spring: cubic-bezier(.22, .8, .28, 1); --spring-soft: cubic-bezier(.22, .8, .28, 1); }
html[data-motion="smooth"] .btn:active { transform: scale(.985); }
html[data-motion="smooth"] .bar:hover { transform: translateY(-1px); }
html[data-motion="smooth"] .modal.open .modal-card { animation: modalSoftIn .24s ease both; }
@keyframes modalSoftIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
html[data-motion="calm"] *,
html[data-motion="calm"] *::before,
html[data-motion="calm"] *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}
body.calm *,
body.calm *::before,
body.calm *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}

/* ================================================================ v3.8 布局精修 */
:root { --topbar-h: 64px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 10px 20px;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(14px);
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .topbar { background: color-mix(in srgb, var(--surface) 86%, transparent); }
}
.brand-text p {
  max-width: 44ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.stats {
  grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat { padding: 12px 14px; transition: transform .2s var(--spring), box-shadow .2s var(--soft); }
.stat:hover { transform: translateY(-2px); }
.layout { grid-template-columns: minmax(0, 1fr) 348px; gap: 18px; }
.side {
  top: calc(var(--topbar-h) + 12px);
  max-height: calc(100dvh - var(--topbar-h) - 26px);
  gap: 12px;
}
.tl-toolbar {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.tl-scroll { max-height: calc(100dvh - 336px); }
.card-head h2, .card-head h3 { letter-spacing: .01em; }

/* 竖屏 / 小屏：单列 + 横滑统计 + 全屏弹层 */
@media (max-width: 720px) {
  :root { --topbar-h: 112px; --radius: 12px; }
  /* 移动端省电/省性能：关掉毛玻璃与两个大模糊光斑 */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; }
  body::before, body::after { display: none; }
  body { font-size: 13.5px; }
  .topbar {
    flex-wrap: wrap;
    padding: 9px 12px;
    gap: 8px;
  }
  .brand-text p { display: none; }
  .brand-text h1 { font-size: 15px; }
  .top-actions {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .top-actions::-webkit-scrollbar { display: none; }
  .top-actions .sync-badge,
  .top-actions .btn.ghost[data-help],
  #helpBtn { display: none; }
  .stats {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scroll-snap-type: x proximity;
  }
  .stat { flex: 0 0 auto; min-width: 138px; scroll-snap-align: start; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .side {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .tl-scroll { max-height: 58dvh; min-height: 300px; }
  .tl-inner { min-width: 720px; }
  .today-fab { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .modal { padding: 0; align-items: stretch; }
  .modal-card, .modal-card.wide, .modal-card.narrow {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .modal-body { padding: 14px 14px; }
  .modal-head, .modal-foot { padding-left: 14px; padding-right: 14px; }
  .drawer { width: 100%; max-width: 100%; border-radius: 0; }
  .cmd { padding: 0; }
  .cmd-card { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .theme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .btn, .tool-btn, .seg button { min-height: 38px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .menu-pop { max-width: calc(100vw - 24px); }
}

@media (orientation: portrait) and (max-width: 520px) {
  .stats .stat { min-width: 124px; }
  .brand .logo { width: 30px; height: 30px; }
  .ws-chip .ws-name { max-width: 72px; }
  .tl-scroll { max-height: 52dvh; }
}

/* ================================================================ v3.9 顶部留白 + 更多动效 */
/* 顶栏更透气 */
.topbar { padding: 13px 24px; gap: 20px; }
.brand-text h1 { letter-spacing: -.015em; }
.brand-text p { margin-top: 4px; }
.top-actions { gap: 10px; }
.top-actions .btn { padding: 9px 14px; }
.stats { gap: 14px; margin-bottom: 18px; }
.stat { padding: 14px 16px; }

/* 空间不够时先收起次要按钮的文字，只留图标（新建实验永远带文字） */
@media (max-width: 1540px) {
  .top-actions .btn:not(.primary) .btn-lbl { display: none; }
  .top-actions .btn:not(.primary) { padding: 9px 11px; }
}
@media (max-width: 1380px) {
  .top-actions .sync-badge { display: none; }
}

/* 主按钮扫光 */
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after {
  content: ""; position: absolute; inset: -40% -60%; pointer-events: none;
  background: linear-gradient(105deg, transparent 36%, rgba(255, 255, 255, .42) 50%, transparent 64%);
  transform: translateX(-130%) rotate(4deg);
  transition: transform .55s ease;
}
.btn.primary:hover::after { transform: translateX(130%) rotate(4deg); }
html[data-motion="calm"] .btn.primary::after { display: none; }

/* 卡片悬浮 */
.card { transition: transform .24s var(--spring), box-shadow .24s var(--soft), border-color .18s; }
html[data-motion="spring"] .card:hover { transform: translateY(-2px); }

/* 弹窗遮罩淡入 */
.modal.open { animation: modalFade .2s ease both; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }

/* 勾选弹跳 */
.ms-done input:checked,
.tpl-chip:active,
.theme-item:active { animation: checkPop .32s var(--spring); }
@keyframes checkPop { 0% { transform: scale(.72); } 55% { transform: scale(1.14); } 100% { transform: scale(1); } }

/* 主题按钮选中呼吸 + chip 悬浮 */
.theme-item.on { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .26); }
html[data-motion="spring"] .theme-item.on { animation: themePulse 3.2s ease-in-out infinite; }
@keyframes themePulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .24); }
  50% { box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .10); }
}
.ws-chip, .user-chip { transition: transform .18s var(--spring), background .18s, border-color .18s; }
.ws-chip:hover, .user-chip:hover { transform: translateY(-1px); }

/* 统计小圆点呼吸 / logo 浮动 / 实验条光晕 */
html[data-motion="spring"] .stat .dot-i { animation: dotPulse 2.8s ease-in-out infinite; }
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .35); }
  50% { box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0); }
}
html[data-motion="spring"] .brand .logo { animation: iconFloat 5.5s ease-in-out infinite; }
@keyframes iconFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
html[data-motion="spring"] .bar:hover { box-shadow: 0 10px 26px rgba(23, 35, 66, .16); }

/* 草稿提示条 */
.draft-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px; padding: 9px 12px; border-radius: 10px;
  background: rgba(var(--accent-rgb), .08);
  border: 1px solid rgba(var(--accent-rgb), .18);
  color: var(--text-2); font-size: 12.5px;
  animation: draftIn .34s var(--spring-soft) both;
}
.draft-hint .btn.tiny { padding: 4px 10px; }
@keyframes draftIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .topbar { padding: 10px 12px; }
  .top-actions .btn:not(.primary) { padding: 8px 10px; }
}

/* ================================================================ v3.10 顶栏柔化 + 模板折叠 + 草稿提示 + 缩放 */
/* 顶栏：更圆润、更透气 */
.topbar {
  padding: 12px 26px;
  gap: 18px;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 10px 26px rgba(23, 35, 66, .05);
}
.brand { gap: 11px; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 13px;
  background: linear-gradient(135deg, rgba(79, 107, 255, .18), rgba(79, 107, 255, .07));
  box-shadow: inset 0 0 0 1px rgba(79, 107, 255, .12);
}
.brand-text h1 { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.brand-text p { font-size: 11.5px; color: var(--muted); }
.top-actions { gap: 8px; }

/* 更宽才显示次要按钮文字，让顶栏更清爽 */
@media (max-width: 1720px) {
  .top-actions .btn:not(.primary) .btn-lbl { display: none; }
  .top-actions .btn:not(.primary) { padding: 9px 11px; }
}
@media (max-width: 1560px) {
  .top-actions .sync-badge { display: none; }
}
@media (max-width: 1280px) {
  .brand-text p { display: none; }
}

/* 顶栏「📝 草稿」徽标 */
.draft-chip {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 132px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  padding: 8px 11px; border-radius: 999px;
  border: 1px dashed rgba(var(--accent-rgb), .45);
  background: rgba(var(--accent-rgb), .07);
  color: var(--accent); font-size: 12px; font-weight: 600;
  transition: transform .18s var(--spring), background .18s;
}
.draft-chip:hover { transform: translateY(-1px); background: rgba(var(--accent-rgb), .13); }
.draft-chip:active { transform: scale(.96); }

/* 顶部草稿提示条 */
.draft-banner {
  position: fixed; left: 50%; top: 18px; transform: translate(-50%, -16px) scale(.96);
  z-index: 950; display: flex; align-items: center; gap: 10px;
  padding: 13px 20px; border-radius: 999px;
  background: var(--surface); color: var(--text);
  border: 1px solid rgba(var(--accent-rgb), .3);
  box-shadow: 0 14px 40px rgba(20, 32, 64, .18), 0 0 0 4px rgba(var(--accent-rgb), .06);
  font-size: 13.5px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .3s var(--spring);
}
.draft-banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.draft-banner-ico { font-size: 16px; }
@media (max-width: 720px) {
  .draft-banner { top: 10px; padding: 11px 14px; font-size: 12.5px; max-width: calc(100vw - 24px); }
}

/* 实验弹窗：草稿提示条更醒目 */
.draft-hint {
  padding: 12px 14px; margin-bottom: 16px;
  font-size: 13px; font-weight: 600; color: var(--text);
  gap: 12px;
}
.draft-hint::before { content: "📝"; font-size: 15px; }

/* 实验模板：默认收起，展开后单行横滑，弹窗不再被撑长 */
.tpl-bar { display: block; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tpl-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 13px; border: 0; background: var(--hover);
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  text-align: left;
}
.tpl-toggle:hover { background: var(--accent-soft); }
.tpl-toggle .tpl-label { color: var(--text); }
.tpl-toggle .tpl-count { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.tpl-toggle .tpl-chevron {
  margin-left: auto; color: var(--muted); font-size: 15px; line-height: 1;
  transition: transform .22s var(--spring);
}
.tpl-bar:not(.collapsed) .tpl-chevron { transform: rotate(90deg); }
.tpl-body { padding: 11px 12px 12px; border-top: 1px solid var(--line-soft); animation: tplIn .24s var(--spring-soft) both; }
@keyframes tplIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tpl-bar .tpl-list {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: thin;
}
.tpl-bar .tpl-chip { flex: 0 0 auto; }
.tpl-bar .tpl-tip { display: block; margin-top: 6px; }

/* 缩放反馈 */
#zoomLabel.pulse { animation: zoomPulse .34s var(--spring); }
@keyframes zoomPulse { 0% { transform: scale(1); } 45% { transform: scale(1.22); color: var(--accent); } 100% { transform: scale(1); } }

/* 用户菜单里的版本号 */
.menu-ver { margin: 8px 4px 2px; padding-top: 8px; border-top: 1px solid var(--line-soft); font-size: 10.5px; color: var(--muted); letter-spacing: .02em; text-align: center; }


/* v3.12 定位高亮 + 自定义模板 */
.bar.focus {
  outline: 3px solid rgba(var(--accent-rgb), .92);
  outline-offset: 2px;
  box-shadow: 0 0 0 7px rgba(var(--accent-rgb), .16), 0 16px 34px rgba(35, 50, 90, .28);
  z-index: 9;
  animation: focusPop .5s var(--spring);
}
@keyframes focusPop { 0% { transform: scale(.98); } 55% { transform: scale(1.05); } 100% { transform: none; } }
.tl-row.focus { background: rgba(var(--accent-rgb), .07); }
.tl-row.focus .tl-row-title, .tl-row.focus .tl-name { color: var(--accent); }
.tpl-chip.custom { border-style: dashed; }
.tpl-chip .tpl-del {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 2px; border-radius: 50%;
  font-size: 11px; line-height: 1; color: var(--muted);
  background: rgba(0, 0, 0, .05);
}
.tpl-chip .tpl-del:hover { background: rgba(239, 68, 68, .14); color: #d64545; }


/* v3.13 草稿卡片 + 顶栏精简 */
.dl-draft {
  display: flex; gap: 10px; align-items: center; margin: 2px 0 8px; padding: 10px 12px;
  border: 1.5px dashed rgba(var(--accent-rgb), .55); border-radius: 10px;
  background: rgba(var(--accent-rgb), .05); cursor: pointer;
  transition: background .16s, transform .16s var(--spring);
}
.dl-draft:hover { background: rgba(var(--accent-rgb), .1); transform: translateY(-1px); }
.dl-draft-ico { font-size: 16px; line-height: 1; }
.dl-draft-main b { display: block; font-size: 12.5px; }
.dl-draft-main span { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
@media (max-width: 1640px) { #btnAi, #btnMcp { display: none; } }


/* v3.14 特殊节点标识 + 实验报告 */
.ms-type.sample, .ms-type.booking, .ms-type.review, .ms-type.report { font-weight: 600; }
.ms-type.sample { background: rgba(14, 165, 233, .12); color: #0284c7; }
.ms-type.booking { background: rgba(139, 92, 246, .12); color: #7c3aed; }
.ms-type.review { background: rgba(245, 158, 11, .16); color: #b45309; }
.ms-type.report { background: rgba(16, 185, 129, .14); color: #047857; }
.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 12px; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.file-up { display: block; margin-top: 8px; }
.file-up input { display: none; }
.file-up span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px dashed rgba(var(--accent-rgb), .45); border-radius: 9px; color: var(--accent); font-size: 12px; cursor: pointer; transition: background .16s; }
.file-up span:hover { background: var(--accent-soft); }


/* v3.15 大文件 / AI 分析 / 顶部留白 */
.topbar { margin-bottom: 10px; }
.stats { margin-top: 6px; margin-bottom: 20px; }
.layout { padding-top: 2px; }
.file-ai-result { margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(var(--accent-rgb), .25); border-radius: 10px; background: rgba(var(--accent-rgb), .04); }
.file-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.file-ai-text { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 12.5px; line-height: 1.65; max-height: 320px; overflow: auto; }
.file-ai-loading { font-size: 12.5px; color: var(--muted); }
.file-ai-err { font-size: 12.5px; color: var(--danger); }
.feat-mail-current { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--hover); font-size: 12px; }
.feat-mail-current b { color: var(--accent); font-size: 12.5px; }
.feat-mail-current span { color: var(--text-2); line-height: 1.6; }
.feat-mail-current em { font-style: normal; color: var(--text); font-weight: 600; }
@media (max-width: 720px) { .topbar { margin-bottom: 8px; } }


/* v3.17 时间轴草稿虚线 + 弹窗动画 */
.tl-draft-row { position: relative; }
.tl-draft-row .draft-label .lbl-title { color: var(--accent); }
.tl-draft-row .draft-ico { font-size: 13px; }
.bar.draft { background: transparent; border: 1.6px dashed rgba(var(--accent-rgb), .75); color: var(--accent); box-shadow: none; }
.bar.draft .bar-text { color: var(--accent); font-weight: 600; }
.bar.draft:hover { background: rgba(var(--accent-rgb), .07); }
.modal { transition: opacity .2s ease, visibility .2s ease; }
.modal-card { transition: transform .26s var(--spring), opacity .2s ease; transform: translateY(12px) scale(.97); opacity: 0; }
.modal.open .modal-card { transform: none; opacity: 1; animation: modalPop .38s var(--spring) both; }
@keyframes modalPop { 0% { transform: translateY(14px) scale(.94); opacity: 0; } 60% { transform: translateY(-2px) scale(1.012); opacity: 1; } 100% { transform: none; opacity: 1; } }
html[data-motion="calm"] .modal.open .modal-card { animation: none !important; }


/* v3.18 多草稿 + 动态收敛 + 地点完整展示 */
.mini-link { margin-left: auto; border: 0; background: none; color: var(--accent); font-size: 11.5px; cursor: pointer; padding: 2px 4px; }
.mini-link:hover { text-decoration: underline; }
.activity-list { max-height: 168px; }
.lab-list { padding: 0 12px 14px; }
.lab-name { white-space: normal; word-break: break-word; line-height: 1.45; }
.lab-meta { flex-wrap: wrap; row-gap: 2px; }


/* v3.21 已完成/已确定的实验用实线，虚线只表示草稿 */
.bar.planned { border-style: solid; box-shadow: 0 3px 10px rgba(35, 50, 90, .14); }
.bar.planned::after { background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0)); }
/* 细刻度（时/分）视图里的草稿带 */
.tl-draft-strip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 12px; border-bottom: 1px dashed var(--line); background: rgba(var(--accent-rgb), .03); }
.tl-draft-strip .tl-draft-title { font-size: 11.5px; color: var(--accent); font-weight: 700; }
.tl-draft-pill { border: 1.5px dashed rgba(var(--accent-rgb), .7); color: var(--accent); border-radius: 999px; padding: 3px 10px; font-size: 11.5px; cursor: pointer; background: rgba(var(--accent-rgb), .05); }
.tl-draft-pill:hover { background: rgba(var(--accent-rgb), .12); }
.feat-ws-member[draggable="true"] { cursor: grab; }
.feat-ws-card.drop-hover { border-color: var(--accent); background: var(--accent-soft); }

/* v3.25 行拖拽 + 更 duang 的交互动效 */
.tl-row { transition: transform .2s var(--spring), background .18s, box-shadow .18s; }
.tl-row.row-dragging { transform: scale(1.01); background: rgba(var(--accent-rgb), .05); box-shadow: 0 12px 28px rgba(23, 35, 66, .12); z-index: 12; position: relative; cursor: grabbing; }
.tl-row.row-dragging .tl-label { cursor: grabbing; color: var(--accent); }
.tl-label { cursor: grab; }
@keyframes duangPop { 0% { transform: scale(1); } 35% { transform: scale(1.06, .94); } 65% { transform: scale(.97, 1.03); } 100% { transform: scale(1); } }
.btn:active, .ws-pill:active, .tpl-chip:active, .menu-item:active { animation: duangPop .32s var(--spring); }
html[data-motion="spring"] .card:hover { transform: translateY(-3px) scale(1.004); }
html[data-motion="spring"] .bar:hover { transform: translateY(-2px) scale(1.01); }
html[data-motion="spring"] .ws-pill:hover { animation: duangPop .45s var(--spring); }
.ws-pill.copy { border-style: dotted; background: rgba(139, 92, 246, .1); border-color: rgba(139, 92, 246, .35); }

/* v3.26 弹窗动效统一：打开/关闭同一条 spring 过渡 */
.modal { transition: opacity .22s ease, visibility .22s ease; }
.modal-card {
  opacity: 0;
  transform: translateY(14px) scale(.96);
  transition: transform .34s cubic-bezier(.2, 1.18, .32, 1), opacity .22s ease;
  will-change: transform, opacity;
}
.modal.open .modal-card { opacity: 1; transform: none; animation: none !important; }
html[data-motion="calm"] .modal-card { transition: none; }

/* v3.27 遮罩层 + 平移手感 */
.modal-backdrop { position: absolute; inset: 0; background: transparent; }
.modal-card { position: relative; z-index: 1; }
.tl-scroll.panning { cursor: grabbing; }
.tl-scroll { cursor: default; }
.tl-body .tl-track { cursor: crosshair; }
.tl-scroll.panning .tl-track { cursor: grabbing; }

/* v3.28 左侧实验名列不再被遮挡 */
.tl-label {
  position: relative;
  z-index: 3;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line-soft);
}
.tl-head .tl-corner { position: relative; z-index: 4; background: var(--surface); }
.tl-draft-row .tl-label.draft-label { background: var(--surface); }
.tl-body .tl-grid { z-index: 0; }
.tl-row { position: relative; }
.tl-row .tl-track { z-index: 1; }
/* 拖动排序时的抓取提示 */
.tl-label::after {
  content: "⋮⋮";
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 10px; letter-spacing: -1px; color: var(--line);
  opacity: 0; transition: opacity .15s;
}
.tl-row:hover .tl-label::after { opacity: 1; color: var(--muted); }

/* v3.29 左侧列不再压住前几天：固定宽度 + 裁剪 */
.tl-label { width: 244px; max-width: 244px; box-sizing: border-box; overflow: hidden; }
.tl-label .lbl-title, .tl-label .lbl-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-corner { width: 244px; max-width: 244px; box-sizing: border-box; overflow: hidden; }

/* ================= 竖屏适配体系（不是硬压桌面版） ================= */


/* v3.31 竖屏移动端外壳：底部导航 + 分栏切换 + 分组议程 */
.m-tabbar { display: none; }
.m-fab { display: none; }



/* v3.32 修复：左侧实验名列恢复 sticky（横滑时钉在左边，不再被滚走） */
.tl-label {
  position: sticky;
  left: 0;
  z-index: 8;
  flex: 0 0 244px;
  width: 244px;
  background: var(--surface);
  border-right: 1px solid var(--line-soft);
}
.tl-corner {
  position: sticky;
  left: 0;
  z-index: 22;
  flex: 0 0 244px;
  width: 244px;
  background: var(--surface);
}


/* v3.33 移动外壳只在登录后出现（登录页不要底部导航/悬浮按钮） */
.m-tabbar, .m-fab { display: none; }


/* v3.34 竖屏：让议程清单有高度、工具栏/顶栏收好 */



/* v3.35 portrait reading refinements */


/* v3.36 portrait UX quality pass */


/* v3.37 竖屏：时间跨度总览（替代四张统计卡） */


/* v3.39 手机端「一眼 + 轻编辑」 */

/* v3.40 修文字重叠（时间跨度轴 / 今天标签 / 色条文字） */


/* v3.42 三栏导航 + 跨度卡片视觉 */


/* v3.43 桌面框选更顺手 */
.tl-track { cursor: crosshair; }
body.dragging, body.dragging * { user-select: none; }
.range-ghost { background: rgba(var(--accent-rgb), .10) !important; border: 1.5px dashed rgba(var(--accent-rgb), .75) !important; border-radius: 8px !important; }
.range-ghost .rg-label { font-size: 11px; font-weight: 700; color: var(--accent); }
#dragTip { z-index: 999; }
/* v3.48 大时间跨度下框选新建：预览更顺、更清楚 */
.tl-track .range-ghost {
  position: absolute;
  top: 14px;
  height: 30px;
  min-width: 3px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), .22), rgba(var(--accent-rgb), .12));
  border: 1.5px dashed rgba(var(--accent-rgb), .85);
  box-shadow: 0 6px 18px rgba(79, 107, 255, .18);
  pointer-events: none;
  z-index: 6;
  transform-origin: left center;
  animation: rgIn .16s cubic-bezier(.2, 1.2, .35, 1);
  overflow: visible;
}
@keyframes rgIn { from { transform: scaleX(.6); opacity: .4; } to { transform: scaleX(1); opacity: 1; } }
.range-ghost .rg-label {
  position: absolute;
  top: -24px;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(79, 107, 255, .3);
  letter-spacing: .02em;
}
/* 框选时给整条轨道一个"可绘制"的底色，避免视觉上突兀 */
.tl-track.range-active { background: rgba(var(--accent-rgb), .03); }
body.dragging .tl-track.range-active { background: rgba(var(--accent-rgb), .05); }
/* 新建实验那一行：大跨度下也有清晰的可拖拽提示 */
.create-row .tl-track::after {
  content: "按住拖拽选择实验周期";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s;
}
.create-row .tl-track:hover::after { opacity: 1; }
/* 拖拽结束时避免高度跳变 */
.tl-track { transition: background .16s; }

/* v3.53 左侧卡牌排序：插入位置指示更明确 */
.tl-label { cursor: grab; }
.tl-row.row-dragging { opacity: .92; box-shadow: 0 14px 32px rgba(23, 35, 66, .16); z-index: 20; }
.tl-row.drop-before::before,
.tl-row.drop-after::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .25);
  z-index: 30;
}
.tl-row.drop-before::before { top: -1px; }
.tl-row.drop-after::after { bottom: -1px; }
.tl-label::before {
  content: "⋮⋮";
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  letter-spacing: -1px;
  color: var(--line);
  opacity: 0;
  transition: opacity .15s;
}
.tl-row:hover .tl-label::before { opacity: 1; color: var(--muted); }

/* v3.55 手机首页重排：实验在上、节点在下 */
@media (max-width: 720px) and (orientation: portrait) {
  .m-tabbar { display: none !important; }
  .app { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .m-top { padding: 14px 14px 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
  .m-top-date { font-size: 12px; color: var(--muted); }
  .m-top-sub { margin-top: 4px; font-size: 17px; font-weight: 750; color: var(--text); }
  .m-scope { display: flex; gap: 6px; margin-top: 12px; background: var(--line-soft); padding: 4px; border-radius: 12px; }
  .m-scope button { flex: 1; border: 0; background: transparent; color: var(--text-2); font-size: 12.5px; padding: 8px 0; border-radius: 9px; }
  .m-scope button.on { background: var(--surface); color: var(--accent); font-weight: 700; box-shadow: 0 2px 8px rgba(23,35,66,.08); }
  .m-card-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
  .m-meta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--text-2); }
  .m-meta i { font-style: normal; font-size: 11px; }
  .m-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }
  .m-dates { font-size: 11px; color: var(--muted); }
  .m-prog { font-size: 10.5px; color: var(--accent); }
  .m-card-bar { height: 4px; margin-top: 7px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
  .m-card-bar span { display: block; height: 100%; border-radius: 999px; transition: width .3s var(--soft); }
  .m-sec-head { display: flex; align-items: baseline; gap: 8px; margin: 16px 2px 6px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
  .m-sec-head span { font-size: 11px; color: var(--muted); font-weight: 400; }
  .m-nodes { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; gap: 6px; }
  .m-node { background: transparent; color: var(--text); padding: 9px 8px; }
  .m-node.overdue { background: rgba(214, 69, 69, .06); }
  .m-node-check { border-color: var(--line); }
  .m-node-main b { color: var(--text); font-size: 13.5px; }
  .m-node-main span { color: var(--muted); opacity: 1; }
  .m-node-when { color: var(--muted); }
  .m-nodes-more { color: var(--accent); }
  .m-span-slim { margin: 16px 0 0; }
  .m-span-slim .m-span-lane { height: 18px; margin-top: 4px; }
  .m-span-slim .m-span-bar { height: 18px; }
}
