/* ==========================================================================
   候场 Green Room
   方向：剧场公告板。纸、墨、一点朱红。
   两种声音：无衬线管「做事」，宋体管「想事」。
   ========================================================================== */

:root {
  --paper: #f4f0e7;
  --paper-2: #ebe5d8;
  --paper-3: #e2dacb;
  --paper-deep: #ddd5c5;
  --ink: #17150f;
  --ink-2: #5a554b;
  --ink-3: #948d80;
  --line: #d6cdbb;
  --line-2: #c3b8a2;
  --lamp: #e2481a;
  --lamp-2: #c73a10;
  --lamp-ink: #fff4ec;
  --lamp-ink-2: rgba(255, 244, 236, 0.74);
  --lamp-line: rgba(255, 244, 236, 0.3);

  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --num: "DIN Alternate", "Bahnschrift", "DIN 2014", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-lamp: cubic-bezier(0.76, 0, 0.24, 1);
  --col: 480px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper-deep);
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  text-align: inherit;
  touch-action: manipulation;
}

textarea,
input {
  font: inherit;
  color: inherit;
  background: transparent;
}

textarea {
  resize: none;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

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

[hidden] {
  display: none !important;
}

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

.ic {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  vertical-align: -0.25em;
}

.num {
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.serif {
  font-family: var(--serif);
}

/* ---------- 外壳 ---------- */

.app {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 64px;
}

.phone {
  position: relative;
  flex: none;
  width: min(100%, var(--col));
  height: 100%;
  background: var(--paper);
  overflow: hidden;
  isolation: isolate;
}

@media (min-width: 960px) {
  .phone {
    height: min(calc(100dvh - 48px), 880px);
    border-radius: 30px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.6),
      0 0 0 1px rgba(23, 21, 15, 0.16),
      0 40px 80px -24px rgba(23, 21, 15, 0.45),
      0 12px 24px -12px rgba(23, 21, 15, 0.3);
  }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px;
}

/* ---------- 视图 ---------- */

.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  min-height: 0;
  background: var(--paper);
}

.view.is-on {
  display: flex;
  animation: rise 0.28s var(--ease) both;
}

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

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px 12px;
}

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 20px calc(96px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none;
}

.scroll::-webkit-scrollbar {
  display: none;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.page-sub {
  font-size: 12px;
  color: var(--ink-2);
}

/* ---------- 候场板 ---------- */

.wordmark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.wordmark span {
  font-family: var(--num);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  font-weight: 500;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1;
}

.pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
}

.pill.is-live {
  border-color: var(--lamp);
  color: var(--lamp);
}

.pill.is-live i {
  background: var(--lamp);
  animation: breathe 1.6s ease-in-out infinite;
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 6px 0 0;
  background: var(--paper-2);
  width: 100%;
}

