/* =============================================================================
   模型 API 页专用样式（api.html）—— 2026-10-12 新增

   🔴 2026-10-12 修「浅色模式下文字看不见」：
     本文件第一版把 #eef4ff / #a8b5d8 / #9ab8ff / rgba(167,197,255,…) 等**深色系
     写死了 28 处**，以为「这页本来就是深色调」。结果用户切到浅色模式时：
     浅色文字压在浅色背景上 → 套餐价、卡片标题、说明条全部几乎不可见。
     → 全部改成 maas.css 的主题变量（:root 深色 / [data-theme="light"] 浅色 都有定义），
        深浅两套自动跟随。

   ⚠️ maas.css 原本没有淡底变量，这里补上（浅色下用低透明度，深色下稍高）。
   ⚠️ 变量来自 maas.css / site-chrome.css；头尾由 site-chrome.js 渲染，
      本文件**不得**写 .w51-nav / .w51-foot。
   ============================================================================= */

/* 淡色底：badge / 说明条用。深色下稍明显，浅色下要很淡才不会糊 */
:root {
  --blue-wash: rgba(79, 133, 255, .18);
  --green-wash: rgba(56, 192, 138, .18);
}
[data-theme="light"] {
  --blue-wash: rgba(42, 111, 255, .10);
  --green-wash: rgba(24, 138, 92, .12);
}

/* ---------------------------------- 区块 ---------------------------------- */
.api-sec { padding: 76px 0; }
.api-sec.alt { background: var(--bg2); }

/* ---------------------------------- 套餐卡 ---------------------------------- */
.plan-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 18px; margin-top: 34px;
}
.plan {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px 24px;
  display: flex; flex-direction: column;
}
/* 推荐档：视觉提上来，但**不做「最划算」之类的效果承诺** */
.plan.is-featured {
  border-color: var(--w51-brand, var(--brand));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 30%, transparent);
}
.plan-flag {
  position: absolute; top: -11px; left: 24px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 11px; border-radius: 999px;
  background: var(--w51-brand, var(--brand)); color: #fff;
}
.plan-top {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.plan-price {
  display: flex; align-items: baseline; gap: 3px;
  font-size: 34px; font-weight: 800; letter-spacing: -.02em;
  color: var(--ink); line-height: 1.1;
}
.plan-price .cur { font-size: 18px; font-weight: 700; }
.plan-price .unit { font-size: 13px; font-weight: 600; color: var(--ink2); margin-left: 2px; }
/* 档位名（体验档 / 主力档 / 全能档）与价格同排 */
.plan-tier { font-size: 15px; font-weight: 700; color: var(--ink); }
.plan-gift {
  font-size: 12.5px; font-weight: 700; color: var(--green);
  padding: 2px 9px; border-radius: 999px;
  background: var(--green-wash); white-space: nowrap;
}
.plan-gift.is-none { color: var(--ink2); background: none; padding: 0; font-weight: 600; }

/* 到账金额 */
.plan-credit {
  margin-top: 10px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--ink2);
}
.plan-credit b { color: var(--ink); font-weight: 700; font-size: 14.5px; }

/* 用量明细：标签灰、数字亮（数字用等宽，避免区间值跳动） */
.plan-spec { margin-top: 14px; display: grid; gap: 13px; }
.plan-spec .k { display: grid; gap: 3px; }
.plan-spec .k span:first-child { font-size: 12.5px; color: var(--ink2); line-height: 1.4; }
.plan-spec .k .v {
  font-size: 17px; font-weight: 700; color: var(--ink);
  line-height: 1.3; letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}

/* 到账量对比条：按 1x / 2.6x / 5.5x 给视觉比例 */
.plan-ratio { margin-top: auto; padding-top: 18px; }
.plan-ratio .k { font-size: 12.5px; color: var(--ink2); margin-bottom: 7px; }
.plan-ratio .bar { height: 6px; border-radius: 999px; overflow: hidden; background: var(--line); }
.plan-ratio .bar i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.plan-ratio .x {
  display: block; margin-top: 6px; font-size: 13px; font-weight: 700;
  color: var(--ink2); font-variant-numeric: tabular-nums;
}
/* 「国产大模型」标注（2026-10-13 用户要求写清楚）
   用户原话：「三个档的价格卡片这里，要写清楚是国产模型」——
   访客看价格时最容易忽略模型范围，所以给它视觉强调而不是一行灰字。 */
