/* ==========================================================================
   components.css — 按钮 / 眉标 / 卡片 / 图标块 / 品类块 / 问答 / 键值行 / 手机框
   ========================================================================== */

/* ---- 按钮 ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 15px 30px;
  border-radius: var(--r-pill);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.btn:hover { text-decoration: none; }

/* 主按钮：橙底 + 深字（白字压橙只有 2.07:1，必须用深字） */
.btn--primary {
  background: var(--brand);
  color: var(--on-brand);
}
.btn--primary:hover { background: var(--brand-strong); }

/* 深色按钮：深底 + 白字（20.6:1） */
.btn--ink {
  background: var(--ink);
  color: var(--text-invert);
}
.btn--ink:hover { background: #2e2721; }

/* 次级按钮：白底 + 描边（不用浅灰实心，那看着像禁用） */
.btn--ghost {
  background: var(--surface);
  color: var(--brand-ink);
  box-shadow: inset 0 0 0 1px var(--line-warm);
}
.btn--ghost:hover { box-shadow: inset 0 0 0 2px var(--brand); }

.btn--lg { padding: 17px 36px; font-size: 16px; }
.btn--sm { padding: 11px 22px; font-size: var(--fs-sm); }
.btn--block { display: flex; width: 100%; }

/* ---- 眉标胶囊 ------------------------------------------------------------ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--brand-surface);
  color: var(--brand-ink);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.eyebrow--solid { background: var(--brand); color: var(--on-brand); }
/* 压在首屏插画上的半透明胶囊（底色接近白，字色按浅底取） */
.eyebrow--soft { background: rgba(255, 255, 255, 0.72); color: #8a5a15; }

/* 鼻血版标签 */
.tag-hot {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--text-invert);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

/* ---- 卡片 ---------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm, 14px);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-warm);
}
.card__title {
  font-size: var(--fs-title);
  font-weight: 700;
  color: var(--text);
}
.card__text {
  font-size: var(--fs-sm);
  line-height: 1.75;
  color: var(--text-muted);
}
.card--plan { box-shadow: inset 0 0 0 1px var(--line); }

/* ---- 图标块（橙底 + 深色图形；白图形压橙只有 2.07:1，图形需 ≥3.0） ---- */
.icon-tile {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: var(--on-brand);
}
.icon-tile svg { width: 22px; height: 22px; }

/* ---- 品类卡（插画 + 分类名胶囊 + 口味一行） -------------------------------
   12 张图各不相同，可读性不能指望画面本身：
   压暗幕只负责把 12 张图收成同一个调性，真正保证文字达标的，是分类名那层
   **不透明胶囊底色** —— 图是变量，胶囊是常量。
   ⚠ 别把文字直接压在图上靠「图够暗」过关：换一张亮图就废了，而且截图上很难发现。
   口味文字挂在图**外面**（吃页面底色，不需要额外处理），
   与分类名分工：胶囊回答「这是什么」，正文回答「合不合我口味」。 */
.tile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.tile__media {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  aspect-ratio: 15 / 8;   /* 与出图比例一致（960×512），cover 零裁切 */
  border-radius: var(--r-md);
  background: var(--brand-surface);   /* 图未就绪时的兜底色 */
}
.tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(24, 12, 3, 0.08) 0%,
    rgba(24, 12, 3, 0.34) 55%,
    rgba(24, 12, 3, 0.62) 100%
  );
}
.tile__name {
  position: relative;
  z-index: 1;
  margin: var(--sp-3);
  padding: 5px 15px;
  border-radius: var(--r-pill);
  background: rgba(18, 10, 2, 0.78);
  color: #fff;
  font-size: var(--fs-title);
  font-weight: 700;
  line-height: 1.3;
}
.tile__text {
  font-size: var(--fs-sm);
  line-height: 1.75;
  color: var(--text-muted);
  /* balance 比 pretty 更适合这里：中文没有词边界，pretty 压不住 2 字尾行（「…爽点 / 密集。」）；
     balance 让 2 行长度接近，12 格看上去断在同一高度。
     注意每格是独立块，行宽不一不会牵连相邻格子。 */
  text-wrap: balance;
}

/* ---- 问答条 -------------------------------------------------------------- */
.qa {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.qa__q {
  font-size: var(--fs-title);
  font-weight: 700;
  color: var(--text);
}
.qa__a {
  font-size: var(--fs-sm);
  line-height: 1.85;
  color: var(--text-muted);
}

/* ---- 键值行（左标签 + 右正文） ---- */
.kv {
  display: flex;
  gap: var(--sp-5);
  align-items: flex-start;
  padding-block: var(--sp-4);
}
.kv__key {
  flex: 0 0 180px;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--brand-ink);
}
.kv__val {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--fs-base);
  line-height: 1.95;
  color: var(--text-body);
}
.kv--tight { padding-block: 0; }

