/* ==========================================================================
   phone_monit 后台样式 —— server/web/app.css（唯一来源）
   --------------------------------------------------------------------------
   谁用：login.html / index.html / device.html 三页都引这一份，页面里不写内联样式。

   设计语言参考 /var/www/html/tools/tool.css（同一套规范，不是抄文件）：
     暖白底 + 白卡片 + 1px 发丝描边 + 单一玫瑰强调色；克制、像工具不像装饰页。

   约定
   · 所有颜色 / 圆角 / 阴影 / 间距只在这里定义，页面别写字面量。
   · 设备详情页 = 两张卡片（--col4 : --col6 = 40 : 60），每张卡内部再左右分栏；
     手机画面的宽度由所在栏决定，高度由 aspect-ratio 按设备真实分辨率算
     （device.html 第一张快照时设上去），没有固定高度常量。
   ========================================================================== */

:root {
  /* 底色 / 面 */
  --bg-page: #fbf9f5;
  --bg-page-2: #f6f1ea;
  --surface: #ffffff;
  --surface-2: #faf8f5;
  --surface-3: #f5f2eb;

  /* 描边 */
  --border: #ece7e0;
  --border-strong: #e2dbd1;

  /* 文字 */
  --text: #1c1917;
  --text-2: #57534e;
  --text-3: #a8a29e;

  /* 强调（玫瑰） */
  --accent: #f43f5e;
  --accent-strong: #e11d48;
  --accent-soft: rgba(244, 63, 94, 0.1);
  --accent-ring: rgba(244, 63, 94, 0.28);

  /* 语义 */
  --ok: #0e9f6e;
  --warn: #d97706;
  --danger: #dc2626;

  /* 圆角 / 阴影 */
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow-md: 0 6px 20px -6px rgba(180, 160, 150, 0.28);

  /* 分区强调色 */
  --rose: #f43f5e;
  --emerald: #659e87;
  --purple: #7e79b5;
  --amber: #f59e0b;
  --sky: #0ea5e9;
  --stone: #78716c;

  /* ★ 设备详情页两列：卡片4（设备信息/日志 + 画面设置/画面/按钮） : 卡片6（更多信息/进程/位置） */
  --col4: 40fr;
  --col6: 60fr;

  /* 等宽数字（仪表读数用）；只用系统字体，不引外网字体 */
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono", "DejaVu Sans Mono",
          Consolas, "Liberation Mono", monospace;
}

/* --------------------------------------------------------------------------
   基础
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
img, svg, video, canvas { display: block; max-width: 100%; }

html { background: var(--bg-page); color-scheme: light; }

body {
  min-height: 100vh;
  margin: 0;
  font-size: 15px;
  color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, var(--bg-page), var(--bg-page-2));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent-soft); color: var(--accent-strong); }
* { scrollbar-width: thin; scrollbar-color: #cfc8bf transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #dcd6cd; border-radius: 6px; }

/* --------------------------------------------------------------------------
   页头
   -------------------------------------------------------------------------- */
.app-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.app-title { font-size: 1.05rem; font-weight: 700; }
.muted { color: var(--text-3); font-size: 0.8rem; }
.spacer { flex: 1; }

/* --------------------------------------------------------------------------
   卡片
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.card-pad { padding: 0.9rem 1rem; }

.card-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.card-title::before {
  content: "";
  width: 0.62rem;
  height: 0.62rem;
  flex: 0 0 auto;
  border-radius: 4px;
  background: var(--card-accent, var(--accent));
}

.section-title { font-size: 0.85rem; font-weight: 700; margin: 1rem 0 0.5rem; }

/* --------------------------------------------------------------------------
   按钮
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active:not(:disabled) { background: var(--surface-3); }
.btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-primary:active:not(:disabled) { background: var(--accent-strong); }

.btn-sm { padding: 0.32rem 0.7rem; font-size: 0.75rem; }

/* --------------------------------------------------------------------------
   表单
   -------------------------------------------------------------------------- */
.input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:hover { border-color: var(--border-strong); }
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.7rem; }
.field-label { font-size: 0.75rem; color: var(--text-2); }

