/* ============================================================================
 * qyapiworkbuddyweb · style.css
 *
 * 对外客户端页（/client/）的完整样式：顶部导航、首页（Hero / 客户端支持 /
 * 定价与估算 / 使用说明 / FAQ）、我的额度（概览卡 / 统计卡 / 趋势 / 记录）、
 * 联系客服，以及生成配置、公告中心、AI 对话三个弹窗。
 *
 * 视觉语言与线上站保持一致：深色靛紫底 + 紫罗兰主色 + 发丝描边 + 大圆角；
 * 数字一律等宽，中文用系统栈（不引外链字体：CSP 限死同源，且首屏更快）。
 * 全部选择器均为同源静态样式，页面无内联脚本、无内联事件处理器。
 * ========================================================================== */

/* ------------------------------------------------------------ 设计令牌 -- */
:root {
  --purple: #724BFF;
  --purple-light: #A78BFA;
  --purple-dark: #583ED3;
  --purple-gradient: linear-gradient(135deg, #724BFF, #583ED3);
  --green: #28B894;
  --green-light: #32E6B9;
  --orange: #ff9500;
  --red: #ff3b30;
  --blue: #007AFF;
  --gray: #8e8e93;

  --bg: #252736;
  --bg-light: #2E3044;
  --surface: #252735;
  --surface-alt: #1E1B3A;
  --elevated: rgba(255, 255, 255, 0.04);
  --elevated-2: rgba(255, 255, 255, 0.07);

  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-light: rgba(114, 75, 255, 0.2);

  --text: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-dim: rgba(255, 255, 255, 0.45);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.25);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  /* 页面内容区统一宽度：顶栏 / 首页 / 我的额度 / 页脚共用同一个值。
     以前「我的额度」面板是单独的 960px，比首页窄一截，看着不整齐；
     统一到令牌后各页自然对齐，改宽度也只需改这一处。 */
  --container: 1180px;
  /* 联系客服是阅读型页面，刻意窄一些（正文行长更舒适），不跟随 --container */
  --container-narrow: 980px;

  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* 原生控件的绘制基线：下拉弹层、滚动条、日期选择器等由系统绘制，
     不看页面背景色，只认 color-scheme。缺了它 Windows 上 select 弹层就是浅色菜单。
     ✓ 同时在 meta[name=color-scheme] 与 .form-input option 上兜底（见下）。 */
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: linear-gradient(180deg, #252736 0%, #1E1B3A 100%) fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--purple-light); text-decoration: none; }
a:hover { color: var(--text); }

button { font-family: inherit; }

code, pre, .mono { font-family: var(--font-mono); }

[hidden] { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

/* ------------------------------------------------------------ 加载遮罩 -- */
.loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #252736 0%, #1E1B3A 100%);
  transition: opacity .35s ease, visibility .35s ease;
}
.loading-overlay.done { opacity: 0; visibility: hidden; }
.loading-box { text-align: center; }
.loading-spinner {
  width: 42px; height: 42px; margin: 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.loading-text { margin-top: 14px; color: var(--text-dim); font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- 图标 -- */
.icon { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon svg { width: 100%; height: 100%; }
.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 16px; height: 16px; }
.icon-lg { width: 20px; height: 20px; }
.c-purple { color: var(--purple-light); }
.c-green { color: var(--green); }
.c-orange { color: var(--orange); }
.c-red { color: var(--red); }
.c-dim { color: var(--text-dim); }

/* ------------------------------------------------------------ 顶部导航 -- */
.topbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(30, 27, 58, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.topbar-inner {
  max-width: var(--container); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px;
}
.topbar-logo {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--text); font-size: 16px; font-weight: 700; letter-spacing: .3px;
  flex: none;
}
.logo-mark { width: 30px; height: 30px; display: inline-flex; }
.logo-mark img { width: 100%; height: 100%; display: block; }

.topbar-slogan {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 149, 0, 0.1);
  border: 1px solid rgba(255, 149, 0, 0.25);
  border-radius: 999px;
  color: #ffb74d; font-size: 12px; cursor: pointer;
  transition: background .2s ease, transform .2s ease;
  white-space: nowrap;
}
.topbar-slogan svg { width: 14px; height: 14px; }
.topbar-slogan b { color: #ffd08a; font-weight: 700; }
.topbar-slogan:hover { background: rgba(255, 149, 0, 0.18); transform: translateY(-1px); }

.topbar-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.topbar-nav .btn { padding: 7px 13px; font-size: 13px; }
.nav-chat-btn, .nav-contact-btn, .nav-notice-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px; cursor: pointer;
  transition: all .2s ease;
}
.nav-chat-btn svg, .nav-contact-btn svg, .nav-notice-btn svg { width: 14px; height: 14px; }
.nav-chat-btn:hover, .nav-contact-btn:hover, .nav-notice-btn:hover {
  color: var(--text); border-color: var(--border-light); background: var(--elevated);
}
.nav-contact-btn.active { color: var(--purple-light); border-color: var(--border-light); background: rgba(114, 75, 255, 0.14); }
.nnb-dot {
  position: absolute; top: 4px; right: 4px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 2px rgba(30, 27, 58, 0.9);
}
.nav-buy-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: var(--purple-gradient);
  border-radius: var(--radius-sm);
  color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 2px 10px rgba(114, 75, 255, 0.35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.nav-buy-btn svg { width: 14px; height: 14px; }
.nav-buy-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(114, 75, 255, 0.5); }
.nb-tag {
  position: absolute; top: -8px; right: -8px;
  padding: 1px 6px; border-radius: 999px;
  background: var(--orange); color: #241a00;
  font-size: 10px; font-weight: 700;
}

/* ------------------------------------------------------------ 通用按钮 -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--purple-gradient); color: #fff; box-shadow: 0 2px 10px rgba(114, 75, 255, 0.3); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(114, 75, 255, 0.45); }
.btn-success { background: linear-gradient(135deg, #28B894, #1f9a7c); color: #fff; }
.btn-success:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(40, 184, 148, 0.4); }
.btn-warning { background: linear-gradient(135deg, #ff9500, #e07c00); color: #241a00; }
.btn-warning:hover:not(:disabled) { transform: translateY(-1px); }
.btn-ghost { background: var(--elevated); border-color: var(--border); color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--border-light); background: var(--elevated-2); }
.btn-large { padding: 12px 26px; font-size: 15px; }

/* ------------------------------------------------------------ 布局容器 -- */
.main { max-width: var(--container); margin: 0 auto; padding: 28px 20px 60px; }
.page-section { display: none; animation: fadeUp .35s ease both; }
.page-section.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.info-section {
  margin-top: 28px; padding: 22px 24px;
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.info-section > h3 {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 16px; font-size: 16px; font-weight: 600;
}
.info-section > h3 .icon-lg { margin-top: -1px; }
.info-list { margin: 0; padding-left: 20px; color: var(--text-secondary); }
.info-list li { margin: 7px 0; }
.info-list code {
  padding: 2px 6px; border-radius: 5px;
  background: rgba(255, 255, 255, 0.07); color: var(--purple-light); font-size: 12px;
}

/* ------------------------------------------------------------ 公告栏 -- */
.home-notice { margin-bottom: 20px; }
.notice-bar {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(114, 75, 255, 0.16), rgba(88, 62, 211, 0.08));
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-secondary); font-size: 13px;
}
.notice-bar-icon { color: var(--purple-light); margin-top: 2px; }
.notice-bar-body { flex: 1; min-width: 0; }
.notice-bar-title { color: var(--text); font-weight: 600; margin-bottom: 2px; }
.notice-bar-text { white-space: pre-wrap; word-break: break-word; }
.notice-bar-close {
  background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 2px;
  display: inline-flex;
}
.notice-bar-close svg { width: 16px; height: 16px; }
.notice-bar-close:hover { color: var(--text); }
/* 多条公告时的「下一条」按钮 + 计数（1/3）：单条公告不渲染这个元素 */
.notice-bar-nav {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-dim); font-size: 11px; cursor: pointer;
  transition: all .2s ease;
}
.notice-bar-nav svg { width: 14px; height: 14px; }
.notice-bar-nav:hover { color: var(--text); border-color: var(--border-light); background: var(--elevated-2); }
.notice-bar-count { font-family: var(--font-mono); }

/* ---------------------------------------------------------------- Hero -- */
.hero { position: relative; }
.hero-model-layer {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: var(--radius-lg);
}
/* 物理词块层：模型名浮在 Hero 之上，只做氛围，不占位、不可点 */
.model-chip {
  position: absolute;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.38);
  font-family: var(--font-mono); font-size: 11px; white-space: nowrap;
  opacity: .6;
  animation: chipFloat 9s ease-in-out infinite;
}
@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
.hero-left {
  position: relative; z-index: 1;
  padding: 40px 36px;
  background: radial-gradient(120% 120% at 0% 0%, rgba(114, 75, 255, 0.18) 0%, rgba(30, 27, 58, 0) 60%), var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.hero-icon {
  width: 120px; height: 120px; margin-bottom: 18px;
  /* 图标换成「暗色圆底 + 云纹」之后，原来的紫色 dropout 光斑会糊成一圈紫边，
     改成中性投影；想回紫色改这一个值即可。 */
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.5));
  transition: transform .35s ease;
}
.hero-icon img { width: 100%; height: 100%; display: block; }
.hero-icon:hover { transform: scale(1.03); }
.hero h1 { margin: 0 0 10px; font-size: 34px; font-weight: 800; letter-spacing: 1px; }
.hero p { margin: 0 0 16px; color: var(--text-secondary); font-size: 15px; }