.banner-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.banner-main b {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banner-main span {
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banner .num {
  font-size: 24px;
  font-weight: 600;
  white-space: nowrap;
}

.lead {
  font-size: clamp(22px, 6.4vw, 30px);
  font-weight: 600;
  line-height: 1.34;
  letter-spacing: 0.01em;
  margin: 18px 0 22px;
}

.cta {
  display: grid;
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  border-radius: 14px;
  padding: 18px 20px 20px;
  text-align: left;
  gap: 2px;
  transition: transform 0.12s var(--ease);
}

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

.cta-kicker {
  font-family: var(--num);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--paper-3);
}

.cta-main {
  font-size: clamp(28px, 8vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cta-main .ic {
  width: 0.72em;
  height: 0.72em;
  stroke-width: 2.2;
}

.cta-sub {
  font-size: 13px;
  color: var(--paper-3);
  margin-top: 6px;
}

.textlink {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  padding: 6px 0;
  border-bottom: 1.5px solid var(--ink);
  margin-top: 14px;
}

.textlink span {
  font-weight: 400;
  color: var(--ink-2);
  font-size: 13px;
}

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 34px 0 12px;
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}

.sec-head h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.sec-head > span {
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}

.talkbar {
  display: grid;
  justify-items: start;
  gap: 6px;
}

.talk {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  transition: background 0.12s, color 0.12s, transform 0.1s;
}

.talk:active,
.talk.is-held {
  background: var(--ink);
  color: var(--paper);
  transform: scale(0.985);
}

.talk.is-held::before {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1.5px solid var(--lamp);
  border-radius: 999px;
  animation: pulse 1.2s ease-out infinite;
}

.sample-note {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 10px;
}

.sample-note button {
  color: var(--lamp);
  font-weight: 700;
  margin-left: 6px;
}

.chores {
  border-top: 1px solid var(--line);
}

.chore {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
}

.chore.is-off {
  opacity: 0.38;
}

.chore-main {
  display: grid;
  gap: 3px;
  min-width: 0;
  text-align: left;
}

.chore-name {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chore-meta {
  font-size: 12px;
  color: var(--ink-3);
}

.chore-min {
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.chore-min small {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 3px;
}

.empty {
  padding: 22px 0 26px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}

.empty b {
  color: var(--ink);
}

/* ---------- AI 动向 ---------- */

.harness {
  margin: 6px 0 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px 6px;
  background: var(--paper-2);
}

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

.sec-mini {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-2);
  white-space: nowrap;
}

.harness-source {
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink-3);
  text-align: right;
}

.harness-source.is-live {
  color: var(--ink-2);
}

.harness-source.is-live::before {
  content: "● ";
  color: var(--lamp);
}

.h-row {
  display: grid;
  grid-template-columns: 12px auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.h-row:first-child {
  border-top: 0;
}

.h-row i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-2);
  align-self: center;
}

.h-row.is-on i {
  background: var(--lamp);
  animation: breathe 1.6s ease-in-out infinite;
}

.h-row.is-quiet i {
  background: var(--ink-3);
}

.h-row b {
  font-weight: 600;
}

.h-row span {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.h-row small {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}

.h-row.is-done b,
.h-row.is-done span {
  color: var(--ink-3);
  font-weight: 500;
}

.harness-empty {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
  padding: 6px 0;
}

.wait-live {
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-2);
  margin-top: 4px;
}

.state-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-2);
  flex: none;
}

.state-dot.is-live {
  background: var(--lamp);
}

.sec-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  padding: 14px 0 2px;
}

.sec-sub[hidden] {
  display: none;
}

/* ---------- 底部导航 ---------- */

.tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 20;
}

.tabs button {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 10px 0 8px;
  font-size: 11px;
  color: var(--ink-3);
  position: relative;
}

.tabs button .ic {
  width: 22px;
  height: 22px;
}

.tabs button.is-on {
  color: var(--ink);
  font-weight: 700;
}

.tabs button.is-on::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: 36px;
  height: 3px;
  background: var(--ink);
  transform: translateX(-50%);
}

.phone.is-immersive .tabs {
  display: none;
}

/* ---------- 候场卡 ---------- */

.view-wait {
  padding: 0 20px calc(16px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}

.wait-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
  font-size: 13px;
  color: var(--ink-2);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lamp);
  animation: breathe 1.6s ease-in-out infinite;
}

.view-wait.is-over .live-dot {
  animation: none;
}

.wait-elapsed {
  font-size: 16px;
}

.clock {
  position: relative;
  width: clamp(136px, 38vw, 180px);
  aspect-ratio: 1;
  margin: 12px auto 2px;
  flex: none;
}

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring circle {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}

.ring-track {
  stroke: var(--line);
}

