/* ============ 高考志愿填报分析系统 样式 ============ */
* { margin:0; padding:0; box-sizing:border-box; }
:root{
  --primary:#2f80ed; --primary-dark:#1b5fc4;
  --bg:#f2f5fa; --card:#fff; --border:#e3e8f0;
  --text:#1f2937; --muted:#6b7280;
  --red:#c0392b; --purple:#8e44ad; --gray:#7f8c8d;
}
html,body{ height:100%; }
body{
  font-family:"Microsoft YaHei","PingFang SC","Segoe UI",sans-serif;
  background:var(--bg); color:var(--text); font-size:14px; line-height:1.6;
}
a{ color:var(--primary); text-decoration:none; cursor:pointer; }
.muted{ color:var(--muted); }
.small{ font-size:12px; }
.center{ text-align:center; }
.link{ font-size:12px; margin-left:8px; }

/* ---- 顶部 ---- */
header{
  background:linear-gradient(120deg,#1b5fc4,#2f80ed 60%,#4aa3ff);
  color:#fff; padding:14px 22px 12px;
  position:sticky; top:0; z-index:50; box-shadow:0 2px 10px rgba(0,0,0,.15);
}
.brand{ display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; }
.brand h1{ font-size:20px; letter-spacing:1px; }
.brand span{ font-size:12px; opacity:.85; }
.input-row{ display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; align-items:center; }
.input-row select,.input-row input{
  height:34px; border:none; border-radius:6px; padding:0 10px; font-size:14px; outline:none;
}
.input-row input{ width:130px; }
.input-row .lbl{ font-size:12px; opacity:.9; margin-left:4px; }
#btn-analyze{
  height:34px; padding:0 22px; border:none; border-radius:6px; cursor:pointer;
  background:#ffb300; color:#5b3c00; font-weight:bold; font-size:14px;
}
#btn-analyze:hover{ filter:brightness(1.08); }
#score-summary{ margin-top:8px; font-size:13px; opacity:.95; }
#score-summary b{ color:#ffe082; }

/* ---- 标签页 ---- */
nav.tabs{
  display:flex; gap:4px; background:var(--card); padding:0 18px;
  border-bottom:1px solid var(--border); position:sticky; top:0; z-index:40;
  overflow-x:auto;
}
.tab-btn{
  padding:12px 18px; border:none; background:none; cursor:pointer; font-size:15px;
  color:var(--muted); border-bottom:3px solid transparent; white-space:nowrap;
}
.tab-btn.active{ color:var(--primary); border-color:var(--primary); font-weight:bold; }
.tab-btn .badge{
  background:var(--primary); color:#fff; border-radius:10px; font-size:11px;
  padding:1px 7px; margin-left:4px; vertical-align:1px;
}
main{ max-width:1280px; margin:0 auto; padding:16px 18px 60px; }
.tab-panel{ display:none; }
.tab-panel.active{ display:block; }