/* ---- 手机框 -------------------------------------------------------------- */
.phone {
  position: relative;
  display: block;
  width: 208px;
  padding: 8px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line-device);
}
.phone__screen {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  height: 384px;
  padding: 8px;
  border-radius: 24px;
  background: var(--surface-cream);
  overflow: hidden;
}
.phone--dark .phone__screen {
  background: var(--screen-dark);
  padding: 6px;
}
.phone--lg { width: 360px; padding: 8px; border-radius: 50px; }
.phone--lg .phone__screen { height: 624px; padding: 7px; border-radius: 44px; }

/* 屏内控件 */
.s-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 18px;
  padding-inline: 8px;
  border-radius: 6px;
  background: var(--surface);
}
.phone--lg .s-bar { height: 20px; padding-inline: 10px; }

.s-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}
.s-dots { display: flex; gap: 4px; }
.s-dots i { width: 8px; height: 8px; border-radius: 50%; background: #eedcbf; }

.s-search {
  flex: 0 0 auto;
  height: 18px;
  border-radius: 9px;
  background: var(--surface-sunk);
}

.s-banner {
  flex: 0 0 auto;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-sunk);
}
.s-banner img { width: 100%; height: 100%; object-fit: cover; }
.phone .s-banner { height: 86px; }
.phone--lg .s-banner { height: 120px; border-radius: 12px; }

.s-label {
  flex: 0 0 auto;
  width: 60px;
  height: 8px;
  border-radius: 4px;
  background: var(--brand-surface-2);
}
.phone--lg .s-label { height: 9px; width: 68px; }

.s-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  flex: 1 1 auto;
  align-content: start;
  min-height: 0;
}
.s-grid__item {
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-sunk);
}
.s-grid__item img { width: 100%; height: 100%; object-fit: cover; }
.phone .s-grid__item { aspect-ratio: 3 / 4; }
.phone--lg .s-grid__item { aspect-ratio: 4 / 5; }

.s-chips { flex: 0 0 auto; display: flex; gap: 5px; }
.s-chips i {
  flex: 1 1 0;
  height: 16px;
  border-radius: 8px;
  background: var(--surface-sunk);
}
.s-chips i.is-on { background: var(--brand); }

.s-tab {
  flex: 0 0 auto;
  margin-block-start: auto;
  height: 20px;
  border-radius: 8px;
  background: var(--surface);
}

.s-reader-top,
.s-reader-bot {
  flex: 0 0 auto;
  height: 16px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
}
.s-reader-bot { height: 14px; border-radius: 7px; margin-block-start: auto; }
.s-page {
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #2e2438;
}
.s-page img { width: 100%; height: 100%; object-fit: cover; }

/* ---- 媒体位（等比例，防抖动） ---- */
.media {
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-sunk);
}
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--cover { aspect-ratio: 3 / 4; }
.media--reader { aspect-ratio: 576 / 806; }

/* ==========================================================================
   组件级断点：紧跟组件定义，写在同一个文件里
   ========================================================================== */

@media (max-width: 768px) {
  .kv { flex-direction: column; gap: var(--sp-2); padding-block: var(--sp-4); }
  .kv__key { flex: 0 0 auto; }
}

@media (max-width: 560px) {
  .btn { padding: 14px 24px; }
  .btn--lg { padding: 15px 28px; }
  .card { gap: 12px; }
  /* 390px 下格子只有 173×92，默认的字号会让胶囊吃掉约 1/3 宽度、压住角色 */
  .tile__name { margin: var(--sp-2); padding: 3px 10px; font-size: 13px; }
  .phone--lg { width: min(320px, 100%); }
  .phone--lg .phone__screen { height: 552px; }
}

/* ---- 下载弹窗（download 页）--------------------------------------------
   语义：主按钮是 <button>，.btn 基础样式按 <a> 设计（无背景/边框），
   这里只对 button 元素补重置，不影响全站 <a class="btn">。 */
button.btn {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3);
}
.modal[hidden] { display: none; }
.modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(16, 13, 11, 0.55);
}
.modal__box {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100vh - 2 * var(--sp-3));
  overflow: auto;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  box-shadow: 0 24px 64px rgba(16, 13, 11, 0.28);
}
.modal__close {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface-sunk);
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  appearance: none;
}
.modal__close:hover { background: var(--line-warm); color: var(--text); }
.modal__title { font-size: var(--fs-h3); color: var(--text); }
.modal__lead {
  margin-block-start: var(--sp-2);
  font-size: var(--fs-base);
  color: var(--text-muted);
}
.modal__list {
  display: grid;
  gap: var(--sp-3);
  margin-block-start: var(--sp-4);
}
.dl-opt {
  position: relative;
  display: block;
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  transition: border-color 0.16s ease, background-color 0.16s ease;
}
.dl-opt:hover {
  border-color: var(--brand-mark);
  background: var(--surface-warm);
  text-decoration: none;
}
.dl-opt__tag {
  position: absolute;
  inset-block-start: -10px;
  inset-inline-start: var(--sp-3);
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--text-invert);
  font-size: var(--fs-2xs);
  font-weight: 700;
}
.dl-opt__name {
  display: block;
  font-size: var(--fs-title);
  font-weight: 700;
  color: var(--text);
}
.dl-opt__desc {
  display: block;
  margin-block-start: var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.modal__note {
  margin-block-start: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.7;
}
