@charset "UTF-8";
/* ============================================================================
   灵境星云 · H5 移动端设计系统
   文件：web/h5/css/h5.css（H5 唯一样式入口，零外部依赖 / 零 CDN）

   适配目标
   - 390px 优先设计，兼容 320–768px；竖屏手机、折叠屏、平板窄栏均可读。
   - 已消费 env(safe-area-inset-*)，页面需 <meta name="viewport" ... viewport-fit=cover>；
     刘海 / 灵动岛 / 底部 Home 条由本文件负责留白，业务代码不要重复加 padding。
   - 触摸目标 ≥ 44px；输入框字号 16px（避免 iOS 聚焦自动放大）。

   页面骨架约定（类名契约）
     <body class="has-tabbar">（无底部导航的页面用 class="no-tabbar"）
       <div class="h5-app">
         <header class="h5-header">
           <button class="icon-btn" aria-label="返回">…</button>
           <h1 class="h5-header-title">技能市场</h1>
           <span class="h5-header-sub">共 9 个技能</span>
         </header>
         <main class="h5-main">
           <div class="page-head">…</div>
           <section class="card">…</section>
         </main>
         <nav class="tabbar" aria-label="底部导航">
           <a class="tabbar-item active" href="#/home" aria-current="page">
             <svg class="icon" aria-hidden="true"><use href="#i-grid"/></svg><span>首页</span>
           </a>
         </nav>
       </div>

   组件速查
   - 容器：.h5-main / .card / .card-head / .card-body / .card-foot / .card-grid / .stack
   - 按钮：.btn .btn-primary .btn-ghost .btn-danger .btn-sm .btn-lg .btn-block .icon-btn
   - 表单：.field > label/.field-label + .input/.select/.textarea + .hint/.field-error
   - 列表：.list > .list-item > .list-icon + .list-main(.list-title/.list-desc/.list-meta) + .list-extra
   - 空态：.empty > .empty-art/.empty-title/.empty-desc + .btn
   - 骨架：.skeleton-card / .skeleton-row / .skeleton-line / .skeleton-text / .skeleton-title
   - 反馈：.toast-root/.toast、.overlay/.modal、.sheet、.notice、.spinner
   - 底部导航：.tabbar > .tabbar-item(.active / [aria-current="page"]) + .tabbar-badge
   - 底部动作条：.action-bar（有 tabbar 时自动上移）

   可访问性：图标按钮必须带 aria-label；动态文本请先转义再插入；禁用内联 onclick。
   ============================================================================ */

/* ==========================================================================
   1. 设计令牌
   ========================================================================== */
:root {
  color-scheme: dark;

  /* 与 web/css/app.css 保持同一套色板 */
  --bg: #05070f;
  --bg-2: #080c18;
  --panel: rgba(17, 23, 41, 0.72);
  --panel-solid: #0b1020;
  --line: rgba(148, 163, 208, 0.14);
  --line-strong: rgba(148, 163, 208, 0.26);
  --text: #e9edfb;
  --muted: #9aa3bd;
  --dim: #8b94b0;
  --violet: #8b5cf6;
  --indigo: #6366f1;
  --cyan: #22d3ee;
  --emerald: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --accent: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #22d3ee 100%);
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.9);

  /* 移动端尺度 */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 22px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;

  --h5-pad: 16px;            /* 内容左右基础留白 */
  --h5-tap: 44px;            /* 最小触摸目标 */
  --h5-header-h: 56px;       /* 顶栏内容高度（不含安全区） */
  --h5-tabbar-h: 56px;       /* 底部导航高度（不含安全区） */

  /* 安全区兜底：不支持 env() 的浏览器保持 0 */
  --h5-safe-top: 0px;
  --h5-safe-right: 0px;
  --h5-safe-bottom: 0px;
  --h5-safe-left: 0px;
  --h5-gutter-l: max(var(--h5-pad), var(--h5-safe-left));
  --h5-gutter-r: max(var(--h5-pad), var(--h5-safe-right));
}

@supports (padding: env(safe-area-inset-top)) {
  :root {
    --h5-safe-top: env(safe-area-inset-top, 0px);
    --h5-safe-right: env(safe-area-inset-right, 0px);
    --h5-safe-bottom: env(safe-area-inset-bottom, 0px);
    --h5-safe-left: env(safe-area-inset-left, 0px);
  }
}

/* ==========================================================================
   2. 基础重置与排版
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--h5-header-h) + var(--h5-safe-top));
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    radial-gradient(620px 420px at 8% -6%, rgba(109, 76, 255, 0.22), transparent 62%),
    radial-gradient(520px 360px at 98% 0%, rgba(34, 211, 238, 0.12), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.62;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

/* overflow-x: clip 不创建滚动容器，避免 sticky 顶栏在部分内核下失效 */
@supports (overflow-x: clip) {
  body { overflow-x: clip; }
}

#app,
.h5-app {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

h1 { font-size: 22px; line-height: 1.3; font-weight: 750; letter-spacing: -0.02em; }
h2 { font-size: 18px; line-height: 1.36; font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: 16px; line-height: 1.42; font-weight: 650; }
h4 { font-size: 15px; line-height: 1.45; font-weight: 650; }
p { font-size: 14.5px; }
small { font-size: 12px; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, video, canvas { max-width: 100%; height: auto; }
svg { max-width: 100%; }

::selection { background: rgba(139, 92, 246, 0.35); }

:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
}

/* SVG 图标（内联 sprite <use>），不依赖任何图标字体 */
.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  vertical-align: -0.2em;
}

