/*
 * Createc · 公众号页（/wechat/）
 * 只写本页样式；公共 tokens / base / components 里的类名一律复用。
 */

/* ======================================================================
   01 · 页头
   ====================================================================== */

.wx-hero {
  padding-top: clamp(28px, 4vw, 56px);
  padding-bottom: clamp(64px, 8vw, 120px);
  overflow: clip;
}

.wx-hero__grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.wx-hero > .wrap { position: relative; z-index: 1; }

.wx-hero__head { display: grid; gap: var(--s-5); }

.wx-hero__title { margin-top: clamp(12px, 1.4vw, 20px); }

.wx-hero__lede {
  font-size: var(--fs-lg);
  line-height: 1.65;
  color: var(--fg-2);
  max-width: 34em;
}

.wx-hero__lede::before {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  margin-bottom: var(--s-4);
  background: var(--accent);
}

@media (min-width: 900px) {
  .wx-hero__head {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: end;
  }
  .wx-hero__lead { grid-column: span 7; }
  .wx-hero__lede {
    grid-column: 9 / span 4;
    padding-bottom: 8px;
  }
}

/* ======================================================================
   02 · 手机样机工作台
   ====================================================================== */

.wx-studio {
  position: relative;
  margin-top: clamp(40px, 5.5vw, 72px);
  padding: clamp(18px, 2.4vw, 32px);
  display: grid;
  gap: clamp(28px, 3.4vw, 48px) clamp(20px, 2.6vw, 40px);
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'tabs'
    'stage'
    'notes';
  background: var(--card);
  border: 1px solid var(--bd);
  --tick: var(--bd-strong);
}

.wx-studio__tabs { grid-area: tabs; min-width: 0; }
.wx-studio__stage { grid-area: stage; min-width: 0; }
.wx-notes { grid-area: notes; min-width: 0; }

.wx-studio__cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  color: var(--fg-mute);
}
.wx-studio__cap span { color: var(--accent-fg); }

.wx-tabs {
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

/* ---- 样例卡（也是 tab） ---- */

.wx-tab {
  --cut: 12px;
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 13px 16px 15px;
  text-align: left;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: 2px;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}

/* 切角上的 1px 斜线 */
.wx-tab::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: var(--cut);
  height: var(--cut);
  background: linear-gradient(45deg,
    transparent calc(50% - .6px),
    var(--bd) calc(50% - .6px),
    var(--bd) calc(50% + .6px),
    transparent calc(50% + .6px));
  pointer-events: none;
}

.wx-tab:hover { border-color: var(--bd-strong); }

.wx-tab[aria-selected='true'] {
  border-color: var(--accent);
  background: var(--white);
}
.wx-tab[aria-selected='true']::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}
.wx-tab[aria-selected='true']::after {
  background: linear-gradient(45deg,
    transparent calc(50% - .6px),
    var(--accent) calc(50% - .6px),
    var(--accent) calc(50% + .6px),
    transparent calc(50% + .6px));
}

/* clip-path 会裁掉默认 outline，用内描边保证键盘可见 */
.wx-tab:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.wx-tab__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2);
}

.wx-tab__no,
.wx-tab__type {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--ls-mono);
  line-height: 1.5;
  color: var(--fg-mute);
}
.wx-tab__no { font-size: var(--fs-mono); }
.wx-tab[aria-selected='true'] .wx-tab__no { color: var(--accent-fg); }

.wx-tab__title {
  font-size: 16px;
  font-weight: var(--fw-bold);
  line-height: 1.35;
  letter-spacing: -.005em;
  color: var(--fg);
}

.wx-tab__desc {
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--fg-mute);
}

.wx-studio__note {
  margin-top: var(--s-3);
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--fg-mute);
}

/* ---- 手机上方的控制条 ---- */

.wx-studio__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
}

.wx-studio__bar {
  width: min(375px, 88vw, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.wx-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-left: -2px;
  padding: 0 2px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--fg);
}

.wx-switch__track {
  position: relative;
  width: 40px;
  height: 22px;
  border: 1px solid var(--bd-strong);
  border-radius: 999px;
  background: var(--paper-2);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.wx-switch__dot {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fg-mute);
  transition: transform var(--dur) var(--ease), background-color var(--dur-fast) var(--ease);
}

.wx-switch[aria-checked='true'] .wx-switch__track {
  background: var(--accent);
  border-color: var(--accent);
}
.wx-switch[aria-checked='true'] .wx-switch__dot {
  transform: translateX(18px);
  background: var(--white);
}
.wx-switch[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.wx-studio__hint {
  font-size: 11px;
  line-height: 1.5;
  color: var(--fg-mute);
  text-align: right;
}

/* ---- 手机样机 ---- */

.phone {
  width: min(375px, 88vw, 100%);
  outline: none;
}
.phone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 54px;
}

