:root {
  color-scheme: light;
  --blue: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-050: #f5f9ff;
  --blue-100: #eff6ff;
  --blue-200: #dbeafe;
  --blue-300: #93c5fd;
  --ink: #18243a;
  --muted: #617086;
  --line: #dce7f1;
  --outline: #39415a;
  --paper: #ffffff;
  --card-shadow: 0 1px 2px rgba(16, 42, 83, 0.04), 0 10px 30px rgba(16, 42, 83, 0.05);
  --card-shadow-lift: 0 1px 2px rgba(16, 42, 83, 0.06), 0 16px 38px rgba(16, 42, 83, 0.09);
}

* {
  box-sizing: border-box;
}

/* 不在 html/body 上做水平裁剪：部分内核会因此把 body 当滚动容器，
   杀死后代 position: sticky（.toc / .topbar）。横向溢出源头各自裁剪。 */
html,
body {
  width: 100%;
  max-width: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Inter",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
}

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

.wrap {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
}

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

.skip-link:focus {
  transform: none;
}

/* ================= 顶部导航（对齐版本14首页） ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(220, 231, 241, 0.9);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
  backdrop-filter: blur(12px) saturate(125%);
}

.nav {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

/* 同 footer:logo 上圈描边+透明填充,深色底下垫浅色小圆角底 */
html.dark .brand-mark {
  background: #e9eefb;
  padding: 3px;
}

.brand .beta {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-left: 2px;
  padding: 0 8px;
  border: 1px solid #b9d3ff;
  border-radius: 999px;
  background: #edf4ff;
  color: #245bd7;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-left: auto;
  color: #47566e;
  font-size: 16px;
  font-weight: 700;
}

.nav-links a {
  padding: 4px 0;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--blue-700);
}

.nav-cta,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--blue-600);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  transition: background 0.18s ease, transform 0.18s ease;
}

.nav-cta:hover,
.primary-link:hover {
  background: var(--blue-700);
  transform: translateY(-1px);
}

/* ================= 页首 Hero（对齐首页幕布视觉） ================= */
.page-hero {
  position: relative;
  overflow: hidden;
  padding: 84px 0 76px;
  background:
    radial-gradient(720px 460px at 88% 8%, rgba(59, 130, 246, 0.08), transparent 62%),
    radial-gradient(560px 420px at 4% 96%, rgba(147, 197, 253, 0.1), transparent 60%),
    linear-gradient(115deg, #f7fbff 0%, #eef6ff 60%, #e7f1ff 100%);
}

/* 点阵纹理，同首页教材幕 */
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(59, 130, 246, 0.07) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at 30% 45%, black, transparent 68%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 45%, black, transparent 68%);
  pointer-events: none;
}

/* 巨型描边水印，同首页 "70+" */
.hero-mark {
  position: absolute;
  right: -1%;
  bottom: -14%;
  font-size: clamp(120px, 18vw, 260px);
  font-weight: 850;
  letter-spacing: -0.05em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px rgba(59, 130, 246, 0.08);
  pointer-events: none;
  user-select: none;
}

.page-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.kicker {
  display: inline-block;
  margin: 0 0 16px;
  color: var(--blue-600);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.16;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.page-hero h1 em {
  font-style: normal;
  color: var(--blue-600);
}

.page-hero p {
  max-width: 44em;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.35vw, 17.5px);
  line-height: 1.85;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

/* 描边标签，同首页教材名标签 */
.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: #fff;
  color: #37455e;
  font-size: 12.5px;
  font-weight: 650;
}

.page-main {
  padding: 64px 0 92px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: start;
  gap: 34px;
}

/* ================= 正文卡片 ================= */
.article,
.contact-panel {
  min-width: 0;
  padding: clamp(26px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--card-shadow);
}

.article-intro {
  margin: 0 0 32px;
  padding: 20px 22px;
  border: 1px solid var(--blue-200);
  border-radius: 16px;
  background: var(--blue-050);
  color: #4d6680;
}

.article-intro p {
  margin: 0 0 10px;
}

.article-intro p:last-child {
  margin-bottom: 0;
}

.article section {
  scroll-margin-top: 96px;
  padding: 0 0 28px;
}