/* --------------------------------------------------------------------------
   表格
   -------------------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
}
.table th { background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }

.online { color: var(--ok); font-weight: 600; }
.offline { color: var(--text-3); }

/* --------------------------------------------------------------------------
   标签 / 状态点
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  background: var(--surface-3);
  color: var(--text-2);
}

/* --------------------------------------------------------------------------
   设备详情：两张卡片 —— 卡片4（40%）: 卡片6（60%）。
   每张卡内部再左右分栏（用发丝竖线分隔）。
   -------------------------------------------------------------------------- */
.device-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--col4)) minmax(0, var(--col6));
  gap: 1.25rem;
  padding: 1.25rem;
}

/* 卡片4：卡内左栏（设备信息/日志）| 右栏（画面设置/手机画面/按钮） */
.console-card { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.console-split { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); }
.console-split > .c4-right { border-left: 1px solid var(--border); padding-left: 0.9rem; }
.c4-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding-right: 0.9rem; }
.c4-right { display: flex; flex-direction: column; min-width: 0; }

/* 卡片6：卡内左半边（更多信息仪表盘）| 右边（上=进程，下=位置） */
.more-card { position: relative; display: flex; flex-direction: column; }
.more-split { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 62fr) minmax(0, 38fr); }
.more-split > .c6-right { border-left: 1px solid var(--border); padding-left: 0.9rem; min-width: 0; }
.c6-left { min-width: 0; padding-right: 0.9rem; }
.c6-right { display: flex; flex-direction: column; }

/* 窄屏（单列）：内部左右两栏也改为上下堆叠，竖分隔线改成横分隔线 */
@media (max-width: 1100px) {
  .device-layout { grid-template-columns: minmax(0, 1fr); }
  .console-split, .more-split { grid-template-columns: minmax(0, 1fr); }
  .console-split > .c4-right, .more-split > .c6-right {
    border-left: 0; padding-left: 0;
    border-top: 1px solid var(--border); padding-top: 0.9rem; margin-top: 0.9rem;
  }
  .c4-left, .c6-left { padding-right: 0; }
}

/* 手机画面外框：宽度撑满所在栏，高度 = 宽度 ÷ 比例。
   aspect-ratio 的初值是占位，拿到第一张快照后由 JS 按**设备真实分辨率**改写。 */
.device-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-3);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  touch-action: none;          /* 拖动时不让浏览器滚动/缩放 */
  user-select: none;
  cursor: crosshair;
}

.device-frame canvas { display: block; }
.device-frame .overlay { position: absolute; inset: 0; pointer-events: none; }

/* 控制条：一行排开、撑满画面宽度、按钮平均自适应（仅图标） */
.controls { display: flex; gap: 0.4rem; flex-wrap: nowrap; margin-top: 0.6rem; }
.controls .btn { flex: 1 1 0; min-width: 0; padding: 0.55rem 0; }
.controls .btn .icon { width: 1.15em; height: 1.15em; }

/* 位置卡片 + 地图（放在卡片6的右下，栏较窄 → 地图矮一点） */
.loc-line { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; font-size: 0.78rem; color: var(--text-2); }
.map { height: 170px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-3); }
.pm-pin { background: transparent; border: 0; }

/* --------------------------------------------------------------------------
   卡片4（左）：卡内左栏「设备信息 / 操作日志」+ 右栏「画面设置 / 手机画面 / 按钮」
   用「小节标签 + 发丝分隔线」分区，做出层次感，而不是把东西堆在一起。
   -------------------------------------------------------------------------- */
/* 顶部状态细条：在线 = 绿渐变（由 JS 切 .on），离线 = 灰渐变 */
.console-accent {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--text-3), rgba(120, 113, 108, 0.12));
  transition: background 0.35s ease;
}
.console-accent.on { background: linear-gradient(90deg, var(--ok), rgba(14, 159, 110, 0.12)); }

/* 同一栏内相邻小节之间留一点纵向呼吸 */
.sec + .sec { margin-top: 0.9rem; }

/* 操作日志：撑满左栏剩余高度（卡内滚动） */
.log-sec { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-top: 0; }
.log-sec .log-list { flex: 1 1 auto; max-height: none; min-height: 120px; }

.sec-title {
  display: flex; align-items: center; gap: 0.45rem;
  margin: 0 0 0.45rem;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3);
}
.sec-title::before { content: ''; width: 14px; height: 1px; background: var(--border-strong); }

