/* ===== 选科推荐子站 · 样式（沿用主站金榜升学蓝色主题） ===== */

:root {
  --blue: #3498db;
  --blue-deep: #2c8acc;
  --blue-dark: #2980b9;
  --blue-light: #5dade2;
  --blue-tint: #eaf5ff;
  --blue-tint2: #e0eaf3;
  --bg: #f4f7f9;
  --teal: #1abc9c;
  --teal-dark: #16a085;
  --danger: #e74c3c;
  --warn: #f39c12;
  --text: #2c3e50;
  --text-muted: #5a6b7b;
  --border: #e1e8ed;
  --card-shadow: 0 6px 24px rgba(44, 62, 80, 0.08);
  --radius: 0.75rem;
  --radius-sm: 0.375rem;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 站点头部 */
.site-header {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  color: #fff;
  padding: 1.75rem 1.5rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(44, 140, 204, 0.25);
}
.site-header h1 { margin: 0; font-size: 1.7rem; letter-spacing: 0.05rem; }
.site-header .subtitle { margin: 0.4rem 0 0; font-size: 0.9rem; opacity: 0.9; }

/* 主体容器（白卡片） */
.container {
  max-width: 82rem;
  margin: 1.5rem auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 1.75rem 1.75rem 1rem;
}

/* 分区标题（左侧蓝条） */
.section { margin-bottom: 1.75rem; }
.section-title {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 1.15rem; font-weight: 700; color: var(--text);
  margin: 0 0 0.8rem;
}
.section-title::before {
  content: ""; width: 0.3rem; height: 1.2rem;
  background: linear-gradient(180deg, var(--blue-deep), var(--blue));
  border-radius: 2px;
}
.section-desc { font-size: 0.85rem; color: var(--text-muted); margin: -0.2rem 0 1rem; }

/* ===== 分步向导 stepper ===== */
.stepper {
  display: flex; align-items: center; justify-content: center;
  margin: 0.5rem 0 2rem; gap: 0;
}
.step-item { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; user-select: none; }
.step-item .num {
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid var(--border); color: var(--text-muted);
  font-weight: 700; font-size: 0.95rem; transition: all 0.2s;
}
.step-item .txt { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }
.step-item.active .num { background: linear-gradient(135deg, var(--blue-deep), var(--blue)); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(44,140,204,0.35); }
.step-item.active .txt { color: var(--text); }
.step-item.done .num { background: var(--teal); border-color: transparent; color: #fff; }
.step-line { flex: 0 0 3rem; height: 2px; background: var(--border); margin: 0 0.4rem; }
.step-line.done { background: var(--teal); }
@media (max-width: 640px) { .step-item .txt { display: none; } .step-line { flex-basis: 1.5rem; } }

/* 步骤面板 */
.step-panel { display: none; }
.step-panel.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 步骤1：成绩 + 雷达 两栏 */
.step-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 820px) { .step-grid { grid-template-columns: 1fr; } }

/* 成绩输入网格 */
.subject-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.subject-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}
.subject-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.subject-card:focus-within { border-color: var(--blue-light); box-shadow: 0 0 0 3px var(--blue-tint); }
.subject-card .sub-name { font-size: 0.92rem; font-weight: 600; display: flex; justify-content: space-between; }
.subject-card .sub-tag { font-size: 0.66rem; color: #fff; background: var(--blue); padding: 0.05rem 0.4rem; border-radius: 999px; }
.subject-card .sub-tag.required { background: var(--text-muted); }
.subject-card .sub-tag.first { background: var(--blue-dark); }
.subject-card .sub-tag.second { background: var(--teal-dark); }
.subject-card input {
  width: 100%; margin-top: 0.5rem; padding: 0.4rem 0.55rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  /* iOS Safari 对 font-size < 16px 的输入框会自动放大页面且不缩回，故固定 16px */
  font-size: 16px; text-align: center; background: #fff; color: var(--text);
}
.subject-card input:focus { outline: none; border-color: var(--blue); }
.subject-card input::placeholder { color: #b9c1cb; opacity: 1; }

/* 雷达图容器 */
.radar-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1rem; text-align: center; position: sticky; top: 1rem;
}
.radar-box h4 { margin: 0 0 0.5rem; font-size: 0.92rem; color: var(--text); }
.radar-box canvas { width: 100%; max-width: 320px; height: auto; }
.radar-box .radar-note { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; }

/* 表单控件行 */
.form-row { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
.form-row .field { display: flex; flex-direction: column; gap: 0.3rem; }
.form-row label { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }
.form-row select {
  padding: 0.45rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; background: #fff; min-width: 12rem; color: var(--text);
}

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: none; border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 600;
  padding: 0.6rem 1.4rem; cursor: pointer; transition: all 0.15s; user-select: none;
}
.btn-primary { background: linear-gradient(135deg, var(--blue-deep), var(--blue)); color: #fff; box-shadow: 0 3px 10px rgba(44,140,204,0.3); }
.btn-primary:hover { background: linear-gradient(135deg, var(--blue), var(--blue-light)); }
.btn-ghost { background: #fff; color: var(--blue-dark); border: 1px solid var(--blue-light); }
.btn-ghost:hover { background: var(--blue-tint); }
.action-bar { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.8rem; }

/* 结果区 */
#results { margin-top: 0.5rem; }
.result-empty { color: var(--text-muted); font-size: 0.9rem; padding: 1rem; text-align: center; background: var(--bg); border-radius: var(--radius-sm); }
.result-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.85rem; }
.result-list.dense { grid-template-columns: repeat(4, 1fr); } /* 紧凑 4列：全尺寸（PC/平板/手机）统一 4 列 */
.result-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1rem 0.9rem; background: #fff; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.result-card h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }

/* 卡片布局密度切换（标准 2列 / 紧凑 4列） */
.density-switch { display: flex; align-items: center; gap: 0.5rem; margin: 0.2rem 0 0.9rem; flex-wrap: wrap; }
.density-switch .ds-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.density-switch .ds-btn {
  padding: 0.25rem 0.8rem; font-size: 0.76rem; font-family: inherit; line-height: 1.6;
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--text-muted); transition: all .15s ease;
}
.density-switch .ds-btn:hover { border-color: var(--blue); color: var(--blue-dark); }
.density-switch .ds-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }
.result-card.top { border-color: var(--blue); box-shadow: 0 4px 18px rgba(44,140,204,0.18); }
.result-card.top::after {
  content: "★ 最推荐"; position: absolute; top: 0; left: 0;
  background: var(--teal); color: #fff; font-size: 0.7rem; padding: 0.18rem 0.6rem; border-bottom-right-radius: var(--radius-sm);
}
.result-card .rank {
  position: absolute; top: 0; right: 0; background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  color: #fff; font-size: 0.75rem; padding: 0.2rem 0.7rem; border-bottom-left-radius: var(--radius-sm);
}
.result-card h3 { margin: 0 0 0.6rem; font-size: 1.2rem; }
/* 方向徽章：卡片与详情弹窗共用（弹窗内无 .result-card 祖先，不能用后代选择器限定） */
.direction {
  display: inline-block; font-size: 0.72rem; color: #fff; padding: 0.1rem 0.5rem; border-radius: 999px; margin-left: 0.5rem;
}
.direction.physics { background: var(--blue-dark); }
.direction.history { background: var(--teal-dark); }