.hero-typewriter {
  display: inline-flex; align-items: center;
  min-height: 26px; margin-bottom: 18px;
  color: var(--purple-light); font-family: var(--font-mono); font-size: 14px;
}
.typewriter-cursor { animation: blink 1s step-end infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.badge {
  padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid transparent;
}
.badge-purple { background: rgba(114, 75, 255, 0.15); border-color: rgba(114, 75, 255, 0.35); color: var(--purple-light); }
.badge-green { background: rgba(40, 184, 148, 0.13); border-color: rgba(40, 184, 148, 0.32); color: var(--green-light); }
.badge-blue { background: rgba(0, 122, 255, 0.13); border-color: rgba(0, 122, 255, 0.32); color: #6db4ff; }
.badge-orange { background: rgba(255, 149, 0, 0.13); border-color: rgba(255, 149, 0, 0.32); color: #ffb74d; }

.hero-highlights { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.highlight-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
}
.highlight-icon { display: inline-flex; color: var(--purple-light); }
.highlight-icon svg { width: 16px; height: 16px; }
.highlight-text strong { font-size: 13px; font-weight: 600; }

/* 快速开始 */
.quick-guide {
  padding: 18px 20px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}
.guide-header h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.guide-steps { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.guide-step {
  flex: 1; min-width: 190px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color .2s ease, transform .2s ease;
}
.guide-step:hover { border-color: var(--border-light); transform: translateY(-2px); }
.guide-step-num {
  flex: none; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--purple-gradient); color: #fff;
  font-size: 13px; font-weight: 700;
}
.guide-step-info { flex: 1; min-width: 0; }
.guide-step-info strong { display: block; font-size: 13px; }
.guide-step-info p { margin: 1px 0 0; color: var(--text-dim); font-size: 12px; }
.guide-step-btn {
  flex: none; padding: 5px 12px;
  background: rgba(114, 75, 255, 0.16);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  color: var(--purple-light); font-size: 12px; font-weight: 600;
}
.guide-step-btn:hover { background: rgba(114, 75, 255, 0.28); color: #fff; }
.guide-step-arrow { display: flex; align-items: center; color: var(--text-dim); }
.guide-step-done {
  flex: none; padding: 5px 12px; border-radius: 999px;
  background: rgba(40, 184, 148, 0.16); border: 1px solid rgba(40, 184, 148, 0.35);
  color: var(--green-light); font-size: 12px; font-weight: 600;
}

/* -------------------------------------------------------- 支持的客户端 -- */
.client-support-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.client-card {
  padding: 18px;
  background: var(--elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  transition: border-color .2s ease, transform .2s ease;
}
.client-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.client-icon { margin-bottom: 10px; }
.client-card h4 { margin: 0 0 6px; font-size: 15px; }
.client-card p { margin: 0 0 12px; color: var(--text-dim); font-size: 13px; }
.client-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 3px 9px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); font-size: 11px; font-family: var(--font-mono);
}
.client-note {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 0 0; color: var(--text-dim); font-size: 13px;
}

/* ------------------------------------------------------------ 定价体系 -- */
#billing-section > h3 { cursor: pointer; user-select: none; margin-bottom: 0; }
#billing-content { margin-top: 16px; }
.billing-hint { margin-left: auto; color: var(--text-dim); font-size: 12px; font-weight: 400; }
.billing-chevron { color: var(--text-dim); transition: transform .2s ease; }
#billing-section.collapsed .billing-chevron { transform: rotate(-90deg); }
#billing-section.collapsed #billing-content { display: none; }

.billing-formula {
  padding: 14px 16px; margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.bf-title { color: var(--text); font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.bf-body code { color: var(--purple-light); font-size: 12px; }
.bf-note { margin-top: 8px; color: var(--text-dim); font-size: 12px; }

.pricing-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pricing-head h4 { margin: 0; font-size: 15px; }
.pricing-tools { margin-left: auto; display: flex; gap: 8px; }
.pricing-tools .form-input { width: 220px; }
.pricing-tools .btn { padding: 8px 14px; font-size: 13px; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.15);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  position: sticky; top: 0;
  padding: 11px 14px; text-align: left;
  background: rgba(30, 27, 58, 0.96);
  color: var(--text-dim); font-size: 12px; font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary); vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }
.data-table .mono-num { font-family: var(--font-mono); color: var(--text); }
.empty-cell { text-align: center; color: var(--text-dim); padding: 26px 14px !important; }
.model-name { color: var(--text); font-weight: 600; }
.model-id { color: var(--text-dim); font-family: var(--font-mono); font-size: 11px; }
.cap-list { display: flex; flex-wrap: wrap; gap: 4px; }
.cap {
  padding: 1px 6px; border-radius: 5px; font-size: 10px;
  background: rgba(114, 75, 255, 0.14); color: var(--purple-light);
}
.cap.gray { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); }
.cap.ok { background: rgba(40, 184, 148, 0.14); color: var(--green-light); }
.cap.warn { background: rgba(255, 149, 0, 0.13); color: #ffb74d; }
/* 倍率列：生效价大字 + 折扣标签 + 划线牌价（悬停给时段说明） */
.rate { cursor: help; }
.rate b { color: var(--text); font-family: var(--font-mono); }
.rate-base { color: var(--text-dim); font-size: 12px; margin-left: 2px; }
.dim-text { color: var(--text-dim); font-size: 12px; }
.pricing-note { margin: 0 0 12px; color: var(--text-dim); font-size: 12px; }

/* ---------------------------------------------------------------- FAQ -- */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); overflow: hidden; background: var(--elevated); }
.faq-q {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; background: none; border: none;
  color: var(--text); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer;
}
.faq-q:hover { background: var(--elevated-2); }
.faq-chevron { margin-left: auto; color: var(--text-dim); transition: transform .2s ease; }
.faq-chevron svg { width: 16px; height: 16px; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 16px 14px; color: var(--text-secondary); font-size: 13px; line-height: 1.75; }
.faq-item.open .faq-a { display: block; }
.faq-a code { padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); color: var(--purple-light); font-size: 12px; }