/* 发丝分隔线：两端渐隐，比一条实线更轻盈 */
.hr {
  height: 1px; margin: 0.85rem 0;
  background: linear-gradient(90deg, transparent, var(--border) 10%, var(--border) 90%, transparent);
}

/* 设备信息紧凑排（2~3 列自适应，字段全保留） */
.grid-compact { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.4rem; }
.grid-compact .grid-item { padding: 0.36rem 0.45rem; }
.grid-compact .grid-item .k { font-size: 0.62rem; }
.grid-compact .grid-item .v { margin-top: 0.12rem; font-size: 0.8rem; }

/* 手机画面：浅色内衬包住，做出「设备窗口」的层次 */
.frame-wrap {
  margin-top: 0.7rem; padding: 0.55rem;
  border: 1px solid var(--border); border-radius: calc(var(--radius-lg) + 4px);
  background: var(--surface-2);
}

/* 轨迹滑动开关（控制条下方一行） */
.traj-row {
  display: flex; align-items: center; gap: 0.4rem;
  margin-top: 0.5rem; font-size: 0.74rem; color: var(--text-2);
  cursor: pointer; user-select: none;
}
.traj-row input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }
.traj-row .muted { margin-left: auto; }

/* 画面模式行：布局/截图 分段开关 + 分辨率档位 */
.view-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

/* 分段开关（布局 / 截图） */
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-3);
}
.seg-btn {
  padding: 0.3rem 0.85rem; border: 0; border-radius: 999px; background: transparent;
  color: var(--text-2); font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.seg-btn:hover:not(:disabled) { color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--accent-strong); box-shadow: var(--shadow-sm); }
.seg-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* 分辨率档位按钮 */
.res { display: inline-flex; align-items: center; gap: 0.35rem; }
.res-btn {
  min-width: 48px; padding: 0.3rem 0.5rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-2);
  font-family: var(--mono); font-size: 0.75rem; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.res-btn:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); }
.res-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.res-btn:disabled { opacity: 0.4; cursor: not-allowed; }
/* 布局模式下整组分辨率置灰 */
.res[data-disabled="1"] { opacity: 0.45; }

/* 界面刷新间隔（行内滑块，撑满剩余宽度） */
.interval-row {
  display: flex; align-items: center; gap: 0.45rem;
  margin-top: 0.7rem; font-size: 0.78rem; color: var(--text-2);
}
.interval-row input[type="range"] { flex: 1 1 auto; min-width: 0; accent-color: var(--accent); cursor: pointer; }

/* 卡片标题里的行内滑块（「更多信息」的信息刷新间隔） */
.interval-inline {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.74rem; font-weight: 400; color: var(--text-3);
}
.interval-inline input[type="range"] { width: 96px; accent-color: var(--accent); cursor: pointer; }

/* 说明 / 降级提示 */
.view-note { margin-top: 0.5rem; font-size: 0.7rem; line-height: 1.5; color: var(--warn); }
.view-note.info { color: var(--text-3); }
.view-note[hidden] { display: none; }

/* --------------------------------------------------------------------------
   「更多信息」：分层仪表盘（总览环 + 状态胶囊 + 规格行 + 刻度条 + 仪器）
   骨架只建一次，之后只更新数值 —— 过渡动画/脉冲才有意义（见 03-pitfalls B9）。
   设计：**收敛「盒子」** —— 只有环 / 刻度条 / 图 / 胶囊保留容器；
        文本与布尔改用「规格行」（标签左、值右、发丝分隔）与状态胶囊，
        数量/层级靠字号与留白拉开，而不是给每个值套一个边框。
   图标：全部**内联 SVG**（.icon，描边跟随文字色），不引外链 / 图标字体。
   -------------------------------------------------------------------------- */
.mg { margin-bottom: 0.9rem; animation: pm-in 0.4s ease-out both; }
.mg:last-child { margin-bottom: 0; }
.mg:nth-child(2) { animation-delay: 0.05s; }
.mg:nth-child(3) { animation-delay: 0.1s; }
.mg:nth-child(4) { animation-delay: 0.15s; }
.mg:nth-child(5) { animation-delay: 0.2s; }
.mg:nth-child(6) { animation-delay: 0.25s; }

