/*
  Navi 今日面板样式：克制的移动端 PWA，首页只突出日期、今日安排、待确认和统一输入。
  关联文件：index.html、app.js。
*/
:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --phone: #fcfdff;
  --surface: #ffffff;
  --surface-soft: #f4f7ff;
  --surface-blue: #eef3ff;
  --ink: #1e2540;
  --muted: #6d7488;
  --faint: #9aa2b4;
  --line: rgba(56, 72, 113, 0.12);
  --line-strong: rgba(56, 72, 113, 0.18);
  --brand: #4f7cff;
  --violet: #715cff;
  --mint: #46bfd6;
  --shadow: 0 18px 54px rgba(36, 49, 91, 0.14);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --keyboard-offset: 0px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}
button, input { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.72; }
button:active { transform: scale(0.98); }
button:focus-visible, input:focus-visible {
  outline: 2px solid rgba(79, 124, 255, 0.28);
  outline-offset: 2px;
}

.shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.phone {
  position: relative;
  width: min(100%, 414px);
  height: min(720px, calc(100vh - 32px));
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  background: var(--phone);
  box-shadow: var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 13px 17px 7px;
}
.menu-button,
.soft-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--line);
}
.menu-button { gap: 4px; }
.menu-button span {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}
.identity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.identity img {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  object-fit: contain;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}
.identity p,
.eyebrow {
  margin: 0 0 1px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}
.identity h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
}

.calendar-card {
  margin: 0 16px 12px;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.calendar-head p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.calendar-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
}
.navi-badge {
  display: none;
}
.navi-badge img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.navi-badge strong {
  position: absolute;
  right: -5px;
  bottom: -5px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.date-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.strip-day {
  position: relative;
  display: grid;
  gap: 3px;
  place-items: center;
  min-width: 0;
  height: 46px;
  border-radius: 13px;
  background: var(--surface-soft);
  color: #4f5872;
  box-shadow: inset 0 0 0 1px rgba(56, 72, 113, 0.06);
}
.strip-day span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}
.strip-day strong {
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.strip-day.is-selected {
  background: var(--brand);
  color: #fff;
}
.strip-day.is-selected span { color: rgba(255, 255, 255, 0.78); }
.strip-day.is-today:not(.is-selected) {
  color: var(--brand);
  background: var(--surface-blue);
}
.strip-day.has-items::after,
.calendar-day.has-items::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.58;
}
.calendar-toggle {
  width: 100%;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 11px;
  background: transparent;
  color: var(--brand);
  font-size: 11px;
  font-weight: 750;
  box-shadow: inset 0 0 0 1px var(--line);
}
.calendar-panel { margin-top: 9px; }
.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.weekday-row {
  margin-bottom: 4px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 650;
  text-align: center;
}
.calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 28px;
  border-radius: 10px;
  background: transparent;
  color: #4f5872;
  font-size: 12px;
  font-weight: 700;
}
.calendar-day.is-selected {
  background: var(--brand);
  color: #fff;
}
.calendar-day.is-today:not(.is-selected) {
  background: var(--surface-blue);
  color: var(--brand);
}

.content {
  height: calc(100% - 188px);
  overflow: auto;
  padding: 0 16px calc(112px + var(--keyboard-offset));
  scroll-behavior: smooth;
}
.section-head {
  display: none;
}
.today-brief {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 9px;
  align-items: center;
  margin: 0 0 10px;
  padding: 10px;
  border-radius: 15px;
  background: var(--surface-blue);
  box-shadow: inset 0 0 0 1px rgba(79, 124, 255, 0.12);
}
.today-brief[hidden] { display: none; }
.today-brief img {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
}
.today-brief p {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}
.today-brief span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.brief-actions:empty,
.assistant-result[hidden] {
  display: none;
}
.brief-actions {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}
.assistant-card,
.assistant-card.is-seed,
.assistant-card.is-draft {
  display: none;
}

.agenda-block { margin-bottom: 12px; }
.block-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 1px 8px;
}
.block-title span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--brand);
}
.block-title h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 750;
}
.timeline,
.stack {
  display: grid;
  gap: 8px;
}
.pending-prompt {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 3px 9px;
  align-items: center;
  width: 100%;
  margin-top: 2px;
  padding: 10px;
  border-radius: 15px;
  background: #f3f1ff;
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(113, 92, 255, 0.14);
}
.pending-prompt[hidden] { display: none; }
.pending-prompt span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--violet);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.pending-prompt strong {
  font-size: 13px;
  font-weight: 750;
}
.pending-prompt small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 11px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.item.done { opacity: 0.55; }
.time {
  display: grid;
  place-items: center;
  min-height: 36px;
  border-radius: 11px;
  background: var(--surface-blue);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.thought .time {
  background: #eefbff;
  color: #168fa8;
}
.draft .time {
  background: #f3f1ff;
  color: var(--violet);
}
.item.is-thinking { background: #fbfcff; }
.body h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.34;
}
.body p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.seed-meta {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px !important;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eefbff;
  color: #168fa8 !important;
  font-size: 10px !important;
  font-weight: 750;
}
.actions {
  display: flex;
  gap: 5px;
}
.mini-action {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 12px;
  font-weight: 800;
}
.mini-action.primary {
  background: var(--violet);
  color: #fff;
  box-shadow: none;
}
.empty {
  padding: 18px 12px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--line);
}