/* ==========================================================================
   3. 布局：外壳 / 页面 / 顶栏 / 底部导航
   ========================================================================== */
/* H5 外壳：index.html 只留 #app/#view/#tabbar 三个挂载点，交给本文件布局 */
#app {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

#view,
.h5-view {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--h5-safe-top) + 14px) var(--h5-gutter-r)
    calc(var(--h5-tabbar-h) + 24px + var(--h5-safe-bottom)) var(--h5-gutter-l);
}

.h5-header,
.app-header,
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: calc(var(--h5-header-h) + var(--h5-safe-top));
  padding: calc(var(--h5-safe-top) + 6px) var(--h5-gutter-r) 6px var(--h5-gutter-l);
  background: rgba(6, 9, 18, 0.84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.h5-header-title {
  min-width: 0;
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.h5-header-sub {
  font-size: 11.5px;
  color: var(--dim);
  white-space: nowrap;
}

.h5-header .row,
.h5-header .h5-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.h5-main,
.app-main,
.page,
.main {
  padding: 14px var(--h5-gutter-r) calc(var(--h5-tabbar-h) + 24px + var(--h5-safe-bottom))
    var(--h5-gutter-l);
}

/* 无底部导航的页面：底部只留安全区与呼吸位 */
body.no-tabbar .h5-main,
body.no-tabbar .main,
.h5-main--plain {
  padding-bottom: calc(24px + var(--h5-safe-bottom));
}

/* 有底部动作条时，内容需要再让出一截 */
body.has-action-bar .h5-main,
body.has-action-bar .main {
  padding-bottom: calc(var(--h5-tabbar-h) + 96px + var(--h5-safe-bottom));
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 14px;
}

.page-head h1 { font-size: 21px; }
.page-head p { margin-top: 4px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 0 10px;
}
.section-title h2 { font-size: 16px; }
.section-title span,
.section-title a { font-size: 12px; color: var(--muted); }

/* ---- 底部 tabbar（5 项，390 基准；320 自动收紧） ---- */
.tabbar,
.h5-tabbar,
.bottom-nav,
.tab-bar,
#tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  min-height: calc(var(--h5-tabbar-h) + var(--h5-safe-bottom));
  padding: 6px max(6px, var(--h5-safe-right)) calc(6px + var(--h5-safe-bottom))
    max(6px, var(--h5-safe-left));
  background: rgba(7, 10, 20, 0.93);
  border-top: 1px solid var(--line);
  box-shadow: 0 -14px 34px -26px #000;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.tabbar-item,
.h5-tabbar-item,
.bottom-nav-item {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--h5-tap);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 2px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.tabbar-item > span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 平板宽度下让自建 tabbar 的 5 项居中收拢；页面自带的 #tabbar 不受影响 */
.tabbar > .tabbar-item,
.h5-tabbar > .tabbar-item,
.bottom-nav > .tabbar-item { max-width: 112px; }

.tabbar-item .icon { width: 21px; height: 21px; }

/* 外壳的动态图标只带 viewBox、无 class，必须显式给尺寸，否则会按 100% 宽撑满 */
.tabbar-item svg {
  width: 21px;
  height: 21px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tabbar-item:active { color: var(--text); }

.tabbar-item.active,
.tabbar-item[aria-current="page"],
.tabbar-item[aria-selected="true"],
.h5-tabbar-item.active {
  color: #f1edff;
}
.tabbar-item.active .icon,
.tabbar-item[aria-current="page"] .icon,
.tabbar-item[aria-selected="true"] .icon {
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.55));
}
.tabbar-item.active::before,
.tabbar-item[aria-current="page"]::before,
.tabbar-item[aria-selected="true"]::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 50%;
  width: 26px;
  height: 3px;
  margin-left: -13px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.7);
}

.tabbar-item .tabbar-badge,
.tabbar-badge {
  position: absolute;
  top: 3px;
  left: calc(50% + 3px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--rose);
  color: #1b0a10;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 1.5px solid #070a14;
}

/* ---- 底部动作条（详情页 CTA）：有 tabbar 时自动上移 ---- */
.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 38;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--h5-gutter-r) calc(10px + var(--h5-safe-bottom)) var(--h5-gutter-l);
  background: rgba(7, 10, 20, 0.95);
  border-top: 1px solid var(--line);
  box-shadow: 0 -16px 34px -26px #000;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
