:root {
  color-scheme: dark;
  --chassis: #101c28;
  --panel: #1c2c39;
  --ink: #f5f1e8;
  --soft: #b1bfc4;
  --rule: #41515c;
  --amber: #f1c485;
  --brass: #edc188;
  --digits: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font: 18px/1.45 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: #0b141d; min-height: 100svh; display: grid; place-items: center; }
button { cursor: pointer; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, audio:focus-visible { outline: 3px solid #ffe1ab; outline-offset: -3px; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#frame { position: relative; width: 1024px; height: 600px; }
#screen {
  width: 1024px; height: 600px; position: relative; transform-origin: top left; overflow: hidden;
  display: grid; grid-template-columns: 340px minmax(0, 1fr); background: var(--panel);
}
.almanac {
  min-height: 0; padding: 26px 26px 16px; border-right: 1px solid #34444f;
  display: flex; flex-direction: column; background: var(--chassis);
}
.brand { display: flex; align-items: center; gap: 9px; color: #c7cecb; font-size: 15px; font-weight: 600; letter-spacing: 2px; }
.brand::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brass); }
.clock, .degrees, .seq { font-family: var(--digits); font-variant-numeric: tabular-nums; }
.clock { color: var(--amber); font-size: 74px; font-weight: 500; letter-spacing: -5px; line-height: 1.18; margin: 15px 0 4px; }
.today { font-size: 25px; line-height: 1.35; font-weight: 550; }
.lunar { color: var(--soft); margin-top: 6px; font-size: 17px; }
.art {
  flex: none; position: relative; overflow: hidden; width: 100%; height: 166px; margin: 22px 0 16px;
  padding: 4px; border: 1px solid #56656e; border-radius: 5px; background: #0a1119;
  box-shadow: inset 0 1px 4px #0008;
}
.art::after { content: ""; position: absolute; inset: 4px; pointer-events: none; background: linear-gradient(0deg, #08152299, transparent 38%); }
.art-image { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 44%; }
.art-image[src$="晴夜.jpg"], .weather-choices img[src$="晴夜.jpg"] { object-position: center 13%; }
.art-arrow { position: absolute; z-index: 1; right: 12px; bottom: 13px; width: 15px; height: 15px; color: white; filter: drop-shadow(0 1px 2px #19212a); }
.location { display: flex; align-items: center; gap: 3px; position: absolute; z-index: 1; bottom: 12px; left: 12px; color: #fff; font-size: 14px; text-shadow: 0 1px 3px #000; }
.location svg { width: 15px; height: 15px; }
.weather { display: flex; gap: 13px; align-items: center; }
.degrees { font-size: 54px; font-weight: 500; line-height: 1.04; letter-spacing: -4px; color: var(--amber); }
.condition { font-size: 25px; font-weight: 500; }
.range { font-size: 16px; margin-top: 7px; color: var(--soft); }
.meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #a2b2b9; margin-top: 10px; }
.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: auto; }
.grille { flex: 1; height: 23px; background: radial-gradient(#52636c .95px, transparent 1.2px) 0 0 / 5px 5px; mask-image: linear-gradient(90deg, black 72%, transparent); }
.link { display: inline-flex; gap: 4px; align-items: center; min-height: 44px; border: 0; padding: 0 2px; color: var(--soft); background: transparent; font-size: 14px; }
.link svg { width: 12px; height: 12px; }

.agenda { display: grid; min-width: 0; min-height: 0; grid-template-rows: auto minmax(0,1fr) auto; gap: 20px; padding: 26px 28px 24px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
h1 { font-size: 32px; letter-spacing: .02em; font-weight: 600; line-height: 1.2; }
.subtitle, .speak-panel { font-size: 16px; color: var(--soft); margin-top: 5px; line-height: 1.45; }
.speak-panel { display: none; color: var(--amber); }
.speak-panel.show { display: block; }
.nav-button, .close, .item-button { border: 1px solid #64737d; background: transparent; border-radius: 5px; }
.nav-button { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 13px; font-size: 16px; }
.nav-button svg { width: 18px; height: 18px; }
.list { padding: 0; margin: 0; list-style: none; overflow-y: auto; scrollbar-width: thin; border-top: 1px solid #62717b; scroll-padding: 5px; }
.row {
  width: 100%; min-height: 61px; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: transparent;
  display: flex; align-items: center; gap: 13px; padding: 8px 3px; text-align: left; transition: background-color 140ms ease-out;
}
.seq { flex: none; width: 23px; color: #9eafb9; font-size: 15px; }
.task-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 23px; line-height: 1.35; letter-spacing: .015em; }
.tag { flex: none; border: 1px solid #78694f; border-radius: 4px; padding: 3px 7px; color: var(--amber); font-size: 14px; white-space: nowrap; }
.tick { flex: none; width: 24px; height: 24px; margin-left: 4px; border: 1.5px solid #95a6af; border-radius: 50%; display: grid; place-items: center; }
.tick svg { opacity: 0; width: 16px; height: 16px; stroke-width: 2.5; }
.row[aria-pressed=true] .tick { color: var(--chassis); background: #b5c3c5; border-color: #b5c3c5; }
.row[aria-pressed=true] .tick svg { opacity: 1; }
.row[aria-pressed=true] .task-name { color: var(--soft); text-decoration: line-through; }
.row.speaking { background: #36444b; }
.row.speaking .seq { color: var(--amber); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.action {
  min-height: 70px; border: 1px solid #6e7e89; border-radius: 8px; background: #354653;
  box-shadow: inset 0 1px #72838c, inset 0 -3px #101c26; display: flex; align-items: center;
  justify-content: center; gap: 13px; font-size: 24px; font-weight: 600; transition: transform 110ms ease-out, background-color 110ms ease-out;
}
.action.play { background: var(--brass); color: #242b2e; border-color: #f0cb99; box-shadow: inset 0 1px #fff0d9, inset 0 -3px #ac8250; }
.action.play:focus-visible { outline-color: #493822; }
.action.play[aria-pressed=true] { background: #f3d5a8; box-shadow: inset 0 2px 3px #ac8250; }
.action:active { transform: translateY(2px); }
.action svg { width: 26px; height: 26px; }
.sheet { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 16px; background: #070e17c9; }
.dialog {
  width: min(560px,100%); max-height: 100%; overflow: auto; padding: 20px 24px 24px; background: #21323f; border: 1px solid #65747d;
  border-radius: 10px; box-shadow: 0 10px 36px #050a1280; overscroll-behavior: contain;
}
.d-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.d-head h2 { font-size: 25px; font-weight: 600; }
.close { width: 44px; height: 44px; display: grid; place-items: center; }
.choices { display: grid; gap: 8px; }
.item-button { min-height: 44px; padding: 8px 14px; font-size: 17px; text-align: left; }
.item-button[aria-pressed=true] { border-color: var(--brass); color: var(--amber); box-shadow: inset 0 0 0 1px var(--brass); }
.weather-choices { grid-template-columns: repeat(4,minmax(0,1fr)); }
.weather-choices .item-button { overflow: hidden; text-align: center; padding: 3px 3px 4px; font-size: 15px; }
.weather-choices img { width: 100%; height: 62px; object-fit: cover; object-position: center 44%; display: block; margin-bottom: 4px; border-radius: 2px; }
.d-note { font-size: 16px; line-height: 1.65; color: var(--soft); }
.transcript { margin: 16px 0; background: var(--chassis); border: 1px solid #586875; border-radius: 5px; padding: 14px; font-size: 20px; }
.meter { height: 6px; background: #42515b; margin: -8px 0 16px; border-radius: 4px; overflow: hidden; }
.meter > span { display: block; background: var(--amber); height: 100%; transform: scaleX(0); transform-origin: left; transition: transform 90ms linear; }
.rec-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rec-actions .item-button { text-align: center; }
audio { width: 100%; margin: 0 0 12px; }
@media (hover: hover) and (pointer: fine) {
  .row:hover, .nav-button:hover, .item-button:enabled:hover, .close:hover { background: #30414d; }
  .art:hover { border-color: var(--amber); }
  .link:hover { color: var(--amber); }
  .action.record:hover { background: #405462; }
  .action.play:hover { background: #f3cf9f; }
}
@media (max-width: 620px) and (orientation: portrait) {
  body { display: block; background: var(--panel); }
  #frame, #screen { width: 100%; height: auto; min-height: 100svh; }
  #screen { display: flex; flex-direction: column; overflow: visible; }
  .almanac {
    display: grid; align-content: start; grid-template-columns: minmax(0,1fr) minmax(0,.95fr);
    grid-template-areas: "brand demo" "clock art" "date art" "lunar art" "weather range" "meta meta";
    gap: 5px 10px; padding: 12px 16px 14px; border: 0; border-bottom: 1px solid var(--rule);
  }
  .brand { grid-area: brand; font-size: 13px; }
  .demo-bar { grid-area: demo; justify-content: end; margin: 0; }
  .grille { display: none; }
  .clock { grid-area: clock; font-size: clamp(44px,12vw,68px); margin: 0; letter-spacing: -3px; }
  .today { grid-area: date; font-size: 18px; }
  .lunar { grid-area: lunar; align-self: start; font-size: 14px; margin: 0; }
  .art { grid-area: art; margin: 0; height: 115px; align-self: center; }
  .location { bottom: 7px; left: 7px; font-size: 12px; }
  .weather { grid-area: weather; gap: 8px; }
  .degrees { font-size: 32px; letter-spacing: -2px; }
  .condition { font-size: 17px; }
  .range { grid-area: range; align-self: center; text-align: right; font-size: 14px; margin: 0; }
  .meta { grid-area: meta; border-top: 1px solid #33434e; margin-top: 2px; padding-top: 5px; }
  .agenda { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 0; }
  h1 { font-size: 25px; }
  .subtitle, .speak-panel { font-size: 14px; }
  .nav-button { font-size: 14px; gap: 5px; padding: 0 9px; }
  .list { overflow: visible; }
  .row { min-height: 54px; gap: 7px; }
  .seq { width: 19px; font-size: 13px; }
  .task-name { font-size: 17px; }
  .tag { font-size: 12px; padding: 2px 4px; }
  .tick { width: 21px; height: 21px; margin-left: 0; }
  .actions { position: sticky; z-index: 1; bottom: 0; background: var(--panel); margin-top: auto; padding: 8px 0 max(8px,env(safe-area-inset-bottom)); gap: 9px; }
  .action { min-height: 52px; font-size: 19px; gap: 8px; }
  .action svg { width: 21px; height: 21px; }
  .sheet { position: fixed; }
  .dialog { padding: 16px; }
  .weather-choices { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .action:active { transform: none; }
}