/* ---- 筛选栏 ---- */
.filter-bar{
  display:flex; gap:8px; flex-wrap:wrap; align-items:center;
  background:var(--card); border:1px solid var(--border); border-radius:8px;
  padding:10px 12px; margin-bottom:12px;
}
.filter-bar select,.filter-bar input{
  height:32px; border:1px solid var(--border); border-radius:6px; padding:0 8px; font-size:13px; background:#fff;
}
.filter-bar input{ flex:1; min-width:160px; }
.cat-chips{ display:flex; gap:6px; flex-wrap:wrap; }
.cat-chip{
  padding:4px 12px; border-radius:16px; background:#eef2f8; cursor:pointer; font-size:13px;
}
.cat-chip.on{ background:var(--primary); color:#fff; }

/* ---- 通用组件 ---- */
.btn{ border:1px solid transparent; border-radius:6px; cursor:pointer; font-size:13px; padding:7px 14px; background:#eee; }
.btn-primary{ background:var(--primary); color:#fff; }
.btn-primary:hover{ background:var(--primary-dark); }
.btn-outline{ background:#fff; border-color:var(--border); color:var(--text); }
.btn-outline:hover{ border-color:var(--primary); color:var(--primary); }
.btn-danger{ color:var(--red); }
.btn-added{ background:#e8f5e9; color:#27ae60; border-color:#a5d6a7; }
.btn-sm{ padding:4px 10px; font-size:12px; }
.btn-xs{ padding:2px 7px; font-size:12px; }
.btn:disabled{ opacity:.35; cursor:default; }
.chip{
  display:inline-block; font-size:11px; border-radius:4px; padding:1px 6px; margin-left:5px; vertical-align:1px;
}
.chip-a{ background:#fdecea; color:var(--red); }
.chip-b{ background:#f3e8fd; color:var(--purple); }
.chip-c{ background:#e8f1fd; color:var(--primary); }
.chip-d{ background:#eef1f5; color:var(--muted); }
.chip-cat{ background:#e8f1fd; color:var(--primary); }
.chip-heat{ background:#fff3e0; color:#e67e22; }
.cat-badge{
  display:inline-block; color:#fff; font-size:12px; font-weight:bold;
  border-radius:4px; padding:1px 8px; margin-right:6px;
}
.chk{ font-size:13px; cursor:pointer; user-select:none; }
.empty-hint{
  text-align:center; padding:70px 20px; background:var(--card);
  border:1px dashed var(--border); border-radius:10px; color:var(--muted);
}
.empty-icon{ font-size:44px; margin-bottom:10px; }
.empty-hint h3{ color:var(--text); margin-bottom:8px; }

/* ---- 推荐列表 ---- */
.reco-tools{ display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; flex-wrap:wrap; gap:8px; }
.reco-group{ margin-bottom:20px; }
.reco-group-head{
  background:var(--card); border-left:4px solid; border-radius:8px 8px 0 0;
  padding:10px 14px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:8px;
}
.uni-row{
  display:grid; grid-template-columns:1fr 110px 120px 120px 170px;
  gap:10px; align-items:center;
  background:var(--card); padding:10px 14px; border-bottom:1px solid var(--border);
}
.uni-row:hover{ background:#f8fafd; }
.uni-row:last-child{ border-radius:0 0 8px 8px; }
.uni-name{ font-size:15px; font-weight:bold; }
.uni-name .uni-link{ color:var(--text); }
.uni-name .uni-link:hover{ color:var(--primary); }
.uni-sub{ font-size:12px; margin-top:2px; }
.eq-score{ font-size:19px; font-weight:bold; color:var(--primary); }
.eq-unit{ font-size:11px; color:var(--muted); margin-left:2px; font-weight:normal; }
.prob-bar{ height:8px; background:#edf0f5; border-radius:4px; overflow:hidden; margin-bottom:3px; }
.prob-fill{ height:100%; border-radius:4px; }
.uni-act{ display:flex; gap:6px; justify-content:flex-end; }
.spark{ display:block; margin:0 auto; }

/* ---- 地图 ---- */
.map-layout{ display:grid; grid-template-columns:1fr 320px; gap:12px; }
.map-wrap{ position:relative; background:var(--card); border:1px solid var(--border); border-radius:10px; overflow:hidden; }
.cmap-container{ position:relative; width:100%; }
.cmap-svg{ width:100%; height:auto; display:block; background:#eaf2fb; cursor:grab; touch-action:none; }
.cmap-svg:active{ cursor:grabbing; }
.cmap-prov{ fill:#fdfefe; stroke:#9db8d8; stroke-width:.5; transition:fill .15s; }
.cmap-prov:hover{ fill:#d6e6fa; }
.cmap-prov-sel{ fill:#c1dbf7; stroke:#2f80ed; stroke-width:1; }
.cmap-prov-inset{ fill:#fdfefe; stroke:#9db8d8; stroke-width:.4; }
.cmap-jd{ fill:none; stroke:#8aa5c8; stroke-width:.8; stroke-dasharray:2 1.6; }
.cmap-inset-box{ fill:#eaf2fb; stroke:#9db8d8; stroke-width:.7; }
.cmap-inset-label{ font-size:7px; fill:#6b7f9c; }
.cmap-marker{ stroke:#fff; stroke-width:1; cursor:pointer; opacity:.92; }
.cmap-marker:hover{ stroke-width:2; opacity:1; }
.cmap-tip{
  position:absolute; z-index:10; background:rgba(20,30,48,.94); color:#fff;
  padding:8px 11px; border-radius:6px; font-size:12px; pointer-events:none;
  max-width:200px; line-height:1.5; box-shadow:0 3px 10px rgba(0,0,0,.3);
}
.cmap-tip .muted{ color:#aebbd0; }
.map-ctrl{ position:absolute; top:10px; right:10px; display:flex; flex-direction:column; gap:5px; }
.map-ctrl .btn{ width:34px; padding:4px 0; }
.map-legend{
  position:absolute; left:10px; bottom:10px; background:rgba(255,255,255,.92);
  border:1px solid var(--border); border-radius:6px; padding:6px 10px; font-size:12px;
  display:flex; gap:10px; flex-wrap:wrap;
}
.map-legend .lg{ display:flex; align-items:center; gap:4px; }
.map-legend i{ width:10px; height:10px; border-radius:50%; display:inline-block; }
.map-side{ background:var(--card); border:1px solid var(--border); border-radius:10px; display:flex; flex-direction:column; max-height:640px; }
.map-side-head{ padding:10px 14px; border-bottom:1px solid var(--border); }
.map-side-list{ overflow-y:auto; }
.side-item{
  display:flex; justify-content:space-between; align-items:center; gap:8px;
  padding:8px 14px; border-bottom:1px solid #f0f3f8; cursor:pointer;
}
.side-item:hover{ background:#f5f8fc; }
.side-eq{ text-align:right; color:var(--primary); }

/* ---- 院校库表格 ---- */
.lib-table,.plan-table{
  width:100%; border-collapse:collapse; background:var(--card);
  border:1px solid var(--border); border-radius:8px; overflow:hidden;
}
.lib-table th,.lib-table td,.plan-table th,.plan-table td{
  padding:8px 10px; border-bottom:1px solid #eef1f6; text-align:left; font-size:13px;
}
.lib-table th,.plan-table th{ background:#f4f7fb; font-size:12px; color:var(--muted); white-space:nowrap; }
.lib-table tr:hover td{ background:#f8fafd; }
th.sortable{ cursor:pointer; user-select:none; }
th.sortable:hover{ color:var(--primary); }
.mini-table{ width:100%; border-collapse:collapse; margin:6px 0; }
.mini-table th,.mini-table td{ padding:5px 8px; border-bottom:1px solid #eef1f6; font-size:13px; text-align:left; }
.mini-table th{ background:#f4f7fb; color:var(--muted); font-size:12px; }

/* ---- 专业库 ---- */
.major-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(310px,1fr)); gap:12px; }
.major-card{
  background:var(--card); border:1px solid var(--border); border-radius:10px;
  padding:14px 16px; cursor:pointer; transition:box-shadow .15s,transform .15s;
  display:flex; flex-direction:column; gap:6px;
}
.major-card:hover{ box-shadow:0 4px 14px rgba(47,128,237,.14); transform:translateY(-2px); }
.major-head{ display:flex; align-items:center; gap:4px; font-size:15px; }
.major-meta{ display:flex; gap:14px; font-size:12px; color:#4a5a70; }
.detail-grid{ display:grid; grid-template-columns:1fr 1fr; gap:4px 18px; margin:10px 0; }
.detail-grid b{ font-size:13px; }
.detail-grid p{ font-size:13px; }

/* ---- 志愿表 ---- */
.plan-tools{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:10px; }
.plan-advice{
  background:#fffbe8; border:1px solid #f5e6a8; border-radius:8px;
  padding:8px 14px; font-size:13px; margin-bottom:12px; color:#7a6520;
}
.plan-table .mj{
  display:inline-block; background:#eef2f8; border-radius:4px; padding:1px 6px; margin:1px 2px;
}

/* ---- 抽屉 ---- */
#drawer-mask{
  position:fixed; inset:0; background:rgba(15,23,42,.4); z-index:90;
  opacity:0; pointer-events:none; transition:opacity .2s;
}
#drawer-mask.open{ opacity:1; pointer-events:auto; }
#drawer{
  position:fixed; top:0; right:-560px; width:540px; max-width:94vw; height:100%;
  background:var(--card); z-index:95; transition:right .25s ease;
  box-shadow:-4px 0 20px rgba(0,0,0,.18); display:flex; flex-direction:column;
}
#drawer.open{ right:0; }
#drawer-close{
  position:absolute; top:12px; right:14px; border:none; background:none;
  font-size:22px; cursor:pointer; color:var(--muted); z-index:2;
}
.drawer-body{ padding:22px 24px; overflow-y:auto; }
.d-head h2{ margin-bottom:4px; }
.d-sec{ margin:14px 0; }
.d-verdict{
  border-left:4px solid; background:#f8fafd; border-radius:0 6px 6px 0;
  padding:8px 12px; margin-top:8px; font-size:13px;
}
.d-actions{ margin:16px 0 8px; }

/* ---- 弹窗 ---- */
#modal{
  position:fixed; inset:0; background:rgba(15,23,42,.45); z-index:100;
  display:none; align-items:flex-start; justify-content:center; padding:6vh 16px;
}
#modal.open{ display:flex; }
.modal-box{
  background:var(--card); border-radius:12px; max-width:680px; width:100%;
  max-height:86vh; overflow-y:auto; position:relative; padding:24px 26px;
  box-shadow:0 10px 40px rgba(0,0,0,.25);
}
#modal-close{
  position:absolute; top:10px; right:14px; border:none; background:none;
  font-size:22px; cursor:pointer; color:var(--muted);
}
.mj-pick{ display:flex; flex-direction:column; gap:4px; margin-top:6px; }
.mj-opt{ padding:5px 8px; border-radius:6px; cursor:pointer; }
.mj-opt:hover{ background:#f4f7fb; }
.modal-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:14px; }

/* ---- 页脚 ---- */
footer{
  background:#1f2937; color:#9aa5b5; font-size:12px; text-align:center;
  padding:14px 20px; line-height:1.8;
}

/* ---- 打印 ---- */
#print-area{ display:none; }
@media print{
  body > *{ display:none !important; }
  #print-area{ display:block !important; padding:20px; font-size:13px; }
  #print-area h1{ font-size:20px; text-align:center; margin-bottom:10px; }
  #print-area table{ width:100%; border-collapse:collapse; margin-top:10px; }
  #print-area th,#print-area td{ border:1px solid #333; padding:6px 8px; font-size:12px; }
  .print-note{ margin-top:14px; color:#555; }
}

/* ---- 响应式 ---- */
@media (max-width: 900px){
  .uni-row{ grid-template-columns:1fr 90px; }
  .uni-spark,.uni-prob{ display:none; }
  .uni-act{ grid-column:1 / -1; justify-content:flex-start; }
  .map-layout{ grid-template-columns:1fr; }
  .detail-grid{ grid-template-columns:1fr; }
  .lib-table{ display:block; overflow-x:auto; }
}
