/* ============================================================
   河北大学志愿预测助手 —— "招生录取档案台"视觉
   墨蓝 ink + 暖纸 paper + 河大红印章 seal；标题宋体，数字等宽
   ============================================================ */
:root {
  --ink: #17293d;
  --ink-2: #3a4d63;
  --paper: #f4f0e8;
  --paper-2: #ece5d7;
  --surface: #ffffff;
  --seal: #9e2b25;
  --seal-deep: #7c1f1b;
  --line: #e2dccd;
  --line-strong: #cfc7b4;
  --muted: #7b8390;

  --rush: #c05a2f;    /* 冲 */
  --steady: #2f6f8f;  /* 稳 */
  --safe: #3f8a5a;    /* 保 */

  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --num: "SF Mono", "Roboto Mono", "Menlo", ui-monospace, monospace;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(23,41,61,.04), 0 8px 30px rgba(23,41,61,.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(158,43,37,.05), transparent 60%),
    var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.shell { max-width: 1180px; margin: 0 auto; padding: 28px 22px 60px; }

/* ---------- 欢迎首屏 ---------- */
.welcome {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 50% 0%, rgba(158,43,37,.10), transparent 60%),
    linear-gradient(180deg, #fbf8f2, var(--paper));
  opacity: 1; transition: opacity .5s ease;
}
.welcome.welcome-hide { opacity: 0; pointer-events: none; }
.welcome-inner { max-width: 560px; text-align: center; animation: welcomeRise .7s cubic-bezier(.2,.7,.2,1) both; }
.welcome-seal {
  width: 76px; height: 76px; font-size: 34px; margin: 0 auto 22px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.4), 0 6px 22px rgba(124,31,27,.35);
}
.welcome-kicker { margin: 0 0 10px; font-size: 14px; letter-spacing: .34em; color: var(--seal); font-weight: 600; }
.welcome-title { margin: 0 0 20px; font-family: var(--serif); font-weight: 700; font-size: clamp(28px, 5vw, 42px); color: var(--ink); letter-spacing: .02em; }
.welcome-body { margin: 0 auto 8px; max-width: 480px; font-size: 15.5px; line-height: 2.1; color: var(--ink-2); }
.welcome-sign { margin: 14px 0 30px; font-family: var(--serif); font-size: 15px; color: var(--seal); }
.welcome-enter {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--sans); font-size: 16px; font-weight: 600; color: #fff;
  padding: 13px 30px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #b8352d, var(--seal) 60%, var(--seal-deep));
  box-shadow: 0 6px 20px rgba(124,31,27,.32);
  transition: transform .1s, box-shadow .2s;
}
.welcome-enter:hover { box-shadow: 0 10px 28px rgba(124,31,27,.4); transform: translateY(-1px); }
.welcome-enter:active { transform: translateY(0); }
@keyframes welcomeRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- 抬头 masthead ---------- */
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; padding-bottom: 20px; border-bottom: 2px solid var(--ink);
  position: relative; flex-wrap: wrap;
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--line-strong); }
.masthead-left { display: flex; align-items: center; gap: 16px; }

.seal {
  flex: none; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 25%, #b8352d, var(--seal) 55%, var(--seal-deep));
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 2px 8px rgba(124,31,27,.35);
  font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: 1px;
}
.topbar .eyebrow { margin: 0 0 3px; font-size: 12.5px; letter-spacing: .14em; color: var(--seal); font-weight: 600; }
.topbar h1 {
  margin: 0; font-family: var(--serif); font-weight: 700;
  font-size: clamp(24px, 3.4vw, 34px); letter-spacing: .01em; color: var(--ink);
}
.topbar-right { display: flex; align-items: center; gap: 10px; padding-bottom: 4px; flex-wrap: wrap; }
.user-nav { display: flex; align-items: center; gap: 8px; }
.user-nav .nav-link { font-size: 13px; text-decoration: none; color: var(--ink-2); padding: 7px 12px; border-radius: 8px; border: 1px solid transparent; }
.user-nav .nav-link:hover { background: var(--paper-2); }
.user-nav .nav-link.primary { background: var(--seal); color: #fff; }
.user-nav .nav-link.primary:hover { background: var(--seal-deep); }
.user-nav .user-name { font-size: 13px; color: var(--ink); font-weight: 600; }

.ghost-button {
  font-family: inherit; font-size: 13px; padding: 7px 13px; border-radius: 8px; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
  transition: background .15s, border-color .15s;
}
.ghost-button:hover { background: var(--paper-2); border-color: var(--muted); }

/* ---------- 工作台栅格 ---------- */
.workspace { display: grid; grid-template-columns: 320px 1fr; gap: 22px; margin-top: 26px; align-items: start; }

/* ---------- 考生档案卡 ---------- */
.control-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; position: sticky; top: 20px;
}
.panel-heading { margin-bottom: 16px; }
.panel-kicker {
  display: inline-block; font-size: 11.5px; letter-spacing: .16em; font-weight: 600;
  color: var(--seal); padding-bottom: 4px; border-bottom: 2px solid var(--seal); margin-bottom: 8px;
}
.panel-heading strong { display: block; font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--ink); }

.form-grid { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span, .field > legend { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.field input[type="number"], .field select {
  width: 100%; font-family: var(--num); font-size: 16px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface);
  color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.field select { font-family: var(--sans); }
.field input:focus, .field select:focus { border-color: var(--seal); box-shadow: 0 0 0 3px rgba(158,43,37,.12); }

.fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 12px 12px 6px; margin: 0; background: #fbfaf6; }
.fieldset legend { padding: 0 6px; }
.fieldset label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); padding: 5px 0; cursor: pointer; }
.fieldset input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--seal); }
.fieldset label:has(input:disabled) { color: var(--muted); cursor: not-allowed; }

