/* SA2 Help Hub — Apple.com 风格（对齐 install/get.css） */

:root {
  --ap-bg: #ffffff;
  --ap-bg-alt: #f5f5f7;
  --ap-text: #1d1d1f;
  --ap-secondary: #6e6e73;
  --ap-link: #0066cc;
  --ap-link-hover: #0077ed;
  --ap-blue: #0071e3;
  --ap-blue-hover: #0077ed;
  --ap-border: #d2d2d7;
  --ap-code-bg: #f5f5f7;
  --ap-selected: #e8f1fc;
  --ap-nav-bg: rgba(251, 251, 253, 0.82);
  --ap-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
  --ap-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ap-radius-tile: 18px;
  --ap-pill: 980px;
  --ap-max: 980px;
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  background: var(--ap-bg);
  color: var(--ap-text);
  font-family: var(--ap-font);
  line-height: 1.47059;
  margin: 0;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ap-link);
  text-decoration: none;
}

a:hover {
  color: var(--ap-link-hover);
}

button,
input {
  font: inherit;
}

/* —— 顶栏 —— */
.hub-nav {
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: var(--ap-nav-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 50;
}

.hub-nav__inner {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--ap-max);
  min-height: 48px;
  padding: 0 22px;
  gap: 1rem;
}

.hub-nav__lead {
  align-items: baseline;
  display: inline-flex;
  gap: 1rem;
  min-width: 0;
}

.casstk-home {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none !important;
}