.mg-title {
  display: flex; align-items: center; gap: 0.45rem;
  margin-bottom: 0.5rem;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-3);
}
.mg-title .icon { width: 0.95rem; height: 0.95rem; color: var(--text-3); }
.mg-body { display: block; }

/* ---- ① 总览：3 个环（存储 / 内存 / 电量） ---- */
.hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 0.7rem; }
.ring-cell { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ring-cell[hidden] { display: none; }
.ring { position: relative; width: 62px; height: 62px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
/* 空槽：用 border-strong（比 surface-3 深一档）→ 浅底上也能看清圆环轮廓 */
.ring-bg { fill: none; stroke: var(--border-strong); stroke-width: 3; }
/* ⚠️ stroke-dashoffset:100 只是**初始值**；实际进度由 JS 用**内联 style** 设置。
   别改回 setAttribute —— CSS 优先级高于 SVG 属性，会静默把弧线永远压成 0（见 03-pitfalls B13）。 */
.ring-fg {
  fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.55s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.3s ease;
}
.ring-fg.ok { stroke: var(--ok); }
.ring-fg.warn { stroke: var(--warn); }
.ring-fg.danger { stroke: var(--danger); }
.ring-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: 0.88rem; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ring-k { display: inline-flex; align-items: center; gap: 0.28rem; margin-top: 0.24rem;
  font-size: 0.66rem; color: var(--text-2); }
.ring-k .icon { width: 0.82rem; height: 0.82rem; color: var(--text-3); }
.ring-sub { font-family: var(--mono); font-size: 0.62rem; color: var(--text-3); margin-top: 0.14rem; }

/* ---- 状态胶囊（布尔/枚举状态收成一排，图标即语义） ---- */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cp {
  display: inline-flex; align-items: center; gap: 0.4rem; height: 25px; padding: 0 0.6rem;
  border-radius: 999px; background: var(--surface-3);
  font-size: 0.71rem; color: var(--text-2); white-space: nowrap;
}
.cp[hidden] { display: none; }
.cp .icon { width: 0.85rem; height: 0.85rem; color: var(--text-3); }
.cp b { font-weight: 600; color: var(--text); font-family: var(--mono); font-size: 0.72rem; }
.cp.on .icon { color: var(--ok); }
.cp.warn { background: rgba(217, 119, 6, 0.12); color: var(--warn); }
.cp.warn .icon, .cp.warn b { color: var(--warn); }
.cp.danger { background: rgba(220, 38, 38, 0.1); color: var(--danger); }
.cp.danger .icon, .cp.danger b { color: var(--danger); }

/* ---- 规格行：标签左 / 值右（mono、tabular-nums）+ 发丝分隔；两列自适应 ---- */
.kv2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.7rem; }
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem;
  padding: 0.36rem 0; border-bottom: 1px solid var(--border); }
.kv-col .kv:last-child { border-bottom: 0; }
.kv[hidden] { display: none; }
.kv .k { display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; color: var(--text-3); white-space: nowrap; }
.kv .k .icon { width: 0.78rem; height: 0.78rem; color: var(--text-3); opacity: 0.75; }
.kv .v { font-family: var(--mono); font-size: 0.78rem; color: var(--text);
  font-variant-numeric: tabular-nums; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 66%; }
.kv-wide { grid-column: 1 / -1; }
.kv-wide .kv { max-width: 100%; }
.kv-wide .v { max-width: 78%; white-space: normal; word-break: break-all; }

/* ---- 刻度条（标签+值一行、细条在下） ---- */
.mrow { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1.4rem; }
.mrow[hidden] { display: none; }
.meter-item[hidden] { display: none; }
.mh { display: flex; align-items: baseline; justify-content: space-between; gap: 0.4rem; margin-top: 0.36rem; }
.mh .mk { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.7rem; color: var(--text-3); }
.mh .mk .icon { width: 0.78rem; height: 0.78rem; color: var(--text-3); opacity: 0.75; }
.mh .mv { font-family: var(--mono); font-size: 0.78rem; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums; }

