/* =========================================================
   项目进度 —— 全局样式
   设计原则：只用黑、白、灰；细边框；充足留白；克制的圆角。
   ========================================================= */

:root {
  --bg: #f3f3f4;
  --bg-soft: #f7f7f8;
  --bg-sunken: #f7f7f8;
  --surface: #ffffff;
  --ink: #0b0b0c;
  --ink-2: #3c3c3e;
  --muted: #8a8a8e;
  --muted-2: #a8a8ac;
  --line: #e9e9eb;
  --line-2: #d9d9dc;
  --line-3: #f0f0f2;
  --black: #0b0b0c;
  --white: #ffffff;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 10px 30px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.03), 0 10px 30px rgba(0, 0, 0, 0.04);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.03);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei",
    "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --print-zoom: 1;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

::selection {
  background: #111;
  color: #fff;
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(243, 243, 244, 0.82);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 0;
}

.topbar-inner {
  max-width: 1200px;
  height: 60px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: none;
}

.brand-mark svg {
  display: block;
}

.brand-name {
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* ---------------- 通用控件 ---------------- */

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.icon svg {
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.btn:hover {
  background: #fbfbfc;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.btn-primary:hover {
  background: #000;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
}

.btn-ghost:hover {
  background: #fbfbfc;
}

.btn-danger {
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--ink);
}

.btn-danger:hover {
  background: #fafafa;
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.btn .icon {
  margin: 0 -2px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  white-space: nowrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: #f0f0f2;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.chip-overdue,
.chip-done {
  background: var(--ink);
  color: #fff;
}

.chip-in_progress {
  background: #ececee;
  color: var(--ink);
  font-weight: 600;
}

.chip-not_started {
  background: #f4f4f5;
  color: var(--muted);
}

.chip-longterm {
  background: #e8e8eb;
  color: var(--ink);
}

.progress-track {
  position: relative;
  flex: 1;
  min-width: 80px;
  height: 8px;
  border-radius: 999px;
  background: #efeff1;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
  transition: width 0.3s ease;
}

/* ---------------- 布局 ---------------- */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.page-title {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.page-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-head-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.page-foot-time {
  white-space: nowrap;
}

/* ---------------- 演示横幅 ---------------- */

#demoBanner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px 0;
}

.demo-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--ink-2);
  font-size: 12.5px;
}

.demo-banner-text {
  flex: 1;
  min-width: 0;
}

.demo-reset {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  cursor: pointer;
}

/* ---------------- 连接状态 ---------------- */

.conn-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.conn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  flex: none;
}

.conn-chip.is-connected .conn-dot {
  background: var(--ink);
}

.conn-chip.is-polling .conn-dot,
.conn-chip.is-reconnecting .conn-dot {
  background: var(--muted-2);
  animation: conn-pulse 1.4s ease-in-out infinite;
}

.conn-chip.is-error .conn-dot {
  background: var(--ink);
}

.conn-chip.is-local .conn-dot {
  background: #c4c4c4;
}

@keyframes conn-pulse {
  50% {
    opacity: 0.3;
  }
}

/* ---------------- 加载与错误 ---------------- */

.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 72px 0;
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-2);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.fatal-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 560px;
  margin: 48px auto;
}

.page-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 34px 24px;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.page-error-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
  border: 0;
  border-radius: 50%;
  background: #f4f4f5;
  color: var(--ink-2);
}

.page-error-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.page-error-desc {
  max-width: 420px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
}

/* ---------------- 空状态 ---------------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 56px 24px;
  border: 1px dashed var(--line-2);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: 4px;
  border: 0;
  border-radius: 50%;
  background: #f4f4f5;
  color: var(--ink-2);
}

.empty-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.empty-desc {
  max-width: 440px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* ---------------- 首页总览数字 ---------------- */

