/* ==========================================================================
   航班 & 酒店查询 — 深色主题样式
   ========================================================================== */

:root {
  --bg: #0a0e14;
  --bg-soft: #0e141d;
  --panel: #131b26;
  --panel-2: #182231;
  --border: #24334a;
  --border-soft: #1b2536;
  --text: #e8eef6;
  --muted: #8fa0b6;
  --muted-2: #64748b;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --cyan: #22d3ee;
  --gold: #f5a524;
  --gold-soft: rgba(245, 165, 36, 0.14);
  --ok: #2fd07a;
  --ok-soft: rgba(47, 208, 122, 0.14);
  --danger: #f2555a;
  --danger-soft: rgba(242, 85, 90, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.36);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1100px 460px at 12% -8%, rgba(59, 130, 246, 0.13), transparent 62%),
    radial-gradient(900px 420px at 92% 4%, rgba(34, 211, 238, 0.09), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

main, .topbar, .tabs, .footer { position: relative; z-index: 1; }

/* ------------------------------ 顶栏 ------------------------------ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 26px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--accent), var(--cyan));
  color: #06121f;
  font-size: 19px;
  font-weight: 700;
}

.brand h1 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: .2px; }
.brand-sub { margin: 0; font-size: 11.5px; color: var(--muted-2); }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; row-gap: 8px; justify-content: flex-end; }

.quota {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.quota-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

.quota.warn .quota-dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.quota.danger .quota-dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.quota.danger { color: #ffb9bb; border-color: rgba(242, 85, 90, .4); }

/* ------------------------------ 标签页 ------------------------------ */

.tabs {
  display: flex;
  gap: 6px;
  padding: 14px 26px 0;
  border-bottom: 1px solid var(--border-soft);
}

.tab {
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-family: inherit;
  padding: 10px 20px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  transition: all .16s ease;
}

.tab:hover { color: var(--text); background: var(--panel); }

.tab.active {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
  box-shadow: inset 0 2px 0 var(--accent);
}

main { max-width: 1320px; margin: 0 auto; padding: 22px 26px 40px; }

.panel { display: none; }
.panel.active { display: block; animation: fade .22s ease; }

@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

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

.search-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
}

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row-places { align-items: flex-end; }
.row-actions { justify-content: space-between; align-items: center; }

.placeholder-wrap { position: relative; flex: 1 1 240px; min-width: 220px; }

.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 150px; min-width: 130px; }
.field.narrow { flex: 0 1 108px; min-width: 96px; }
.field.grow { flex: 2 1 300px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }

.field > span {
  font-size: 11.5px;
  color: var(--muted-2);
  letter-spacing: .3px;
  text-transform: none;
}

input[type="text"], input[type="date"], input[type="number"],
input[type="password"], select, textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder { color: #4c5b70; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238fa0b6' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(.7);
  cursor: pointer;
}

.field.inline select, .field.inline input { width: auto; min-width: 92px; }

/* 下拉补全 */
.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 306px;
  overflow-y: auto;
  z-index: 60;
  display: none;
}

.dropdown.open { display: block; }

.dd-item {
  padding: 9px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
}

