:root {
  color-scheme: light;
  --page: #f7f9fc;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #687187;
  --line: #dfe4ee;
  --brand: #263a8b;
  --brand-bright: #3d68d8;
  --teal: #168c88;
  --night: #10182f;
  --night-soft: #182346;
  --radius: 28px;
  --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 85% 4%, rgba(61, 104, 216, .075), transparent 28rem),
    var(--page);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  padding-top: 28px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  text-decoration: none;
}

.brand img {
  width: auto;
  height: 40px;
}

.daily-entry {
  min-height: 42px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .64);
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .22s var(--ease), border-color .22s ease, background-color .22s ease;
}

.daily-entry-arrow {
  color: var(--brand);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  transition: transform .24s var(--ease);
}

.home-main {
  padding-top: clamp(64px, 7vw, 104px);
  padding-bottom: clamp(28px, 4vw, 48px);
}

.intro {
  max-width: 940px;
  margin-bottom: clamp(42px, 5vw, 64px);
  animation: reveal .5s var(--ease) both;
}

.intro h1 {
  margin: 0;
  font-size: clamp(52px, 5.6vw, 76px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.08;
  text-wrap: balance;
}

.intro p {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 20px);
  letter-spacing: 0;
  line-height: 1.7;
  text-wrap: balance;
}

.domain-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .9fr);
  gap: 20px;
  align-items: stretch;
}

.domain-card {
  text-decoration: none;
  position: relative;
  min-width: 0;
  min-height: 380px;
  padding: clamp(28px, 3vw, 38px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .22s ease;
  animation: reveal .5s var(--ease) .06s both;
}

.math-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--ink);
}

.daily-card {
  display: flex;
  flex-direction: column;
  border-color: #e3dfd5;
  background-color: #f8f6f0;
  background-image:
    linear-gradient(rgba(215, 210, 196, .35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(215, 210, 196, .35) 1px, transparent 1px);
  background-size: 32px 32px;
  animation-delay: .12s;
}

.domain-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.domain-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .16em;
  line-height: 1.2;
}

.daily-card h2 {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-weight: 700;
}

.domain-card h2 {
  margin: 0;
  font-size: clamp(34px, 3.2vw, 46px);
  font-weight: 640;
  letter-spacing: 0;
  line-height: 1.05;
}

.status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 30px;
  margin: 0;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .02em;
  line-height: 1;
}

.status-open {
  border-color: #d5e8e3;
  background: #edf7f5;
  color: #23655e;
}

.status-open span {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #67d1bd;
  box-shadow: 0 0 0 4px rgba(103, 209, 189, .12);
}

.status-closed {
  background: #f4f6fa;
}

.domain-description {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  letter-spacing: 0;
}

.card-visual {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 100px;
  margin: 8px 0 16px;
}