body.has-tabbar .action-bar,
.action-bar.above-tabbar {
  bottom: calc(var(--h5-tabbar-h) + var(--h5-safe-bottom));
  padding-bottom: 10px;
}
.action-bar .btn { flex: 1; }
.action-bar .action-price {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}
.action-bar .action-price b {
  display: block;
  font-size: 17px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   4. 卡片与通用容器
   ========================================================================== */
.card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21, 27, 47, 0.72), rgba(10, 14, 26, 0.78));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card.flush { padding: 0; overflow: hidden; }
.card.tight { padding: 12px 14px; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.card-sub { margin-top: 3px; font-size: 11.5px; color: var(--dim); }
.card-body { display: grid; gap: 10px; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

a.card,
button.card,
.card.tap {
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
a.card:active,
button.card:active,
.card.tap:active {
  transform: scale(0.988);
  border-color: var(--line-strong);
}

.card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.stack { display: grid; gap: 12px; }
.stack-sm { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-top { display: flex; align-items: flex-start; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; min-width: 0; }
.divider { height: 1px; margin: 12px 0; background: var(--line); border: 0; }

/* ==========================================================================
   5. 按钮
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--h5-tap);
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}
.btn .icon { width: 17px; height: 17px; }
.btn:active { transform: scale(0.985); background: rgba(255, 255, 255, 0.1); }

.btn-primary {
  border: 0;
  background: linear-gradient(135deg, #7c3aed, #4f46e5 62%, #4338ca);
  color: #fff;
  box-shadow: 0 10px 24px -14px rgba(99, 102, 241, 0.9);
}
.btn-primary:active {
  background: linear-gradient(135deg, #6d28d9, #4338ca 62%, #3730a3);
  box-shadow: 0 6px 16px -12px rgba(99, 102, 241, 0.9);
}

.btn-ghost { border-color: var(--line); background: transparent; }
.btn-danger {
  border-color: rgba(251, 113, 133, 0.42);
  background: rgba(251, 113, 133, 0.09);
  color: #fda4af;
}
.btn-success {
  border-color: rgba(52, 211, 153, 0.38);
  background: rgba(52, 211, 153, 0.09);
  color: #a7f3d0;
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
}
.btn-sm .icon { width: 15px; height: 15px; }
.btn-lg {
  min-height: 50px;
  border-radius: 14px;
  font-size: 16px;
}
.btn-block { display: flex; width: 100%; }
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-group > .btn { flex: 1; min-width: 0; }

.btn:disabled,
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 图标按钮：必须带 aria-label；44×44 保证可点 */
.icon-btn {
  width: var(--h5-tap);
  height: var(--h5-tap);
  min-width: var(--h5-tap);
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.16s ease, color 0.16s ease;
}
.icon-btn:active { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.icon-btn .icon { width: 19px; height: 19px; }

/* 容器内滚动/裁切时，焦点环向内收，避免被 overflow 裁掉 */
.list-item:focus-visible,
.tabbar-item:focus-visible,
.chip:focus-visible,
.tab:focus-visible,
.account:focus-visible,
.segmented > button:focus-visible { outline-offset: -2px; }

/* ==========================================================================
   6. 徽章 / 标签 / 筛选
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-violet { color: #c4b5fd; border-color: rgba(139, 92, 246, 0.35); background: rgba(139, 92, 246, 0.12); }
.badge-cyan { color: #a5f3fc; border-color: rgba(34, 211, 238, 0.3); background: rgba(34, 211, 238, 0.1); }
.badge-emerald { color: #a7f3d0; border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.1); }
.badge-amber { color: #fde68a; border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.1); }
.badge-rose { color: #fecdd3; border-color: rgba(251, 113, 133, 0.3); background: rgba(251, 113, 133, 0.1); }
.badge .dot,
.dot-badge { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: #aeb6cf;
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-row.scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chip-row.scroll::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.chip.active,
.chip[aria-pressed="true"] {
  color: #ddd6fe;
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(139, 92, 246, 0.14);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
}
.tab.active,
.tab[aria-selected="true"] {
  background: rgba(139, 92, 246, 0.2);
  color: #ede9fe;
}

.segmented {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}
.segmented > button {
  flex: 1;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.segmented > button.active,
.segmented > button[aria-selected="true"] {
  background: rgba(139, 92, 246, 0.22);
  color: #f1edff;
}

/* ==========================================================================
   7. 表单
   ========================================================================== */
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.field > label,
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: #c6cde2;
}
.field .hint { font-size: 12px; line-height: 1.6; color: var(--dim); }

/* 独立使用的说明文字（不限于 .field 内） */
.hint { font-size: 12px; line-height: 1.65; color: var(--dim); }
.field-error {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #fda4af;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(4, 7, 14, 0.62);
  color: var(--text);
  font-family: inherit;
  font-size: 16px; /* 16px 防止 iOS 聚焦放大 */
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder,
.textarea::placeholder { color: #8b94b0; }
.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(139, 92, 246, 0.72);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}
.textarea {
  min-height: 108px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.65;
}
.select {
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 19px) 50%,
    calc(100% - 14px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.input[type="date"],
.input[type="time"],
.input[type="datetime-local"] { min-height: 48px; }

.field.invalid .input,
.field.invalid .select,
.field.invalid .textarea {
  border-color: rgba(251, 113, 133, 0.66);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.12);
}

.input-group { display: flex; align-items: stretch; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }
.input-group .btn { flex: none; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.form-actions .btn { flex: 1; }

.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}
.searchbar .icon { color: var(--dim); flex: none; }
.searchbar input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  outline: none;
}
.searchbar input::placeholder { color: #8b94b0; }
.searchbar:focus-within {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

/* 原生复选框 / 单选框：只用 accent-color，无额外依赖 */
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: var(--h5-tap);
  padding: 10px 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  cursor: pointer;
}
.check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  flex: none;
  accent-color: var(--violet);
}
.check b { color: var(--text); font-weight: 600; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 6px 0;
  font-size: 14px;
}
.switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s ease;
}
.switch.on,
.switch:checked {
  border-color: transparent;
  background: linear-gradient(135deg, #8b5cf6, #22d3ee);
}
.switch.on::after,
.switch:checked::after { left: 20px; }

/* ==========================================================================
   8. 列表
   ========================================================================== */
.list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(19, 25, 43, 0.64), rgba(9, 13, 24, 0.72));
  overflow: hidden;
}
.list-group { margin-bottom: 16px; }
.list-group-title {
  padding: 0 4px 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 208, 0.09);
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.14s ease;
}
.list-item:last-child { border-bottom: 0; }
.list-item:active { background: rgba(255, 255, 255, 0.045); }

.list-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: #c4b5fd;
}
.list-icon .icon { width: 18px; height: 18px; }

