/* ============================================================
   TravelRadar — 背包客/自由行旅游风险警示 (原型演示站)
   移动优先响应式样式
   ============================================================ */

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1d2330;
  --ink-2: #5b6472;
  --line: #e3e6ec;
  --brand: #1f4fd8;
  --brand-dark: #183aa0;
  --stable: #2e9e5b;
  --attention: #d8930a;
  --warning: #d23a2d;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(23, 32, 56, .08), 0 6px 18px rgba(23, 32, 56, .05);
  --shadow-lg: 0 10px 30px rgba(23, 32, 56, .12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--ink); white-space: nowrap; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #7a4dd8);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--ink-2); padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.nav-links a:hover { background: #eef1f7; color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--brand); background: #edf1ff; }

/* ---------- 布局 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.main { padding: 22px 0 60px; min-height: 70vh; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px;
}
.card + .card { margin-top: 16px; }

.section-title { font-size: 18px; font-weight: 700; margin: 26px 0 14px; display: flex; align-items: center; gap: 8px; }
.section-title:first-child { margin-top: 6px; }
.section-title .sub { font-size: 13px; font-weight: 400; color: var(--ink-2); }

/* ---------- 英雄区 + 搜索 ---------- */
.hero {
  background: linear-gradient(135deg, #16285c, #1f4fd8 55%, #5a3fb8);
  color: #fff; border-radius: 16px; padding: 34px 26px; margin-bottom: 22px;
  box-shadow: var(--shadow-lg);
}
.hero h1 { font-size: 26px; letter-spacing: .5px; margin-bottom: 8px; }
.hero p { color: #dbe4ff; font-size: 14px; max-width: 640px; }

.search-box {
  margin-top: 20px; display: flex; gap: 8px; flex-wrap: wrap;
  background: #fff; border-radius: 12px; padding: 6px;
  box-shadow: var(--shadow);
}
.search-box input {
  flex: 1; min-width: 200px; border: none; outline: none;
  font-size: 15px; padding: 10px 12px; background: transparent; color: var(--ink);
}
.search-box button {
  background: var(--brand); color: #fff; border: none; border-radius: 8px;
  padding: 10px 22px; font-size: 15px; cursor: pointer; font-weight: 600;
}
.search-box button:hover { background: var(--brand-dark); }

.search-hint { margin-top: 10px; font-size: 13px; color: rgba(255,255,255,.85); }
.search-hint .pill {
  display: inline-block; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.32);
  color: #fff; padding: 2px 10px; border-radius: 20px; margin: 3px 4px 0 0; cursor: pointer; font-size: 12px;
}
.search-hint .pill:hover { background: rgba(255,255,255,.32); color: #fff; text-decoration: none; }

/* ---------- 风险标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 6px; white-space: nowrap;
}
.tag .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.level-stable   { color: var(--stable);   background: #e6f6ec; }
.level-attention{ color: var(--attention);background: #fdf3dd; }
.level-warning  { color: var(--warning);  background: #fde9e7; }

.pill-label { font-size: 12px; color: var(--ink-2); font-weight: 500; }

/* ---------- AI 自动核验显著标志 ---------- */
.ai-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #7a3ff2, #b02bd8);
  border: 1px solid #7a3ff2; border-radius: 6px; padding: 3px 9px;
  white-space: nowrap; letter-spacing: .3px;
}
.ai-badge .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: #9dffc9;
  box-shadow: 0 0 0 0 rgba(157,255,201,.7);
  animation: aiPulse 1.6s infinite;
}
@keyframes aiPulse {
  0%   { box-shadow: 0 0 0 0 rgba(157,255,201,.7); }
  70%  { box-shadow: 0 0 0 6px rgba(157,255,201,0); }
  100% { box-shadow: 0 0 0 0 rgba(157,255,201,0); }
}
.ai-notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: linear-gradient(135deg, #f3ecff, #fbeafa);
  border: 1px solid #cfb3f2; border-radius: 10px;
  padding: 11px 14px; color: #5726a8; font-size: 13px; margin-bottom: 14px;
}
.ai-notice b { font-weight: 700; }

