/* ==========================================================
   全国专升本查询系统 - 前台样式（移动端优先）
   继承原山东版视觉范式：深蓝渐变头图 + 白色卡片
   新增：省份选择网格 / 省份切换条 / 未上线省份弹层
   ========================================================== */

:root {
  --blue: #2f6bff;
  --blue-deep: #1e4fd6;
  --navy-1: #141d42;
  --navy-2: #1e3a8c;
  --navy-3: #2a56c6;
  --ink: #1a2333;
  --ink-2: #55607a;
  --ink-3: #98a2b8;
  --line: #eceff5;
  --bg: #f4f6fb;
  --white: #ffffff;
  --orange: #f7b733;
  --shadow: 0 8px 30px rgba(20, 33, 74, .12);
  --radius: 16px;
}

* { 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", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}

body.s-home {
  background: linear-gradient(165deg, var(--navy-1) 0%, var(--navy-2) 45%, var(--navy-3) 100%);
  background-attachment: fixed;
}

.hidden { display: none !important; }

/* ================= 首页：头图区 ================= */
#step1 { max-width: 640px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

.hero { position: relative; overflow: hidden; padding: 54px 24px 78px; text-align: center; }

.hero-deco { position: absolute; border-radius: 50%; pointer-events: none; }
.deco-1 { width: 260px; height: 260px; top: -110px; right: -80px; background: radial-gradient(circle, rgba(255,255,255,.09), transparent 68%); }
.deco-2 { width: 200px; height: 200px; bottom: -70px; left: -70px; background: radial-gradient(circle, rgba(247,183,51,.14), transparent 68%); }

.hero-inner { position: relative; z-index: 1; }

.hero-badge {
  display: inline-block;
  font-size: .82rem;
  letter-spacing: .35em;
  text-indent: .35em;
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  padding: 6px 18px;
  margin-bottom: 20px;
  backdrop-filter: blur(4px);
}

.hero h1 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: .04em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}

.hero-art { margin-top: 22px; opacity: .95; filter: drop-shadow(0 10px 20px rgba(0,0,0,.25)); }

.prov-logo { margin-bottom: 14px; }
.prov-logo img { max-width: 120px; max-height: 120px; border-radius: 12px; }

/* ================= 省份选择网格 ================= */
.prov-card { padding-bottom: 30px; }

.prov-group-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-2);
  margin: 14px 2px 10px;
}

.prov-group-title.warn { color: #b0680a; }

.prov-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.prov-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 12px 4px;
  border-radius: 12px;
  text-decoration: none;
  border: 1.5px solid var(--line);
  background: #f8fafd;
  transition: transform .12s, box-shadow .2s;
}

