:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --accent: #f59e0b;
  --bg: #f4f7f6;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --danger: #dc2626;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

main { max-width: 860px; margin: 0 auto; padding: 0 16px 60px; }

/* ---------- header ---------- */
.hero {
  background: linear-gradient(135deg, #0d9488 0%, #0ea5e9 60%, #6366f1 100%);
  color: #fff; text-align: center; padding: 42px 16px 34px;
}
.hero h1 { font-size: 28px; margin-bottom: 6px; }
.hero .sub { opacity: .92; }
.hero .sub b { color: #fde68a; }
.status-chips { margin-top: 12px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.status-chips span {
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
  padding: 2px 12px; border-radius: 999px; font-size: 12px;
}

/* ---------- form ---------- */
.card {
  background: var(--card); border-radius: 16px; padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06); margin-top: 24px;
}
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px;
}
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.field .opt { color: var(--muted); font-weight: 400; font-size: 12px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; background: #fafafa; transition: border .15s;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); background: #fff;
}
textarea { resize: vertical; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fafafa; font-size: 13px; cursor: pointer; user-select: none;
  transition: all .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.btn {
  padding: 12px 26px; border-radius: 12px; font-size: 15px; font-weight: 600;
  border: none; cursor: pointer; transition: all .15s;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn.primary:disabled { opacity: .6; cursor: wait; transform: none; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }

.llm-toggle {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--muted); cursor: pointer; user-select: none;
  background: #fff; border: 1px dashed var(--line); border-radius: 12px;
  padding: 0 14px; align-self: center;
}
.llm-toggle input { accent-color: var(--primary); }
.llm-toggle:has(input:checked) { color: var(--primary-dark); border-color: var(--primary); }

/* ---------- recommend ---------- */
.recommend-box { margin-top: 16px; }
.recommend-box h3 { font-size: 15px; margin-bottom: 10px; color: var(--primary-dark); }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.rec-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer;
  transition: all .15s; background: #fcfdfd;
}
.rec-card:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(13,148,136,.15); }
.rec-card .name { font-weight: 700; }
.rec-card .prov { color: var(--muted); font-size: 12px; margin-left: 6px; }
.rec-card .reason { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.rec-card .tags { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.rec-card .tags i {
  font-style: normal; font-size: 11px; color: var(--primary-dark);
  background: #ecfdf5; padding: 1px 8px; border-radius: 999px;
}

/* ---------- loading / error ---------- */
#loading { text-align: center; padding: 48px 0; }
.loader {
  width: 42px; height: 42px; margin: 0 auto 14px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-text { color: var(--muted); }
.error { border-left: 4px solid var(--danger); color: var(--danger); }

/* ---------- result ---------- */
#result section { background: var(--card); border-radius: 16px; padding: 22px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06); margin-top: 18px; }
.head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
#result h2 { font-size: 22px; }
#result h2 small { color: var(--muted); font-size: 14px; font-weight: 400; margin-left: 8px; }
.badge {
  font-size: 12px; padding: 3px 12px; border-radius: 999px; white-space: nowrap;
  background: #ecfdf5; color: var(--primary-dark); border: 1px solid #a7f3d0;
}
.badge.llm { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.desc-line { color: var(--muted); font-size: 14px; margin-top: 6px; }

.auto-decided {
  margin-top: 12px; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 12px; padding: 10px 14px; font-size: 13px;
}
.auto-decided b { color: #92400e; }

.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-top: 14px;
}
.meta-item { background: #f8fafc; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; }
.meta-item .k { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.meta-item .v { font-weight: 600; }

.weather-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.w-day { min-width: 108px; text-align: center; background: #f0f9ff; border-radius: 12px; padding: 10px 6px; font-size: 13px; }
.w-day .d { color: var(--muted); font-size: 12px; }
.w-day .t { font-weight: 700; margin: 2px 0; }

/* timeline */
.day-card h3 { font-size: 17px; margin-bottom: 4px; }
.day-card .date-line { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.tl { position: relative; padding-left: 26px; }
.tl::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 8px 0 14px; }
.tl-item::before {
  content: ""; position: absolute; left: -23px; top: 14px; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; border: 3px solid var(--primary);
}
.tl-item .row1 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tl-item .time { font-size: 12.5px; color: var(--primary-dark); font-weight: 700; min-width: 44px; }
.tl-item .name { font-weight: 700; font-size: 15px; }
.tl-item .itype { font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.itype.景点 { background: #ecfdf5; color: #047857; }
.itype.餐饮 { background: #fff7ed; color: #c2410c; }
.itype.交通 { background: #eff6ff; color: #1d4ed8; }
.itype.住宿 { background: #fdf4ff; color: #a21caf; }
.itype.体验 { background: #f0fdfa; color: #0f766e; }
.tl-item .ticket { font-size: 12px; color: var(--accent); font-weight: 600; }
.tl-item .desc { font-size: 13.5px; color: var(--text); opacity: .85; margin-top: 2px; }
.tl-item .tips { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tl-item .tips::before { content: "💡 "; }

/* budget & tips */
table.budget { width: 100%; border-collapse: collapse; font-size: 14px; }
table.budget td { padding: 8px 6px; border-bottom: 1px dashed var(--line); }
table.budget td:last-child { text-align: right; font-weight: 700; }
table.budget tr.total td { border-bottom: none; font-size: 16px; color: var(--primary-dark); }
#result ul.tips { padding-left: 20px; font-size: 14px; }
#result ul.tips li { margin-bottom: 6px; }
.links a { color: var(--primary-dark); text-decoration: none; margin-right: 14px; font-size: 13.5px; }
.links a:hover { text-decoration: underline; }
.food-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.food-tags i { font-style: normal; background: #fff7ed; color: #c2410c; font-size: 13px; padding: 3px 12px; border-radius: 999px; }

.export-row { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* ---------- 天气提醒横幅 ---------- */
.w-banner {
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af;
  border-radius: 10px; padding: 8px 14px; font-size: 13px; margin-bottom: 12px;
}

/* ---------- 景点弹窗 ---------- */
.spot-link { cursor: pointer; border-bottom: 1px dashed var(--primary); }
.spot-link:hover { color: var(--primary); }
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  background: #fff; border-radius: 16px; max-width: 480px; width: 100%;
  max-height: 88vh; overflow: auto; position: relative; padding-bottom: 8px;
}
.modal-close {
  position: absolute; right: 10px; top: 10px; width: 30px; height: 30px;
  border-radius: 50%; border: none; background: rgba(0,0,0,.35); color: #fff;
  cursor: pointer; font-size: 14px; z-index: 2;
}
.modal-map { width: 100%; height: 200px; object-fit: cover; border-radius: 16px 16px 0 0; display: block; background: #e5e7eb; }
.modal-body { padding: 14px 18px 16px; }
.modal-body h3 { font-size: 18px; margin-bottom: 8px; }
.modal-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.modal-meta span { background: #f3f4f6; padding: 2px 10px; border-radius: 999px; }
.modal-desc { font-size: 14px; margin: 8px 0; }
.modal-tips { font-size: 13px; color: #92400e; background: #fffbeb; border-radius: 10px; padding: 8px 12px; }
.modal-nav {
  display: inline-block; margin-top: 6px; color: var(--primary-dark); font-size: 14px;
  text-decoration: none; font-weight: 600;
}

/* ---------- 酒店推荐 ---------- */
.hotel-area { margin-bottom: 14px; }
.hotel-area-name { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.hotel-note { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 8px; }
.hotel-row {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px;
}
.hotel-name { font-weight: 600; font-size: 14px; }
.hotel-meta { display: flex; gap: 12px; font-size: 12.5px; color: var(--accent); margin: 2px 0; flex-wrap: wrap; }
.hotel-meta span { color: var(--muted); }
.hotel-meta span:first-child { color: var(--accent); font-weight: 600; }
.hotel-addr { font-size: 12.5px; color: var(--muted); }

/* ---------- 美食卡片 ---------- */
.food-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.food-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fffdf9; }
.food-card b { color: #c2410c; }
.food-card .fd { font-size: 13px; margin-top: 2px; }
.food-card .where { font-size: 12px; color: var(--muted); margin-top: 4px; }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 12px; }
footer a { color: var(--primary-dark); }

.hidden { display: none !important; }

@media (max-width: 560px) {
  .hero h1 { font-size: 22px; }
  .card { padding: 18px 16px; }
}
