:root {
  --bg: #f4f1ec;
  --card: #ffffff;
  --ink: #1e2a26;
  --muted: #7c8a84;
  --line: #e6e0d7;
  --green: #2f6f5e;
  --green-soft: #e7f0ec;
  --gold: #c08a30;
  --gold-soft: #faf1e2;
  --red: #bb5040;
  --red-soft: #fbeceb;
  --blue: #3a6ea5;
  --blue-soft: #eaf1f8;
  --shadow: 0 1px 2px rgba(30, 42, 38, .05), 0 8px 24px rgba(30, 42, 38, .06);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 26px;
  background: rgba(244, 241, 236, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--green); color: #fff;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700; letter-spacing: .02em;
}
.brand h1 { font-size: 17px; }
.brand .sub { font-size: 12.5px; color: var(--muted); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.chip {
  font-size: 12.5px; padding: 5px 11px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: #4c5a54;
  white-space: nowrap;
}
.chip b { color: var(--green); font-weight: 650; }

.topright { display: flex; align-items: center; gap: 10px; }
.ghost {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 13px; font-size: 13px; color: #52605a;
  transition: .15s;
}
.ghost:hover { border-color: #cfc7bb; background: #fbf9f6; }
.save-dot { font-size: 12px; color: var(--muted); }
.save-dot.saving { color: var(--gold); }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 6px; padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: #f8f6f2; overflow-x: auto;
}
.tabs button {
  border: 0; background: none; padding: 13px 14px 11px;
  color: var(--muted); font-size: 14px; font-weight: 550;
  border-bottom: 2.5px solid transparent; white-space: nowrap;
}
.tabs button.active { color: var(--green); border-bottom-color: var(--green); }
.tabs button:hover { color: var(--ink); }

main { padding: 26px; max-width: 1400px; margin: 0 auto; width: 100%; min-width: 0; }
.tabpane { display: none; animation: fade .22s ease; }
.tabpane.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .tabpane { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* ---------- 通用 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.sec-title {
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px;
}
.sec-title h2 { font-size: 16px; }
.sec-title span { font-size: 12.5px; color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: #f0eee9; color: #5d6a64; font-weight: 550;
}
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.gold { background: var(--gold-soft); color: #8f6318; }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }

/* ---------- 行程 ---------- */
.plan-grid { display: grid; grid-template-columns: 1.35fr .95fr; gap: 22px; align-items: start; }
@media (max-width: 1080px) { .plan-grid { grid-template-columns: 1fr; } }

.timeline { padding: 6px 4px; }
.tl-item { display: grid; grid-template-columns: 74px 26px 1fr; gap: 0; }
.tl-time { text-align: right; padding-top: 16px; }
.tl-time b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.tl-time span { font-size: 11px; color: var(--muted); }
.tl-rail { position: relative; }
.tl-rail::before {
  content: ""; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: var(--line);
}
.tl-dot {
  position: absolute; left: 4px; top: 20px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; border: 3px solid var(--green); z-index: 2;
}
.tl-dot.hollow { border-color: #c9c2b6; }
.tl-dot.gold { border-color: var(--gold); }
.tl-body { padding: 10px 0 16px 4px; }

.stop {
  display: grid; grid-template-columns: 104px 1fr auto; gap: 14px;
  padding: 12px; border-radius: 14px; border: 1px solid var(--line);
  background: #fff; transition: .15s;
}
.stop:hover { border-color: #cfc7bb; transform: translateY(-1px); box-shadow: var(--shadow); }
.stop .cover {
  width: 104px; height: 74px; border-radius: 10px; overflow: hidden;
  background: #eeebe4; position: relative;
}
.stop .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stop .cover .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #b3aa9c; font-size: 11px; text-align: center; line-height: 1.3;
}
.stop h4 { font-size: 14.5px; margin-bottom: 3px; }
.stop .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.stop .meta b { color: var(--ink); font-weight: 600; }
.stop .right { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.price { font-size: 16px; font-weight: 680; color: var(--green); }
.price small { font-size: 11px; font-weight: 500; color: var(--muted); }

.travel {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); padding: 6px 0 6px 108px;
}
.travel::before { content: "↓"; color: #c3bbae; }

.agent-sep {
  margin: 10px 0 10px 100px; padding: 9px 14px; border-radius: 10px;
  background: #eef2f8; border: 1px dashed #c9d7e8; color: #3a5f8a;
  font-size: 13px; line-height: 1.5;
}
.agent-sep b { color: #2b4c72; font-weight: 700; }
.agent-sep-sub { font-size: 11.5px; color: #6b88ab; margin-top: 2px; }

.lunch {
  margin: 10px 0 10px 100px; padding: 12px 16px; border-radius: 12px;
  background: repeating-linear-gradient(45deg, #fbf6ec, #fbf6ec 10px, #f8f2e5 10px, #f8f2e5 20px);
  border: 1px dashed #e3d4b8; color: #8a6a2c; font-size: 13px;
}

/* 圈层图 */
.ring-wrap { padding: 16px; }
.ring-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.ring-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }

.why { padding: 16px 18px; }
.why li { margin-bottom: 9px; font-size: 13.5px; color: #46534d; }
.why li b { color: var(--ink); }
.why ol { margin: 0; padding-left: 20px; }

/* ---------- 房源卡 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 18px; width: 100%; }
.r-card { min-width: 0; max-width: 100%; }
.r-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); cursor: pointer;
  display: flex; flex-direction: column; transition: .18s; position: relative;
}
.r-card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(30,42,38,.07), 0 16px 34px rgba(30,42,38,.10); }
.r-card .thumb { height: 172px; background: #eae6de; position: relative; overflow: hidden; }
.r-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.r-card .thumb .empty {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 6px;
  color: #a89f90; font-size: 12.5px; text-align: center;
}
.r-card .badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 11px; padding: 3px 8px; border-radius: 999px; font-weight: 600;
  background: rgba(255,255,255,.94); color: #4d5a54; backdrop-filter: blur(6px);
}
.badge.s-已约 { background: #eaf1f8; color: #2f5f92; }
.badge.s-已看 { background: #f1efe9; color: #6b6455; }
.badge.s-中意 { background: #e7f0ec; color: var(--green); }
.badge.s-放弃 { background: #f6e9e7; color: var(--red); }
.badge.s-待定 { background: #faf1e2; color: #8f6318; }
.badge.s-待约 { background: #f0eee9; color: #5d6a64; }
.r-card .score { position: absolute; top: 9px; right: 10px; background: rgba(30,42,38,.72); color: #fff; font-size: 11.5px; padding: 3px 8px; border-radius: 999px; }
.r-card .body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.r-card h3 { font-size: 15px; line-height: 1.35; }
.r-card .addr { font-size: 12px; color: var(--muted); }
.r-card .facts { display: flex; gap: 6px; flex-wrap: wrap; }
.fact { font-size: 11.5px; color: #5e6b64; background: #f5f3ee; padding: 3px 8px; border-radius: 7px; }
.fact.walk { background: var(--green-soft); color: var(--green); font-weight: 600; }
.r-card .foot {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding-top: 9px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted);
}

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; width: 100%; }
.toolbar .spacer { flex: 1; }
.btn {
  background: var(--green); color: #fff; border: 0; border-radius: 10px;
  padding: 9px 16px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(47,111,94,.3); transition: .15s;
}
.btn:hover { background: #27604f; }
.btn.sec { background: #fff; color: #4d5a54; border: 1px solid var(--line); box-shadow: none; }
.btn.sec:hover { background: #fbf9f6; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
select.inp, input.inp {
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 8px 11px; font-size: 13px; outline: none;
}
select.inp:focus, input.inp:focus, textarea.inp:focus { border-color: #a9c3ba; box-shadow: 0 0 0 3px rgba(47,111,94,.08); }
textarea.inp {
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 9px 11px; font-size: 13.5px; outline: none; width: 100%; resize: vertical;
}

/* ---------- 对比表 ---------- */
.tablewrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #faf8f4; font-weight: 600; font-size: 12.5px; color: #5d6a64; position: sticky; top: 0; }
tbody tr:hover { background: #fbfaf7; }
tbody tr:last-child td { border-bottom: 0; }
td.best { color: var(--green); font-weight: 650; background: rgba(47,111,94,.05); }
td.warn { color: var(--red); }
.tsort { cursor: pointer; user-select: none; }
.tsort:hover { color: var(--green); }

/* ---------- 中介 ---------- */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.agent {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
}
.agent .top { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 15px;
}
.agent .note { font-size: 12.5px; color: var(--muted); }
.agent .rooms-mini { display: flex; flex-direction: column; gap: 5px; }
.mini {
  display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px;
  padding: 6px 9px; border-radius: 8px; background: #f7f5f1; cursor: pointer;
}
.mini:hover { background: #f1eee8; }
.followup { font-size: 12.5px; color: #8f6318; background: var(--gold-soft); padding: 8px 10px; border-radius: 9px; }

/* ---------- 视频库 ---------- */
.dropzone {
  border: 2px dashed #d8d0c3; border-radius: var(--radius); padding: 26px;
  text-align: center; color: var(--muted); background: #fdfcfa; transition: .18s; margin-bottom: 20px;
}
.dropzone.hot { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.dropzone h3 { font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.dropzone p { font-size: 12.5px; }
.vgroup { margin-bottom: 26px; }
.vgroup-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.vgroup-head h3 { font-size: 14.5px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.vcard {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer;
}
.vcard .vthumb { height: 118px; background: #eae6de; position: relative; }
.vcard .vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard .vthumb .dur {
  position: absolute; right: 7px; bottom: 7px; background: rgba(0,0,0,.6); color: #fff;
  font-size: 10.5px; padding: 1px 6px; border-radius: 5px;
}
.vcard .vthumb .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 26px; text-shadow: 0 2px 8px rgba(0,0,0,.4); opacity: .92;
}
.vcard .vbody { padding: 9px 11px 11px; }
.vcard .vname { font-size: 12.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vcard .vlink { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- 清单 ---------- */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.check-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 11px; font-size: 13.5px;
}
.check-item input { margin-top: 3px; accent-color: var(--green); width: 16px; height: 16px; }
.check-item.done { opacity: .55; text-decoration: line-through; }

/* ---------- 抽屉 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(24,32,29,.36); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: .2s; z-index: 60;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--bg); z-index: 61; transform: translateX(100%);
  transition: transform .26s cubic-bezier(.3,.8,.4,1); overflow-y: auto;
  box-shadow: -20px 0 50px rgba(0,0,0,.14);
}
.drawer.open { transform: none; }
.drawer-head {
  position: sticky; top: 0; background: rgba(244,241,236,.95); backdrop-filter: blur(10px);
  padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; z-index: 3;
}
.drawer-head h2 { font-size: 16px; flex: 1; }
.drawer-body { padding: 18px 20px 60px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 550; }
.field .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stars { display: flex; gap: 4px; font-size: 24px; color: #d9d2c6; }
.stars i { cursor: pointer; font-style: normal; transition: .1s; }
.stars i.on { color: var(--gold); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 6px 12px; font-size: 12.5px; color: #5d6a64;
}
.seg button.on { background: var(--green); color: #fff; border-color: var(--green); font-weight: 600; }
.vplayer { width: 100%; border-radius: 12px; background: #000; margin-bottom: 6px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state h3 { font-size: 16px; color: var(--ink); margin-bottom: 8px; }
.hint { font-size: 12.5px; color: var(--muted); background: #fdfcfa; border: 1px solid var(--line); border-radius: 11px; padding: 11px 14px; }
.tip {
  display: flex; gap: 10px; padding: 12px 15px; border-radius: 12px;
  background: var(--green-soft); color: #2c5b4d; font-size: 13px; margin-bottom: 16px;
}
.tip b { color: var(--green); }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: #1e2a26; color: #fff; padding: 11px 18px; border-radius: 11px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 720px) {
  main { padding: 14px; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .brand h1 { font-size: 15px; }
  .brand .sub { font-size: 11.5px; }
  .logo { width: 36px; height: 36px; font-size: 13px; border-radius: 10px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { font-size: 11.5px; padding: 4px 9px; }
  .topright { width: 100%; justify-content: flex-end; }
  .tabs { padding: 0 10px; }
  .tabs button { padding: 11px 10px 9px; font-size: 13px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .r-card .thumb { height: 168px; }
  .plan-grid { gap: 16px; }
  .stop { grid-template-columns: 84px 1fr; }
  .stop .right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .agent-sep {
  margin: 10px 0 10px 100px; padding: 9px 14px; border-radius: 10px;
  background: #eef2f8; border: 1px dashed #c9d7e8; color: #3a5f8a;
  font-size: 13px; line-height: 1.5;
}
.agent-sep b { color: #2b4c72; font-weight: 700; }
.agent-sep-sub { font-size: 11.5px; color: #6b88ab; margin-top: 2px; }

.lunch { margin-left: 0; }
  .travel { padding-left: 0; }
}
