:root {
  --brand: #185FA5;
  --brand-light: #E6F1FB;
  --accent: #0F6E56;
  --bg: #F4F6F9;
  --card: #FFFFFF;
  --text: #1F2329;
  --text-2: #646A73;
  --text-3: #8F959E;
  --border: #E5E8EC;
  --danger: #A32D2D;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 64px;
}
a { color: var(--brand); text-decoration: none; }
.page { max-width: 640px; margin: 0 auto; }

/* 顶部头 */
.topbar {
  background: linear-gradient(135deg, #185FA5 0%, #2C7BC9 100%);
  color: #fff;
  padding: 18px 16px 16px;
}
.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar .sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.topbar .sub a { color: #fff; }

/* 搜索区 */
.search-wrap { padding: 14px 16px 18px; background: #fff; border-bottom: 1px solid var(--border); }
.search-row { display: flex; gap: 8px; }
.search-input {
  flex: 1; height: 42px; border: 1.5px solid var(--border); border-radius: 21px;
  padding: 0 16px; font-size: 15px; outline: none; background: var(--bg); color: var(--text);
}
.search-input:focus { border-color: var(--brand); background: #fff; }
.search-btn {
  height: 42px; padding: 0 20px; border: none; border-radius: 21px;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 500;
}
.search-btn:active { opacity: .85; }
.tab-switch { display: flex; gap: 8px; margin-bottom: 12px; }
.tab-switch button {
  flex: 1; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-2); font-size: 14px;
}
.tab-switch button.on { background: var(--brand-light); border-color: var(--brand); color: var(--brand); font-weight: 500; }

/* 热词与宫格 */
.hot-words { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hot-words .tag {
  font-size: 13px; color: var(--text-2); background: var(--bg);
  border-radius: 14px; padding: 4px 12px;
}
.section { padding: 16px; }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.region-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.region-grid a {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  text-align: center; padding: 10px 0; font-size: 13px; color: var(--text-2);
}
.quick-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 8px; text-align: center; color: var(--text);
}
.quick-card .ic { font-size: 22px; line-height: 1; margin-bottom: 6px; }
.quick-card .t { font-size: 13px; font-weight: 500; }
.quick-card .d { font-size: 11px; color: var(--text-3); }
.quick-card.disabled { opacity: .55; }

/* 筛选条 */
.filter-bar { background: #fff; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-row + .filter-row { margin-top: 8px; }
.filter-label { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.chip {
  font-size: 13px; padding: 4px 12px; border-radius: 14px;
  border: 1px solid var(--border); color: var(--text-2); background: #fff; cursor: pointer;
}
.chip.on { background: var(--brand-light); border-color: var(--brand); color: var(--brand); font-weight: 500; }
select.chip { height: 30px; padding: 0 8px; background: #fff; }

/* 列表卡片 */
.list { padding: 12px 16px; }
.card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--border);
  padding: 14px; margin-bottom: 10px; display: block; color: var(--text);
}
.card:active { background: #FAFBFC; }
.card .name { font-size: 16px; font-weight: 600; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: var(--brand-light); color: var(--brand);
}
.badge.lv-zhongzhi { background: #F4C0D1; color: #993556; }
.badge.lv-gaozhi { background: #B5D4F4; color: #0C447C; }
.badge.lv-jigong { background: #C0DD97; color: #27500A; }
.badge.mban { background: #F1EFE8; color: #854F0B; }
.badge.gongban { background: #E1F5EE; color: #0F6E56; }
.badge.ad { background: #A32D2D; color: #fff; font-weight: 500; }
.card .desc { font-size: 13px; color: var(--text-2); margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .extra { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.empty { text-align: center; color: var(--text-3); font-size: 14px; padding: 48px 0; }

/* 详情页 */
.detail-head { background: #fff; padding: 18px 16px; border-bottom: 1px solid var(--border); }
.detail-head .name { font-size: 20px; font-weight: 600; }
.detail-head .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.info-block { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); padding: 14px 16px; margin: 12px 16px; }
.info-block h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.kv { display: flex; font-size: 14px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: none; }
.kv .k { width: 88px; flex-shrink: 0; color: var(--text-3); font-size: 13px; }
.kv .v { flex: 1; color: var(--text); word-break: break-all; }
.info-block p { font-size: 14px; color: var(--text-2); }
.career-list li { font-size: 14px; color: var(--text-2); margin: 6px 0 6px 18px; }
.disclaimer {
  font-size: 11px; color: var(--text-3); text-align: center; padding: 16px; line-height: 1.7;
}
.cta {
  display: block; margin: 12px 16px; padding: 12px; text-align: center;
  background: var(--brand-light); color: var(--brand); border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
}
.cta:active { opacity: .8; }

/* 测试壳（老 v2 hero 已由下方 v3 .test-hero 取代，保留 .test-hero .t/.d 兼容） */
.test-hero .t { font-size: 20px; font-weight: 600; }
.test-hero .d { font-size: 13px; opacity: .9; margin-top: 8px; }

/* 底部 TabBar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: #fff; border-top: 1px solid var(--border);
  display: flex; max-height: 64px;
}
.tabbar .inner { display: flex; width: 100%; max-width: 640px; margin: 0 auto; }
.tabbar a {
  flex: 1; text-align: center; padding: 8px 0 6px; color: var(--text-3); font-size: 11px;
}
.tabbar a .ic { font-size: 20px; line-height: 1.2; display: block; }
.tabbar a.on { color: var(--brand); }

.count-note { font-size: 12px; color: var(--text-3); padding: 8px 16px 0; }

/* ===== V2 职业测试 ===== */
.test-stage { padding: 16px; }
.test-progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin: 4px 16px 14px; }
.test-progress > i { display: block; height: 100%; background: linear-gradient(90deg,#534AB7,#7F77DD); transition: width .25s; }
.test-progress-txt { font-size: 12px; color: var(--text-3); text-align: center; margin-top: -6px; }
.q-text { font-size: 17px; font-weight: 600; line-height: 1.55; margin: 6px 16px 18px; }
.opt-btn {
  display: block; width: 100%; text-align: left; background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 16px 16px; margin: 0 16px 12px; font-size: 15px; color: var(--text);
  cursor: pointer; transition: .15s;
}
.opt-btn:active { border-color: #534AB7; background: #F3F1FC; transform: scale(.99); }
.opt-btn .ix { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center;
  border-radius: 50%; background: var(--brand-light); color: var(--brand); font-size: 13px; margin-right: 10px; font-weight: 600; }
.test-actions { padding: 8px 16px 0; }
.btn-primary {
  display: block; width: 100%; border: none; border-radius: var(--radius); padding: 14px;
  background: linear-gradient(135deg,#534AB7,#7F77DD); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn-primary:active { opacity: .88; }
.btn-ghost {
  display: block; width: 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
  background: #fff; color: var(--text-2); font-size: 14px; margin-top: 10px; cursor: pointer;
}

/* 结果页 */
.result-hero { background: linear-gradient(135deg,#534AB7,#7F77DD); color:#fff; margin:16px; border-radius:16px; padding:22px 20px; }
.result-hero .t { font-size: 14px; opacity:.9; }
.result-hero .code { font-size: 30px; font-weight: 700; letter-spacing: 2px; margin: 8px 0 4px; }
.result-hero .code small { font-size: 14px; font-weight: 500; opacity:.9; margin-left:8px; letter-spacing:0; }
.result-hero .desc { font-size: 13px; opacity: .92; margin-top: 8px; line-height: 1.6; }
.holland-tags { display:flex; flex-wrap:wrap; gap:8px; padding: 0 16px 4px; }
.holland-tags .ht { font-size:13px; padding:5px 12px; border-radius:14px; color:#fff; font-weight:500; }
.ht-R{background:#C0563B;} .ht-I{background:#2C7BC9;} .ht-A{background:#9B4FB0;}
.ht-S{background:#0F9D6B;} .ht-E{background:#D98A1F;} .ht-C{background:#5B6B7B;}
.match-card { background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:14px; margin:10px 16px; }
.match-card .top { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.match-card .mn { font-size:16px; font-weight:600; }
.match-card .match { font-size:12px; color:#0F6E56; background:#E1F5EE; padding:2px 8px; border-radius:10px; white-space:nowrap; }
.match-card .reason { font-size:13px; color:var(--text-2); margin-top:6px; }
.match-card .schools { margin-top:10px; border-top:1px dashed var(--border); padding-top:10px; }
.match-card .school-row { display:flex; justify-content:space-between; align-items:center; font-size:13px; padding:4px 0; }
.match-card .school-row .sn { color:var(--text); }
.match-card .school-row .sc { color:var(--text-3); font-size:12px; }
.match-card .school-row .ad { background:#A32D2D; color:#fff; font-size:10px; padding:1px 6px; border-radius:8px; margin-left:6px; }
.pre-major { background:#FFF7E8; border:1px solid #F0D8A0; border-radius:var(--radius); padding:14px; margin:12px 16px; font-size:14px; }
.pre-major b { color:#854F0B; }

/* ===== 轮播广告位 ===== */
#adSlot {
  margin: 0 16px 18px;         /* 底部留白加大 8→18，把"查学校"往下挪 */
  padding-top: 24px;           /* 顶部留白加大 14→24，让广告与头部明显分离 */
  background: transparent;
  display: flow-root;         /* 再加一层 BFC 防御 */
}
.ad-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(20, 40, 80, .10);
  overflow: hidden;
}
.ad-carousel { position: relative; height: 120px; border-radius: 14px 14px 0 0; overflow: hidden; background: var(--brand); }
.ad-slide {
  position: absolute; inset: 0; opacity: 0; visibility: hidden;
  transition: opacity .4s ease; pointer-events: none;
}
.ad-slide.on { opacity: 1; visibility: visible; pointer-events: auto; }
.ad-slide .ad-bg { position: absolute; inset: 0; background-size: cover; background-position: center; background-repeat: no-repeat; }
.ad-slide .ad-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px; font-weight: 600; padding: 0 16px; text-align: center;
}
.ad-cap {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 16px; line-height: 1.3; font-weight: 600;
  max-width: calc(100% - 24px); text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,.55), 0 0 1px rgba(0,0,0,.4);
  white-space: nowrap;
}
.ad-cap .badge {
  display: inline-block;
  background: #FFC93C; color: #5A3500;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 6px;
  margin-left: 6px; vertical-align: 1px;
  letter-spacing: 0;
  text-shadow: none;
  box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
/* 独立角标（HTML 层，浮在 SVG 背景之上）：不被 SVG slice 裁掉 */
.ad-corner {
  position: absolute;
  top: 10px;
  z-index: 2;
  background: #FFC93C; color: #5A3500;
  font-size: 12px; font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0;
}
.ad-corner--right { right: 14px; }
.ad-corner--left  { left: 14px; }
/* 六边形变体（用于 ad2 的「免费」装饰）：胶囊改为六边形，更醒目 */
.ad-corner--hex {
  background: #FFC93C; color: #5A3500;
  border-radius: 4px;
  padding: 4px 14px;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  min-width: 56px; text-align: center;
}
.ad-dots { display: flex; justify-content: center; gap: 6px; padding: 9px 0 8px; background: #fff; }
.ad-dot { width: 6px; height: 6px; border-radius: 50%; background: #D5DBE2; transition: background .2s, width .25s; }
.ad-dot.on { background: var(--brand); width: 16px; border-radius: 4px; }

/* ===== 测专业（v3 多维） ===== */
.test-intro, .test-step, .result { padding-bottom: 8px; }
.test-hero {
  font-size: 19px; font-weight: 700; line-height: 1.45; padding: 22px 18px 20px;
  margin: 14px 16px 4px; border-radius: 14px; color: #fff;
  background: linear-gradient(135deg, #534AB7 0%, #7F77DD 100%);
  box-shadow: 0 6px 18px rgba(83,74,183,.18);
}
.test-hero .badge { display: inline-block; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 12px; background: rgba(255,255,255,.18); margin-bottom: 8px; letter-spacing: .5px; }
.test-lead { font-size: 14px; color: var(--text-2); line-height: 1.75; padding: 6px 18px 4px; }
.test-lead b { color: var(--brand); }
.field { padding: 12px 16px 0; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field .chip { width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; background: #fff; font-size: 14px; }
.btn-primary { display: block; width: calc(100% - 32px); margin: 16px; padding: 13px; background: var(--brand); color: #fff; border: 0; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; }
.btn-ghost { padding: 11px 18px; background: #eef1f6; color: #334; border: 0; border-radius: 12px; font-size: 15px; cursor: pointer; }
.test-note { font-size: 12px; color: var(--text-3); padding: 0 16px 8px; line-height: 1.6; }
.prog { height: 4px; background: #e9edf2; margin: 14px 16px 0; border-radius: 2px; overflow: hidden; }
.prog-bar { height: 100%; background: var(--brand); transition: width .25s; }
.step-head { font-size: 17px; font-weight: 700; padding: 10px 16px 0; }
.step-desc { font-size: 13px; color: var(--text-2); padding: 2px 16px 10px; }
.q {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  margin: 0 16px 12px; padding: 14px 14px 12px; box-shadow: 0 1px 0 rgba(20,40,80,.02);
}
.q-t { font-size: 15px; font-weight: 600; line-height: 1.55; margin-bottom: 12px; color: var(--text); }
.q-opts { display: flex; flex-direction: column; gap: 9px; }
.opt {
  position: relative; text-align: left; min-height: 46px;
  padding: 12px 44px 12px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  background: #fff; font-size: 14px; line-height: 1.45; color: var(--text);
  cursor: pointer; transition: border-color .15s, background .15s, transform .12s, box-shadow .15s;
  -webkit-user-select: none; user-select: none;
}
.opt:hover { border-color: #B6CCE6; background: #FAFCFE; }
.opt:active { transform: scale(.985); }
.opt::after {
  content: ""; position: absolute; right: 12px; top: 50%; transform: translateY(-50%) scale(.6);
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #D5DCE4; background: #fff;
  transition: background .15s, border-color .15s, transform .15s;
}
.opt.on {
  border-color: var(--brand); background: var(--brand-light);
  color: var(--brand); font-weight: 600; box-shadow: 0 0 0 3px rgba(24,95,165,.10);
}
.opt.on::after {
  background: var(--brand); border-color: var(--brand); transform: translateY(-50%) scale(1);
  box-shadow: inset 0 0 0 2.5px #fff;
}
.step-nav { display: flex; gap: 10px; padding: 14px 16px; }
.step-nav .btn-primary { margin: 0; flex: 1; }

.result { padding-top: 4px; }
.res-hero { background: linear-gradient(135deg, #534AB7, #7F77DD); color: #fff; margin: 12px 16px; border-radius: 16px; padding: 18px 20px; font-size: 19px; font-weight: 700; }
.res-sec { padding: 6px 16px 12px; }
.res-t { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.res-desc { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-holland { font-size: 13px; padding: 5px 12px; border-radius: 14px; color: #fff; font-weight: 500; background: var(--brand); }
.chip-trait { font-size: 13px; padding: 5px 12px; border-radius: 14px; background: #eef6ee; color: var(--accent); }
.ind-card { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.ind-ic { font-size: 26px; flex: none; }
.ind-name { font-size: 15px; font-weight: 600; }
.ind-blurb { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-top: 2px; }
.major-rec { display: flex; gap: 10px; align-items: flex-start; }
.major-rec .rank { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.mr-body { flex: 1; }
.mr-body .name { font-size: 16px; font-weight: 600; }
.mr-body .meta { margin: 4px 0; }
.why { font-size: 12px; color: var(--text-2); }
.school-recs { display: flex; flex-direction: column; gap: 10px; }
.sr-block { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.sr-major { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.sr-card { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--border); font-size: 14px; }
.sr-card:first-child { border-top: 0; }
.sr-card .name { flex: 1; }
.sr-card .meta { display: flex; gap: 6px; }
.sr-card.is-sponsor { background: #fff8f3; border-radius: 8px; padding: 8px; }
.res-actions { padding: 8px 16px 4px; }
