:root {
  --bg: #f5f4ed;
  --ink: #1f3b31;
  --ink-soft: #3c5348;
  --accent: #295943;
  --accent-deep: #143024;
  --soft: #d8ded2;
  --line: #e2e5da;
  --muted: #7d8b7f;
  --card: #ffffff;
  --cream: #fbfaf4;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.75 "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 22px; }

/* ---------- 顶部 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 0; font-size: 13px; color: var(--muted);
}
.topbar a { text-decoration: none; }
.topbar a:hover { color: var(--accent); }
.topbar .brand { letter-spacing: 2px; }

/* ---------- 首屏 ---------- */
.hero { padding: 46px 0 30px; }
.eyebrow {
  font-size: 11px; letter-spacing: 3px; color: var(--muted);
  text-transform: uppercase; margin-bottom: 18px;
}
.hero h1 {
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
  font-size: clamp(30px, 5.2vw, 46px);
  line-height: 1.28; font-weight: 600; letter-spacing: -0.5px;
  margin: 0 0 16px; color: var(--accent-deep);
}
.hero p { margin: 0; max-width: 620px; color: var(--ink-soft); }
.hero .meta { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero .meta span {
  font-size: 12px; color: var(--accent); background: #e7ecdf;
  padding: 5px 12px; border-radius: 999px;
}

/* ---------- 表单 ---------- */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 28px; margin: 8px 0 34px; box-shadow: 0 18px 40px -32px rgba(20, 48, 36, .55);
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.panel-head h2 { font-size: 17px; margin: 0; letter-spacing: .5px; }
.panel-head span { font-size: 12px; color: var(--muted); }

.field { padding: 18px 0; border-top: 1px solid var(--line); }
.field:first-of-type { border-top: 0; }
.field > label.title, .field > .title { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; letter-spacing: .5px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

input[type="date"], input[type="number"], select, textarea {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--ink);
  background: var(--cream); border: 1px solid var(--soft); border-radius: 11px;
  outline: none; transition: border-color .15s, background .15s;
}
input[type="date"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
  border-color: var(--accent); background: #fff;
}
textarea { min-height: 76px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-block; padding: 9px 16px; border: 1px solid var(--soft);
  border-radius: 999px; font-size: 14px; color: var(--ink-soft);
  background: var(--cream); cursor: pointer; transition: all .16s;
  user-select: none;
}
.chip span:hover { border-color: #b9c7b3; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #f4f7ec; }
.chip input:focus-visible + span { outline: 2px solid #8da385; outline-offset: 2px; }

.submit-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--line); }
.btn {
  font: inherit; cursor: pointer; border-radius: 999px; padding: 12px 26px;
  border: 1px solid var(--accent); background: var(--accent); color: #f4f7ec;
  letter-spacing: .5px; transition: transform .12s, box-shadow .16s, background .16s;
}
.btn:hover { background: #1f4a37; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: #e9eee2; }
.note { font-size: 12px; color: var(--muted); }
.note.err { color: #a4402f; }

/* ---------- 生成中 ---------- */
.loading { display: none; padding: 30px 0 44px; }
.loading.on { display: block; }
.loading .bar { height: 3px; background: #e3e8dc; border-radius: 999px; overflow: hidden; margin-bottom: 20px; }
.loading .bar i { display: block; height: 100%; width: 34%; background: var(--accent); border-radius: 999px; animation: slide 1.6s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -34%; } 100% { margin-left: 100%; } }
.loading .stage { font-size: 14px; color: var(--ink-soft); }
.loading .stage em { font-style: normal; color: var(--muted); font-size: 12px; display: block; margin-top: 6px; }

/* ---------- 结果 ---------- */
#result { display: none; padding-bottom: 40px; }
#result.on { display: block; }

.doc-head { border-top: 2px solid var(--accent-deep); padding-top: 22px; }
.doc-head .kicker { font-size: 12px; letter-spacing: 2px; color: var(--muted); }
.doc-head h2 {
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
  font-size: clamp(24px, 4vw, 34px); margin: 10px 0; color: var(--accent-deep); line-height: 1.35;
}
.doc-head .lead { color: var(--ink-soft); margin: 0 0 6px; }
.doc-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 0; }
.doc-tags span { font-size: 12px; color: var(--accent); background: #e7ecdf; padding: 4px 11px; border-radius: 999px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 8px; }
.actions .btn { padding: 10px 20px; font-size: 14px; }

section.block { margin-top: 40px; }
section.block > h3 {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; letter-spacing: 2px; color: var(--accent);
  text-transform: uppercase; margin: 0 0 18px; font-weight: 600;
}
section.block > h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.day {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; margin-bottom: 14px;
}
.day-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.day-no {
  font-family: Georgia, serif; font-size: 13px; letter-spacing: 1px; color: #fff;
  background: var(--accent); border-radius: 999px; padding: 3px 12px;
}
.day h4 { margin: 0; font-size: 18px; font-weight: 600; }
.day .route { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.day .drive { font-size: 12px; color: var(--accent); background: #eef2e7; border-radius: 8px; padding: 3px 10px; display: inline-block; margin-top: 10px; }
.sched { list-style: none; padding: 0; margin: 16px 0 0; }
.sched li { display: grid; grid-template-columns: 62px 1fr; gap: 12px; padding: 9px 0; border-top: 1px dashed var(--line); font-size: 15px; }
.sched li:first-child { border-top: 0; }
.sched .t { font-size: 13px; color: var(--accent); font-variant-numeric: tabular-nums; padding-top: 3px; }
.day .note { margin-top: 14px; font-size: 13px; color: #7a6a3f; background: #faf5e6; border-left: 3px solid #e0cf9b; padding: 9px 13px; border-radius: 0 8px 8px 0; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px;
}
.card h5 { margin: 0 0 8px; font-size: 16px; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.card .price { font-size: 13px; color: var(--accent); font-weight: 500; white-space: nowrap; }
.card p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.advice { background: #eef2e7; border: 1px solid #dbe3d2; border-radius: 14px; padding: 16px 18px; font-size: 15px; color: var(--accent-deep); margin-bottom: 14px; }

.budget-total { font-family: Georgia, serif; font-size: 26px; color: var(--accent-deep); }
.budget-list { list-style: none; padding: 0; margin: 12px 0 0; }
.budget-list li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.budget-list li span:last-child { color: var(--accent); white-space: nowrap; }

ul.tips { margin: 0; padding-left: 20px; }
ul.tips li { margin: 8px 0; color: var(--ink-soft); font-size: 14.5px; }

.foot-cta {
  margin-top: 46px; padding: 30px; border-radius: 18px; text-align: center;
  background: var(--accent-deep); color: #eef2e4;
}
.foot-cta strong { display: block; font-size: 19px; margin-bottom: 6px; font-weight: 600; }
.foot-cta p { margin: 0 0 16px; font-size: 14px; color: #c3d2c3; }
.foot-cta a { display: inline-block; padding: 10px 22px; border: 1px solid #6f8b76; border-radius: 999px; text-decoration: none; font-size: 14px; }
.foot-cta a:hover { background: #1d4433; }

footer.page { padding: 44px 0 56px; font-size: 12px; color: var(--muted); text-align: center; }
footer.page a { text-decoration: none; }
footer.page a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .hero { padding: 34px 0 22px; }
  .panel { padding: 20px 16px; border-radius: 16px; }
  .row2, .grid { grid-template-columns: 1fr; }
  .sched li { grid-template-columns: 52px 1fr; }
  .day { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
