mirror of
https://git.simgreek.com/zzz/yanxuan.git
synced 2026-11-23 00:40:46 +08:00
1162 lines
60 KiB
HTML
1162 lines
60 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
|
||
<meta name="theme-color" content="#FFFFFF">
|
||
<title>研择 · 2027 择校数据</title>
|
||
<style>
|
||
:root{
|
||
--bg:#FFFFFF;
|
||
--bg2:#F7F7F5;
|
||
--bg3:#EDEDEA;
|
||
--ink:#111111;
|
||
--ink2:#4A4A4A;
|
||
--ink3:#8A8A8A;
|
||
--ink4:#B4B4B0;
|
||
--rule:#E4E4E0;
|
||
--rule2:#C9C9C4;
|
||
--accent:#B3261E;
|
||
--sans:-apple-system,BlinkMacSystemFont,"PingFang SC","Helvetica Neue","Microsoft YaHei","Source Han Sans SC",sans-serif;
|
||
--num:"Helvetica Neue",Helvetica,Arial,sans-serif;
|
||
--pad:20px;
|
||
--tab:54px;
|
||
}
|
||
*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
|
||
html{-webkit-text-size-adjust:100%}
|
||
body{
|
||
font-family:var(--sans);background:var(--bg);color:var(--ink);
|
||
font-size:15px;line-height:1.6;-webkit-font-smoothing:antialiased;overflow-x:hidden;
|
||
}
|
||
button,input,select{font-family:inherit;font-size:inherit;color:inherit;border:0;background:none;outline:none}
|
||
button{cursor:pointer;text-align:left}
|
||
a{color:inherit;text-decoration:none}
|
||
ul,ol{list-style:none}
|
||
.num{font-family:var(--num);font-variant-numeric:tabular-nums;letter-spacing:-.02em}
|
||
|
||
.app{max-width:520px;margin:0 auto;min-height:100dvh;background:var(--bg);position:relative}
|
||
@media (min-width:600px){
|
||
body{background:var(--bg3)}
|
||
.app{border-left:1px solid var(--rule);border-right:1px solid var(--rule)}
|
||
}
|
||
|
||
/* ── 顶栏 ─────────────────────────── */
|
||
.top{position:sticky;top:0;z-index:40;background:var(--bg);border-bottom:1px solid var(--ink)}
|
||
.top-in{display:flex;align-items:center;height:50px;padding:0 var(--pad)}
|
||
.logo{font-size:16px;font-weight:800;letter-spacing:-.3px}
|
||
.logo i{font-style:normal;color:var(--accent)}
|
||
.top-meta{margin-left:auto;font-size:11px;color:var(--ink3);letter-spacing:.06em}
|
||
.top-btn{width:34px;height:34px;display:grid;place-items:center;margin-right:-8px;margin-left:8px;color:var(--ink)}
|
||
.top-btn:active{background:var(--bg2)}
|
||
|
||
/* ── 首页报头 ─────────────────────── */
|
||
.mast{padding:22px var(--pad) 0}
|
||
.kicker{
|
||
font-size:11px;letter-spacing:.14em;color:var(--ink3);
|
||
padding-bottom:9px;border-bottom:3px solid var(--ink);display:flex;justify-content:space-between;
|
||
}
|
||
.mast h1{
|
||
font-size:31px;line-height:1.24;font-weight:800;letter-spacing:-.9px;
|
||
margin-top:16px;
|
||
}
|
||
.mast h1 em{font-style:normal;color:var(--accent)}
|
||
.dek{margin-top:11px;font-size:14.5px;line-height:1.75;color:var(--ink2);max-width:32em}
|
||
.dek b{font-weight:600;color:var(--ink)}
|
||
|
||
.figs{display:flex;margin-top:20px;border-top:1px solid var(--rule);border-bottom:1px solid var(--ink);padding:13px 0}
|
||
.figs>div{flex:1}
|
||
.figs>div+div{padding-left:14px;border-left:1px solid var(--rule)}
|
||
.figs b{display:block;font-family:var(--num);font-size:24px;font-weight:700;letter-spacing:-.04em;line-height:1.1}
|
||
.figs span{display:block;font-size:11px;color:var(--ink3);margin-top:3px}
|
||
|
||
/* ── 入口(编号目录) ──────────────── */
|
||
.entries{padding:4px var(--pad) 0}
|
||
.entry{
|
||
display:flex;align-items:center;gap:13px;width:100%;padding:15px 0;
|
||
border-bottom:1px solid var(--rule);
|
||
}
|
||
.entry:active{background:var(--bg2)}
|
||
.e-no{
|
||
font-family:var(--num);font-size:11.5px;color:var(--ink4);font-weight:500;
|
||
flex:0 0 17px;align-self:flex-start;padding-top:3px;
|
||
}
|
||
.e-body{flex:1;min-width:0}
|
||
.e-t{font-size:16.5px;font-weight:700;letter-spacing:-.3px;display:flex;align-items:baseline;gap:7px}
|
||
.e-t u{text-decoration:none;font-family:var(--num);font-size:11px;font-weight:400;color:var(--ink3);letter-spacing:0}
|
||
.e-s{font-size:12.5px;color:var(--ink3);margin-top:3px;line-height:1.5}
|
||
.e-go{flex:0 0 auto;color:var(--ink4)}
|
||
|
||
/* ── 小节 ─────────────────────────── */
|
||
.sec{padding:26px var(--pad) 0}
|
||
.sec-hd{display:flex;align-items:baseline;gap:10px;padding-bottom:8px;border-bottom:1px solid var(--ink)}
|
||
.sec-hd h2{font-size:16px;font-weight:700;letter-spacing:-.3px}
|
||
.sec-hd span{font-size:11px;color:var(--ink3)}
|
||
.sec-hd .more{margin-left:auto;font-size:12px;color:var(--ink2)}
|
||
|
||
/* 专业行 + 迷你分布 */
|
||
.mrow{display:flex;align-items:center;gap:12px;width:100%;padding:12px 0;border-bottom:1px solid var(--rule)}
|
||
.mrow:active{background:var(--bg2)}
|
||
.mrow-l{flex:1;min-width:0}
|
||
.mrow-t{font-size:15.5px;font-weight:600;letter-spacing:-.2px;display:flex;align-items:baseline;gap:6px}
|
||
.mrow-t u{text-decoration:none;font-family:var(--num);font-size:11px;color:var(--ink3);font-weight:400}
|
||
.mrow-s{font-size:12px;color:var(--ink3);margin-top:2px}
|
||
.mrow-s em{font-style:normal;color:var(--accent);font-weight:600}
|
||
.spark{flex:0 0 58px}
|
||
|
||
/* ── 页头 ─────────────────────────── */
|
||
.ph{padding:16px var(--pad) 0}
|
||
.crumb{font-size:11.5px;color:var(--ink3);display:flex;align-items:center;gap:6px}
|
||
.ph h1{font-size:27px;font-weight:800;letter-spacing:-.8px;margin-top:10px;line-height:1.24}
|
||
.ph h1 .code{font-family:var(--num);font-size:12px;font-weight:400;color:var(--ink3);letter-spacing:0;margin-left:6px}
|
||
.ph .lede{font-size:13px;color:var(--ink2);margin-top:8px;line-height:1.7}
|
||
.ph .lede b{font-weight:700;color:var(--ink)}
|
||
|
||
/* ── 图表 ─────────────────────────── */
|
||
.chart{margin:18px var(--pad) 0}
|
||
.chart-hd{display:flex;align-items:baseline;gap:8px;font-size:12px;font-weight:700;color:var(--ink)}
|
||
.chart-hd span{font-weight:400;color:var(--ink3);font-size:11px;margin-left:auto;font-family:var(--num)}
|
||
.chart svg{display:block;width:100%;margin-top:8px;overflow:visible}
|
||
.cap{font-size:11px;color:var(--ink3);line-height:1.65;margin-top:7px;padding-top:6px;border-top:1px solid var(--rule)}
|
||
.cap b{color:var(--ink2);font-weight:600}
|
||
|
||
/* 结论条 */
|
||
.finding{
|
||
margin:16px var(--pad) 0;padding:12px 0 12px 12px;border-left:3px solid var(--accent);
|
||
font-size:13.5px;line-height:1.75;color:var(--ink2);
|
||
}
|
||
.finding b{color:var(--ink);font-weight:700}
|
||
.finding .hl{color:var(--accent);font-weight:700}
|
||
|
||
/* ── 排序 / 筛选 ───────────────────── */
|
||
.toolbar{position:sticky;top:50px;z-index:30;background:var(--bg);border-bottom:1px solid var(--rule);margin-top:18px}
|
||
.sorts{display:flex;gap:18px;padding:0 var(--pad);overflow-x:auto;scrollbar-width:none;border-bottom:1px solid var(--rule)}
|
||
.sorts::-webkit-scrollbar{display:none}
|
||
.sorts button{
|
||
flex:0 0 auto;height:40px;font-size:13px;color:var(--ink3);
|
||
border-bottom:2px solid transparent;margin-bottom:-1px;font-weight:500;
|
||
}
|
||
.sorts button.on{color:var(--ink);font-weight:700;border-bottom-color:var(--ink)}
|
||
.frow{display:flex;gap:8px;padding:9px var(--pad);align-items:center}
|
||
.fsel{
|
||
height:30px;padding:0 22px 0 9px;border:1px solid var(--rule2);font-size:12.5px;color:var(--ink2);
|
||
background:var(--bg) url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 24 24' fill='none' stroke='%238A8A8A' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 7px center;
|
||
-webkit-appearance:none;appearance:none;border-radius:2px;
|
||
}
|
||
.fcount{margin-left:auto;font-size:11px;color:var(--ink3);font-family:var(--num)}
|
||
.chips{display:flex;gap:7px;overflow-x:auto;padding:0 var(--pad) 9px;scrollbar-width:none}
|
||
.chips::-webkit-scrollbar{display:none}
|
||
.chip{
|
||
flex:0 0 auto;height:28px;padding:0 10px;border:1px solid var(--rule2);
|
||
font-size:12px;color:var(--ink2);border-radius:2px;background:var(--bg);
|
||
}
|
||
.chip.on{background:var(--ink);border-color:var(--ink);color:#fff}
|
||
|
||
/* ── 数据行 ───────────────────────── */
|
||
.rows{border-top:1px solid var(--rule)}
|
||
.row{display:flex;align-items:stretch;width:100%;border-bottom:1px solid var(--rule);background:var(--bg);position:relative}
|
||
.row:active{background:var(--bg2)}
|
||
.row::before{content:"";width:2px;flex:0 0 2px;background:var(--tone,transparent)}
|
||
.row-in{display:flex;align-items:center;gap:10px;padding:12px var(--pad) 12px 12px;flex:1;min-width:0}
|
||
.r-no{font-family:var(--num);font-size:11px;color:var(--ink4);flex:0 0 17px;text-align:right;align-self:flex-start;padding-top:3px}
|
||
.r-mid{flex:1;min-width:0}
|
||
.r-t{display:flex;align-items:center;gap:6px;min-width:0}
|
||
.r-t b{font-size:15.5px;font-weight:600;letter-spacing:-.2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||
.r-t .gr{font-style:normal;font-size:10.5px;font-weight:700;letter-spacing:.02em}
|
||
.g-cold{color:#0B6E4F}.g-hot{color:var(--accent)}.g-mid{color:var(--ink3)}
|
||
.r-s{font-size:11.5px;color:var(--ink3);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||
.r-r{flex:0 0 auto;text-align:right;padding-left:6px}
|
||
.r-r b{font-family:var(--num);font-size:21px;font-weight:700;letter-spacing:-.04em;line-height:1;white-space:nowrap}
|
||
.r-r b em{font-style:normal;font-size:10px;font-weight:400;color:var(--ink4);margin-left:2px;letter-spacing:0}
|
||
.r-r b.na{color:var(--ink4);font-weight:400;font-size:16px}
|
||
.r-r span{display:block;font-size:10px;color:var(--ink3);margin-top:3px}
|
||
|
||
.lv{font-size:9.5px;line-height:1;padding:2px 3px;font-weight:700;letter-spacing:.02em;border-radius:1px;flex:0 0 auto}
|
||
.lv-985{background:var(--accent);color:#fff}
|
||
.lv-211{background:var(--ink);color:#fff}
|
||
.lv-双一流{color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
|
||
|
||
.list-more{display:block;width:100%;padding:17px var(--pad);background:var(--bg2);
|
||
border-bottom:1px solid var(--rule);font-size:12.5px;color:var(--ink2)}
|
||
.list-more span{color:var(--accent);font-weight:600}
|
||
|
||
/* ── 判断卡 ───────────────────────── */
|
||
.verdict{margin:20px var(--pad) 0;border:1px solid var(--ink);background:var(--bg)}
|
||
.v-hd{padding:12px 14px;border-bottom:1px solid var(--ink);display:flex;align-items:baseline;gap:8px}
|
||
.v-hd b{font-size:15px;font-weight:700;letter-spacing:-.2px}
|
||
.v-hd span{font-size:11.5px;color:var(--ink3);margin-left:auto;font-family:var(--num)}
|
||
.v-nums{display:flex;padding:15px 0}
|
||
.v-nums>div{flex:1;text-align:center;position:relative}
|
||
.v-nums>div+div{border-left:1px solid var(--rule)}
|
||
.v-nums b{display:block;font-family:var(--num);font-size:32px;font-weight:700;letter-spacing:-.05em;line-height:1.05}
|
||
.v-nums i{display:block;font-style:normal;font-size:12px;color:var(--ink2);margin-top:5px;font-weight:600}
|
||
.v-nums u{display:block;text-decoration:none;font-size:10px;color:var(--ink3);margin-top:2px}
|
||
.v-tc b{color:var(--accent)} .v-tw b{color:#8A5A00} .v-tb b{color:#0B6E4F}
|
||
.v-body{padding:0 14px 14px}
|
||
.v-pos{font-size:13px;line-height:1.8;color:var(--ink2);padding-top:12px;border-top:1px solid var(--rule)}
|
||
.v-pos b{color:var(--ink);font-weight:700}
|
||
.v-pos .hl{color:var(--accent);font-weight:700}
|
||
.v-bar{position:relative;height:30px;margin-top:10px}
|
||
.v-bar .track{position:absolute;left:0;right:0;top:14px;height:4px;background:var(--bg3)}
|
||
.v-bar .mark{position:absolute;top:5px;width:2px;height:20px;background:var(--accent)}
|
||
.v-bar .mark::after{content:"";position:absolute;left:-3px;top:-4px;width:8px;height:8px;border-radius:50%;background:var(--accent)}
|
||
.v-bar .lb{position:absolute;top:-1px;font-size:9.5px;color:var(--ink3);font-family:var(--num)}
|
||
.v-bar .lb.l{left:0}.v-bar .lb.r{right:0}
|
||
|
||
/* 档位列表 */
|
||
.tier{margin-top:20px}
|
||
.tier-hd{display:flex;align-items:baseline;gap:8px;padding-bottom:7px;border-bottom:1px solid var(--ink)}
|
||
.tier-hd b{font-size:15px;font-weight:700}
|
||
.tier-hd span{font-size:11px;color:var(--ink3)}
|
||
.tier-hd .n{margin-left:auto;font-family:var(--num);font-size:13px;color:var(--ink2);font-weight:600}
|
||
.trow{display:flex;align-items:center;gap:10px;width:100%;padding:10px 0;border-bottom:1px solid var(--rule)}
|
||
.trow:active{background:var(--bg2)}
|
||
.tr-l{flex:1;min-width:0}
|
||
.tr-t{font-size:14.5px;font-weight:600;display:flex;align-items:center;gap:5px;min-width:0}
|
||
.tr-t b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||
.tr-s{font-size:11.5px;color:var(--ink3);margin-top:1px}
|
||
.tr-r{flex:0 0 auto;text-align:right}
|
||
.tr-r b{display:block;font-family:var(--num);font-size:16px;font-weight:700;letter-spacing:-.02em}
|
||
.tr-r span{display:block;font-size:10.5px;margin-top:1px}
|
||
.up{color:#0B6E4F}.down{color:var(--accent)}
|
||
|
||
/* ── 表单 ─────────────────────────── */
|
||
.form{padding:18px var(--pad) 0}
|
||
.field{margin-bottom:14px}
|
||
.field label{display:block;font-size:10.5px;letter-spacing:.12em;color:var(--ink3);margin-bottom:6px}
|
||
.big-in{
|
||
width:100%;height:68px;border:1px solid var(--ink);background:var(--bg);
|
||
padding:0 14px;font-family:var(--num);font-size:36px;font-weight:700;letter-spacing:-.04em;
|
||
-moz-appearance:textfield;border-radius:0;
|
||
}
|
||
.big-in::-webkit-outer-spin-button,.big-in::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
|
||
.big-in::placeholder{color:var(--ink4);font-weight:400}
|
||
.pick{width:100%;height:48px;border:1px solid var(--rule2);background:var(--bg);padding:0 12px;
|
||
display:flex;align-items:center;gap:8px;font-size:14.5px}
|
||
.pick .arw{margin-left:auto;color:var(--ink3)}
|
||
.btn{width:100%;height:50px;background:var(--ink);color:#fff;font-size:15px;font-weight:700;border-radius:0;
|
||
display:flex;align-items:center;justify-content:center}
|
||
.btn:active{background:#000}
|
||
.btn-line{width:100%;height:44px;border:1px solid var(--rule2);background:var(--bg);font-size:13.5px;
|
||
font-weight:600;color:var(--ink2);display:flex;align-items:center;justify-content:center}
|
||
.hint{font-size:11.5px;color:var(--ink3);line-height:1.7;margin-top:8px}
|
||
|
||
/* ── 空 / 骨架 ─────────────────────── */
|
||
.empty{margin:22px var(--pad);padding:20px 0;border-top:1px solid var(--rule);border-bottom:1px solid var(--rule)}
|
||
.empty b{display:block;font-size:15px;font-weight:700;margin-bottom:6px}
|
||
.empty p{font-size:12.5px;color:var(--ink3);line-height:1.75}
|
||
.sk{height:62px;border-bottom:1px solid var(--rule);position:relative;overflow:hidden;background:var(--bg)}
|
||
.sk::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(0,0,0,.04),transparent);animation:sh 1.1s infinite}
|
||
@keyframes sh{from{transform:translateX(-100%)}to{transform:translateX(100%)}}
|
||
|
||
/* ── 底部 tab ─────────────────────── */
|
||
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:45;max-width:520px;margin:0 auto;
|
||
background:var(--bg);border-top:1px solid var(--ink);padding-bottom:env(safe-area-inset-bottom)}
|
||
.tabs-in{display:flex;height:var(--tab)}
|
||
.tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
|
||
font-size:10px;color:var(--ink3);letter-spacing:.04em}
|
||
.tab svg{width:19px;height:19px;stroke-width:1.6}
|
||
.tab.on{color:var(--ink);font-weight:700}
|
||
.tab.on svg{stroke-width:2.1}
|
||
body{padding-bottom:calc(var(--tab) + env(safe-area-inset-bottom))}
|
||
|
||
/* ── 浮层 ─────────────────────────── */
|
||
.mask{position:fixed;inset:0;background:rgba(17,17,17,.4);z-index:60;opacity:0;visibility:hidden;transition:.18s}
|
||
.mask.on{opacity:1;visibility:visible}
|
||
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:70;max-width:520px;margin:0 auto;
|
||
background:var(--bg);border-top:2px solid var(--ink);max-height:88dvh;display:flex;flex-direction:column;
|
||
transform:translateY(101%);transition:transform .24s cubic-bezier(.22,1,.36,1)}
|
||
.sheet.on{transform:none}
|
||
.sheet-hd{padding:16px var(--pad) 12px;border-bottom:1px solid var(--ink);position:relative}
|
||
.sheet-hd::before{content:"";position:absolute;top:6px;left:50%;transform:translateX(-50%);width:32px;height:3px;background:var(--rule2)}
|
||
.sheet-hd h3{font-size:19px;font-weight:800;letter-spacing:-.4px;padding-top:6px}
|
||
.sheet-hd .sub{font-size:11.5px;color:var(--ink3);margin-top:3px}
|
||
.sheet-x{position:absolute;right:12px;top:14px;width:32px;height:32px;display:grid;place-items:center;color:var(--ink3)}
|
||
.sheet-bd{overflow-y:auto;padding:16px var(--pad);-webkit-overflow-scrolling:touch}
|
||
.sheet-ft{padding:10px var(--pad) calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--rule)}
|
||
|
||
.dgrid{display:grid;grid-template-columns:1fr 1fr;border-top:1px solid var(--rule);border-left:1px solid var(--rule)}
|
||
.dgrid>div{border-right:1px solid var(--rule);border-bottom:1px solid var(--rule);padding:10px 12px}
|
||
.dgrid i{display:block;font-style:normal;font-size:10.5px;color:var(--ink3);margin-bottom:2px}
|
||
.dgrid b{display:block;font-family:var(--num);font-size:19px;font-weight:700;letter-spacing:-.03em}
|
||
.dgrid b.sm{font-size:14px;font-weight:600;font-family:var(--sans)}
|
||
.sec-t{font-size:10.5px;letter-spacing:.12em;color:var(--ink3);margin:18px 0 7px;padding-bottom:5px;border-bottom:1px solid var(--ink)}
|
||
.yr{width:100%;border-collapse:collapse;font-size:12.5px}
|
||
.yr th{text-align:right;font-size:10.5px;color:var(--ink3);font-weight:400;padding:5px 0;border-bottom:1px solid var(--rule)}
|
||
.yr th:first-child{text-align:left}
|
||
.yr td{text-align:right;padding:7px 0;border-bottom:1px solid var(--rule);font-family:var(--num)}
|
||
.yr td:first-child{text-align:left;font-family:var(--sans);color:var(--ink2)}
|
||
.yr tr:last-child td{border-bottom:0}
|
||
.tag{font-size:10.5px;padding:2px 5px;line-height:1.5;display:inline-block;border:1px solid var(--rule2);color:var(--ink2)}
|
||
.tag.t-ln,.tag.t-ok,.tag.t-gf{color:#0B6E4F;border-color:#BFD8CC}
|
||
.tag.t-yk,.tag.t-np,.tag.t-sw{color:var(--accent);border-color:#E4C4C1}
|
||
.tag.t-tj,.tag.t-zk{color:#8A5A00;border-color:#DCCBA6}
|
||
.note{font-size:11.5px;color:var(--ink3);line-height:1.85}
|
||
.note b{color:var(--ink2);font-weight:600}
|
||
|
||
/* ── 搜索 ─────────────────────────── */
|
||
.srch{position:fixed;inset:0;z-index:80;background:var(--bg);max-width:520px;margin:0 auto;
|
||
display:flex;flex-direction:column;transform:translateY(-6px);opacity:0;visibility:hidden;transition:.16s}
|
||
.srch.on{transform:none;opacity:1;visibility:visible}
|
||
.srch-hd{display:flex;align-items:center;gap:10px;padding:9px var(--pad);border-bottom:1px solid var(--ink)}
|
||
.srch-in{flex:1;display:flex;align-items:center;gap:8px;height:38px;border:1px solid var(--rule2);padding:0 10px}
|
||
.srch-in input{flex:1;min-width:0;font-size:14.5px}
|
||
.srch-in svg{color:var(--ink3);flex:0 0 auto}
|
||
.srch-cancel{font-size:13.5px;color:var(--ink2);flex:0 0 auto}
|
||
.srch-bd{overflow-y:auto;flex:1;padding-bottom:40px}
|
||
.sgt{font-size:10.5px;letter-spacing:.12em;color:var(--ink3);padding:14px var(--pad) 6px}
|
||
.sitem{display:flex;align-items:center;gap:10px;width:100%;padding:11px var(--pad);border-bottom:1px solid var(--rule)}
|
||
.sitem:active{background:var(--bg2)}
|
||
.sitem-t{flex:1;min-width:0;font-size:14.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||
.sitem-t em{font-style:normal;color:var(--accent);font-weight:700}
|
||
.sitem-m{font-size:11px;color:var(--ink3);flex:0 0 auto;font-family:var(--num)}
|
||
|
||
#toast{position:fixed;left:50%;bottom:calc(var(--tab) + 22px + env(safe-area-inset-bottom));
|
||
transform:translate(-50%,6px);background:var(--ink);color:#fff;padding:8px 15px;font-size:12.5px;
|
||
z-index:200;opacity:0;pointer-events:none;transition:.18s;white-space:nowrap;max-width:88vw}
|
||
#toast.on{opacity:1;transform:translate(-50%,0)}
|
||
|
||
.view{display:none}.view.on{display:block}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="app">
|
||
|
||
<header class="top">
|
||
<div class="top-in">
|
||
<a class="logo" href="#/home">研<i>择</i></a>
|
||
<button class="top-btn" id="btn-search" aria-label="搜索院校或专业" style="margin-left:auto">
|
||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"><circle cx="10.5" cy="10.5" r="6.5"/><path d="M20 20l-4.6-4.6"/></svg>
|
||
</button>
|
||
</div>
|
||
</header>
|
||
|
||
<main>
|
||
<section class="view" id="v-home">
|
||
<div class="mast">
|
||
<div class="kicker"><span>择校数据</span><span>2026 录取季</span></div>
|
||
<h1>五万个硕士点<br>录取分<em>都在这儿</em></h1>
|
||
<p class="dek">先按专业看全国院校的分数分布,或者填个估分,看你在这一档里排在什么位置。</p>
|
||
<div class="figs" id="figs">
|
||
<div><b class="num">—</b><span>硕士点</span></div>
|
||
<div><b class="num">—</b><span>所院校</span></div>
|
||
<div><b class="num">—</b><span>有录取分</span></div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="entries" id="entries"></div>
|
||
|
||
<div class="sec">
|
||
<div class="sec-hd">
|
||
<h2>开设最多的专业</h2>
|
||
<span>按硕士点数</span>
|
||
</div>
|
||
<div id="home-majors"></div>
|
||
</div>
|
||
|
||
<div class="sec">
|
||
<div class="sec-hd"><h2>数据说明</h2><span>读之前先看这几句</span></div>
|
||
<div class="note" id="foot-note" style="margin-top:12px;padding-bottom:70px">加载中…</div>
|
||
</div>
|
||
</section>
|
||
|
||
<section class="view" id="v-rank">
|
||
<div class="ph" id="rank-hd"></div>
|
||
<div class="chart" id="rank-chart"></div>
|
||
<div class="finding" id="rank-finding"></div>
|
||
<div class="toolbar">
|
||
<div class="sorts" id="rank-sorts">
|
||
<button data-sort="easy" class="on">好考优先</button>
|
||
<button data-sort="low">分数从低到高</button>
|
||
<button data-sort="big">招生多</button>
|
||
<button data-sort="hot">竞争最热</button>
|
||
</div>
|
||
<div class="frow">
|
||
<select class="fsel" id="f-pv" aria-label="地区"><option value="">全国</option></select>
|
||
<select class="fsel" id="f-lv" aria-label="层次">
|
||
<option value="">不限层次</option>
|
||
<option value="985">985</option>
|
||
<option value="211">211</option>
|
||
<option value="双一流">双一流</option>
|
||
<option value="双非">双非</option>
|
||
</select>
|
||
<span class="fcount" id="rank-cnt"></span>
|
||
</div>
|
||
<div class="chips" id="rank-tags">
|
||
<button class="chip on" data-tag="">全部</button>
|
||
<button class="chip" data-tag="ln">可捡漏</button>
|
||
<button class="chip" data-tag="ok">过线就上</button>
|
||
<button class="chip" data-tag="cold">偏冷</button>
|
||
<button class="chip" data-tag="yk">压分</button>
|
||
</div>
|
||
</div>
|
||
<div class="rows" id="rank-list"></div>
|
||
</section>
|
||
|
||
<section class="view" id="v-score">
|
||
<div class="ph">
|
||
<div class="crumb">估分择校</div>
|
||
<h1>填分数,看排在哪</h1>
|
||
<p class="lede">基准是各硕士点<b>去年拟录取最低分</b>。最低分是某个考生的分数,不是平均水位——招 5 人和招 50 人的同一个分数,风险差得远。</p>
|
||
</div>
|
||
<div class="form">
|
||
<div class="field">
|
||
<label>目标专业</label>
|
||
<button class="pick" id="score-major">
|
||
<span id="score-major-txt" style="color:var(--ink3)">选择专业</span>
|
||
<svg class="arw" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4"><path d="M9 6l6 6-6 6"/></svg>
|
||
</button>
|
||
</div>
|
||
<div class="field">
|
||
<label>预估总分</label>
|
||
<input class="big-in" id="score-val" type="number" inputmode="numeric" placeholder="320">
|
||
</div>
|
||
<button class="btn" id="score-go">看排在什么位置</button>
|
||
</div>
|
||
<div id="score-result" style="padding:0 var(--pad) 40px">
|
||
<div class="note" style="margin-top:20px;padding-top:14px;border-top:1px solid var(--ink)">
|
||
选好专业、填上分数,会按去年拟录取最低分把你和学校分成三档:冲刺、稳妥、保底,并在分数分布上标出你的位置。<br>
|
||
手头还没分数的话,先去榜单看这个专业的分数分布。
|
||
<a href="#/major/085400" style="color:var(--accent);font-weight:600;display:block;margin-top:10px">看电子信息(085400)的榜单 ›</a>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<section class="view" id="v-schools">
|
||
<div class="ph">
|
||
<div class="crumb">院校库</div>
|
||
<h1>先选学校,再看专业</h1>
|
||
<p class="lede">同一所学校里,专业之间的分差常常比学校之间还大。点进去看它哪些专业偏冷。</p>
|
||
</div>
|
||
<div class="toolbar" style="margin-top:14px">
|
||
<div class="frow" style="padding-top:10px;padding-bottom:10px">
|
||
<select class="fsel" id="s-pv" aria-label="地区"><option value="">全国</option></select>
|
||
<select class="fsel" id="s-lv" aria-label="层次">
|
||
<option value="">不限层次</option>
|
||
<option value="985">985</option>
|
||
<option value="211">211</option>
|
||
<option value="双一流">双一流</option>
|
||
<option value="双非">双非</option>
|
||
</select>
|
||
<select class="fsel" id="s-sort" aria-label="排序">
|
||
<option value="n">专业最多</option>
|
||
<option value="cold">好考专业多</option>
|
||
<option value="sc">竞争最热</option>
|
||
</select>
|
||
<span class="fcount" id="sch-cnt"></span>
|
||
</div>
|
||
</div>
|
||
<div class="rows" id="school-list"></div>
|
||
</section>
|
||
|
||
<section class="view" id="v-school">
|
||
<div class="ph" id="school-hd"></div>
|
||
<div id="school-body"></div>
|
||
</section>
|
||
</main>
|
||
|
||
<nav class="tabs">
|
||
<div class="tabs-in">
|
||
<a class="tab" href="#/home" data-nav="home">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"><path d="M3.5 10.5L12 3.5l8.5 7"/><path d="M5.5 9.5V20h13V9.5"/></svg>首页</a>
|
||
<a class="tab" href="#/rank" data-nav="rank">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"><path d="M4 19.5h16"/><path d="M7 19.5v-6M11.5 19.5V7M16 19.5v-9M20.5 19.5v-4"/></svg>榜单</a>
|
||
<a class="tab" href="#/score" data-nav="score">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"><rect x="4.5" y="3.5" width="15" height="17"/><path d="M8 8.5h8M8 12.5h8M8 16.5h4"/></svg>估分</a>
|
||
<a class="tab" href="#/schools" data-nav="schools">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"><path d="M3.5 20.5h17"/><path d="M5.5 20.5V9l6.5-5 6.5 5v11.5"/><path d="M10 20.5v-5h4v5"/></svg>院校</a>
|
||
</div>
|
||
</nav>
|
||
|
||
<div class="mask" id="mask"></div>
|
||
<aside class="sheet" id="sheet" role="dialog" aria-modal="true" aria-labelledby="sheet-title">
|
||
<div class="sheet-hd">
|
||
<button class="sheet-x" id="sheet-x" aria-label="关闭">
|
||
<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"><path d="M6 6l12 12M18 6L6 18"/></svg>
|
||
</button>
|
||
<h3 id="sheet-title">—</h3>
|
||
<div class="sub" id="sheet-sub">—</div>
|
||
</div>
|
||
<div class="sheet-bd" id="sheet-bd"></div>
|
||
<div class="sheet-ft" id="sheet-ft"></div>
|
||
</aside>
|
||
|
||
<div class="srch" id="srch">
|
||
<div class="srch-hd">
|
||
<div class="srch-in">
|
||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"><circle cx="10.5" cy="10.5" r="6.5"/><path d="M20 20l-4.6-4.6"/></svg>
|
||
<input id="srch-in" type="search" placeholder="院校名、专业名或专业代码" autocomplete="off" aria-label="搜索">
|
||
</div>
|
||
<button class="srch-cancel" id="srch-cancel">取消</button>
|
||
</div>
|
||
<div class="srch-bd" id="srch-bd"></div>
|
||
</div>
|
||
|
||
<div id="toast"></div>
|
||
</div>
|
||
|
||
<script>
|
||
'use strict';
|
||
const $ = (s, r = document) => r.querySelector(s);
|
||
const $$ = (s, r = document) => Array.from(r.querySelectorAll(s));
|
||
const esc = s => String(s ?? '').replace(/[&<>"']/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
||
const fmt = n => (n === null || n === undefined || n === '') ? '—' : Number(n).toLocaleString('zh-CN');
|
||
const num1 = n => (n === null || n === undefined) ? '—' : (Math.round(n * 10) / 10);
|
||
|
||
const TAG = { ln: '可捡漏', ok: '过线就能上', yk: '压分', np: '不保护一志愿', tj: '有调剂', ht: '火爆', sm: '招生少', fb: '复试比大', sb: '双非慎报', bk: '参考书多', zk: '专业课难', sw: '死亡硕士点', gf: '给分足' };
|
||
const STRONG = ['ln', 'ok', 'yk', 'np', 'sw', 'fb', 'zk'];
|
||
const TONE = { '偏冷': '#0B6E4F', '中性': '#C9C9C4', '偏热': '#B3261E', '极热': '#B3261E' };
|
||
|
||
const S = {
|
||
idx: null, schools: [], majors: [], majorMap: {},
|
||
cur: null, F: { sort: 'easy', pv: '', lv: '', tag: '', all: false },
|
||
SF: { pv: '', lv: '', sort: 'n' },
|
||
scoreMajor: null, pending: null, pendingScore: null, afterPick: null
|
||
};
|
||
|
||
/* ── 统计工具 ── */
|
||
const median = a => { const b = a.slice().sort((x, y) => x - y); const m = b.length >> 1; return b.length % 2 ? b[m] : (b[m - 1] + b[m]) / 2; };
|
||
const quant = (a, q) => { const b = a.slice().sort((x, y) => x - y); return b[Math.min(b.length - 1, Math.floor(b.length * q))]; };
|
||
function makeBins(vals, k) {
|
||
const min = Math.min(...vals), max = Math.max(...vals);
|
||
const span = Math.max(max - min, 1);
|
||
const w = span / k;
|
||
const counts = new Array(k).fill(0);
|
||
vals.forEach(v => {
|
||
let i = Math.floor((v - min) / w);
|
||
if (i >= k) i = k - 1;
|
||
if (i < 0) i = 0;
|
||
counts[i]++;
|
||
});
|
||
return { counts, min, max, w, k };
|
||
}
|
||
|
||
/* 直方图:14 个区间,你所在的区间标红 */
|
||
function histSVG(vals, mark) {
|
||
if (vals.length < 4) return '';
|
||
const W = 340, H = 108, base = 80, top = 10, pad = 12;
|
||
const b = makeBins(vals, 10);
|
||
const maxC = Math.max(...b.counts);
|
||
const bw = (W - pad * 2) / b.k;
|
||
const tall = base - top;
|
||
const med = median(vals);
|
||
let s = `<svg viewBox="0 0 ${W} ${H}" width="100%" height="108" role="img" aria-label="录取分分布">`;
|
||
b.counts.forEach((c, i) => {
|
||
const h = Math.max(Math.round(c / maxC * tall), c ? 2 : 0);
|
||
if (!c) return;
|
||
const x = pad + i * bw;
|
||
const binL = b.min + i * b.w, binR = b.min + (i + 1) * b.w;
|
||
const hit = mark != null && mark >= binL && mark < binR;
|
||
s += `<rect x="${(x + 1).toFixed(1)}" y="${base - h}" width="${(bw - 2).toFixed(1)}" height="${h}" fill="${hit ? '#B3261E' : '#C4C4BE'}"/>`;
|
||
});
|
||
s += `<line x1="${pad}" y1="${base}" x2="${W - pad}" y2="${base}" stroke="#111" stroke-width="1"/>`;
|
||
s += `<line x1="${pad}" y1="${base}" x2="${W - pad}" y2="${base}" stroke="#111" stroke-width="1"/>`;
|
||
const mx = pad + ((med - b.min) / Math.max(b.max - b.min, 1)) * (W - pad * 2);
|
||
s += `<line x1="${mx.toFixed(1)}" y1="${base}" x2="${mx.toFixed(1)}" y2="${base + 5}" stroke="#111" stroke-width="1"/>`;
|
||
s += `<text x="${mx.toFixed(1)}" y="${base + 19}" font-size="10" fill="#111" text-anchor="middle" font-family="Helvetica,Arial">中位 ${Math.round(med)}</text>`;
|
||
s += `<text x="${pad}" y="${base + 19}" font-size="10" fill="#8A8A8A" font-family="Helvetica,Arial">${Math.round(b.min)}</text>`;
|
||
s += `<text x="${W - pad}" y="${base + 19}" font-size="10" fill="#8A8A8A" text-anchor="end" font-family="Helvetica,Arial">${Math.round(b.max)}</text>`;
|
||
if (mark != null) {
|
||
const px = pad + ((mark - b.min) / Math.max(b.max - b.min, 1)) * (W - pad * 2);
|
||
if (px > pad && px < W - pad) {
|
||
s += `<line x1="${px.toFixed(1)}" y1="${top - 2}" x2="${px.toFixed(1)}" y2="${base}" stroke="#B3261E" stroke-width="1.5" stroke-dasharray="2 2"/>`;
|
||
s += `<text x="${px.toFixed(1)}" y="${top - 6}" font-size="10" fill="#B3261E" text-anchor="middle" font-family="Helvetica,Arial" font-weight="bold">你 ${mark}</text>`;
|
||
}
|
||
}
|
||
return s + '</svg>';
|
||
}
|
||
|
||
/* ── 数据 ── */
|
||
async function boot() {
|
||
try {
|
||
const [idx, sch, maj] = await Promise.all([
|
||
fetch('data/probe_index.json').then(r => r.json()),
|
||
fetch('data/school_probe.json').then(r => r.json()),
|
||
fetch('data/majors.json').then(r => r.json())
|
||
]);
|
||
S.idx = idx;
|
||
S.schools = sch.schools;
|
||
S.majors = Array.isArray(maj) ? maj : (maj.majors || []);
|
||
S.majors.forEach(m => S.majorMap[m.code] = m);
|
||
paintHome();
|
||
route();
|
||
applyURL();
|
||
} catch (e) {
|
||
console.error(e);
|
||
$('main').innerHTML = '<div class="empty"><b>数据没加载出来</b><p>要通过本地服务器打开(file:// 会被浏览器拦),并确认 data/ 目录完整。</p></div>';
|
||
}
|
||
}
|
||
|
||
/* ── 首页 ── */
|
||
function paintHome() {
|
||
const o = S.idx.overview;
|
||
$('#figs').innerHTML =
|
||
`<div><b class="num">${fmt(o.n_point)}</b><span>硕士点</span></div>
|
||
<div><b class="num">${fmt(o.n_school)}</b><span>所院校</span></div>
|
||
<div><b class="num">${fmt(o.n_admit)}</b><span>有录取分</span></div>`;
|
||
|
||
const entries = [
|
||
{ no: '01', t: '按专业挑学校', u: fmt(o.n_code) + ' 个专业', s: '看全国院校的分数分布,谁低谁高一眼看出来', href: '#/rank' },
|
||
{ no: '02', t: '我有个估分', u: '', s: '填分数,看冲刺、稳妥、保底三档,以及你排在哪', href: '#/score' },
|
||
{ no: '03', t: '按院校查', u: fmt(o.n_school) + ' 所', s: '看一所学校里哪些专业偏冷、哪些别碰', href: '#/schools' },
|
||
{ no: '04', t: '捡漏与避坑', u: fmt(o.n_tag) + ' 条标签', s: '招不满的、压分的、不保护一志愿的', href: '#/rank', tag: 'ln' }
|
||
];
|
||
$('#entries').innerHTML = entries.map(e => `
|
||
<button class="entry" data-href="${e.href}"${e.tag ? ` data-tag="${e.tag}"` : ''}>
|
||
<span class="e-no">${e.no}</span>
|
||
<span class="e-body">
|
||
<span class="e-t">${e.t}${e.u ? `<u>${e.u}</u>` : ''}</span>
|
||
<span class="e-s">${e.s}</span>
|
||
</span>
|
||
<svg class="e-go" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4"><path d="M9 6l6 6-6 6"/></svg>
|
||
</button>`).join('');
|
||
|
||
const top = S.idx.majors.slice(0, 7);
|
||
$('#home-majors').innerHTML = top.map(m => `
|
||
<button class="mrow" data-code="${m.code}">
|
||
<span class="mrow-l">
|
||
<span class="mrow-t">${esc(m.name)}<u>${m.code}</u></span>
|
||
<span class="mrow-s">${m.n} 个硕士点${m.cold ? ` <em>${m.cold} 个偏冷</em>` : ''}</span>
|
||
</span>
|
||
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="#C9C9C4" stroke-width="2.4" style="flex:0 0 auto"><path d="M9 6l6 6-6 6"/></svg>
|
||
</button>`).join('');
|
||
|
||
$('#foot-note').innerHTML = `
|
||
共 <b>${fmt(o.n_point)}</b> 个硕士点,按「学校 × 院系 × 专业」计数,同校同专业分在不同院系的分别算。
|
||
其中 <b>${fmt(o.n_scored)}</b> 个有平台竞争评估,<b>${fmt(o.n_admit)}</b> 个查得到拟录取最低分。<br>
|
||
竞争分(0–100)和「偏冷 / 中性 / 偏热 / 极热」是平台按报录比、调剂、分数分布测算的相对热度,<b>不是官方指标</b>。
|
||
录取分、录取人数是源页实测值,缺的显示「—」,不按 0 处理。<br>
|
||
数据覆盖不完整。没给数字的地方就是真没有,不用猜。`;
|
||
}
|
||
|
||
/* ── 路由 ── */
|
||
function route() {
|
||
const h = (location.hash || '#/home').replace(/^#\/?/, '');
|
||
const seg = h.split('/');
|
||
const p = seg[0] || 'home';
|
||
$$('.view').forEach(v => v.classList.remove('on'));
|
||
const tabKey = (p === 'major' || p === 'rank') ? 'rank' : (p === 'school') ? 'schools' : p;
|
||
$$('.tab').forEach(a => a.classList.toggle('on', a.dataset.nav === tabKey));
|
||
window.scrollTo(0, 0);
|
||
|
||
if (p === 'home') $('#v-home').classList.add('on');
|
||
else if (p === 'rank') {
|
||
$('#v-rank').classList.add('on');
|
||
if (!S.cur) openRank(null); else { applyPending(); renderRank(); }
|
||
}
|
||
else if (p === 'major') { $('#v-rank').classList.add('on'); openRank(seg[1]); }
|
||
else if (p === 'score') { $('#v-score').classList.add('on'); runPendingScore(); }
|
||
else if (p === 'schools') { $('#v-schools').classList.add('on'); paintSchools(); }
|
||
else if (p === 'school') { $('#v-school').classList.add('on'); openSchool(seg[1]); }
|
||
else location.hash = '#/home';
|
||
}
|
||
|
||
function applyURL() {
|
||
const q = new URLSearchParams(location.search);
|
||
const code = q.get('m');
|
||
if (code && S.majorMap[code]) { S.scoreMajor = S.majorMap[code]; paintScoreMajor(); }
|
||
const v = q.get('v');
|
||
if (v && /^\d{3}$/.test(v)) {
|
||
$('#score-val').value = v;
|
||
if (/score/.test(location.hash)) loadForScore().then(genScore);
|
||
}
|
||
}
|
||
|
||
/* ── 榜单 ── */
|
||
async function openRank(code) {
|
||
if (!code) code = S.cur ? S.cur.code : '085400';
|
||
if (S.cur && S.cur.code === code) { renderRank(); return; }
|
||
$('#rank-list').innerHTML = '<div class="sk"></div><div class="sk"></div><div class="sk"></div>';
|
||
try {
|
||
const d = await fetch('data/probe/' + code + '.json').then(r => r.json());
|
||
S.cur = d;
|
||
if (location.hash !== '#/major/' + code) history.replaceState(null, '', '#/major/' + code);
|
||
} catch (e) {
|
||
S.cur = null;
|
||
$('#rank-hd').innerHTML = '<div class="crumb">榜单</div><h1>没找到这个专业</h1>';
|
||
$('#rank-list').innerHTML = '<div class="empty"><b>换一个专业试试</b><p>点右上角搜索,输入专业名或代码。</p></div>';
|
||
return;
|
||
}
|
||
const pvs = [...new Set(S.cur.rows.map(r => r.pv).filter(Boolean))].sort();
|
||
$('#f-pv').innerHTML = '<option value="">全国</option>' +
|
||
pvs.map(x => `<option value="${esc(x)}">${esc(x).replace(/省|市|自治区|壮族|回族|维吾尔/g, '')}</option>`).join('');
|
||
S.F.pv = ''; S.F.lv = ''; S.F.tag = ''; S.F.all = false;
|
||
$('#f-pv').value = ''; $('#f-lv').value = '';
|
||
$$('#rank-tags .chip').forEach(b => b.classList.toggle('on', b.dataset.tag === ''));
|
||
applyPending();
|
||
renderRank();
|
||
}
|
||
|
||
function goRank(opts) {
|
||
S.pending = opts || {};
|
||
if (/^#\/(rank|major)/.test(location.hash || '')) {
|
||
if (!S.cur) openRank(null); else { applyPending(); renderRank(); }
|
||
} else location.hash = '#/rank';
|
||
}
|
||
function applyPending() {
|
||
if (!S.pending) return;
|
||
S.F.pv = S.pending.pv || ''; S.F.lv = S.pending.lv || ''; S.F.tag = S.pending.tag || '';
|
||
S.pending = null;
|
||
if ($('#f-pv')) $('#f-pv').value = S.F.pv;
|
||
if ($('#f-lv')) $('#f-lv').value = S.F.lv;
|
||
$$('#rank-tags .chip').forEach(b => b.classList.toggle('on', (b.dataset.tag || '') === S.F.tag));
|
||
}
|
||
function filteredRows() {
|
||
const d = S.cur; if (!d) return [];
|
||
return d.rows.filter(r => {
|
||
if (!S.F.all && r.sc === null && r.img === null) return false;
|
||
if (S.F.pv && r.pv !== S.F.pv) return false;
|
||
if (S.F.lv && r.lv !== S.F.lv) return false;
|
||
if (S.F.tag === 'cold') return r.gr === '偏冷';
|
||
if (S.F.tag) return (r.tg || []).includes(S.F.tag);
|
||
return true;
|
||
});
|
||
}
|
||
function sortRows(rows) {
|
||
const a = rows.slice(), nil = v => v === null || v === undefined, s = S.F.sort;
|
||
if (s === 'low') a.sort((x, y) => (nil(x.img) - nil(y.img)) || (x.img || 9999) - (y.img || 9999));
|
||
else if (s === 'big') a.sort((x, y) => (y.ic || 0) - (x.ic || 0));
|
||
else if (s === 'hot') a.sort((x, y) => (nil(y.sc) - nil(x.sc)) || (y.sc || -1) - (x.sc || -1));
|
||
else a.sort((x, y) => (nil(x.sc) - nil(y.sc)) || (x.sc ?? 999) - (y.sc ?? 999) || (nil(x.img) - nil(y.img)) || (x.img || 9999) - (y.img || 9999));
|
||
return a;
|
||
}
|
||
|
||
function renderRank() {
|
||
const d = S.cur; if (!d) return;
|
||
const rows = sortRows(filteredRows());
|
||
const withImg = d.rows.filter(r => r.img !== null).length;
|
||
const withSc = d.rows.filter(r => r.sc !== null).length;
|
||
const imgs = d.rows.map(r => r.img).filter(v => v !== null);
|
||
const med = imgs.length ? median(imgs) : null;
|
||
const q1 = imgs.length ? quant(imgs, .25) : null;
|
||
const q3 = imgs.length ? quant(imgs, .75) : null;
|
||
|
||
$('#rank-hd').innerHTML = `
|
||
<div class="crumb"><a href="#/home">首页</a>
|
||
<svg width="9" height="9" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><path d="M9 6l6 6-6 6"/></svg>
|
||
${esc(d.ml || '专业')}</div>
|
||
<h1>${esc(d.name)}<span class="code">${d.code}</span></h1>
|
||
<p class="lede">全国 <b>${fmt(d.n)}</b> 个硕士点开设,<b>${fmt(withImg)}</b> 个查得到去年录取分,<b>${fmt(withSc)}</b> 个有竞争评估。</p>`;
|
||
|
||
$('#rank-chart').innerHTML = imgs.length >= 4 ? `
|
||
<div class="chart-hd">录取最低分分布<span>${withImg} 个硕士点</span></div>
|
||
${histSVG(imgs)}
|
||
<div class="cap">图:每个柱是一个分数区间,柱越高该区间的硕士点越多。竖线标的是<b>中位分 ${Math.round(med)}</b>。</div>` : '';
|
||
|
||
$('#rank-finding').innerHTML = med !== null
|
||
? `中间一半的硕士点,录取分落在 <span class="hl">${Math.round(q1)}–${Math.round(q3)} 分</span> 之间,
|
||
中位 <b>${Math.round(med)} 分</b>。最低 ${Math.round(Math.min(...imgs))},最高 ${Math.round(Math.max(...imgs))}。
|
||
下面这张表按“好考优先”排,往下越难。`
|
||
: `这个专业暂时没有录取分。下面按竞争评估排序。`;
|
||
|
||
$('#rank-cnt').textContent = rows.length + ' / ' + d.n;
|
||
if (!rows.length) {
|
||
$('#rank-list').innerHTML = '<div class="empty"><b>这个条件下没有结果</b><p>把地区或层次放宽一点。</p></div>';
|
||
return;
|
||
}
|
||
const rest = d.n - withSc;
|
||
$('#rank-list').innerHTML = rows.map((r, i) => rowHTML(r, i + 1)).join('') +
|
||
(S.F.all || rest <= 0 ? '' : `<button class="list-more" id="show-all-rows">
|
||
另有 ${fmt(rest)} 个硕士点没有竞争评估<span>一起看 ›</span></button>`);
|
||
const more = $('#show-all-rows');
|
||
if (more) more.onclick = () => { S.F.all = true; renderRank(); toast('已打开全部,缺数据的地方标了「—」'); };
|
||
}
|
||
|
||
function rowHTML(r, i) {
|
||
const tg = (r.tg || []).filter(t => STRONG.includes(t)).slice(0, 2).map(t => TAG[t]);
|
||
const share = [];
|
||
if (r.ic) share.push('招 ' + r.ic + ' 人');
|
||
if (r.pv) share.push(String(r.pv).replace(/省$|市$|自治区$/, ''));
|
||
const lvBadge = (r.lv && r.lv !== '双非') ? `<i class="lv lv-${esc(r.lv)}">${esc(r.lv)}</i>` : '';
|
||
const grCls = r.gr === '偏冷' ? 'g-cold' : (r.gr === '偏热' || r.gr === '极热') ? 'g-hot' : 'g-mid';
|
||
const tail = [esc(r.xy || '不区分院系')].concat(share.length ? [esc(share.join(' · '))] : []).concat(tg).join(' · ');
|
||
return `<button class="row" style="--tone:${TONE[r.gr] || 'transparent'}"
|
||
data-sid="${r.sid}" data-code="${S.cur ? S.cur.code : ''}" data-sname="${esc(r.sch)}" data-xy="${esc(r.xy || '')}">
|
||
<div class="row-in">
|
||
<span class="r-no">${String(i).padStart(2, '0')}</span>
|
||
<div class="r-mid">
|
||
<div class="r-t"><b>${esc(r.sch)}</b>${lvBadge}${r.gr && r.gr !== '中性' ? `<i class="gr ${grCls}">${r.gr}</i>` : ''}</div>
|
||
<div class="r-s">${tail}</div>
|
||
</div>
|
||
<div class="r-r">
|
||
<b class="${r.img === null ? 'na' : ''}">${r.img === null ? '—' : r.img}<em>${r.img === null ? '' : '分'}</em></b>
|
||
</div>
|
||
</div>
|
||
</button>`;
|
||
}
|
||
|
||
/* ── 院校 ── */
|
||
function paintSchools() {
|
||
if (!S.schools.length) return;
|
||
if ($('#s-pv').options.length <= 1) {
|
||
const pvs = [...new Set(S.schools.map(s => s.pv).filter(Boolean))].sort();
|
||
$('#s-pv').innerHTML = '<option value="">全国</option>' +
|
||
pvs.map(x => `<option value="${esc(x)}">${esc(x).replace(/省|市|自治区|壮族|回族|维吾尔/g, '')}</option>`).join('');
|
||
}
|
||
let arr = S.schools.filter(s => (!S.SF.pv || s.pv === S.SF.pv) && (!S.SF.lv || s.lv === S.SF.lv));
|
||
const s = S.SF.sort;
|
||
if (s === 'cold') arr = arr.slice().sort((a, b) => (b.cold || 0) - (a.cold || 0));
|
||
else if (s === 'sc') arr = arr.slice().sort((a, b) => (b.sc ?? -1) - (a.sc ?? -1));
|
||
else arr = arr.slice().sort((a, b) => b.n - a.n);
|
||
|
||
$('#sch-cnt').textContent = arr.length + ' 所';
|
||
$('#school-list').innerHTML = arr.slice(0, 120).map(s2 => `
|
||
<button class="row" style="--tone:transparent" data-go-school="${s2.sid}">
|
||
<div class="row-in">
|
||
<div class="r-mid">
|
||
<div class="r-t"><b>${esc(s2.name)}</b>${(s2.lv && s2.lv !== '双非') ? `<i class="lv lv-${esc(s2.lv)}">${esc(s2.lv)}</i>` : ''}</div>
|
||
<div class="r-s">${esc(s2.pv || '')} · ${s2.n} 个硕士点${s2.cold ? ` · ${s2.cold} 个偏冷` : ''}</div>
|
||
</div>
|
||
<div class="r-r">
|
||
<b class="${s2.img === null ? 'na' : ''}">${s2.img === null ? '—' : s2.img}<em>${s2.img === null ? '' : '分'}</em></b>
|
||
</div>
|
||
</div>
|
||
</button>`).join('') +
|
||
(arr.length > 120 ? `<div style="padding:16px var(--pad);font-size:12px;color:var(--ink3)">还有 ${arr.length - 120} 所,用上面筛选缩小范围</div>` : '');
|
||
}
|
||
|
||
async function openSchool(sid) {
|
||
$('#school-hd').innerHTML = '<div class="crumb">院校</div><h1>加载中…</h1>';
|
||
$('#school-body').innerHTML = '<div class="sk"></div><div class="sk"></div>';
|
||
let d;
|
||
try { d = await fetch('data/school/' + sid + '.json').then(r => r.json()); }
|
||
catch (e) {
|
||
$('#school-hd').innerHTML = '<div class="crumb">院校</div><h1>没有这所学校的数据</h1>';
|
||
$('#school-body').innerHTML = '';
|
||
return;
|
||
}
|
||
const rows = d.rows;
|
||
const withSc = rows.filter(r => r.sc !== null);
|
||
const imgs = rows.map(r => r.img).filter(v => v !== null);
|
||
const cold = rows.filter(r => r.gr === '偏冷');
|
||
const hot = rows.filter(r => r.gr === '偏热' || r.gr === '极热');
|
||
const thin = withSc.length < rows.length * 0.4;
|
||
|
||
$('#school-hd').innerHTML = `
|
||
<div class="crumb"><a href="#/schools">院校库</a>
|
||
<svg width="9" height="9" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><path d="M9 6l6 6-6 6"/></svg>
|
||
${esc(d.pv || '')}</div>
|
||
<h1>${esc(d.name)}${d.lv ? ` <i class="lv lv-${esc(d.lv)}" style="vertical-align:middle">${esc(d.lv)}</i>` : ''}</h1>
|
||
<p class="lede">${rows.length} 个硕士点,${withSc.length} 个有竞争评估、${imgs.length} 个查得到录取分。</p>
|
||
${thin ? `<p class="lede" style="color:#8A5A00;margin-top:5px">评估只覆盖 ${withSc.length}/${rows.length}。标「未评估」的是平台没有这部分分析,<b>不等于好考</b>。</p>` : ''}`;
|
||
|
||
const shown = { cold: 0, hot: 0, mid: 0, none: 0 };
|
||
const sec = (key, title, sub, arr) => {
|
||
if (!arr.length) return '';
|
||
shown[key] = arr.length;
|
||
return `<div class="sec" style="padding-top:20px">
|
||
<div class="sec-hd"><h2 style="font-size:15px">${title}</h2><span>${sub}</span></div>
|
||
<div class="rows" style="border-top:0">${arr.map((r, i) => schoolRow(r, d.name, i)).join('')}</div>
|
||
</div>`;
|
||
};
|
||
const mid = rows.filter(r => r.gr === '中性');
|
||
const none = rows.filter(r => !r.gr);
|
||
const total = shown.cold + shown.hot + shown.mid + shown.none;
|
||
$('#school-body').innerHTML =
|
||
sec('cold', '偏冷', '竞争分低,先看这些', cold.slice(0, 15)) +
|
||
sec('hot', '偏热以上', '报的人多,慎选', hot.slice(0, 12)) +
|
||
sec('mid', '中性', '热度中等', mid.slice(0, 20)) +
|
||
sec('none', '未评估', '平台没有竞争分析,部分有录取分', none.slice(0, 30)) +
|
||
`<div class="note" style="padding:20px var(--pad) 100px">
|
||
${total < rows.length
|
||
? `这所学校共 ${rows.length} 个硕士点,上面按分档列了 ${total} 个。想看全部,用右上角搜索按专业查。`
|
||
: `共 ${rows.length} 个硕士点,已全部列出。`}<br>
|
||
点任意专业看它的四年分数、录取人数和择校标签。竞争分是平台测算,不是官方指标。
|
||
</div>`;
|
||
}
|
||
|
||
function schoolRow(r, sname, i) {
|
||
const tg = (r.tg || []).filter(t => STRONG.includes(t)).slice(0, 2).map(t => TAG[t]);
|
||
return `<button class="row" style="--tone:${TONE[r.gr] || 'transparent'}"
|
||
data-sid="${r.sid}" data-code="${r.code}" data-sname="${esc(sname)}" data-xy="${esc(r.xy || '')}">
|
||
<div class="row-in">
|
||
<span class="r-no">${String(i + 1).padStart(2, '0')}</span>
|
||
<div class="r-mid">
|
||
<div class="r-t"><b>${esc(r.name)}</b><i class="num" style="font-style:normal;font-size:10.5px;color:var(--ink3)">${r.code}</i></div>
|
||
<div class="r-s">${esc(r.xy || '不区分院系')}${(r.gr === '偏热' || r.gr === '极热') ? ' · ' + r.gr : ''}${tg.length ? ' · ' + tg.join(' / ') : ''}</div>
|
||
</div>
|
||
<div class="r-r">
|
||
<b class="${r.img === null ? 'na' : ''}">${r.img === null ? '—' : r.img}<em>${r.img === null ? '' : '分'}</em></b>
|
||
</div>
|
||
</div>
|
||
</button>`;
|
||
}
|
||
|
||
/* ── 详情 ── */
|
||
async function openSheet(sid, code, sname, xy) {
|
||
$('#sheet-title').textContent = sname || '';
|
||
$('#sheet-sub').textContent = (xy ? xy + ' · ' : '') + code;
|
||
$('#sheet-bd').innerHTML = '<div class="sk"></div><div class="sk"></div>';
|
||
$('#sheet-ft').innerHTML = '';
|
||
$('#sheet').classList.add('on'); $('#mask').classList.add('on');
|
||
document.body.style.overflow = 'hidden';
|
||
|
||
let d = null;
|
||
try { d = await fetch('data/probe/' + code + '.json').then(r => r.json()); } catch (e) { }
|
||
const r = d ? d.rows.find(x => String(x.sid) === String(sid) && (!xy || x.xy === xy)) : null;
|
||
if (!r) { $('#sheet-bd').innerHTML = '<div class="empty"><b>没有找到这条记录</b></div>'; return; }
|
||
|
||
const years = [2023, 2024, 2025, 2026];
|
||
const yrows = (r.yo || []).map((v, i) => ({ y: years[i], cnt: Array.isArray(v) ? v[0] : 0, min: Array.isArray(v) ? v[1] : 0 }));
|
||
const hasY = yrows.some(x => x.cnt || x.min);
|
||
const tone = r.gr === '偏冷' ? '#0B6E4F' : (r.gr === '偏热' || r.gr === '极热') ? 'var(--accent)' : 'var(--ink2)';
|
||
|
||
$('#sheet-bd').innerHTML = `
|
||
<div class="dgrid">
|
||
<div><i>拟录取最低分</i><b style="color:var(--accent)">${fmt(r.img)}</b></div>
|
||
<div><i>拟录取最高分</i><b>${fmt(r.imx)}</b></div>
|
||
<div><i>进复试最低分</i><b>${fmt(r.ifm)}</b></div>
|
||
<div><i>录取人数</i><b>${r.ic ? fmt(r.ic) : '—'}</b></div>
|
||
<div><i>竞争分(0–100)</i><b>${r.sc === null ? '—' : num1(r.sc)}</b></div>
|
||
<div><i>竞争分档</i><b class="sm" style="color:${tone}">${r.gr || '无评估'}</b></div>
|
||
</div>
|
||
${(r.tg || []).length ? `<div class="sec-t">择校标签</div>
|
||
<div style="display:flex;gap:6px;flex-wrap:wrap">${r.tg.map(t => `<span class="tag t-${t}">${TAG[t] || t}</span>`).join('')}</div>` : ''}
|
||
${hasY ? `<div class="sec-t">近四年</div>
|
||
<table class="yr"><thead><tr><th>年份</th><th>录取人数</th><th>最低分</th></tr></thead><tbody>
|
||
${yrows.map(x => `<tr><td>${x.y}</td><td>${x.cnt || '—'}</td><td>${x.min || '—'}</td></tr>`).join('')}
|
||
</tbody></table>` : ''}
|
||
<div class="sec-t">这些数字怎么来的</div>
|
||
<div class="note">录取分、复试分、录取人数取自源页实测值,缺的显示「—」。
|
||
竞争分和分档是平台按报录、调剂、分数分布测算的,只能用来横向比较,不代表上岸难度的绝对值。</div>`;
|
||
|
||
$('#sheet-ft').innerHTML = `<a class="btn-line" href="#/major/${code}" id="sheet-goto">看这个专业的全国榜单</a>`;
|
||
$('#sheet-goto').onclick = closeSheet;
|
||
}
|
||
|
||
function closeSheet() {
|
||
$('#sheet').classList.remove('on'); $('#mask').classList.remove('on');
|
||
document.body.style.overflow = '';
|
||
}
|
||
|
||
/* ── 估分 ── */
|
||
function genScore() {
|
||
const v = parseFloat($('#score-val').value);
|
||
const code = S.scoreMajor && S.scoreMajor.code;
|
||
if (!code) { toast('先选一个专业'); return; }
|
||
if (!v || v < 100 || v > 500) { toast('填一个 100 到 500 之间的分数'); return; }
|
||
const d = S.cur && S.cur.code === code ? S.cur : null;
|
||
if (!d) { toast('专业数据还在加载'); return; }
|
||
|
||
const pool = d.rows.filter(r => r.img !== null);
|
||
if (!pool.length) {
|
||
$('#score-result').innerHTML = '<div class="empty"><b>这个专业没有录取分数据</b><p>换成「按专业挑学校」看竞争评估。</p></div>';
|
||
return;
|
||
}
|
||
const tc = [], tw = [], tb = [];
|
||
let far = 0;
|
||
pool.forEach(r => {
|
||
const item = { ...r, diff: v - r.img };
|
||
if (item.diff >= 20) tb.push(item);
|
||
else if (item.diff >= 0) tw.push(item);
|
||
else if (item.diff >= -20) tc.push(item);
|
||
else far++;
|
||
});
|
||
const byDiff = a => a.sort((x, y) => y.diff - x.diff);
|
||
const vals = pool.map(r => r.img);
|
||
const below = vals.filter(x => x < v).length;
|
||
const pct = Math.round(below / vals.length * 100);
|
||
const med = median(vals);
|
||
const dMed = Math.round(v - med);
|
||
const n211 = tc.filter(r => r.lv === '211' || r.lv === '985').length;
|
||
const few = tc.filter(r => (r.ic || 0) > 0 && r.ic < 5).length;
|
||
|
||
const posTxt = pct >= 99
|
||
? `${v} 分高于这里所有硕士点去年的录取最低分。`
|
||
: `${v} 分比 <span class="hl">${pct}%</span> 的硕士点录取最低分高,${Math.abs(dMed) <= 2 ? `基本贴在中位分(${Math.round(med)})上` : `比中位分(${Math.round(med)})${dMed > 0 ? '高' : '低'} ${Math.abs(dMed)} 分`}。`;
|
||
const extra = tc.length
|
||
? `冲刺档 ${tc.length} 所里,${n211 ? `<b>${n211} 所是 985/211</b>` : '没有 985/211'}${few ? `,${few} 所招生不到 5 人` : ''}。`
|
||
: '';
|
||
|
||
const tier = (cls, title, hint, arr) => `
|
||
<div class="tier">
|
||
<div class="tier-hd"><b>${title}</b><span>${hint}</span><span class="n">${arr.length} 所</span></div>
|
||
${arr.slice(0, 5).map(r => `
|
||
<button class="trow" data-sid="${r.sid}" data-code="${code}" data-sname="${esc(r.sch)}" data-xy="${esc(r.xy || '')}">
|
||
<span class="tr-l">
|
||
<span class="tr-t"><b>${esc(r.sch)}</b>${r.lv && r.lv !== '双非' ? `<i class="lv lv-${esc(r.lv)}">${esc(r.lv)}</i>` : ''}</span>
|
||
<span class="tr-s">${esc(r.xy || '不区分院系')}${r.ic ? ' · 招 ' + r.ic + ' 人' : ''}</span>
|
||
</span>
|
||
<span class="tr-r">
|
||
<b>${r.img}</b>
|
||
<span class="${r.diff >= 0 ? 'up' : 'down'}">${r.diff >= 0 ? '高' : '低'} ${Math.abs(r.diff)} 分</span>
|
||
</span>
|
||
</button>`).join('')}
|
||
${arr.length > 5 ? `<div style="padding:10px 0;font-size:12px;color:var(--ink3)">还有 ${arr.length - 5} 所</div>` : ''}
|
||
${arr.length === 0 ? '<div style="padding:14px 0;font-size:12.5px;color:var(--ink3)">这一档没有匹配的学校</div>' : ''}
|
||
</div>`;
|
||
|
||
const px = Math.max(2, Math.min(98, pct));
|
||
|
||
$('#score-result').innerHTML = `
|
||
<div class="verdict">
|
||
<div class="v-hd"><b>${esc(d.name)}</b><span>你估 ${v}</span></div>
|
||
<div class="v-nums">
|
||
<div class="v-tc"><b>${tc.length}</b><i>冲刺</i><u>比你高 0–20</u></div>
|
||
<div class="v-tw"><b>${tw.length}</b><i>稳妥</i><u>差 20 分内</u></div>
|
||
<div class="v-tb"><b>${tb.length}</b><i>保底</i><u>你高出 20+</u></div>
|
||
</div>
|
||
<div class="v-body">
|
||
<div class="v-pos">${posTxt}${extra}</div>
|
||
<div class="v-bar">
|
||
<span class="track"></span>
|
||
<span class="mark" style="left:${px}%"></span>
|
||
<span class="lb l">录取分低</span>
|
||
<span class="lb r">录取分高</span>
|
||
</div>
|
||
<div style="font-size:10.5px;color:var(--ink3);margin-top:4px">把 ${pool.length} 个硕士点按录取最低分从低到高排,红线是你的位置</div>
|
||
</div>
|
||
</div>
|
||
${tier('tc', '冲刺', '最低分比你高 0–20 分', byDiff(tc))}
|
||
${tier('tw', '稳妥', '刚好够,或高出 20 分内', byDiff(tw))}
|
||
${tier('tb', '保底', '你高出 20 分以上', byDiff(tb))}
|
||
<div class="note" style="margin-top:22px;padding-top:14px;border-top:1px solid var(--rule)">
|
||
比最低分低 20 分以上的有 ${far} 所,没列出来。最低分是单个考生的分数,不是平均水位;
|
||
同样一个分数,招 5 人和招 50 人的风险差得远。冲刺档里优先挑招生多的。
|
||
</div>`;
|
||
$$('#score-result .trow').forEach(el =>
|
||
el.onclick = () => openSheet(el.dataset.sid, el.dataset.code, el.dataset.sname, el.dataset.xy));
|
||
}
|
||
|
||
function runPendingScore() {
|
||
paintScoreMajor();
|
||
if (S.pendingScore) { $('#score-val').value = S.pendingScore; S.pendingScore = null; }
|
||
if ($('#score-val').value) loadForScore().then(genScore);
|
||
}
|
||
function paintScoreMajor() {
|
||
const el = $('#score-major-txt');
|
||
if (!el) return;
|
||
if (S.scoreMajor) { el.textContent = S.scoreMajor.name + ' ' + S.scoreMajor.code; el.style.color = 'var(--ink)'; }
|
||
else { el.textContent = '选择专业'; el.style.color = 'var(--ink3)'; }
|
||
}
|
||
async function loadForScore() {
|
||
const code = S.scoreMajor && S.scoreMajor.code;
|
||
if (!code) return;
|
||
if (S.cur && S.cur.code === code) return;
|
||
try { S.cur = await fetch('data/probe/' + code + '.json').then(r => r.json()); } catch (e) { }
|
||
}
|
||
|
||
/* ── 搜索 ── */
|
||
function openSearch() {
|
||
$('#srch').classList.add('on');
|
||
$('#srch-in').value = '';
|
||
paintSearch('');
|
||
setTimeout(() => $('#srch-in').focus(), 60);
|
||
}
|
||
function closeSearch() { $('#srch').classList.remove('on'); $('#srch-in').blur(); }
|
||
function paintSearch(q) {
|
||
q = (q || '').trim().toLowerCase();
|
||
const box = $('#srch-bd');
|
||
if (!q) {
|
||
const top = S.idx ? S.idx.majors.slice(0, 6) : [];
|
||
box.innerHTML = '<div class="sgt">常见的几个专业</div>' +
|
||
top.map(m => `<button class="sitem" data-t="major" data-code="${m.code}">
|
||
<span class="sitem-t">${esc(m.name)}</span><span class="sitem-m">${m.n} 个硕士点</span></button>`).join('');
|
||
return;
|
||
}
|
||
const ms = S.majors.filter(m => (m.name || '').toLowerCase().includes(q) || (m.code || '').includes(q)).slice(0, 12);
|
||
const ss = S.schools.filter(s => (s.name || '').toLowerCase().includes(q)).slice(0, 12);
|
||
let html = '';
|
||
if (ms.length) html += '<div class="sgt">专业</div>' + ms.map(m => `
|
||
<button class="sitem" data-t="major" data-code="${m.code}">
|
||
<span class="sitem-t">${hl(m.name, q)}</span>
|
||
<span class="sitem-m">${m.code}${m.n_school ? ' · ' + m.n_school + ' 所' : ''}</span></button>`).join('');
|
||
if (ss.length) html += '<div class="sgt">院校</div>' + ss.map(s => `
|
||
<button class="sitem" data-t="school" data-sid="${s.sid}">
|
||
<span class="sitem-t">${hl(s.name, q)}</span>
|
||
<span class="sitem-m">${esc(s.pv || '')}</span></button>`).join('');
|
||
if (!html) html = '<div class="empty"><b>没搜到</b><p>试试专业名(如「会计」)、专业代码(如 125300),或者学校名。</p></div>';
|
||
box.innerHTML = html;
|
||
}
|
||
function hl(txt, q) {
|
||
const i = (txt || '').toLowerCase().indexOf(q);
|
||
if (i < 0) return esc(txt);
|
||
return esc(txt.slice(0, i)) + '<em>' + esc(txt.slice(i, i + q.length)) + '</em>' + esc(txt.slice(i + q.length));
|
||
}
|
||
|
||
/* ── 绑定 ── */
|
||
function bind() {
|
||
$('#entries').addEventListener('click', e => {
|
||
const b = e.target.closest('.entry');
|
||
if (!b) return;
|
||
if (b.dataset.tag) goRank({ tag: b.dataset.tag });
|
||
else location.hash = b.dataset.href;
|
||
});
|
||
$('#home-majors').addEventListener('click', e => {
|
||
const b = e.target.closest('.mrow');
|
||
if (b) location.hash = '#/major/' + b.dataset.code;
|
||
});
|
||
|
||
$('#rank-sorts').addEventListener('click', e => {
|
||
const b = e.target.closest('button');
|
||
if (!b) return;
|
||
$$('#rank-sorts button').forEach(x => x.classList.toggle('on', x === b));
|
||
S.F.sort = b.dataset.sort;
|
||
renderRank();
|
||
});
|
||
$('#f-pv').onchange = e => { S.F.pv = e.target.value; renderRank(); };
|
||
$('#f-lv').onchange = e => { S.F.lv = e.target.value; renderRank(); };
|
||
$('#rank-tags').addEventListener('click', e => {
|
||
const b = e.target.closest('.chip');
|
||
if (!b) return;
|
||
$$('#rank-tags .chip').forEach(x => x.classList.toggle('on', x === b));
|
||
S.F.tag = b.dataset.tag || '';
|
||
renderRank();
|
||
});
|
||
|
||
document.addEventListener('click', e => {
|
||
const row = e.target.closest('.row[data-code]');
|
||
if (row) { openSheet(row.dataset.sid, row.dataset.code, row.dataset.sname, row.dataset.xy); return; }
|
||
const sc = e.target.closest('[data-go-school]');
|
||
if (sc) location.hash = '#/school/' + sc.dataset.goSchool;
|
||
});
|
||
|
||
$('#s-pv').onchange = e => { S.SF.pv = e.target.value; paintSchools(); };
|
||
$('#s-lv').onchange = e => { S.SF.lv = e.target.value; paintSchools(); };
|
||
$('#s-sort').onchange = e => { S.SF.sort = e.target.value; paintSchools(); };
|
||
|
||
$('#score-major').onclick = () => { S.afterPick = 'score'; openSearch(); };
|
||
$('#score-go').onclick = () => { loadForScore().then(genScore); };
|
||
$('#score-val').addEventListener('keydown', e => { if (e.key === 'Enter') $('#score-go').click(); });
|
||
|
||
$('#sheet-x').onclick = closeSheet;
|
||
$('#mask').onclick = closeSheet;
|
||
|
||
$('#btn-search').onclick = () => { S.afterPick = null; openSearch(); };
|
||
$('#srch-cancel').onclick = closeSearch;
|
||
$('#srch-in').addEventListener('input', e => paintSearch(e.target.value));
|
||
$('#srch-bd').addEventListener('click', e => {
|
||
const it = e.target.closest('.sitem');
|
||
if (!it) return;
|
||
closeSearch();
|
||
if (it.dataset.t === 'major') {
|
||
const code = it.dataset.code;
|
||
if (S.afterPick === 'score') {
|
||
S.scoreMajor = S.majorMap[code] || { code, name: code };
|
||
S.afterPick = null;
|
||
paintScoreMajor();
|
||
return;
|
||
}
|
||
S.afterPick = null;
|
||
location.hash = '#/major/' + code;
|
||
} else {
|
||
S.afterPick = null;
|
||
location.hash = '#/school/' + it.dataset.sid;
|
||
}
|
||
});
|
||
|
||
addEventListener('hashchange', route);
|
||
}
|
||
|
||
function toast(msg) {
|
||
const t = $('#toast');
|
||
t.textContent = msg;
|
||
t.classList.add('on');
|
||
clearTimeout(t._t);
|
||
t._t = setTimeout(() => t.classList.remove('on'), 1800);
|
||
}
|
||
|
||
document.addEventListener('DOMContentLoaded', () => { bind(); boot(); });
|
||
</script>
|
||
</body>
|
||
</html>
|