/* style.css — 布局骨架（header / hero / section 间距 / footer）。组件规则在 components.css。 */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-body);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-md);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }

.wrap {
  width: min(var(--wrap), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--ink-invert);
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 10px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-header);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  color: var(--ink);
}
.brand-mark { color: var(--accent-deep); flex: 0 0 auto; }
.brand-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .01em;
}

.site-nav { margin-left: auto; }
.site-nav > ul {
  display: flex;
  align-items: center;
  gap: 22px;
}
.site-nav a {
  font-size: var(--fs-sm);
  color: var(--ink-body);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--accent-deep); border-bottom-color: var(--accent); }

/* ---------- nav dropdown ---------- */
.site-nav .dropdown { position: relative; }
.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  vertical-align: middle;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  opacity: .55;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: -14px;
  z-index: 45;
  min-width: 194px;
  max-height: 360px;
  overflow-y: auto;
  padding: 7px 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-header);
}
.dropdown:hover .dropdown-menu { display: block; }
.site-nav .dropdown-menu a {
  display: block;
  padding: 7px 16px;
  border-bottom: 0;
  white-space: nowrap;
}
.site-nav .dropdown-menu a:hover,
.site-nav .dropdown-menu a:focus-visible { background: var(--surface-hover); }

.header-link {
  flex: 0 0 auto;
  font-size: var(--fs-sm);
  color: var(--accent-deep);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--accent);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .18s var(--ease), opacity .18s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { background: var(--bg-hero); }
.hero-grid {
  display: grid;
  grid-template-columns: 49% 1fr;
  align-items: stretch;
}
.hero-copy {
  padding: 41px 60px 20px 51px;
}
.hero-media { min-width: 0; }
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 50%;
}

/* ---------- section rhythm ---------- */
.section { padding: 0; }
.section-title {
  font-family: var(--serif);
  font-size: var(--fs-h2);
  line-height: 1.24;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  letter-spacing: .01em;
}

.section-index { padding: 28px 0 0; }
.section-index .cat-grid { margin-top: 21px; }

.section-starter { padding: 32px 0 0; }
.section-starter .starter-grid { margin-top: 12px; }

.section-stage { padding: 59px 0 0; }
.section-stage .stage-panel { margin-top: 27px; }

.section-scene { padding: 9px 0 0; }
.section-scene .scene-grid { margin-top: 23px; }

.section-note { padding: 70px 0 0; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 39px;
  background: var(--footer);
  color: var(--footer-ink);
  padding: 26px 0 18px;
}
.footer-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 22px 34px;
  align-items: flex-start;
}
.footer-brand { flex: 1 1 240px; min-width: 210px; }
.footer-col { flex: 1 1 170px; min-width: 158px; }
.footer-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .01em;
}
.footer-desc {
  margin-top: 8px;
  font-size: var(--fs-xs);
  color: var(--footer-soft);
  line-height: 1.65;
}
.footer-label {
  font-size: var(--fs-xs);
  color: var(--footer-soft);
  letter-spacing: .12em;
  margin-bottom: 10px;
}
.footer-links { display: grid; gap: 6px; }
.footer-links a {
  font-size: var(--fs-sm);
  color: var(--footer-ink);
  opacity: .82;
  transition: opacity .16s var(--ease);
}
.footer-links a:hover,
.footer-links a:focus-visible { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 20px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(238, 243, 234, .16);
  font-size: 12.5px;
  color: var(--footer-soft);
  line-height: 1.7;
}
.footer-icp { white-space: nowrap; }

/* ---------- focus ---------- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .brand-name { font-size: 18px; }
  .site-nav ul { gap: 16px; }
  .site-nav a { font-size: 13px; }
}

@media (max-width: 1000px) {
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    display: none;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter) 18px;
    box-shadow: var(--shadow-header);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: 0; }
  .site-nav li { width: 100%; }
  .site-nav a {
    display: block;
    width: 100%;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: var(--fs-md);
  }
  .nav-toggle { display: flex; }
  .header-link { display: none; }
  .site-nav .dropdown-menu {
    position: static;
    display: block;
    min-width: 0;
    max-height: none;
    margin: 0;
    padding: 0 0 0 14px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .site-nav .dropdown-menu a {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink-soft);
  }
  .site-nav .caret { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 43px var(--gutter) 24px; }
  .hero-media { order: -1; }
  .hero-media img { height: 320px; }
  .section-title { font-size: 29px; }
  .footer-main { flex-direction: column; gap: 24px; }
  .footer-col { flex: 1 1 auto; min-width: 0; width: 100%; }
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
}

@media (max-width: 700px) {
  :root { --gutter: 20px; }
  .brand-name { font-size: 16.5px; }
  .hero-media img { height: 232px; }
  .hero-copy { padding: 26px var(--gutter) 22px; }
  .section-title { font-size: 24px; line-height: 1.38; }
  .section-index { padding-top: 26px; }
  .section-starter { padding-top: 32px; }
  .section-stage { padding-top: 34px; }
  .section-scene { padding-top: 34px; }
  .section-note { padding-top: 38px; }
  .site-footer { margin-top: 44px; }
  .footer-main { gap: 20px; }
  .footer-links { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