/* ---- 每核（一条迷你条 = 负载占比，文字带 负载% · 频率） ---- */
.freqs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.34rem 1.1rem; margin-top: 0.4rem; }
.freqs[hidden] { display: none; }
.freq { display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.66rem; color: var(--text-2); }
.freq .fk { width: 1.5rem; color: var(--text-3); }
.freq .fbar { flex: 1 1 auto; min-width: 0; height: 5px; border-radius: 999px;
  background: var(--surface-3); overflow: hidden; }
.freq .fbar > i { display: block; height: 100%; width: 0; border-radius: 999px;
  background: var(--accent-strong); opacity: 0.85;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease; }
.freq .fbar > i.ok { background: var(--ok); }
.freq .fbar > i.warn { background: var(--warn); }
.freq .fbar > i.danger { background: var(--danger); }
.freq .fv { width: 5.4rem; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }

/* 窄屏：规格表 / 刻度条 / 每核 全部回单列 */
@media (max-width: 1100px) {
  .kv2, .mrow, .freqs { grid-template-columns: 1fr; }
}

/* 刻度条（供上面的 .mh 配套使用） */
.meter { position: relative; height: 6px; margin-top: 0.32rem; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > i {
  display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent-strong);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease;
}
.meter > i.ok { background: var(--ok); }
.meter > i.warn { background: var(--warn); }
.meter > i.danger { background: var(--danger); }
.meter > i[hidden] { display: none; }
.meter-comfort { position: absolute; top: 0; height: 100%; background: var(--emerald); opacity: 0.22; }
.meter-comfort[hidden] { display: none; }

