:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --primary: #0ea5a4;
  --primary-dark: #0b8483;
  --secondary: #2563eb;
  --accent: #f97316;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; font-size: 15px; }

/* ---------- 导航栏 ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--primary-dark); }
.brand .logo { font-size: 26px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 8px 16px; border-radius: 10px; color: var(--muted); font-weight: 600; transition: .2s;
}
.nav-links a:hover { background: #e6f7f6; color: var(--primary-dark); }
.nav-links a.active { background: var(--primary); color: #fff; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.btn {
  padding: 9px 18px; border-radius: 10px; font-weight: 700; font-size: 14px;
  background: var(--primary); color: #fff; transition: .2s; box-shadow: 0 4px 14px rgba(14,165,164,.25);
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--primary-dark); border: 1.5px solid var(--primary); box-shadow: none; }
.btn.ghost:hover { background: #e6f7f6; }
.btn.orange { background: var(--accent); box-shadow: 0 4px 14px rgba(249,115,22,.25); }
.btn.orange:hover { background: #ea580c; }
.btn.danger { background: #ef4444; }
.btn.danger:hover { background: #dc2626; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.sm { padding: 6px 12px; font-size: 13px; }

/* ---------- 布局 ---------- */
.container { max-width: 1140px; margin: 0 auto; padding: 28px 20px 60px; }
.page-title { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.page-sub { color: var(--muted); margin-bottom: 22px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; color: #fff;
  padding: 64px 48px; margin-bottom: 32px;
  background: linear-gradient(135deg, #0ea5a4 0%, #2563eb 100%);
  box-shadow: var(--shadow);
}
.hero h1 { font-size: 40px; font-weight: 900; margin-bottom: 12px; letter-spacing: 1px; }
.hero p { font-size: 17px; opacity: .92; max-width: 620px; }
.hero .badges { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero .badge { background: rgba(255,255,255,.18); padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }

/* ---------- 搜索 ---------- */
.search-bar { display: flex; gap: 10px; margin-bottom: 24px; }
.search-bar input { flex: 1; padding: 13px 16px; border: 1.5px solid var(--border); border-radius: 12px; outline: none; transition: .2s; }
.search-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,165,164,.15); }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: .25s; border: 1px solid var(--border);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(15,23,42,.14); }
.card .thumb { height: 130px; display: flex; align-items: center; justify-content: center; font-size: 54px;
  background: linear-gradient(135deg, #e0f2f1, #dbeafe); }
.card .body { padding: 16px; }
.card .body h3 { font-size: 17px; margin-bottom: 4px; }
.card .meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.tag { display: inline-block; background: #e6f7f6; color: var(--primary-dark); padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.card .desc { color: var(--muted); font-size: 13.5px; }

/* ---------- 表单 ---------- */
.panel { background: var(--surface); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 14px; }
.field input, .field select, .field textarea {
  padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px; outline: none; transition: .2s; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,165,164,.15); }
.field .hint { color: var(--muted); font-size: 12px; }
.model-switch { display: flex; gap: 10px; }
.model-switch .opt {
  flex: 1; text-align: center; padding: 12px; border: 1.5px solid var(--border); border-radius: 12px; font-weight: 700; cursor: pointer; transition: .2s;
}
.model-switch .opt.active { border-color: var(--primary); background: #e6f7f6; color: var(--primary-dark); }

/* ---------- 行程结果 ---------- */
.result-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.itinerary-title { font-size: 24px; font-weight: 800; }
.summary { color: var(--muted); margin-bottom: 20px; }
.timeline { position: relative; margin-left: 8px; }
.day-block { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.day-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.day-num { background: var(--primary); color: #fff; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.day-theme { font-weight: 800; font-size: 16px; }
.timeline-item { display: flex; gap: 14px; padding: 10px 0; border-top: 1px dashed var(--border); }
.timeline-item:first-child { border-top: none; }
.ti-time { font-weight: 700; color: var(--secondary); min-width: 52px; }
.ti-main { flex: 1; }
.ti-name { font-weight: 700; }
.ti-desc { color: var(--muted); font-size: 13.5px; }
.ti-cost { font-weight: 700; color: var(--accent); white-space: nowrap; }
.ti-type { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 6px; background: #eef2ff; color: var(--secondary); margin-left: 8px; }
.cost-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 20px 0; }
.cost-box { background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 12px; padding: 14px; text-align: center; }
.cost-box .k { color: var(--muted); font-size: 13px; }
.cost-box .v { font-size: 20px; font-weight: 800; color: var(--primary-dark); }
.tips { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; padding: 16px; }
.tips h4 { color: var(--accent); margin-bottom: 8px; }
.tips li { margin-left: 18px; margin-bottom: 4px; }

/* ---------- 空状态 / 提示 ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 48px; margin-bottom: 10px; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.alert.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert.warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.alert.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* ---------- 表格（后台） ---------- */
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: #f8fafc; font-weight: 700; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.actions { display: flex; gap: 8px; }

/* ---------- 模态框 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 18px; padding: 26px; width: 100%; max-width: 480px; box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.modal h3 { margin-bottom: 18px; }

/* ---------- 顶部用户菜单 ---------- */
.user-menu { position: relative; }
.user-menu .trigger { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,#0ea5a4,#2563eb); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.dropdown { position: absolute; right: 0; top: 46px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; min-width: 160px; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; background: none; font-size: 14px; color: var(--text); }
.dropdown a:hover, .dropdown button:hover { background: #f1f5f9; }

.section-gap { margin-top: 26px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.pill { background: #eef2ff; color: var(--secondary); padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0; }
.loading { text-align: center; padding: 40px; color: var(--muted); }

@media (max-width: 720px) {
  .navbar { padding: 12px 16px; }
  .nav-links a { padding: 6px 10px; font-size: 13px; }
  .hero { padding: 40px 24px; }
  .hero h1 { font-size: 30px; }
  .form-grid { grid-template-columns: 1fr; }
}