.article section + section {
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.article h2 {
  margin: 0 0 15px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.article h3 {
  margin: 22px 0 10px;
  color: #314762;
  font-size: 17px;
}

.article p,
.article li {
  color: #4e6077;
  font-size: 15px;
  line-height: 1.9;
  text-align: justify;
}

.article p {
  margin: 0 0 13px;
}

.article strong {
  color: #263c57;
}

.article ul,
.article ol {
  margin: 12px 0 18px;
  padding-left: 1.5em;
}

.article a,
.contact-panel a {
  color: var(--blue-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 目录：描边小卡，同首页 mini-sheet 质感 */
.toc {
  position: sticky;
  top: 96px;
  padding: 22px;
  border: 1px solid var(--outline);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--card-shadow);
}

.toc b {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--blue-600);
}

.toc a {
  display: block;
  padding: 7px 0;
  color: #65768a;
  font-size: 13px;
  line-height: 1.45;
}

.toc a:hover {
  color: var(--blue-700);
}

/* ================= 联系我们 ================= */
.contact-panel {
  padding: clamp(26px, 5vw, 48px);
}

.contact-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  margin-bottom: 34px;
}

.contact-heading h2 {
  margin: 0 0 8px;
  font-size: clamp(27px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.contact-heading h2 em {
  font-style: normal;
  color: var(--blue-600);
}

.contact-heading p {
  margin: 0;
  color: var(--muted);
}

.response-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #ecf9f3;
  color: #267356;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.response-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #31c783;
}

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

/* 联系卡：描边卡，同首页 Excel 导入面板 */
.contact-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--outline);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--card-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.contact-card:hover {
  box-shadow: var(--card-shadow-lift);
  transform: translateY(-2px);
}

.contact-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  overflow: hidden;
}