/* ------------------------------------------------------------ 表单通用 -- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.form-input {
  width: 100%; padding: 10px 13px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; font-family: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-input::placeholder { color: rgba(255, 255, 255, 0.3); }
.form-input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(114, 75, 255, 0.18); }
.form-input.large { padding: 13px 15px; font-size: 15px; font-family: var(--font-mono); }

/* 下拉（估算器的模型选择 / 日志筛选 / AI 对话模型）：
   弹层是系统画的，页面背景管不到它，所以两层都写死深色——
   ① select 自身声明 color-scheme，让系统按深色绘制弹层；
   ② option 显式给底色/字色，兜底那些忽略 ① 的浏览器。 */
select.form-input { color-scheme: dark; }
select.form-input option,
select.form-input optgroup {
  background-color: #2A2746;
  color: var(--text);
}
select.form-input option:checked,
select.form-input option:hover {
  background-color: var(--purple);
  color: #fff;
}
.form-hint { margin-top: 6px; color: var(--text-dim); font-size: 12px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.error-msg {
  margin-bottom: 16px; padding: 11px 14px;
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.3);
  border-radius: var(--radius-sm);
  color: #ff8a80; font-size: 13px; white-space: pre-wrap;
}

/* ------------------------------------------------- 我的额度：统一面板 -- */
/* 整页只有一块面板，内部纵向分区；区块之间是发丝分割线而不是卡片间距，
   目的是避免出现「一块一块」的割裂感（对齐线上站的排版观感）。 */
