/* ============================================================
   H5 框架样式 v2：高端 Web 工具站设计系统
   关键词：克制留白 / 低饱和色 / 统一图标 / 精致阴影 / 现代字体层级
   ============================================================ */

:root {
  /* 色板 */
  --c-bg: #F8FAFC;
  --c-surface: #FFFFFF;
  --c-elevated: #FFFFFF;
  --c-border: #E2E8F0;
  --c-border-light: #F1F5F9;
  --c-text-primary: #0F172A;
  --c-text-secondary: #475569;
  --c-text-tertiary: #94A3B8;
  --c-primary: #2563EB;
  --c-primary-dark: #1D4ED8;
  --c-success: #10B981;
  --c-warning: #F59E0B;
  --c-danger: #EF4444;
  --c-info: #0EA5E9;
  --c-vip: #4F46E5;

  /* 功能色（轻量背景） */
  --c-office-bg: #E0F2FE;
  --c-office-text: #0369A1;
  --c-hse-bg: #D1FAE5;
  --c-hse-text: #047857;
  --c-amber-bg: #FFFBEB;
  --c-amber-text: #B45309;
  --c-primary-bg: #EEF2FF;
  --c-primary-text: #4338CA;
  --c-purple-bg: #F3E8FF;
  --c-purple-text: #7E22CE;
  --c-rose-bg: #FFE4E6;
  --c-rose-text: #BE123C;
  --c-slate-bg: #F1F5F9;
  --c-slate-text: #475569;

  /* 尺寸 */
  --nav-h: 56px;
  --tabbar-h: 60px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.07), 0 4px 6px -2px rgba(15, 23, 42, 0.03);

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text-primary);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  /* .page 自己会留足 tabBar 高度，body 不再额外补，避免双重空白 */
  padding-bottom: 0;
}
a { color: inherit; text-decoration: none; }

.page {
  max-width: 960px; margin: 0 auto;
  padding: calc(var(--nav-h) + 12px) 16px calc(var(--tabbar-h) + 44px);
}

/* ---------- 顶部导航栏 ---------- */
.app-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}
.nav-back {
  border: none; background: transparent; cursor: pointer;
  width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-primary);
}
.nav-back svg { width: 22px; height: 22px; }
.nav-title {
  flex: 1; text-align: center;
  font-size: 17px; font-weight: 600; letter-spacing: 0.2px;
}
.nav-right { min-width: 64px; display: flex; justify-content: flex-end; }
.nav-login-btn {
  appearance: none; border: none; cursor: pointer;
  background: var(--c-primary); color: #fff;
  padding: 6px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
  transition: transform .1s, background .2s;
}
.nav-login-btn:active { transform: scale(0.97); }
.nav-login-btn.ghost {
  background: #fff; color: var(--c-text-secondary);
  box-shadow: inset 0 0 0 1px var(--c-border);
}

/* ---------- 底部 tabBar（悬浮 dock） ---------- */
.tab-bar {
  position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 60;
  height: var(--tabbar-h);
  width: min(560px, calc(100vw - 24px));
  display: flex;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid var(--c-border);
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--c-text-tertiary); font-size: 11px; font-weight: 500;
  cursor: pointer; transition: color .15s;
}
.tab-item .tab-icon { width: 22px; height: 22px; }
.tab-item.active { color: var(--c-primary); }
.tab-item:active { opacity: 0.8; }