.ring-fill {
  stroke: var(--ink);
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.view-wait.is-over .ring-fill {
  stroke: var(--lamp);
}

.clock-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.clock-num .num {
  font-size: clamp(34px, 10.5vw, 48px);
  font-weight: 600;
  line-height: 1;
}

.clock-cap {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.14em;
  margin-top: 4px;
}

.wait-title {
  font-size: 13px;
  color: var(--ink-2);
  text-align: center;
  max-width: 32ch;
  margin: 0 auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lane {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  min-height: 0;
}

.wait-title + .lane,
.on-meta + .lane {
  margin-top: auto;
}

.lane-ai .q {
  font-size: 16px;
  line-height: 1.6;
  -webkit-line-clamp: 3;
}

.lane-ai.is-open .q {
  display: block;
  overflow: visible;
}

.lane-label {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--ink-2);
  padding-top: 3px;
  line-height: 1;
}

.task-name {
  font-size: clamp(28px, 8.2vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-meta {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 8px;
}

.stage {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--lamp);
  margin-bottom: 8px;
}

.q {
  font-size: clamp(20px, 5.6vw, 25px);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cue {
  font-size: clamp(16px, 4.4vw, 19px);
  line-height: 1.6;
  color: var(--ink-2);
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--line-2);
}

.cue.is-swap {
  animation: cue-in 0.4s var(--ease);
}

@keyframes cue-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.wait-actions {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding-top: 14px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 54px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  width: 100%;
  transition: transform 0.1s var(--ease);
  user-select: none;
  -webkit-user-select: none;
}

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

.btn:disabled {
  opacity: 0.45;
}

.btn[hidden] {
  display: none;
}

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

.btn-line {
  border: 1.5px solid var(--line-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  height: 48px;
}

.btn-quiet {
  border-color: transparent;
  color: var(--ink-3);
  padding: 0 14px;
}

@media (max-height: 700px) {
  .clock {
    width: 112px;
  }
  .task-name {
    font-size: 26px;
  }
  .lane {
    padding: 12px 0;
  }
  .q {
    -webkit-line-clamp: 3;
  }
  .btn {
    height: 50px;
  }
}

/* ---------- 一次一步 ---------- */

.step-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--lamp);
  margin-bottom: 6px;
}

.step-kicker[hidden] {
  display: none;
}

.step-skip {
  justify-self: center;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
  border-bottom-color: var(--line);
  margin-top: 2px;
}

.talk-links {
  display: flex;
  gap: 18px;
}

/* ---------- 现成的活 ---------- */

.lib-group {
  border-bottom: 1px solid var(--line);
  padding: 4px 0 8px;
}

.lib-group > summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.lib-group > summary::-webkit-details-marker {
  display: none;
}

.lib-group > summary small {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
}

.lib-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.lib-item b {
  font-size: 15px;
  font-weight: 600;
}

.lib-item small {
  font-size: 11px;
  color: var(--ink-3);
}

.lib-add {
  height: 32px;
  padding: 0 12px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.lib-add[disabled] {
  border-color: var(--line-2);
  color: var(--ink-3);
}

.lib-steps {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
}

.rv-steps {
  grid-column: 1 / -1;
  width: 100%;
  border: 1.5px solid var(--line-2);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  background: var(--paper-2);
}

.rv-steps:focus {
  border-color: var(--ink);
}

#ch-steps {
  width: 100%;
  border: 1.5px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.6;
  outline: none;
}

#ch-steps:focus {
  border-color: var(--ink);
}

#btn-ch-split {
  justify-self: start;
}

/* ---------- 该上场了 ---------- */

.view-on {
  background: var(--lamp);
  color: var(--lamp-ink);
  padding: 0 20px calc(16px + env(safe-area-inset-bottom, 0px));
  animation: lamp 0.5s var(--ease-lamp) both;
  overflow-y: auto;
}

.view-on::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 60% at 50% -10%, rgba(255, 255, 255, 0.24), transparent 60%);
  pointer-events: none;
}

.view-on > * {
  position: relative;
}

@keyframes lamp {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0);
  }
}

.on-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
  font-size: 12px;
  letter-spacing: 0.26em;
  font-weight: 700;
  color: var(--lamp-ink);
}

.on-top .num {
  letter-spacing: 0.02em;
  font-size: 16px;
  font-weight: 600;
  color: var(--lamp-ink);
}

