:root {
  color-scheme: dark;
  --bg: #101418;
  --panel: #171d22;
  --panel-2: #20272d;
  --text: #eef3f1;
  --muted: #a8b3ad;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #83d3b7;
  --accent-2: #f4c76c;
  --danger: #ff8a7a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root.light {
  color-scheme: light;
  --bg: #f5f2eb;
  --panel: #fffdf8;
  --panel-2: #ebe6da;
  --text: #1d2321;
  --muted: #69716d;
  --line: rgba(20, 28, 24, 0.12);
  --accent: #247c66;
  --accent-2: #b77a19;
  --danger: #b74737;
  --shadow: 0 16px 42px rgba(50, 42, 30, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px calc(88px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
}

.icon-button,
.sheet-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  font-size: 20px;
}

.today-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 42%),
    var(--panel);
  box-shadow: var(--shadow);
}

.date-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 14px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
}

.hero-copy h2 {
  margin-bottom: 10px;
  font-size: 26px;
  line-height: 1.22;
}

.hero-desc {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.focus-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.focus-node {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 84%, transparent);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.focus-node b {
  color: var(--accent-2);
  font-size: 11px;
}

.orbit-card {
  position: relative;
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: radial-gradient(circle at center, color-mix(in srgb, var(--accent) 20%, transparent), transparent 50%);
  overflow: hidden;
}

.orbit-core {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--text);
  color: var(--bg);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.orbit-node {
  position: absolute;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.n1 { top: 18px; left: 18%; }
.n2 { top: 30px; right: 16%; }
.n3 { bottom: 20px; left: 20%; }
.n4 { right: 18%; bottom: 18px; }

.quick-list {
  display: flex;
  gap: 8px;
  margin: 18px -16px 4px;
  padding: 0 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-list::-webkit-scrollbar {
  display: none;
}

.time-chip,
.text-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.time-chip {
  padding: 0 15px;
}

.time-chip.active {
  background: var(--accent);
  color: var(--bg);
}

.share-feed {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.share-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
  animation: riseIn 0.48s ease both;
}

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

.share-time {
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
}

.share-type {
  color: var(--muted);
  font-size: 13px;
}

.share-card h3 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.32;
}

.visual-card {
  display: grid;
  min-height: 132px;
  padding: 16px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 26%, transparent), transparent 46%),
    linear-gradient(315deg, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 42%),
    var(--panel-2);
  place-items: end start;
  position: relative;
  overflow: hidden;
}

.visual-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -24px;
  width: 96px;
  height: 96px;
  border: 1px solid color-mix(in srgb, var(--text) 22%, transparent);
  border-radius: 22px;
  transform: rotate(18deg);
}

.visual-card.gold {
  background:
    linear-gradient(135deg, rgba(244, 199, 108, 0.28), transparent 46%),
    linear-gradient(315deg, rgba(131, 211, 183, 0.14), transparent 42%),
    var(--panel-2);
}

.visual-card.blue {
  background:
    linear-gradient(135deg, rgba(116, 178, 255, 0.24), transparent 46%),
    linear-gradient(315deg, rgba(131, 211, 183, 0.16), transparent 42%),
    var(--panel-2);
}

.visual-card.red {
  background:
    linear-gradient(135deg, rgba(255, 138, 122, 0.24), transparent 46%),
    linear-gradient(315deg, rgba(244, 199, 108, 0.14), transparent 42%),
    var(--panel-2);
}

.visual-card strong {
  position: relative;
  z-index: 1;
  max-width: 240px;
  font-size: 24px;
  line-height: 1.15;
}

.model-flow {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 82%, transparent);
  overflow-x: auto;
  scrollbar-width: none;
}

.model-flow::-webkit-scrollbar {
  display: none;
}

.flow-step {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.model-flow i {
  flex: 0 0 18px;
  height: 1px;
  background: var(--line);
  position: relative;
}

.model-flow i::after {
  content: "";
  position: absolute;
  top: -3px;
  right: 0;
  width: 7px;
  height: 7px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  transform: rotate(45deg);
}

.summary {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.case-card {
  min-height: 108px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.case-card span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.case-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.35;
}

.case-card p,
.action-box p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.link-strip {
  display: flex;
  gap: 8px;
  margin: 0 -18px;
  padding: 0 18px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.link-strip::-webkit-scrollbar {
  display: none;
}

.link-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.action-box {
  padding: 12px;
  border-left: 3px solid var(--accent-2);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-2) 10%, var(--panel-2));
}

.action-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
}

.tag-row,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.primary-button,
.secondary-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
}

.primary-button {
  background: var(--text);
  color: var(--bg);
}

.secondary-button {
  background: var(--panel-2);
  color: var(--text);
}

.insight-panel {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.text-button {
  padding: 0 14px;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.archive-item {
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.archive-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

.archive-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: grid;
  min-height: 42px;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.nav-item.active {
  background: var(--panel-2);
  color: var(--text);
}

.detail-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.detail-sheet.open {
  display: block;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.sheet-card {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 86vh;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 22px 18px calc(24px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.sheet-close {
  position: sticky;
  top: 0;
  margin-left: auto;
}

.sheet-time {
  margin: 4px 0 8px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
}

.sheet-card h2 {
  font-size: 24px;
  line-height: 1.28;
}

.sheet-card h3 {
  margin: 18px 0 8px;
  font-size: 17px;
}

.sheet-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.audio-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.audio-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.audio-box p {
  margin-bottom: 0;
}

@media (min-width: 680px) {
  .today-hero {
    grid-template-columns: 1fr 230px;
    align-items: stretch;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .share-card {
    animation: none;
  }
}
