/* ==========================================================================
   Apple 官网原型 — 产品详情页（iPhone）
   ========================================================================== */

/* 锚点跳转时避开两级吸顶导航 */
.phero[id],
.feature[id],
.compare[id],
.lineup[id] {
  scroll-margin-top: 108px;
}

/* --------------------------------------------------------------------------
   产品首屏
   -------------------------------------------------------------------------- */

.phero {
  position: relative;
  overflow: hidden;
  background: var(--c-black);
  color: var(--c-white);
  text-align: center;
  padding: 64px 22px 0;
}

.phero__eyebrow {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.022em;
  margin: 0 0 6px;
}

.phero__title {
  font-size: clamp(46px, 7vw, 86px);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -0.017em;
  margin: 0;
}

.phero__price {
  font-size: 19px;
  line-height: 1.4;
  color: #a1a1a6;
  margin: 14px 0 0;
}

.phero__actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.phero__note {
  margin-top: 16px;
  font-size: 12px;
  color: #86868b;
}

.phero__visual {
  margin-top: 44px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.phero .iphone {
  width: calc(clamp(300px, 44vh, 460px) * 0.4853);
  height: clamp(300px, 44vh, 460px);
}

/* --------------------------------------------------------------------------
   规格条
   -------------------------------------------------------------------------- */

.specbar {
  background: var(--c-black);
  color: var(--c-white);
  padding: 0 22px 72px;
}

.specbar__inner {
  max-width: var(--content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-top: 4px;
}

.spec {
  border-top: 1px solid #38383a;
  padding-top: 18px;
}

.spec__k {
  font-size: 12px;
  color: #86868b;
  margin: 0 0 6px;
}

.spec__v {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0;
  line-height: 1.25;
}

.spec__d {
  margin: 6px 0 0;
  font-size: 13px;
  color: #a1a1a6;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   通用区块
   -------------------------------------------------------------------------- */

.feature {
  padding: 100px 22px;
}

.feature--light {
  background: var(--c-gray);
  color: var(--c-ink);
}

.feature--dark {
  background: var(--c-black);
  color: var(--c-white);
}

.feature--white {
  background: var(--c-white);
}

.feature__head {
  max-width: 660px;
  margin: 0 auto 52px;
  text-align: center;
}

.feature__head h2 {
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0 0 14px;
}

.feature__head p {
  margin: 0;
  font-size: 19px;
  line-height: 1.42;
  color: var(--c-muted);
}

.feature--dark .feature__head p {
  color: #a1a1a6;
}

/* 三栏卡片 */
.cards {
  max-width: var(--content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--c-white);
  border-radius: var(--r-card);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 白底区块里用浅灰卡，否则白卡在白底上看不见 */
.feature--white .card {
  background: var(--c-gray);
}

.feature--dark .card {
  background: #17171a;
}

.card h3 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0;
}

.card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.47;
  color: var(--c-muted);
}

.feature--dark .card p {
  color: #a1a1a6;
}

.card__glyph {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  background: linear-gradient(140deg, #f5f5f7, #e2e2e8);
  color: var(--c-ink);
}

.card__glyph svg {
  display: block;
}

.feature--dark .card__glyph {
  background: linear-gradient(140deg, #2c2c31, #1d1d21);
  color: #f5f5f7;
}

/* 左右分栏 */
.split {
  max-width: var(--content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.split__copy h2 {
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0 0 14px;
}

.split__copy p {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--c-muted);
}

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

.split__copy li {
  font-size: 15px;
  line-height: 1.5;
  padding: 9px 0;
  border-top: 1px solid var(--c-hairline);
  color: var(--c-ink);
}

/* 反向分栏：视觉在左，文案在右 */
.split--reverse .split__visual {
  order: -1;
}

/* --------------------------------------------------------------------------
   相机模组（CSS 绘制）
   -------------------------------------------------------------------------- */

.camera {
  width: min(320px, 78%);
  aspect-ratio: 1;
  margin: 0 auto;
  /* 相机模组自身宽度有上限，所以用 vw 夹紧来近似「自身宽度的 8%」 */
  padding: clamp(15px, 5.2vw, 26px);
  border-radius: 30%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8%;
  background: linear-gradient(148deg, #57575f 0%, #2b2b31 45%, #16161a 100%);
  box-shadow: 0 40px 70px -30px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.camera__lens {
  border-radius: 50%;
  background: radial-gradient(
    circle at 36% 30%,
    #4c4c55 0%,
    #16161a 52%,
    #000 100%
  );
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.09) inset,
    0 0 18px rgba(0, 0, 0, 0.7);
}

.camera__flash {
  border-radius: 50%;
  width: 62%;
  aspect-ratio: 1;
  align-self: center;
  justify-self: center;
  background: radial-gradient(circle at 40% 34%, #fff8e6 0%, #d9cfa8 60%, #8f8a75 100%);
  box-shadow: 0 0 14px rgba(255, 240, 200, 0.35) inset;
}

/* --------------------------------------------------------------------------
   机型阵容
   -------------------------------------------------------------------------- */

.lineup {
  max-width: var(--content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  align-items: end;
}

.model {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.model h3 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0;
}

.model__price {
  font-size: 14px;
  color: var(--c-muted);
  margin: -10px 0 0;
}

/* 机型阵容：三款手机高矮不同，宽度一律按 0.4853 的比例显式换算 */
.model .iphone {
  width: auto;
}

.model--tall .iphone,
.model--mid .iphone,
.model--short .iphone {
  height: clamp(240px, 28vw, 400px);
  width: calc(clamp(240px, 28vw, 400px) * 0.4853);
}

.model--mid .iphone {
  height: clamp(220px, 25vw, 350px);
  width: calc(clamp(220px, 25vw, 350px) * 0.4853);
}

.model--short .iphone {
  height: clamp(205px, 23vw, 325px);
  width: calc(clamp(205px, 23vw, 325px) * 0.4853);
}

.swatches {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14) inset;
}

.swatch--titanium {
  background: linear-gradient(140deg, #d8d5ce, #9b968c);
}

.swatch--blue {
  background: linear-gradient(140deg, #5c7fa3, #2f4a66);
}

.swatch--black {
  background: linear-gradient(140deg, #4a4a4f, #1c1c1f);
}

.swatch--silver {
  background: linear-gradient(140deg, #ffffff, #d9d9de);
}

.swatch--gold {
  background: linear-gradient(140deg, #f0e2c8, #c9b48c);
}

.swatch--pink {
  background: linear-gradient(140deg, #f7d6e0, #dfa6bb);
}

/* --------------------------------------------------------------------------
   机型对比
   -------------------------------------------------------------------------- */

.compare {
  max-width: var(--content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* 卡片底色跟随所在区块，避免浅灰区块里灰卡隐形、白区块里白卡隐形 */
.compare__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 32px 20px;
  border-radius: var(--r-card);
  background: var(--c-white);
}

.feature--light .compare__item {
  background: var(--c-white);
}

.feature--white .compare__item {
  background: var(--c-gray);
}

.feature--dark .compare__item {
  background: #17171a;
}

.feature--dark .compare__item h3 {
  color: var(--c-white);
}

.feature--dark .compare__item p,
.feature--dark .compare__price {
  color: #a1a1a6;
}

.compare__item .iphone {
  width: calc(clamp(180px, 19vw, 260px) * 0.4853);
  height: clamp(180px, 19vw, 260px);
  margin-bottom: 8px;
}

.compare__item h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0;
}

.compare__item p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--c-muted);
}

.compare__price {
  font-size: 14px;
  color: var(--c-ink);
  margin-top: auto;
}

/* --------------------------------------------------------------------------
   收尾 CTA
   -------------------------------------------------------------------------- */

.cta {
  background: var(--c-gray);
  color: var(--c-ink);
  text-align: center;
  padding: 90px 22px;
}

.cta h2 {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.09;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0 0 18px;
}

.cta p {
  margin: 0 0 24px;
  font-size: 17px;
  color: var(--c-muted);
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 833px) {
  .feature {
    padding: 64px 22px;
  }

  .specbar__inner,
  .cards,
  .lineup,
  .compare {
    grid-template-columns: 1fr;
  }

  .specbar__inner {
    gap: 26px;
  }

  .split {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .lineup {
    gap: 48px;
  }

  /* 单列时三款手机统一高度，宽度必须同步改，否则会被拉变形 */
  .model--tall .iphone,
  .model--mid .iphone,
  .model--short .iphone {
    height: 260px;
    width: calc(260px * 0.4853);
  }

  .phero {
    padding-top: 48px;
  }
}

@media (max-width: 480px) {
  .phero__actions {
    flex-direction: column;
    align-items: center;
  }
}

/* ==========================================================================
   分类页扩展组件
   ========================================================================== */

/* 浅色首屏（AirPods、配件这类白色产品用浅底更好看） */
.phero--light {
  background: var(--c-gray);
  color: var(--c-ink);
}

.phero--light .phero__price {
  color: var(--c-muted);
}

.phero--light .phero__note {
  color: #86868b;
}

/* 浅色规格条 */
.specbar--light {
  background: var(--c-gray);
  color: var(--c-ink);
}

.specbar--light .spec {
  border-top-color: var(--c-hairline);
}

.specbar--light .spec__k,
.specbar--light .spec__d {
  color: var(--c-muted);
}

/* 对比卡里的各类设备尺寸：让 compare 能当通用「机型阵容」用 */
.compare__item .macbook {
  width: clamp(190px, 21vw, 290px);
}

.compare__item .ipad {
  width: clamp(160px, 18vw, 240px);
}

.compare__item .watch__case {
  width: clamp(104px, 11.5vw, 146px);
}

.compare__item .watch__band {
  height: clamp(36px, 4.4vw, 56px);
}

.compare__item .tv {
  width: clamp(180px, 21vw, 280px);
}

.compare__item .homepod {
  width: clamp(62px, 7.5vw, 92px);
}

.compare__item .airpods .bud {
  width: clamp(46px, 5vw, 66px);
}

.compare__item .airpods .bud__stem {
  height: clamp(62px, 7vw, 92px);
}

.compare__item .airtag,
.compare__item .puck {
  width: clamp(90px, 11vw, 132px);
}

/* 静态搜索框（技术支持页原型） */
.searchbar {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border: 1px solid var(--c-hairline);
  border-radius: 12px;
  background: var(--c-white);
}

.searchbar svg {
  flex: none;
  color: var(--c-muted);
}

.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 17px;
  letter-spacing: -0.022em;
  color: var(--c-ink);
}

.searchbar input::placeholder {
  color: var(--c-muted);
}

/* 一行文字 + 若干个跳转入口（分类页底部用） */
.linkrow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 32px;
}

/* 首屏里的工具区（技术支持页的搜索框） */
.phero__util {
  max-width: 520px;
  margin: 30px auto 0;
}

/* 首屏没有产品图时，底部要留出自己的内边距 */
.phero--nopad {
  padding-bottom: 84px;
}

/* 多个设备并排展示 */
.devrow {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
}

/* HomePod mini 比 HomePod 小一圈 */
.homepod--mini {
  width: clamp(48px, 6vw, 74px);
}