/* ---------- 后台自动核验面板 ---------- */
.verify-panel {
  border: 1px dashed #b9a0e8; background: #faf7ff; border-radius: 10px;
  padding: 12px 14px; margin-top: 10px; font-size: 13px;
}
.verify-panel .vp-head { font-weight: 700; color: #5f2bb0; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.verify-model { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.verify-model .v-name { width: 96px; font-weight: 600; }
.verify-model .v-verdict { font-size: 12.5px; }
.v-ok    { color: #2e9e5b; font-weight: 700; }
.v-fail  { color: #d23a2d; font-weight: 700; }
.consensus { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e4d6f7; font-size: 12.5px; }

/* ---------- 人工审核标签 ---------- */
.ai-badge.human {
  background: linear-gradient(135deg, #b8730a, #d8930a);
  border-color: #d8930a;
}
.ai-badge.human .pulse { background: #fff3c4; box-shadow: 0 0 0 0 rgba(255,243,196,.8); }

.note-line { font-size: 12px; margin-top: 6px; color: var(--ink-2); line-height: 1.6; }

/* ---------- 发布模式切换 ---------- */
.mode-switch { display: flex; gap: 12px; flex-wrap: wrap; }
.mode-btn {
  flex: 1; min-width: 240px; border: 2px solid var(--line); background: #fff;
  border-radius: 12px; padding: 14px 16px; cursor: pointer; text-align: left;
  transition: border-color .12s ease, background .12s ease, transform .12s ease;
}
.mode-btn:hover { transform: translateY(-2px); }
.mode-btn .mtitle { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.mode-btn .mdesc { color: var(--ink-2); font-size: 12.5px; margin-top: 6px; line-height: 1.6; }
.mode-btn .mbadge { font-size: 11px; font-weight: 700; border-radius: 5px; padding: 2px 7px; margin-top: 8px; display: inline-block; }
.mode-btn.active.ai    { border-color: #7a3ff2; background: #faf7ff; }
.mode-btn.active.human { border-color: #d8930a; background: #fff9ec; }
.mode-btn.ai    .mbadge { background: linear-gradient(135deg,#7a3ff2,#b02bd8); color: #fff; }
.mode-btn.human .mbadge { background: linear-gradient(135deg,#b8730a,#d8930a); color: #fff; }
.mode-btn.active.ai    .mbadge { box-shadow: 0 0 0 2px rgba(122,63,242,.35); }
.mode-btn.active.human .mbadge { box-shadow: 0 0 0 2px rgba(216,147,10,.35); }

/* ---------- 地区 → 国家 → 城市 分类浏览 ---------- */
.region-group { border: 1px solid var(--line); border-radius: 14px; background: #fff; margin-bottom: 12px; overflow: hidden; }
.region-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 16px; border: 0;
  background: #f7f8fb; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--ink); }
.region-head:hover { background: #eef1f7; }
.region-head .gmeta { font-weight: 500; font-size: 12.5px; color: var(--ink-2); margin-left: auto; }
.region-head .chevg { color: var(--ink-2); transition: transform .15s ease; }
.region-group.open .region-head .chevg { transform: rotate(180deg); }
.region-group.open .region-body { display: block; animation: fadeIn .18s ease; }
.region-body { padding: 4px 16px 14px; display: none; }
.geo-country { border-bottom: 1px dashed #e7e9f0; padding: 12px 0; }
.geo-country:last-child { border-bottom: 0; }
.geo-c-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.geo-c-title .cname { font-size: 16px; font-weight: 700; color: var(--ink); text-decoration: none; }
.geo-c-title .cname:hover { color: var(--brand); }
.city-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.city-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: #fff;
  border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--ink); text-decoration: none; }
.city-chip:hover { border-color: var(--brand); color: var(--brand); box-shadow: 0 2px 6px rgba(31,79,216,.12); }
.city-chip .tag { margin: 0; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 国家详情页的「城市」区块 */
.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.city-tile { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; text-decoration: none; transition: all .12s ease; }
.city-tile:hover { border-color: var(--brand); box-shadow: 0 3px 10px rgba(1,79,216,.10); transform: translateY(-1px); }
.city-tile .tt { display: flex; flex-direction: column; gap: 2px; }
.city-tile .tt b { font-size: 15px; color: var(--ink); }
.city-tile .tt span { font-size: 12px; color: var(--ink-2); }
.city-tile .tag { margin: 0; flex-shrink: 0; }
.related-link { display: inline-block; margin-top: 6px; font-size: 13px; }

.updated-at { font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.updated-at::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3bb46b; display: inline-block; }

/* ---------- 风险速览网格 ---------- */
.overview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.dest-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  position: relative; overflow: hidden;
}
.dest-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.dest-card .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dest-card .name { font-size: 17px; font-weight: 700; }
.dest-card .en { font-size: 12px; color: var(--ink-2); }
.dest-card .score {
  font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums;
}
.dest-card .score small { font-size: 11px; font-weight: 500; color: var(--ink-2); }
.dest-card .tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.dest-card .foot {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line);
  display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2);
}
.dest-card .foot .region { font-weight: 600; color: var(--ink); }

.bar-score { height: 6px; background: #eef1f6; border-radius: 4px; margin-top: 8px; overflow: hidden; }
.bar-score i { display: block; height: 100%; border-radius: 4px; }

/* ---------- 要闻列表 ---------- */
.news-list { list-style: none; }
.news-list li {
  padding: 12px 2px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start;
}
.news-list li:last-child { border-bottom: none; }
.news-list .news-tag {
  flex: 0 0 auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-top: 3px;
}
.news-list .news-title { font-weight: 600; font-size: 15px; }
.news-list .news-meta { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

.flag-warning { background: #fde9e7; color: var(--warning); }
.flag-attention { background: #fdf3dd; color: var(--attention); }
.flag-stable { background: #e6f6ec; color: var(--stable); }

/* ---------- 详情页 ---------- */
.crumb { font-size: 13px; color: var(--ink-2); margin-bottom: 14px; }
.crumb a { color: var(--ink-2); }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.detail-head h1 { font-size: 28px; line-height: 1.3; }
.detail-head .en { color: var(--ink-2); font-size: 14px; font-weight: 400; margin-left: 6px; }
.detail-head .score-box { text-align: center; }
.detail-head .score-big { font-size: 34px; font-weight: 800; }
.detail-head .score-big small { font-size: 13px; font-weight: 500; color: var(--ink-2); }

.risk-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 18px; }
.risk-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 10px; background: #fbfcfe;
  display: flex; flex-direction: column; gap: 6px;
}
.risk-item .cat { font-size: 13px; font-weight: 700; }
.risk-item .note { font-size: 12px; color: var(--ink-2); flex: 1; }
.risk-item .src { font-size: 12px; }
.risk-item .src a { color: var(--brand); }

.timebar { border-left: 2px solid var(--line); margin: 14px 0 6px 8px; padding-left: 18px; }
.time-item { position: relative; padding: 10px 0; }
.time-item::before {
  content: ""; position: absolute; left: -24px; top: 16px;
  width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--ink-2);
}
.time-item[data-tag="warning"]::before { border-color: var(--warning); }
.time-item[data-tag="attention"]::before { border-color: var(--attention); }
.time-item .t-time { font-size: 12px; color: var(--ink-2); }
.time-item .t-title { font-weight: 600; margin: 2px 0; }
.time-item .t-src { font-size: 12px; color: var(--ink-2); }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.info-grid .cell { background: #fbfcfe; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.info-grid .cell h3 { font-size: 14px; margin-bottom: 6px; }
.info-grid .cell p, .info-grid .cell li { font-size: 13.5px; color: var(--ink); }
.info-grid .cell ul { padding-left: 18px; }
.kv { font-size: 13.5px; line-height: 1.9; }
.kv b { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand); color: #fff; border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.ghost:hover { background: #edf1ff; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: #fff; color: var(--warning); border: 1px solid var(--warning); }
.btn.danger:hover { background: #fde9e7; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- 通知条 ---------- */
.notice {
  background: #fff8e1; border: 1px solid #f0e0a8; color: #7a5c00;
  border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}
.notice.info { background: #edf1ff; border-color: #c8d4f8; color: #1f3a8f; }
.notice.success { background: #e6f6ec; border-color: #bfe4cd; color: #1f6a3d; }

/* ---------- 表格 ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: #f6f8fb; font-weight: 600; white-space: nowrap; }
.tbl tr:hover td { background: #fafbfe; }

/* ---------- 表格/后台 ---------- */
.queue-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.queue-item .q-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.queue-item .q-title { font-weight: 700; font-size: 15px; }
.queue-item .q-desc { font-size: 13px; color: var(--ink); margin: 8px 0; background: #f7f8fb; border-radius: 8px; padding: 10px 12px; }
.queue-item .q-meta { font-size: 12px; color: var(--ink-2); display: flex; gap: 14px; flex-wrap: wrap; }
.queue-item .q-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .n { font-size: 26px; font-weight: 800; }
.stat .l { font-size: 12.5px; color: var(--ink-2); }

/* ---------- 路线规划 ---------- */
.route-input { display: flex; flex-direction: column; gap: 10px; }
.stop-row { display: flex; gap: 8px; align-items: center; }
.stop-row input { flex: 1; }
.stop-row .step { flex: 0 0 24px; font-weight: 700; color: var(--brand); }

input[type="text"], input[type="email"], input[type="password"], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 14px;
  outline: none; background: #fff; color: var(--ink); font-family: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }

.route-result { margin-top: 18px; }
.route-seg {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.route-seg .seg-name { flex: 1; font-weight: 600; }
.route-seg .arrow { color: var(--ink-2); }

.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; margin-top: 8px; }
.legend .lg { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); background: #fff; margin-top: 40px; }
.footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 26px 16px;
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between;
  font-size: 13px; color: var(--ink-2);
}
.footer-inner .col h4 { color: var(--ink); font-size: 14px; margin-bottom: 8px; }
.footer-inner .col a { display: block; color: var(--ink-2); padding: 3px 0; }
.footer-inner .col a:hover { color: var(--brand); }
.footer-note { max-width: 1080px; margin: 0 auto; padding: 0 16px 20px; font-size: 12px; color: #8a93a3; }

/* ---------- 通用 ---------- */
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.muted { color: var(--ink-2); }
.flex { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--ink-2); padding: 30px 0; }
.backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 90; display: none; align-items: center; justify-content: center; padding: 16px; }
.backdrop.show { display: flex; }
.modal { background: #fff; border-radius: 14px; max-width: 440px; width: 100%; padding: 20px; box-shadow: var(--shadow-lg); }
.modal h3 { margin-bottom: 10px; }
.modal .row { margin: 10px 0; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* ---------- 账号(注册/登录) ---------- */
.auth-tabs { display: flex; gap: 8px; }
.auth-tab { flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: 14px; text-align: center; }
.auth-tab.on { border-color: var(--brand); color: var(--brand); background: #f2f6ff; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.field input { width: 100%; }
.auth-msg { min-height: 18px; font-size: 13px; margin: 2px 0 8px; }
.auth-msg.err { color: var(--ink-danger, #d23a2d); }
.auth-msg.ok { color: #2e9e5b; }

.demo-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: #7a5c00;
  background: #fff4d6; border: 1px solid #f0e0a8; padding: 3px 9px; border-radius: 20px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .risk-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .overview-grid { grid-template-columns: 1fr; }
  .risk-grid { grid-template-columns: 1fr 1fr; }
  .nav { gap: 8px; }
  .nav-links a { padding: 6px 8px; font-size: 13px; }
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: 21px; }
  .detail-head h1 { font-size: 23px; }
  .score-big { font-size: 28px !important; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}