.home-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.home-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 18px 14px 16px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.home-stat-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.home-stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.home-stat-sub {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-stat.is-alert .home-stat-value {
  font-weight: 800;
}

/* ---------------- 首页项目时间轴 ---------------- */

.home-timeline {
  margin-bottom: 20px;
  padding: 20px 22px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.ht-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ht-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ht-sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.ht-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  padding-top: 2px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.ht-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ht-legend-line {
  display: inline-block;
  width: 14px;
  height: 0;
  border-top: 1px dashed #b9b9be;
}

.ht-legend-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid #9a9a9e;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}

.ht-chart {
  --ht-name: 132px;
  position: relative;
  margin-top: 4px;
}

.ht-rows {
  position: relative;
  padding-top: 18px;
}

.ht-row {
  display: grid;
  grid-template-columns: var(--ht-name) minmax(0, 1fr);
  align-items: center;
  height: 40px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}

.ht-row:hover {
  background: #fafafb;
}

.ht-name {
  min-width: 0;
  padding-right: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
}

.ht-row:hover .ht-name {
  color: var(--ink);
}

.ht-track {
  position: relative;
  height: 22px;
}

.ht-bar {
  position: absolute;
  top: 50%;
  z-index: 2;
  height: 22px;
  min-width: 6px;
  border-radius: 6px;
  transform: translateY(-50%);
}

.ht-bar.is-in_progress {
  background: #efeff1;
}

.ht-bar.is-not_started {
  border: 1px dashed #c9c9ce;
  background: #fff;
}

.ht-bar.is-done {
  background: #111;
}

.ht-bar.is-overdue::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(45deg, rgba(17, 17, 17, 0.42) 0 1px, transparent 1px 6px);
  pointer-events: none;
}

.ht-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 5px 0 0 5px;
  background: #111;
}

.ht-open {
  position: absolute;
  top: 50%;
  right: -8px;
  width: 0;
  height: 0;
  border-left: 6px solid #8a8a8e;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transform: translateY(-50%);
  pointer-events: none;
}

.ht-bar.is-done .ht-open {
  border-left-color: #111;
}

.ht-row:hover .ht-bar {
  outline: 1.5px solid #111;
  outline-offset: 2px;
}

.ht-today {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 0;
  border-left: 1px dashed #b9b9be;
  pointer-events: none;
}

.ht-today-label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  transform: translateX(-50%);
}

.ht-axis {
  position: relative;
  height: 22px;
  margin-top: 2px;
}

.ht-tick {
  position: absolute;
  top: 3px;
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.ht-note {
  margin: 8px 0 2px;
  color: var(--muted);
  font-size: 11px;
}

/* ---------------- 首页项目列表 ---------------- */

.project-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-card {
  position: relative;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 18px 44px rgba(0, 0, 0, 0.07);
}

.project-card-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: center;
  gap: 28px;
  padding: 22px 58px 22px 22px;
  border-radius: 22px;
  text-decoration: none;
}

.pc-main {
  min-width: 0;
}

