/* 寰途 · 视觉基调：深墨绿 + 米白 + 金色点缀；移动端优先，留白充足 */

:root {
  --ink: #0f2b26;
  --ink-soft: #1c3d36;
  --ink-line: #2b4a43;
  --cream: #f6f2e8;
  --cream-deep: #ece5d6;
  --paper: #fffdf8;
  --gold: #c9a961;
  --gold-deep: #a8873f;
  --sage: #6f8e83;
  --text: #22302c;
  --text-soft: #5c6b64;
  --text-faint: #8a958d;
  --danger: #9b4a3f;
  --radius: 2px;
  --shadow: 0 1px 2px rgba(15, 43, 38, 0.05), 0 12px 32px -22px rgba(15, 43, 38, 0.35);
  --serif: Georgia, "Songti SC", "SimSun", "Times New Roman", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: 0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--cream); padding: 10px 16px;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; }

/* ---------- 页头 ---------- */

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(246, 242, 232, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--cream-deep);
}

.header-inner {
  max-width: 1120px; margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }

.brand-mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  background: var(--ink); color: var(--gold);
  font-family: var(--serif); font-size: 18px;
  border-radius: var(--radius);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-size: 19px; letter-spacing: 0.16em; }
.brand-text small { font-size: 10.5px; color: var(--text-faint); letter-spacing: 0.12em; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.status-pill {
  font-size: 11.5px; letter-spacing: 0.04em;
  padding: 5px 10px; border: 1px solid var(--cream-deep);
  border-radius: 999px; color: var(--text-soft); background: var(--paper);
  white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis;
}
.status-pill[data-state="online"] { border-color: #b9cfc2; color: #2f5b46; background: #eef4ef; }
.status-pill[data-state="configured"] { border-color: #ddcea5; color: var(--gold-deep); background: #fbf6e9; }
.status-pill[data-state="offline"] { border-color: #e3d4ce; color: var(--danger); background: #fbf1ee; }

@media (max-width: 520px) {
  .header-inner { padding: 10px 14px; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 17px; }
  .header-actions { gap: 6px; }
  .header-actions .ghost-button { padding: 7px 10px; font-size: 12px; white-space: nowrap; }
  .status-pill { font-size: 10.5px; max-width: 32vw; padding: 4px 8px; }
}

/* ---------- 按钮 ---------- */

.primary-button {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--cream);
  border: 1px solid var(--ink);
  padding: 13px 22px; border-radius: var(--radius);
  font-size: 15px; letter-spacing: 0.06em;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.primary-button:hover { background: var(--ink-soft); }
.primary-button:disabled { opacity: 0.5; cursor: not-allowed; }
.primary-button .arrow { color: var(--gold); font-size: 15px; }

.ghost-button {
  background: transparent; color: var(--ink);
  border: 1px solid rgba(15, 43, 38, 0.22);
  padding: 8px 13px; border-radius: var(--radius);
  font-size: 12.5px; letter-spacing: 0.04em;
  transition: border-color 0.16s ease, color 0.16s ease;
}
.ghost-button:hover { border-color: var(--gold-deep); color: var(--gold-deep); }
.ghost-button:disabled { opacity: 0.45; cursor: not-allowed; }

.icon-button {
  background: none; border: none; font-size: 22px; line-height: 1;
  color: var(--text-soft); padding: 2px 6px;
}

/* ---------- Hero ---------- */

.hero { padding: 0 20px; }

.hero-inner {
  max-width: 1120px; margin: 22px auto 0;
  background: var(--ink); color: var(--cream);
  padding: 40px 28px 34px;
  border-radius: var(--radius);
  position: relative; overflow: hidden;
  /* 首页视觉：桌面端文字在左、插画卡片在右；移动端插画卡片排到标题下方 */
  display: grid; grid-template-columns: minmax(0, 1fr);
}

.hero-inner::after {
  content: ""; position: absolute; left: -70px; top: -90px;
  width: 280px; height: 280px; border: 1px solid rgba(201, 169, 97, 0.28);
  border-radius: 50%;
  pointer-events: none;
}

/* ---------- 首页视觉素材：本地原创插画卡片（public/assets/） ---------- */

.visual-card {
  margin: 0;
  border-radius: 6px;
  border: 1px solid rgba(201, 169, 97, 0.55);
  box-shadow: 0 14px 30px -20px rgba(6, 20, 17, 0.65);
  overflow: hidden;
  min-width: 0;
  /* 图片加载失败时的本地占位底色：alt 文案会落在这块底色上，不留白 */
  background: linear-gradient(150deg, #234a42, #0f2b26);
}

.visual-card img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  /* 加载失败的占位样式：深绿底 + 米白 alt 文案 */
  background: linear-gradient(150deg, #234a42, #0f2b26);
  color: rgba(246, 242, 232, 0.85);
  font-size: 12.5px; line-height: 1.7; letter-spacing: 0.06em;
  padding: 12px;
}

.visual-card figcaption {
  font-size: 11px; letter-spacing: 0.18em;
  color: rgba(246, 242, 232, 0.62);
  padding: 8px 14px 10px;
  border-top: 1px solid rgba(201, 169, 97, 0.35);
}

.hero-visual { margin-top: 24px; }
/* 移动端：标题下方的横向卡片。4:3 裁切 + 略偏上的取景，保留落日与湖面，不把全景裁成一条缝 */
.hero-visual img { aspect-ratio: 4 / 3; height: auto; object-position: 50% 40%; }

.form-visual { margin-top: 18px; }
.form-visual img { height: 128px; }

.eyebrow {
  font-size: 10.5px; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(30px, 7.4vw, 46px);
  line-height: 1.28; font-weight: 600;
}
.hero h1 em { font-style: normal; color: var(--gold); }

.hero-lede {
  margin-top: 18px; max-width: 46ch;
  font-size: 14.5px; line-height: 1.85; color: rgba(246, 242, 232, 0.82);
}

.hero-facts {
  margin-top: 28px; display: grid; gap: 10px;
  border-top: 1px solid rgba(246, 242, 232, 0.16); padding-top: 18px;
}
.hero-facts li {
  font-size: 12.5px; color: rgba(246, 242, 232, 0.72);
  display: flex; gap: 12px; align-items: baseline;
}
.hero-facts span { font-family: var(--serif); color: var(--gold); font-size: 12px; letter-spacing: 0.1em; }

@media (min-width: 760px) {
  .hero-inner { padding: 58px 56px 46px; }
  .hero-facts { grid-template-columns: repeat(3, 1fr); gap: 22px; }
  /* 表单横向图片带：桌面端整条带（含图注）控制在 150–220px */
  .form-visual img { height: 168px; }
}

@media (min-width: 900px) {
  /* 桌面端 Hero 双栏：文案锁定左栏，插画卡片整列在右，不压标题与正文 */
  .hero-inner { grid-template-columns: minmax(0, 1fr) 330px; column-gap: 48px; }
  .hero-inner > .eyebrow,
  .hero-inner > h1,
  .hero-lede,
  .hero-facts { grid-column: 1; }
  .hero-visual {
    grid-column: 2; grid-row: 1 / span 4;
    margin: 0;
    align-self: stretch;
    display: flex; flex-direction: column;
  }
  .hero-visual img { aspect-ratio: auto; height: auto; flex: 1 1 auto; min-height: 0; object-position: 50% 50%; }
  .hero-visual figcaption { flex: 0 0 auto; }
}

/* ---------- 通用面板 ---------- */

.panel, .result, .boundaries, .progress-panel {
  max-width: 1120px;
  margin: 22px auto 0;
  background: var(--paper);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px;
}

@media (min-width: 760px) {
  .panel, .result, .boundaries { padding: 34px 40px; }
}

.panel-head, .result-head, .replan-head {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: flex-end; justify-content: space-between;
  margin-bottom: 22px;
}

.section-kicker {
  font-size: 10.5px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold-deep); margin-bottom: 8px;
}

.panel h2, .result h2, .boundaries h2 { font-size: 22px; }
.panel-note { font-size: 12px; color: var(--text-faint); }

/* ---------- 表单 ---------- */

.field-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.field-grid-three { grid-template-columns: 1fr; }
.field-wide { grid-column: span 2; }
.field-full { display: block; margin-top: 16px; }

@media (max-width: 719px) {
  .field-wide { grid-column: 1 / -1; }
}

@media (min-width: 720px) {
  .field-grid { grid-template-columns: repeat(4, 1fr); }
  .field-grid-three { grid-template-columns: repeat(3, 1fr); }
}

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span {
  font-size: 12px; letter-spacing: 0.08em; color: var(--text-soft);
}

.field input, .field select, .field textarea {
  width: 100%;
  background: #fff;
  border: 1px solid #e2dbcb;
  border-radius: var(--radius);
  padding: 11px 12px;
  font-size: 15px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.14);
  outline: none;
}
.field textarea { resize: vertical; line-height: 1.7; }
.field small { font-size: 11.5px; color: var(--text-faint); line-height: 1.6; }
.field select { appearance: none; background-image: none; }

.chip-field { border: none; padding: 0; margin: 20px 0 0; }
.chip-field legend {
  font-size: 12px; letter-spacing: 0.08em; color: var(--text-soft);
  margin-bottom: 10px; padding: 0;
}
.chip-field legend small { color: var(--text-faint); margin-left: 8px; font-size: 11px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  background: transparent;
  border: 1px solid #ded6c4;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--gold); color: var(--gold-deep); }
.chip.is-active {
  background: var(--ink); border-color: var(--ink); color: var(--cream);
}
.chips-small .chip { font-size: 12px; padding: 6px 12px; }

.form-actions {
  margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--cream-deep);
  display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center; justify-content: space-between;
}
.form-hint { font-size: 12px; color: var(--text-faint); max-width: 48ch; }
.form-buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.import-label { display: inline-flex; align-items: center; cursor: pointer; }

/* ---------- 提示条 ---------- */

.notice {
  max-width: 1120px; margin: 16px auto 0; padding: 0 20px;
  font-size: 13px; color: var(--gold-deep); min-height: 0;
}
.notice:empty { display: none; }
.notice.is-error { color: var(--danger); }

/* ---------- 进度 ---------- */

.progress-panel { display: flex; gap: 18px; align-items: flex-start; }
.progress-body { flex: 1; min-width: 0; }
.progress-meta { margin-top: 8px; font-size: 11.5px; letter-spacing: 0.02em; color: var(--text-faint); }
.progress-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.progress-actions .microcopy { font-size: 11.5px; color: var(--text-faint); }
.progress-mark {
  width: 14px; height: 14px; margin-top: 8px; flex: none;
  border: 1.5px solid var(--gold); border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1.1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-detail { font-size: 13px; color: var(--text-soft); margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  .progress-mark { animation: none; }
}

/* ---------- 结果 ---------- */

.result-head-actions { display: flex; gap: 8px; }
.result-meta { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }

.tabs {
  display: flex; gap: 4px; overflow-x: auto;
  border-bottom: 1px solid var(--cream-deep);
  margin: 0 -22px 22px; padding: 0 22px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  background: none; border: none;
  padding: 12px 2px; margin-right: 18px;
  font-size: 13.5px; color: var(--text-faint);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--gold); }

@media (min-width: 760px) {
  .tabs { margin: 0 0 26px; padding: 0; }
}

/* 概览 */

.plan-title { font-size: clamp(24px, 5.4vw, 32px); line-height: 1.35; }
.plan-summary { margin-top: 12px; font-size: 14.5px; color: var(--text-soft); line-height: 1.9; max-width: 62ch; }

.meta-grid {
  margin-top: 24px; display: grid; gap: 1px;
  background: var(--cream-deep);
  border: 1px solid var(--cream-deep);
  grid-template-columns: 1fr 1fr;
}
.meta-cell { background: var(--paper); padding: 14px 14px; }
.meta-cell dt { font-size: 10.5px; letter-spacing: 0.16em; color: var(--text-faint); }
.meta-cell dd { margin: 4px 0 0; font-size: 14px; color: var(--ink); }

@media (min-width: 720px) {
  .meta-grid { grid-template-columns: repeat(4, 1fr); }
}

.highlights { margin-top: 26px; display: grid; gap: 10px; }
.highlights li {
  font-size: 14px; color: var(--text); padding-left: 18px; position: relative;
}
.highlights li::before {
  content: ""; position: absolute; left: 0; top: 12px;
  width: 7px; height: 1px; background: var(--gold);
}

.block { margin-top: 30px; }
.block > h3 {
  font-size: 15px; letter-spacing: 0.06em; color: var(--ink);
  padding-bottom: 8px; border-bottom: 1px solid var(--cream-deep);
  margin-bottom: 14px;
}

.warning-list { display: grid; gap: 10px; }
.warning-list li {
  font-size: 13px; line-height: 1.75; color: #6b4a2f;
  background: #fbf6ea; border-left: 2px solid var(--gold);
  padding: 10px 14px;
}

.fact-row { display: grid; gap: 8px; grid-template-columns: 88px 1fr; font-size: 13.5px; }
.fact-row dt { color: var(--text-faint); }
.fact-row dd { margin: 0; color: var(--text); }

/* 每日行程 */

.day-card {
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 16px;
  background: #fffefb;
}
.day-card.is-locked { border-color: var(--gold); background: #fdfaf1; }

.day-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; justify-content: space-between; }
.day-label { font-family: var(--serif); font-size: 12px; letter-spacing: 0.22em; color: var(--gold-deep); }
.day-theme { font-size: 18px; margin-top: 2px; }
.day-sub { font-size: 12px; color: var(--text-faint); margin-top: 3px; }

.lock-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-soft);
  border: 1px solid #e2dbcb; border-radius: 999px;
  padding: 5px 11px; background: transparent;
}
.lock-toggle[aria-pressed="true"] {
  border-color: var(--gold); color: var(--gold-deep); background: #fbf5e6;
}

.timeline { margin-top: 16px; }
.timeline-item {
  display: grid; grid-template-columns: 54px 1fr; gap: 12px;
  padding: 12px 0; border-top: 1px solid #f0ebdf;
}
.timeline-item:first-child { border-top: none; }
.ti-time { font-family: var(--serif); font-size: 13px; color: var(--ink); line-height: 1.4; }
.ti-time small { display: block; font-size: 10.5px; color: var(--text-faint); font-family: var(--sans); }
.ti-body h4 { font-size: 15px; font-family: var(--sans); font-weight: 600; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.ti-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ti-lock {
  flex: none; background: none; border: 1px solid #e6dfd0; border-radius: 999px;
  font-size: 10.5px; color: var(--text-faint); padding: 1px 9px; letter-spacing: 0.04em;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.ti-lock:hover { border-color: var(--gold); color: var(--gold-deep); }
.ti-lock[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-deep); background: #fbf5e6; }
.ti-detail { font-size: 13px; color: var(--text-soft); margin-top: 4px; line-height: 1.75; }
.ti-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--text-faint); }
.ti-backup { margin-top: 6px; font-size: 12px; color: #5a6f5f; background: #f2f6f2; padding: 7px 10px; border-radius: var(--radius); }

.type-badge {
  font-size: 10.5px; letter-spacing: 0.1em; color: var(--text-soft);
  border: 1px solid #e2dbcb; padding: 1px 7px; border-radius: 2px;
  font-family: var(--sans); font-weight: 400;
}
.type-badge[data-type="餐饮"] { color: #7a5a2a; border-color: #e4d3ad; }
.type-badge[data-type="交通"] { color: #43606b; border-color: #ccdae0; }
.type-badge[data-type="休息"], .type-badge[data-type="自由"] { color: #4d6152; border-color: #cfdcd3; }

.day-meals {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--cream-deep);
  display: grid; gap: 6px; font-size: 12.5px; color: var(--text-soft);
}
.day-meals span { color: var(--text-faint); margin-right: 8px; }
.day-extra { margin-top: 10px; font-size: 12.5px; color: var(--text-soft); }
.day-extra strong { color: var(--ink); font-weight: 600; }

/* 卡片集合 */

.card-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .card-grid { grid-template-columns: 1fr 1fr; } }

.spot-card {
  border: 1px solid var(--cream-deep); border-radius: var(--radius);
  padding: 16px 16px; background: #fffefb;
}
.spot-card h4 { font-size: 15.5px; font-family: var(--sans); font-weight: 600; }
.spot-area { font-size: 11.5px; color: var(--gold-deep); letter-spacing: 0.06em; }
.spot-why { font-size: 13px; color: var(--text-soft); margin-top: 8px; line-height: 1.75; }
.spot-facts { margin-top: 10px; display: grid; gap: 4px; font-size: 12px; color: var(--text-soft); }
.spot-facts b { color: var(--text-faint); font-weight: 400; margin-right: 6px; }
.tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 10.5px; color: var(--text-soft); background: var(--cream);
  border: 1px solid var(--cream-deep); padding: 2px 8px; border-radius: 999px;
}

.verify-line {
  margin-top: 10px; font-size: 11px; color: #8a7340;
  display: flex; gap: 6px; align-items: baseline;
}
.verify-line::before {
  content: "待核实"; font-size: 9.5px; letter-spacing: 0.08em;
  border: 1px solid #e2d3ac; color: #8a7340; padding: 0 5px; border-radius: 2px;
  white-space: nowrap;
}

.hotel-price { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.hotel-needcheck { margin-top: 10px; font-size: 12px; color: var(--text-soft); }
.hotel-needcheck li { padding-left: 14px; position: relative; }
.hotel-needcheck li::before { content: "·"; position: absolute; left: 4px; color: var(--gold-deep); }

.empty-state {
  font-size: 13px; color: var(--text-faint); padding: 18px 0;
}

/* 路线图 */

.route-frame {
  border: 1px solid var(--cream-deep);
  background: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 220px;
  display: grid; place-items: center;
}
.route-frame img { width: 100%; height: auto; display: block; }
.route-frame .route-note { color: rgba(246, 242, 232, 0.72); padding: 24px; font-size: 12.5px; }
.route-note { margin-top: 12px; font-size: 12px; color: var(--text-faint); line-height: 1.8; }
.route-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }

/* 日历 */

.calendar-list { display: grid; gap: 12px; margin-top: 6px; }
.calendar-row {
  display: grid; gap: 6px;
  border: 1px solid var(--cream-deep); border-radius: var(--radius);
  padding: 15px 16px; background: #fffefb;
}
.calendar-row-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.calendar-name { font-size: 14.5px; font-weight: 600; }
.calendar-state { font-size: 11px; letter-spacing: 0.06em; padding: 2px 9px; border-radius: 999px; border: 1px solid; }
.calendar-state[data-state="needs_authorization"] { color: #8a5a2b; border-color: #e4cfa6; background: #fdf7ea; }
.calendar-state[data-state="ics_available"] { color: #2f5b46; border-color: #b9cfc2; background: #eef4ef; }
.calendar-state[data-state="unsupported_direct"] { color: var(--text-soft); border-color: #ded6c4; background: var(--cream); }
.calendar-detail { font-size: 12.5px; color: var(--text-soft); line-height: 1.8; }
.calendar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.event-link-list { margin-top: 8px; display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.event-link {
  font-size: 12.5px; display: flex; gap: 10px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px solid #f2ede1;
}
.event-link a { color: var(--gold-deep); text-decoration: none; border-bottom: 1px solid rgba(168, 135, 63, 0.4); }
.event-link a:hover { color: var(--ink); }
.event-link span { color: var(--text-faint); font-size: 11px; }

.confirm-box {
  margin-top: 16px; border: 1px solid #e6d6cf; background: #fdf6f3;
  padding: 14px 16px; border-radius: var(--radius);
}
.confirm-box p { font-size: 12.5px; color: #7c4a3c; line-height: 1.8; }
.confirm-box label { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: #7c4a3c; margin-top: 10px; }

/* 来源 */

.source-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.source-table th, .source-table td {
  text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--cream-deep); vertical-align: top;
}
.source-table th { font-weight: 500; color: var(--text-faint); font-size: 11px; letter-spacing: 0.08em; }
.src-status { font-size: 11px; padding: 1px 7px; border-radius: 2px; border: 1px solid #ded6c4; color: var(--text-soft); white-space: nowrap; }
.src-status[data-status="static"] { color: #43606b; border-color: #ccdae0; }
.src-status[data-status="unverified"] { color: #8a7340; border-color: #e2d3ac; }
.src-status[data-status="not_connected"] { color: var(--danger); border-color: #e6d6cf; }

/* 重新规划 */

.replan {
  margin-top: 30px; padding-top: 24px;
  border-top: 1px solid var(--cream-deep);
}
.replan textarea { width: 100%; }

/* 边界说明 */

.boundaries ul { display: grid; gap: 8px; margin-top: 14px; }
.boundaries li { font-size: 13px; color: var(--text-soft); padding-left: 16px; position: relative; line-height: 1.8; }
.boundaries li::before { content: "—"; position: absolute; left: 0; color: var(--gold); }

/* 公开试用的访问码页面 */

.gate {
  max-width: 760px; margin: 40px auto 0; padding: 0 20px;
}
.gate-card {
  background: var(--paper);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 24px;
}
.gate h1 { font-size: clamp(24px, 5.2vw, 34px); line-height: 1.35; }
.gate-lede {
  margin-top: 14px; font-size: 14px; line-height: 1.9;
  color: var(--text-soft); max-width: 54ch;
}
.gate form { margin-top: 26px; }
.gate .field input { font-size: 16px; letter-spacing: 0.06em; }
.gate-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.gate-error { margin-top: 12px; font-size: 13px; color: var(--danger); min-height: 1.2em; }
.gate-facts {
  margin-top: 26px; padding-top: 18px;
  border-top: 1px solid var(--cream-deep);
  display: grid; gap: 8px;
}
.gate-facts li {
  font-size: 12.5px; color: var(--text-faint);
  padding-left: 16px; position: relative; line-height: 1.8;
}
.gate-facts li::before { content: "—"; position: absolute; left: 0; color: var(--gold); }

@media (min-width: 760px) {
  .gate { margin-top: 64px; }
  .gate-card { padding: 46px 52px; }
}

/* 页脚 */

.site-footer {
  max-width: 1120px; margin: 40px auto 0; padding: 22px 22px 40px;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between;
  font-size: 11.5px; color: var(--text-faint);
  border-top: 1px solid var(--cream-deep);
}

/* 弹窗 */

dialog {
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius);
  padding: 26px 22px;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--paper);
  color: var(--text);
  box-shadow: 0 30px 70px -40px rgba(15, 43, 38, 0.6);
}
dialog::backdrop { background: rgba(15, 43, 38, 0.42); }

.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.dialog-head h2 { font-size: 21px; }
.dialog-note { font-size: 12px; color: var(--text-faint); line-height: 1.85; margin-bottom: 16px; }
dialog .field { margin-bottom: 14px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.test-result { font-size: 12.5px; color: var(--text-soft); white-space: pre-wrap; line-height: 1.75; min-height: 1em; }
.test-result.is-error { color: var(--danger); }

/* 第三方跳转链接（寰途只跳转，不代订） */

.link-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px; padding-top: 8px;
  border-top: 1px dashed var(--cream-deep);
}

.link-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--sans); font-size: 12px; line-height: 1.7;
  text-decoration: none; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.link-chip::before { content: '↗'; font-size: 10px; opacity: .5; }
.link-chip:hover, .link-chip:focus-visible {
  background: var(--cream); border-color: var(--gold); color: var(--ink);
}
.link-chip[data-group='map'] { border-color: #a2bcb2; }
.link-chip[data-group='book'] { border-color: var(--gold); color: var(--gold-deep); }
.link-chip[data-group='ticket'] { border-color: var(--ink-line); }
.link-chip[data-group='guide'] { border-color: #cdbbab; color: #7a6650; }

/* 来源表里的 URL 胶囊允许换行，否则长 URL 会把表格撑破 */
.source-table .link-chip { white-space: normal; word-break: break-all; max-width: 320px; }

/* 表格横向滚动：窄屏下优先保证列宽与可读性 */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll > .source-table { min-width: 620px; }
@media (max-width: 640px) {
  .table-scroll > .source-table { min-width: 560px; font-size: 12px; }
}

/* 窄屏：链接胶囊更紧凑，标题不再被操作按钮挤成一行 */
@media (max-width: 640px) {
  .link-row { gap: 5px; }
  .link-chip { font-size: 11.5px; padding: 3px 8px; }
  .result-head { align-items: flex-start; }
  .result-head > div:first-child { flex: 1 1 100%; min-width: 0; }
  .result-head h2 { font-size: 19px; line-height: 1.4; word-break: break-word; }
  .result-head-actions { flex: 1 1 100%; flex-wrap: wrap; }
  .result-head-actions .ghost-button { flex: 1 1 auto; }
}

/* 屏幕阅读器 */

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media print {
  .site-header, .tabs, .form-panel, .hero, .boundaries, .site-footer,
  .result-head-actions, .notice, .route-actions, .ti-lock, .lock-toggle,
  .confirm-box, .replan { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .result { box-shadow: none; border: none; padding: 0; margin: 0; }
  /* 打印时展开所有分区，避免只输出当前标签页 */
  .tab-panel[hidden] { display: block !important; }
  .tab-panel { break-inside: auto; }
  .block, .day-card, .spot-card, .calendar-row { break-inside: avoid; }
  .block > h3 { break-after: avoid; }
  .day-card { border-color: #ccc; }
  .route-frame { background: #0f2b26; }
  a[href]::after { content: ""; }
  /* 纸质版只留文字，去掉胶囊装饰 */
  .link-row { border-top: none; padding-top: 4px; }
  .link-chip { border: none; background: none; padding: 0 10px 0 0; }
  .link-chip::before { content: ''; }
}
/* 本地生活与逐个儿童档案 */
.local-preferences { border: 1px solid #d5ded7; border-radius: 14px; padding: 24px; margin: 24px 0; min-width: 0; }
.local-preferences legend { font-weight: 700; padding: 0 8px; }
.local-category-choices { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.local-category-choices label { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.local-category-choices input { width: 18px; height: 18px; accent-color: #224d42; }
.field-caption { margin: 20px 0 12px; font-weight: 600; }
.child-profile { border: 0; border-bottom: 1px solid #d5ded7; padding: 12px 0 20px; margin-bottom: 20px; min-width: 0; }
.child-profile legend { font-size: 15px; padding: 0; }
.local-filter-bar { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin: 20px 0; }
.local-match { padding: 10px 12px; background: #edf2eb; border-radius: 8px; font-size: 14px; }
.local-match[data-outcome="avoid"] { background: #f8e9e2; }
.local-match[data-outcome="unknown"] { background: #f5f0dd; }
@media(max-width: 680px) { .local-preferences { padding: 16px; } .local-filter-bar { grid-template-columns: 1fr 1fr; } }