.card-illustration {
  flex: 0 0 auto;
  width: 100px;
  height: 100px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.math-illustration { width: 180px; color: #7893c7; }
.daily-illustration { color: #498b98; }
.illustration-guide { stroke: currentColor; opacity: .22; stroke-width: 1; }
.illustration-axis { opacity: .55; stroke-width: 1.5; }
.illustration-paper { fill: #fffdf8; stroke-opacity: .45; }

.daily-steps {
  margin: 0 auto 0 0;
  color: #0c728c;
  font-size: 14px;
  font-weight: 600;
  word-spacing: .35em;
}

.browse-math {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: auto;
  padding: 16px 18px;
  border: 1px solid #dce3f4;
  border-radius: 18px;
  background: #f1f4fc;
  color: var(--brand);
  text-decoration: none;
  transition: background-color .22s ease, border-color .22s ease;
}

.browse-math span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.browse-math strong {
  font-size: 16px;
  font-weight: 650;
}

.browse-math small {
  color: var(--muted);
  font-size: 13px;
}

.browse-math svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  transition: transform .24s var(--ease), stroke .22s ease;
}

.curriculum-section {
  padding-top: clamp(96px, 10vw, 144px);
}

.curriculum-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
  gap: 48px;
  align-items: end;
  margin-bottom: 56px;
  scroll-margin-top: 28px;
}

.section-label,
.group-label {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .15em;
  line-height: 1.2;
}

.curriculum-header h2 {
  margin: 0;
  font-size: clamp(34px, 3vw, 42px);
  font-weight: 640;
  line-height: 1.08;
}

.curriculum-header > p,
.chapter-group-header > p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.chapter-group {
  scroll-margin-top: 24px;
}

.chapter-group + .chapter-group {
  margin-top: 68px;
}

.chapter-group-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.chapter-group-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.2;
}

.chapter-group-header > p {
  max-width: 440px;
  text-align: right;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.high-school-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chapter-card {
  min-width: 0;
  min-height: 184px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .78);
  color: var(--ink);
  text-decoration: none;
  transition: transform .24s var(--ease), border-color .22s ease, box-shadow .22s ease, background-color .22s ease;
}

.chapter-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.chapter-number {
  color: var(--brand);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  letter-spacing: .08em;
}

.high-school-grid .chapter-number {
  font-size: 16px;
}

.chapter-arrow {
  color: #9ba3b3;
  font-size: 19px;
  line-height: 1;
  transition: color .22s ease, transform .24s var(--ease);
}

.chapter-card h4 {
  margin: 32px 0 0;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.35;
}

.chapter-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.site-footer {
  margin-top: 32px;
  padding: 40px 0 24px;
  border-top: 1px solid var(--line);
  background: #f0f3f8;
  color: var(--muted);
  font-size: 12px;
}

.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-bottom: 28px;
}