.contact-icon.xhs {
  background: linear-gradient(160deg, #ff4e63 0%, #ff2442 62%, #f01236 100%);
}

.contact-icon.wechat {
  background: linear-gradient(160deg, #2bd97e 0%, #07c160 58%, #059b4e 100%);
}

.contact-icon.group {
  background: linear-gradient(160deg, #63a4ff 0%, #3b82f6 58%, #2563eb 100%);
}

.contact-icon.email {
  background: linear-gradient(160deg, #ffc53d 0%, #f59e0b 55%, #e8890c 100%);
}

.xhs-wordmark {
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2px;
  line-height: 1;
  white-space: nowrap;
}

.contact-logo {
  display: block;
  fill: #fff;
}

.contact-logo-wechat {
  width: 30px;
  height: 30px;
}

.contact-logo-wechat .wechat-eye {
  fill: #07c160;
}

.contact-logo-group {
  width: 29px;
  height: 29px;
}

.contact-logo-group .group-back {
  opacity: 0.8;
}

.contact-logo-email {
  width: 30px;
  height: 30px;
}

.contact-copy {
  min-width: 0;
}

.contact-copy b {
  display: block;
  font-size: 15px;
}

.contact-copy span {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: #fff;
  color: #37455e;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.copy-button:hover {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  padding: 11px 17px;
  border-radius: 999px;
  background: rgba(24, 36, 58, 0.94);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  box-shadow: 0 16px 36px rgba(24, 36, 58, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

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

/* ================= 页脚（对齐版本14首页） ================= */
.site-footer {
  padding: 28px 0 24px;
  border-top: 1px solid rgba(220, 231, 241, 0.46);
  background: rgba(243, 248, 254, 0.92);
  color: #718095;
  font-size: 12px;
}

.footer-row {
  display: flex;
  align-items: center;
  gap: 22px;
}

.footer-row .brand {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  gap: 10px;
}

.footer-row .brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.footer-spacer {
  flex: 1;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a:hover {
  color: var(--blue-700);
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.footer-legal-separator {
  color: #aeb9c8;
}

.icp-record:hover {
  color: var(--blue-700);
}

/* ================= 响应式 ================= */
@media (max-width: 1000px) {
  .footer-row {
    flex-direction: column;
    text-align: center;
  }

  .footer-spacer {
    display: none;
  }

  .footer-links {
    justify-content: center;
  }
}

@media (max-width: 820px) {
  .nav-links {
    display: none;
  }

  .theme-switch {
    margin-left: auto;
  }

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

  .toc {
    display: none;
  }

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

@media (max-width: 700px) {
  .site-footer {
    padding: 18px 0 14px;
  }

  .footer-legal {
    flex-direction: column;
    gap: 6px;
    white-space: normal;
  }

  .footer-legal-separator {
    display: none;
  }
}

@media (max-width: 600px) {
  .wrap {
    width: min(100% - 28px, 1160px);
  }

  .nav {
    min-height: 64px;
    gap: 20px;
  }

  .brand {
    font-size: 17px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .nav-cta {
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
  }

  .page-hero {
    padding: 56px 0 52px;
  }

  .page-hero h1 {
    font-size: clamp(30px, 9.5vw, 42px);
  }

  .page-hero p {
    font-size: 15px;
  }

  .hero-mark {
    bottom: -6%;
    font-size: clamp(90px, 26vw, 150px);
  }

  .page-main {
    padding: 34px 0 64px;
  }

  .article,
  .contact-panel {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .article-intro {
    padding: 16px;
  }

  .article h2 {
    font-size: 20px;
  }

  .article p,
  .article li {
    font-size: 14px;
    line-height: 1.85;
  }

  .contact-heading {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .contact-card {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 15px;
  }

  .contact-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .copy-button {
    padding: 0 11px;
  }
}

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

/* ================= 主题切换（三态：跟随系统/浅色/深色，对齐首页） ================= */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
}

.theme-switch button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8a97ac;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.theme-switch button:hover {
  color: var(--blue-700);
}

.theme-switch button.on {
  background: var(--blue-100);
  color: var(--blue-700);
}

.theme-switch svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ================= 深色模式（方案F 夜空地平线，对齐首页） ================= */
html.dark {
  color-scheme: dark;
  --blue-050: #0d1526;
  --blue-100: #13203a;
  --blue-200: #1e3054;
  --blue-300: #34517e;
  --ink: #e9eefb;
  --muted: #8794b3;
  --line: rgba(148, 168, 220, 0.16);
  --outline: #3d4a6b;
  --paper: #0e1326;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
  --card-shadow-lift: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 38px rgba(0, 0, 0, 0.45);
}

html.dark body {
  background: #05070f;
}

html.dark .topbar {
  background: rgba(5, 7, 15, 0.88);
  border-bottom-color: rgba(148, 168, 220, 0.14);
}

html.dark .brand .beta {
  border-color: #2b4170;
  background: #13203a;
  color: #9dbcff;
}

html.dark .nav-links {
  color: #93a1bc;
}

html.dark .nav-links a:hover,
html.dark .nav-links a[aria-current="page"] {
  color: #9dbcff;
}

html.dark .theme-switch {
  border-color: rgba(148, 168, 220, 0.2);
  background: rgba(14, 19, 38, 0.6);
}

html.dark .theme-switch button {
  color: #8794b3;
}

html.dark .theme-switch button:hover {
  color: #cdd9f2;
}

html.dark .theme-switch button.on {
  background: rgba(111, 162, 255, 0.16);
  color: #9dbcff;
}

html.dark .page-hero {
  background:
    radial-gradient(720px 460px at 88% 8%, rgba(111, 162, 255, 0.08), transparent 62%),
    radial-gradient(560px 420px at 4% 96%, rgba(52, 81, 126, 0.16), transparent 60%),
    linear-gradient(115deg, #070b18 0%, #060a15 60%, #05070f 100%);
}

html.dark .page-hero::before {
  background-image: radial-gradient(rgba(111, 162, 255, 0.08) 1.5px, transparent 1.5px);
}

html.dark .hero-mark {
  -webkit-text-stroke-color: rgba(111, 162, 255, 0.1);
}

html.dark .kicker {
  color: #6fa2ff;
}

html.dark .page-hero h1 em {
  color: #6fa2ff;
}

html.dark .meta-pill {
  background: #0e1326;
  color: #a9bede;
}

html.dark .article,
html.dark .contact-panel {
  background: #0e1326;
}

html.dark .article-intro {
  color: #a9bede;
}

html.dark .article h3 {
  color: #cdd9f2;
}

html.dark .article p,
html.dark .article li {
  color: #a9b6ce;
}

html.dark .article strong {
  color: #dbe4f6;
}

html.dark .article a,
html.dark .contact-panel a {
  color: #9dbcff;
}

html.dark .toc {
  background: #0e1326;
}

html.dark .toc b {
  color: #6fa2ff;
}

html.dark .toc a {
  color: #8794b3;
}

html.dark .toc a:hover {
  color: #9dbcff;
}

html.dark .response-chip {
  background: #10231d;
  color: #7fbfa4;
}

html.dark .contact-card {
  background: #0e1326;
}

html.dark .copy-button {
  background: #121b33;
  color: #a9bede;
}

html.dark .copy-button:hover {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: #fff;
}

html.dark .toast {
  background: rgba(233, 238, 251, 0.95);
  color: #18243a;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

html.dark .site-footer {
  background: rgba(6, 9, 18, 0.92);
  border-top-color: rgba(148, 168, 220, 0.14);
  color: #7c89a5;
}

html.dark .site-footer .brand,
html.dark .footer-row .brand {
  color: #e9eefb;
}

html.dark .footer-links a:hover,
html.dark .icp-record:hover {
  color: #9dbcff;
}

html.dark .footer-legal-separator {
  color: #3d4a6b;
}

/* logo 上圈是描边+透明填充,深色底下会隐形,垫一块浅色小圆角底 */
html.dark .footer-row .brand img {
  background: #e9eefb;
  border-radius: 9px;
  padding: 3px;
}