/* ---------- 分类大卡 ---------- */
.cat-grid { display: flex; flex-direction: column; gap: 12px; }
.cat-card {
  position: relative; overflow: hidden;
  background: var(--c-surface); border-radius: 16px; padding: 16px;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: transform .12s, box-shadow .2s;
}
.cat-card:active { transform: scale(0.992); }
.cat-card .cat-icon-wrap {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.cat-card .cat-icon-wrap svg { width: 26px; height: 26px; }
.cat-info { flex: 1; min-width: 0; }
.cat-name { font-size: 16px; font-weight: 600; display: block; color: var(--c-text-primary); }
.cat-desc { font-size: 13px; color: var(--c-text-secondary); margin-top: 3px; display: block; }
.cat-tags { margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cat-tool-count {
  font-size: 11px; color: var(--c-text-tertiary);
  background: var(--c-border-light); border-radius: 6px; padding: 2px 7px; font-weight: 500;
}
.cat-cost-free { font-size: 11px; color: var(--c-success); background: rgba(16,185,129,0.10); border-radius: 6px; padding: 2px 7px; font-weight: 500; }
.cat-cost-partial { font-size: 11px; color: var(--c-warning); background: rgba(245,158,11,0.10); border-radius: 6px; padding: 2px 7px; font-weight: 500; }
.cat-arrow { color: var(--c-text-tertiary); width: 20px; height: 20px; opacity: 0.5; }

/* 分类图标背景（柔和版） */
.mesh-primary { background: var(--c-primary-bg); color: var(--c-primary-text); }
.mesh-office  { background: var(--c-office-bg); color: var(--c-office-text); }
.mesh-hse     { background: var(--c-hse-bg); color: var(--c-hse-text); }
.mesh-purple  { background: var(--c-purple-bg); color: var(--c-purple-text); }
.mesh-amber   { background: var(--c-amber-bg); color: var(--c-amber-text); }
.mesh-rose    { background: var(--c-rose-bg); color: var(--c-rose-text); }
.mesh-slate   { background: var(--c-slate-bg); color: var(--c-slate-text); }

/* ---------- 区块标题 ---------- */
.section-title { display: flex; align-items: baseline; gap: 8px; margin: 24px 4px 12px; }
.section-title .st-main { font-size: 17px; font-weight: 600; color: var(--c-text-primary); }
.section-title .st-sub { font-size: 13px; color: var(--c-text-tertiary); font-weight: 400; }

/* ---------- 工具列表卡 ---------- */
.tools-list { display: flex; flex-direction: column; gap: 10px; }
.tool-card {
  background: var(--c-surface); border-radius: 14px; padding: 14px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-xs);
  cursor: pointer; transition: background .1s, transform .1s, box-shadow .2s;
}
.tool-card:active { transform: scale(0.992); box-shadow: var(--shadow-sm); }
.tool-card .tool-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.tool-card .tool-icon svg { width: 22px; height: 22px; }
.tool-card .tool-body { flex: 1; min-width: 0; }
.tool-card .tool-name { font-size: 15px; font-weight: 600; display: block; color: var(--c-text-primary); }
.tool-card .tool-desc { font-size: 13px; color: var(--c-text-secondary); margin-top: 2px; display: block; }
.tool-card .tool-cost {
  font-size: 11px; margin-left: auto; flex-shrink: 0;
  padding: 3px 9px; border-radius: 20px; font-weight: 500;
}
.tool-cost-free { color: var(--c-success); background: rgba(16,185,129,0.10); }
.tool-cost-points { color: var(--c-warning); background: rgba(245,158,11,0.10); }

/* ---------- 常用工具网格 ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 8px 0; border-radius: 14px; cursor: pointer; transition: background .15s;
}
.quick-item:active { background: var(--c-border-light); }
.quick-icon {
  width: 52px; height: 52px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
}
.quick-icon svg { width: 24px; height: 24px; }
.quick-name { font-size: 12px; color: var(--c-text-secondary); font-weight: 500; }
.quick-cost { font-size: 10px; font-weight: 500; }

/* ---------- 横幅 / 通用卡片 ---------- */
.banner {
  border-radius: 16px; padding: 18px 16px; color: #fff; margin-bottom: 12px;
  display: flex; align-items: center; gap: 14px;
  border: 1px solid transparent;
  cursor: pointer; transition: transform .12s, box-shadow .2s;
}
.banner:active { transform: scale(0.992); }
.banner-amber {
  background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.22);
}
.banner-vip {
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 50%, #4F46E5 100%);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}
.banner h3 { margin: 0; font-size: 16px; font-weight: 600; }
.banner p { margin: 4px 0 0; font-size: 13px; opacity: 0.92; }
.banner svg { width: 28px; height: 28px; flex-shrink: 0; }

.card { background: var(--c-surface); border-radius: 16px; padding: 16px; border: 1px solid var(--c-border); box-shadow: var(--shadow-xs); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 10px; padding: 12px 18px; font-size: 15px; font-weight: 500;
  cursor: pointer; background: var(--c-primary); color: #fff;
  transition: transform .1s, background .2s, box-shadow .2s;
}
.btn.block { width: 100%; }
.btn.ghost { background: var(--c-surface); color: var(--c-primary); border: 1px solid var(--c-border); }
.btn.amber { background: linear-gradient(135deg, #F59E0B, #F97316); color: #fff; }
.btn.danger { background: var(--c-danger); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(0.98); }

/* ---------- Toast ---------- */
.h5-toast {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(0.96);
  background: rgba(15, 23, 42, 0.88); color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 14px; z-index: 999; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: 80%; text-align: center; box-shadow: var(--shadow-lg);
}
.h5-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- Loading ---------- */
.h5-loading-mask {
  position: fixed; inset: 0; background: rgba(248, 250, 252, 0.6); z-index: 998;
  display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.h5-loading-mask.show { opacity: 1; pointer-events: auto; }
.h5-loading-box { background: #fff; border-radius: 14px; padding: 20px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; box-shadow: var(--shadow-lg); }
.h5-spinner { width: 26px; height: 26px; border: 3px solid #E2E8F0; border-top-color: var(--c-primary); border-radius: 50%; animation: h5spin .8s linear infinite; }
@keyframes h5spin { to { transform: rotate(360deg); } }
.h5-loading-text { font-size: 14px; color: var(--c-text-secondary); }

/* ---------- Modal ---------- */
.h5-modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.35); z-index: 997;
  display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.h5-modal-mask.show { opacity: 1; pointer-events: auto; }
.h5-modal {
  width: 84%; max-width: 340px; background: #fff; border-radius: 18px; padding: 22px;
  transform: translateY(10px); transition: transform .2s; box-shadow: var(--shadow-lg);
}
.h5-modal-mask.show .h5-modal { transform: translateY(0); }
.h5-modal-title { font-size: 17px; font-weight: 600; text-align: center; margin-bottom: 10px; color: var(--c-text-primary); }
.h5-modal-content { font-size: 14px; color: var(--c-text-secondary); text-align: center; line-height: 1.6; }
.h5-modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.h5-modal-btn { flex: 1; border: none; border-radius: 10px; padding: 12px 0; font-size: 15px; font-weight: 500; cursor: pointer; transition: background .15s; }
.h5-modal-btn.cancel { background: var(--c-border-light); color: var(--c-text-secondary); }
.h5-modal-btn.primary { background: var(--c-primary); color: #fff; }

/* ---------- 空状态 / 底部 ---------- */
.empty { text-align: center; color: var(--c-text-tertiary); padding: 36px 0; font-size: 14px; }
.safe-bottom { height: 12px; }
.footer-info { text-align: center; padding: 28px 0 8px; color: var(--c-text-tertiary); font-size: 12px; line-height: 1.8; }
.footer-info a, .footer-link { color: var(--c-text-secondary); cursor: pointer; transition: color .15s; }
.footer-link:hover { color: var(--c-primary); }
.footer-link-divider { margin: 0 6px; }

/* fade-in */
.fade-in-up { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ============================================================
   证照 / 设备 / 台账类页面
   ============================================================ */
.cost-tip {
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.18);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; text-align: center;
}
.cost-tip-text { font-size: 13px; color: #B45309; }

.rec-header {
  border-radius: 18px; padding: 18px; color: #fff; margin-bottom: 14px;
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}
.rec-header-title { font-size: 18px; font-weight: 600; }
.rec-header-sub { font-size: 13px; opacity: 0.9; margin-top: 4px; }
.rec-stats { display: flex; margin-top: 16px; gap: 0; }
.rec-stat { flex: 1; display: flex; flex-direction: column; align-items: center; }
.rec-stat-num { font-size: 22px; font-weight: 700; }
.rec-stat-label { font-size: 12px; opacity: 0.9; margin-top: 3px; }
.rec-stat:not(:last-child) { border-right: 1px solid rgba(255,255,255,0.22); }

/* 分段控件 */
.seg-control {
  display: flex; background: var(--c-surface); border-radius: 12px; padding: 4px; gap: 4px;
  margin-bottom: 14px; border: 1px solid var(--c-border); box-shadow: var(--shadow-xs);
}
.seg-item {
  flex: 1; border: none; background: transparent; border-radius: 9px; padding: 9px 0;
  font-size: 14px; font-weight: 500; color: var(--c-text-secondary); cursor: pointer; transition: all .2s;
}
.seg-item.active { background: var(--c-primary); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,0.22); }

/* 搜索栏 */
.search-bar {
  display: flex; align-items: center; gap: 8px; background: var(--c-surface); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 14px; border: 1px solid var(--c-border); box-shadow: var(--shadow-xs);
}
.search-bar .search-svg { width: 18px; height: 18px; color: var(--c-text-tertiary); flex-shrink: 0; }
.search-bar .search-input { flex: 1; border: none; outline: none; font-size: 14px; background: transparent; color: var(--c-text-primary); }
.search-bar .search-input::placeholder { color: var(--c-text-tertiary); }
.search-clear { width: 20px; height: 20px; color: var(--c-text-tertiary); cursor: pointer; flex-shrink: 0; }

/* 记录列表 */
.record-list { display: flex; flex-direction: column; gap: 10px; }
.record-card {
  position: relative; background: var(--c-surface); border-radius: 14px; overflow: hidden;
  display: flex; border: 1px solid var(--c-border); box-shadow: var(--shadow-xs); padding: 14px 14px 14px 18px;
}
.status-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 4px 0 0 4px; }
.status-normal { background: var(--c-success); }
.status-warning { background: var(--c-warning); }
.status-expired { background: var(--c-danger); }
.status-unknown { background: var(--c-text-tertiary); }
.card-body { flex: 1; min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; flex-shrink: 0; font-weight: 500; }
.status-badge.status-normal { color: var(--c-success); background: rgba(16,185,129,0.10); }
.status-badge.status-warning { color: #B45309; background: rgba(245,158,11,0.12); }
.status-badge.status-expired { color: var(--c-danger); background: rgba(239,68,68,0.10); }
.status-badge.status-unknown { color: var(--c-text-secondary); background: var(--c-border-light); }
.card-info { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.info-row { display: flex; gap: 8px; font-size: 13px; }
.info-label { color: var(--c-text-tertiary); flex-shrink: 0; width: 76px; }
.info-value { color: var(--c-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-footer { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; padding-right: 40px; }
.expiry-info { display: flex; flex-direction: column; gap: 2px; }
.expiry-label { font-size: 11px; color: var(--c-text-tertiary); }
.expiry-date { font-size: 13px; font-weight: 600; color: var(--c-text-primary); }
.days-left { font-size: 13px; font-weight: 600; }
.text-danger { color: var(--c-danger); }
.text-warn { color: #B45309; }
.text-normal { color: var(--c-success); }
.card-del {
  position: absolute; right: 10px; bottom: 10px; border: none; background: #FEF2F2; color: var(--c-danger);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.card-del svg { width: 16px; height: 16px; }

.load-more { text-align: center; color: var(--c-text-secondary); font-size: 13px; padding: 16px 0; cursor: pointer; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 52px 0; color: var(--c-text-tertiary); gap: 14px; }
.empty-state svg { width: 48px; height: 48px; opacity: 0.35; }
.empty-text { white-space: pre-line; text-align: center; font-size: 14px; line-height: 1.7; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 28px 0; color: var(--c-text-secondary); font-size: 13px; }
.loading-spinner { width: 18px; height: 18px; border: 2px solid #E2E8F0; border-top-color: var(--c-primary); border-radius: 50%; animation: h5spin .8s linear infinite; }

.bottom-bar { position: fixed; left: 0; right: 0; bottom: var(--tabbar-h); z-index: 40; padding: 10px 16px; background: rgba(255,255,255,0.94); backdrop-filter: blur(8px); border-top: 1px solid var(--c-border); display: flex; gap: 10px; justify-content: center; align-items: center; }
.bottom-bar .btn { padding: 11px 22px; font-size: 15px; }
.bottom-bar .add-btn { width: auto; flex: 0 1 auto; box-shadow: 0 4px 14px rgba(37,99,235,0.22); }

/* 页面内删除弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.35); z-index: 997; display: none; align-items: center; justify-content: center; }
.modal-mask.show { display: flex; }
.modal-content { width: 84%; max-width: 340px; background: #fff; border-radius: 18px; padding: 22px; box-shadow: var(--shadow-lg); }
.modal-title { font-size: 17px; font-weight: 600; text-align: center; color: var(--c-text-primary); }
.modal-desc { font-size: 14px; color: var(--c-text-secondary); text-align: center; margin-top: 12px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-btn { flex: 1; border: none; border-radius: 10px; padding: 12px 0; font-size: 15px; font-weight: 500; cursor: pointer; }
.modal-cancel { background: var(--c-border-light); color: var(--c-text-secondary); }
.modal-confirm { background: var(--c-danger); color: #fff; }

/* ============================================================
   编辑 / 添加表单页
   ============================================================ */
.edit-wrap { display: flex; flex-direction: column; gap: 12px; }
.upload-card, .form-card {
  background: var(--c-surface); border-radius: 14px; padding: 16px;
  border: 1px solid var(--c-border); box-shadow: var(--shadow-xs);
}
.upload-title { font-size: 15px; font-weight: 600; color: var(--c-text-primary); }
.upload-hint { font-size: 13px; color: var(--c-text-tertiary); margin-top: 4px; line-height: 1.5; }
.img-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.img-thumb { position: relative; width: 74px; height: 74px; border-radius: 10px; overflow: hidden; border: 1px solid var(--c-border); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-del { position: absolute; top: 3px; right: 3px; border: none; background: rgba(15,23,42,0.55); color: #fff; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.img-del svg { width: 12px; height: 12px; }
.upload-btn {
  display: inline-flex; align-items: center; justify-content: center; margin-top: 12px;
  border: 1px dashed var(--c-border); border-radius: 10px; padding: 10px 16px;
  color: var(--c-text-secondary); font-size: 13px; cursor: pointer; background: var(--c-bg);
  transition: border-color .15s, background .15s;
}
.upload-btn svg { width: 18px; height: 18px; margin-right: 6px; color: var(--c-text-tertiary); }
.upload-btn:active { background: var(--c-border-light); }

.recog-btn { margin-bottom: 2px; }
.recog-err { background: #FEF2F2; color: var(--c-danger); font-size: 13px; padding: 10px 12px; border-radius: 8px; line-height: 1.5; }

.form-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--c-border-light); color: var(--c-text-primary); }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row label { font-size: 13px; color: var(--c-text-secondary); font-weight: 500; }
.form-row .req { color: var(--c-danger); }
.form-control {
  border: 1px solid var(--c-border); border-radius: 10px; padding: 10px 12px; font-size: 14px;
  outline: none; background: #fff; color: var(--c-text-primary); width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
textarea.form-control { resize: vertical; font-family: inherit; }

.save-btn { margin-top: 4px; }
.del-btn { margin-top: 12px; }

/* 兼容旧版 emoji 占位 */
.icon-letter {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: inherit;
}

/*  mine 页特殊 */
.mine-header {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 16px;
  padding: 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-xs); margin-bottom: 14px;
}
.mine-header-guest {
  background: linear-gradient(135deg, #3730A3 0%, #2563EB 100%);
  border: none; color: #fff;
}
.mine-header-guest .mine-sub { color: rgba(255,255,255,.75); }
.mine-header-guest .mine-arrow { color: rgba(255,255,255,.6); }
.mine-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.mine-avatar svg { width: 28px; height: 28px; }
.mine-info { flex: 1; }
.mine-name { font-size: 17px; font-weight: 600; }
.mine-sub { font-size: 13px; color: var(--c-text-tertiary); margin-top: 3px; }
.mine-arrow { color: var(--c-text-tertiary); width: 20px; height: 20px; opacity: 0.5; }

.asset-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 16px;
  padding: 14px; box-shadow: var(--shadow-xs); margin-bottom: 14px;
}
.asset-cell { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.asset-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.asset-icon svg { width: 20px; height: 20px; }
.asset-icon.blue { background: #EFF6FF; color: #2563EB; }
.asset-icon.purple { background: #F3E8FF; color: #7E22CE; }
.asset-icon.green { background: #D1FAE5; color: #047857; }
.asset-num { font-size: 18px; font-weight: 700; color: var(--c-text-primary); }
.asset-label { font-size: 12px; color: var(--c-text-tertiary); }

.menu-group { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-xs); margin-bottom: 14px; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; transition: background .1s; }
.menu-item:active { background: var(--c-bg); }
.menu-item + .menu-item { border-top: 1px solid var(--c-border-light); }
.menu-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.menu-icon svg { width: 20px; height: 20px; }
.menu-icon.blue { background: #EFF6FF; color: #2563EB; }
.menu-icon.purple { background: #F3E8FF; color: #7E22CE; }
.menu-icon.amber { background: #FFFBEB; color: #B45309; }
.menu-icon.green { background: #D1FAE5; color: #047857; }
.menu-icon.slate { background: #F1F5F9; color: #475569; }
.menu-icon.indigo { background: #EEF2FF; color: #4338CA; }
.menu-icon.gray { background: #F8FAFC; color: #64748B; }
.menu-icon.red { background: #FEF2F2; color: #DC2626; }
.menu-body { flex: 1; }
.menu-name { font-size: 15px; font-weight: 500; color: var(--c-text-primary); }
.menu-desc { font-size: 12px; color: var(--c-text-tertiary); margin-top: 2px; }
.menu-arrow { width: 18px; height: 18px; color: var(--c-text-tertiary); opacity: 0.5; }
.menu-item.danger .menu-name { color: var(--c-danger); }

/* 响应式：宽屏居中、窄屏自然 */
@media (min-width: 768px) {
  .page { padding-left: 24px; padding-right: 24px; }
}

/* ============================================================
   登录弹层
   ============================================================ */
.login-mask { align-items: flex-end; }
.login-modal-box {
  width: 100%; max-width: 420px; border-radius: 20px 20px 0 0;
  padding: 22px 22px 28px; position: relative;
  transform: translateY(20px);
}
@media (min-width: 420px) {
  .login-mask { align-items: center; }
  .login-modal-box { border-radius: 20px; max-width: 360px; }
}
.login-close {
  position: absolute; top: 14px; right: 16px; width: 30px; height: 30px;
  border: none; background: transparent; color: var(--c-text-tertiary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.login-close svg { width: 18px; height: 18px; }
.login-tabs {
  display: flex; background: var(--c-bg); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 22px;
}
.login-tab {
  flex: 1; border: none; background: transparent; border-radius: 9px; padding: 10px 0;
  font-size: 15px; font-weight: 500; color: var(--c-text-secondary); cursor: pointer; transition: all .2s;
}
.login-tab.active { background: #fff; color: var(--c-primary); box-shadow: var(--shadow-sm); }
.login-scan-tip {
  text-align: center; font-size: 14px; color: var(--c-text-secondary); margin-bottom: 18px; line-height: 1.6;
}
.login-pane .field {
  background: var(--c-bg); border-radius: 10px; padding: 0 12px; border: 1px solid var(--c-border);
  display: flex; align-items: center; margin-bottom: 12px;
}
.login-pane .field input {
  flex: 1; border: none; background: transparent; outline: none; padding: 12px 0;
  font-size: 15px; color: var(--c-text-primary);
}
.login-pane .row { display: flex; gap: 10px; }
.login-pane .row .field { flex: 1; margin-bottom: 0; }
.login-pane .row .btn { flex-shrink: 0; padding: 0 16px; }
.login-pane .btn.wechat { background: #07C160; color: #fff; }
.login-pane .btn.wechat:active { background: #06AD56; }


.login-cloud-tip {
  background: #fff7ed; color: #b45309;
  border: 1px solid #fed7aa; border-radius: 8px;
  padding: 10px 12px; font-size: 13px; line-height: 1.5; margin-bottom: 12px;
}

/* ============================================================
   会员 / 充值 / 新手导航
   ============================================================ */
.vip-hero {
  border-radius: 18px; padding: 28px 20px; text-align: center; margin-bottom: 14px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}
.vip-hero-icon { margin: 0 auto 14px; width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; }
.vip-hero-icon svg { width: 28px; height: 28px; }
.vip-hero h2 { margin: 0; font-size: 22px; font-weight: 700; }
.vip-hero p { margin: 8px 0 0; font-size: 14px; opacity: 0.92; }

.vip-plans { display: flex; flex-direction: column; gap: 12px; }
.vip-plan {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 16px;
  padding: 16px; box-shadow: var(--shadow-xs); cursor: pointer; transition: transform .12s, box-shadow .2s, border-color .2s;
  border-left: 4px solid var(--plan-color);
}
.vip-plan:active { transform: scale(0.992); }
.vip-plan-head { display: flex; align-items: center; justify-content: space-between; }
.vip-plan-name { font-size: 17px; font-weight: 600; }
.vip-plan-tag { font-size: 11px; padding: 3px 9px; border-radius: 20px; font-weight: 500; }
.vip-plan-price { font-size: 32px; font-weight: 700; color: var(--plan-color); margin-top: 10px; }
.vip-unit { font-size: 16px; margin-right: 2px; }
.vip-plan-desc { font-size: 13px; color: var(--c-text-secondary); margin-top: 4px; }
.vip-plan-mask {
  position: absolute; inset: 0; background: rgba(248, 250, 252, 0.78);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; color: var(--c-text-tertiary);
  pointer-events: none;
}
.vip-plan { position: relative; }
.vip-plan.current,
.vip-plan.owned {
  opacity: 0.85; cursor: default; border-color: var(--c-border-light);
}
.vip-plan.current .vip-plan-price,
.vip-plan.owned .vip-plan-price { color: var(--c-text-tertiary); }
.vip-plan.upgrade { border-left-color: var(--c-warning); }

.vip-tip { margin-top: 18px; font-size: 12px; color: var(--c-text-tertiary); line-height: 1.8; }
.vip-tip p { margin: 0; }

.recharge-list { display: flex; flex-direction: column; gap: 10px; }
.recharge-card {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 14px;
  padding: 16px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-xs); cursor: pointer; transition: background .1s, transform .1s;
}
.recharge-card:active { transform: scale(0.992); background: var(--c-bg); }
.recharge-points { font-size: 24px; font-weight: 700; color: var(--c-text-primary); }
.recharge-points span { font-size: 14px; font-weight: 500; margin-left: 4px; color: var(--c-text-secondary); }
.recharge-tag { font-size: 12px; color: var(--c-text-tertiary); margin-top: 4px; }
.recharge-price { font-size: 18px; font-weight: 700; color: var(--c-primary); }

.guide-list { display: flex; flex-direction: column; gap: 12px; }
.guide-step {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 14px;
  padding: 14px; display: flex; gap: 12px; box-shadow: var(--shadow-xs);
}
.guide-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.guide-body { flex: 1; }
.guide-title { font-size: 15px; font-weight: 600; color: var(--c-text-primary); }
.guide-desc { font-size: 13px; color: var(--c-text-secondary); margin-top: 4px; line-height: 1.5; }

/* ============================================================
   图片工具上传区（扫描/压缩/转换/P图/AI识别 共用）
   这批页面使用 .upload-area 结构，此前样式缺失导致上传入口不可见
   ============================================================ */
.section { margin-bottom: 16px; }
.section-label { font-size: 15px; font-weight: 600; color: var(--c-text-primary); margin-bottom: 10px; }
.upload-area {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 180px; padding: 24px 16px;
  background: var(--c-surface); border: 2px dashed var(--c-primary);
  border-radius: 16px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.upload-area:active { background: var(--c-primary-bg); }
.upload-icon-box { font-size: 40px; line-height: 1; }
.upload-area .upload-hint { margin-top: 0; font-size: 15px; font-weight: 600; color: var(--c-primary); }
.upload-sub { font-size: 13px; color: var(--c-text-tertiary); }
.image-preview { position: relative; margin-top: 4px; }
.preview-img {
  width: 100%; max-height: 420px; object-fit: contain;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 14px;
}
.image-actions { display: flex; justify-content: center; gap: 12px; margin-top: 10px; }
.img-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; border-radius: 10px; font-size: 14px; font-weight: 500;
  background: var(--c-surface); border: 1px solid var(--c-border);
  color: var(--c-primary); cursor: pointer;
}
.img-btn:active { background: var(--c-border-light); }

.btn-wrap { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }

/* ============================================================
   触控尺寸放大补丁（H5 在宽屏/桌面下原小程序尺寸偏小）
   同特异性后写覆盖，保持移动端观感不变的前提下放大可点区域
   ============================================================ */
.btn { padding: 14px 20px; font-size: 16px; border-radius: 12px; }
.seg-item { padding: 12px 0; font-size: 15px; }
.seg-control { padding: 5px; border-radius: 14px; }
.search-bar { padding: 14px 16px; border-radius: 14px; }
.search-bar .search-svg { width: 20px; height: 20px; }
.search-bar .search-input { font-size: 15px; }
.form-control { padding: 13px 14px; font-size: 15px; border-radius: 12px; }
.form-row label { font-size: 14px; }
.upload-btn { width: 100%; padding: 16px; font-size: 15px; border-width: 2px; border-radius: 12px; }
.upload-btn svg { width: 20px; height: 20px; }
.upload-card, .form-card { padding: 18px; }
.tool-card { padding: 16px; }
.tool-card .tool-icon { width: 48px; height: 48px; }
.tool-card .tool-icon svg { width: 24px; height: 24px; }
.tool-card .tool-name { font-size: 16px; }
.tool-card .tool-desc { font-size: 14px; }
.quick-icon { width: 60px; height: 60px; border-radius: 18px; }
.quick-icon svg { width: 28px; height: 28px; }
.quick-name { font-size: 13px; }
.cat-card { padding: 18px; }
.cat-card .cat-icon-wrap { width: 54px; height: 54px; }
.cat-name { font-size: 17px; }
.img-thumb { width: 88px; height: 88px; }
.img-del { width: 26px; height: 26px; top: 4px; right: 4px; }
.img-del svg { width: 14px; height: 14px; }
.modal-btn { padding: 14px 0; font-size: 16px; border-radius: 12px; }
.nav-login-btn { padding: 8px 16px; font-size: 14px; }
.tab-item { font-size: 12px; }
.tab-item .tab-icon { width: 24px; height: 24px; }
.cost-tip-text { font-size: 14px; }
.upload-title, .form-title, .section-title .st-main { font-size: 16px; }
.upload-hint { font-size: 14px; }

/* ============================================================
   新版式：金刚区 / 工具宫格 / 左右分栏（参考主流工具类 H5）
   ============================================================ */
/* 金刚区：核心入口 4 列宫格 */
.kong-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 6px; }
.kong-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 2px; background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: 14px; cursor: pointer; transition: transform .1s;
}
.kong-item:active { transform: scale(0.97); }
.kong-icon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.kong-icon svg { width: 24px; height: 24px; }
.kong-name { font-size: 12px; font-weight: 600; color: var(--c-text-primary); }

/* 首页 tab 切换（代替整页长列表） */
.home-tabs {
  display: flex; gap: 6px; margin: 18px 0 12px;
  border-bottom: 1px solid var(--c-border); padding-bottom: 0;
}
.home-tab {
  flex: none; padding: 10px 18px; font-size: 15px; font-weight: 500; cursor: pointer;
  color: var(--c-text-secondary); border: none; background: transparent;
  border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0;
}
.home-tab.active { color: var(--c-primary); font-weight: 600; border-bottom-color: var(--c-primary); }

/* 工具宫格：两列紧凑卡（桌面三列） */
.tools-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid-item {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 14px;
  padding: 14px 12px; min-height: 128px; cursor: pointer; transition: transform .1s;
}
.grid-item:active { transform: scale(0.98); }
.grid-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.grid-icon svg { width: 22px; height: 22px; }
.grid-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.grid-name { font-size: 14px; font-weight: 600; color: var(--c-text-primary); line-height: 1.3; }
.grid-cost { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 20px; align-self: flex-start; }
@media (min-width: 720px) {
  .tools-grid { grid-template-columns: repeat(4, 1fr); }
  .kong-grid { grid-template-columns: repeat(8, 1fr); }
}

/* 左右分栏（分类页：左类别栏 + 右工具区） */
.split-layout { display: flex; gap: 10px; align-items: flex-start; }
.side-nav {
  width: 98px; flex-shrink: 0; position: sticky; top: calc(var(--nav-h) + 10px);
  display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - var(--nav-h) - var(--tabbar-h) - 40px);
  overflow-y: auto; scrollbar-width: none;
}
.side-nav::-webkit-scrollbar { display: none; }
.side-item {
  padding: 13px 6px; text-align: center; font-size: 13px; line-height: 1.35;
  color: var(--c-text-secondary); background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: 12px; cursor: pointer; transition: all .15s;
}
.side-item.active {
  background: var(--c-primary); border-color: var(--c-primary);
  color: #fff; font-weight: 600; box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}
.side-content { flex: 1; min-width: 0; }

/* 上传区大图标支持 SVG */
.upload-icon-box svg { width: 42px; height: 42px; }
.btn svg { width: 18px; height: 18px; margin-right: 6px; }
.search-clear svg { width: 18px; height: 18px; }
.img-del svg { width: 14px; height: 14px; }
.q-mark svg, .wb-mark svg { width: 16px; height: 16px; }
.wb-redo-result { display: flex; align-items: center; gap: 6px; }
.wb-redo-result svg { width: 16px; height: 16px; flex-shrink: 0; }

/* 文件在线预览浮层 */
.mini-btn {
  border: 1px solid var(--c-border); background: #fff; color: var(--c-text-secondary);
  font-size: 12px; padding: 5px 10px; border-radius: 7px; cursor: pointer;
}
.mini-btn:disabled { opacity: .4; cursor: not-allowed; }
.mini-btn.danger { color: var(--c-danger); border-color: rgba(239,68,68,.4); background: #FEF2F2; }

.preview-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(15,23,42,.72);
  display: flex; flex-direction: column; padding: 12px;
}
.preview-head { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 2px 10px; }
.preview-title { flex: 1; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-btn { background: rgba(255,255,255,.16); color: #fff; border: none; border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.preview-body { flex: 1; background: #fff; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.preview-body iframe { width: 100%; height: 100%; border: none; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ============ 隐患识别结果卡片 ============ */
.result-header {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
  color: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
}
.result-title { font-size: 16px; font-weight: 700; }
.result-count { font-size: 13px; font-weight: 600; opacity: .95; }
.hazard-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.hazard-item {
  display: flex; gap: 12px; background: #fff; border: 1px solid var(--c-border);
  border-radius: 14px; padding: 14px; box-shadow: var(--shadow-xs);
}
.hazard-level {
  width: 52px; flex-shrink: 0; align-self: flex-start;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 13px; font-weight: 700; padding: 8px 0;
}
.hazard-level.high { background: #FEE2E2; color: #DC2626; }
.hazard-level.medium { background: #FEF3C7; color: #D97706; }
.hazard-level.low { background: #DBEAFE; color: #2563EB; }
.hazard-info { flex: 1; min-width: 0; }
.hazard-name { font-size: 15px; font-weight: 600; color: var(--c-text-primary); display: block; margin-bottom: 6px; }
.hazard-desc { font-size: 13px; color: var(--c-text-secondary); line-height: 1.6; display: block; }
.hazard-standard {
  margin-top: 10px; padding: 10px 12px; background: var(--c-bg); border-radius: 8px;
  font-size: 12px; color: var(--c-text-secondary); line-height: 1.6;
}
.hazard-standard span { color: var(--c-text-tertiary); }
.suggestion-card {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border: 1px solid #BFDBFE; border-radius: 14px; padding: 14px 16px;
}
.suggestion-title { font-size: 14px; font-weight: 700; color: #1E40AF; display: block; margin-bottom: 8px; }
.suggestion-text { font-size: 13px; color: #3730A3; line-height: 1.7; white-space: pre-line; }

/* 隐患条目单字段 AI 优化按钮 */
.opt-btn {
  position: absolute; right: 8px; bottom: 8px;
  background: #FFF7ED; color: #EA580C; border: 1px solid #FED7AA;
  font-size: 11px; padding: 3px 10px; border-radius: 999px; cursor: pointer;
}
.opt-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   图片结果左右对比（原图 | 结果），大屏一屏看全
   ============================================================ */
.compare-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.compare-col { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.compare-label { font-size: 13px; font-weight: 600; color: var(--c-text-secondary); }
.compare-img {
  width: 100%; border-radius: 10px; border: 1px solid var(--c-border);
  max-height: 62vh; object-fit: contain; background: #fff;
}
.compare-img.alpha { background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 50%/16px 16px; }
@media (max-width: 420px) {
  .compare-row { grid-template-columns: 1fr; }
  .compare-img { max-height: 40vh; }
}
/* 预览区重选按钮（替代误用的小圆删除钮） */
.rechoose-row { display: flex; justify-content: flex-end; margin-top: 8px; }

/* 证件照选项（背景色 / 尺寸） */
.opt-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(15,23,42,.12);
  transition: transform .1s, border-color .1s;
}
.swatch.active { border-color: var(--c-primary); transform: scale(1.06); }

/* P 图工具条 */
.tool-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tool-row .btn svg { width: 16px; height: 16px; }
.edit-hint { font-size: 12px; color: var(--c-text-tertiary); text-align: center; margin-top: 8px; }