.footer-identity .brand img { height: 30px; }
.footer-identity p { margin: 12px 0 0; font-size: 14px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-nav a, .footer-nav button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.footer-nav a:hover, .footer-nav button:hover { color: var(--brand); }
.footer-nav a:focus-visible, .footer-nav button:focus-visible {
  outline: 3px solid rgba(61, 104, 216, .48);
  outline-offset: 4px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.brand:focus-visible,
.daily-entry:focus-visible,
.domain-card:focus-visible,
.chapter-card:focus-visible,
.skip-link:focus-visible {
  outline: 3px solid rgba(61, 104, 216, .48);
  outline-offset: 4px;
}

.domain-card:focus-visible {
  outline-color: #83a6ff;
}

@media (hover: hover) {
  .daily-entry:hover {
    border-color: rgba(38, 58, 139, .34);
    background: #fff;
    transform: translateY(-1px);
  }

  .daily-entry:hover .daily-entry-arrow {
    transform: translateX(2px);
  }

  .math-card:hover {
    border-color: #aab9df;
  }

  .math-card:hover .browse-math {
    border-color: #b9c7e9;
    background: #e8eefb;
  }

  .daily-card:hover {
    border-color: #90bcc7;
  }

  .daily-card:hover .browse-math {
    background: #09667e;
    border-color: #09667e;
  }

  .domain-card:hover .browse-math svg {
    transform: translateY(3px);
  }

  .chapter-card:hover {
    border-color: rgba(38, 58, 139, .3);
    background: #fff;
    box-shadow: 0 16px 42px rgba(23, 32, 51, .075);
    transform: translateY(-2px);
  }

  .chapter-card:hover .chapter-arrow {
    color: var(--brand);
    transform: translateX(4px);
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .home-main {
    padding-top: 54px;
  }

  .domain-grid {
    grid-template-columns: 1fr;
  }

  .domain-card {
    min-height: 0;
  }

  .math-card {
    min-height: 320px;
  }

  .daily-card {
    min-height: 190px;
  }

  .curriculum-header {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .chapter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 620px) {
  .page-shell {
    width: calc(100% - 40px);
  }

  .site-header {
    padding-top: 18px;
  }

  .header-inner {
    min-height: 36px;
  }

  .brand img {
    height: 32px;
  }

  .daily-entry {
    min-height: 38px;
    gap: 6px;
    padding-inline: 12px;
    border-radius: 11px;
    font-size: 13px;
  }

  .daily-entry-arrow {
    font-size: 16px;
  }

  .home-main {
    padding-top: 32px;
    padding-bottom: 22px;
  }

  .intro {
    margin-bottom: 28px;
  }

  .intro h1 {
    font-size: clamp(36px, 11vw, 46px);
  }

  .intro p {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.65;
  }

  .domain-grid {
    gap: 14px;
  }

  .domain-card {
    padding: 22px;
    border-radius: 22px;
  }

  .domain-card h2 {
    font-size: 32px;
  }

  .domain-heading {
    gap: 16px;
  }

  .domain-label {
    margin-bottom: 8px;
    font-size: 10px;
  }

  .domain-description {
    margin-top: 12px;
    font-size: 14px;
  }

  .math-card {
    min-height: 260px;
  }

  .browse-math {
    min-height: 66px;
    padding: 13px 15px;
    border-radius: 15px;
  }

  .browse-math strong {
    font-size: 15px;
  }

  .browse-math small {
    font-size: 12px;
  }

  .browse-math svg {
    width: 19px;
    height: 19px;
  }

  .curriculum-section {
    padding-top: 74px;
  }

  .curriculum-header {
    margin-bottom: 42px;
  }

  .curriculum-header h2 {
    font-size: 36px;
  }

  .chapter-group + .chapter-group {
    margin-top: 50px;
  }

  .chapter-group-header {
    display: block;
    margin-bottom: 18px;
    padding-bottom: 16px;
  }

  .chapter-group-header h3 {
    font-size: 22px;
  }

  .chapter-group-header > p {
    max-width: none;
    margin-top: 10px;
    font-size: 14px;
    text-align: left;
  }

  .chapter-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .chapter-card {
    min-height: 150px;
    padding: 21px;
    border-radius: 18px;
  }

  .chapter-card h4 {
    margin-top: 24px;
    font-size: 18px;
  }

  .daily-card {
    min-height: 142px;
  }

  .daily-card .domain-description {
    max-width: 200px;
  }

  .site-footer {
    padding-bottom: 20px;
  }

  .footer-inner {
    padding-top: 16px;
  }
}

@media (max-width: 430px) {
  .footer-inner span:last-child {
    display: none;
  }
}

@media (max-width: 360px) {
  .daily-card .domain-description {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.daily-card .browse-math {
  border-color: #0c728c;
  background: #0c728c;
  color: #fff;
}
.daily-card:hover .browse-math svg { transform: translateX(3px); }
.contact-dialog {
  width: min(460px, calc(100% - 32px));
  max-height: calc(100svh - 32px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(16, 24, 47, .2);
}
.contact-dialog::backdrop { background: rgba(16, 24, 47, .36); }
.contact-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.contact-heading h2 { margin: 0; font-size: 26px; font-weight: 650; }
.contact-close {
  width: 44px; height: 44px; border: 0; border-radius: 12px;
  background: var(--page); color: var(--muted); font: inherit; font-size: 26px; cursor: pointer;
}
.contact-intro { margin: 12px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.wechat-contact { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--page); }
.contact-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
#wechat-id { font-size: 22px; font-weight: 650; user-select: all; }
.copy-status { min-height: 40px; margin: 8px 0 14px; color: var(--muted); font-size: 13px; }
.social-links { display: flex; flex-wrap: wrap; gap: 8px; }
.social-links a { display: flex; align-items: center; justify-content: space-between; flex: 1 0 auto; gap: 12px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--brand); text-decoration: none; font-size: 14px; }
.contact-dialog button:focus-visible, .social-links a:focus-visible { outline: 3px solid rgba(61,104,216,.48); outline-offset: 3px; }
.social-links a:hover { background: var(--page); border-color: var(--brand); }
@media (max-width: 620px) {
  .daily-card { min-height: 228px; }
  .daily-card .domain-description { max-width: none; }
  .card-visual { min-height: 76px; margin-block: 8px 12px; }
  .card-illustration { width: 76px; height: 76px; }
  .math-illustration { width: 137px; }
  .footer-main { align-items: flex-start; flex-direction: column; gap: 18px; padding-bottom: 20px; }
  .footer-nav { gap: 24px; }
  .contact-dialog { padding: 20px; }
  .wechat-contact { padding: 14px; }
  #copy-wechat { min-height: 44px; }
}