.phone__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 375 / 760;
  padding: 9px;
  background: linear-gradient(160deg, var(--graphite-2), var(--graphite) 58%);
  border-radius: clamp(38px, 10vw, 54px);
  box-shadow: var(--shadow-2), inset 0 0 0 1px rgba(255, 255, 255, .08);
}

/* 侧键 */
.phone__frame::before {
  content: '';
  position: absolute;
  right: -2px;
  top: 27%;
  width: 2px;
  height: 62px;
  border-radius: 2px;
  background: var(--graphite-2);
}

.phone__screen {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: clamp(30px, 8.4vw, 45px);
  background: var(--white);
  isolation: isolate;
}

.phone__island {
  position: absolute;
  top: 9px;
  left: 50%;
  z-index: 6;
  width: 88px;
  height: 24px;
  border-radius: 999px;
  background: var(--ink);
  transform: translateX(-50%);
}

.phone__status {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 22px;
  color: var(--ink);
  background: var(--white);
}

.phone__time {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}

.phone__sysicons {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
}

.phone__bar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  height: 44px;
  padding: 0 8px;
  background: var(--white);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 7%, var(--white));
}

.phone__back,
.phone__more {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--ink);
}
.phone__more { justify-self: end; }

.phone__bar-title {
  text-align: center;
  font-size: 15px;
  font-weight: var(--fw-medium);
  color: var(--ink);
  letter-spacing: .01em;
}

.phone__viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--white);
  overflow: hidden;
}

.phone__iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--white);
  opacity: 1;
  transition: opacity 220ms var(--ease);
}
.phone__iframe.is-fading { opacity: 0; }

.phone__home {
  position: absolute;
  left: 50%;
  bottom: 6px;
  z-index: 6;
  width: 120px;
  height: 4px;
  border-radius: 999px;
  background: var(--ink);
  opacity: .78;
  transform: translateX(-50%);
  pointer-events: none;
}

/* 样例缺失时的占位 */
.phone__empty {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--s-3);
  padding: var(--s-6);
  text-align: center;
  background: var(--white);
  color: var(--fg-mute);
}
.phone__empty .mono { color: var(--accent-fg); }
.phone__empty-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: var(--fw-black);
  color: var(--fg);
}
.phone__empty-text { font-size: var(--fs-xs); line-height: 1.7; max-width: 22em; }

.wx-studio__meta {
  width: min(375px, 88vw, 100%);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: 10px;
  color: var(--fg-mute);
}

/* ---- 标注层 ---- */

.wx-anno {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
.phone.is-anno .wx-anno { opacity: 1; }

.wx-anno__box {
  position: absolute;
  top: 0;
  left: 0;
  border: 1.5px dashed var(--accent);
  border-radius: 2px;
  background: var(--accent-soft);
  will-change: transform, width, height;
}

/* 编号挂在框线左侧的文章留白里，不压正文 */
.wx-anno__no {
  position: absolute;
  top: -1px;
  left: -1px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: .02em;
  transform: translateX(-100%);
}

/* 贴到左边缘的区块（通栏图等）：编号放回框内 */
.wx-anno__box.is-edge .wx-anno__no {
  transform: none;
}

/* ---- 右侧版式拆解 ---- */

.wx-notes__title {
  margin-top: var(--s-3);
  font-size: clamp(20px, 1.7vw, 24px);
  line-height: 1.3;
  letter-spacing: -.01em;
}

.wx-notes__list {
  margin-top: var(--s-4);
  border-top: 1px solid var(--bd);
}

.wx-note {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 4px 8px;
  width: 100%;
  min-height: 44px;
  padding: 11px 4px 11px 0;
  text-align: left;
  color: var(--fg);
  border-bottom: 1px solid var(--bd);
  transition: box-shadow var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}

.wx-note:hover,
.wx-note.is-current {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

/* 当前样例里没有这个区块 */
.wx-note.is-na { opacity: .42; }

.wx-note:focus-visible { outline-offset: -2px; }

.wx-note__no {
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--ls-mono);
  color: var(--fg-mute);
}
.wx-note:hover .wx-note__no,
.wx-note.is-current .wx-note__no { color: var(--accent-fg); }

.wx-note__body { display: block; min-width: 0; }

.wx-note__name {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  line-height: 1.5;
}

.wx-note__text {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--fg-mute);
}

.wx-notes__foot {
  margin-top: var(--s-3);
  font-size: 11px;
  line-height: 1.6;
  color: var(--fg-mute);
}

/* ======================================================================
   03 · 我们做的公众号内容
   ====================================================================== */

.wx-offer__list {
  margin-top: clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--bd-strong);
}

.wx-offer__row {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 2px var(--s-4);
  align-items: start;
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--bd);
  transition: background-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.wx-offer__icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--bd-strong);
  border-radius: 2px;
  color: var(--fg-2);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.wx-offer__no {
  display: none;
  align-self: center;
  color: var(--fg-mute);
}

