:root {
  --bg0: #0b1520;
  --bg1: #132536;
  --fog: #d7e4ef;
  --fog-dim: #9bb0c2;
  --line: rgba(215, 228, 239, 0.16);
  --accent: #3ecfbf;
  --accent-ink: #06221f;
  --card: #183247;
  --card-hover: #1f3d56;
  --display: "Fraunces", "Songti SC", "Noto Serif SC", serif;
  --text: "IBM Plex Sans", "PingFang SC", "Noto Sans SC", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg0); }
html:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--fog);
  font: 17px/1.7 var(--text);
  background:
    radial-gradient(900px 480px at 88% 12%, rgba(62, 207, 191, 0.18), transparent 60%),
    radial-gradient(700px 420px at 8% 80%, rgba(88, 140, 210, 0.14), transparent 55%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 55%, #0d1a26);
}

a { color: inherit; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.bar {
  position: fixed; top: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: max(14px, env(safe-area-inset-top)) 16px 0;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(11, 21, 32, 0.72);
  backdrop-filter: blur(8px); font-size: 14px; color: var(--fog-dim);
  text-decoration: none;
}
.chip b { color: var(--fog); font-weight: 600; }
.menu-btn, .menu-close {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(11, 21, 32, 0.72);
  color: var(--fog); cursor: pointer;
}
.menu-btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.menu-btn span { width: 18px; height: 2px; border-radius: 1px; background: currentColor; }
.menu-close { position: relative; }
.menu-close::before, .menu-close::after {
  content: ""; position: absolute; left: 12px; right: 12px; top: 20px; height: 2px;
  background: currentColor;
}
.menu-close::before { transform: rotate(45deg); }
.menu-close::after { transform: rotate(-45deg); }

.home {
  display: grid;
  min-height: 100vh;
  padding: 88px 20px 40px;
}
.visual {
  display: grid; place-items: center;
  min-height: 220px; margin-bottom: 8px;
}
.orbit {
  width: min(420px, 86vw); aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 35% 30%, rgba(62, 207, 191, 0.35), transparent 42%),
    radial-gradient(circle at 70% 65%, rgba(120, 160, 220, 0.25), transparent 40%),
    rgba(24, 50, 71, 0.55);
  position: relative;
  animation: drift 14s ease-in-out infinite;
}
.orbit::after {
  content: ""; position: absolute; inset: 18%;
  border-radius: 50%; border: 1px dashed rgba(62, 207, 191, 0.35);
}
@keyframes drift {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  .orbit { animation: none; }
}

.side { max-width: 34rem; }
.kicker {
  margin: 0 0 10px; font-size: 13px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
}
h1 {
  margin: 0; font: 700 clamp(42px, 11vw, 72px)/1.05 var(--display);
  letter-spacing: -0.02em;
}
h1 span { display: block; }
.who {
  margin: 16px 0 0; color: var(--fog-dim); font-size: 16px; max-width: 32em;
}
.projects { margin-top: 28px; display: grid; gap: 10px; }
.proj {
  display: block; width: 100%; text-align: left; text-decoration: none;
  padding: 14px 18px; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--card); color: var(--fog); font: inherit;
  transition: background 0.2s ease, transform 0.2s ease;
}
.proj:hover { background: var(--card-hover); transform: translateY(-1px); }
.proj-name { display: block; font: 600 22px/1.3 var(--display); }
.proj-desc { display: block; margin-top: 4px; font-size: 14px; color: var(--fog-dim); }
.note {
  margin: 18px 0 0; font-size: 13px; color: var(--fog-dim); max-width: 36em;
}
footer {
  padding: 8px 20px 36px; font-size: 13px; color: var(--fog-dim);
}

.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font: 600 15px/1 var(--text); text-decoration: none; cursor: pointer;
}

dialog { padding: 0; border: 0; background: var(--bg1); color: var(--fog); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(3, 10, 18, 0.55); }
.drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(400px, 92vw); height: 100%;
  border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer.in { transform: none; }