.on-title {
  font-size: clamp(56px, 16.5vw, 80px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: 0.02em;
  margin: 18px 0 10px;
  white-space: nowrap;
}

.on-title span {
  display: inline-block;
  animation: word 0.6s var(--ease) both;
  animation-delay: calc(var(--i) * 70ms + 120ms);
}

@keyframes word {
  from {
    opacity: 0;
    transform: translateY(0.3em);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.on-meta {
  font-size: 15px;
  font-weight: 600;
  color: var(--lamp-ink);
}

.view-on .lane {
  border-top-color: var(--lamp-line);
}

.view-on .lane-label {
  color: var(--lamp-ink);
}

.view-on .stage {
  color: var(--lamp-ink);
}

.view-on .q {
  -webkit-line-clamp: 3;
}

.on-thought {
  width: 100%;
  border: 1.5px solid var(--lamp-line);
  background: rgba(255, 244, 236, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 18px;
  line-height: 1.55;
  min-height: 92px;
  color: var(--lamp-ink);
  outline: none;
  margin-top: 2px;
}

.on-thought:focus {
  border-color: var(--lamp-ink);
  background: rgba(255, 244, 236, 0.16);
}

.on-thought::placeholder {
  color: var(--lamp-ink);
  opacity: 0.8;
}

.talk-on {
  border-color: var(--lamp-ink);
  color: var(--lamp-ink);
  height: 48px;
  margin-top: 8px;
}

.talk-on:active,
.talk-on.is-held {
  background: var(--lamp-ink);
  color: var(--lamp-2);
}

.btn-paper {
  background: var(--lamp-ink);
  color: var(--lamp-2);
}

.on-actions {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding-top: 14px;
}

.textlink-on {
  color: var(--lamp-ink);
  border-bottom-color: var(--lamp-line);
  justify-self: center;
  margin-top: 4px;
}

/* ---------- 底部弹层 ---------- */

.sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
}

.sheet[hidden] {
  display: none;
}

.scrim {
  position: absolute;
  inset: 0;
  background: rgba(23, 21, 15, 0.42);
  animation: fade 0.2s both;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.panel {
  position: relative;
  margin-top: auto;
  max-height: 94%;
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: sheet-in 0.34s var(--ease) both;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow:
    inset 0 1px 0 var(--line),
    0 -20px 50px -20px rgba(23, 21, 15, 0.35);
}

@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}

.panel::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-2);
  transform: translateX(-50%);
}

.sheet-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  padding: 26px 20px 12px;
  border-bottom: 2px solid var(--ink);
}

.kicker {
  grid-column: 1;
  font-family: var(--num);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-3);
}

.sheet-head h2 {
  grid-column: 1;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.iconbtn {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
}

.sheet-scroll {
  overflow-y: auto;
  min-height: 0;
  padding: 4px 20px 8px;
}

.sheet-foot {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
}

.hint {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
  padding: 12px 20px 0;
}

.hint[hidden] {
  display: none;
}

.field {
  display: grid;
  gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.field-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.opt {
  font-weight: 400;
  color: var(--ink-3);
  margin-left: 8px;
  letter-spacing: 0;
}

.field-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.field-box textarea,
.type-box {
  width: 100%;
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 17px;
  line-height: 1.5;
  outline: none;
  min-height: 46px;
}

.field-box textarea:focus,
.type-box:focus {
  border-color: var(--ink);
}

.field-box textarea {
  overflow-y: auto;
  scrollbar-width: none;
}

.field-box textarea::-webkit-scrollbar {
  display: none;
}

.type-box {
  margin: 12px 0;
}

.talk-sm {
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 15px;
  font-weight: 600;
}

.chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.chip-num {
  width: 76px;
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  outline: none;
}

.chip-num.is-on {
  border-color: var(--ink);
}

.chip-num::placeholder {
  color: var(--ink-3);
  font-family: var(--sans);
  font-weight: 400;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  font-size: 15px;
  font-weight: 600;
}

.switch-row small {
  display: block;
  font-weight: 400;
  color: var(--ink-3);
  font-size: 12px;
  margin-top: 2px;
}

.switch {
  position: relative;
  width: 46px;
  height: 28px;
  flex: none;
  display: inline-block;
  vertical-align: middle;
}

.switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  z-index: 1;
  cursor: pointer;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line-2);
  transition: background 0.2s;
}

.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s var(--ease);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.switch input:checked + i {
  background: var(--ink);
}

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

.plan {
  padding: 16px 0 4px;
}