.casstk-wordmark__cas { color: #003366; }
.casstk-wordmark__stk { color: #000; }

.casstk-home:hover,
.casstk-home:hover .casstk-wordmark__cas {
  color: #003366;
}

.casstk-home:hover .casstk-wordmark__stk {
  color: #000;
}

.hub-nav__brand {
  align-items: baseline;
  color: var(--ap-text);
  display: inline-flex;
  gap: 0.55rem;
  text-decoration: none !important;
}

.hub-nav__mark {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hub-nav__ver {
  color: var(--ap-secondary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.hub-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.hub-nav__links a {
  color: var(--ap-text);
  font-size: 12px;
  opacity: 0.88;
  text-decoration: none !important;
}

.hub-nav__links a:hover {
  opacity: 1;
}

/* —— Hero —— */
.hub-hero {
  background: linear-gradient(180deg, #fbfbfd 0%, var(--ap-bg-alt) 100%);
  padding: 2.75rem 1.5rem 2.1rem;
  text-align: center;
}

.hub-hero__eyebrow {
  color: var(--ap-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

.hub-hero__brand {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0;
}

.hub-hero__product {
  font-size: clamp(1.2rem, 2.6vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0.35rem 0 0.65rem;
}

.hub-hero__lead {
  color: var(--ap-secondary);
  font-size: 17px;
  font-weight: 400;
  margin: 0 auto;
  max-width: 34em;
}

.hub-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.hub-pill {
  align-items: center;
  border-radius: var(--ap-pill);
  display: inline-flex;
  font-size: 14px;
  font-weight: 400;
  justify-content: center;
  min-width: 7rem;
  padding: 0.55rem 1.2rem;
  text-decoration: none !important;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hub-pill:hover {
  text-decoration: none !important;
}

.hub-pill--primary {
  background: var(--ap-blue);
  color: #fff !important;
}

.hub-pill--primary:hover {
  background: var(--ap-blue-hover);
  color: #fff !important;
}

.hub-pill--ghost {
  background: transparent;
  border: 1px solid var(--ap-border);
  color: var(--ap-blue) !important;
}

.hub-pill--ghost:hover {
  border-color: var(--ap-blue);
  background: var(--ap-selected);
}

/* —— 内容区 —— */
.hub-page {
  margin: 0 auto;
  max-width: var(--ap-max);
  padding: 1.75rem 22px 2.5rem;
}

.hub-zones {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 1.5rem;
}

.hub-zone {
  background: var(--ap-bg-alt);
  border: 1px solid transparent;
  border-radius: var(--ap-radius-tile);
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 7.5rem;
  padding: 1.15rem 1.2rem;
  text-decoration: none !important;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.hub-zone:hover {
  background: #fff;
  border-color: var(--ap-border);
  color: inherit;
  transform: translateY(-1px);
}

.hub-zone__badge {
  color: var(--ap-blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hub-zone__title {
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0;
}

.hub-zone__desc {
  color: var(--ap-secondary);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

.hub-cmd {
  background: var(--ap-bg-alt);
  border-radius: var(--ap-radius-tile);
  margin: 0 0 1.35rem;
  padding: 1rem 1.15rem;
}

.hub-cmd__row {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.hub-cmd__label {
  color: var(--ap-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hub-cmd__copy {
  background: #fff;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-pill);
  color: var(--ap-blue);
  cursor: pointer;
  font-size: 13px;
  padding: 0.28rem 0.85rem;
}

.hub-cmd__copy:hover {
  border-color: var(--ap-blue);
  background: var(--ap-selected);
}

.hub-cmd__code {
  color: var(--ap-text);
  font-family: var(--ap-mono);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.hub-search {
  margin: 0 0 1.75rem;
}

.hub-search__input {
  background: #fff;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-pill);
  color: var(--ap-text);
  min-height: 2.85rem;
  outline: none;
  padding: 0 1.1rem 0 2.65rem;
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236e6e73' stroke-width='1.6'%3E%3Ccircle cx='8' cy='8' r='5.5'/%3E%3Cpath d='M12.5 12.5 16 16'/%3E%3C/svg%3E");
  background-position: 1.05rem 50%;
  background-repeat: no-repeat;
  background-size: 18px;
}

.hub-search__input:focus {
  border-color: var(--ap-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.hub-search__input::placeholder {
  color: #86868b;
}

.hub-section {
  margin: 0 0 2.1rem;
  scroll-margin-top: 72px;
}

.hub-section__head {
  margin-bottom: 0.85rem;
}

.hub-section__title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.hub-section__lead {
  color: var(--ap-secondary);
  font-size: 14px;
  margin: 0.25rem 0 0;
}

.hub-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hub-tile {
  background: var(--ap-bg-alt);
  border: 1px solid transparent;
  border-radius: var(--ap-radius-tile);
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 7rem;
  padding: 1.1rem 1.15rem;
  position: relative;
  text-decoration: none !important;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.hub-tile:hover {
  background: #fff;
  border-color: var(--ap-border);
  color: inherit;
  transform: translateY(-1px);
}

.hub-tile__title {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0;
  padding-right: 3rem;
}

.hub-tile__desc {
  color: var(--ap-secondary);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.hub-tile__badge {
  background: var(--ap-selected);
  border-radius: var(--ap-pill);
  color: var(--ap-blue);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.55rem;
  position: absolute;
  right: 0.85rem;
  top: 0.85rem;
}

.hub-tile.is-hidden {
  display: none;
}

.hub-section.is-empty {
  display: none;
}

.hub-empty {
  color: var(--ap-secondary);
  display: none;
  margin: 0 0 1.25rem;
  text-align: center;
}

.hub-empty.is-visible {
  display: block;
}

.hub-links {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--ap-secondary);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 0.65rem 1.25rem;
  padding: 1.25rem 0 0.5rem;
}

.hub-links a {
  color: var(--ap-link);
}

.hub-foot {
  color: #86868b;
  font-size: 12px;
  padding: 0.5rem 0 1.5rem;
}

.hub-foot code {
  font-family: var(--ap-mono);
  font-size: 11px;
}

@media (max-width: 820px) {
  .hub-nav__inner {
    flex-wrap: wrap;
    align-items: center;
    padding: 6px 14px 2px;
    row-gap: 0;
  }

  .hub-nav__links {
    flex: 1 0 100%;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .hub-nav__links::-webkit-scrollbar {
    display: none;
  }

  .hub-nav__links a {
    font-size: 14px;
    padding: 10px 14px 10px 0;
    white-space: nowrap;
  }

  .hub-hero {
    padding: 1.5rem 1rem 1.15rem;
  }

  .hub-pill {
    min-height: 44px;
    min-width: 0;
  }

  .hub-page {
    padding: 1.15rem 16px 5.5rem;
  }

  .hub-zones {
    grid-template-columns: 1fr;
  }

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

  .hub-cmd__row {
    align-items: flex-start;
    gap: 0.5rem;
  }

  .hub-cmd__code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hub-tile,
  .hub-zone,
  .hub-pill {
    transition: none;
  }
}