.drawer-in {
  min-height: 100%; display: flex; flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
}
.dlg-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.dlg-head h2 { margin: 0; font: 600 28px/1.1 var(--display); }
.routes { list-style: none; margin: 18px 0 0; padding: 0; }
.routes > li > a, .routes > li > button {
  display: block; width: 100%; padding: 16px 0; border: 0; border-top: 1px solid var(--line);
  background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.routes .name { display: block; font: 600 20px/1.3 var(--display); }
.routes .desc { display: block; margin-top: 4px; font-size: 14px; color: var(--fog-dim); }
.routes-sub {
  list-style: none; margin: 0 0 8px; padding: 0 0 4px 12px;
  border-left: 2px solid rgba(201, 162, 39, 0.35);
}
.routes-sub a {
  display: block; padding: 8px 0 8px 4px; color: var(--fog-dim);
  font: 500 15px/1.35 var(--text); text-decoration: none;
}
.routes-sub a:hover, .routes-sub a:focus-visible { color: var(--fog); }
.routes-sub .sub-name { display: block; }
.routes-sub .sub-desc { display: block; margin-top: 2px; font-size: 12px; opacity: 0.75; }
.drawer-foot { margin-top: auto; padding-top: 28px; color: var(--fog-dim); font-size: 14px; }
/* positions page anchors under sticky top bar */
.section[id] { scroll-margin-top: 88px; }

/* positions page */
.wrap { max-width: 920px; margin: 0 auto; padding: 96px 20px 64px; }
.wrap h1 { font-size: clamp(36px, 7vw, 56px); }
.meta { margin-top: 12px; color: var(--fog-dim); }
.list { margin-top: 16px; display: grid; gap: 12px; }
.card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px 16px; align-items: start;
  padding: 16px 16px 14px;
  border: 1px solid var(--line); border-radius: 16px; background: rgba(24, 50, 71, 0.55);
  text-decoration: none;
}
.card:hover { border-color: rgba(62, 207, 191, 0.45); }
.card.past { opacity: 0.82; background: rgba(18, 36, 52, 0.55); }
.card.unlisted { border-color: rgba(62, 207, 191, 0.35); }
.card.interview-active {
  border-color: rgba(62, 207, 191, 0.5);
  box-shadow: inset 0 0 0 1px rgba(62, 207, 191, 0.12);
}
.subhead {
  margin: 22px 0 10px;
  font: 600 16px/1.3 var(--display);
  color: var(--fog);
}
.card-body { display: grid; gap: 8px; min-width: 0; }
.card h2, .card h3 { margin: 0; font: 600 20px/1.35 var(--display); }
.card .job-link { color: inherit; text-decoration: none; }
.card .job-link:hover { color: var(--accent); }
.card .place {
  margin: 0; font-size: 14px; line-height: 1.5; color: var(--fog-dim);
}
.card .rank-line {
  margin: 0; font-size: 13px; line-height: 1.45; color: var(--accent);
}
.match {
  width: 64px; min-height: 68px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  border: 1px solid var(--line); background: rgba(11, 21, 32, 0.55);
}
.match-grade { font: 700 22px/1.05 var(--display); letter-spacing: -0.02em; }
.match-pct { font-size: 12px; line-height: 1.2; color: var(--fog-dim); font-variant-numeric: tabular-nums; }
/* 仅 ≥80% 黄色；80% 以下不再用黄（含原 mid 档） */
.match-high { border-color: rgba(230, 190, 90, 0.45); }
.match-high .match-grade { color: #e6be5a; }
.match-mid,
.match-low { border-color: var(--line); }
.match-mid .match-grade,
.match-low .match-grade { color: var(--fog-dim); }
.card-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin: 2px 0 0;
}
.mentor-btn {
  display: inline-flex; align-items: center; width: fit-content;
  max-width: 100%; min-height: 34px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line);
  background: rgba(62, 207, 191, 0.1); color: var(--fog);
  font-size: 14px; text-decoration: none; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.mentor-btn:hover { border-color: rgba(62, 207, 191, 0.55); color: var(--accent); }