.plan-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  margin-bottom: 10px;
}

.plan-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.plan-tag {
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 8px 12px;
  display: grid;
  gap: 1px;
}

.plan-tag b {
  font-size: 15px;
}

.plan-tag span {
  font-size: 11px;
  color: var(--ink-2);
}

.plan-tag.is-partial {
  border-style: dashed;
}

.plan-sep {
  color: var(--ink-3);
  font-size: 13px;
}

.plan-note {
  font-size: 12px;
  color: var(--lamp);
  margin-top: 10px;
  font-weight: 600;
  line-height: 1.5;
}

.review-list {
  overflow-y: auto;
  min-height: 0;
  padding: 6px 20px;
}

.rv-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 32px;
  gap: 10px 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.rv-row.is-flag .rv-name {
  color: var(--lamp);
}

.rv-name {
  border: 0;
  border-bottom: 1.5px solid var(--line-2);
  font-size: 18px;
  font-weight: 600;
  padding: 6px 0;
  outline: none;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rv-name:focus {
  border-bottom-color: var(--ink);
}

.rv-name::placeholder {
  color: var(--lamp);
  font-weight: 400;
}

.rv-minwrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
  padding: 6px 12px;
}

.rv-minwrap:has(input:focus) {
  border-color: var(--ink);
}

.rv-min {
  border: 0;
  width: 44px;
  text-align: right;
  font-size: 20px;
  font-weight: 600;
  outline: none;
}

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

.rv-del {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-3);
}

.rv-mind {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--ink-3);
}

.dots {
  display: flex;
  gap: 6px;
}

.dots button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  transition: background 0.12s, border-color 0.12s;
}

.dots button.is-on {
  background: var(--ink);
  border-color: var(--ink);
}

/* ---------- 记录 ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 16px 0 18px;
}

.stat {
  background: var(--paper);
  padding: 14px 14px 12px;
  display: grid;
  gap: 2px;
}

.stat b {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
}

.stat b small {
  font-size: 12px;
  color: var(--ink-2);
  margin-left: 3px;
  font-family: var(--sans);
  font-weight: 500;
}

.stat small {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

.log-line {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}

.log-line b {
  color: var(--ink);
  font-family: var(--num);
  font-size: 15px;
}

.cal-row {
  display: grid;
  grid-template-columns: 84px 1fr 84px;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 13px;
}

.cal-row > :last-child {
  text-align: right;
  color: var(--ink-2);
  white-space: nowrap;
}

.cal-row > :last-child small {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
}

.wi-facts .sep {
  color: var(--ink-3);
}

.cal-bar {
  position: relative;
  height: 8px;
  background: var(--paper-3);
  border-radius: 4px;
}

.cal-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--ink);
  border-radius: 4px;
}

.cal-bar em {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--lamp);
}

.wait-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
}

.wait-item header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-3);
}

.wi-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wi-facts {
  font-size: 12px;
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.wi-thought {
  font-size: 15px;
  line-height: 1.55;
  background: var(--paper-2);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  width: 100%;
}

.copybtn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  flex: none;
}

.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 1px 6px;
  border: 1px solid currentColor;
  border-radius: 4px;
  line-height: 1.5;
  vertical-align: 1px;
}

.tag-demo {
  color: var(--lamp);
}

/* ---------- 设置 ---------- */

.set {
  margin-bottom: 26px;
}

.sec-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-2);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}

.row-set {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 600;
}

.row-set small {
  display: block;
  font-weight: 400;
  color: var(--ink-3);
  font-size: 12px;
  margin-top: 2px;
}

.row-set.is-stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.stepper {
  display: flex;
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
  overflow: hidden;
  flex: none;
}

