:root {
  --ink: #16332e;
  --muted: #5d746f;
  --green-900: #075f52;
  --green-700: #087f6b;
  --green-500: #21aa8b;
  --mint: #dff8ef;
  --apple: #c9f1d5;
  --pink: #f7b6cf;
  --pink-soft: #fff0f6;
  --purple: #bba7ee;
  --purple-soft: #f1edff;
  --cream: #fffdf7;
  --line: #d9e8e3;
  --white: #ffffff;
  --shadow: 0 16px 38px rgba(14, 84, 70, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(151, 230, 188, .40), transparent 27rem),
    radial-gradient(circle at 96% 16%, rgba(247, 182, 207, .32), transparent 28rem),
    radial-gradient(circle at 70% 74%, rgba(187, 167, 238, .20), transparent 32rem),
    #f7fcfa;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  line-height: 1.55;
}

button, input { font: inherit; }
a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(217, 232, 227, .8);
  background: rgba(247, 252, 250, .88);
  backdrop-filter: blur(16px);
}

.header-inner, .page-shell, footer {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  color: white;
  background: #fff;
  box-shadow: 0 8px 22px rgba(8, 127, 107, .24);
}

.brand-mark img { width: 88%; height: 88%; object-fit: contain; }

.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; line-height: 1.3; }
.brand small { color: var(--muted); font-size: .72rem; letter-spacing: .04em; }

.install-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
  background: var(--green-700);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(8, 127, 107, .2);
}

.install-button:focus-visible,
.dialog-close:focus-visible,
.dialog-done:focus-visible {
  outline: 3px solid #73d6ba;
  outline-offset: 3px;
}

body.dialog-open { overflow: hidden; }

.install-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}

.install-dialog[hidden] { display: none; }

.install-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 37, 32, .58);
  backdrop-filter: blur(5px);
}

.install-dialog-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow-y: auto;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 28px 28px 28px 9px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(5, 50, 42, .28);
  outline: none;
  animation: dialog-in .2s ease-out;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0 0 3px;
  border: 0;
  border-radius: 50%;
  color: var(--green-900);
  background: var(--mint);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-right: 38px;
}

.dialog-heading p,
.dialog-heading h2,
.dialog-heading span { margin: 0; }
.dialog-heading p { color: var(--green-700); font-size: .78rem; font-weight: 900; letter-spacing: .12em; }
.dialog-heading h2 { font-size: 1.7rem; line-height: 1.2; }
.dialog-heading > div > span { color: var(--muted); font-size: .9rem; }

