:root {
  --ink: #17241e;
  --muted: #5a6b62;
  --paper: #f2eee4;
  --surface: rgba(255, 252, 246, 0.88);
  --reader: #fffcf7;
  --line: rgba(23, 36, 30, 0.1);
  --accent: #1b6b57;
  --accent-deep: #114c3d;
  --warn: #9a5b2f;
  --danger: #8b3a2f;
  --radius: 16px;
  --shadow: 0 20px 48px rgba(23, 36, 30, 0.08);
  --font-display: "ZCOOL XiaoWei", "Songti SC", serif;
  --font-body: "Noto Sans SC", "PingFang SC", sans-serif;
  --rail-w: min(400px, 38vw);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1000px 480px at 8% -8%, rgba(27, 107, 87, 0.16), transparent 58%),
    radial-gradient(720px 420px at 96% 4%, rgba(154, 91, 47, 0.1), transparent 52%),
    linear-gradient(160deg, #f6f2e8 0%, #eef2ec 48%, #e5ebe4 100%);
}

.app {
  width: min(1280px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: rise 0.45s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0.15rem;
}

.brand-mark {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw, 2.75rem);
  letter-spacing: 0.1em;
  line-height: 1;
}

.brand-sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lang-toggle {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.lang-toggle .lang-btn {
  min-width: 2.1rem;
  opacity: 0.65;
}

.lang-toggle .lang-btn.active {
  opacity: 1;
  background: color-mix(in srgb, var(--accent, #2a6f6a) 18%, transparent);
}

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: 1rem;
  min-height: calc(100vh - 7rem);
  align-items: stretch;
}

.rail,
.reader {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.rail {
  padding: 1.1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: auto;
  max-height: calc(100vh - 7rem);
}

.reader {
  background: var(--reader);
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  overflow: hidden;
  position: relative;
}

.compose {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field span,
.check span,
.advanced summary {
  font-size: 0.8rem;
  color: var(--muted);
}

textarea,
input[type="text"],
input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  padding: 0.75rem 0.85rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

textarea:focus,
input:focus {
  border-color: rgba(27, 107, 87, 0.5);
  box-shadow: 0 0 0 3px rgba(27, 107, 87, 0.12);
}

.advanced {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
}

.advanced summary {
  cursor: pointer;
  list-style: none;
}

.advanced summary::-webkit-details-marker {
  display: none;
}

.advanced[open] {
  padding-bottom: 0.75rem;
}

.advanced .field,
.advanced .check {
  margin-top: 0.65rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.actions {
  display: flex;
  gap: 0.6rem;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.1rem;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.compact {
  padding: 0.42rem 0.8rem;
  font-size: 0.84rem;
}

.btn.wide {
  width: 100%;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: #f4fff9;
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-deep);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.ghost:hover:not(:disabled) {
  background: rgba(23, 36, 30, 0.04);
}

.btn.warn {
  background: var(--warn);
  color: #fff8f0;
  width: 100%;
}

.status {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 280px;
  text-align: right;
}

.status.busy {
  color: var(--accent-deep);
}

.status.error {
  color: var(--danger);
}

.block {
  animation: rise 0.3s ease both;
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
}

.block.hidden,
.hidden {
  display: none !important;
}

.block-title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
}

.block-hint {
  margin: -0.25rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.progress-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.progress-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
  font-size: 0.88rem;
}

.progress-list li.done {
  color: var(--ink);
}

.progress-list li.current {
  border-color: rgba(27, 107, 87, 0.4);
  background: rgba(27, 107, 87, 0.08);
  color: var(--accent-deep);
  font-weight: 500;
}

.progress-list .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.progress-list li.current .dot {
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.interrupt-controls {
  display: grid;
  gap: 0.7rem;
}

.option-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.55);
}

.option-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
}

.option-block .field {
  margin-bottom: 0.5rem;
}

.option-block .btn.primary {
  width: 100%;
}

.reader-empty {
  margin: auto;
  text-align: center;
  padding: 2rem;
  animation: rise 0.4s ease both;
}

.reader-kicker {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.04em;
}

.reader-lead {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

.reader-doc {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  animation: rise 0.35s ease both;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.7);
  position: sticky;
  top: 0;
  z-index: 1;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--accent-deep);
  border: 1px solid rgba(27, 107, 87, 0.25);
  background: rgba(27, 107, 87, 0.08);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
}

.badge.done {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(23, 36, 30, 0.04);
}

.memory {
  margin: 0;
  padding: 0.55rem 1.15rem 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.markdown {
  padding: 1rem 1.25rem 2rem;
  overflow: auto;
  flex: 1;
  font-size: 0.96rem;
}

.trip-view {
  padding: 1rem 1.15rem 2rem;
  overflow: auto;
  flex: 1;
}

.trip-header {
  margin-bottom: 0.9rem;
}

.trip-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.trip-meta,
.trip-prefs {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.trip-chip {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(27, 107, 87, 0.05);
  margin-bottom: 0.55rem;
  font-size: 0.88rem;
}

.trip-chip strong {
  color: var(--accent-deep);
  font-weight: 500;
}

.day-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.95rem 1rem 1.05rem;
  margin: 1rem 0;
  box-shadow: 0 8px 24px rgba(23, 36, 30, 0.05);
}

.day-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.day-label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #f4fff9;
  background: var(--accent);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
}

.day-theme {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
}

.spot-list {
  display: grid;
  gap: 0.55rem;
}

.spot-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: linear-gradient(180deg, #fffcf7 0%, #f7f3ea 100%);
}

.spot-name {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.spot-line {
  margin: 0.2rem 0;
  font-size: 0.88rem;
  color: #2a3b33;
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.4rem;
}

.spot-line span {
  color: var(--muted);
  font-size: 0.78rem;
}

.notes-card {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px dashed var(--line);
}

.notes-card h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
}

.notes-card ul {
  margin: 0;
  padding-left: 1.1rem;
}

.markdown h1,
.markdown h2,
.markdown h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.25;
}

.markdown h1 {
  font-size: 1.75rem;
  margin: 0 0 0.85rem;
}

.markdown h2 {
  font-size: 1.28rem;
  margin: 1.35rem 0 0.45rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.markdown h3 {
  font-size: 1.05rem;
  margin: 0.95rem 0 0.25rem;
}

.markdown p,
.markdown li {
  color: #24352d;
}

.markdown ul {
  padding-left: 1.2rem;
}

body[data-phase="running"] .reader-empty .reader-lead::after {
  content: " 左侧进度会实时更新。";
}

html[lang="en"] body[data-phase="running"] .reader-empty .reader-lead::after {
  content: " Progress updates live on the left.";
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .rail {
    max-height: none;
  }

  .reader {
    min-height: 420px;
  }

  .status {
    max-width: 180px;
  }
}

@media (max-width: 560px) {
  .app {
    width: calc(100% - 1rem);
  }

  .topbar {
    flex-direction: column;
    align-items: start;
  }

  .topbar-meta {
    width: 100%;
    justify-content: space-between;
  }

  .status {
    text-align: left;
    max-width: none;
  }
}

/* —— Landing / Privacy —— */
.brand-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.logo {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-nav {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.logo-app {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.logo-hero {
  width: min(220px, 42vw);
  height: auto;
  border-radius: 28px;
  box-shadow: 0 18px 40px rgba(23, 36, 30, 0.12);
  animation: rise 0.7s ease both;
}

.site {
  width: min(1080px, calc(100% - 1.75rem));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0 2.5rem;
  animation: rise 0.5s ease both;
}

.site-narrow {
  width: min(720px, calc(100% - 1.75rem));
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  text-decoration: none;
}

.nav-mark {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.08em;
}

.nav-product {
  color: var(--muted);
  font-size: 0.85rem;
}

.site-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.nav-link:hover {
  color: var(--ink);
}

.atmosphere-hero {
  background:
    radial-gradient(1200px 560px at 50% -10%, rgba(27, 107, 87, 0.22), transparent 55%),
    radial-gradient(700px 400px at 100% 20%, rgba(154, 91, 47, 0.12), transparent 50%),
    linear-gradient(165deg, #f7f3e9 0%, #e8efe9 42%, #dde8e2 100%);
}

.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: min(72vh, 640px);
  padding: 2rem 0 1.5rem;
  gap: 0.85rem;
}

.hero-title {
  margin: 0;
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  font-weight: 400;
  line-height: 1.35;
  animation: rise 0.75s ease 0.06s both;
}

.hero-lead {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
  animation: rise 0.8s ease 0.12s both;
}

.hero-cta {
  margin-top: 0.75rem;
  animation: rise 0.85s ease 0.18s both;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.4rem;
  text-decoration: none;
  font-size: 1.05rem;
}

.landing-how {
  padding: 2.5rem 0 1rem;
  border-top: 1px solid var(--line);
  max-width: 36rem;
}

.how-title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
}

.how-lead {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  margin-top: auto;
  padding-top: 2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer a {
  color: var(--accent-deep);
}

.legal-doc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem 1.75rem;
  box-shadow: var(--shadow);
}

.legal-doc h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
}

.legal-updated {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.legal-doc section + section {
  margin-top: 1.15rem;
}

.legal-doc h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.legal-doc p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 640px) {
  .site-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .landing-hero {
    min-height: auto;
    padding-top: 1.5rem;
  }
}