.plan-spec .k.plan-domestic {
  margin-top: 4px; padding: 8px 11px;
  border-radius: 9px;
  background: var(--brand-soft, var(--accent-wash, rgba(59,130,246,.1)));
  border: 1px solid color-mix(in srgb, var(--brand, #3b82f6) 26%, transparent);
}
.plan-spec .k.plan-domestic span:first-child { color: var(--ink2); }
.plan-spec .k.plan-domestic .v {
  color: var(--brand, var(--accent-ink, #3b82f6));
  font-size: 15.5px; font-weight: 700; letter-spacing: .01em;
}

.plan-desc { margin-top: 14px; font-size: 14px; color: var(--ink2); line-height: 1.72; }
.plan-cta {
  margin-top: 18px; display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: 999px;
  font-size: 14.5px; font-weight: 700; line-height: 1.2;
  border: 1px solid transparent; transition: all .18s ease;
}
.plan-cta.primary { background: var(--w51-brand, var(--brand)); color: #fff; }
.plan-cta.primary:hover { background: var(--w51-brand-deep, var(--brand2)); }
.plan-cta.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.plan-cta.ghost:hover { border-color: var(--w51-accent, var(--blue)); color: var(--inline); }
/* 2026-11-07：套餐 CTA 从「了解购买方式」的 <a> 改成直接下单的 <button>。
   ⚠️ button 默认带 UA 样式（字体、cursor 不是 pointer、宽度按内容），
   不重置就会比原来的 <a> 窄一截、鼠标移上去不变手型。 */
button.plan-cta {
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
button.plan-cta:focus-visible { outline: 2px solid var(--w51-accent, var(--blue)); outline-offset: 2px; }
button.plan-cta[disabled] { opacity: .6; cursor: default; }

/* 套餐说明（计费单位、有效期等），写在卡片下方而不是塞进每张卡 */
.plan-note {
  margin-top: 22px; padding: 16px 20px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--blue-wash, rgba(79,133,255,.10));
  font-size: 14px; color: var(--ink2); line-height: 1.8;
}
.plan-note b { color: var(--ink); font-weight: 700; }

/* ---------------------------------- 价格表 ---------------------------------- */
/* ⚠️ 窄屏可读性是硬要求：390/360 下表格不能把**页面**撑出横向溢出。
   坑：`.table-scroll` 是块级但默认 width:auto，min-width 的表格会把它的
   内容宽度顶开，导致它自己变宽 → 页面溢出（实测 390px 下 OVERFLOW=37）。
   修法：给滚动容器显式 max-width:100% + min-width:0，让它老老实实当滚动窗口。*/
.table-scroll {
  margin-top: 30px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.api-table {
  width: 100%; min-width: 620px;
  border-collapse: collapse; font-size: 14px;
}
.api-table caption {
  caption-side: top; text-align: left;
  padding: 16px 18px 12px;
  font-size: 14px; color: var(--ink2); line-height: 1.7;
}
.api-table th, .api-table td {
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.api-table thead th {
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--ink2); text-transform: uppercase; white-space: nowrap;
}
.api-table tbody th {
  font-weight: 700; color: var(--ink); white-space: nowrap;
}
.api-table td { color: var(--ink2); }
.api-table tbody tr:last-child th,
.api-table tbody tr:last-child td { border-bottom: none; }
.api-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.api-table .tag-hot {
  display: inline-block; margin-left: 7px;
  font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 5px;
  background: var(--green-wash, rgba(56,192,138,.18)); color: var(--green);
}

/* 窄屏提示条：告诉用户表格可以左右滑 */
.table-hint {
  display: none;
  margin-top: 10px; font-size: 12.5px; color: var(--ink2);
}
@media (max-width: 700px) { .table-hint { display: block; } }

/* ---------------------------------- 步骤 ---------------------------------- */
.step-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-top: 30px;
}
.step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px; padding: 22px 20px;
}
.step-n {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue-wash, rgba(79,133,255,.18)); color: var(--inline);
  font-size: 13.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.step h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 8px; line-height: 1.4; }
.step p { font-size: 14px; color: var(--ink2); line-height: 1.72; }
.step code.inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; padding: 1px 6px; border-radius: 5px;
  background: var(--code); color: var(--inline);
}

/* ---------------------------------- 说明清单 ---------------------------------- */
.api-list { list-style: none; display: grid; gap: 12px; margin-top: 26px; }
.api-list li {
  position: relative; padding-left: 24px;
  font-size: 15px; color: var(--ink2); line-height: 1.75;
}
.api-list li::before {
  content: ''; position: absolute; left: 4px; top: 11px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--w51-accent, var(--blue));
}
.api-list li b { color: var(--ink); font-weight: 700; }

@media (max-width: 640px) {
  .api-sec { padding: 54px 0; }
  .plan-grid { grid-template-columns: 1fr; }
}