.dd-item:last-child { border-bottom: none; }
.dd-item:hover, .dd-item.active { background: var(--accent-soft); }
.dd-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dd-city { font-size: 13px; font-weight: 600; }
.dd-airport { font-size: 11.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-iata {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: #9dc2ff;
  border: 1px solid rgba(59, 130, 246, .3);
  flex-shrink: 0;
}
.dd-empty { padding: 12px; color: var(--muted-2); font-size: 12.5px; text-align: center; }

/* 分段控件 */
.segmented {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.seg {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}

.seg:hover { color: var(--text); }
.seg.active { background: var(--accent); color: #fff; }

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.checkbox input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.inline-checks { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 2px; }

/* 按钮 */
.btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}

.btn:hover { border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(140deg, var(--accent), #2563eb);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(59, 130, 246, .3);
}

.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 12.5px; }
.btn.swap {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 17px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 1px;
}

/* 快捷入口 */
.shortcuts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.shortcuts-label { font-size: 11.5px; color: var(--muted-2); }

.chip {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}

.chip:hover { border-color: var(--accent); color: #fff; background: var(--accent-soft); }

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

.hidden { display: none !important; }

.banner {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, .32);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.summary {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  min-width: 116px;
}

.stat-label { font-size: 11px; color: var(--muted-2); letter-spacing: .3px; }
.stat-value { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat-value.small { font-size: 14px; font-weight: 550; }
.stat.highlight { border-color: rgba(245, 165, 36, .42); background: var(--gold-soft); }
.stat.highlight .stat-value { color: var(--gold); }
.stat.note { display: flex; flex-direction: column; justify-content: center; }
.stat.note .stat-value { font-size: 12.5px; color: var(--muted); font-weight: 500; }

.toolbar {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.filters { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.results { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }

/* 航班卡片 */
.flight-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .16s ease, transform .16s ease;
}

.flight-card:hover { border-color: #33507c; }
.flight-card.best { border-left: 3px solid var(--gold); }

.fc-main {
  display: flex;
  gap: 20px;
  padding: 16px 18px;
  align-items: center;
  flex-wrap: wrap;
}

.fc-airline { display: flex; align-items: center; gap: 10px; min-width: 168px; flex: 0 1 auto; }
.fc-logo { width: 34px; height: 34px; object-fit: contain; border-radius: 6px; background: #fff; padding: 3px; }
.fc-logo-fallback {
  width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center;
  background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 700;
}
.fc-airline-names { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fc-airline-name { font-size: 13px; font-weight: 600; }
.fc-flight-no { font-size: 11.5px; color: var(--muted-2); font-family: var(--mono); }

.fc-route { display: flex; align-items: center; gap: 14px; flex: 1 1 320px; min-width: 280px; }
.fc-point { display: flex; flex-direction: column; gap: 1px; min-width: 74px; }
.fc-time { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.fc-code { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.fc-point.right { text-align: right; align-items: flex-end; }

.fc-line { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 92px; }
.fc-duration { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.fc-track { width: 100%; height: 2px; background: var(--border); position: relative; border-radius: 2px; }
.fc-track::before, .fc-track::after {
  content: ""; position: absolute; top: 50%; width: 5px; height: 5px; border-radius: 50%;
  background: var(--muted); transform: translateY(-50%);
}
.fc-track::before { left: 0; }
.fc-track::after { right: 0; }
.fc-stops { font-size: 11px; color: var(--cyan); white-space: nowrap; }
.fc-stops.nonstop { color: var(--ok); }
.fc-stops.multi { color: var(--gold); }

.fc-price { text-align: right; min-width: 132px; flex: 0 0 auto; margin-left: auto; }
.fc-price-value { font-size: 21px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.fc-price-note { font-size: 11px; color: var(--muted-2); }
.fc-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.badge.gold { border-color: rgba(245, 165, 36, .42); background: var(--gold-soft); color: var(--gold); }
.badge.ok { border-color: rgba(47, 208, 122, .38); background: var(--ok-soft); color: var(--ok); }
.badge.cyan { border-color: rgba(34, 211, 238, .34); background: rgba(34, 211, 238, .12); color: var(--cyan); }
.badge.danger { border-color: rgba(242, 85, 90, .38); background: var(--danger-soft); color: #ff9a9d; }

.fc-tags { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 18px 12px; }

.fc-detail {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
  padding: 16px 18px;
  display: none;
}

.fc-detail.open { display: block; animation: fade .18s ease; }

.leg { display: flex; gap: 14px; padding: 10px 0; }
.leg + .leg { border-top: 1px dashed var(--border-soft); }
.leg-rail { display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 4px; }
.leg-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--accent); background: var(--bg); }
.leg-dot.fill { background: var(--accent); }
.leg-line { flex: 1; width: 1px; background: var(--border); min-height: 22px; }
.leg-body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.leg-title { font-size: 13px; font-weight: 600; }
.leg-meta { font-size: 11.5px; color: var(--muted-2); }
.leg-ext { font-size: 11.5px; color: var(--muted); }

.layover {
  margin: 4px 0 4px 24px;
  padding: 7px 12px;
  border-left: 2px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: #f3cd8f;
}

/* 酒店卡片 */
.hotel-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  gap: 0;
  overflow: hidden;
  transition: border-color .16s ease;
}

.hotel-card:hover { border-color: #33507c; }

.hc-media { flex: 0 0 220px; background: var(--panel-2); position: relative; min-height: 168px; }
.hc-media img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
.hc-media-empty { display: grid; place-items: center; color: var(--muted-2); font-size: 26px; height: 100%; }

.hc-body { flex: 1 1 auto; padding: 15px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hc-head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.hc-name { font-size: 15.5px; font-weight: 650; margin: 0; flex: 1 1 auto; min-width: 0; }
.hc-type { font-size: 11px; color: var(--muted-2); text-transform: capitalize; }
.hc-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.rating-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 650;
  padding: 3px 9px; border-radius: 6px;
}

.reviews { font-size: 11.5px; color: var(--muted-2); }
.stars { color: var(--gold); font-size: 12px; letter-spacing: 1px; }

.amenities { display: flex; gap: 6px; flex-wrap: wrap; }
.amenity {
  font-size: 11px; color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  padding: 3px 8px; border-radius: 5px;
}

.hc-nearby { font-size: 11.5px; color: var(--muted-2); }

.hc-price {
  flex: 0 0 186px;
  padding: 15px 18px;
  border-left: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  background: var(--bg-soft);
}

.hc-price-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hc-price-unit { font-size: 11px; color: var(--muted-2); }
.hc-total { font-size: 12px; color: var(--muted); }
.hc-deal { font-size: 11.5px; color: var(--ok); }

/* 空状态 / 加载 */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.empty-icon { font-size: 34px; margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 15px; font-weight: 600; }
.empty p { margin: 0; font-size: 13px; }

.skeleton { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.sk-line {
  height: 13px;
  border-radius: 5px;
  background: linear-gradient(90deg, #1a2434 25%, #243146 50%, #1a2434 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
  margin-bottom: 11px;
}
.sk-line.w40 { width: 40%; } .sk-line.w60 { width: 60%; } .sk-line.w80 { width: 80%; } .sk-line.w25 { width: 25%; }

@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* 提示条 */
.toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  max-width: 420px;
}

.toast {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: slide .22s ease;
}

.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--gold); }

@keyframes slide { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }

/* 页脚 */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 18px 26px 26px;
  max-width: 1320px;
  margin: 0 auto;
  font-size: 12px;
  color: var(--muted-2);
}
.footer p { margin: 3px 0; }
.footer .muted { color: #4d5c71; }

/* ------------------------------ 设置弹窗 ------------------------------ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(4, 7, 12, 0.74);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop[hidden] { display: none; }

.modal {
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop .18s ease;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(.995); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-head h2 { margin: 0; font-size: 15px; font-weight: 650; }

.modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 5px;
  border-radius: 6px;
}

.modal-close:hover { color: var(--text); background: var(--panel-2); }

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-section { display: flex; flex-direction: column; gap: 10px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.section-head h3 { margin: 0; font-size: 13px; font-weight: 650; }

.section-hint { font-size: 11.5px; color: var(--muted-2); font-family: var(--mono); }
.section-hint.ok { color: var(--ok); }
.section-hint.bad { color: var(--danger); }

.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hint { margin: 0; font-size: 11.5px; color: var(--muted-2); line-height: 1.65; }

.hint code {
  font-family: var(--mono);
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--muted);
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
  flex-wrap: wrap;
}

.foot-hint { font-size: 11.5px; color: var(--muted-2); max-width: 60%; }
.foot-actions { display: flex; gap: 10px; margin-left: auto; }

/* ------------------------------ 加载更多 / 详情弹窗 ------------------------------ */

.load-more-wrap { display: flex; justify-content: center; padding: 6px 0 2px; }

.hc-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.modal-wide { max-width: 900px; }

.hdet-top { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.hdet-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hdet-address { font-size: 12.5px; color: var(--muted); line-height: 1.65; }

.hdet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 10px;
}

.hdet-box {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.hdet-box .k { font-size: 11px; color: var(--muted-2); }
.hdet-box .v { font-size: 14px; font-weight: 600; margin-top: 2px; }

.hdet-section-title {
  font-size: 12.5px;
  font-weight: 650;
  margin: 4px 0 8px;
  color: var(--text);
}

.hdet-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.hdet-images img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
}

.hdet-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.hdet-bar-label { width: 34px; flex-shrink: 0; }

/* track / fill 都是 span，必须显式 block，否则行内元素忽略 height，进度条不显示 */
.hdet-bar-track {
  display: block;
  flex: 1;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  overflow: hidden;
}

.hdet-bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.hdet-topic {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border-soft);
}

.hdet-topic .pos { color: var(--ok); }
.hdet-topic .neg { color: var(--danger); }

.hdet-amenity-group { margin-bottom: 10px; }
.hdet-amenity-group .g { font-size: 11.5px; color: var(--muted-2); margin-bottom: 5px; }

.amenity.off { opacity: .42; text-decoration: line-through; }

/* ============================ 价格监控 ============================ */

.btn.danger { color: var(--danger); border-color: var(--danger-soft); }
.btn.danger:hover { border-color: var(--danger); color: #fff; background: var(--danger-soft); }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

.section-title { margin: 30px 0 12px; font-size: 14px; font-weight: 600; color: var(--text); }

.monitor-bar {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch;
  justify-content: space-between; margin-bottom: 14px;
}
.monitor-summary { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 12px; flex: 1 1 480px; }
.monitor-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.ms-card {
  background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 12px 14px;
}
.ms-label { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.ms-value { font-size: 19px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ms-value span { font-size: 12px; font-weight: 500; color: var(--muted); }
.ms-value.bad { color: var(--danger); }
.ms-sub { margin-top: 5px; font-size: 11px; color: var(--muted-2); }
.ms-bar { margin-top: 9px; height: 5px; border-radius: 3px; background: var(--bg-soft); overflow: hidden; }
.ms-bar span { display: block; height: 100%; border-radius: 3px; background: var(--ok); }
.ms-bar.warn span { background: var(--gold); }
.ms-bar.over span { background: var(--danger); }

.monitor-hint {
  margin: 0 0 14px; padding: 10px 13px; border-radius: var(--radius-sm); font-size: 12.5px;
  line-height: 1.6; border: 1px solid var(--border-soft); background: var(--bg-soft); color: var(--muted);
}
.monitor-hint.warn { border-color: var(--gold-soft); background: var(--gold-soft); color: var(--gold); }

.monitor-list { display: grid; gap: 12px; }
.monitor-empty {
  text-align: center; padding: 46px 20px; border: 1px dashed var(--border);
  border-radius: var(--radius); background: var(--bg-soft);
}
.monitor-empty .me-icon { font-size: 30px; margin-bottom: 10px; }
.monitor-empty h3 { margin: 0 0 8px; font-size: 15px; color: var(--text); }
.monitor-empty p { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.monitor-empty .muted { color: var(--muted-2); font-size: 11.5px; }

.monitor-card {
  background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.monitor-card.is-paused { opacity: .62; }

.mc-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.mc-kind {
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
}
.mc-kind.flight { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }
.mc-kind.hotel { color: var(--cyan); border-color: rgba(34, 211, 238, .22); background: rgba(34, 211, 238, .13); }
.mc-name { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--text); flex: 1 1 auto; }

.pill { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: var(--ok-soft); background: var(--ok-soft); }
.pill.error { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.pill.paused { color: var(--muted-2); }

.mc-route { margin: 7px 0 11px; font-size: 12.5px; color: var(--muted); font-family: var(--mono); }

.mc-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 11px; }
.mc-metric { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 8px 11px; }
.mc-metric span { display: block; font-size: 10.5px; color: var(--muted-2); margin-bottom: 3px; }
.mc-metric b { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.mc-metric b.good { color: var(--ok); }

.mc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mc-meta { font-size: 11px; color: var(--muted-2); }
.mc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mc-error { margin: 9px 0 0; font-size: 11.5px; color: var(--danger); }

.alerts-list { display: grid; gap: 6px; }
.alert-row {
  display: grid; grid-template-columns: 88px minmax(120px, 1.4fr) 100px 130px 90px;
  gap: 10px; align-items: center; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--border-soft); font-size: 12px;
}
.alert-row.below_target { border-color: var(--ok-soft); }
.alert-row.new_low { border-color: var(--accent-soft); }
.alert-row.error { border-color: var(--danger-soft); }
.alert-kind { font-size: 11px; color: var(--muted); }
.alert-row.below_target .alert-kind { color: var(--ok); }
.alert-row.new_low .alert-kind { color: var(--accent); }
.alert-row.error .alert-kind { color: var(--danger); }
.alert-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-price { font-variant-numeric: tabular-nums; color: var(--text); }
.alert-status { color: var(--muted-2); font-size: 11px; }
.alert-time { color: var(--muted-2); font-size: 11px; text-align: right; font-family: var(--mono); }

.modal-notes {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--gold-soft); border: 1px solid var(--gold-soft);
  color: var(--gold); font-size: 12px; line-height: 1.7;
}

.hist-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.hist-metrics div { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 9px 12px; }
.hist-metrics span { display: block; font-size: 10.5px; color: var(--muted-2); margin-bottom: 3px; }
.hist-metrics b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }

.price-chart { width: 100%; height: auto; display: block; margin-bottom: 14px; }

.hist-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.hist-table th {
  text-align: left; padding: 7px 8px; color: var(--muted-2); font-weight: 500;
  border-bottom: 1px solid var(--border-soft); font-size: 11px;
}
.hist-table td { padding: 7px 8px; border-bottom: 1px solid var(--border-soft); color: var(--muted); }
.hist-table td.bad { color: var(--danger); }
.hist-table .muted { color: var(--muted-2); text-align: center; }

/* 响应式 */
@media (max-width: 900px) {
  .topbar { padding: 14px 16px; }
  main { padding: 18px 16px 32px; }
  .tabs { padding: 12px 16px 0; }
  .hotel-card { flex-direction: column; }
  .hc-media { flex: 0 0 190px; }
  .hc-price { flex: 1 1 auto; border-left: none; border-top: 1px solid var(--border-soft);
              align-items: flex-start; flex-direction: row; justify-content: space-between; }
  .fc-price { margin-left: 0; text-align: left; }
  .field.narrow { flex: 1 1 100px; }
}

@media (max-width: 900px) {
  .monitor-summary { grid-template-columns: 1fr; }
  .monitor-actions { width: 100%; }
  .mc-metrics { grid-template-columns: repeat(2, 1fr); }
  .alert-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .alert-time { text-align: left; }
  .hist-metrics { grid-template-columns: repeat(2, 1fr); }
  .mc-foot { flex-direction: column; align-items: flex-start; }
}
