/* ---------------------------------------------------------------
   马哈鱼-校园服务站 · design tokens & shared UI
   --------------------------------------------------------------- */
:root {
  --ink: #1b1714;
  --ink-soft: #4a423a;
  --ink-faint: #7c7166;
  --paper: #fff9ef;
  --paper-deep: #f7ecdb;
  --white: #ffffff;
  --coral: #e2603d;
  --coral-deep: #c4451f;
  --coral-soft: #fbe3d9;
  --mint: #7ed1bc;
  --mint-soft: #ddf5ee;
  --sky: #9ed6ef;
  --sun: #ffd056;
  --line: #1b1714;
  --line-soft: rgba(27, 23, 20, 0.14);
  --shadow: 6px 7px 0 rgba(27, 23, 20, 0.12);
  --shadow-sm: 3px 4px 0 rgba(27, 23, 20, 0.14);
  --radius: 20px;
  --radius-sm: 12px;
  --font-body: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", system-ui, sans-serif;
  --font-display: "Arial Rounded MT Bold", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --max: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.landing {
  background-image: radial-gradient(rgba(27, 23, 20, 0.1) 1px, transparent 1px);
  background-size: 22px 22px;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.16;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
}

::selection {
  background: var(--sun);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.paper-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(27, 23, 20, 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}

/* ------------------------------- header ------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 249, 239, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transform: rotate(-2deg);
}

.brand-badge img {
  height: 34px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.02em;
}

.brand-text small {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
}

.site-nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.site-nav a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 0.18s ease, color 0.18s ease;
}

.site-nav a:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ------------------------------- buttons ------------------------------- */
.btn {
  --btn-bg: var(--white);
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 0 var(--line);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  text-align: center;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--line);
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--line);
}

.btn[disabled],
.btn.is-loading {
  opacity: 0.62;
  pointer-events: none;
  transform: none;
}

.btn-primary {
  --btn-bg: var(--coral);
  --btn-fg: #fff;
}

.btn-primary:hover {
  --btn-bg: #ea6c49;
}

.btn-dark {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
}

.btn-ghost {
  --btn-bg: transparent;
  box-shadow: 0 3px 0 rgba(27, 23, 20, 0.16);
}

.btn-ghost:hover {
  --btn-bg: var(--white);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  box-shadow: 0 3px 0 var(--line);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.btn-soft {
  --btn-bg: var(--paper-deep);
  box-shadow: 0 3px 0 rgba(27, 23, 20, 0.18);
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--coral-deep);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------- forms ------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span,
.field-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--white);
  border: 2px solid rgba(27, 23, 20, 0.75);
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(226, 96, 61, 0.16);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a99f93;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-hint {
  font-size: 12px;
  color: var(--ink-faint);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--coral);
}

.form-note {
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
}

.form-message {
  min-height: 22px;
  font-size: 13px;
  font-weight: 700;
  color: var(--coral-deep);
  text-align: center;
}

.form-message.ok {
  color: #177a55;
}

/* ------------------------------- misc ------------------------------- */
.is-hidden {
  display: none !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  z-index: 120;
  padding: 11px 20px;
  max-width: min(90vw, 520px);
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: var(--coral-deep);
}

.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--coral-deep);
  text-transform: uppercase;
}

.kicker.light {
  color: var(--sun);
}

/* ------------------------------- markdown ------------------------------- */
.markdown {
  font-size: 15.5px;
  line-height: 1.82;
  color: var(--ink);
  word-wrap: break-word;
}

.markdown > *:first-child {
  margin-top: 0;
}

.markdown h1 {
  font-size: clamp(24px, 3vw, 32px);
  margin: 34px 0 16px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--ink);
}

.markdown h2 {
  font-size: 22px;
  margin: 32px 0 12px;
  padding: 6px 0 6px 14px;
  border-left: 5px solid var(--coral);
  background: linear-gradient(90deg, var(--coral-soft), transparent 70%);
}

.markdown h3 {
  font-size: 18px;
  margin: 24px 0 10px;
}

.markdown h4 {
  font-size: 16px;
  margin: 20px 0 8px;
}

.markdown p {
  margin: 10px 0;
}

.markdown ul,
.markdown ol {
  margin: 10px 0;
  padding-left: 24px;
}

.markdown li {
  margin: 5px 0;
}

.markdown li > ul,
.markdown li > ol {
  margin: 4px 0;
}

.markdown code {
  padding: 2px 6px;
  background: var(--paper-deep);
  border: 1px solid rgba(27, 23, 20, 0.12);
  border-radius: 6px;
  font-family: "Cascadia Code", Consolas, "SFMono-Regular", monospace;
  font-size: 0.88em;
}

.markdown pre {
  margin: 16px 0;
  padding: 16px;
  overflow-x: auto;
  background: #201d1a;
  color: #fdf6ea;
  border-radius: 12px;
  border: 2px solid var(--line);
}

.markdown pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: 13px;
  line-height: 1.65;
}

.markdown blockquote {
  margin: 14px 0;
  padding: 8px 16px;
  border-left: 4px solid var(--sun);
  background: rgba(255, 208, 86, 0.16);
  color: var(--ink-soft);
}

.markdown table {
  width: 100%;
  margin: 16px 0;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--white);
  border: 2px solid var(--line);
}

.markdown th,
.markdown td {
  padding: 9px 11px;
  border: 1px solid rgba(27, 23, 20, 0.16);
  text-align: left;
  vertical-align: top;
}

.markdown th {
  background: var(--paper-deep);
  font-weight: 800;
}

.markdown tr:nth-child(even) td {
  background: rgba(255, 249, 239, 0.55);
}

.markdown a {
  color: var(--coral-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown hr {
  margin: 26px 0;
  border: 0;
  border-top: 2px dashed rgba(27, 23, 20, 0.22);
}

.markdown img {
  border-radius: 10px;
}

.markdown .table-wrap {
  overflow-x: auto;
}

.markdown .mermaid-note {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: -8px;
}

@media (max-width: 720px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

[hidden] {
  display: none !important;
}
