/* ==========================================================================
   Apple 官网原型 — 基础样式（设计 token / 排版 / 导航 / 页脚）
   说明：此文件只放全站复用的原子样式，页面级布局放在 home.css / product.css
   ========================================================================== */

:root {
  /* 颜色：Apple 官网用色极少，靠留白和灰度层次撑起层次感 */
  --c-black: #000000;
  --c-ink: #1d1d1f;
  --c-white: #ffffff;
  --c-gray: #f5f5f7;
  --c-gray-2: #e8e8ed;
  --c-muted: #6e6e73;
  --c-hairline: #d2d2d7;
  --c-link: #0066cc;
  --c-link-dark: #2997ff;
  --c-link-hover: #0077ed;
  --c-btn: #0071e3;
  --c-btn-hover: #0077ed;

  /* 尺寸 */
  --nav-h: 44px;
  --r-tile: 28px;
  --r-card: 18px;
  --r-pill: 980px;
  --gutter: 12px;
  --content: 1024px;

  /* 字体：优先 SF Pro，Windows 下依次回退到 Inter / 苹方 / 微软雅黑 */
  --font: "SF Pro Display", "SF Pro Text", "Inter", -apple-system,
    BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "微软雅黑", sans-serif;

  /* Apple 的曲线：进出都很快，中段平滑 */
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  color: var(--c-ink);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* 焦点可见：键盘用户需要看得见落点 */
:focus-visible {
  outline: 3px solid rgba(0, 125, 250, 0.6);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   排版尺度
   -------------------------------------------------------------------------- */

.t-hero {
  font-size: clamp(40px, 6.6vw, 80px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
}

.t-tile {
  font-size: clamp(28px, 3.6vw, 48px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0;
}

.t-section {
  font-size: clamp(28px, 3.4vw, 48px);
  line-height: 1.0835;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0;
}

.t-sub {
  font-size: clamp(18px, 1.9vw, 24px);
  line-height: 1.25;
  font-weight: 400;
  letter-spacing: 0.007em;
  margin: 0;
}

.t-eyebrow {
  font-size: 17px;
  line-height: 1.23;
  font-weight: 600;
  letter-spacing: -0.022em;
  margin: 0;
}

.t-body {
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  margin: 0;
}

.t-meta {
  font-size: 14px;
  line-height: 1.42;
  letter-spacing: -0.016em;
  color: var(--c-muted);
  margin: 0;
}

.u-center {
  text-align: center;
}

.u-content {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 22px;
}

/* 深色区块里文字反白 */
.on-dark {
  color: var(--c-white);
}

.on-dark .t-meta {
  color: #a1a1a6;
}

/* --------------------------------------------------------------------------
   链接与按钮
   -------------------------------------------------------------------------- */

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 21px;
  line-height: 1.19;
  letter-spacing: 0.011em;
  color: var(--c-link);
}

.link-arrow:hover {
  text-decoration: underline;
}

.link-arrow::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
  margin-left: 3px;
  margin-top: -1px;
  flex: none;
}

.on-dark .link-arrow {
  color: var(--c-link-dark);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px 28px;
}

.btn {
  display: inline-block;
  background: var(--c-btn);
  color: var(--c-white);
  border-radius: var(--r-pill);
  padding: 11px 22px;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -0.022em;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease);
}

.btn:hover {
  background: var(--c-btn-hover);
  text-decoration: none;
}

.btn--sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn--ghost {
  background: transparent;
  color: var(--c-link);
  border: 1px solid currentColor;
}

.btn--ghost:hover {
  background: var(--c-link);
  color: var(--c-white);
}

.on-dark .btn--ghost {
  color: var(--c-link-dark);
}

.on-dark .btn--ghost:hover {
  background: var(--c-link-dark);
  color: var(--c-black);
  border-color: var(--c-link-dark);
}

/* --------------------------------------------------------------------------
   全局导航（毛玻璃吸顶）
   -------------------------------------------------------------------------- */

.gnav {
  position: sticky;
  top: 0;
  z-index: 9999;
  height: var(--nav-h);
  background: rgba(251, 251, 253, 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.gnav__inner {
  max-width: var(--content);
  height: var(--nav-h);
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gnav__link {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  padding: 0 8px;
  font-size: 12px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}

.gnav__link:hover {
  color: var(--c-black);
  text-decoration: none;
}

/* 图标统一用 currentColor 描边/填充，靠 color 换色 */
.gnav__logo,
.gnav__icon {
  color: rgba(0, 0, 0, 0.8);
}

.gnav__logo:hover,
.gnav__icon:hover {
  color: var(--c-black);
}

.gnav__logo svg,
.gnav__icon svg {
  display: block;
}

.gnav__burger {
  display: none;
}

/* 窄屏：只留 logo / 汉堡 / 购物袋 */
@media (max-width: 900px) {
  .gnav__item--collapse,
  .gnav__logo {
    display: none;
  }

  .gnav__burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 24px;
    height: 44px;
  }

  .gnav__burger span {
    display: block;
    width: 16px;
    height: 1.5px;
    background: rgba(0, 0, 0, 0.8);
    transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
  }

  .gnav.is-open .gnav__burger span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
  }

  .gnav.is-open .gnav__burger span:nth-child(2) {
    opacity: 0;
  }

  .gnav.is-open .gnav__burger span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
  }
}

/* 抽屉菜单 */
.gnav__drawer {
  position: fixed;
  inset: var(--nav-h) 0 auto 0;
  max-height: 0;
  overflow: hidden;
  background: rgba(251, 251, 253, 0.96);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: max-height 0.4s var(--ease);
}

.gnav.is-open .gnav__drawer {
  max-height: 70vh;
  overflow-y: auto;
}

.gnav__drawer ul {
  list-style: none;
  margin: 0;
  padding: 8px 22px 24px;
}

.gnav__drawer li + li {
  border-top: 1px solid var(--c-hairline);
}

.gnav__drawer a {
  display: block;
  padding: 14px 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--c-ink);
}

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */

.gfooter {
  background: var(--c-gray);
  color: var(--c-muted);
  font-size: 12px;
  line-height: 1.3333;
  letter-spacing: -0.01em;
  padding: 17px 0 21px;
}

.gfooter__inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 22px;
}

.gfooter__notes {
  border-bottom: 1px solid var(--c-hairline);
  padding-bottom: 17px;
}

.gfooter__notes p {
  margin: 0 0 9px;
}

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

.gfooter__links {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0 20px;
  padding: 20px 0 0;
}

.gfooter__col h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-ink);
  margin: 0 0 10px;
}

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

.gfooter__col li {
  margin-bottom: 8px;
}

.gfooter__col a {
  color: #424245;
}

.gfooter__col a:hover {
  color: var(--c-ink);
  text-decoration: underline;
}

.gfooter__shop {
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--c-hairline);
}

.gfooter__shop a {
  color: var(--c-link);
}

.gfooter__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 20px;
  margin-top: 17px;
  padding-top: 17px;
  border-top: 1px solid var(--c-hairline);
}

.gfooter__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

.gfooter__legal a,
.gfooter__legal span {
  color: #424245;
  padding-right: 10px;
  border-right: 1px solid var(--c-hairline);
  margin-right: 10px;
}

.gfooter__legal > :last-child {
  border-right: 0;
  margin-right: 0;
  padding-right: 0;
}

/* 移动端页脚折叠：把五列压成两列 */
@media (max-width: 833px) {
  .gfooter__links {
    grid-template-columns: repeat(2, 1fr);
    gap: 0 20px;
  }
}

@media (max-width: 500px) {
  .gfooter__links {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   产品页的二级导航（Local Nav）
   -------------------------------------------------------------------------- */

.lnav {
  position: sticky;
  top: var(--nav-h);
  z-index: 9998;
  height: 52px;
  background: rgba(29, 29, 31, 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lnav__inner {
  max-width: var(--content);
  height: 52px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lnav__title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--c-white);
}

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

.lnav__links a {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.lnav__links a:hover {
  color: var(--c-white);
  text-decoration: none;
}

@media (max-width: 833px) {
  .lnav {
    height: 48px;
  }

  .lnav__inner {
    height: 48px;
  }

  .lnav__links {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   进场动画：一次编排好的落场，不逐块弹跳
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .rise {
    opacity: 0;
    transform: translateY(14px);
    animation: rise 0.9s var(--ease) forwards;
  }

  .rise--2 {
    animation-delay: 0.12s;
  }

  .rise--3 {
    animation-delay: 0.24s;
  }

  .rise--4 {
    animation-delay: 0.36s;
  }

  @keyframes rise {
    to {
      opacity: 1;
      transform: none;
    }
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   当前页高亮
   -------------------------------------------------------------------------- */

.gnav__link[aria-current="page"] {
  color: var(--c-black);
  font-weight: 500;
}

.gnav__drawer a[aria-current="page"] {
  color: var(--c-link);
}

.lnav__links a[aria-current="page"] {
  color: var(--c-white);
}

/* --------------------------------------------------------------------------
   原型提示条：点了尚未实现的链接时给出反馈，避免「点了没反应」
   -------------------------------------------------------------------------- */

.ph-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 10000;
  margin: 0;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  background: rgba(29, 29, 31, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--c-white);
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

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