.stepper button {
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.stepper button + button {
  border-left: 1px solid var(--line-2);
}

.stepper button.is-on {
  background: var(--ink);
  color: var(--paper);
}

.stepper.is-wide {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-radius: 12px;
}

.stepper.is-wide button {
  padding: 10px 6px;
  font-size: 13px;
}

.proj {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.proj > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.proj b {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proj small {
  color: var(--ink-3);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proj label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
  flex: none;
}

.howto {
  padding: 12px 0 4px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.65;
}

.howto summary {
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.howto p {
  margin-top: 8px;
}

.howto code {
  display: block;
  background: var(--paper-2);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 8px 0;
  font-family: var(--mono);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--ink);
}

.set-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  padding: 12px 0 0;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0 0;
}

.btn-sm {
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
  font-weight: 600;
}

.btn-sm.is-danger {
  color: var(--lamp);
  border-color: var(--lamp);
}

.diag {
  font-size: 13px;
}

.diag li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.diag b {
  font-weight: 600;
  flex: none;
}

.diag span {
  color: var(--ink-2);
  text-align: right;
  line-height: 1.5;
}

.diag .no {
  color: var(--lamp);
}

.foot {
  font-size: 11px;
  color: var(--ink-3);
  padding: 18px 0 0;
  text-align: center;
}

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

.toast {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s var(--ease);
  pointer-events: none;
  max-width: 420px;
  margin: 0 auto;
}

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

/* 提示条不挡手：整条不接点击，只有里面的按钮能点 */
.toast button {
  pointer-events: auto;
  color: var(--paper-3);
  font-weight: 700;
  float: right;
  margin-left: 12px;
  padding: 4px 2px;
}

/* 全屏的两张卡，按钮都在下面，提示条改从顶部出来 */
/* 顶上那一行是状态，让开 */
.phone.is-immersive .toast {
  top: calc(env(safe-area-inset-top, 0px) + 58px);
  bottom: auto;
}

.phone.is-return .toast {
  background: var(--lamp-ink);
  color: var(--lamp-2);
}

.phone.is-return .toast button {
  color: var(--lamp-2);
}

/* ---------- 桌面侧栏 ---------- */

.side {
  display: none;
  flex: none;
  width: min(380px, 34vw);
  color: var(--ink);
}

.side-kicker {
  font-family: var(--num);
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--ink-2);
}

.side-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.35;
  margin: 14px 0 22px;
}

.side-steps {
  display: grid;
  gap: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  counter-reset: s;
}

.side-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
}

.side-steps li::before {
  counter-increment: s;
  content: "0" counter(s);
  font-family: var(--num);
  font-weight: 600;
  color: var(--ink);
  font-size: 15px;
}

.side-steps b {
  color: var(--ink);
}

.side-qr {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}

.side-qr[hidden] {
  display: none;
}

.side-qr canvas {
  width: 108px;
  height: 108px;
  background: #fff;
  border-radius: 8px;
}

.side-qr p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}

.side-qr small {
  display: block;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  word-break: break-all;
  margin-top: 4px;
}

@media (min-width: 960px) {
  .side:not([hidden]) {
    display: block;
  }
}

/* ---------- 动效 ---------- */

@keyframes breathe {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}

@keyframes pulse {
  from {
    opacity: 0.9;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.14);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- 锁屏通知的逐项自检：过的打勾变淡，没做的写编号，下一步高亮 ---------- */

.steps {
  list-style: none;
  margin: 4px 0 2px;
  padding: 0;
}

.steps li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.steps li:last-child {
  border-bottom: 0;
}

.steps .mark {
  font-weight: 700;
  line-height: 1.55;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.steps li.is-next .mark {
  color: var(--lamp);
}

.steps li.is-next b {
  color: var(--ink);
}

.steps li.is-ok .mark {
  color: #2f7d4f;
}

.steps li.is-fail .mark,
.steps li.is-fail b {
  color: var(--lamp);
}

.steps li.is-ok b {
  color: var(--ink-2);
  font-weight: 500;
}

.steps b {
  font-weight: 600;
  font-size: 14px;
  display: block;
  line-height: 1.55;
}

.steps small {
  display: block;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.btn-sm:disabled {
  opacity: 0.45;
}

/* 录完在等文字回来 */
.talk.is-busy {
  opacity: 0.72;
}

.row-set.is-off {
  opacity: 0.5;
}

/* 录完在等文字回来 */
.talk.is-busy {
  opacity: 0.72;
}

.row-set.is-off {
  opacity: 0.5;
}