.match-bar { margin: 0.6rem 0; }
.match-bar .mb-track { height: 0.55rem; background: var(--bg); border-radius: 999px; overflow: hidden; }
.match-bar .mb-fill { height: 100%; background: linear-gradient(to right, var(--blue-deep), var(--blue-light)); border-radius: 999px; }
.match-bar .mb-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; display: flex; justify-content: space-between; }

/* 覆盖率徽章 */
.cov-badge {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 600;
  padding: 0.18rem 0.6rem; border-radius: 999px; margin: 0.2rem 0.4rem 0.2rem 0;
}
.cov-badge.high { background: #e8f8f3; color: var(--teal-dark); }
.cov-badge.mid { background: #fef5e7; color: var(--warn); }
.cov-badge.low { background: #fdecea; color: var(--danger); }

.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0; }
.tag { font-size: 0.74rem; padding: 0.12rem 0.5rem; border-radius: 999px; background: var(--blue-tint); color: var(--blue-dark); }
.tag.block { background: #fdecea; color: var(--danger); }
.tag.match { background: #e8f8f3; color: var(--teal-dark); border: 1px solid #b8e6d8; font-weight: 600; }

/* 可报专业区块 */
.major-section { margin: 0.6rem 0; padding: 0.7rem 0.85rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
/* 卡片顶部：学历层次切换 + 覆盖率/兴趣徽章同排（避开右上角 No.x 徽章） */
.card-top { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.55rem; }
.card-top .cov-badge { margin: 0; }
.major-head { font-size: 0.82rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.major-head .major-count { color: var(--blue-dark); font-weight: 800; }
.major-head .major-match { color: var(--teal-dark); font-weight: 600; }

/* 门类分布 chips */
.cat-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.55rem; }
.cat-chip { font-size: 0.72rem; padding: 0.12rem 0.5rem; border-radius: 999px; background: #eef3f7; color: var(--text-muted); border: 1px solid var(--border); }
.cat-chip b { color: var(--blue-dark); font-weight: 700; }

/* 可报专业搜索 + 滚动列表 */
.major-search {
  width: 100%; box-sizing: border-box; margin-bottom: 0.5rem;
  padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 16px; color: var(--text); background: #fff;   /* 同 iOS 16px 规则 */
}
.major-search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-tint); }
.major-list {
  display: flex; flex-wrap: wrap; gap: 0.35rem; max-height: 220px; overflow-y: auto;
  padding: 0.15rem; border-top: 1px dashed var(--border); padding-top: 0.5rem;
}
.major-item {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.74rem; padding: 0.12rem 0.5rem; border-radius: 999px;
  background: var(--blue-tint); color: var(--blue-dark); border: 1px solid transparent;
}
.major-item i { font-style: normal; font-size: 0.66rem; color: var(--text-muted); opacity: 0.8; }
.major-item.match { background: #e8f8f3; color: var(--teal-dark); border: 1px solid #b8e6d8; font-weight: 600; }
.mj-plan {
  font-style: normal; font-weight: 700; font-size: 0.68rem; color: var(--blue-dark);
  background: rgba(255, 255, 255, 0.7); padding: 0 0.3rem; border-radius: 999px; white-space: nowrap;
}
.major-item.match .mj-plan { color: var(--teal-dark); background: rgba(255, 255, 255, 0.72); }
.major-foot { margin-top: 0.45rem; font-size: 0.7rem; color: var(--text-muted); }

.compare-table .major-num { font-weight: 700; color: var(--text); }

/* 对比表：推荐组合标识 */
.compare-table tbody tr.rec { background: rgba(52, 152, 219, 0.05); }
.compare-table tbody tr.rec td.name { font-weight: 600; }
.rec-badge {
  display: inline-block; margin-left: 0.35rem; font-size: 0.68rem; font-weight: 700;
  padding: 0.05rem 0.4rem; border-radius: 999px; vertical-align: middle;
  background: var(--blue); color: #fff; white-space: nowrap;
}
.section-title .title-note { margin-left: 0.4rem; font-size: 0.78rem; font-weight: 400; color: var(--text-muted); }

/* 本科 / 专科 层次切换按钮组（每张推荐卡片、对比表各一组，互不影响） */
.lv-switch { display: inline-flex; gap: 0.3rem; flex-shrink: 0; }
.lv-switch .lv-btn {
  padding: 0.16rem 0.7rem; font-size: 0.74rem; font-family: inherit; line-height: 1.6; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--text-muted); transition: all .15s ease;
}
.lv-switch .lv-btn:hover { border-color: var(--blue); color: var(--blue-dark); }
.lv-switch .lv-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }
.compare-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
.compare-table .plan-num { font-weight: 700; color: var(--blue-dark); }
.table-note { margin-top: 0.5rem; font-size: 0.74rem; color: var(--text-muted); }
.major-head .lv-chip {
  display: inline-block; margin-right: 0.35rem; padding: 0.05rem 0.45rem;
  border-radius: 4px; font-size: 0.72rem; font-weight: 700; vertical-align: middle;
  background: var(--blue-tint); color: var(--blue-dark);
}

.reasons { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; color: var(--text-muted); }
.reasons li { margin-bottom: 0.25rem; }

/* 12 组合对比表 */
/* 12 组合对比表：移动端横向滚动 —— 容器限定滚动范围，避免整页被迫横向滑动 */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.table-scroll::-webkit-scrollbar { height: 6px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--blue-light); border-radius: 999px; }
.compare-table { min-width: 640px; }
.compare-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.85rem; }
.compare-table th, .compare-table td { border: 1px solid var(--border); padding: 0.45rem 0.6rem; text-align: center; white-space: nowrap; }
/* 不加 sticky：表格已放进横向滚动容器，sticky 相对视口会跟着页面浮到顶部遮挡内容 */
.compare-table th { background: var(--blue-tint); color: var(--text); }
.compare-table td.name { text-align: left; font-weight: 600; }
.compare-table tr.best td { background: #f0f9ff; }
.compare-table .cov-cell.high { color: var(--teal-dark); font-weight: 700; }
.compare-table .cov-cell.mid { color: var(--warn); font-weight: 700; }
.compare-table .cov-cell.low { color: var(--danger); font-weight: 700; }
.compare-table .match-pill { display: inline-block; min-width: 2.4rem; padding: 0.1rem 0.4rem; border-radius: 999px; background: var(--blue-tint); color: var(--blue-dark); font-weight: 700; }
.compare-table .ok { color: var(--teal-dark); }
.compare-table .no { color: var(--danger); }

/* 规则说明（折叠） */
.rules details { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.5rem 1rem; }
.rules summary { cursor: pointer; font-weight: 600; color: var(--blue-dark); }
.rules .rule-body { font-size: 0.88rem; color: var(--text-muted); margin-top: 0.6rem; }
.rules .rule-body table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.rules .rule-body th, .rules .rule-body td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; text-align: left; }
.rules .rule-body th { background: var(--blue-tint); }

/* 页脚 */
.site-footer {
  text-align: center; font-size: 0.78rem; color: var(--text-muted);
  padding: 1rem 0 0.5rem; border-top: 1px solid var(--border); margin-top: 1rem;
}
.site-footer a { color: var(--blue-dark); text-decoration: none; }
.site-footer .gongan { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.6rem; }

/* ===== 霍兰德 60 题测评 ===== */
.holland-intro, .holland-confirm {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.25rem; text-align: center; max-width: 34rem; margin: 0 auto;
}
.holland-intro-emoji { font-size: 2.2rem; }
.holland-intro-title { font-size: 1.25rem; font-weight: 700; color: var(--text); margin: 0.4rem 0 0.2rem; }
.holland-intro-sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.holland-intro-tips { text-align: left; list-style: none; padding: 0; margin: 0 auto 1.25rem; max-width: 26rem; }
.holland-intro-tips li { font-size: 0.85rem; color: var(--text-muted); padding: 0.3rem 0 0.3rem 1.1rem; position: relative; }
.holland-intro-tips li::before { content: "·"; position: absolute; left: 0.4rem; color: var(--blue); font-weight: 700; }

/* 逐题作答 */
.holland-test { max-width: 40rem; margin: 0 auto; }
.h-progress { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.h-progress-info { font-weight: 700; color: var(--blue-dark); font-size: 0.95rem; }
.h-progress-dim { font-size: 0.82rem; color: var(--text-muted); }
.h-progress-bar { height: 0.5rem; background: var(--bg); border-radius: 999px; overflow: hidden; }
.h-progress-fill { height: 100%; background: linear-gradient(to right, var(--blue-deep), var(--blue-light)); border-radius: 999px; transition: width 0.25s ease; }
.h-question-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin: 1rem 0; min-height: 8rem; display: flex; flex-direction: column; justify-content: center;
}
.h-q-num { font-size: 0.82rem; color: var(--blue-dark); font-weight: 600; margin-bottom: 0.6rem; }
.h-q-text { font-size: 1.1rem; font-weight: 600; color: var(--text); line-height: 1.7; }
.h-options { display: flex; gap: 1rem; }
.h-option {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: 1px solid var(--border); background: #fff; border-radius: var(--radius-sm);
  padding: 0.85rem 1rem; cursor: pointer; transition: all 0.15s; user-select: none; font-size: 1rem; font-weight: 600;
}
.h-option:hover { border-color: var(--blue-light); }
.h-option.selected { border-color: var(--blue); background: var(--blue-tint); color: var(--blue-dark); }
.h-radio { width: 1.1rem; height: 1.1rem; border: 2px solid var(--border); border-radius: 50%; flex: 0 0 auto; position: relative; }
.h-option.selected .h-radio { border-color: var(--blue); }
.h-option.selected .h-radio::after { content: ""; position: absolute; inset: 0.18rem; background: var(--blue); border-radius: 50%; }
.h-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; }
.h-dots { display: flex; gap: 0.3rem; }
.h-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--border); }
.h-dot.answered { background: var(--teal); }
.h-dot.current { background: var(--blue); width: 0.75rem; height: 0.75rem; }