.primary-action {
  margin-top: 4px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 15px; font-weight: 600; padding: 12px 16px;
  border: 0; border-radius: 9px; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, #22384f, var(--ink));
  box-shadow: 0 2px 10px rgba(23,41,61,.22); transition: transform .06s, box-shadow .15s;
}
.primary-action:hover { box-shadow: 0 4px 16px rgba(23,41,61,.28); }
.primary-action:active { transform: translateY(1px); }
.primary-action span { color: #f0b7b2; font-size: 13px; }

.import-box { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.file-button { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.file-button:hover { background: var(--paper-2); }
.file-button input[type="file"] { display: none; }
.file-button span { color: var(--seal); }

/* ---------- 结果面板 ---------- */
.result-panel { display: grid; gap: 18px; min-width: 0; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.summary-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.summary-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--seal); }
.summary-card span { font-size: 12px; color: var(--muted); }
.summary-card strong { display: block; margin: 4px 0 2px; font-family: var(--serif); font-weight: 700; font-size: clamp(20px, 2.6vw, 27px); color: var(--ink); font-variant-numeric: tabular-nums; }
.summary-card .meta { font-size: 11.5px; color: var(--muted); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 3px; }
.segment { font-family: inherit; font-size: 13px; font-weight: 600; padding: 7px 16px; border: 0; border-radius: 7px; cursor: pointer; background: transparent; color: var(--ink-2); }
.segment.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(23,41,61,.14); }

/* ---------- 结果表 ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
thead th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted); padding: 12px 14px; background: #fbfaf6; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13.5px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfaf5; }

.major-name strong { display: block; font-size: 14.5px; color: var(--ink); font-weight: 600; }
.meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 11px; border-radius: 999px; white-space: nowrap; }
.tag-rush { color: var(--rush); background: rgba(192,90,47,.12); }
.tag-steady { color: var(--steady); background: rgba(47,111,143,.12); }
.tag-safe, .tag-pad { color: var(--safe); background: rgba(63,138,90,.12); }

/* 概率环 */
.prob { display: flex; align-items: center; gap: 9px; }
.dial { --value: 0%; width: 34px; height: 34px; border-radius: 50%; flex: none; background: conic-gradient(var(--seal) var(--value), var(--paper-2) 0); -webkit-mask: radial-gradient(circle 10px at center, transparent 98%, #000 100%); mask: radial-gradient(circle 10px at center, transparent 98%, #000 100%); }
.prob strong { font-family: var(--num); font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink); }

/* 位次刻度尺（签名元素） */
.rank-ruler { min-width: 150px; }
.ruler-track { position: relative; height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--safe), var(--steady) 52%, var(--rush)); opacity: .85; }
.ruler-dot { position: absolute; top: 50%; width: 3px; height: 16px; border-radius: 2px; background: var(--ink); transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--surface); }
.ruler-caption { display: flex; justify-content: space-between; margin-top: 6px; }
.ruler-caption span { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ruler-caption span:nth-child(2) { color: var(--ink-2); font-weight: 600; }

/* 空状态 */
.empty-state { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 40px 20px; text-align: center; }
.empty-state strong { display: block; font-family: var(--serif); font-size: 17px; margin-bottom: 6px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- 测算说明 ---------- */
.method-band { margin-top: 30px; padding: 22px 24px; background: var(--ink); color: #e9edf2; border-radius: var(--radius); display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; align-items: center; }
.method-band .panel-kicker { color: #f0b7b2; border-color: var(--seal); }
.method-band h2 { margin: 6px 0 0; font-family: var(--serif); font-size: 18px; font-weight: 700; color: #fff; }
.method-steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; }
.method-steps span { font-size: 12.5px; color: #c3ccd6; padding-left: 14px; position: relative; font-variant-numeric: tabular-nums; }
.method-steps span::before { content: ""; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--seal); }

/* ---------- 弹窗 ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; padding: 20px; display: flex; align-items: center; justify-content: center; background: rgba(23,41,61,.55); backdrop-filter: blur(2px); }
.modal-overlay[hidden] { display: none; }
.modal-card { position: relative; width: 100%; max-width: 380px; background: var(--surface); border-radius: 14px; padding: 26px; box-shadow: 0 24px 70px rgba(23,41,61,.32); text-align: center; border-top: 4px solid var(--seal); }
.modal-card h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 19px; }
.modal-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.modal-foot { font-size: 12px; color: var(--muted); margin: 14px 0 0; }
.modal-foot a, .modal-sub a { color: var(--seal); text-decoration: none; font-weight: 600; }
.modal-close { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }
.contact-qr { width: 240px; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }

/* ---------- 滑块验证码 ---------- */
.cap-wrap { margin: 6px auto; max-width: 300px; }
.cap-track { position: relative; width: 300px; max-width: 100%; height: 42px; background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; }
.cap-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: rgba(158,43,37,.14); }
.cap-gap { position: absolute; top: 0; height: 100%; width: 42px; border: 2px dashed var(--line-strong); border-radius: 9px; box-sizing: border-box; }
.cap-handle { position: absolute; left: 0; top: 0; width: 42px; height: 42px; background: var(--seal); color: #fff; display: flex; align-items: center; justify-content: center; border-radius: 9px; cursor: grab; user-select: none; font-size: 20px; }
.cap-handle.ok { background: var(--safe); } .cap-handle.bad { background: var(--rush); }
.cap-tip { font-size: 12px; color: var(--muted); margin-top: 6px; cursor: pointer; text-align: center; }
.cap-tip.ok { color: var(--safe); } .cap-tip.bad { color: var(--rush); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
  .control-panel { position: static; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .method-band { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .shell { padding: 20px 15px 46px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .seal { width: 46px; height: 46px; font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