.list-main { flex: 1; min-width: 0; }
.list-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-desc,
.list-meta {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-desc.clamp-2,
.list-meta.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}
.list-extra {
  flex: none;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.list-extra b { display: block; color: var(--text); font-size: 14.5px; }

.list-item.has-arrow { padding-right: 34px; position: relative; }
.list-item.has-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-top: 1.8px solid #5f6986;
  border-right: 1.8px solid #5f6986;
  transform: rotate(45deg);
}

/* 键值明细（订单、合约、账单） */
.kv-list { display: grid; }
.kv-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(148, 163, 208, 0.08);
  font-size: 13.5px;
}
.kv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-key { flex: none; color: var(--muted); }
.kv-val {
  min-width: 0;
  text-align: right;
  color: var(--text);
  word-break: break-word;
}
.kv-val .mono { font-size: 12px; color: #9aa4c4; }

/* ==========================================================================
   9. 空状态 / 加载骨架 / 加载中
   ========================================================================== */
.empty {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty > .icon {
  width: 30px;
  height: 30px;
  color: #8b7ac0;
  opacity: 0.9;
}
.empty-art {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(139, 92, 246, 0.24);
  border-radius: 20px;
  background: radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.24), rgba(34, 211, 238, 0.07));
  color: #c4b5fd;
}
.empty-art .icon { width: 28px; height: 28px; }
.empty-title {
  font-size: 15px;
  font-weight: 620;
  color: #dfe5f7;
  line-height: 1.5;
}
.empty-desc {
  max-width: 270px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--dim);
}
.empty .btn { margin-top: 4px; }
.empty-sm { padding: 26px 16px; gap: 8px; }

/* 骨架：shimmer 由渐变位移实现，不加载任何图片 */
.skeleton {
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.045) 25%,
    rgba(255, 255, 255, 0.095) 37%,
    rgba(255, 255, 255, 0.045) 63%
  );
  background-size: 400% 100%;
  animation: h5-shimmer 1.4s ease infinite;
}
@keyframes h5-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.skeleton-text { height: 11px; border-radius: 6px; }
.skeleton-title { width: 42%; height: 15px; border-radius: 7px; }
.skeleton-circle { border-radius: 50%; }
.skeleton-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 23, 41, 0.42);
}
.skeleton-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 52px;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 208, 0.08);
}
.skeleton-row:last-child { border-bottom: 0; }
.skeleton-line { display: grid; gap: 8px; }
.skeleton-line > .skeleton-text:nth-child(2) { width: 66%; }
.skeleton-grid { display: grid; gap: 12px; }

.spinner {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #c4b5fd;
  animation: h5-spin 0.7s linear infinite;
}
@keyframes h5-spin { to { transform: rotate(360deg); } }

.loading-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 0;
  font-size: 12.5px;
  color: var(--dim);
}

/* ==========================================================================
   10. 反馈：Toast / 弹窗 / 底部面板 / 提示条
   ========================================================================== */
.toast-root {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--h5-tabbar-h) + 16px + var(--h5-safe-bottom));
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  pointer-events: none;
}
body.no-tabbar .toast-root { bottom: calc(20px + var(--h5-safe-bottom)); }

/* 弹层打开时把 Toast 移到顶部，避免遮挡面板底部的操作区 */
body:has(.overlay:not(.hide):not([hidden])) .toast-root,
body:has(.sheet:not(.hide):not([hidden])) .toast-root {
  top: calc(var(--h5-safe-top) + 12px);
  bottom: auto;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  max-width: 480px;
  align-self: center;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #0e1526;
  box-shadow: 0 16px 36px -20px #000;
  font-size: 13px;
  line-height: 1.5;
  animation: h5-toast-in 0.22s ease;
}
.toast .icon { flex: none; }
.toast.ok { border-color: rgba(52, 211, 153, 0.4); }
.toast.ok .icon { color: var(--emerald); }
.toast.err { border-color: rgba(251, 113, 133, 0.45); }
.toast.err .icon { color: var(--rose); }
@keyframes h5-toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(3, 5, 12, 0.74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: h5-fade 0.18s ease;
}
@keyframes h5-fade { from { opacity: 0; } }