.prov-item .prov-name {
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.prov-item .prov-flag { font-size: .68rem; color: var(--ink-3); }

.prov-item.prov-on {
  background: #eef4ff;
  border-color: #c8d9f7;
}
.prov-item.prov-on .prov-flag { color: #2b5cc4; font-weight: 600; }
.prov-item.prov-on:active { transform: scale(.96); }

.prov-item.prov-off {
  background: #f6f7fa;
  border-color: #e8eaf0;
  opacity: .78;
}
.prov-item.prov-off .prov-name { color: var(--ink-2); }
.prov-item.prov-off .prov-flag { color: #b0680a; }

/* 未上线省份提示弹层 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; display: none; }
.mask.show { display: block; }

.prov-dialog {
  position: fixed; z-index: 100; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, 88vw);
  background: #fff; border-radius: 14px; padding: 24px 22px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
  display: none;
}
.prov-dialog.show { display: block; }
.prov-dialog h3 { font-size: 1.05rem; color: var(--ink); margin-bottom: 12px; }
.prov-dialog p { font-size: .9rem; color: var(--ink-2); line-height: 1.8; margin-bottom: 18px; }
.prov-dialog button {
  width: 100%; padding: 11px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #4a86ff, var(--blue-deep));
  color: #fff; font-size: .95rem; font-weight: 600; cursor: pointer;
}

/* ================= 查询页：省份切换条 ================= */
.prov-bar {
  max-width: 640px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -46px 18px 14px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

.prov-bar-cur {
  display: inline-block;
  background: rgba(255,255,255,.94);
  color: var(--navy-2);
  font-size: .84rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 14px;
  box-shadow: 0 4px 14px rgba(20,33,74,.18);
}

.prov-bar-switch, .prov-bar-link {
  display: inline-block;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: .8rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 6px 13px;
}

.tip-note {
  background: #fff8e8;
  border: 1px solid #f2dcb4;
  color: #92640a;
  font-size: .8rem;
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 12px;
  text-align: center;
}

#noRestrictionTip { max-width: 640px; margin: 14px 18px 0; }

/* ================= 首页：搜索卡 ================= */
.search-card {
  position: relative;
  z-index: 2;
  background: var(--white);
  border-radius: var(--radius);
  margin: -56px 18px 0;
  padding: 26px 20px 24px;
  box-shadow: var(--shadow);
}

.search-card h2 {
  font-size: 1.06rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 18px;
}

.search-row { position: relative; }

.search-row input {
  width: 100%;
  height: 52px;
  border: 1.5px solid #e3e8f2;
  border-radius: 12px;
  padding: 0 44px 0 16px;
  font-size: 1rem;
  color: var(--ink);
  background: #f8fafd;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.search-row input:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 107, 255, .10);
}

.search-row input::placeholder { color: var(--ink-3); }

#btnClear {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  border: none; border-radius: 50%;
  background: #e7ebf3; color: #8b95ab;
  font-size: 15px; line-height: 26px;
  cursor: pointer;
}

#btnSearch {
  width: 100%;
  height: 52px;
  margin-top: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #4a86ff, var(--blue-deep));
  color: #fff;
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-indent: .2em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(47, 107, 255, .35);
  transition: transform .12s, box-shadow .2s;
}

#btnSearch:active { transform: scale(.98); box-shadow: 0 4px 10px rgba(47,107,255,.3); }

/* 搜索结果下拉 */
.list {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  max-height: 50vh;
  overflow-y: auto;
  list-style: none;
}

.list .item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s;
}

.list .item:last-child { border-bottom: none; }
.list .item:active { background: #f2f6ff; }

.list .mname { font-size: .98rem; font-weight: 500; }
.list .mcode {
  font-size: .78rem;
  color: var(--ink-3);
  background: #f1f4fa;
  border-radius: 6px;
  padding: 3px 8px;
  flex-shrink: 0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.empty { padding: 22px 10px; text-align: center; color: var(--ink-3); font-size: .92rem; }

/* 首页底部提示 */
.site-foot { margin-top: auto; padding: 26px 24px calc(20px + env(safe-area-inset-bottom)); }

.site-foot .notice {
  font-size: .82rem;
  color: rgba(255, 255, 255, .72);
  line-height: 1.9;
  text-align: justify;
}

.site-foot .copy {
  margin-top: 12px;
  font-size: .74rem;
  color: rgba(255, 255, 255, .42);
  text-align: center;
}

/* ================= 内页通用（第二步/第三步/科目对照表） ================= */
#step2, #step3, .subject-page { max-width: 640px; margin: 0 auto; min-height: 100vh; background: var(--bg); }

.page-head {
  position: relative;
  background: linear-gradient(150deg, var(--navy-2), var(--navy-3));
  padding: 40px 52px 26px;
  text-align: center;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 6px 20px rgba(20, 40, 100, .18);
}

.page-head h1 {
  color: #fff;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: .02em;
  word-break: break-all;
}

.page-head .head-code {
  font-weight: 500;
  font-size: .95rem;
  opacity: .8;
  margin-left: 6px;
}

.head-back {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s;
}

.head-back:active { background: rgba(255, 255, 255, .28); }

.head-switch {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: .76rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

.page-foot {
  padding: 30px 0 calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: .75rem;
  color: var(--ink-3);
}

/* ================= 预留图片位 ================= */
.foot-img {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px auto 0;
  max-width: 260px;
  min-height: 120px;
}
.foot-img img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
}
.site-foot .foot-img { margin-top: 18px; }

/* ================= 第二步：本科专业列表 ================= */
.b-list {
  background: var(--white);
  border-radius: var(--radius);
  margin: 16px 14px 0;
  box-shadow: 0 4px 16px rgba(20, 33, 74, .06);
  overflow: hidden;
}

.b-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s;
}

.b-row:last-child { border-bottom: none; }
.b-row:active { background: #f4f8ff; }

.b-row .b-name { font-size: 1rem; font-weight: 500; }
.b-row .b-code {
  color: var(--ink-3);
  font-size: .82rem;
  margin-left: 6px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.b-row .b-count { display: block; font-size: .76rem; color: var(--ink-3); margin-top: 3px; }

/* 考试科目标签（内容来自各省 exam_category_map 配置，如 高等数学Ⅱ / 大学语文+英语） */
.b-row .b-math {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: 1px;
  color: #2b5cc4;
  background: #eaf1fd;
  border: 1px solid #c8d9f7;
}
.b-row .b-math.math-1 { color: #2b5cc4; background: #eaf1fd; border-color: #c8d9f7; }
.b-row .b-math.math-2 { color: #1d8a4e; background: #e8f7ee; border-color: #bfe6cf; }
.b-row .b-math.math-3 { color: #b0680a; background: #fdf2e3; border-color: #f2dcb4; }

.b-row .b-link {
  flex-shrink: 0;
  color: var(--blue);
  font-size: .88rem;
  font-weight: 500;
  white-space: nowrap;
}

.b-row .b-link::after { content: " ›"; font-weight: 700; }

/* ================= 第三步：招生院校表格 ================= */
.sheet {
  background: var(--white);
  border-radius: var(--radius);
  margin: 16px 14px 0;
  box-shadow: 0 4px 16px rgba(20, 33, 74, .06);
  overflow: hidden;
}

.sheet-crumb {
  padding: 14px 18px;
  font-size: .82rem;
  color: var(--ink-2);
  background: #f7f9fd;
  border-bottom: 1px solid var(--line);
}

.sheet-crumb b { color: var(--ink); }

.ltab { width: 100%; border-collapse: collapse; table-layout: fixed; }

.ltab th, .ltab td {
  padding: 13px 6px;
  font-size: .86rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.ltab th {
  background: #f2f6ff;
  color: var(--ink-2);
  font-weight: 600;
  font-size: .78rem;
  line-height: 1.4;
}

.ltab th:first-child, .ltab td:first-child { text-align: left; padding-left: 18px; }

.ltab td.sname { font-weight: 600; font-size: .9rem; }
.ltab td.plan { color: #e8960c; font-weight: 700; }
.ltab td.cur-line { color: var(--blue-deep); font-weight: 700; }
.ltab td.none { color: #c3cad8; }
.ltab tr:last-child td { border-bottom: none; }
.ltab tbody tr:active { background: #f7faff; }

/* 小屏微调：表格字号整体略缩小；院校名称列加宽，避免校名换行过多 */
@media (max-width: 480px) {
  .ltab th, .ltab td { font-size: .74rem; padding: 11px 3px; }
  .ltab th { font-size: .71rem; }
  .ltab th:first-child, .ltab td:first-child { padding-left: 10px; width: 36%; }
  .ltab td.sname { font-size: .8rem; line-height: 1.5; word-break: break-all; }
  .prov-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 380px) {
  .ltab th, .ltab td { font-size: .72rem; padding: 11px 3px; }
  .ltab th { font-size: .69rem; }
  .ltab th:first-child, .ltab td:first-child { padding-left: 10px; }
}

/* 桌面端：居中更宽一点 */
@media (min-width: 768px) {
  .hero { padding-top: 72px; }
  .hero h1 { font-size: 1.8rem; }
  .search-card { padding: 34px 32px 30px; }
  .b-row { padding: 18px 24px; }
  .ltab th, .ltab td { font-size: .94rem; }
  .prov-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ================= 科目对照表页 ================= */
.subject-page .exam-desc {
  margin: 16px 14px 0;
  background: #eef4ff;
  border: 1px solid #c8d9f7;
  color: #2b5cc4;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: .86rem;
  line-height: 1.8;
}

.subject-page .sheet { margin-top: 14px; }
.subject-page .ltab th, .subject-page .ltab td { text-align: center; }
.subject-page .ltab td.scode { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink-2); }
.subject-page .ltab td.ssubj { font-size: .78rem; color: var(--ink-2); line-height: 1.6; word-break: break-all; }

.subj-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 500;
  color: #1d8a4e;
  background: #e8f7ee;
  border: 1px solid #bfe6cf;
  white-space: nowrap;
}

.back-query {
  display: inline-block;
  color: var(--blue);
  font-size: .88rem;
  text-decoration: none;
  margin-bottom: 8px;
}
