/*!
 * 此刻 · styles.css
 * 纸感底色 + 墨色文字 + 一点青绿。深浅色自动跟随。
 */

:root {
  color-scheme: light;
  --font-sans: "MiSans", "HarmonyOS Sans SC", "HarmonyOS Sans", "PingFang SC",
    "Microsoft YaHei UI", "Source Han Sans SC", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", "Cascadia Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #16181c;
  --ink-2: #585e67;
  --ink-3: #8c929b;
  --line: rgba(22, 24, 28, 0.085);
  --line-strong: rgba(22, 24, 28, 0.17);
  --accent: #1e7a67;
  --accent-ink: #ffffff;
  --accent-soft: #e7f2ee;
  --warn: #a9560b;
  --warn-soft: #fbf1e3;
  --danger: #b42318;
  --danger-soft: #fbedeb;
  --shadow-sm: 0 1px 2px rgba(20, 22, 26, 0.03), 0 10px 30px -18px rgba(20, 22, 26, 0.22);
  --shadow-lg: 0 30px 80px -30px rgba(20, 22, 26, 0.35);
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

html[data-theme="dark"] {
  --bg: #0c0e10;
  --surface: #141719;
  --surface-2: #191d20;
  --ink: #f2f1ed;
  --ink-2: #a7adb5;
  --ink-3: #767d86;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.17);
  --accent: #5cd2b4;
  --accent-ink: #06231c;
  --accent-soft: rgba(92, 210, 180, 0.13);
  --warn: #f0b26a;
  --warn-soft: rgba(240, 178, 106, 0.13);
  --danger: #f08a7e;
  --danger-soft: rgba(240, 138, 126, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -24px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #0c0e10;
    --surface: #141719;
    --surface-2: #191d20;
    --ink: #f2f1ed;
    --ink-2: #a7adb5;
    --ink-3: #767d86;
    --line: rgba(255, 255, 255, 0.075);
    --line-strong: rgba(255, 255, 255, 0.17);
    --accent: #5cd2b4;
    --accent-ink: #06231c;
    --accent-soft: rgba(92, 210, 180, 0.13);
    --warn: #f0b26a;
    --warn-soft: rgba(240, 178, 106, 0.13);
    --danger: #f08a7e;
    --danger-soft: rgba(240, 138, 126, 0.12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -24px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 440px at 50% -10%, var(--accent-soft) 0%, transparent 62%),
    var(--bg);
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ic {
  width: 20px;
  height: 20px;
  flex: none;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#i-more circle {
  fill: currentColor;
  stroke: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ */
/* 外框                                                                */
/* ------------------------------------------------------------------ */

.app {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px clamp(16px, 4.2vw, 34px) calc(112px + var(--safe-b));
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.logo {
  width: 39px;
  height: 39px;
  flex: none;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.logo svg {
  width: 25px;
  height: 25px;
}

.brand-text h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.2;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.08s;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.icon-btn:active {
  transform: scale(0.96);
}

.layout {
  display: block;
}

.stage:empty {
  display: none;
}

/* ------------------------------------------------------------------ */
/* 主卡片                                                              */
/* ------------------------------------------------------------------ */

.hero {
  position: relative;
  padding: 20px 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: rise 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 190px;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 0%, var(--accent-soft) 0%, transparent 70%);
  opacity: 0.9;
}

.hero.is-overtime::before {
  background: radial-gradient(120% 100% at 50% 0%, var(--warn-soft) 0%, transparent 70%);
}

.hero.is-waiting::before {
  background: radial-gradient(120% 100% at 50% 0%, var(--surface-2) 0%, transparent 70%);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.hero.is-overtime .pill {
  background: var(--warn-soft);
  color: var(--warn);
}

.hero.is-waiting .pill {
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.hero.is-done .pill {
  background: var(--accent-soft);
  color: var(--accent);
}

.time-range {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hero-title {
  margin: 15px 0 0;
  font-size: clamp(25px, 6.2vw, 33px);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.015em;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.hero-sub {
  margin: 7px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
  letter-spacing: 0.01em;
}

.dial {
  position: relative;
  width: min(212px, 57vw);
  aspect-ratio: 1 / 1;
  margin: 12px auto 2px;
}

.dial-svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
}

.dial-track {
  fill: none;
  stroke: var(--line);
  stroke-width: 9;
}

.dial-value {
  fill: none;
  stroke: var(--accent);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), stroke 0.3s ease;
}

.hero.is-overtime .dial-value {
  stroke: var(--warn);
  animation: breathe 2.6s ease-in-out infinite;
}

.hero.is-waiting .dial-value {
  stroke: var(--ink-3);
  opacity: 0.45;
}

@keyframes breathe {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.dial-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dial-num {
  font-size: clamp(34px, 9vw, 43px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.dial-num.is-long {
  font-size: clamp(27px, 7.4vw, 35px);
}

.dial-label {
  margin-top: 7px;
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.18em;
  text-indent: 0.18em;
}

.next-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.next-label {
  flex: none;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.next-title {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-time {
  flex: none;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.hero-back {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.link-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 7px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
}

.link-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-btn .ic {
  width: 15px;
  height: 15px;
  flex: none;
}

.link-btn:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.btn {
  appearance: none;
  -webkit-appearance: none;
  min-height: 47px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.08s, filter 0.18s;
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled,
.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.hero-actions .icon-btn {
  width: 44px;
  height: 47px;
  flex: none;
  border-radius: 14px;
  background: transparent;
  border-color: var(--line);
}

.btn .ic {
  width: 18px;
  height: 18px;
}

.btn.primary {
  flex: 1;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px -14px rgba(30, 122, 103, 0.75);
}

.btn.primary:hover {
  filter: brightness(1.05);
}

.btn.soft {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink-2);
}

.btn.soft:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-2);
}

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

.btn.danger-ghost {
  background: transparent;
  color: var(--danger);
  padding: 0 12px;
}

.btn.danger-ghost:hover {
  background: var(--danger-soft);
}

.btn.lg {
  min-height: 54px;
  min-width: 132px;
  border-radius: 17px;
  font-size: 15px;
}

.hero.is-empty,
.hero.is-done {
  padding: 30px 22px 24px;
  text-align: center;
}

.hero.is-empty::before,
.hero.is-done::before {
  background: radial-gradient(120% 100% at 50% 0%, var(--accent-soft) 0%, transparent 65%);
  opacity: 0.55;
}

.hero-art {
  width: 74px;
  height: 74px;
  margin: 2px auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.hero-art .ic {
  width: 32px;
  height: 32px;
  stroke-width: 1.5;
}

.hero.is-empty .hero-title,
.hero.is-done .hero-title {
  margin: 0;
  font-size: clamp(21px, 5.4vw, 26px);
  -webkit-line-clamp: unset;
}

.hero.is-empty .hero-sub,
.hero.is-done .hero-sub {
  justify-content: center;
  margin-top: 8px;
  line-height: 1.75;
}

.done-seal {
  width: 64px;
  height: 64px;
  margin: 4px auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 14px 30px -16px rgba(30, 122, 103, 0.7);
}

.done-seal .ic {
  width: 30px;
  height: 30px;
  stroke-width: 2.2;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 18px;
}

.empty-actions .btn {
  flex: 0 1 auto;
  padding: 0 20px;
}

.hint-line {
  margin: 14px 0 0;
  font-size: 11.5px;
  color: var(--ink-3);
}

.hint-line code {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* ------------------------------------------------------------------ */
/* 时间轴                                                              */
/* ------------------------------------------------------------------ */

.board {
  margin-top: 26px;
}

.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.board-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.counter {
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.track {
  height: 3px;
  margin-bottom: 14px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 33px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.chip-btn .ic {
  width: 16px;
  height: 16px;
}

.chip-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.chip-btn.warn {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: transparent;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tl {
  position: relative;
  display: grid;
  grid-template-columns: 44px 18px minmax(0, 1fr) 28px 32px;
  align-items: stretch;
  padding: 0 2px 0 6px;
  border-radius: 13px;
  transition: background 0.2s;
}

.tl + .tl {
  margin-top: 1px;
}

.tl-time {
  display: flex;
  flex-direction: column;
  padding-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.tl-time b {
  font-weight: 500;
  color: var(--ink-2);
}

.tl-rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.tl-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.tl:first-child .tl-rail::before {
  top: 20px;
}

.tl:last-child .tl-rail::before {
  bottom: calc(100% - 20px);
}

.tl-dot {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  margin-top: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
}

.tl-body {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  padding: 10px 6px 10px 2px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}

.tl-title {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tl-meta {
  overflow: hidden;
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.tl-check {
  width: 28px;
  height: 28px;
  margin-top: 13px;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: transparent;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.tl-check .ic {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.tl-check:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tl-check:disabled {
  opacity: 0.32;
  cursor: default;
}

.tl-check:disabled:hover {
  border-color: var(--line-strong);
  color: transparent;
}

.tl-more {
  width: 28px;
  height: 30px;
  margin-top: 13px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink-3);
  opacity: 0.5;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: opacity 0.18s, color 0.18s, background 0.18s;
}

.tl-more .ic {
  width: 15px;
  height: 15px;
}

.tl-more:hover,
.tl-more:focus-visible {
  opacity: 1;
  color: var(--ink);
  background: var(--surface-2);
}

.tl.is-done .tl-more {
  opacity: 0.35;
}

.tl-more:active {
  cursor: grabbing;
}

.tl.is-dragging {
  z-index: 2;
  opacity: 0.6;
  background: var(--surface-2);
  box-shadow: 0 18px 34px -24px rgba(15, 18, 20, 0.65);
  transition: none;
}

.tl.is-drop-before {
  box-shadow: inset 0 2px 0 var(--accent);
}

.tl.is-drop-after {
  box-shadow: inset 0 -2px 0 var(--accent);
}

body.is-reordering {
  cursor: grabbing;
  -webkit-user-select: none;
  user-select: none;
}

body.is-reordering .tl {
  transition: none;
}

@media (hover: none) {
  .tl-more {
    opacity: 0.7;
  }
}

.tl.is-done {
  opacity: 0.62;
}

.tl.is-done .tl-check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.tl.is-done .tl-title {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.tl.is-current {
  background: var(--accent-soft);
}

.tl.is-current .tl-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--surface);
}

.tl.is-current .tl-title {
  font-weight: 600;
}

.tl.is-current .tl-time b {
  color: var(--accent);
}

.tl.is-overtime {
  background: var(--warn-soft);
}

.tl.is-overtime .tl-dot {
  background: var(--warn);
  border-color: var(--warn);
  box-shadow: 0 0 0 3px var(--surface);
}

.tl.is-overtime .tl-time b,
.tl.is-overtime .tl-meta {
  color: var(--warn);
}

.tl.is-waiting .tl-dot {
  background: var(--ink-3);
  border-color: var(--ink-3);
}

.tl.is-queued {
  opacity: 0.86;
}

.tl.is-skipped {
  opacity: 0.45;
}

.tl.is-skipped .tl-title {
  text-decoration: line-through;
}

.tl.is-skipped .tl-check {
  color: var(--ink-3);
  border-color: var(--line);
}

.tl.is-moved {
  opacity: 0.42;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  flex: none;
  border-radius: 5px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.board-empty {
  margin-top: 10px;
  padding: 26px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
}

.board-empty p {
  margin: 0 0 4px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}

.board.is-empty-day .board-head,
.board.is-empty-day .track,
.board.is-empty-day .quick {
  display: none;
}

.board.is-empty-day .board-empty {
  margin-top: 0;
  padding: 30px 24px;
  text-align: left;
}

.board.is-empty-day .board-empty p {
  margin-bottom: 2px;
  font-size: 14px;
}

.empty-steps {
  counter-reset: step;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.empty-steps li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.step-no {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 1px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
}

.empty-steps b {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.empty-steps div span {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-3);
}

@media (max-width: 719px) {
  .board.is-empty-day {
    display: none;
  }

  body.day-empty .app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }

  body.day-empty .layout {
    display: flex;
    flex: 1;
    align-items: center;
    min-height: 0;
  }

  body.day-empty .stage {
    width: 100%;
  }
}

/* ------------------------------------------------------------------ */
/* 底部工具条                                                          */
/* ------------------------------------------------------------------ */

.dock {
  position: fixed;
  left: 50%;
  bottom: calc(14px + var(--safe-b));
  z-index: 40;
  display: flex;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 40px -24px rgba(20, 22, 26, 0.45);
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
}

@supports (background: color-mix(in srgb, white 50%, transparent)) {
  .dock {
    background: color-mix(in srgb, var(--surface) 86%, transparent);
  }
}

.dock button {
  width: 68px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.dock button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.dock .ic {
  width: 18px;
  height: 18px;
}

/* ------------------------------------------------------------------ */
/* 弹层                                                                */
/* ------------------------------------------------------------------ */

dialog {
  padding: 0;
  border: 0;
  color: var(--ink);
  background: var(--surface);
}

dialog::backdrop {
  background: rgba(10, 12, 14, 0.38);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.sheet {
  width: min(520px, calc(100vw - 28px));
  max-height: min(86vh, 840px);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.sheet[open] {
  animation: sheetIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes sheetIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sheet-inner {
  max-height: min(86vh, 840px);
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

.sheet-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sheet-head p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--ink-3);
}

.sheet-head .icon-btn {
  width: 34px;
  height: 34px;
  flex: none;
  border-color: transparent;
  background: transparent;
}

.sheet-head .icon-btn:hover {
  background: var(--surface-2);
}

.sheet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.sheet-actions .btn {
  min-height: 44px;
}

.sheet-actions .btn.primary {
  flex: 1;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-item {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.menu-item .ic {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--ink-3);
}

.menu-item span {
  flex: 1;
  min-width: 0;
}

.menu-item small {
  flex: none;
  color: var(--ink-3);
  font-size: 11px;
  white-space: nowrap;
}

.menu-item:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.menu-item.danger {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger);
}

.menu-item.danger .ic {
  color: var(--danger);
}

.menu-item.danger:hover {
  border-color: var(--danger);
}

.grow,
.spacer {
  flex: 1;
}

.textarea {
  width: 100%;
  min-height: 158px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.8;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.textarea:focus {
  border-color: var(--accent);
}

.textarea::placeholder {
  color: var(--ink-3);
}

.import-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 2px 0;
  font-size: 11.5px;
}

.muted {
  color: var(--ink-3);
}

.sm {
  font-size: 11.5px;
  line-height: 1.7;
}

.link {
  appearance: none;
  padding: 3px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.preview {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ink-2);
}

.preview-head span {
  font-size: 11px;
  color: var(--ink-3);
}

.preview-list {
  list-style: none;
  max-height: 190px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}

.preview-list li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  font-size: 12px;
}

.pv-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.pv-title {
  overflow: hidden;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pv-dur {
  font-size: 10.5px;
  color: var(--ink-3);
}

.warn-line {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--warn);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.field > span {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus {
  border-color: var(--accent);
}

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

.set-group {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.set-group:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.set-group h4 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  font-size: 13.5px;
  cursor: pointer;
}

.set-row + .set-row {
  border-top: 1px solid var(--line);
}

.set-row select,
.set-row input[type="time"] {
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  outline: none;
}

.set-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.set-grid .btn {
  min-height: 42px;
  font-size: 12.5px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.seg {
  height: 35px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.seg.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 44px;
  height: 26px;
  flex: none;
  margin: 0;
  border-radius: 999px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.switch:checked {
  background: var(--accent);
}

.switch:checked::after {
  transform: translateX(18px);
}

.stat-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-tile {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.stat-tile span {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.stat-tile b {
  display: block;
  margin-top: 3px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-tile small {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--ink-3);
}

.usage-note {
  margin: 12px 0 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.7;
}

.usage-note b {
  color: var(--ink-2);
  font-weight: 500;
}

.chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  align-items: stretch;
  height: 158px;
  margin: 22px 0 6px;
  padding: 0 2px;
}

.bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  height: 100%;
  min-width: 0;
}

.bar b {
  font-size: 9.5px;
  font-weight: 500;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.bar-track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  flex: 1;
  min-height: 0;
}

.bar-track i {
  display: block;
  width: 100%;
  max-width: 24px;
  min-height: 3px;
  margin: 0 auto;
  border-radius: 6px;
  background: var(--accent-soft);
  transition: height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bar.is-today .bar-track i {
  background: var(--accent);
}

.bar span {
  font-size: 10px;
  color: var(--ink-3);
  line-height: 1.2;
}

.history {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.h-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--ink-2);
}

.h-row span {
  color: var(--ink-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.carry-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.carry-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.carry-list li:first-child {
  border-top: 1px solid var(--line);
}

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

.carry-list small {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-3);
}

.export-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s;
}

.export-item:hover {
  border-color: var(--line-strong);
}

.export-ic {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.export-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.export-text b {
  font-size: 13px;
  font-weight: 500;
}

.export-text small {
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
}

.chev {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
}

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

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(80px + var(--safe-b));
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 18px 44px -20px rgba(20, 22, 26, 0.45);
  pointer-events: auto;
  animation: toastIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

.toast span {
  flex: 1;
  min-width: 0;
}

.toast button {
  flex: none;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------------ */
/* 悬浮小窗                                                            */
/* ------------------------------------------------------------------ */

.mini {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 13px 15px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  overflow: hidden;
}

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
}

.mini-head .pill {
  height: 21px;
  padding: 0 8px;
  font-size: 10px;
}

.mini-title {
  margin-top: 1px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mini-clock {
  font-size: 31px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.mini-clock.is-overtime {
  color: var(--warn);
}

.mini-next {
  overflow: hidden;
  font-size: 10.5px;
  color: var(--ink-3);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mini-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
  padding-top: 4px;
}

.mini-actions button {
  flex: 1;
  height: 31px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.mini-actions button.primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.pip-body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--surface);
}

body.mini-mode {
  background: var(--bg);
}

body.mini-mode .app {
  display: none;
}

body.mini-mode .mini {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(390px, calc(100vw - 36px));
  height: auto;
  padding: 24px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transform: translate(-50%, -50%);
}

body.mini-mode .mini-clock {
  font-size: 54px;
}

body.mini-mode .mini-title {
  font-size: 18px;
}

body.mini-mode .mini-actions button {
  height: 46px;
  font-size: 13px;
}

/* ------------------------------------------------------------------ */
/* 专注                                                                */
/* ------------------------------------------------------------------ */

.focus-dialog {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  background: var(--bg);
}

.focus-dialog[open] {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.focus-dialog::backdrop {
  background: var(--bg);
}

.focus-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 760px;
  height: 100%;
  margin: 0 auto;
  padding: 76px 26px calc(30px + var(--safe-b));
  text-align: center;
}

.focus-top {
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.focus-title {
  margin: 0;
  max-width: 20ch;
  font-size: clamp(22px, 4.4vw, 34px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  word-break: break-word;
}

.focus-clock {
  margin: 10px 0 2px;
  font-size: clamp(64px, 18vw, 140px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.focus-clock.is-overtime {
  color: var(--warn);
}

.focus-sub {
  font-size: 14px;
  color: var(--ink-3);
}

.focus-next {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.focus-next b {
  font-weight: 500;
  color: var(--ink-2);
}

.focus-actions {
  display: flex;
  gap: 12px;
  margin-top: 26px;
}

.focus-actions .btn {
  min-width: 148px;
}

.focus-back {
  margin-top: 22px;
}

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

@media (min-width: 720px) {
  .app {
    padding-top: 26px;
  }

  .layout {
    display: grid;
    grid-template-columns: minmax(0, min(380px, 46%)) minmax(0, 1fr);
    gap: 26px;
    align-items: start;
  }

  .stage {
    position: sticky;
    top: 26px;
  }

  .hero {
    padding: 22px 22px 20px;
  }

  .board {
    margin-top: 2px;
  }

  .board-head h2 {
    font-size: 12px;
  }

  .tl {
    grid-template-columns: 50px 20px minmax(0, 1fr) 30px 34px;
  }

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

@media (min-width: 1100px) {
  .app {
    padding-top: 30px;
  }

  .layout {
    grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
    gap: 38px;
  }

  .hero {
    padding: 24px 24px 20px;
  }
}

@media (max-width: 639px) {
  .app {
    padding-top: 18px;
  }

  .hero {
    border-radius: 24px;
  }

  .sheet {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  .sheet-inner {
    max-height: 92vh;
    padding: 18px 16px calc(20px + var(--safe-b));
  }

  .sheet[open] {
    animation: sheetUp 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  @keyframes sheetUp {
    from {
      opacity: 0.4;
      transform: translateY(40px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .field-grid .field:last-child {
    grid-column: span 2;
  }

  .hero-actions .btn {
    padding: 0 12px;
  }

  .focus-actions {
    flex-direction: row;
    width: 100%;
    max-width: 360px;
    gap: 10px;
  }

  .focus-actions .btn {
    flex: 1;
    min-width: 0;
    height: 56px;
  }

  .focus-actions .btn.primary {
    flex: 1.35;
  }
}

@media (max-width: 359px) {
  .hero {
    padding: 18px 16px;
  }

  .hero-actions {
    gap: 6px;
  }

  .dock button {
    width: 62px;
  }
}

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

@media print {
  .top-actions,
  .dock,
  .quick,
  .mini,
  .toasts {
    display: none !important;
  }

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

  .layout {
    display: block;
  }

  .hero {
    box-shadow: none;
    border-color: #ccc;
    break-inside: avoid;
  }

  .tl {
    break-inside: avoid;
  }
}
