/*!
 * theme.css - V5.5 共享设计令牌与跨页组件（三页统一引用）
 * 只做"一致性"：颜色、字号、圆角、焦点、动效、移动端辅助类。
 * 页面自身的布局样式仍保留在各 HTML 内。
 */
:root{
  --primary:#2563eb;
  --primary-soft:#eff6ff;
  --normal:#0f9d76;
  --medium:#d97706;
  --severe:#dc2626;
  --severe-rgb:220,38,38;
  --grade-excellent:#047857;
  --grade-good:#0f9d76;
  --grade-notice:#d97706;
  --grade-warning:#ea580c;
  --grade-danger:#dc2626;
  --grade-excellent-soft:#ecfdf5;
  --grade-good-soft:#f0fdfa;
  --grade-notice-soft:#fffbeb;
  --grade-warning-soft:#fff7ed;
  --grade-danger-soft:#fef2f2;
  --danger-text:#b91c1c;
  --excellent-text:#047857;
  --warning-text:#b45309;
  --bg:#f6f8fb;
  --card:#ffffff;
  --line:#e3e9f2;
  --line2:#f1f5f9;
  --text:#0f172a;
  --muted:#475569;
  --hint:#64748b;
  --radius-sm:8px;
  --radius:12px;
  --radius-lg:16px;
  --shadow:0 1px 2px rgba(15,23,42,.04),0 10px 26px -14px rgba(15,23,42,.16);
  --shadow-hover:0 16px 34px -18px rgba(15,23,42,.26);
}
body{color:var(--text);background:var(--bg);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1}
button,input,select,textarea{color:var(--text)}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible{
  outline:2px solid var(--primary);outline-offset:2px
}
.btn{border-radius:var(--radius-sm)}
.btn.primary{background:var(--primary);border-color:var(--primary)}
.panel,.kpi,.dcard,.todo,.banner{border-radius:var(--radius)}
.dcard:hover{box-shadow:var(--shadow-hover)}
.badge{border-radius:7px}
.tag{border-radius:5px}
.search,.sel,.toolbar select{border-radius:9px}
table.tbl th{color:var(--hint)}
.report-paper{color:#1f2937}
.toast{border-radius:10px}
::-webkit-scrollbar-thumb{background:#c3cedd}
*{scrollbar-color:#c3cedd transparent;scrollbar-width:thin}

/* ---------- 可访问性 ---------- */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
[aria-busy="true"]{cursor:progress}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}
@media (prefers-reduced-motion:reduce){
  .dcard.severe{animation:none!important;box-shadow:0 0 0 2px rgba(220,38,38,.16),var(--shadow)!important}
}

/* ---------- 多厂标识 ---------- */
.plant-chip{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;line-height:1.4;padding:2px 7px;border-radius:5px;background:#eef4ff;color:#1d4ed8;white-space:nowrap;font-weight:500}
.plant-chip.muted{background:var(--line2);color:var(--hint);font-weight:400}

/* ---------- 行动闭环 ---------- */
.act-panel{border:1px solid var(--line);border-radius:10px;padding:12px 14px;background:#fbfdff}
.act-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.act-head b{font-size:12px}
.act-grid{display:grid;grid-template-columns:150px 1fr;gap:8px;align-items:start}
.act-grid label{font-size:12px;color:var(--hint);padding-top:8px}
.act-grid select,.act-grid input,.act-grid textarea{width:100%;border:1px solid var(--line);border-radius:8px;padding:7px 9px;font-size:12px;background:#fff}
.act-grid textarea{min-height:54px;resize:vertical;line-height:1.6}
.act-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:10px;flex-wrap:wrap}
.act-state{font-size:12px;padding:2px 7px;border-radius:5px;white-space:nowrap}
.act-state.new{background:#f1f5f9;color:#64748b}
.act-state.ack{background:#eff6ff;color:#1d4ed8}
.act-state.processing{background:#fff7ed;color:#b45309}
.act-state.closed{background:#ecfdf5;color:#047857}
.act-meta{font-size:12px;color:var(--hint);margin-top:8px;line-height:1.6}

/* ---------- 健康趋势 ---------- */
.spark-wrap{border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:#fff}
.spark{display:block;width:100%;height:48px}
.spark-foot{display:flex;justify-content:space-between;font-size:12px;color:var(--hint);margin-top:4px}

/* ---------- 设备清单分页 ---------- */
.load-more{display:flex;justify-content:center;margin:18px 0 4px}
.load-more .btn{padding:8px 22px;font-size:12px}

/* ---------- 移动端筛选入口 ---------- */
.only-mobile{display:none!important}
@media (max-width:760px){
  .only-mobile{display:inline-flex!important}
  .mobile-hidden{display:none!important}
}

/* ---------- 异步状态（加载 / 错误 / 重试） ---------- */
.async-row{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.async-spinner{width:12px;height:12px;border:2px solid var(--line);border-top-color:var(--primary);border-radius:50%;display:inline-block;animation:hp-spin .8s linear infinite;flex-shrink:0}
@keyframes hp-spin{to{transform:rotate(360deg)}}
.async-retry{border:1px solid var(--line);background:#fff;color:var(--primary);border-radius:6px;padding:3px 8px;font-size:12px;cursor:pointer;white-space:nowrap}
.async-retry:hover{background:var(--primary-soft);border-color:var(--primary)}
.async-error{font-size:12px;color:var(--danger-text);line-height:1.5;margin-top:4px;word-break:break-all}
.async-skeleton{background:linear-gradient(90deg,var(--line2) 25%,#fff 50%,var(--line2) 75%);background-size:200% 100%;animation:hp-shimmer 1.4s infinite;border-radius:6px;min-height:12px}
@keyframes hp-shimmer{to{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){
  .async-spinner,.async-skeleton{animation:none!important}
}
