.hero {
  position: relative;
  padding-top: 40px;
  overflow-x: clip;
}

.hero::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 420px;
  background: linear-gradient(180deg, transparent, var(--color-panel-alt));
  content: '';
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero-copy h1 {
  max-width: 920px;
  margin-top: 18px;
  margin-bottom: 0;
}

.hero-lede {
  max-width: 900px;
  margin-top: 18px;
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 17px;
  line-height: 1.65;
}

.hero-lede strong {
  color: var(--color-text);
  font-weight: 750;
}

.hero-actions {
  margin-top: 24px;
}

.device-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.device-badge-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 0;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--color-panel-alt);
  list-style: none;
}

.device-badge-group a,
.device-badge-group span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  color: var(--color-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.device-badge-group a:hover {
  background: var(--color-panel);
  color: var(--color-text);
}

.device-badge-group svg,
.store-pill svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.device-badge-group svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.store-pill {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 14px 0 11px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-panel);
  color: var(--color-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.store-pill:hover {
  color: var(--color-text);
  border-color: var(--color-muted);
}

.hero-stage {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 40px;
}

.hero-stage .official-shot {
  width: min(360px, 78vw);
}

.hero-stage .official-shot img {
  display: block;
  height: auto;
  background: #fff;
}

.ipad-device {
  position: relative;
  width: min(1040px, 92%);
  aspect-ratio: 4 / 3;
  padding: 20px;
  border-radius: var(--radius-device);
  background: var(--color-text);
  box-shadow: var(--shadow-device);
}

.ipad-device::before {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--color-muted);
  content: '';
  opacity: 0.65;
}

.ipad-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-screen);
  background: linear-gradient(180deg, var(--color-panel-alt), var(--color-panel));
}

.rule-card {
  position: absolute;
  width: 380px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
}

.rule-card-title {
  padding: 16px 20px 8px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rule-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rule-card li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 18px 11px 20px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}

.rule-card code {
  flex: 1;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  text-overflow: clip;
}

.rule-state {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.state-direct {
  background: var(--color-success);
}

.state-reject {
  background: var(--color-muted);
}

.state-proxy {
  background: var(--color-accent);
}

.rule-policy {
  color: var(--color-muted);
}

.rule-chevron {
  width: 8px;
  height: 12px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--color-border);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rule-card-a {
  top: 50px;
  left: 6%;
  z-index: 1;
}

.rule-card-b {
  top: 22px;
  left: 31%;
  z-index: 3;
  box-shadow: var(--shadow-card-raised);
}

.rule-card-c {
  top: 84px;
  left: 56%;
  z-index: 2;
}

.fact-row,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.fact-row-center,
.badge-row-center {
  justify-content: center;
}

.fact-pill,
.badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 5px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-panel);
  color: var(--color-text);
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.badge-accent {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.badge-success {
  border-color: var(--color-success);
  background: var(--color-panel);
  color: var(--color-success);
}

.badge-warning {
  border-color: var(--color-warning);
  background: var(--color-panel);
  color: var(--color-text);
}

.app-store-button {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 8px 20px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-button);
  text-decoration: none;
  transition:
    transform var(--transition-fast),
    background-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.app-store-button:hover {
  background: var(--color-accent-dark);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-1px);
}

.app-store-button svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.app-store-copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.app-store-kicker {
  font-size: 11px;
  font-weight: 650;
  line-height: 1.15;
}

.app-store-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.tabs {
  min-width: 0;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-panel-alt);
}

.tab-button {
  min-height: 42px;
  padding: 8px 17px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-muted);
  font-weight: 700;
}

.tab-button:hover {
  color: var(--color-text);
}

.tab-button[aria-selected='true'] {
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
}

.tab-panel {
  margin-top: 24px;
}

.tab-panel[hidden] {
  display: none;
}

.toc {
  position: sticky;
  top: 20px;
  z-index: 10;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
}

.toc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}

.toc a:hover {
  background: var(--color-panel-alt);
  color: var(--color-text);
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  overflow: clip;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-panel);
  color: var(--color-text);
}

.faq-item summary {
  position: relative;
  padding: 19px 54px 19px 20px;
  cursor: pointer;
  color: var(--color-text);
  font-weight: 750;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  position: absolute;
  top: 50%;
  right: 20px;
  color: var(--color-accent-dark);
  content: '+';
  font-size: 24px;
  line-height: 1;
  transform: translateY(-50%);
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-answer {
  padding: 0 20px 20px;
  color: var(--color-muted);
}

.faq-answer > :last-child {
  margin-bottom: 0;
}

.glossary-card {
  position: relative;
  padding-top: 46px;
}

.glossary-card::before {
  position: absolute;
  top: 24px;
  left: 28px;
  width: 30px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  content: '';
}

.glossary-term {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 750;
}

.article-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  color: var(--color-text);
  text-decoration: none;
}

.article-card:hover {
  color: var(--color-text);
  transform: translateY(-2px);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--color-muted);
  font-size: 13px;
}

.article-card h3 {
  margin-bottom: 12px;
}

.article-card p {
  color: var(--color-muted);
}

.article-link {
  margin-top: auto;
  color: var(--color-accent-dark);
  font-weight: 750;
}

.device-entry-card {
  display: grid;
  min-height: 100%;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  color: var(--color-text);
  text-decoration: none;
}

.device-entry-card:hover {
  color: var(--color-text);
  transform: translateY(-2px);
}

