/* =========================================================
   研途启航 · 基础样式
   ========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #f4f1e8;
  --bg-2: #eee9dc;
  --paper: #fffdf7;
  --paper-2: #fbf8ef;
  --ink: #14243d;
  --ink-2: #3a4c68;
  --muted: #71809a;
  --line: #e2dccd;
  --line-strong: #d3cbb8;
  --blue: #2f6fed;
  --blue-deep: #1b3f7a;
  --blue-soft: #e8efff;
  --teal: #0f9e8a;
  --teal-soft: #e4f7f3;
  --amber: #df8a2b;
  --amber-soft: #fdf1df;
  --violet: #7b6cf6;
  --violet-soft: #eeebff;
  --rose: #cf6688;
  --rose-soft: #fbeaf0;
  --danger: #c4453b;
  --ok: #15803d;
  --shadow-sm: 0 2px 10px -4px rgba(20, 36, 61, .2);
  --shadow: 0 22px 60px -30px rgba(20, 36, 61, .45);
  --shadow-lg: 0 40px 90px -40px rgba(20, 36, 61, .5);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 30px;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --header-h: 68px;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 88% -8%, rgba(47, 111, 237, .10), transparent 62%),
    radial-gradient(900px 520px at -6% 18%, rgba(15, 158, 138, .08), transparent 60%),
    var(--bg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .35;
  background-image:
    linear-gradient(rgba(20, 36, 61, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 36, 61, .028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; }
ul, ol { margin: 0; padding-left: 1.2em; }
::selection { background: rgba(47, 111, 237, .18); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { width: min(1180px, calc(100% - 48px)); margin-inline: auto; position: relative; z-index: 1; }

/* ---------- 通用组件 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--blue-deep);
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; opacity: .5; }

.section { padding: 96px 0; position: relative; }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-title {
  font-family: var(--serif);
  font-size: clamp(30px, 3.6vw, 46px);
  letter-spacing: .015em;
  color: var(--ink);
}
.section-title em { font-style: normal; color: var(--blue); }
.section-desc { margin-top: 16px; color: var(--ink-2); font-size: 16.5px; max-width: 640px; }
.section-head.center .section-desc { margin-inline: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary {
  background: linear-gradient(135deg, #2f6fed, #1b4fbf);
  color: #fff;
  box-shadow: 0 14px 30px -12px rgba(47, 111, 237, .65), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn-primary:hover { box-shadow: 0 18px 36px -12px rgba(47, 111, 237, .75); }
.btn-dark {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 14px 30px -14px rgba(20, 36, 61, .8);
}
.btn-ghost { border-color: var(--line-strong); background: rgba(255, 253, 247, .6); color: var(--ink); }
.btn-ghost:hover { background: var(--paper); border-color: var(--ink-2); }
.btn-soft { background: var(--blue-soft); color: var(--blue-deep); }
.btn-soft:hover { background: #dbe7ff; }
.btn-danger-soft { background: #fdeceb; color: var(--danger); }
.btn-sm { padding: 9px 15px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 247, .7);
  color: var(--ink-2);
  transition: .18s ease;
}
.icon-btn:hover { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.chip-blue { background: var(--blue-soft); border-color: #d5e2ff; color: var(--blue-deep); }
.chip-teal { background: var(--teal-soft); border-color: #c8ece6; color: #0a6f61; }
.chip-amber { background: var(--amber-soft); border-color: #f4ddba; color: #9a5a14; }
.chip-violet { background: var(--violet-soft); border-color: #ddd6ff; color: #4f3fc4; }
.chip-rose { background: var(--rose-soft); border-color: #f4d3df; color: #a83f63; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.tag-blue { background: var(--blue-soft); color: var(--blue-deep); }
.tag-teal { background: var(--teal-soft); color: #0a6f61; }
.tag-amber { background: var(--amber-soft); color: #9a5a14; }
.tag-rose { background: var(--rose-soft); color: #a83f63; }
.tag-gray { background: #f0ede4; color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 顶部导航 ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(244, 241, 232, .78);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid rgba(211, 203, 184, .55);
}
.site-nav .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: min(1280px, calc(100% - 48px)); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: .02em; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #1b3f7a, #2f6fed 60%, #0f9e8a);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(27, 63, 122, .8), inset 0 1px 0 rgba(255,255,255,.25);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-size: 18px; letter-spacing: .08em; }
.brand-text span { font-size: 10px; letter-spacing: .16em; color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 9px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-2);
  transition: .18s ease;
}
.nav-links a:hover { background: rgba(255, 253, 247, .8); color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); background: rgba(255, 253, 247, .55); padding: 46px 0 34px; position: relative; z-index: 1; }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand p { max-width: 380px; color: var(--muted); font-size: 13.5px; margin-top: 12px; }
.footer-meta { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col h5 { font-size: 12px; letter-spacing: .14em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.footer-col p, .footer-col a { display: block; font-size: 13px; color: var(--ink-2); margin: 4px 0; }
.footer-col a:hover { color: var(--blue); }
.copyright { margin-top: 34px; padding-top: 20px; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

/* ---------- 弹层 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(16, 25, 40, .5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-backdrop.open { display: flex; animation: fadeIn .18s ease both; }
.modal {
  width: min(680px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  animation: modalUp .24s cubic-bezier(.2, .8, .2, 1) both;
}
.modal.wide { width: min(860px, 100%); }
.modal-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 24px 28px 18px;
  background: linear-gradient(to bottom, var(--paper) 70%, rgba(255, 253, 247, 0));
}
.modal-head h3 { font-family: var(--serif); font-size: 23px; }
.modal-head p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.modal-body { padding: 2px 28px 28px; }
.modal-foot {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 16px 28px 22px;
  background: linear-gradient(to top, var(--paper) 72%, rgba(255, 253, 247, 0));
}
.modal-close { flex: none; }

.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  max-width: min(520px, calc(100vw - 40px));
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(20, 36, 61, .94);
  color: #fff;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: toastIn .24s ease both;
}
.toast.ok { background: #0e6b55; }
.toast.err { background: #9c332b; }
.toast svg { width: 16px; height: 16px; flex: none; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; gap: 10px; }
.field > label span { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fffef9;
  padding: 11px 13px;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .12);
}
.textarea { resize: vertical; min-height: 92px; line-height: 1.65; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 12px; color: var(--muted); margin: 0; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { position: relative; }
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fffef9;
  font-size: 13px; color: var(--ink-2); cursor: pointer; transition: .16s ease;
}
.check-chip input:checked + span { background: var(--blue-soft); border-color: #b9cdfa; color: var(--blue-deep); font-weight: 600; }
.check-chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Markdown ---------- */
.md { font-size: 14.5px; line-height: 1.78; word-break: break-word; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md p { margin: 0 0 .72em; }
.md h4 { font-size: 15.5px; margin: 1.1em 0 .5em; color: var(--ink); }
.md ul, .md ol { margin: 0 0 .8em; padding-left: 1.25em; }
.md li { margin: 3px 0; }
.md li::marker { color: var(--blue); }
.md strong { font-weight: 700; color: var(--ink); }
.md code {
  font-family: var(--mono); font-size: .88em;
  padding: 2px 6px; border-radius: 6px;
  background: #f0ecdf; color: #8a4a12;
}
.md pre {
  margin: 0 0 1em; padding: 14px 16px; overflow: auto;
  background: #182641; color: #e8edf7; border-radius: 12px;
  font-size: 12.5px; line-height: 1.65;
}
.md pre code { background: none; color: inherit; padding: 0; }
.md a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.md blockquote { margin: 0 0 1em; padding: 8px 14px; border-left: 3px solid var(--line-strong); color: var(--ink-2); background: #faf7ee; border-radius: 0 8px 8px 0; }

/* ---------- 动画 ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalUp { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseDot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes drawLine { from { stroke-dashoffset: 620; } to { stroke-dashoffset: 0; } }

.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.btn-ghost .spinner, .btn-soft .spinner { border-color: rgba(20, 36, 61, .2); border-top-color: var(--ink); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .container { width: calc(100% - 32px); }
  .site-nav .container { width: calc(100% - 32px); }
  .nav-links { display: none; }
  .section { padding: 70px 0; }
  .footer-meta { gap: 32px; }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 12px; }
  .modal-head { padding: 20px 20px 14px; }
  .modal-body { padding: 0 20px 22px; }
  .modal-foot { padding: 14px 20px 18px; }
  .brand-text span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