/* 移动端弹窗默认从底部升起 */
.modal {
  width: min(520px, 100%);
  max-height: 86vh;
  max-height: 86dvh;
  overflow-y: auto;
  padding: 20px var(--h5-gutter-r) calc(18px + var(--h5-safe-bottom)) var(--h5-gutter-l);
  border: 1px solid rgba(148, 163, 208, 0.18);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(180deg, #0d1222, #080c17);
  box-shadow: 0 -30px 70px -30px #000;
  animation: h5-sheet-in 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes h5-sheet-in {
  from { transform: translateY(26px); opacity: 0.6; }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.modal-head h3 { font-size: 17px; letter-spacing: -0.01em; }
.modal-head p { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.modal-close {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.modal-close:active { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.modal-body { display: grid; gap: 4px; }
.modal-foot { display: flex; gap: 10px; margin-top: 18px; }
.modal-foot .btn { flex: 1; }

/* ui.js 的抽屉在 H5 里作为底部面板（宽度由调用方内联给出） */
.drawer {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  width: 100%;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 18px var(--h5-gutter-r) calc(20px + var(--h5-safe-bottom)) var(--h5-gutter-l);
  border: 1px solid rgba(148, 163, 208, 0.18);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(180deg, #0b1020, #060912);
  box-shadow: 0 -30px 70px -30px #000;
  animation: h5-sheet-in 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* 自定义底部面板 */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3, 5, 12, 0.68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: h5-fade 0.18s ease;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  max-height: 86vh;
  max-height: 86dvh;
  overflow-y: auto;
  padding: 8px var(--h5-gutter-r) calc(18px + var(--h5-safe-bottom)) var(--h5-gutter-l);
  border-top: 1px solid rgba(148, 163, 208, 0.2);
  border-radius: 20px 20px 0 0;
  background: linear-gradient(180deg, #0d1222, #080c17);
  box-shadow: 0 -30px 70px -30px #000;
  animation: h5-sheet-in 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet::before {
  content: "";
  display: block;
  width: 38px;
  height: 4px;
  margin: 2px auto 12px;
  border-radius: 99px;
  background: rgba(148, 163, 208, 0.35);
}
.sheet-title {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 650;
  text-align: center;
}
.sheet-actions { display: grid; gap: 8px; margin-top: 14px; }

/* 提示条 */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: #c7cdea;
  font-size: 12.5px;
  line-height: 1.65;
}
.notice .icon { flex: none; margin-top: 2px; }
.notice b { color: var(--text); }
.notice-info { border-color: rgba(34, 211, 238, 0.28); background: rgba(34, 211, 238, 0.07); }
.notice-ok { border-color: rgba(52, 211, 153, 0.28); background: rgba(52, 211, 153, 0.07); }
.notice-warn { border-color: rgba(251, 191, 36, 0.28); background: rgba(251, 191, 36, 0.07); }
.notice-danger { border-color: rgba(251, 113, 133, 0.32); background: rgba(251, 113, 133, 0.08); }

/* 启动 / 骨架屏 */
.boot {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 13px;
}
.orbit {
  position: relative;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 50%;
  animation: h5-spin 3.2s linear infinite;
}
.orbit::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(2px);
}
.orbit span {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

/* ==========================================================================
   11. 业务卡片：技能 / 知识 / 租赁 / 报价
   ========================================================================== */
.skill-card,
.knowledge-card,
.lease-card,
.offer-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skill-top { display: flex; align-items: flex-start; gap: 12px; }
.skill-icon {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 20px;
  border: 1px solid rgba(139, 92, 246, 0.24);
  border-radius: 13px;
  background: rgba(139, 92, 246, 0.12);
}
.skill-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.skill-tagline {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
}
.skill-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  color: var(--dim);
}
.skill-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.price small { font-size: 11px; font-weight: 500; color: var(--dim); letter-spacing: 0; }

.owner-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--muted);
}
.owner-line .avatar { width: 20px; height: 20px; font-size: 9px; }

.avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #0a0d18;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.avatar-lg { width: 46px; height: 46px; font-size: 15px; }
.avatar-sm { width: 28px; height: 28px; font-size: 10px; }

/* 知识卡片：封面 + 正文 */
.knowledge-card {
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.knowledge-cover {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 104px;
  padding: 14px 16px;
  overflow: hidden;
}
.knowledge-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 0.7px, transparent 0.7px);
  background-size: 16px 16px;
  opacity: 0.32;
}
.knowledge-kind {
  position: relative;
  z-index: 1;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 11px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.knowledge-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
}
.knowledge-title { font-size: 14.5px; font-weight: 650; line-height: 1.45; }
.knowledge-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}
.knowledge-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.tone-violet { background: linear-gradient(135deg, #4c1d95, #7c3aed 55%, #312e81); }
.tone-cyan { background: linear-gradient(135deg, #164e63, #0891b2 55%, #1e3a8a); }
.tone-amber { background: linear-gradient(135deg, #78350f, #d97706 55%, #7c2d12); }
.tone-rose { background: linear-gradient(135deg, #881337, #e11d48 55%, #4c0519); }
.tone-emerald { background: linear-gradient(135deg, #064e3b, #059669 55%, #14532d); }
.tone-sky { background: linear-gradient(135deg, #0c4a6e, #0284c7 55%, #0f172a); }

/* 租赁 / 供给 */
.lease-specs { display: flex; flex-wrap: wrap; gap: 6px; }
.spec {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  color: #aeb6cf;
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
}
.lease-price { display: flex; align-items: baseline; gap: 6px; }
.lease-price b { font-size: 22px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.lease-price span { font-size: 11.5px; color: var(--dim); }

/* KPI / 数据块 */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.kpi {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(24, 30, 52, 0.8), rgba(9, 13, 24, 0.8));
  overflow: hidden;
}
.kpi-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.kpi-label .icon { width: 14px; height: 14px; color: #a78bfa; }
.kpi-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.kpi-value small { margin-left: 4px; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi-foot { margin-top: 3px; font-size: 11px; color: var(--dim); }
.up { color: #6ee7b7; }
.down { color: #fda4af; }

/* 订单金额汇总 */
.summary {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(4, 7, 14, 0.55);
}
.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.summary-row b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.summary-row.total {
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--text);
}
.summary-row.total b { font-size: 17px; }

.progress {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #8b5cf6, #22d3ee);
  transition: width 0.4s ease;
}

/* ==========================================================================
   12. 登录页（H5 单列）
   ========================================================================== */
.login {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.login-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: calc(var(--h5-safe-top) + 26px) var(--h5-gutter-r) 22px var(--h5-gutter-l);
}
.login-hero .hero-stats { display: none; }
.hero-title {
  margin: 6px 0 8px;
  font-size: 30px;
  line-height: 1.16;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.hero-title em {
  font-style: normal;
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-copy { font-size: 13.5px; line-height: 1.75; color: var(--muted); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  color: #b9c1da;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  position: relative;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  background: var(--accent);
  box-shadow: 0 0 30px -8px rgba(139, 92, 246, 0.8);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #070b18;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
}
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.06em; }
.brand-sub { font-size: 10.5px; color: var(--dim); letter-spacing: 0.16em; }

.login-panel { padding: 0 var(--h5-gutter-r) calc(26px + var(--h5-safe-bottom)) var(--h5-gutter-l); }
.login-card { width: 100%; }
.login-card h2 { font-size: 20px; }
.login-card > p { margin: 6px 0 16px; font-size: 13px; color: var(--muted); }
.account-list { display: grid; gap: 10px; }
.account {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}
.account:active { border-color: rgba(139, 92, 246, 0.5); background: rgba(139, 92, 246, 0.08); }
.account .avatar { width: 38px; height: 38px; font-size: 13px; }
.account-main { flex: 1; min-width: 0; }
.account-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 600;
}
.account-meta {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-arrow { flex: none; color: var(--dim); font-size: 15px; }
.login-note {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.7;
}
.login-foot {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--dim);
}

/* ==========================================================================
   13. 工具类
   ========================================================================== */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.text-right { text-align: right; }
.hide { display: none !important; }
.full { width: 100%; }
.break { word-break: break-word; }

.clamp-1,
.clamp-2,
.clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp-1 { -webkit-line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

.safe-top { padding-top: calc(var(--h5-safe-top) + 12px); }
.safe-bottom { padding-bottom: calc(var(--h5-safe-bottom) + 12px); }

.scroll-x {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.scroll-x::-webkit-scrollbar { display: none; }

.fade-up { animation: h5-fade-up 0.4s ease both; }
@keyframes h5-fade-up {
  from { opacity: 0; transform: translateY(8px); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 表格兜底：窄屏横向滚动，不撑破页面 */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.table th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 11px;
  font-weight: 550;
  text-align: left;
  white-space: nowrap;
}
.table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(148, 163, 208, 0.08);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }

/* ==========================================================================
   14. 断点：320 收紧 / 600+ 平板 / 768 宽栏 / 横屏
   ========================================================================== */

/* 小屏 320–359：收紧间距与字号，保证 5 个 tab 不挤爆 */
@media (max-width: 359px) {
  :root {
    --h5-pad: 12px;
    --radius: 14px;
  }
  body { font-size: 14.5px; }
  h1 { font-size: 20px; }
  .h5-header { gap: 8px; }
  .h5-header-title { font-size: 15.5px; }
  .card { padding: 14px; }
  .kpi-grid { gap: 8px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 20px; }
  .btn { padding: 0 13px; font-size: 14.5px; }
  .tabbar { gap: 0; }
  .tabbar-item { font-size: 10px; }
  .tabbar-item .icon { width: 20px; height: 20px; }
  .toast-root { left: 12px; right: 12px; }
  .price { font-size: 17px; }
  .hero-title { font-size: 27px; }
}

/* 平板 / 折叠屏展开 600–768：内容居中，卡片两列起 */
@media (min-width: 600px) {
  :root { --h5-pad: 24px; }

  .h5-main,
  .main,
  .page {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
  .h5-header > * { max-width: none; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .field.full-width { grid-column: 1 / -1; }

  /* 平板弹窗回到居中卡片形态 */
  .overlay { align-items: center; padding: 24px; }
  .modal {
    border-bottom: 1px solid rgba(148, 163, 208, 0.18);
    border-radius: 20px;
    padding-bottom: 22px;
    animation: h5-pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  }
  .drawer {
    border-bottom: 1px solid rgba(148, 163, 208, 0.18);
    border-radius: 20px;
    padding-bottom: 22px;
  }

  /* 平板上的底部面板改为居中浮层 */
  .sheet {
    left: 0;
    right: 0;
    bottom: 24px;
    width: min(560px, calc(100% - 48px));
    max-height: 80dvh;
    margin: 0 auto;
    border: 1px solid rgba(148, 163, 208, 0.18);
    border-radius: 20px;
    padding-bottom: 20px;
  }
  .tabbar > .tabbar-item,
  .h5-tabbar > .tabbar-item,
  .bottom-nav > .tabbar-item { max-width: 118px; }
}

@keyframes h5-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

@media (min-width: 768px) {
  .h5-main,
  .main,
  .page { max-width: 800px; }
  .card-grid { gap: 14px; }
  .h5-header { padding-top: calc(var(--h5-safe-top) + 8px); padding-bottom: 8px; }
}

/* 横屏小高度：压缩纵向留白，避免首屏只剩标题 */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --h5-header-h: 48px; }
  .h5-header {
    min-height: calc(var(--h5-header-h) + var(--h5-safe-top));
    padding-top: calc(var(--h5-safe-top) + 2px);
    padding-bottom: 2px;
  }
  .login-hero { padding-top: calc(var(--h5-safe-top) + 16px); padding-bottom: 12px; }
  .hero-title { margin: 2px 0 4px; font-size: 25px; }
  .hero-chips { display: none; }
  .boot { gap: 12px; }
}

/* 支持悬停的设备才启用 hover 效果，避免触屏残留态 */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: rgba(148, 163, 208, 0.42); background: rgba(255, 255, 255, 0.09); }
  .btn-primary:hover {
    background: linear-gradient(135deg, #8b5cf6, #4f46e5 62%, #4338ca);
    box-shadow: 0 14px 30px -14px rgba(99, 102, 241, 0.95);
  }
  .chip:hover { color: var(--text); border-color: var(--line-strong); }
  a.card:hover,
  button.card:hover,
  .card.tap:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 22px 50px -30px rgba(139, 92, 246, 0.6);
  }
  .list-item:hover { background: rgba(255, 255, 255, 0.035); }
  .account:hover { border-color: rgba(139, 92, 246, 0.5); background: rgba(139, 92, 246, 0.08); }
}

/* ==========================================================================
   15. 动效降级
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .skeleton {
    animation: none;
    background: rgba(255, 255, 255, 0.07);
  }
}

/* 集成修复：筛选 chips 在窄屏换行，避免横向溢出（2026-12） */
html, body { max-width: 100%; overflow-x: hidden; }
.chip-row.scroll { flex-wrap: wrap !important; overflow-x: visible !important; }
.chip { max-width: 100%; }

/* ==========================================================================
   浅色主题：与工作台 / 营销站统一
   ========================================================================== */
:root {
  color-scheme: light;
  --bg: #f5f6fc;
  --bg-2: #eef0fa;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --line: rgba(60, 72, 120, 0.12);
  --line-strong: rgba(60, 72, 120, 0.22);
  --text: #1f2333;
  --muted: #5f6880;
  --dim: #8a92a8;
  --violet: #7c3aed;
  --indigo: #6366f1;
  --cyan: #0891b2;
  --emerald: #059669;
  --amber: #b45309;
  --rose: #e11d48;
  --accent: linear-gradient(135deg, #7c3aed 0%, #6366f1 55%, #0891b2 100%);
  --shadow: 0 16px 40px -28px rgba(50, 60, 110, 0.35);
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(620px 420px at 8% -6%, rgba(124, 58, 237, 0.08), transparent 62%),
    radial-gradient(520px 360px at 98% 0%, rgba(8, 145, 178, 0.05), transparent 60%);
}

.h5-header,
.app-header,
.topbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px -24px rgba(50, 60, 110, 0.3);
}

.tabbar,
.h5-tabbar,
.bottom-nav,
.tab-bar,
#tabbar {
  background: rgba(255, 255, 255, 0.95);
  border-top-color: var(--line);
  box-shadow: 0 -12px 30px -26px rgba(50, 60, 110, 0.35);
}

.card,
.sheet,
.modal,
.overlay-panel,
.drawer {
  background: #ffffff;
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.list-item:active { background: #f5f2ff; }
.list-item { border-bottom-color: var(--line); }

.input,
.select,
.textarea {
  background: #ffffff;
  border-color: var(--line-strong);
  color: var(--text);
}

.input::placeholder,
.textarea::placeholder { color: #9aa2b8; }

.chip {
  background: #f8f7ff;
  border-color: var(--line);
  color: #4b5563;
}

.chip.active,
.chip[aria-pressed="true"] {
  background: #f3edff;
  border-color: rgba(124, 58, 237, 0.35);
  color: #6d28d9;
}

.btn-ghost {
  background: #ffffff;
  border-color: var(--line);
  color: #5f6880;
}

.notice {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.code,
pre.code {
  background: #f7f5ff;
  border-color: rgba(124, 58, 237, 0.16);
  color: #2b2440;
}

.skeleton {
  background: #edeff8;
}

.toast {
  background: #ffffff;
  color: var(--text);
  border-color: var(--line);
  box-shadow: 0 18px 44px -24px rgba(50, 60, 110, 0.4);
}

.badge-violet { color: #6d28d9; background: #f3edff; border-color: rgba(124, 58, 237, 0.22); }
.badge-cyan { color: #0e7490; background: #ecfeff; border-color: rgba(8, 145, 178, 0.22); }
.badge-emerald { color: #047857; background: #ecfdf5; border-color: rgba(5, 150, 105, 0.22); }
.badge-amber { color: #92400e; background: #fffbeb; border-color: rgba(180, 83, 9, 0.22); }
.badge-rose { color: #be123c; background: #fff1f2; border-color: rgba(225, 29, 72, 0.2); }

::selection { background: rgba(124, 58, 237, 0.2); }

/* 首页组件（内联样式优先级较高，使用 !important 统一浅色） */
.ljsk-hero,
.ljw-hero,
.ljme-hero {
  background: linear-gradient(160deg, #ffffff, #f6f2ff 70%) !important;
  border-color: rgba(124, 58, 237, 0.18) !important;
  box-shadow: 0 18px 44px -36px rgba(80, 60, 160, 0.35) !important;
}
.ljsk-kicker { color: #6d28d9 !important; }
.ljsk-title,
.ljsk-sub { color: #1f2333 !important; }
.ljsk-sub { color: #5f6880 !important; }
.ljw-label,
.ljw-note,
.ljw-stats span { color: #5f6880 !important; }
.ljw-label { color: #3f475c !important; }
.ljw-balance,
.ljw-stats b { color: #1f2333 !important; }
.ljw-balance small { color: #6d28d9 !important; }
.ljw-hero .icon-btn { color: #6d28d9 !important; }
.ljme-name,
.ljme-credits-value { color: #1f2333 !important; }
.ljme-meta,
.ljme-credits-label { color: #5f6880 !important; }
.ljme-credits-value small { color: #6d28d9 !important; }
.ljme-hero .icon-btn { color: #6d28d9 !important; }

/* 底部导航激活态：浅色下用深紫，避免近白不可见 */
.tabbar-item.active,
.tabbar-item[aria-current="page"],
.tabbar-item[aria-selected="true"],
.h5-tabbar-item.active {
  color: #6d28d9 !important;
}
.tabbar-item.active .icon,
.tabbar-item[aria-current="page"] .icon,
.tabbar-item[aria-selected="true"] .icon {
  color: #6d28d9 !important;
  filter: none !important;
}
.tabbar-item.active::before,
.tabbar-item[aria-current="page"]::before,
.tabbar-item[aria-selected="true"]::before {
  background: #7c3aed !important;
}

/* 页内 tabs / segmented 激活态 */
.tabs { background: #f8f9ff !important; }
.tab.active,
.tab[aria-selected="true"] {
  background: #f3edff !important;
  color: #6d28d9 !important;
}
.segmented { background: #f8f9ff !important; }
.segmented > button.active,
.segmented > button[aria-selected="true"] {
  background: #f3edff !important;
  color: #6d28d9 !important;
}

/* 市场筛选：只展示热门模型，换行不横向溢出 */
.mkt-chips {
  flex-wrap: wrap !important;
  overflow-x: visible !important;
  gap: 6px;
}
.mkt-chips .chip { flex: none !important; max-width: 100%; }

/* 市场卡片价格 / 可用率 / 技能详情链接 */
.mkt-card-price b { color: #6d28d9 !important; }
.mkt-card-price span { color: #5f6880 !important; }
.mkt-metric-value.is-ok { color: #047857 !important; }
.mkt-metric-label { color: #5f6880 !important; }
.ljsk-card-cta,
.ljsk-balance-line a { color: #6d28d9 !important; }
.ljsk-balance-line { color: #5f6880 !important; }
.ljsk-balance-line b { color: #1f2333 !important; }
.field-label,
label { color: #3f475c; }
.field > label { color: #3f475c !important; }
.ljsk-hero-meta,
.ljsk-hero .dim { color: #5f6880 !important; }
.hint { color: #7a8399 !important; }
.h5h-balance {
  background:
    radial-gradient(120% 110% at 6% 0%, rgba(124, 58, 237, 0.12), transparent 58%),
    linear-gradient(150deg, #ffffff, #f5f2ff) !important;
  border-color: rgba(124, 58, 237, 0.22) !important;
  box-shadow: 0 20px 46px -34px rgba(80, 60, 160, 0.35) !important;
}
.h5h-eyebrow { color: #6d28d9 !important; }
.h5h-refresh { color: #6d28d9 !important; }
.h5h-refresh:active { background: #f1efff !important; }
.h5h-balance-value { color: #1f2333 !important; }
.h5h-balance-value small { color: #6d28d9 !important; }
.h5h-balance-note { color: #5f6880 !important; }
.h5h-stats { border-top-color: var(--line) !important; }
.h5h-stat span { color: #5f6880 !important; }
.h5h-stat b { color: #1f2333 !important; }

.h5h-quick-item {
  background: #ffffff !important;
  border-color: var(--line) !important;
  color: #1f2333 !important;
}
.h5h-quick-item:active { background: #f5f2ff !important; }
.h5h-quick-icon {
  background: #f3edff !important;
  border-color: rgba(124, 58, 237, 0.22) !important;
  color: #6d28d9 !important;
}
.h5h-quick-sub { color: #8a92a8 !important; }

.h5h-card {
  background: #ffffff !important;
  border-color: var(--line) !important;
  box-shadow: 0 16px 40px -32px rgba(50, 60, 110, 0.28) !important;
}
.h5h-card-title { color: #1f2333 !important; }
.h5h-card-title > .icon { color: #7c3aed !important; }
.h5h-count { background: #f3edff !important; color: #6d28d9 !important; }
.h5h-action {
  background: #ffffff !important;
  border-color: var(--line-strong) !important;
  color: #5f6880 !important;
}
.h5h-action:active { background: #f5f2ff !important; }
.h5h-more { color: #6d28d9 !important; }
.h5h-warn {
  background: #fffbeb !important;
  border-color: #fde68a !important;
  color: #92400e !important;
}
.h5h-warn-btn { color: #78350f !important; }
.h5h-notif { border-bottom-color: var(--line) !important; color: #1f2333 !important; }
.h5h-notif:active { background: #f5f2ff !important; }
.h5h-notif-icon {
  background: #f3edff !important;
  border-color: rgba(124, 58, 237, 0.22) !important;
  color: #6d28d9 !important;
}
.h5h-notif-title { color: #1f2333 !important; }
.h5h-notif-desc { color: #5f6880 !important; }
.h5h-notif-time { color: #8a92a8 !important; }