/* 确认 */
.h-stats { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin: 1rem 0; }
.h-stat { display: flex; flex-direction: column; align-items: center; }
.h-stat-num { font-size: 1.8rem; font-weight: 800; color: var(--blue-dark); }
.h-stat-label { font-size: 0.8rem; color: var(--text-muted); }
.h-stat-div { width: 1px; height: 2.4rem; background: var(--border); }
.h-confirm-tip { font-size: 0.85rem; color: var(--warn); margin-bottom: 1rem; }
.h-confirm-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

/* 结果 */
.holland-result { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.h-result-head { display: flex; align-items: center; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.h-result-type {
  width: 3.6rem; height: 3.6rem; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 0.95rem; font-weight: 800; letter-spacing: 0.05rem;
}
.h-result-names { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.h-result-combo { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.25rem; }
.h-result-body { display: grid; grid-template-columns: 200px 1fr; gap: 1.25rem; margin-top: 1rem; align-items: start; }
.h-result-radar { text-align: center; }
.h-result-radar canvas { width: 100%; max-width: 200px; height: auto; }
.h-result-detail { display: flex; flex-direction: column; gap: 0.7rem; }
.h-type-row { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; }
.h-type-row.top { border-color: var(--blue); background: var(--blue-tint); }
.h-type-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.h-type-badge { font-size: 0.82rem; font-weight: 700; color: #fff; padding: 0.15rem 0.55rem; border-radius: 999px; }
.h-type-score { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); }
.h-type-bar { height: 0.5rem; background: var(--bg); border-radius: 999px; overflow: hidden; margin-bottom: 0.4rem; }
.h-type-fill { height: 100%; border-radius: 999px; }
.h-type-strengths { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.h-tag { font-size: 0.72rem; padding: 0.1rem 0.45rem; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--text-muted); }
.h-result-actions { margin-top: 1rem; text-align: center; }

/* ===== 缩略卡（点击打开详情弹窗） ===== */
.result-card { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.result-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(44, 62, 80, 0.13); border-color: var(--blue-light); }
.result-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.result-card .card-stat {
  display: flex; flex-wrap: wrap; gap: 0.3rem 0.75rem; font-size: 0.78rem;
  color: var(--text-muted); margin: 0.1rem 0 0.55rem;
}
.result-card .card-stat b { color: var(--blue-dark); font-weight: 800; font-size: 0.86rem; }
.result-card .card-stat .cs-match b { color: var(--teal-dark); }
.result-card .card-top5 { margin-bottom: 0.5rem; }
.result-card .ct-label { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.result-card .ct-list { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.t5-item {
  font-size: 0.72rem; padding: 0.14rem 0.5rem; border-radius: 999px;
  background: #fff; color: var(--text); border: 1px solid var(--border);
}
.t5-item i { font-style: normal; color: var(--blue-dark); font-weight: 700; margin-left: 0.3rem; }
.t5-item.match { border-color: var(--teal); background: #e8f8f3; color: var(--teal-dark); font-weight: 600; }
.t5-more { font-size: 0.72rem; color: var(--blue-dark); font-weight: 600; }
.result-card .card-more {
  display: flex; align-items: center; justify-content: center; gap: 0.3rem;
  margin-top: auto; padding: 0.4rem; font-size: 0.78rem; font-weight: 600;
  color: var(--blue-dark); background: var(--blue-tint);
  border-radius: var(--radius-sm); border: 1px dashed var(--blue-light);
}
.result-card .card-more .cm-full { display: inline; }
.result-card .card-more .cm-short { display: none; }
.result-card:hover .card-more { background: var(--blue); color: #fff; border-style: solid; }

/* 紧凑 4 列：缩到最小，手机一排放得下全部 4 个组合 */
.lbl-short { display: none; }
.result-list.dense .result-card { padding: 1.55rem 0.52rem 0.78rem; } /* 顶部留白避开 No.x / ★最推荐 角标 */
.result-list.dense .result-card h3 { font-size: 0.92rem; margin-bottom: 0.4rem; }
.result-list.dense .lbl-full { display: none; }
.result-list.dense .lbl-short { display: inline; }
.result-list.dense .direction { margin-left: 0.3rem; font-size: 0.64rem; padding: 0.06rem 0.4rem; }
.result-list.dense .rank { font-size: 0.6rem; padding: 0.12rem 0.42rem; }
/* 紧凑卡宽仅约 77px：★最推荐 横幅会压住右上 No.x，故密集档改为短标签并收宽度 */
.result-list.dense .result-card.top::after { content: "最推荐"; font-size: 0.56rem; padding: 0.12rem 0.38rem; }
.result-list.dense .card-top { flex-direction: column; align-items: stretch; gap: 0.22rem; margin-bottom: 0.3rem; }
.result-list.dense .lv-switch { justify-content: center; gap: 0.1rem; }
.result-list.dense .lv-switch .lv-btn { padding: 0.13rem 0.22rem; font-size: 0.58rem; }
/* 覆盖率徽章：紧凑模式也显示完整标签「本科覆盖率 92%」，窄卡放不下时自动换行（标签/数字各一行） */
.result-list.dense .card-top .cov-badge { align-self: center; font-size: 0.5rem; padding: 0.1rem 0.24rem; white-space: nowrap; text-align: center; }
.result-list.dense .match-bar { margin: 0.32rem 0.14rem; }
.result-list.dense .mb-label { font-size: 0.56rem; justify-content: center; align-items: baseline; gap: 0.15rem; white-space: nowrap; }
.result-list.dense .mb-label span:first-child { display: inline; } /* 紧凑卡也显示「综合匹配分」标签，与分数同一行 */
.result-list.dense .mb-label strong { font-size: 0.63rem; }
.result-list.dense .card-stat,
.result-list.dense .card-top5,
.result-list.dense .cat-chips { display: none; }
/* 紧凑模式保留「点击查看」提示，但用精简文案、缩小避免换行 */
.result-list.dense .card-more { margin-top: 0.4rem; padding: 0.3rem; font-size: 0.62rem; }
.result-list.dense .card-more .cm-full { display: none; }
.result-list.dense .card-more .cm-short { display: inline; white-space: nowrap; }

/* ===== 详情弹窗 ===== */
html.dm-open, html.dm-open body { overflow: hidden; }
.detail-mask {
  position: fixed; inset: 0; z-index: 1000; display: flex;
  align-items: center; justify-content: center; padding: 1.5rem 1rem;
  background: rgba(15, 30, 45, 0.55); opacity: 0; transition: opacity .18s ease;
}
.detail-mask.show { opacity: 1; }
/* 关键：作者样式的 display:flex 会覆盖 UA 的 [hidden]{display:none}，必须显式还原，否则弹窗初始即显示 */
.detail-mask[hidden] { display: none; }
.detail-modal {
  position: relative; width: 100%; max-width: 58rem; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(15, 30, 45, 0.3);
  padding: 1.4rem 1.5rem 1.6rem; transform: translateY(12px) scale(.99);
  transition: transform .18s ease;
}
.detail-mask.show .detail-modal { transform: none; }
.dm-close {
  position: absolute; top: 0.6rem; right: 0.7rem; z-index: 2;
  width: 2rem; height: 2rem; line-height: 1; font-size: 1.4rem; cursor: pointer;
  border: 1px solid var(--border); border-radius: 50%;
  background: #fff; color: var(--text-muted); transition: all .15s ease;
}
.dm-close:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.dm-head { padding-right: 2.4rem; margin-bottom: 0.6rem; flex-shrink: 0; }
.dm-head h3 { margin: 0; font-size: 1.35rem; }
.dm-rank {
  display: inline-block; font-size: 0.75rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  padding: 0.12rem 0.6rem; border-radius: 999px; margin-bottom: 0.35rem;
}
.detail-modal .card-top { flex-wrap: wrap; flex-shrink: 0; }
/* 内容区：推荐理由 + 可报专业板块，独立滚动，保证弹窗整体不超高（PC/手机统一） */
.detail-modal .dm-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.detail-modal .major-list.dm-list { max-height: 24vh; }
.detail-modal .major-search { max-width: 22rem; }
.dm-reason-title {
  font-size: 0.85rem; font-weight: 700; color: var(--text);
  margin: 1rem 0 0.3rem; padding-top: 0.7rem; border-top: 1px solid var(--border);
}
.detail-modal .reasons { margin-top: 0; }

/* 响应式 */
@media (max-width: 640px) {
  .h-result-body { grid-template-columns: 1fr; }
  .h-result-radar canvas { max-width: 240px; }
  .h-options { flex-direction: column; }
  .holland-intro-tips { max-width: 100%; }
  .container { margin: 0.75rem; padding: 1.1rem; }
  .site-header h1 { font-size: 1.35rem; }
  .subject-row { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .result-list { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .result-list.dense { grid-template-columns: repeat(4, 1fr); gap: 0.45rem; }
  .detail-mask { padding: 0.75rem 0.5rem; }
  .detail-modal { max-height: 92vh; padding: 1.1rem 1rem 1.3rem; }
  .detail-modal .major-list.dm-list { max-height: 24vh; }
  /* 触控目标放大：原高度约 26px 手指易误触连带弹出详情窗，现约 38px */
  .lv-switch .lv-btn { padding: 0.45rem 1rem; font-size: 0.82rem; }
  /* 单列布局下 sticky 的雷达图会浮在顶部遮挡成绩录入，改回普通流 */
  .radar-box { position: static; }
}

/* 触屏设备（含横屏手机、平板）统一放大触控目标：依据是输入方式而非屏幕宽度，
   否则横屏 844px 会越过上面的宽度断点、按钮又缩回 26px 导致手指按不准 */
@media (pointer: coarse) {
  .lv-switch .lv-btn { padding: 0.45rem 1rem; font-size: 0.82rem; }
}