/* 读数变化时的微脉冲 + 「实时」呼吸点 */
@keyframes pm-bump { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
.bump { animation: pm-bump 0.4s ease-out; }
@keyframes pm-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.live {
  display: inline-block; width: 6px; height: 6px; margin-right: 0.32rem;
  border-radius: 50%; background: var(--ok);
  animation: pm-pulse 1.8s ease-in-out infinite;
}
@keyframes pm-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* 轻提示（替代原来常驻的提示文字） */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  transform: translateX(-50%) translateY(10px);
  padding: 0.5rem 0.9rem; border-radius: 999px;
  background: rgba(28, 25, 23, 0.92); color: #fff;
  font-size: 0.78rem; max-width: 80vw;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --------------------------------------------------------------------------
   应用 / 进程（卡片6 的右上角；栏较窄 → 列表矮一点）
   受系统限制只能列「最近使用过」的应用。
   -------------------------------------------------------------------------- */
.proc-list { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.35rem; max-height: 200px; overflow: auto; }
.proc-row {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.42rem 0.55rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-2);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.2s ease;
}
.proc-row:hover { border-color: var(--border-strong); }
.proc-row .p-main { flex: 1 1 auto; min-width: 0; }
.proc-row .p-name {
  font-size: 0.78rem; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.proc-row .p-pkg {
  font-size: 0.66rem; color: var(--text-3); font-family: var(--mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.proc-row .p-time { flex: none; font-size: 0.68rem; color: var(--text-3); white-space: nowrap; }
.proc-note { margin-top: 0.5rem; font-size: 0.68rem; line-height: 1.5; }

/* 小号输入框（「已装应用」搜索） */
.input-sm { padding: 0.35rem 0.55rem; font-size: 0.75rem; margin-top: 0.35rem; }

/* 通知行：App 名 + 标题 + 正文（正文可折行、最多两行） */
.notif-row {
  display: flex; align-items: flex-start; gap: 0.5rem;
  padding: 0.42rem 0.55rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-2);
}
.notif-row .n-main { flex: 1 1 auto; min-width: 0; }
.notif-row .n-name { font-size: 0.74rem; font-weight: 600; color: var(--text); }
.notif-row .n-title {
  font-size: 0.74rem; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notif-row .n-text {
  font-size: 0.7rem; color: var(--text-3); line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.notif-row .n-time { flex: none; font-size: 0.66rem; color: var(--text-3); white-space: nowrap; }

/* 截图质量滑块：布局模式下整行置灰（与分辨率档位一致） */
.interval-row[data-disabled="1"] { opacity: 0.45; }

/* --------------------------------------------------------------------------
   「网络速率」面积图（canvas 自绘）+ 图例
   -------------------------------------------------------------------------- */
.net-chart {
  display: block; width: 100%; height: 128px; margin-top: 0.5rem;
  border-radius: var(--radius); background: var(--surface-3);
}
.net-legend {
  margin-left: 0.5rem;
  display: inline-flex; gap: 0.6rem;
  font-family: var(--mono); font-size: 0.68rem; color: var(--text-2);
}
.net-legend .nl { display: inline-flex; align-items: center; gap: 0.25rem; }
.net-legend .nl i { display: inline-block; width: 9px; height: 2px; border-radius: 2px; }
.net-legend .nl.rx i { background: var(--ok); }
.net-legend .nl.tx i { background: var(--accent); }
/* 图例放进区标题里时，别继承标题的字母间距/大写 */
.mg-title .net-legend { letter-spacing: 0; text-transform: none; }
.net-legend .nl b { font-weight: 600; color: var(--text); }

/* 操作日志（在卡片4左栏里：撑满剩余高度、卡内滚动；栏窄 → 每条折成两行） */
.log-list { max-height: 180px; overflow-y: auto; }
.log-item { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.log-item:last-child { border-bottom: 0; }
.log-top { display: flex; justify-content: space-between; gap: 0.5rem; }
.log-at { font-family: var(--mono); font-size: 0.7rem; color: var(--text-3); }
.log-act { font-family: var(--mono); font-size: 0.7rem; color: var(--text-2); }
.log-res { margin-top: 0.15rem; font-size: 0.72rem; }
.log-err { margin-left: 0.35rem; color: var(--text-3); }
.pending { color: var(--text-3); }
.ok { color: var(--ok); }
.fail { color: var(--danger); }

/* --------------------------------------------------------------------------
   图标（inline SVG）——统一描边、跟随文字色
   -------------------------------------------------------------------------- */
.icon {
  width: 1em; height: 1em; flex: 0 0 auto;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon-lg { width: 1.3em; height: 1.3em; }

/* 顶部品牌 / 页面内边距 */
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.brand .logo { width: 26px; height: 26px; display: grid; place-items: center;
               border-radius: 8px; background: var(--accent-soft); color: var(--accent-strong); }
.page-pad { padding: 1.25rem; }

/* --------------------------------------------------------------------------
   统计卡（列表页顶部）
   -------------------------------------------------------------------------- */
.stat-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stat {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.7rem 0.95rem; min-width: 138px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.stat .stat-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
                  background: var(--accent-soft); color: var(--accent-strong); font-size: 1rem; }
.stat .stat-num { font-size: 1.15rem; font-weight: 700; line-height: 1.1; }
.stat .stat-lbl { font-size: 0.72rem; color: var(--text-3); }

/* --------------------------------------------------------------------------
   信息网格（详情页：分组展示，别用长条单列表）
   -------------------------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; }
.grid-item {
  padding: 0.5rem 0.6rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-2);
}
.grid-item .k { display: flex; align-items: center; gap: 0.3rem; font-size: 0.7rem; color: var(--text-3); }
.grid-item .v { margin-top: 0.2rem; font-size: 0.85rem; font-weight: 600; word-break: break-all; }

/* 进度条（电量 / 存储） */
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 0.35rem; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.bar.warn > i { background: var(--warn); }
.bar.danger > i { background: var(--danger); }

/* --------------------------------------------------------------------------
   徽标 / 状态点
   -------------------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 0.25rem;
         padding: 0.1rem 0.45rem; border-radius: 999px;
         font-size: 0.68rem; border: 1px solid var(--border-strong); color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(14, 159, 110, 0.15); }
.dot.off { background: var(--text-3); }

/* 危险操作按钮（删除） */
.btn-danger { color: var(--danger); border-color: #f3d0d0; }
.btn-danger:hover:not(:disabled) { background: #fef2f2; border-color: var(--danger); }

.table tbody tr:hover { background: var(--surface-2); }

/* --------------------------------------------------------------------------
   登录页
   -------------------------------------------------------------------------- */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.25rem; }
.login-card { width: 320px; padding: 1.75rem; }
.login-card h1 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.login-card .sub { color: var(--text-3); font-size: 0.8rem; margin-bottom: 1.25rem; }
.login-card .btn { width: 100%; margin-top: 0.35rem; padding: 0.6rem 1rem; }
.err { color: var(--danger); font-size: 0.78rem; min-height: 1.1rem; margin-top: 0.6rem; }
