/* h5-engine · base.css — reset 补充 + @font-face + 组件类（引用 theme.css 的 token）。
   页面级布局用 Tailwind；组件基线样式在这里，保证组件开箱好看、不依赖 tailwind。 */

/* 字体本地化：woff2 放 vendor/fonts/。缺文件时自动回退到系统字，不报错。 */
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../vendor/fonts/SpaceGrotesk-Variable.woff2") format("woff2");
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--fg);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* 移动端画布：桌面预览时居中成手机宽（form-mobile） */
.h5-app { max-width: 480px; min-height: 100vh; margin: 0 auto; background: var(--bg); position: relative; }

/* 桌面/大屏画布：全宽流式（form-desktop：驾驶舱/看板/后台），与 .h5-app 二选一 */
.app-desktop { min-height: 100vh; background: var(--bg); position: relative; }
.app-desktop .shell { max-width: 1440px; margin: 0 auto; padding: 0 24px; }

/* 桌面 hover 基线：仅真实指针设备生效，不影响触屏 */
@media (hover: hover) {
  .btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px color-mix(in srgb, var(--fg) 12%, transparent); }
  .card.hoverable:hover, .kpi-card:hover { border-color: var(--brand); transition: border-color .15s; }
}

/* ---- 卡片 / 容器 ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; margin: 20px 4px 10px; text-transform: uppercase; }

/* ---- 按钮 ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; justify-content: center; padding: 10px 18px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-weight: 600; cursor: pointer; transition: transform .12s, box-shadow .12s, background .15s, opacity .15s; }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; border-color: transparent; box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 40%, transparent); }
.btn-accent { background: var(--accent); color: #fff; border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-block { display: flex; width: 100%; }

/* ---- badge / tag ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.badge.hot { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge.new { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }

/* ---- 星级 ---- */
.stars .star-on { color: var(--brand-2); fill: var(--brand-2); }
.stars .star-off { color: var(--border); fill: var(--border); }

/* ---- KPI 卡 ---- */
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-ic { color: var(--brand); }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 4px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); }
.kpi-delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; }
.kpi-delta.up { color: var(--accent); } .kpi-delta.down { color: var(--danger); }
.spark { color: var(--brand); }

/* ---- 图表 ---- */
.chart .bar { fill: var(--brand); transition: fill .15s; }
.chart .bar:hover { fill: var(--brand-2); }
.chart .bar-x { font-size: 10px; fill: var(--muted); }
.line-chart, .bar-chart { overflow: visible; }

/* ---- 空状态 ---- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-ic { color: var(--border); margin-bottom: 10px; }
.empty-title { font-weight: 700; color: var(--fg); }
.empty-desc { font-size: 13px; margin-top: 4px; }
.empty-action { margin-top: 16px; }

/* ---- 模态标题 ---- */
.h5-modal__title { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.h5-modal__body { color: var(--muted); font-size: 14px; line-height: 1.6; }

/* 网格工具 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