.pc-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pc-name {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.pc-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.deadline-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: #f0f0f2;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.deadline-badge.is-soon,
.deadline-badge.is-today,
.deadline-badge.is-overdue {
  background: var(--ink);
  color: #fff;
}

.deadline-badge.is-done {
  background: #f4f4f5;
  color: var(--muted);
  font-weight: 500;
}

.deadline-badge.is-none {
  border: 1px dashed var(--line-2);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

.deadline-badge.is-ongoing {
  background: #e8e8eb;
  color: var(--ink);
  font-weight: 600;
}

.pc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.pc-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pc-meta-alert {
  color: var(--ink);
  font-weight: 600;
}

.pc-progress {
  min-width: 0;
}

.pc-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.pc-progress-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.pc-percent {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pc-status {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11.5px;
}

.pc-settings {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  color: var(--muted);
}

/* ---------------- 项目页头部 ---------------- */

.project-head {
  margin-bottom: 20px;
}

.project-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 24px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-heading {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-title {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.project-desc {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* 项目截止日期：页面上的重点信息 */
.deadline-card {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 4px;
  width: 240px;
  padding: 20px;
  border: 0;
  border-radius: 18px;
  background: var(--bg-sunken);
  box-shadow: none;
}

.deadline-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.deadline-date {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.deadline-sub {
  color: var(--muted);
  font-size: 11px;
}

.deadline-meta {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  height: 24px;
  margin-top: 8px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.deadline-card.is-soon .deadline-meta {
  background: var(--ink);
  color: #fff;
}

.deadline-card.is-today,
.deadline-card.is-overdue {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.deadline-card.is-today .deadline-label,
.deadline-card.is-today .deadline-sub,
.deadline-card.is-overdue .deadline-label,
.deadline-card.is-overdue .deadline-sub {
  color: rgba(255, 255, 255, 0.65);
}

.deadline-card.is-today .deadline-meta,
.deadline-card.is-overdue .deadline-meta {
  background: #fff;
  color: var(--ink);
}

.deadline-card.is-done {
  background: var(--bg-sunken);
}

.deadline-card.is-done .deadline-label {
  color: var(--muted);
  font-weight: 500;
}

.deadline-card.is-done .deadline-date {
  color: var(--ink-2);
}

.deadline-card.is-done .deadline-meta {
  background: #f1f1f3;
  color: var(--muted);
}

.deadline-card.is-none {
  border: 1px dashed var(--line-2);
  background: transparent;
  box-shadow: none;
}

.deadline-card.is-none .deadline-label {
  color: var(--muted);
  font-weight: 500;
}

.deadline-card.is-none .deadline-date {
  color: var(--muted);
  font-size: 20px;
}

.deadline-card.is-none .deadline-meta {
  height: auto;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 0.8fr 1.5fr 0.95fr;
  grid-auto-flow: dense;
  gap: 12px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 18px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.stat-value {
  overflow: hidden;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.stat-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.stat.is-alert .stat-value {
  font-weight: 800;
}

.stat-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-progress-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding: 2px 0 18px;
  border-top: 0;
}

/* ---------------- 时间线区域 ---------------- */

.chart-section {
  margin-top: 4px;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.chart-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.chart-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.chart-count {
  color: var(--muted);
  font-size: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 11.5px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  display: inline-block;
  width: 20px;
  height: 10px;
  border-radius: 3px;
}

.legend-swatch.is-done {
  background: #111;
}

.legend-swatch.is-progress {
  border: 1px solid #cfcfcf;
  background: linear-gradient(90deg, #111 0 50%, #ededed 50% 100%);
}

.legend-swatch.is-todo {
  border: 1px dashed #9a9a9a;
  background: #fff;
}

.legend-swatch.is-overdue {
  border: 1px solid #cfcfcf;
  background: repeating-linear-gradient(45deg, #111 0 1px, transparent 1px 5px), #fff;
}

.legend-swatch.is-today {
  width: 0;
  height: 12px;
  border-left: 1px dashed #111;
  border-radius: 0;
}

.legend-swatch.is-longterm {
  position: relative;
  background: linear-gradient(90deg, #111 0 55%, #efeff1 55% 100%);
  border-radius: 3px 0 0 3px;
}

.legend-swatch.is-longterm::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -4px;
  transform: translateY(-50%);
  border-left: 4px solid #111;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  opacity: 0.45;
}

/* ---------------- 甘特图 ---------------- */

.gantt-wrap {
  min-width: 0;
}

.gantt {
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.gantt-note {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-3);
  background: var(--bg-sunken);
  color: var(--muted);
  font-size: 12px;
}

.gantt-scroll {
  max-height: calc(100vh - 280px);
  max-height: calc(100dvh - 280px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.gantt-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.gantt-scroll::-webkit-scrollbar-thumb {
  border: 2px solid #fff;
  border-radius: 999px;
  background: #d6d6d6;
}

.gantt-scroll::-webkit-scrollbar-thumb:hover {
  background: #bdbdbd;
}

.gantt-canvas {
  position: relative;
  width: max-content;
  min-width: 100%;
}

.gantt-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  border-bottom: 1px solid var(--line-3);
  background: var(--bg-sunken);
}

.gantt-corner {
  position: sticky;
  left: 0;
  z-index: 6;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 16px;
  border-right: 1px solid var(--line-3);
  background: var(--bg-sunken);
}

.gantt-corner-title {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.gantt-corner-count {
  color: var(--muted);
  font-size: 11px;
}

.gantt-axis {
  position: relative;
  flex: none;
  background: var(--bg-sunken);
}

.gantt-month {
  position: absolute;
  top: 0;
  overflow: hidden;
  padding: 4px 8px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gantt-tick {
  position: absolute;
  border-left: 1px solid var(--line-3);
}

.gantt-tick.is-weekend {
  background: rgba(0, 0, 0, 0.018);
}

.gantt-tick.is-month {
  border-left-color: var(--line-2);
}

.gantt-tick.is-week {
  border-left-color: var(--line-3);
}

.gantt-tick-label {
  position: absolute;
  top: 5px;
  left: 5px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.gantt-tick.is-weekend .gantt-tick-label {
  color: var(--muted-2);
}

.gantt-today-chip {
  position: absolute;
  z-index: 7;
  transform: translateX(-50%);
  padding: 3px 5px;
  border-radius: 4px;
  background: #111;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.gantt-main {
  display: flex;
}

.gantt-left {
  position: sticky;
  left: 0;
  z-index: 4;
  flex: none;
  border-right: 1px solid var(--line-3);
  background: var(--surface);
}

.gantt-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line-3);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.gantt-name:hover {
  background: #fafafb;
}

.gantt-name-title {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gantt-name-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.gantt-name-meta-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gantt-name .chip {
  height: 16px;
  padding: 0 5px;
  font-size: 9.5px;
}

.gantt-plot {
  position: relative;
  flex: none;
  background: #fff;
}

.gantt-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.gantt-weekend {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.018);
}

.gantt-row-line {
  position: absolute;
  right: 0;
  left: 0;
  border-top: 1px solid var(--line-3);
}

.gantt-month-line {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--line);
}

.gantt-deps {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
}

.gantt-dep {
  fill: none;
  stroke: #6b6b70;
  stroke-width: 1.2;
}

.gantt-dep.is-backward {
  stroke: #8e8e93;
  stroke-dasharray: 4 3;
}

.gantt-dep-head {
  fill: #6b6b70;
}

.gantt-dep-head.is-backward {
  fill: #8e8e93;
}

.gantt-dep-dot {
  fill: #6b6b70;
}

.gantt-bar {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  height: 26px;
  padding: 0;
  border-radius: 7px;
  overflow: visible;
  font-size: 11px;
  cursor: pointer;
}

.gantt-bar.is-in_progress {
  border: 0;
  background: #f0f0f2;
}

.gantt-bar.is-done {
  border: 0;
  background: #111;
}

.gantt-bar.is-not_started {
  border: 1px dashed #c9c9ce;
  background: #fff;
}

.gantt-bar.is-invalid {
  border-color: #111;
}

.gantt-bar:hover {
  outline: 1.5px solid #111;
  outline-offset: 2px;
}

.gantt-bar.is-overdue::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: repeating-linear-gradient(45deg, rgba(17, 17, 17, 0.42) 0 1px, transparent 1px 6px);
  pointer-events: none;
}

.gantt-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 6px 0 0 6px;
  background: #111;
}

.gantt-bar-pct {
  position: absolute;
  top: 50%;
  right: 6px;
  z-index: 2;
  transform: translateY(-50%);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

.gantt-bar-pct.is-outside {
  right: auto;
  color: var(--muted);
  font-weight: 500;
}

.gantt-bar-open {
  position: absolute;
  top: 50%;
  right: -9px;
  width: 0;
  height: 0;
  transform: translateY(-50%);
  border-left: 6px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  opacity: 0.45;
  pointer-events: none;
}

.gantt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  border-left: 1.5px dashed #111;
  opacity: 0.45;
  pointer-events: none;
}

.gantt-canvas.is-focus .gantt-bar {
  opacity: 0.35;
}

.gantt-canvas.is-focus .gantt-bar.is-hi {
  opacity: 1;
}

.gantt-canvas.is-focus .gantt-name {
  opacity: 0.45;
}

.gantt-canvas.is-focus .gantt-name.is-hi {
  opacity: 1;
}

.gantt-canvas.is-focus .gantt-dep,
.gantt-canvas.is-focus .gantt-dep-head,
.gantt-canvas.is-focus .gantt-dep-dot {
  opacity: 0.14;
}

.gantt-canvas.is-focus .gantt-dep.is-hi,
.gantt-canvas.is-focus .gantt-dep-head.is-hi,
.gantt-canvas.is-focus .gantt-dep-dot.is-hi {
  opacity: 1;
}

.gantt-dep.is-hi {
  stroke: #111;
  stroke-width: 1.6;
}

.gantt-dep-head.is-hi {
  fill: #111;
}

.gantt-dep-dot.is-hi {
  fill: #111;
}

/* ---------------- 手机时间线 ---------------- */

.mobile-timeline {
  display: none;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tl-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  padding: 18px;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tl-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 16px 38px rgba(0, 0, 0, 0.06);
}

.tl-card.is-overdue {
  border-left: 3px solid #111;
  padding-left: 15px;
}

.tl-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tl-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.tl-chips {
  display: flex;
  flex: none;
  gap: 6px;
}

.tl-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.tl-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tl-progress-track {
  display: block;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #efeff1;
  overflow: hidden;
}

.tl-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
}

.tl-progress-text {
  width: 36px;
  color: var(--ink-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.tl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: var(--muted);
  font-size: 11.5px;
}

.tl-note {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding-top: 0;
  border-top: 0;
  color: var(--muted);
  font-size: 12px;
}

/* ---------------- 抽屉 ---------------- */

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.drawer-scrim.is-show {
  opacity: 1;
}

.drawer {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(410px, 100%);
  height: 100%;
  border-left: 0;
  background: var(--surface);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.12);
  opacity: 0.6;
  transform: translateX(24px);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.drawer-scrim.is-show .drawer {
  opacity: 1;
  transform: none;
}

.drawer-head {
  display: flex;
  flex: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 22px 10px;
  border-bottom: 0;
}

.drawer-heading {
  min-width: 0;
}

.drawer-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.drawer-subtitle {
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.drawer-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  overflow: auto;
  padding: 10px 22px 24px;
}

.drawer-foot {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 0;
  background: var(--surface);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.03);
}

.drawer-foot .btn {
  height: 40px;
}

/* ---------------- 表单 ---------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.field-hint {
  color: var(--muted);
  font-size: 11px;
}

.longterm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.longterm-check {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.longterm-track {
  position: relative;
  flex: none;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: #e5e5e8;
  transition: background 0.18s ease;
}

.longterm-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease;
}

.longterm-check:checked + .longterm-track {
  background: var(--ink);
}

.longterm-check:checked + .longterm-track::after {
  transform: translateX(14px);
}

.longterm-check:focus-visible + .longterm-track {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.longterm-text {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.longterm-check:checked ~ .longterm-text {
  color: var(--ink);
}

.longterm-box {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #f4f4f5;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-error {
  margin: 0;
  min-height: 0;
  color: var(--ink);
  font-size: 11.5px;
}

.field-error:empty {
  display: none;
}

.input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #f4f4f5;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
}

.input::placeholder {
  color: var(--muted-2);
}

.input:focus {
  border-color: var(--ink);
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.06);
}

.textarea {
  min-height: 84px;
  resize: vertical;
}

.progress-range {
  width: 100%;
  height: 22px;
  accent-color: #111;
}

.progress-out {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: #f1f1f3;
}

.segmented-btn {
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.segmented-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.segmented-btn.is-active {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

/* ---------------- 依赖选择 ---------------- */

.dep-search {
  margin-bottom: 2px;
}

.dep-list {
  max-height: 200px;
  overflow: auto;
  border: 0;
  border-radius: 14px;
  background: var(--bg-sunken);
}

.dep-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.dep-row:last-child {
  border-bottom: 0;
}

.dep-row:hover {
  background: var(--surface);
}

.dep-row.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dep-check {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: #111;
}

.dep-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dep-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dep-meta {
  color: var(--muted);
  font-size: 11px;
}

.dep-warn {
  margin-left: auto;
  padding: 1px 4px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  color: var(--ink);
  font-size: 10px;
  white-space: nowrap;
}

.dep-empty {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.drawer-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: #f4f4f5;
  color: var(--ink-2);
  font-size: 12px;
}

.save-state {
  margin-left: auto;
  padding: 4px 6px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  cursor: default;
}

.save-state[disabled] {
  opacity: 1;
}

.save-state.is-error {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.save-state.is-saved,
.save-state.is-saving {
  color: var(--muted);
}

.save-state.is-invalid {
  color: var(--ink);
}

.save-state.is-hint {
  margin-left: auto;
  text-decoration: none;
}

/* ---------------- 修改历史 ---------------- */

.history-drawer .drawer-body {
  padding-top: 8px;
}

.history-note {
  flex: none;
  margin: 0 22px 4px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--bg-sunken);
  color: var(--muted);
  font-size: 11.5px;
}

.history-body {
  padding-top: 10px !important;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.history-group-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.history-row {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-3);
  font-size: 12.5px;
}

.history-row:last-child {
  border-bottom: 0;
}

.history-time {
  flex: none;
  width: 38px;
  padding-top: 1px;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.history-summary {
  min-width: 0;
  color: var(--ink-2);
  line-height: 1.6;
}

.history-foot {
  display: flex;
  flex: none;
  justify-content: center;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 0;
}

.history-loading {
  padding: 20px 0;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 40px 12px;
  color: var(--muted);
  text-align: center;
}

/* ---------------- 弹窗 ---------------- */

.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.24);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.modal-scrim.is-show {
  opacity: 1;
}

.modal-card {
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
  transform: translateY(8px);
  transition: transform 0.16s ease;
}

.modal-scrim.is-show .modal-card {
  transform: none;
}

.modal-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 8px;
  border-bottom: 0;
}

.modal-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-body {
  overflow: auto;
  padding: 8px 22px 20px;
}

.modal-message {
  margin: 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-line;
}

.modal-actions {
  display: flex;
  flex: none;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 22px calc(18px + env(safe-area-inset-bottom));
  border-top: 0;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-danger {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line-3);
}

.modal-danger-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
}

.modal-danger-desc {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* ---------------- 提示条 ---------------- */

#toastRoot {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 560px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
  cursor: pointer;
}

.toast.is-show {
  opacity: 1;
  transform: none;
}

.toast .icon {
  margin-top: 1px;
}

.toast-text {
  min-width: 0;
}

/* ---------------- 帮助页 ---------------- */

.help-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 36px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.help-title {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.help-sub {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
}

.help-section {
  padding: 20px 0;
  border-top: 1px solid var(--line-3);
}

.help-section h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.help-section p,
.help-section li {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.75;
}

.help-section ul,
.help-section ol {
  margin: 8px 0;
  padding-left: 20px;
}

.help-section li {
  margin: 4px 0;
}

.help-note {
  margin: 12px 0;
  padding: 12px 14px;
  border: 0;
  border-left: 3px solid #111;
  border-radius: 0 14px 14px 0;
  background: var(--bg-sunken);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.7;
}

.help-kbd {
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fff;
  font-family: var(--mono);
  font-size: 12px;
}

/* ---------------- 打印 ---------------- */

.print-header {
  display: none;
}

.print-deadline {
  margin: 5px 0 0;
  font-size: 12px;
  font-weight: 700;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  html,
  body {
    background: #fff !important;
  }

  .topbar,
  #demoBanner,
  .toolbar,
  .page-foot,
  .drawer-scrim,
  .modal-scrim,
  #toastRoot,
  .mobile-timeline,
  .chart-count,
  .empty-state .btn {
    display: none !important;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .project-head {
    margin-bottom: 8px;
  }

  .project-head-top {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 0;
    background: #fff;
  }

  .stat {
    padding: 8px 10px;
    border-right: 1px solid #eee;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .stat:last-child {
    border-right: 0;
  }

  .stat-label,
  .stat-sub {
    font-size: 8px;
  }

  .stat-value,
  .stat-progress-value {
    font-size: 11px;
  }

  .print-header {
    display: block !important;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
  }

  .print-brand {
    margin: 0 0 4px;
    color: #666;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .print-title {
    margin: 0;
    font-size: 20px;
  }

  .print-desc {
    margin: 4px 0 0;
    color: #555;
    font-size: 10px;
  }

  .print-meta {
    margin: 6px 0 0;
    color: #555;
    font-size: 9px;
  }

  .gantt-wrap {
    display: block !important;
  }

  .gantt {
    overflow: visible;
    border: 1px solid #ccc;
    border-radius: 0;
    box-shadow: none;
  }

  .gantt-scroll {
    max-height: none !important;
    overflow: visible !important;
  }

  .gantt-canvas {
    zoom: var(--print-zoom, 1);
  }

  .gantt-head {
    position: static !important;
  }

  .gantt-corner,
  .gantt-left {
    position: static !important;
  }

  .gantt-name,
  .gantt-bar {
    cursor: default;
  }

  .gantt-bar,
  .gantt-bar-fill,
  .gantt-bar.is-overdue::after,
  .gantt-weekend,
  .gantt-today-chip,
  .gantt-today,
  .chip,
  .progress-fill,
  .legend-swatch {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .legend {
    display: flex !important;
    margin: 8px 0 4px;
  }

  .chart-head {
    margin-bottom: 6px;
  }

  .chart-title {
    font-size: 12px;
  }

  .chart-section,
  .chart-head,
  .project-head,
  .page-foot {
    box-shadow: none;
  }

  a {
    text-decoration: none;
  }
}

/* ---------------- 响应式 ---------------- */

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

  .stat-progress {
    grid-column: span 2;
  }

  .project-card-link {
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 18px;
  }
}

@media (max-width: 719px) {
  .container {
    padding: 20px 16px 56px;
  }

  .topbar-inner {
    height: 54px;
    padding: 0 12px;
    gap: 8px;
  }

  #demoBanner {
    padding: 10px 16px 0;
  }

  .demo-banner {
    align-items: flex-start;
    font-size: 12px;
    border-radius: 14px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
  }

  .page-head-side {
    display: none;
  }

  .page-title {
    font-size: 26px;
  }

  .home-stats {
    gap: 8px;
    margin-bottom: 16px;
  }

  .home-stat {
    padding: 14px 12px 12px;
    border-radius: 16px;
  }

  .home-stat-label {
    font-size: 10.5px;
  }

  .home-stat-value {
    font-size: 24px;
  }

  .home-stat-sub {
    font-size: 9.5px;
  }

  .home-timeline {
    margin-bottom: 16px;
    padding: 16px 14px 8px;
    border-radius: 18px;
  }

  .ht-chart {
    --ht-name: 88px;
  }

  .ht-title {
    font-size: 14px;
  }

  .ht-sub,
  .ht-legend {
    display: none;
  }

  .ht-rows {
    padding-top: 16px;
  }

  .ht-row {
    height: 36px;
  }

  .ht-name {
    padding-right: 8px;
    font-size: 11.5px;
  }

  .ht-track {
    height: 18px;
  }

  .ht-bar {
    height: 18px;
  }

  .ht-tick {
    font-size: 9px;
  }

  .project-title {
    font-size: 28px;
  }

  .project-desc {
    font-size: 13px;
  }

  .project-head-top {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
    padding: 18px;
    border-radius: 22px;
  }

  .deadline-card {
    width: 100%;
    padding: 18px;
    border-radius: 16px;
    gap: 3px;
  }

  .deadline-date {
    font-size: 30px;
  }

  .deadline-card.is-none {
    border-radius: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-progress {
    grid-column: span 2;
  }

  .stat {
    padding: 14px;
    border-radius: 18px;
  }

  .stat-value {
    font-size: 18px;
  }

  .stat-progress-value {
    font-size: 20px;
  }

  .stat-sub {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    line-height: 1.5;
  }

  .toolbar {
    gap: 6px;
  }

  .toolbar .btn {
    height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }

  .toolbar .btn-primary {
    flex: 1 1 100%;
    justify-content: center;
    order: -1;
  }

  .chart-head {
    align-items: flex-start;
  }

  .chart-title {
    font-size: 18px;
  }

  .legend {
    display: none;
  }

  .project-card {
    border-radius: 20px;
  }

  .project-card-link {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px 48px 18px 18px;
    border-radius: 20px;
  }

  .pc-name {
    font-size: 17px;
  }

  .pc-percent {
    font-size: 22px;
  }

  .pc-settings {
    top: 10px;
    right: 10px;
  }

  .pc-meta {
    gap: 6px 12px;
  }

  .gantt-wrap {
    display: none;
  }

  .mobile-timeline {
    display: block;
  }

  .input {
    font-size: 16px;
  }

  .drawer-scrim {
    align-items: flex-end;
    justify-content: center;
  }

  .drawer {
    width: 100%;
    height: auto;
    max-height: 88vh;
    max-height: 88dvh;
    border-top: 0;
    border-left: 0;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.16);
    transform: translateY(28px);
  }

  .drawer::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: #d8d8dc;
    transform: translateX(-50%);
  }

  .drawer-head {
    padding: 24px 18px 8px;
  }

  .drawer-body {
    padding: 8px 18px 18px;
  }

  .drawer-foot {
    padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
  }

  .drawer-foot .btn {
    padding: 0 12px;
  }

  .modal-scrim {
    padding: 12px;
  }

  .modal-card {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 22px;
  }

  .history-note {
    margin: 0 18px 4px;
    padding: 8px 10px;
  }

  .conn-chip {
    padding: 0 9px;
    gap: 5px;
  }

  .brand-name {
    max-width: 30vw;
  }

  .help-page {
    padding: 22px 20px;
    border-radius: 20px;
  }

  .help-title {
    font-size: 24px;
  }
}

@media (max-width: 420px) {
  .topbar-actions .btn-ghost {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