.navi-toast {
  position: absolute;
  right: 16px;
  bottom: calc(90px + var(--safe-bottom) + var(--keyboard-offset));
  left: 16px;
  z-index: 8;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 12px 34px rgba(36, 49, 91, 0.16);
  backdrop-filter: blur(16px);
}
.navi-toast[hidden] { display: none; }
.navi-toast img {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #fff;
  object-fit: contain;
}
.navi-toast p {
  margin: 0 0 2px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
}
.navi-toast h3 {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: 750;
}
.navi-toast span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.navi-toast.is-thinking img { animation: float 1.1s ease-in-out infinite; }

.panel-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  background: rgba(24, 32, 68, 0.18);
  backdrop-filter: blur(4px);
}
.panel-overlay[hidden],
.detail-panel[hidden] { display: none; }
.detail-panel {
  position: absolute;
  right: 10px;
  bottom: calc(10px + var(--safe-bottom) + var(--keyboard-offset));
  left: 10px;
  z-index: 19;
  max-height: min(72%, 620px);
  overflow: hidden;
  padding: 13px;
  border-radius: 22px;
  background: rgba(252, 253, 255, 0.98);
  box-shadow: 0 22px 70px rgba(28, 42, 88, 0.24);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 1px 11px;
}
.panel-head p {
  margin: 0 0 2px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
}
.panel-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 750;
}
.panel-content {
  max-height: calc(72vh - 112px);
  overflow: auto;
  padding-bottom: 5px;
}
.panel-group { margin-bottom: 14px; }
.panel-group h3 {
  margin: 0 1px 8px;
  font-size: 13px;
  font-weight: 750;
}
.panel-link {
  width: 100%;
  min-height: 38px;
  border-radius: 13px;
  background: var(--surface-blue);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.diagnostic-list {
  display: grid;
  gap: 8px;
}
.diagnostic-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.diagnostic-qr {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 11px;
  margin-top: 10px;
  padding: 11px;
  border-radius: 15px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.diagnostic-qr img {
  width: 78px;
  height: 78px;
  padding: 7px;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}
.diagnostic-qr strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.25;
}
.diagnostic-qr p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.diagnostic-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  padding: 11px;
  border-radius: 15px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.diagnostic-row > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.diagnostic-row strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}
.diagnostic-row p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.diagnostic-row.is-good { box-shadow: inset 0 0 0 1px rgba(64, 178, 121, 0.22); }
.diagnostic-row.is-warn { box-shadow: inset 0 0 0 1px rgba(255, 150, 84, 0.25); }
.diagnostic-time {
  margin: 9px 2px 8px;
  color: var(--muted);
  font-size: 10px;
}
.review-card {
  display: grid;
  gap: 10px;
  padding: 15px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.review-count {
  justify-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-blue);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.review-time {
  display: inline-grid;
  place-items: center;
  width: fit-content;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 11px;
  background: #f3f1ff;
  color: var(--violet);
  font-size: 12px;
  font-weight: 800;
}
.review-card h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.25;
}
.review-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.48;
}
.review-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 7px;
  margin-top: 1px;
}
.review-actions.single { grid-template-columns: 1fr; }
.review-actions button {
  min-width: 0;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-blue);
  color: var(--ink);
  font-size: 12px;
  font-weight: 780;
}
.review-actions .review-primary {
  background: var(--brand);
  color: #fff;
}

.composer {
  position: absolute;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom) + var(--keyboard-offset));
  left: 12px;
  padding: 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 16px 42px rgba(36, 49, 91, 0.16);
  backdrop-filter: blur(18px);
}
.composer-line {
  display: grid;
  grid-template-columns: 38px 1fr 48px 40px;
  gap: 7px;
  align-items: center;
}
#naviInput {
  min-width: 0;
  height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}
#naviInput::placeholder { color: var(--faint); }
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.round,
.send {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
}
.round {
  background: var(--surface-blue);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(79, 124, 255, 0.13);
  font-size: 18px;
  font-weight: 700;
}
.mic {
  position: relative;
  width: 48px;
  grid-template-columns: 12px auto;
  gap: 4px;
  color: var(--violet);
}
.mic span {
  font-size: 10px;
  font-weight: 800;
}
.mic::before {
  content: "";
  width: 10px;
  height: 16px;
  border-radius: 999px;
  background: var(--violet);
}
.mic::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 7px;
  margin: 16px 0 0 -26px;
  border-bottom: 2px solid var(--violet);
  border-radius: 0 0 999px 999px;
}
.send {
  width: 40px;
  background: var(--brand);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}
.composer.is-listening .mic::before {
  background: var(--mint);
  animation: pulse 0.8s infinite;
}
.composer.is-listening .mic {
  background: #eefbff;
  box-shadow: inset 0 0 0 1px rgba(70, 191, 214, 0.24), 0 0 0 4px rgba(70, 191, 214, 0.1);
}
.composer-status {
  min-height: 0;
  margin: 6px 4px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
.composer-status:empty { display: none; }

.story { display: none; }
.story-grid { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes pulse {
  50% { transform: scaleY(1.35); }
}
@keyframes float {
  50% { transform: translateY(-3px); }
}

@media (max-width: 900px) {
  .shell {
    display: block;
    min-height: 100dvh;
    padding: 0;
  }
  .phone {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@supports not (height: 100dvh) {
  @media (max-width: 900px) {
    .shell { min-height: 100svh; }
    .phone { height: 100svh; }
  }
}

@media (max-width: 370px) {
  .calendar-card { margin-inline: 12px; }
  .topbar { padding-inline: 13px; }
  .content { padding-inline: 12px; }
  .item { grid-template-columns: 46px 1fr; }
  .actions {
    grid-column: 2;
    justify-content: flex-start;
  }
  .composer-line {
    grid-template-columns: 36px 1fr 44px 38px;
  }
  .round { width: 36px; height: 36px; }
  .mic { width: 44px; }
  .send { width: 38px; height: 38px; }
}