.dialog-phone {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px 18px 18px 6px;
  color: var(--green-900);
  background: linear-gradient(145deg, var(--apple), #e9ddff 58%, #ffddea);
}
.dialog-phone svg { width: 31px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.install-steps {
  display: grid;
  gap: 12px;
  margin: 24px 0 18px;
  padding: 0;
  list-style: none;
  counter-reset: install-step;
}

.install-steps li {
  counter-increment: install-step;
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(100deg, #f4fcf9, #f8f4ff 62%, #fff5f8);
}

.install-steps li > span:last-child { position: relative; padding-right: 24px; }
.install-steps li > span:last-child::after {
  content: counter(install-step);
  position: absolute;
  top: 0;
  right: 0;
  color: #80a29a;
  font-size: .78rem;
  font-weight: 900;
}
.install-steps strong,
.install-steps small { display: block; }
.install-steps strong { font-size: 1rem; }
.install-steps small { margin-top: 2px; color: var(--muted); font-size: .78rem; }

.step-visual {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 15px;
  color: #087f6b;
  background: #fff;
  box-shadow: 0 6px 16px rgba(14, 84, 70, .09);
}
.step-visual svg { width: 40px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.safari-visual svg circle:first-child { fill: #eaf7ff; stroke: #318fd1; }
.safari-visual svg path { fill: #ee6d79; stroke: #316ea9; }
.safari-visual svg circle:last-child { fill: #fff; stroke: #316ea9; }
.share-visual { color: #147ad6; }
.add-visual { color: var(--green-700); }

.dialog-note { margin: 0 0 18px; color: var(--muted); font-size: .9rem; text-align: center; }
.dialog-done {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--green-700);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 9px 20px rgba(8, 127, 107, .18);
}

.page-shell { padding: 48px 0 64px; }

.intro {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  display: grid;
  align-content: center;
  padding: clamp(32px, 6vw, 70px);
  border-radius: 34px 34px 34px 10px;
  color: white;
  background: linear-gradient(125deg, #076b5b 0%, #07917a 40%, #8c79c5 72%, #e58bad 100%);
  box-shadow: var(--shadow);
}

.intro::after {
  content: "";
  position: absolute;
  right: clamp(18px, 8vw, 100px);
  top: 50%;
  width: clamp(11rem, 24vw, 19rem);
  aspect-ratio: 229 / 246;
  translate: 0 -50%;
  background: url("icons/school-logo.png") center / contain no-repeat;
  filter: drop-shadow(0 18px 24px rgba(24, 38, 84, .18));
  opacity: .42;
}

.eyebrow, .section-kicker {
  margin: 0 0 8px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
}

.intro h1 { margin: 0; font-size: clamp(2.8rem, 8vw, 5.4rem); line-height: 1.05; letter-spacing: -.04em; }
.intro > p:not(.eyebrow) { margin: 12px 0 26px; font-size: clamp(1rem, 2vw, 1.2rem); }

.search-box {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 15px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 12px 30px rgba(0, 61, 50, .16);
}

.search-box svg { width: 21px; fill: none; stroke: var(--green-700); stroke-width: 2; }
.search-box input { width: 100%; min-height: 54px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 1rem; }
.search-box input::placeholder { color: #78908b; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 48px 2px 20px;
}

.section-kicker { color: var(--green-700); }
.section-heading h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.03em; }
.result-count { color: var(--muted); font-variant-numeric: tabular-nums; }

.directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.directory-card {
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 23px 23px 23px 7px;
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(239,252,248,.92));
  box-shadow: 0 10px 25px rgba(14, 84, 70, .06);
  animation: rise .45s both;
  animation-delay: var(--delay);
}

.directory-card:nth-child(3n + 2) { background: linear-gradient(145deg, #fff, var(--purple-soft)); }
.directory-card:nth-child(3n) { background: linear-gradient(145deg, #fff, var(--pink-soft)); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.card-heading {
  width: 100%;
  display: grid;
  grid-template-columns: 54px 1fr 24px;
  align-items: center;
  gap: 15px;
  padding: 18px;
  border: 0;
  text-align: left;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.card-heading:hover { background: #f4fbf8; }
.card-heading:focus-visible, .child-link:focus-visible, .direct-link:focus-visible { outline: 3px solid #73d6ba; outline-offset: -3px; }

.icon-wrap {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 17px 17px 17px 5px;
  color: var(--green-900);
  background: linear-gradient(145deg, var(--apple), #e9ddff 58%, #ffddea);
}

.icon-wrap svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.heading-copy { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 9px; min-width: 0; }
.heading-copy .number { color: var(--green-700); font-size: .78rem; font-weight: 900; }
.heading-copy strong { font-size: 1.06rem; }
.heading-copy small { grid-column: 1 / -1; color: var(--muted); font-size: .84rem; }

.chevron { width: 22px; fill: none; stroke: var(--muted); stroke-width: 2; transition: transform .2s ease; }
.card-heading[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.card-panel { padding: 0 18px 18px 87px; }
.card-panel[hidden] { display: none; }
.children { display: grid; gap: 7px; padding-top: 3px; }

.child-link, .direct-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 43px;
  padding: 9px 12px;
  border-radius: 11px;
  text-decoration: none;
  color: #274b44;
  background: linear-gradient(100deg, #f1fbf7, #f6f1ff 58%, #fff2f7);
  transition: transform .18s ease, background .18s ease;
}

.child-link:hover, .direct-link:hover { transform: translateX(3px); background: linear-gradient(100deg, #dff8ef, #ece4ff 58%, #ffe3ee); }
.child-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--green-900);
  background: linear-gradient(145deg, #c9f1d5, #decffd 58%, #ffcfe0);
}
.child-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.child-title { flex: 1 1 auto; min-width: 0; }
.child-arrow, .direct-arrow { flex: 0 0 auto; width: 18px; fill: none; stroke: var(--green-700); stroke-width: 2; }
.pending { color: #61746f; }
.pending::after { content: "待填链接"; flex: 0 0 auto; padding: 2px 7px; border-radius: 99px; color: #60766f; background: #e7efec; font-size: .7rem; }
.child-link.pending .child-arrow { display: none; }
.direct-link { width: fit-content; color: var(--green-900); font-weight: 700; }

.direct-card { border-color: rgba(168, 132, 211, .34); }
.direct-card-heading { min-height: 91px; text-decoration: none; }
.direct-card-heading:hover { background: linear-gradient(100deg, rgba(215,248,238,.65), rgba(244,226,250,.72), rgba(255,222,235,.75)); }
.direct-arrow { width: 24px; stroke: #9b5f9e; }

.empty-state { padding: 50px 20px; border: 1px dashed #a9c8bf; border-radius: 18px; text-align: center; color: var(--muted); }
.empty-state strong, .empty-state span { display: block; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  translate: -50% 20px;
  padding: 12px 18px;
  border-radius: 999px;
  color: white;
  background: #173e36;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  white-space: nowrap;
}
.toast.show { translate: -50% 0; opacity: 1; }

@media (max-width: 760px) {
  .header-inner, .page-shell, footer { width: min(100% - 24px, 1160px); }
  .header-inner { min-height: 68px; }
  .brand strong { font-size: .9rem; }
  .brand small { font-size: .64rem; }
  .brand-mark { width: 40px; border-radius: 12px 12px 12px 4px; }
  .install-button { padding: 8px 11px; font-size: .82rem; }
  .install-dialog { align-items: end; padding: 10px; }
  .install-dialog-panel { max-height: calc(100vh - 20px); padding: 24px 18px 20px; border-radius: 25px 25px 12px 12px; }
  .dialog-heading h2 { font-size: 1.5rem; }
  .install-steps { gap: 9px; margin-top: 19px; }
  .install-steps li { grid-template-columns: 52px 1fr; gap: 11px; padding: 11px; }
  .step-visual { width: 52px; height: 52px; }
  .step-visual svg { width: 35px; }
  .page-shell { padding-top: 18px; }
  .intro { min-height: 275px; padding: 30px 22px; border-radius: 25px 25px 25px 8px; }
  .intro::after { right: -24px; width: 11rem; opacity: .25; }
  .directory-grid { grid-template-columns: 1fr; gap: 12px; }
  .section-heading { margin-top: 34px; }
  .card-heading { grid-template-columns: 48px 1fr 22px; padding: 15px; }
  .icon-wrap { width: 48px; height: 48px; border-radius: 15px 15px 15px 5px; }
  .icon-wrap svg { width: 24px; }
  .card-panel { padding: 0 15px 15px; }
  .children { padding-top: 0; }
  .child-link { min-height: 46px; }
  footer { flex-direction: column; gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