.device-silhouette {
  display: grid;
  width: 84px;
  height: 104px;
  place-items: center;
  border-radius: var(--radius-control);
  background: var(--color-panel-alt);
  color: var(--color-text);
}

.device-silhouette svg {
  width: 48px;
  height: 68px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.device-entry-card p {
  margin-bottom: 0;
  color: var(--color-muted);
}

.official-shot {
  width: min(100%, 280px);
  flex: 0 0 auto;
  margin: 0;
}

.official-shot img,
.official-shot-placeholder {
  display: block;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--color-panel-alt), var(--color-panel));
  box-shadow: var(--shadow-card);
}

/* 官方截图按原图比例满幅显示(750×1334):不锁 aspect-ratio、不 contain,上下不留白条。
   原图是直角屏截图,状态栏 Carrier/电量贴边,圆角只许 ≤10px,大圆角会把角上的内容切掉 */
.official-shot img {
  height: auto;
  aspect-ratio: auto;
  object-fit: fill;
  border-radius: 10px;
}

.official-shot-placeholder {
  position: relative;
  aspect-ratio: 750 / 1334;
}

.official-shot-placeholder::before {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 32%;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--color-border);
  content: '';
  transform: translateX(-50%);
}

.official-shot-placeholder::after {
  position: absolute;
  top: 64px;
  right: 18px;
  left: 18px;
  height: 42%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-panel);
  content: '';
}

.official-shot figcaption {
  margin-top: 12px;
  color: var(--color-muted);
  text-align: center;
  font-size: 13px;
}



.callout {
  padding: 22px 24px;
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: var(--color-accent-soft);
  color: var(--color-text);
}

.callout strong {
  color: var(--color-text);
}

.callout > :last-child {
  margin-bottom: 0;
}

.end-store-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-panel);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
}

.end-store-copy {
  max-width: 680px;
}

.end-store-copy > :last-child {
  margin-bottom: 0;
}

.dl-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 35;
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 11px;
  max-width: min(330px, calc(100vw - 36px));
  padding: 10px 18px 10px 12px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-button-hover);
  text-decoration: none;
}

.dl-fab:hover {
  background: var(--color-accent-dark);
  color: var(--color-on-accent);
  transform: translateY(-1px);
}

.dl-fab-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--color-panel);
  color: var(--color-accent-dark);
}

.dl-fab-icon svg {
  width: 19px;
  height: 19px;
}

.dl-fab-copy {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.dl-fab-copy strong {
  font-size: 14px;
}

.dl-fab-copy span {
  font-size: 12px;
  opacity: 0.86;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.palette-swatch {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-panel);
  color: var(--color-text);
}

.palette-color {
  height: 90px;
}

.swatch-bg {
  background: var(--color-bg);
}

.swatch-panel {
  background: var(--color-panel);
}

.swatch-panel-alt {
  background: var(--color-panel-alt);
}

.swatch-border {
  background: var(--color-border);
}

.swatch-accent {
  background: var(--color-accent);
}

.swatch-accent-dark {
  background: var(--color-accent-dark);
}

.swatch-text {
  background: var(--color-text);
}

.swatch-muted {
  background: var(--color-muted);
}

.swatch-success {
  background: var(--color-success);
}

.swatch-warning {
  background: var(--color-warning);
}

.swatch-error {
  background: var(--color-error);
}

.swatch-band {
  background: var(--color-band);
}

.palette-label {
  display: grid;
  gap: 2px;
  padding: 12px;
  font-size: 13px;
}

.palette-label code {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-muted);
}

.preview-section-heading {
  max-width: 760px;
  margin-bottom: 42px;
}

.type-sample {
  padding-block: 22px;
  border-bottom: 1px solid var(--color-border);
}

.type-sample:last-child {
  border-bottom: 0;
}

.component-stack {
  display: grid;
  gap: 24px;
}

@media (max-width: 960px) {
  .rule-card {
    width: 300px;
  }

  .rule-card li {
    font-size: 12px;
  }

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

@media (max-width: 700px) {
  .end-store-card {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .toc {
    position: static;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 32px;
  }

  .hero-lede {
    font-size: 15px;
  }

  .device-badge-group {
    max-width: 100%;
  }

  .device-badge-group a,
  .device-badge-group span {
    padding-inline: 10px;
    font-size: 12px;
  }

  .hero-stage {
    margin-top: 32px;
  }

  .ipad-device {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-card);
  }

  .ipad-screen {
    border-radius: var(--radius-control);
  }

  .rule-card {
    width: 240px;
    transform: none;
  }

  .rule-card-title {
    padding: 10px 13px 6px;
    font-size: 9px;
  }

  .rule-card li {
    gap: 7px;
    padding: 7px 10px 7px 12px;
    font-size: 9px;
  }

  .rule-card-a {
    top: 24px;
    left: 4%;
  }

  .rule-card-b {
    top: 8px;
    left: 22%;
  }

  .rule-card-c {
    top: 40px;
    left: 40%;
  }

  .tab-list {
    border-radius: var(--radius-control);
  }

  .tab-button {
    flex: 1 1 auto;
  }

  .device-entry-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 17px;
  }

  .device-silhouette {
    width: 64px;
    height: 84px;
  }

  .device-silhouette svg {
    width: 38px;
    height: 56px;
  }

  .official-shot {
    width: min(100%, 260px);
    margin-inline: auto;
  }

  .dl-fab {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 420px) {
  .palette-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-store-button {
    width: 100%;
    justify-content: center;
  }

  .fact-row,
  .badge-row {
    justify-content: center;
  }
}