.wx-offer__name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: var(--fw-bold);
  line-height: 1.3;
  letter-spacing: -.005em;
}

.wx-offer__text {
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--fg-2);
  max-width: 62ch;
}

@media (min-width: 900px) {
  .wx-offer__row {
    grid-template-columns: 56px 44px 260px minmax(0, 1fr);
    gap: 0 var(--s-5);
    align-items: center;
    padding: 22px 0;
  }
  .wx-offer__icon {
    grid-row: auto;
    width: 48px;
    height: 48px;
  }
  .wx-offer__no { display: block; }
  .wx-offer__name { font-size: clamp(19px, 1.5vw, 23px); }
  .wx-offer__row:hover {
    background: var(--card);
    box-shadow: inset 3px 0 0 var(--accent);
  }
  .wx-offer__row:hover .wx-offer__icon {
    color: var(--accent-fg);
    border-color: var(--accent);
  }
  .wx-offer__row:hover .wx-offer__no { color: var(--accent-fg); }
}

/* ======================================================================
   04 · 交付与流程（石墨黑）
   ====================================================================== */

.wx-flow .sec__head { margin-bottom: clamp(32px, 4vw, 56px); }

.wx-flow__grid {
  display: grid;
  gap: clamp(36px, 5vw, 64px);
}

.wx-flow__cap { color: var(--fg-mute); }

.wx-deliver__list {
  margin-top: var(--s-4);
  border-top: 1px solid var(--bd-strong);
}

.wx-deliver__list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: var(--s-3);
  padding: 15px 0;
  border-bottom: 1px solid var(--bd);
}

.wx-deliver__no {
  padding-top: 4px;
  font-size: 12px;
  color: var(--accent-fg);
}

.wx-deliver__name {
  font-size: 17px;
  font-weight: var(--fw-bold);
  line-height: 1.4;
}

.wx-deliver__list p {
  margin-top: 3px;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--fg-mute);
}

.wx-steps { display: grid; gap: var(--s-6); }

.wx-step {
  position: relative;
  padding-top: 18px;
  border-top: 2px solid var(--bd-strong);
}

.wx-step::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 36px;
  height: 2px;
  background: var(--accent);
}

.wx-step__no {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-mono);
  color: var(--accent-fg);
}

.wx-step__name {
  margin-top: var(--s-2);
  font-size: 19px;
  line-height: 1.3;
}

.wx-step p {
  margin-top: 6px;
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--fg-mute);
}

.wx-flow__cta {
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: var(--s-5);
  border-top: 1px solid var(--bd);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}

.wx-flow__cta-text {
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--fg-2);
  max-width: 36em;
}

@media (min-width: 900px) {
  .wx-flow__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(40px, 6vw, 96px);
  }
  .wx-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
}

/* ======================================================================
   05 · 断点：把三栏摊开
   ====================================================================== */

@media (min-width: 720px) {
  .wx-studio {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      'tabs tabs'
      'stage notes';
    align-items: start;
  }
  .wx-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wx-tab__title { font-size: 15px; }
  .wx-studio__stage { justify-self: center; }
  .wx-notes { padding-top: var(--s-2); }
}

@media (min-width: 1200px) {
  .wx-studio {
    grid-template-columns: minmax(240px, 300px) auto minmax(300px, 360px);
    grid-template-areas: 'tabs stage notes';
    justify-content: space-between;
    align-items: start;
  }
  .wx-tabs { grid-template-columns: minmax(0, 1fr); }
  .wx-tab__title { font-size: 16px; }
  .wx-studio__stage { justify-self: stretch; }
}

/* 手机 / 窄屏：工作台不占内边距，样机尽量大 */
@media (max-width: 719px) {
  .wx-studio {
    padding: 0;
    border: 0;
    background: transparent;
    margin-top: var(--s-6);
  }
  .wx-studio.ticks::before { display: none; }
  .wx-studio__bar { width: min(375px, 88vw); }
  .wx-studio__hint { max-width: 16em; }
  .wx-studio__note { max-width: 34em; }
  .wx-studio__meta { width: min(375px, 88vw); font-size: 10px; }
  .wx-notes { margin-top: var(--s-2); }

  /* 未选中的样例只留类型和标题，让样机尽早出现；选中项再展开说明 */
  .wx-tabs { gap: 6px; }
  .wx-tab { padding: 10px 14px 12px; gap: 3px; }
  .wx-tab__title { font-size: 15px; }
  .wx-tab__desc { display: none; }
  .wx-tab[aria-selected='true'] .wx-tab__desc { display: block; margin-top: 2px; }
}

/* ======================================================================
   06 · 减弱动效
   ====================================================================== */

@media (prefers-reduced-motion: reduce) {
  .wx-anno,
  .phone__iframe,
  .wx-switch__dot { transition: none; }
}