.mentor-btn.disabled {
  opacity: 0.55; pointer-events: none; background: transparent;
}
/* 有本地材料：强制蓝字+下划线（压过 a { color: inherit }） */
a.materials-btn,
.materials-btn:not(.disabled) {
  font-size: 14px; line-height: 1.4;
  color: #5b9fff !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  white-space: nowrap; cursor: pointer;
}
a.materials-btn:hover,
.materials-btn:not(.disabled):hover { color: #8bbcff !important; }
span.materials-btn.disabled,
.materials-btn.disabled {
  font-size: 14px; line-height: 1.4;
  color: #7a8794 !important;
  text-decoration: none !important;
  cursor: default;
  pointer-events: none; opacity: 0.75;
}
/* 状态按钮：正向统一绿 / 负面统一红 */
button.status-btn {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 28px; padding: 2px 12px;
  border-radius: 6px; background: transparent;
  font: inherit; font-size: 13px; line-height: 1.3;
  white-space: nowrap; cursor: pointer;
}
button.status-btn-pos,
button.status-btn-applied,
button.status-btn-interview,
button.status-btn-iv-next {
  color: #3dcf7a !important;
  border: 1.5px solid rgba(61, 207, 122, 0.85);
}
button.status-btn-pos:hover,
button.status-btn-applied:hover,
button.status-btn-interview:hover,
button.status-btn-iv-next:hover {
  background: rgba(61, 207, 122, 0.12);
  border-color: #3dcf7a;
}
button.status-btn-neg,
button.status-btn-abandon,
button.status-btn-reject,
button.status-btn-iv-end {
  color: #f07178 !important;
  border: 1.5px solid rgba(240, 113, 120, 0.85);
}
button.status-btn-neg:hover,
button.status-btn-abandon:hover,
button.status-btn-reject:hover,
button.status-btn-iv-end:hover {
  background: rgba(240, 113, 120, 0.12);
  border-color: #f07178;
}
/* 已中标·已投：合同状态 */
button.status-btn-contract-pending {
  color: #e85d5d !important;
  border: 1.5px solid rgba(232, 93, 93, 0.9);
}
button.status-btn-contract-pending:hover {
  background: rgba(232, 93, 93, 0.14);
  border-color: #e85d5d;
}
button.status-btn-contract-signed {
  color: #e6c84a !important;
  border: 1.5px solid rgba(230, 200, 74, 0.9);
}
button.status-btn-contract-signed:hover {
  background: rgba(230, 200, 74, 0.14);
  border-color: #e6c84a;
}
.tag.contract-pending {
  color: #e85d5d;
  border-color: rgba(232, 93, 93, 0.55);
}
.tag.contract-signed {
  color: #e6c84a;
  border-color: rgba(230, 200, 74, 0.55);
}
.materials-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 40;
  transform: translateX(-50%) translateY(12px);
  max-width: min(92vw, 420px); padding: 10px 16px;
  border-radius: 10px; border: 1px solid var(--line);
  background: rgba(15, 28, 40, 0.94); color: var(--fog);
  font-size: 13px; line-height: 1.45; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.materials-toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.card .timeline {
  margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 8px 14px;
  font-size: 13px; line-height: 1.45; color: var(--fog-dim);
}
.card .timeline span {
  white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 12px; color: var(--fog-dim);
}
.tag.accent { color: var(--accent); border-color: rgba(62, 207, 191, 0.35); }
.bucket-summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px;
  margin: 10px 0 0; padding: 0;
  font-size: 14px; line-height: 1.5; color: var(--fog-dim);
}
.bucket-summary a {
  color: var(--fog); text-decoration: none;
  border-bottom: 1px solid transparent;
}
.bucket-summary a:hover {
  color: var(--accent); border-bottom-color: rgba(62, 207, 191, 0.45);
}
.bucket-summary strong {
  color: var(--fog); font-weight: 600; font-variant-numeric: tabular-nums;
}
.bucket-summary .bucket-sep { color: var(--line); user-select: none; }
.privacy {
  margin-top: 20px; padding: 14px 16px; border-left: 3px solid var(--accent);
  background: rgba(62, 207, 191, 0.08); color: var(--fog-dim); font-size: 14px;
}
.section { margin-top: 40px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--line); padding-bottom: 10px;
}
.section-head h2 {
  margin: 0; font: 600 clamp(24px, 4vw, 32px)/1.2 var(--display);
}
.count { font-size: 14px; color: var(--fog-dim); }
.section-note { margin: 10px 0 0; font-size: 14px; color: var(--fog-dim); }
.empty { color: var(--fog-dim); font-size: 15px; }

.gate {
  min-height: 100vh; display: grid; place-items: center;
  padding: 24px 16px;
}
.gate[hidden],
#app[hidden] {
  display: none !important;
}
.gate-card {
  width: min(400px, 100%);
  padding: 28px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(24, 50, 71, 0.72);
  backdrop-filter: blur(10px);
}
.gate-title { margin: 0; font: 700 36px/1.1 var(--display); }
.gate-desc { margin: 10px 0 22px; color: var(--fog-dim); font-size: 15px; }
.gate-label { display: block; font-size: 13px; color: var(--fog-dim); margin-bottom: 8px; }
.gate-input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(11, 21, 32, 0.65);
  color: var(--fog); font: 600 18px/1 var(--text); letter-spacing: 0.12em;
}
.gate-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.gate-err { margin: 10px 0 0; color: #ff7b72; font-size: 14px; }
.gate-btn { margin-top: 18px; width: 100%; justify-content: center; }
.gate-back { margin: 16px 0 0; font-size: 14px; color: var(--fog-dim); }
.gate-back a { color: var(--accent); text-decoration: none; }

@media (min-width: 960px) {
  .home {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center; gap: 24px;
    padding: 0 clamp(28px, 6vw, 88px);
  }
  .visual { grid-column: 2; grid-row: 1; min-height: 100vh; margin: 0; }
  .side { grid-column: 1; grid-row: 1; padding: 96px 0; }
  h1 { font-size: clamp(64px, 6.5vw, 92px); }
  .who { font-size: 18px; }
  .projects { margin-top: 36px; max-width: 440px; }
  footer { padding-left: clamp(28px, 6vw, 88px); }
}
