@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');

:root {
  --ink: #000000;
  --paper: #ffffff;
  --line: #000000;
  --rule: #d9d9d9;
  --mute: #565656;
  --pad: 1.25rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  overflow-wrap: break-word;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 1.1em; }
pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--rule);
}

h1, h2, h3 {
  margin: 0 0 .55em;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.03em;
}

hr {
  border: 0;
  border-top: 2px solid var(--line);
  margin: 0 0 2rem;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  padding: .8rem 1.1rem;
  text-decoration: none;
  font-weight: 500;
}
.skip:focus { left: 0; }

/* 顶部：品牌行 + 胶囊菜单行 */
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  max-width: 100%;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding: .7rem var(--pad);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.025em;
  text-decoration: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .55rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.pill:hover,
.pill:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.contact {
  flex: 0 0 auto;
  background: var(--ink);
  color: var(--paper);
}
.contact:hover,
.contact:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

/* 菜单行用 grid + minmax(0,1fr)，保证窄屏时胶囊行只在自身内滚动 */
.nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .6rem;
  width: 100%;
  max-width: 100%;
  padding: 0 var(--pad) .75rem;
}

.nav > summary {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 44px;
  padding: .5rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  transition: background-color .2s ease, color .2s ease;
}
.nav > summary::-webkit-details-marker { display: none; }
.nav > summary:hover { background: var(--ink); color: var(--paper); }

.pills {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pills::-webkit-scrollbar { display: none; }
.pills > li { flex: 0 0 auto; }

/* Hero：纯文字满屏 */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-height: calc(100svh - 130px);
  padding: 3rem var(--pad) 4rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 140px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  font-size: clamp(3.4rem, 21vw, 18rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.06em;
  color: #ededed;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  will-change: transform;
}

.hero-in {
  position: relative;
  z-index: 1;
  max-width: 52rem;
  min-width: 0;
  text-align: center;
}

.hero h1 {
  margin: 0 0 .45em;
  font-size: clamp(2.1rem, 8vw, 5.5rem);
  line-height: .95;
  letter-spacing: -.045em;
}

.hero-sub {
  max-width: 46ch;
  margin: 0 auto;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: #111;
}

/* 正文区块 */
main > section { scroll-margin-top: 140px; }

main > section:not(.hero):not(.outro) {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem var(--pad);
  border-bottom: 1px solid var(--rule);
}

main > section h2 { font-size: clamp(1.7rem, 5vw, 2.9rem); }
main > section h3 { font-size: clamp(1.2rem, 3.2vw, 1.6rem); }
main > section p,
main > section li { max-width: 68ch; }

main > section figure {
  margin: 2rem 0;
  padding: 1.25rem;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(6px);
}

main > section blockquote {
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--line);
  font-weight: 500;
}

main > section table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
main > section th,
main > section td {
  border-bottom: 1px solid var(--rule);
  padding: .7rem .5rem;
  text-align: left;
  overflow-wrap: anywhere;
}

/* 收尾：左图右栏 */
.outro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem var(--pad) 4rem;
  border-bottom: 1px solid var(--line);
}

.outro > h2,
.outro > hr { grid-column: 1 / -1; }
.outro > h2 {
  margin-bottom: .4em;
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
}

.outro-fig {
  margin: 0;
  padding: 1.5rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(6px);
}

.outro-mark {
  margin: 0;
  font-size: clamp(1.8rem, 6vw, 3.4rem);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.045em;
}

.outro-aside { min-width: 0; }

.outro-aside ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rel;
  border-top: 1px solid var(--line);
}

.outro-aside li {
  counter-increment: rel;
  border-bottom: 1px solid var(--rule);
}

.outro-aside a {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  min-height: 44px;
  padding: .8rem 0;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}
.outro-aside a::before {
  content: counter(rel, decimal-leading-zero);
  min-width: 1.6rem;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: .06em;
  color: var(--mute);
}
.outro-aside a:hover { text-decoration: underline; }

/* 页脚 */
.foot {
  width: 100%;
  max-width: 100%;
  padding: 2.5rem var(--pad) 1.5rem;
  border-top: 2px solid var(--line);
}

.foot-mark {
  margin: 0 0 .9rem;
  font-size: clamp(2rem, 11vw, 8rem);
  font-weight: 700;
  line-height: .85;
  letter-spacing: -.06em;
  white-space: nowrap;
  overflow: hidden;
}

.foot-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.foot-base small {
  font-size: 1rem;
  color: var(--mute);
}

.foot-base a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}
.foot-base a:hover { text-decoration: underline; }

/* 滚动出现 */
.has-reveal main > section {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}
.has-reveal main > section.is-in {
  opacity: 1;
  transform: none;
}

@media (min-width: 900px) {
  :root { --pad: 2.5rem; }

  .nav {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: .9rem;
  }
  .nav > summary { display: none; }

  .pills {
    flex-wrap: wrap;
    overflow: visible;
  }

  .outro {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr);
    align-items: start;
  }

  .outro-aside { justify-self: end; width: 100%; }

  main > section:not(.hero):not(.outro) { padding: 4.5rem var(--pad); }
}

@media (max-width: 380px) {
  :root { --pad: 1rem; }
  .pill { padding: .55rem .85rem; }
  .hero-bg { font-size: clamp(2.9rem, 20vw, 18rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .has-reveal main > section {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-bg { transform: none !important; }
  .pill, .nav > summary { transition: none; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