.quota-panel {
  max-width: var(--container); margin: 0 auto;
  background: linear-gradient(170deg, rgba(42, 39, 70, 0.9) 0%, rgba(34, 31, 62, 0.92) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.qp-head { padding: 24px 26px 18px; }
.qp-head h2 { margin: 0 0 6px; font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.qp-head p { margin: 0; color: var(--text-dim); font-size: 13px; }

.qp-block { padding: 20px 26px; border-top: 1px solid var(--border-subtle); }
.qp-block-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.qp-block-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.qp-block-sub { margin-left: auto; color: var(--text-dim); font-size: 12px; }

/* 余额区 */
.qp-balance {
  position: relative; display: flex; gap: 24px; align-items: flex-start;
  padding: 22px 26px;
  background: linear-gradient(160deg, rgba(58, 42, 132, 0.5) 0%, rgba(40, 30, 90, 0.25) 100%);
}
.qp-balance-main { flex: 1; min-width: 0; }
.qp-balance-label { display: flex; align-items: center; gap: 7px; color: var(--text-dim); font-size: 11.5px; letter-spacing: .6px; }
.qp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-light); box-shadow: 0 0 0 3px rgba(50, 230, 185, 0.16); }
.qp-balance-value { display: flex; align-items: baseline; gap: 7px; margin: 8px 0 14px; }
.qp-balance-value span { font-family: var(--font-mono); font-size: 34px; font-weight: 700; line-height: 1; }
.qp-balance-value small { color: var(--text-dim); font-size: 12px; }
.qp-progress { max-width: 420px; }

/* Base URL 行与 API Key 行**同构**：标题用 .qp-label、内容框用 .qp-input-wrap + .form-input、
   右侧按钮用 .qp-eye、描述用 .qp-hint —— 全部复用，不另起一套样式，
   这样以后调整输入框外观时两行会自动保持一致。 */
.qp-progress-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: var(--text-dim); font-size: 12px; }
.qp-progress-head span:last-child { text-align: right; }
.qp-balance-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.qp-balance-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.qp-balance-actions .btn { padding: 8px 15px; font-size: 13px; }
.qp-status { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* 查询表单 */
.qp-label { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.qp-input-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.qp-input-wrap { position: relative; flex: 1; min-width: 240px; }
.qp-input-wrap .form-input { padding-right: 42px; font-family: var(--font-mono); font-size: 13.5px; }
.qp-eye {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  display: inline-flex; padding: 5px; border: none; border-radius: 6px;
  background: none; color: var(--text-dim); cursor: pointer;
}
.qp-eye svg { width: 16px; height: 16px; }
.qp-eye:hover { color: var(--text); background: var(--elevated-2); }
/* 地址不可用时禁用右侧按钮（不改外观尺寸，避免行高跳动） */
.qp-eye:disabled { opacity: .35; cursor: not-allowed; }
.qp-submit { flex: none; padding: 10px 26px; }
.qp-input-row .btn-ghost { flex: none; padding: 10px 18px; }
.qp-hint { margin-top: 9px; color: var(--text-dim); font-size: 12px; }
.qp-form .error-msg { margin: 14px 0 0; }

/* 紧凑指标条 */
.qp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.qp-stat {
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.qp-stat-label { color: var(--text-dim); font-size: 11.5px; margin-bottom: 5px; }
.qp-stat-value { color: var(--text); font-family: var(--font-mono); font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Tokens 格里的「约 X 亿」补充：淡灰 + 小一档 + 降字重，读起来是主数值的注脚而不是并列信息。
   父级是 nowrap + ellipsis，万一主数值本身很长，省略号会落在整行末尾（截掉注脚）
   —— 比让文字溢出/撑破四列网格要好。 */
.qp-stat-sub { margin-left: 6px; color: var(--text-dim); font-size: 12px; font-weight: 500; }

/* 日志工具条与页脚 */
.qp-log-tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.qp-log-tools .form-input { width: auto; min-width: 112px; padding: 7px 11px; font-size: 12.5px; }
.qp-log-tools .btn { padding: 7px 14px; font-size: 12.5px; }
.qp-foot { padding: 16px 26px 20px; }
.qp-foot .info-list { color: var(--text-dim); font-size: 12.5px; }
.qp-foot .info-list li { margin: 5px 0; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.pill-ok { background: rgba(40, 184, 148, 0.14); color: var(--green-light); border: 1px solid rgba(40, 184, 148, 0.3); }
.pill-warn { background: rgba(255, 149, 0, 0.14); color: #ffb74d; border: 1px solid rgba(255, 149, 0, 0.3); }
.pill-bad { background: rgba(255, 59, 48, 0.14); color: #ff8a80; border: 1px solid rgba(255, 59, 48, 0.3); }
.pill-dim { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); border: 1px solid var(--border); }

.progress-bar { height: 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%;
  background: var(--purple-gradient);
  border-radius: 999px;
  transition: width .6s cubic-bezier(.2, .8, .2, 1), background .3s ease;
}
.progress-fill.warn { background: linear-gradient(135deg, #ff9500, #e07c00); }
.progress-fill.bad { background: linear-gradient(135deg, #ff3b30, #c62828); }

/* ------------------------------------------------------------ 趋势图 -- */
.trend-wrap {
  padding: 10px 4px; border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.16); border: 1px solid var(--border-subtle);
}
#query-trendChart { display: block; width: 100%; height: 220px; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; color: var(--text-dim); font-size: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }

/* --------------------------------------------------------- 模型分布条 -- */
.model-bars { display: flex; flex-direction: column; gap: 10px; }
.model-bar-row { display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto; gap: 12px; align-items: center; }
.model-bar-name { color: var(--text-secondary); font-size: 13px; font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-bar-track { height: 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.model-bar-fill { height: 100%; background: var(--purple-gradient); border-radius: 999px; }
.model-bar-val { color: var(--text); font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }

/* ------------------------------------------------------------ 日志区 -- */
.logs-summary { margin-bottom: 12px; color: var(--text-dim); font-size: 12px; }
.logs-summary b { color: var(--text); font-family: var(--font-mono); }
.logs-table td { font-family: var(--font-mono); font-size: 12px; }
.status-ok { color: var(--green-light); }
.status-bad { color: #ff8a80; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; color: var(--text-dim); font-size: 13px; }

/* ------------------------------------------------------------ 联系客服 -- */
.contact-page { max-width: var(--container-narrow); margin: 0 auto; }
.contact-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.contact-heading-icon {
  width: 48px; height: 48px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: rgba(114, 75, 255, 0.16); color: var(--purple-light);
}
.contact-heading-icon svg { width: 24px; height: 24px; }
.contact-heading h2 { margin: 0 0 4px; font-size: 20px; }
.contact-heading p { margin: 0; color: var(--text-dim); font-size: 13px; }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.contact-details {
  padding: 22px;
  background: var(--elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
}
.contact-status { display: inline-flex; align-items: center; gap: 7px; color: var(--green-light); font-size: 12px; font-weight: 600; }
.contact-status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green-light);
  box-shadow: 0 0 0 3px rgba(50, 230, 185, 0.15);
}
.contact-details h3 { margin: 12px 0 6px; font-size: 18px; }
.contact-muted { margin: 0 0 16px; color: var(--text-dim); font-size: 13px; }
.contact-qq-line { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--text-dim); font-size: 13px; }
.contact-qq-line strong { color: var(--text); font-family: var(--font-mono); font-size: 17px; }
.contact-copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--elevated-2); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 12px; cursor: pointer;
}
.contact-copy-btn svg { width: 13px; height: 13px; }
.contact-copy-btn:hover { color: var(--text); border-color: var(--border-light); }
.contact-hours { display: flex; align-items: center; gap: 7px; color: var(--text-dim); font-size: 12px; }
.contact-hours svg { width: 14px; height: 14px; }
.contact-qr { margin: 0; padding: 16px; background: var(--elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); text-align: center; }
.contact-qr img { width: 100%; max-width: 260px; height: auto; border-radius: var(--radius); }
.contact-qr figcaption { display: flex; flex-direction: column; gap: 3px; margin-top: 12px; font-size: 12px; color: var(--text-dim); }
.contact-qr figcaption strong { color: var(--text); font-size: 13px; }
.contact-safe-tip {
  display: flex; align-items: flex-start; gap: 9px;
  margin-top: 18px; padding: 13px 16px;
  background: rgba(255, 149, 0, 0.08); border: 1px solid rgba(255, 149, 0, 0.22);
  border-radius: var(--radius); color: var(--text-secondary); font-size: 12.5px;
}
.contact-safe-tip svg { width: 16px; height: 16px; color: #ffb74d; flex: none; margin-top: 2px; }

/* ---------------------------------------------------------------- 页脚 -- */
.footer { border-top: 1px solid var(--border-subtle); }
.footer-inner {
  max-width: var(--container); margin: 0 auto; padding: 22px 20px;
  display: flex; align-items: center; gap: 8px; justify-content: center;
  color: var(--text-dim); font-size: 12px;
}
.footer-brand { color: var(--text-secondary); font-weight: 600; }
.footer-sep { opacity: .5; }

/* --------------------------------------------------------------- Toast -- */
.toast {
  position: fixed; left: 50%; bottom: 42px; z-index: 10000;
  transform: translate(-50%, 20px);
  max-width: min(520px, calc(100vw - 40px));
  padding: 11px 18px; border-radius: 999px;
  background: rgba(30, 27, 58, 0.96); border: 1px solid var(--border-light);
  color: var(--text); font-size: 13px;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast.success { border-color: rgba(40, 184, 148, 0.45); }
.toast.error { border-color: rgba(255, 59, 48, 0.45); }

/* ---------------------------------------------------------------- 弹窗 -- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px;
  background: rgba(10, 9, 22, 0.72);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* 叠层弹窗（购卡 → 我的充值记录）：只有最上层带遮罩与背景模糊，
   下层加 .stacked 把自己的关掉 —— 两层 72% 黑 + 两层模糊叠起来会又黑又糊。 */
.modal-overlay.stacked { background: transparent; backdrop-filter: none; animation: none; }
.modal-content {
  width: 100%; max-width: 620px; margin: auto;
  background: linear-gradient(170deg, #2A2746 0%, #221F3E 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalUp .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes modalUp { from { opacity: 0; transform: translateY(16px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-wide { max-width: 860px; }
/* 模型列表弹窗：6 列表格（含能力/档位标签），比 .modal-wide 需要更多横向空间；
   限高 + body 内部滚动，表头之外的部分滚走也不影响弹窗头。 */
.modal-models {
  max-width: 1080px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 80px);
}
.modal-models .modal-body { overflow-y: auto; }
.model-modal-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.model-modal-tools .form-input { flex: 1; min-width: 0; }
.modal-chat { max-width: 720px; display: flex; flex-direction: column; max-height: calc(100vh - 80px); }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 22px 0;
}
.modal-head h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 17px; }
.modal-close {
  margin-left: auto; padding: 4px;
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  display: inline-flex;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px 22px 24px; overflow-y: auto; }
/* 弹窗底部操作条（目前只有公告弹窗用：已读确认） */
.modal-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 0 22px 20px;
}
.modal-foot-hint { color: var(--text-dim); font-size: 12px; }
.modal-foot .btn { margin-left: auto; }

/* 生成配置弹窗 */
.auto-loading { padding: 34px 0; text-align: center; color: var(--text-dim); font-size: 13px; }
.config-methods { margin-bottom: 16px; }
.config-methods h3 { margin: 0 0 12px; font-size: 15px; }
.method-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.method-tab {
  padding: 8px 15px;
  background: var(--elevated); border: 1px solid var(--border);
  border-radius: 999px; color: var(--text-secondary); font-size: 13px; cursor: pointer;
  transition: all .2s ease;
}
.method-tab:hover { color: var(--text); border-color: var(--border-light); }
.method-tab.active { background: rgba(114, 75, 255, 0.18); border-color: var(--border-light); color: var(--purple-light); font-weight: 600; }
.method-content { display: none; }
.method-content.active { display: block; animation: fadeUp .25s ease both; }
.method-header { margin-bottom: 14px; }
.method-header h4 { margin: 0 0 4px; font-size: 15px; }
.method-header p { margin: 0; color: var(--text-dim); font-size: 12.5px; }
.models-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.ai-prompt-preview, .models-preview {
  max-height: 300px; overflow: auto; padding: 14px;
  background: rgba(0, 0, 0, 0.32); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
}
.ai-prompt-preview pre, .models-preview pre {
  margin: 0; color: var(--text-secondary); font-size: 11.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
}
.path-section { margin-top: 18px; }
.path-section h4 { margin: 0 0 12px; font-size: 15px; }
.path-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.path-card { padding: 14px; background: var(--elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
.path-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.path-item { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.path-item:last-child { margin-bottom: 0; }
.path-label { flex: none; width: 76px; color: var(--text-dim); }
.path-value { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.path-value code {
  flex: 1; padding: 5px 8px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.3); color: var(--purple-light);
  font-size: 11px; overflow-x: auto; white-space: nowrap;
}
.copy-btn {
  flex: none; padding: 4px 9px; border-radius: 6px;
  background: var(--elevated-2); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 11px; cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--border-light); }
.tip-box {
  margin-top: 16px; padding: 12px 14px;
  background: rgba(40, 184, 148, 0.08); border: 1px solid rgba(40, 184, 148, 0.22);
  border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 12.5px;
}
.tip-box p { margin: 0; }
.tip-box strong { color: var(--green-light); }

/* 公告中心 */
.notice-list { display: flex; flex-direction: column; gap: 12px; }
.notice-item {
  padding: 16px;
  background: var(--elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius);
}
.notice-item-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.notice-item-title { font-size: 14px; font-weight: 600; }
.notice-item-time { margin-left: auto; color: var(--text-dim); font-size: 11px; font-family: var(--font-mono); white-space: nowrap; }
.notice-item-body { color: var(--text-secondary); font-size: 13px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.notice-empty, .chat-empty { padding: 34px 12px; text-align: center; color: var(--text-dim); font-size: 13px; }

/* AI 对话 */
.chat-toolbar { display: flex; gap: 8px; padding: 14px 22px 0; }
.chat-toolbar .form-input { font-size: 12.5px; }
.chat-toolbar #chatKey { flex: 1.6; font-family: var(--font-mono); }
.chat-toolbar #chatModel { flex: 1; }
.chat-body { flex: 1; min-height: 220px; max-height: 46vh; overflow-y: auto; padding: 16px 22px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 82%; padding: 11px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.chat-msg.user { align-self: flex-end; background: var(--purple-gradient); color: #fff; border-bottom-right-radius: 5px; }
.chat-msg.ai { align-self: flex-start; background: var(--elevated-2); border: 1px solid var(--border-subtle); border-bottom-left-radius: 5px; color: var(--text); }
.chat-msg.err { align-self: center; background: rgba(255, 59, 48, 0.12); border: 1px solid rgba(255, 59, 48, 0.3); color: #ff8a80; font-size: 12.5px; }
.chat-msg.pending::after { content: "▍"; animation: blink 1s step-end infinite; color: var(--purple-light); }
.chat-input-row { display: flex; gap: 10px; padding: 0 22px 20px; align-items: flex-end; }
.chat-input-row textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; font-size: 13.5px; }
.chat-input-row .btn { flex: none; height: 44px; }

/* ------------------------------------------------------------ 购卡充值 -- */
/* 导航里的购卡入口由 <a> 改成 <button>（点击开弹窗，不再是外链），
   按钮默认字体不继承，必须显式声明，否则整条导航字体会不一致。 */
button.nav-buy-btn { font-family: inherit; border: none; cursor: pointer; }

.modal-buy { max-width: 680px; }
.buy-loading { padding: 40px 0; text-align: center; color: var(--text-dim); font-size: 13px; }
.buy-loading .loading-spinner { width: 30px; height: 30px; border-width: 2.5px; }
.buy-loading p { margin: 14px 0 0; }

.buy-off { padding: 30px 20px; text-align: center; }
.buy-off strong { display: block; margin-bottom: 8px; font-size: 15px; }
.buy-off p { margin: 0 0 18px; color: var(--text-dim); font-size: 13px; }

.buy-step { margin-bottom: 20px; }
.buy-step-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.buy-step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  background: rgba(114, 75, 255, 0.18); border: 1px solid var(--border-light);
  color: var(--purple-light); font-size: 11px; font-weight: 700;
}

.buy-pkgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); gap: 10px; }
.buy-pkg {
  position: relative; padding: 14px 12px 12px; text-align: center; cursor: pointer;
  background: var(--elevated); border: 1px solid var(--border); border-radius: var(--radius);
  transition: all .18s ease;
}
.buy-pkg:hover { border-color: var(--border-light); background: var(--elevated-2); }
.buy-pkg.active { border-color: var(--purple); background: rgba(114, 75, 255, 0.14); }
.buy-pkg-empty { grid-column: 1 / -1; padding: 18px 0; color: var(--text-dim); font-size: 12.5px; text-align: center; }
.buy-pkg-credits { display: block; font-size: 19px; font-weight: 700; color: var(--text); font-family: var(--font-mono); }
.buy-pkg-credits small { margin-left: 3px; font-size: 11px; font-weight: 500; color: var(--text-dim); font-family: var(--font-sans); }
.buy-pkg-price { display: block; margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--purple-light); }
.buy-pkg-origin { margin-left: 5px; color: var(--text-dim); font-size: 11px; font-weight: 400; text-decoration: line-through; }
.buy-pkg-name { display: block; margin-top: 5px; color: var(--text-dim); font-size: 11.5px; }
.buy-pkg-bonus {
  position: absolute; top: -8px; right: -6px; padding: 1px 7px; border-radius: 999px;
  background: linear-gradient(135deg, #ff9500, #e07c00); color: #241a00;
  font-size: 10px; font-weight: 700; white-space: nowrap;
}

.buy-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.buy-custom-label { color: var(--text-dim); font-size: 12.5px; }
.buy-custom-input { width: 118px; }
.buy-custom-input .form-input { padding: 9px 11px; font-family: var(--font-mono); font-size: 14px; }
.buy-custom-unit { margin-left: -4px; color: var(--text-secondary); font-size: 13px; }
.buy-custom-eq { margin-left: auto; color: var(--purple-light); font-size: 12.5px; font-family: var(--font-mono); }

.buy-req {
  margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  background: rgba(255, 59, 48, 0.14); border: 1px solid rgba(255, 59, 48, 0.3);
  color: #ff8a80; font-size: 10.5px; font-weight: 700;
}
/* 续费态顶部提示：先让人确认"充给哪把 Key"，再往下填邮箱。
   配色沿用紫色（与余额页同一家族），刻意区别于邮箱提示的橙色 —— 那是"警告"，
   这里只是"你在给这个东西充值"，用警告色会让用户以为出事了。 */
.buy-renew {
  margin-bottom: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(114, 75, 255, 0.1);
  border: 1px solid rgba(114, 75, 255, 0.28);
}
.buy-renew-head {
  display: flex; align-items: center; gap: 7px;
  color: var(--text-secondary); font-size: 12.5px; font-weight: 600;
}
.buy-renew-badge {
  padding: 1px 7px; border-radius: 999px;
  background: var(--purple-gradient); color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
}
/* key 明文（sk-wb- + 20 位随机，共 26 字符）是这一块的主体，要让用户逐位核对：
   字号略大、加粗、等宽。窄屏靠 code 自己横向滚动，别把弹窗撑破。 */
.buy-renew-key {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px; padding: 9px 10px 9px 12px; border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22); border: 1px solid var(--border-subtle);
}
.buy-renew-key code {
  flex: 1 1 auto; min-width: 0; overflow-x: auto;
  font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--purple-light);
  white-space: nowrap;
}
/* 复制按钮固定不滚（把整串 key 抄错是这次改动要防的事，复制比手抄可靠） */
.buy-renew-key .copy-btn { flex: none; }

/* 「核对无误再付」的提示：充错 key 的积分退不回来，值得一个警示色 */
.buy-renew-warn { margin-top: 9px; color: #ffb74d; font-size: 12px; line-height: 1.65; }
.buy-renew-warn strong { color: #ffcc80; }
.buy-renew-tip { margin-top: 6px; color: var(--text-dim); font-size: 12px; line-height: 1.7; }
.buy-renew-tip strong { color: var(--purple-light); }

/* 邮箱被自动填入且不可修改时的说明（否则用户会以为输入框坏了） */
.buy-email-lock { margin-top: 8px; color: var(--text-dim); font-size: 12px; line-height: 1.6; }
/* 只读输入框要看起来"不可改"，否则用户点了没反应会以为页面卡住 */
.modal-buy .form-input[readonly] { color: var(--text-secondary); cursor: default; }
.modal-buy .form-input[readonly]:focus { border-color: var(--border); box-shadow: none; }

.buy-email-tip {
  margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255, 149, 0, 0.08); border: 1px solid rgba(255, 149, 0, 0.25);
  color: var(--text-secondary); font-size: 12px; line-height: 1.75;
}
.buy-email-tip strong { color: #ffb74d; }
.buy-email-err {
  margin-top: 8px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: rgba(255, 59, 48, 0.1); border: 1px solid rgba(255, 59, 48, 0.3);
  color: #ff8a80; font-size: 12.5px; line-height: 1.6;
}
.form-input.invalid { border-color: rgba(255, 59, 48, 0.6); }
.form-input.invalid:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.16); }

.buy-pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.buy-pay-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 13px 14px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14.5px; font-weight: 600; color: #fff; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.buy-pay-btn svg { width: 18px; height: 18px; }
.buy-pay-btn.wx { background: linear-gradient(135deg, #2AAE67, #1d8f52); }
.buy-pay-btn.ali { background: linear-gradient(135deg, #1677FF, #0d5fd0); }
.buy-pay-btn:hover:not(:disabled) { transform: translateY(-1px); }
.buy-pay-btn.wx:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(42, 174, 103, 0.4); }
.buy-pay-btn.ali:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(22, 119, 255, 0.4); }
.buy-pay-btn:disabled { opacity: .55; cursor: not-allowed; }
.buy-pay-hint { margin: 10px 0 0; color: var(--text-dim); font-size: 11.5px; }

.buy-order {
  margin-top: 16px; padding: 16px;
  background: rgba(0, 0, 0, 0.22); border: 1px solid var(--border-subtle); border-radius: var(--radius);
  animation: fadeUp .25s ease both;
}
.buy-order-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12.5px; }
.buy-order-row span { flex: none; width: 62px; color: var(--text-dim); }
.buy-order-row code { font-family: var(--font-mono); color: var(--text-secondary); word-break: break-all; }
.buy-order-row strong { color: var(--text); font-size: 13.5px; }
.buy-order-state { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--text-secondary); }
.buy-order-state.wait::before {
  content: ""; width: 13px; height: 13px; flex: none; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18); border-top-color: var(--purple);
  animation: spin .8s linear infinite;
}
.buy-order-state.ok { color: var(--green-light); font-weight: 600; }
.buy-order-state.fail { color: #ff8a80; }
/* 支付超时是中性收尾（既非成功也非报错），用橙色提示而不是红色 */
.buy-order-state.warn { color: #ffb74d; }
#buyOrderPayLink { margin-top: 14px; width: 100%; }

.buy-key-box {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(40, 184, 148, 0.08); border: 1px solid rgba(40, 184, 148, 0.28);
}
.buy-key-label { margin-bottom: 8px; color: var(--green-light); font-size: 12px; font-weight: 600; }
.buy-key-row { display: flex; align-items: center; gap: 10px; }
.buy-key-row code {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.32); border: 1px solid var(--border-subtle);
  color: var(--text); font-family: var(--font-mono); font-size: 12.5px; word-break: break-all;
}

.buy-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-subtle);
}
.buy-link {
  padding: 0; background: none; border: none; cursor: pointer;
  color: var(--purple-light); font-family: inherit; font-size: 12.5px;
  text-decoration: underline; text-underline-offset: 3px;
}
.buy-link:hover { color: #c4b5fd; }

/* 我的充值记录 */
.myorders-form { display: flex; gap: 10px; }
.myorders-form .form-input { flex: 1; min-width: 0; }
.myorders-hint { margin: 10px 0 16px; color: var(--text-dim); font-size: 11.5px; }
.buy-orders { display: flex; flex-direction: column; gap: 12px; }
.buy-order-card {
  padding: 14px 16px; background: var(--elevated);
  border: 1px solid var(--border-subtle); border-radius: var(--radius);
}
.boc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.boc-pkg { font-size: 14px; font-weight: 600; }
.boc-chip {
  margin-left: auto; padding: 2px 9px; border-radius: 999px;
  background: var(--elevated-2); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 11px; font-weight: 600;
}
.boc-chip.paid { background: rgba(40, 184, 148, 0.14); border-color: rgba(40, 184, 148, 0.32); color: var(--green-light); }
.boc-chip.pending { background: rgba(255, 149, 0, 0.14); border-color: rgba(255, 149, 0, 0.32); color: #ffb74d; }
/* 支付超时：灰调 = 已失效但不算失败（用户可能只是没付完） */
.boc-chip.timeout { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.16); color: var(--text-dim); }
.boc-chip.failed, .boc-chip.closed { background: rgba(255, 59, 48, 0.12); border-color: rgba(255, 59, 48, 0.28); color: #ff8a80; }
.boc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-dim); font-size: 12px; }
.boc-meta code { font-family: var(--font-mono); color: var(--text-secondary); }
.boc-key { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.boc-key code {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.32); border: 1px solid var(--border-subtle);
  color: var(--text); font-family: var(--font-mono); font-size: 12px; word-break: break-all;
}
.boc-act { margin-top: 10px; }
.boc-act .btn { padding: 7px 14px; font-size: 12.5px; }

/* ------------------------------------------------------------ 响应式 -- */
@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .topbar-slogan { display: none; }
  .topbar-nav { margin-left: 0; width: 100%; }
  .contact-layout { grid-template-columns: 1fr; }
  .hero-left { padding: 28px 22px; }
  .hero h1 { font-size: 28px; }
  /* 余额区在窄屏改成上下排：数字在上，操作按钮在下，避免右侧被挤成一条 */
  .qp-balance { flex-direction: column; gap: 16px; }
  .qp-balance-side { align-items: flex-start; width: 100%; }
  .qp-balance-actions, .qp-status { justify-content: flex-start; }
  .qp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .main { padding: 20px 14px 48px; }
  .topbar-nav .btn, .nav-chat-btn, .nav-contact-btn, .nav-notice-btn, .nav-buy-btn { padding: 6px 10px; font-size: 12px; }
  .guide-step-arrow { display: none; }
  .guide-step { min-width: 100%; }
  .qp-head { padding: 18px 16px 14px; }
  .qp-block, .qp-balance { padding: 16px; }
  .qp-balance-value span { font-size: 28px; }
  .qp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qp-input-row .btn { flex: 1; }
  .qp-log-tools { width: 100%; margin-left: 0; }
  .model-bar-row { grid-template-columns: 1fr; gap: 6px; }
  .modal-overlay { padding: 16px 10px; }
  /* 购卡弹窗：窄屏套餐两列、支付按钮上下排，避免按钮被挤成窄条 */
  .buy-pkgs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buy-pay-row { grid-template-columns: 1fr; }
  .myorders-form { flex-direction: column; }
  .buy-custom-eq { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
