/* ==========================================================================
   还活着 / Alive.on —— 全局样式
   设计约束（来自需求文档）：
     · 柔和色彩，页面背景浅蓝色
     · 所有内容用一个很浅色的实线框、圆角框起来，形成一点立体感
     · 按钮：圆角长方形、深绿色背景、白色前景、有立体感
     · 平台（管理端 / 监护端）12px 字体；客户端 14px 字体
   ========================================================================== */
:root {
  --bg: #e7f1fa;
  --bg-grad: radial-gradient(1200px 600px at 12% -10%, #f3f9ff 0%, rgba(243, 249, 255, 0) 60%),
    linear-gradient(180deg, #eaf3fc 0%, #e2edf8 100%);
  --card: #fcfdff;
  --card-soft: #f6fbff;
  --line: #e2ecf6;
  --line-strong: #d2e2f1;
  --ink: #1e3a55;
  --ink-soft: #41637f;
  --muted: #8ba3ba;

  --green: #1F6B45;
  --green-hi: #2a8a5b;
  --green-lo: #175339;
  --green-deep: #0f3f2a;

  --red: #9c2f2a;
  --red-hi: #c8403a;
  --amber: #b8860b;

  --alive: #2fa36b;
  --offline: #a9b8c6;
  --emergency: #e0453e;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-card: 0 1px 0 #fff inset, 0 2px 4px rgba(30, 58, 85, 0.04), 0 10px 20px -14px rgba(30, 58, 85, 0.35);
  --shadow-btn: 0 1px 0 rgba(255, 255, 255, 0.32) inset, 0 2px 0 var(--green-deep), 0 4px 10px -4px rgba(15, 63, 42, 0.55);

  --font-platform: 12px;
  --font-client: 14px;

  /* 广场每个栏目的正文最大高度：所有栏目（含「热门」）共用这一个值，改这里即可整体调 */
  --plaza-col-h: 430px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--ink);
  font-size: var(--font-platform);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.client-mode { font-size: var(--font-client); }

a { color: var(--green); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: 0.2px; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------------- 布局 ---------------- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 14px 18px 40px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 18px;
  background: linear-gradient(180deg, #fdfeff, #f3f9ff);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 2px 10px -8px rgba(30, 58, 85, 0.6);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: none;              /* 图片自带圆角红底，不再叠深绿方块 */
  box-shadow: none;
  color: #fff; font-size: 15px;
}
.brand-name { font-size: 1.15em; font-weight: 700; letter-spacing: 0.4px; }
.brand-sub { color: var(--muted); font-size: 0.92em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.who { color: var(--ink-soft); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line-strong); background: linear-gradient(180deg, #ffffff, #f2f8fe);
  color: var(--ink-soft); border-radius: 999px; padding: 6px 15px; cursor: pointer;
  box-shadow: 0 1px 0 #fff inset, 0 2px 3px rgba(30, 58, 85, 0.06);
  transition: transform 0.12s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.tab:hover { color: var(--green); border-color: #c3dbc9; }
.tab.active {
  background: linear-gradient(180deg, var(--green-hi), var(--green));
  border-color: var(--green-deep); color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
  box-shadow: var(--shadow-btn);
}
.tab .badge { display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 5px; border-radius: 8px; background: var(--emergency); color: #fff; font-size: 0.85em; text-align: center; }

/* ---------------- 卡片 / 分区 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.card.tight { padding: 10px 12px; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-title { font-size: 1.12em; font-weight: 650; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.card-title::before {
  content: ""; width: 4px; height: 14px; border-radius: 3px;
  background: linear-gradient(180deg, var(--green-hi), var(--green-lo)); display: inline-block;
}

/* 广场栏目标题前的小图标（column-icon/）：图片比标题略高一点 —— 标题 14px、图标 18px，上下各留 2px。
   图标紧跟在标题左边那条竖线（.card-title::before）后面，然后是文字。 */
.card-title .col-icon {
  display: block; flex: none;
  width: auto; height: 18px;
  margin: 2px 0 2px -2px;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}
@media (max-width: 820px) {
  /* 手机上标题字号不变，图标也不缩，别让图标比字还小 */
  .card-title .col-icon { height: 18px; }
}
.card-sub { color: var(--muted); font-size: 0.94em; }
.spacer { flex: 1; }
.hr { height: 1px; background: var(--line); margin: 12px 0; border: 0; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.kv { display: flex; gap: 8px; padding: 3px 0; }
.kv .k { color: var(--muted); min-width: 96px; }
.kv .v { color: var(--ink); word-break: break-all; }

.metric { display: flex; flex-direction: column; gap: 4px; }
.metric .label { color: var(--muted); }
.metric .value { font-size: 1.6em; font-weight: 700; color: var(--green); letter-spacing: 0.5px; }
.metric .hint { color: var(--muted); font-size: 0.92em; }

.bar { height: 9px; border-radius: 6px; background: #eef5fb; border: 1px solid var(--line-strong); overflow: hidden; box-shadow: inset 0 1px 2px rgba(30, 58, 85, 0.08); }
.bar > i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(180deg, var(--green-hi), var(--green)); transition: width 0.5s ease; }
.bar.warn > i { background: linear-gradient(180deg, #e0a13a, #c2841a); }
.bar.danger > i { background: linear-gradient(180deg, var(--red-hi), var(--red)); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 16px; min-height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--green-deep);
  background: linear-gradient(180deg, #29895a 0%, var(--green) 55%, var(--green-lo) 100%);
  color: #fff; font-weight: 600; letter-spacing: 0.3px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
  box-shadow: var(--shadow-btn);
  cursor: pointer; user-select: none;
  transition: transform 0.1s ease, box-shadow 0.12s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 rgba(0, 0, 0, 0) inset, 0 1px 0 var(--green-deep), 0 1px 4px -2px rgba(15, 63, 42, 0.6); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; filter: grayscale(0.25); }
.btn.ghost {
  background: linear-gradient(180deg, #ffffff, #f2f8fe); color: var(--green);
  border-color: var(--line-strong); text-shadow: none;
  box-shadow: 0 1px 0 #fff inset, 0 2px 3px rgba(30, 58, 85, 0.08);
}
.btn.ghost:hover { border-color: #bcd8c6; color: var(--green-lo); }
.btn.danger { background: linear-gradient(180deg, #c8403a, #9c2f2a); border-color: #7d2521; box-shadow: 0 1px 0 rgba(255,255,255,.28) inset, 0 2px 0 #7d2521, 0 4px 10px -4px rgba(120,30,26,.5); }
.btn.sm { padding: 4px 10px; min-height: 24px; font-size: 0.95em; border-radius: 8px; }
.btn.xs { padding: 2px 8px; min-height: 20px; font-size: 0.9em; border-radius: 7px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------- 表单 ---------------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label { color: var(--ink-soft); font-weight: 600; }
input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="search"], select, textarea {
  width: 100%; padding: 6px 9px; min-height: 30px;
  background: linear-gradient(180deg, #fbfdff, #ffffff);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 2px rgba(30, 58, 85, 0.06);
  outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { min-height: 64px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #8fc0a5; box-shadow: 0 0 0 3px rgba(47, 163, 107, 0.14); }
input:disabled, select:disabled, textarea:disabled { background: #f2f6fa; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }

@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } }
.checkline { display: flex; align-items: center; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(180deg, #f7fbfe, #eef6fd);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 10px; color: var(--ink-soft);
}
.chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 0 0 2px; }
.chip button:hover { color: var(--emergency); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; background: var(--card); }
table.data th, table.data td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data thead th { background: linear-gradient(180deg, #f4fafe, #eaf4fc); color: var(--ink-soft); font-weight: 650; white-space: nowrap; position: sticky; top: 0; }
table.data tbody tr:hover { background: #f6fbfe; }
table.data tbody tr:last-child td { border-bottom: 0; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------------- 状态 ---------------- */
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.dot.alive { background: radial-gradient(circle at 32% 30%, #63d39b, var(--alive)); }
.dot.offline { background: radial-gradient(circle at 32% 30%, #cbd6e0, var(--offline)); }
.dot.emergency { background: radial-gradient(circle at 32% 30%, #ff7b74, var(--emergency)); animation: pulse 1.1s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(224, 69, 62, 0.55); } 50% { box-shadow: 0 0 0 5px rgba(224, 69, 62, 0); } }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fbfdff; }
.status-pill.alive { border-color: #bfe5d0; background: #f1fbf5; color: #1d7a4f; }
.status-pill.offline { border-color: #dbe3ea; background: #f6f9fc; color: #6d879c; }
.status-pill.emergency { border-color: #f3c3c0; background: #fff3f2; color: var(--emergency); font-weight: 700; }

/* ---------------- 客户端打卡大按钮 ---------------- */
.status-btn {
  width: 260px; height: 96px; border-radius: 18px; border: 1px solid var(--green-deep);
  color: #fff; font-size: 1.9em; font-weight: 700; letter-spacing: 2px; cursor: pointer;
  background: linear-gradient(180deg, #34a06b, var(--green) 60%, var(--green-lo));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 4px 0 var(--green-deep), 0 12px 20px -10px rgba(15, 63, 42, 0.7);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.3s ease;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.status-btn small { font-size: 0.42em; letter-spacing: 1px; font-weight: 500; opacity: 0.9; }
.status-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--green-deep); }
.status-btn.is-offline {
  background: linear-gradient(180deg, #c3ced9, #a3b3c2 60%, #8e9fae);
  border-color: #7f90a0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 4px 0 #7f90a0, 0 12px 20px -10px rgba(80, 95, 110, 0.55);
  color: #fbfdff;
}
.status-btn.is-emergency {
  background: linear-gradient(180deg, #ef6b64, var(--emergency) 60%, #b8352f);
  border-color: #94251f;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 4px 0 #94251f, 0 12px 20px -10px rgba(150, 35, 30, 0.7);
  animation: blink 1s steps(1, end) infinite;
}
@keyframes blink { 0%, 49% { filter: brightness(1); } 50%, 100% { filter: brightness(1.45) saturate(1.2); } }
.status-btn[disabled] { cursor: default; }
.status-btn[disabled]:active { transform: none; }

/* ---------------- 地图 ---------------- */
.map-shell { position: relative; border-radius: var(--radius); border: 1px solid var(--line-strong); overflow: hidden; background: linear-gradient(180deg, #f2f9ff, #e6f2fc); box-shadow: inset 0 1px 3px rgba(30, 58, 85, 0.08); }
.map-shell svg { display: block; width: 100%; height: auto; touch-action: none; }

.map-shell .land { fill: #fbfefb; stroke: #cfe2d8; stroke-width: 0.6; }
.map-shell .province { fill: #f7fcf8; stroke: #d5e6ef; stroke-width: 0.28; }
.map-shell .marker { cursor: pointer; transition: r 0.15s ease, opacity 0.15s ease; }
.map-shell .marker:hover { opacity: 0.85; }

.map-legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-soft); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 120px;
  background: rgba(255, 255, 255, 0.97); border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 8px 18px -10px rgba(30, 58, 85, 0.6); padding: 6px 9px; opacity: 0; transition: opacity 0.12s ease;
}
.map-tip.on { opacity: 1; }
.map-tip b { color: var(--ink); }
.map-tip .s { color: var(--muted); }

/* ---------------- 聊天 ---------------- */
.chat-split { display: grid; grid-template-columns: 70% 30%; gap: 12px; }
@media (max-width: 900px) { .chat-split { grid-template-columns: 1fr; } }
.chat-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card-soft); display: flex; flex-direction: column; min-height: 460px; overflow: hidden; }
.chat-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #ffffff, #f5fafe); }
.chat-toolbar .peer { font-weight: 650; }
.icon-btn {
  width: 30px; height: 28px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #fff, #eef6fd); cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 1px 0 #fff inset, 0 2px 3px rgba(30, 58, 85, 0.1);
  transition: all 0.15s ease; color: var(--ink-soft);
}
.icon-btn:hover { border-color: #bcd8c6; color: var(--green); }
.icon-btn.on {
  background: linear-gradient(180deg, var(--green-lo), var(--green-deep)); color: #fff; border-color: var(--green-deep);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45);
  transform: translateY(1px);
}
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 380px; }
.msg { max-width: 72%; padding: 7px 11px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; box-shadow: 0 1px 2px rgba(30, 58, 85, 0.06); position: relative; }
.msg .meta { color: var(--muted); font-size: 0.86em; margin-top: 2px; }
.msg.mine { align-self: flex-end; background: linear-gradient(180deg, #eaf8f0, #dff2e8); border-color: #c4e3d2; }
.msg.system { align-self: center; max-width: 88%; background: #fff8e8; border-color: #f0dcae; color: #7d6320; font-size: 0.95em; }
.chat-input { display: flex; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); background: #fff; align-items: center; }
.chat-input input { flex: 1; }
.recording { color: var(--emergency); font-weight: 650; display: none; align-items: center; gap: 6px; }
.recording.on { display: inline-flex; }
.recording .wave { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.recording .wave i { width: 2px; background: var(--emergency); border-radius: 2px; animation: wv 0.7s infinite ease-in-out; }
.recording .wave i:nth-child(2) { animation-delay: 0.12s; }
.recording .wave i:nth-child(3) { animation-delay: 0.24s; }
.recording .wave i:nth-child(4) { animation-delay: 0.36s; }
@keyframes wv { 0%, 100% { height: 3px; } 50% { height: 12px; } }

.contact-tools { padding: 8px 10px; border-bottom: 1px solid var(--line); display: flex; gap: 6px; background: #fff; }
.contact-scroll { overflow-y: auto; max-height: 430px; }
.contact-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-bottom: 1px solid var(--line); cursor: pointer; background: #fff; }
.contact-item:hover { background: #f5fbff; }
.contact-item.active { background: linear-gradient(180deg, #eef8f2, #e3f4ea); box-shadow: inset 3px 0 0 var(--green); }
.contact-item .avatar { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(180deg, #e8f4fd, #d8e9f7); color: var(--green); font-weight: 700; flex: none; }
.contact-item .cname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-item .cmeta { color: var(--muted); font-size: 0.88em; }
.contact-item .ops { display: flex; gap: 3px; opacity: 0.55; }
.contact-item:hover .ops { opacity: 1; }
.unread { background: var(--emergency); color: #fff; border-radius: 999px; padding: 0 5px; font-size: 0.85em; }
.pin-flag { color: var(--amber); }

/* ---------------- 模态框 / 抽屉 ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(22, 45, 66, 0.34); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 60; animation: fade 0.16s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: 100%; max-width: 780px; background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 24px 60px -24px rgba(15, 40, 60, 0.6); animation: rise 0.18s ease; }
.modal.sm { max-width: 460px; }
.modal.lg { max-width: 1000px; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #ffffff, #f4faff); border-radius: var(--radius) var(--radius) 0 0; }
.modal-head h3 { font-size: 1.14em; }
.modal-body { padding: 14px 16px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 11px 16px; border-top: 1px solid var(--line); background: #fafdff; border-radius: 0 0 var(--radius) var(--radius); }

/* ---------------- 杂项 ---------------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast { background: #fff; border: 1px solid var(--line-strong); border-left: 4px solid var(--green); border-radius: 10px; padding: 8px 13px; box-shadow: 0 10px 24px -14px rgba(30, 58, 85, 0.7); animation: rise 0.18s ease; max-width: 340px; }
.toast.err { border-left-color: var(--emergency); }
.toast.warn { border-left-color: var(--amber); }
.empty { color: var(--muted); text-align: center; padding: 26px 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: #fbfdff; }
.center { display: flex; align-items: center; justify-content: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.muted { color: var(--muted); } .soft { color: var(--ink-soft); }
.right { text-align: right; } .nowrap { white-space: nowrap; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-strong); background: #f8fcff; color: var(--ink-soft); font-size: 0.92em; }

.sos-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .sos-grid { grid-template-columns: 1fr; } }
.sos-btn {
  border-radius: 18px; padding: 20px 16px; min-height: 150px; border: 1px solid #94251f; cursor: pointer; color: #fff;
  justify-content: center;
  background: linear-gradient(180deg, #d5544e, #ab332e 60%, #8d2722);
  box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 5px 0 #7a201c, 0 14px 22px -12px rgba(140,35,30,.8);
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-shadow: 0 1px 0 rgba(0,0,0,.22);
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s;
  text-align: center;
}
.sos-btn:hover { filter: brightness(1.06); }
.sos-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #7a201c; }
.sos-btn .t { font-size: 1.55em; font-weight: 700; letter-spacing: 1.5px; }
.sos-btn .n { opacity: 0.95; }
.sos-btn .p { opacity: 0.9; font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
.sos-btn[disabled] { filter: grayscale(0.4) brightness(0.95); cursor: not-allowed; }

.notice-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fbfdff; }
.notice-item .t { font-weight: 650; }
.notice-item .b { color: var(--ink-soft); }
.notice-item .m { color: var(--muted); font-size: 0.9em; white-space: nowrap; }
.placeholder-box { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 40px 20px; text-align: center; color: var(--muted); background: repeating-linear-gradient(45deg, #fbfdff, #fbfdff 10px, #f6fbff 10px, #f6fbff 20px); }
.lang-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: #fff; }
.lang-switch button { border: 0; background: transparent; padding: 3px 10px; cursor: pointer; color: var(--ink-soft); }
.lang-switch button.on { background: linear-gradient(180deg, var(--green-hi), var(--green)); color: #fff; }

/* ══════════════════════════════════════════════════════════════════════════
   11.4 新增：登录分栏 / 广场 / 账号头像 / 系统设置
   ══════════════════════════════════════════════════════════════════════════ */

/* ---------------- 登录页：左 2/3 图 + 右 1/3 面板 ---------------- */
.login-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  min-height: 100vh;
  gap: 0;
}
@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; }
  .login-art { min-height: 190px; }
}
.login-art {
  position: relative;
  overflow: hidden;
  background: #cfe3f2 center/cover no-repeat;
  display: flex;
  align-items: flex-end;
  box-shadow: inset -24px 0 40px -30px rgba(15, 63, 42, 0.6);
}
.login-art::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 40, 30, 0) 45%, rgba(8, 32, 24, 0.62) 100%);
}

.login-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 26px 22px;
  background: linear-gradient(180deg, #f7fbff 0%, #eef6fd 100%);
  border-left: 1px solid var(--line-strong);
}
.login-panel .card { width: 100%; max-width: 360px; padding: 20px 20px 18px; }
.login-panel .logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }

.entry-tip {
  margin-top: 10px; padding: 8px 10px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  color: var(--ink-soft); background: #f7fcff; font-size: 0.94em;
}

/* ---------------- 头像 ---------------- */
.avatar {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(160deg, #e8f4ff, #d6ecff);
  border: 1px solid var(--line-strong);
  color: var(--green); font-weight: 700; overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3em; }
.avatar.xl { width: 92px; height: 92px; font-size: 1.7em; }
.avatar-edit { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------------- 广场 ---------------- */
.plaza { display: grid; gap: 12px; }
.plaza-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px;
}
.plaza-clock { display: grid; line-height: 1.25; }
.plaza-clock .d { font-size: 1.15em; font-weight: 600; }
.plaza-clock .t { font-size: 1.5em; font-weight: 700; letter-spacing: 0.5px; color: var(--green); }
.plaza-weather { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #f6fbff; }
.plaza-weather .temp { font-size: 1.25em; font-weight: 700; }
.plaza-weather .wnote { color: var(--muted); }

.cols-strip-wrap { position: relative; display: flex; align-items: center; gap: 6px; }
.cols-strip {
  display: flex; gap: 8px; overflow-x: auto; scroll-behavior: smooth;
  padding: 4px 2px; cursor: grab; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.cols-strip.dragging { cursor: grabbing; }
.col-chip {
  flex: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  /* 每颗 chip 带一点自己栏目的淡色（--col-accent-wash 由 plaza.js 内联注入，缺省是白） */
  background: linear-gradient(180deg, #fff, var(--col-accent-wash, #f7fbff));
  color: var(--ink-soft); cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 0 #fff inset;
  display: inline-flex; align-items: center; gap: 6px;
}
.col-chip.active {
  background: linear-gradient(180deg, var(--col-accent-hi, var(--green-hi)), var(--col-accent, var(--green)));
  border-color: var(--col-accent, var(--green-lo)); color: #fff; font-weight: 600;
  box-shadow: 0 1px 0 rgba(255,255,255,.28) inset, 0 2px 6px -3px rgba(30,58,85,.5);
}
/* 栏目条里的小图标：比标题上的小一号（16px），上下各留 2px，跟着 chip 的文字走 */
.col-chip .chip-icon {
  flex: none; width: auto; height: 16px; margin: 2px 0; object-fit: contain;
  -webkit-user-drag: none; user-select: none;
}
.col-chip .force { font-size: 0.85em; opacity: 0.8; margin-left: 4px; }
.strip-btn { width: 26px; height: 26px; padding: 0; line-height: 1; border-radius: 50%; }

.card-hint { font-size: 0.8em; color: var(--muted); margin-left: 4px; cursor: help; }
.plaza-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
/* 第三排：热门客户（原「活跃客户」，同一个榜单）占 2/3，我的关注占 1/3 */
.plaza-grid-23 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
@media (max-width: 1000px) {
  .plaza-grid-3 { grid-template-columns: 1fr; }
  .plaza-grid-23 { grid-template-columns: 1fr; }
}
/* 我的关注 */
.following-list { max-height: var(--plaza-col-h); overflow-y: auto; }
.following-row {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center;
  padding: 7px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fbfdff;
}
.following-row .fr-main { min-width: 0; }
.following-row .ar-name { font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.following-row .ar-meta { color: var(--muted); font-size: 0.9em; }
.following-row .fr-login { color: var(--ink-soft); }
.online-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #22a06b; margin-right: 4px; vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(34, 160, 107, 0.15);
}
.ar-login { color: var(--ink-soft); }
.col-card { display: flex; flex-direction: column; min-height: 190px; }
/* 每个栏目用自己的主色（plaza.js 通过 --col-accent* 内联注入；没有配置就回落到品牌绿）：
   标题左边那道竖线、右上角的「N 条」、以及空栏目的淡色底，这样一整排不再是清一色灰。 */
.col-card .card-title::before {
  background: linear-gradient(180deg, var(--col-accent-hi, var(--green-hi)), var(--col-accent, var(--green-lo)));
}
.col-card > .card-head > .card-sub { color: var(--col-accent, var(--muted)); font-weight: 600; }
.col-card .col-body > .empty {
  background: linear-gradient(180deg, #fdfeff, var(--col-accent-wash, #fbfdff));
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

/* 广场所有栏目正文统一限高（和「热门」一致）：内容多了就在栏内滚动，不再把整行/整页拉长 */
.col-card .col-body {
  display: grid; gap: 8px; margin-top: 8px;
  max-height: var(--plaza-col-h); overflow-y: auto; align-content: start;
  padding-right: 2px;
  scrollbar-width: thin; scrollbar-color: #cddcea transparent;
}
.col-card .col-body::-webkit-scrollbar { width: 8px; }
.col-card .col-body::-webkit-scrollbar-thumb { background: #cddcea; border-radius: 999px; }
.col-card .col-body::-webkit-scrollbar-thumb:hover { background: #b6cbe0; }
.col-card .col-body::-webkit-scrollbar-track { background: transparent; }
.mini-post {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fbfdff; cursor: pointer;
}
.mini-post:hover { border-color: var(--green-hi); background: #f4fbf7; }
.mini-post .mt { font-weight: 600; color: var(--ink); }
.mini-post .mb { color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-post .mm { color: var(--muted); font-size: 0.9em; margin-top: 2px; }

.post-card { padding: 12px 14px; }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-head .who { display: grid; line-height: 1.3; }
.post-head .who .n { font-weight: 600; }
.post-head .who .m { color: var(--muted); font-size: 0.9em; }
.post-body { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; }
.post-title { font-size: 1.08em; font-weight: 700; margin: 8px 0 0; }
.post-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.post-imgs img { max-width: 220px; max-height: 180px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.post-actions { display: flex; gap: 6px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.vis-tag { font-size: 0.86em; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-soft); background: #f7fbff; }
.vis-tag.public { border-color: #bfe4cf; background: #f2fbf6; color: var(--green); }
.vis-tag.friends { border-color: #cfe0f6; background: #f4f9ff; color: #2b6aa8; }
.vis-tag.private { border-color: #f0d6c8; background: #fff7f2; color: #a8663a; }

.comments { margin-top: 10px; border-top: 1px dashed var(--line-strong); padding-top: 8px; display: grid; gap: 6px; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment .cb { flex: 1; background: #f7fbff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 5px 9px; }
.comment .cb .cn { font-weight: 600; margin-right: 6px; }
.comment .cb .ct { color: var(--muted); font-size: 0.88em; margin-left: 6px; }
.comment-form { display: flex; gap: 6px; margin-top: 4px; }
.comment-form input { flex: 1; }

.editor-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.editor-imgs .thumb { position: relative; }
.editor-imgs img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); }
.editor-imgs .del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0; border-radius: 50%; }

/* ---------------- 系统设置 ---------------- */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 1000px) { .set-grid { grid-template-columns: 1fr; } }
.loginimg-preview {
  width: 100%; max-width: 360px; aspect-ratio: 5/3; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: #eef6fd center/cover no-repeat;
}
.colrow {
  display: grid; grid-template-columns: 26px 1fr 1fr 92px 30px 30px 30px;
  gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line);
}
.colrow input[type=text] { width: 100%; }
.colrow .idx { color: var(--muted); text-align: right; }
.force-chk { display: flex; align-items: center; gap: 5px; color: var(--ink-soft); }

/* ---------------- 位图世界地图（map-image.js） ---------------- */
.map-shell { position: relative; }
.mapstage {
  position: relative; width: 100%; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  /* 与地图海洋同色：投影在大洋两侧有留白，放大时不会露出突兀的白边 */
  background: linear-gradient(180deg, #8ed3e4 0%, #6cbad2 100%);
  cursor: grab;
  aspect-ratio: 1681 / 946;
}
.mapstage.dragging { cursor: grabbing; }
.mapstage .mapbg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: fill; user-select: none; pointer-events: none;
}
.mapstage .maplayers { position: absolute; inset: 0; width: 100%; height: 100%; }
.maplayers .marker { cursor: pointer; }
.maplayers .marker text { font-weight: 600; pointer-events: none; }

/* 危险操作的次要按钮：只描边，不填色（列表里的删除按钮不要变成大红块） */
.btn.ghost.danger, .btn.ghost.xs.danger {
  background: #fff; color: var(--red); border-color: #eccfcc;
}
.btn.ghost.danger:hover, .btn.ghost.xs.danger:hover { background: #fff5f4; border-color: var(--red-hi); }

/* ---------------- 列表限高（不超过一屏） ---------------- */
.list-capped {
  max-height: calc(100vh - 240px);
  overflow: auto;
  border-radius: var(--radius-sm);
}
.list-capped::-webkit-scrollbar { width: 8px; height: 8px; }
.list-capped::-webkit-scrollbar-thumb { background: #cfe0ee; border-radius: 8px; }
/* 表头吸顶，滚动时列名不跑掉 */
.list-capped thead th { position: sticky; top: 0; background: var(--card); z-index: 2; }

/* ---------------- 广场管理：效果预览 + 左右分栏 ----------------
 * 上面整块是"用户看到的广场"（只读预览，和前台同一套 .col-card/.mini-post 样式）；
 * 下面一行：左边改栏目、右边管内容。右边高度由 JS 设成与左边一致，内容多了在卡内滚动，
 * 这样两块总是齐平，不会因为内容条数不同把页面拉得高低不齐。 */
/* 预览整块限高：栏目多的时候不至于把"栏目编辑/内容管理"顶到屏幕外面去 */
.plaza-preview {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #cfe0ee transparent;
}
.plaza-preview::-webkit-scrollbar { width: 8px; }
.plaza-preview::-webkit-scrollbar-thumb { background: #cfe0ee; border-radius: 8px; }
.plaza-preview .plaza-grid-3 { margin-bottom: 8px; }
.plaza-preview .col-card { min-height: 0; }
.plaza-preview .col-card .col-body { max-height: 148px; }

.plaza-admin-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
@media (max-width: 1100px) {
  .plaza-admin-split { grid-template-columns: 1fr; }
}
.plaza-mod-card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.plaza-mod-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  align-content: start;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #cfe0ee transparent;
}
.plaza-mod-list::-webkit-scrollbar { width: 8px; }
.plaza-mod-list::-webkit-scrollbar-thumb { background: #cfe0ee; border-radius: 8px; }
.plaza-mod-list::-webkit-scrollbar-track { background: transparent; }
/* 卡片内的帖子条目不要被 flex 压扁 */
.plaza-mod-list > .card { flex: none; }

/* 登录图上的口号（32px）与介绍（14px），居中叠放 */
.login-art .art-center {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 8%; pointer-events: none;
}
.login-art .art-slogan {
  font-size: 32px; line-height: 1.25; font-weight: 700; color: #fff; letter-spacing: 2px;
  text-shadow: 0 2px 14px rgba(6, 30, 22, 0.65), 0 1px 2px rgba(0, 0, 0, 0.5);
}
.login-art .art-intro {
  margin-top: 12px; font-size: 14px; color: #f2fbff; letter-spacing: 0.5px;
  text-shadow: 0 1px 8px rgba(6, 30, 22, 0.7);
}
@media (max-width: 1000px) {
  .login-art .art-slogan { font-size: 24px; }
}

/* 今天该做的事：一个方框，文字多了内部滚动（不撑破版面） */
.tasks-box {
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fbfdff; padding: 10px 12px; max-height: 260px; overflow: auto;
}
.tasks-box .tasks-ol { margin: 0; padding-left: 20px; }
.tasks-box .tasks-ol li { margin: 4px 0; }

/* 朋友圈小列表 */
.circle-box { max-height: 300px; overflow: auto; display: grid; gap: 8px; }

/* ---------------- 邮件面板 ---------------- */
.mail-panel { display: grid; gap: 12px; }
.mail-section { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fbfdff; }
.mail-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.mail-list { max-height: 240px; overflow: auto; }
.mail-row {
  display: grid; grid-template-columns: 190px 1fr auto; gap: 10px; align-items: center;
  padding: 7px 10px; border-bottom: 1px dashed var(--line); cursor: pointer;
}
.mail-row:hover { background: #f1f9ff; }
.mail-row.unread .ml-subj { font-weight: 700; }
.mail-row .ml-from { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row .ml-subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row .ml-date { color: var(--muted); font-size: 0.92em; white-space: nowrap; }
.mail-reader {
  width: 100%; height: 320px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: #fff;
}
@media (max-width: 900px) {
  .mail-row { grid-template-columns: 1fr auto; }
  .mail-row .ml-from { display: none; }
}

/* 群发邮件面板 */
.bulk-mail { display: grid; gap: 8px; }
.bulk-mail .row2 { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }

/* 登录面板底部的平台名与一句话介绍（原来是叠在图片左下角，手机上会和口号重叠） */
.login-foot {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  text-align: center;
}
.login-foot .lf-name { font-size: 1.15em; font-weight: 700; letter-spacing: 1px; color: var(--green); }
.login-foot .lf-tag { margin-top: 4px; color: var(--muted); line-height: 1.5; }
/* 手机上：口号/介绍留白更紧凑，绝不与任何元素重叠 */
@media (max-width: 900px) {
  .login-art .art-center { padding: 0 6%; }
  .login-art .art-slogan { font-size: 22px; }
  .login-art .art-intro { font-size: 13px; margin-top: 8px; }
}

/* 热门（活跃客户榜） */
.active-search { min-width: 130px; height: 26px; padding: 2px 8px; border-radius: 999px; }
.active-list { max-height: var(--plaza-col-h); overflow-y: auto; }
.active-row {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center;
  padding: 7px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fbfdff; cursor: default;
}
.active-row.is-followed { border-color: #bfe4cf; background: #f3fbf6; }
.active-row .ar-main { min-width: 0; }
.active-row .ar-name { font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.active-row .ar-intro { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-row .ar-meta { color: var(--muted); font-size: 0.9em; }

/* 客户个人主页编辑：头像 + 右边自我介绍 */
.profile-edit {
  display: grid; grid-template-columns: auto minmax(150px, 190px) minmax(220px, 1fr);
  gap: 14px; align-items: start;
}
.profile-edit .pe-label { display: block; color: var(--ink-soft); margin-bottom: 4px; }
@media (max-width: 900px) { .profile-edit { grid-template-columns: 1fr; } }

/* 站点 logo（附件图片）：圆形、无多余内边距 */
/* 站点 logo：直接用图片本身，不再套深绿方块背景 */
.logo,
.logo-img {
  object-fit: contain;
  background: none;          /* 去掉原来的深绿渐变方块 */
  box-shadow: none;
  border: 0;
  border-radius: 50%;
  padding: 0;
  display: inline-block;
}
.brand .logo-img { width: 30px; height: 30px; }
.login-panel .logo-img { width: 38px; height: 38px; }

/* VPN 管理：内嵌 WGNet 面板 */
.vpn-frame {
  width: 100%; height: 620px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: #fff;
}

/* VPN 管理的配置预览 */
.vpn-conf {
  margin: 0; padding: 12px; max-height: 320px; overflow: auto;
  background: #0f1b2a; color: #cfe8ff; border-radius: var(--radius-sm);
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre;
}

/* 「发出紧急求助」按钮：比普通按钮高 50%，手机上也好按 */
.btn.sos-raise {
  min-height: 54px;
  padding: 16px 26px;
  font-size: 1.15em;
  letter-spacing: 0.5px;
}
@media (max-width: 600px) {
  .btn.sos-raise { min-height: 60px; font-size: 1.2em; width: 100%; }
}

/* 客户主页弹窗 */
.profile-head { display: flex; gap: 14px; align-items: center; }
.profile-avatar {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line-strong); flex: none;
}
.profile-name { font-size: 1.25em; font-weight: 700; }
.profile-intro {
  margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm); background: #f8fbff; color: var(--ink-soft);
  white-space: pre-wrap; max-height: 160px; overflow: auto;
}
.active-row .ar-avatar { cursor: pointer; }
.active-row .ar-avatar:hover { filter: brightness(1.05); transform: scale(1.04); }

/* ══════════════════════════════════════════════════════════════════════════
   摄像头（camera.js）—— 监护端画面格 / 老人端隐私卡 / 管理端诊断与表单
   ══════════════════════════════════════════════════════════════════════════ */
.cam-groups { display: flex; flex-direction: column; gap: 6px; }
.cam-group + .cam-group { margin-top: 10px; }
.cam-group-title { font-weight: 650; color: var(--ink-soft); margin: 2px 0 8px; }
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }

/* 画面格 */
.cam-tile { margin-bottom: 0; display: flex; flex-direction: column; gap: 8px; }
.cam-stage {
  position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: #0f2033 radial-gradient(circle at 50% 40%, #1d3b57 0%, #0f2033 70%);
}
.cam-video, .cam-snap { width: 100%; height: 100%; object-fit: contain; display: block; background: #0f2033; }
.cam-video[hidden], .cam-snap[hidden] { display: none; }
.cam-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px;
  align-items: center; justify-content: center; text-align: center; padding: 10px;
  color: #eaf3fc; background: rgba(9, 22, 36, 0.72); font-size: 0.98em;
}
.cam-overlay[hidden] { display: none; }
.cam-overlay-big { font-size: 1.9em; }
.cam-live-hint {
  position: absolute; left: 8px; bottom: 8px; right: 8px;
  padding: 3px 8px; border-radius: 999px; text-align: center;
  background: rgba(9, 22, 36, 0.66); color: #d9e9f7; font-size: 0.9em;
}
.cam-live-hint[hidden] { display: none; }

.cam-head { display: flex; align-items: center; gap: 8px; }
.cam-name { font-weight: 650; color: var(--ink); }
.cam-meta { font-size: 0.92em; }
.cam-badge {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: #f8fcff; color: var(--ink-soft); font-size: 0.92em;
}
.cam-badge.on { border-color: #bfe5d0; background: #f1fbf5; color: #1d7a4f; }
.cam-badge.off { border-color: #dbe3ea; background: #f6f9fc; color: #6d879c; }
.cam-badge.snap { border-color: #cfe0ee; background: #f4f9ff; color: #35668f; }
.cam-badge.wait { border-color: #f0dcae; background: #fffbf0; color: #8a6d1c; }
.cam-badge.err { border-color: #f3c3c0; background: #fff3f2; color: var(--emergency); }
.cam-ops { gap: 6px; }

/* 云台 */
.cam-tool { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 10px; background: #fbfdff; }
.cam-tool[hidden] { display: none; }
.cam-pad { display: grid; grid-template-columns: repeat(3, 44px); gap: 6px; justify-content: center; margin-bottom: 8px; }
.cam-pad-btn {
  height: 38px; border-radius: 9px; border: 1px solid var(--line-strong); cursor: pointer;
  background: linear-gradient(180deg, #ffffff, #eef6fd); color: var(--ink-soft);
  box-shadow: 0 1px 0 #fff inset, 0 2px 3px rgba(30, 58, 85, 0.1);
  user-select: none; touch-action: none;
}
.cam-pad-btn:hover { border-color: #bcd8c6; color: var(--green); }
.cam-pad-btn:active { transform: translateY(1px); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.16); }
.cam-pad-btn[disabled] { opacity: 0.4; cursor: default; }
.cam-pad [data-ptz="up"] { grid-column: 2; grid-row: 1; }
.cam-pad [data-ptz="left"] { grid-column: 1; grid-row: 2; }
.cam-pad-mid { grid-column: 2; grid-row: 2; }
.cam-pad [data-ptz="right"] { grid-column: 3; grid-row: 2; }
.cam-pad [data-ptz="down"] { grid-column: 2; grid-row: 3; }
.cam-pad [data-ptz="zin"] { grid-column: 1; grid-row: 4; }
.cam-pad [data-ptz="zout"] { grid-column: 3; grid-row: 4; }
.cam-preset { max-width: 100%; }

/* 回放 */
.cam-rec-list { display: flex; flex-direction: column; gap: 5px; max-height: 190px; overflow: auto; }
.cam-seg {
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  padding: 5px 9px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: #fff; cursor: pointer; text-align: left;
}
.cam-seg:hover { border-color: #bcd8c6; background: #f6fbf8; }
.cam-rec-play { margin-top: 10px; }
.cam-rec-play[hidden] { display: none; }
.cam-rec-video { width: 100%; border-radius: var(--radius-sm); background: #0f2033; }

/* 谁看过（折叠区） */
.cam-audit-card { margin-top: 14px; }
.cam-audit-card > summary {
  cursor: pointer; font-weight: 650; color: var(--ink); list-style: none;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cam-audit-card > summary::-webkit-details-marker { display: none; }
.cam-audit-card > summary::before { content: "▸"; color: var(--green); }
.cam-audit-card[open] > summary::before { content: "▾"; }
.cam-audit-body { margin-top: 10px; }
.cam-note {
  padding: 8px 11px; border-radius: var(--radius-sm); border: 1px solid #f0dcae;
  background: #fffbf0; color: #7d6320;
}

/* 老人端（客户端）：字大、按钮大、一句话说清 */
.cam-client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cam-client-card { margin-bottom: 0; display: flex; flex-direction: column; gap: 10px; }
.cam-client-head { display: flex; align-items: center; gap: 10px; }
.cam-client-name { font-size: 1.24em; font-weight: 700; color: var(--ink); }
.cam-client-state {
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 1.1em; line-height: 1.5;
  border: 1px solid var(--line-strong);
}
.cam-client-state.on { background: #f1fbf5; border-color: #bfe5d0; color: #1d7a4f; }
.cam-client-state.off { background: #f6f9fc; border-color: #dbe3ea; color: #5d7488; }
.cam-big-btn { min-height: 62px; font-size: 1.3em; letter-spacing: 1px; border-radius: 14px; }
.cam-client-hint { color: var(--ink-soft); font-size: 1em; }
.cam-client-label { font-weight: 650; color: var(--ink); font-size: 1.06em; }
.cam-window-list { display: flex; flex-direction: column; gap: 8px; }
.cam-window-row { display: flex; align-items: center; gap: 8px; }
input[type="time"] {
  padding: 6px 9px; min-height: 34px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: linear-gradient(180deg, #fbfdff, #ffffff);
  box-shadow: inset 0 1px 2px rgba(30, 58, 85, 0.06); outline: none; font: inherit; color: inherit;
}
input[type="time"]:focus { border-color: #8fc0a5; box-shadow: 0 0 0 3px rgba(47, 163, 107, 0.14); }

/* 管理端：诊断 / 表单 / 自检 */
.cam-diag { display: flex; flex-direction: column; gap: 10px; }
.cam-diag-line { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill.warn { border-color: #f0dcae; background: #fffbf0; color: #8a6d1c; }
.cam-issues { display: flex; flex-direction: column; gap: 6px; }
.cam-issue {
  display: flex; gap: 8px; align-items: flex-start; padding: 7px 11px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: #fbfdff;
}
.cam-issue b { flex: none; width: 15px; text-align: center; }
.cam-issue.error { border-color: #f3c3c0; background: #fff3f2; color: #8d2b26; }
.cam-issue.warn { border-color: #f0dcae; background: #fffbf0; color: #7d6320; }
.cam-issue.info { border-color: #cfe0ee; background: #f4f9ff; color: #35668f; }
.cam-kv { display: flex; gap: 8px; padding: 2px 0; font-size: 0.96em; }
.cam-kv .k { color: var(--muted); min-width: 128px; flex: none; }
.cam-kv .v { color: var(--ink); word-break: break-all; }
.cam-test-box { display: flex; flex-direction: column; gap: 6px; }
.cam-test-line {
  display: flex; gap: 9px; align-items: baseline; padding: 7px 11px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: #fbfdff;
}
.cam-test-line .lbl { font-weight: 650; min-width: 96px; }
.cam-test-line.ok { border-color: #bfe5d0; background: #f1fbf5; }
.cam-test-line.bad { border-color: #f3c3c0; background: #fff3f2; }
.cam-test-line.skip { border-color: #dbe3ea; background: #f6f9fc; color: var(--muted); }
.cam-adv > summary { cursor: pointer; color: var(--green); font-weight: 600; }
.cam-probe { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--card-soft); }
.cam-streams { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.cam-stream {
  display: flex; gap: 9px; align-items: center; flex-wrap: wrap;
  padding: 3px 8px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; font-size: 0.94em;
}
.cam-stream.pick { border-color: #bfe5d0; background: #f1fbf5; }
.cam-stream.pick::after { content: "✓"; color: #1d7a4f; font-weight: 700; }
/* .btn 自带 display:inline-flex，会盖掉浏览器对 [hidden] 的默认 display:none —— 显式关掉 */
.cam-tile .btn[hidden], .cam-tool .btn[hidden], .cam-ops .btn[hidden] { display: none; }

/* ══════════════════════════════════════════════════════════════════════════
   手机顶栏（≤820px）——市场部反馈：手机浏览器里 TAB 占地方、布局随浏览器变
     · 左上角「三条线」= 菜单抽屉（原来顶栏那一排 menu TAB 全收进去）
     · 右上角「三个点」= 账号菜单（语言 / 账号 / 退出）
   桌面（>820px）保持原样：品牌 + 一排 TAB + 右上角，用的是同一批 DOM 节点。
   ══════════════════════════════════════════════════════════════════════════ */
.nav-drawer { display: contents; }   /* 桌面：抽屉不参与布局，TAB 仍直接排在顶栏里 */
.drawer-head, .nav-toggle, .more-toggle, .more-menu, .nav-backdrop { display: none; }
/* .btn / .icon-btn 自带 display，会盖掉浏览器对 [hidden] 的默认 display:none */
[hidden] { display: none !important; }

@media (max-width: 820px) {
  html { -webkit-text-size-adjust: 100%; }

  .topbar {
    flex-wrap: nowrap; gap: 8px;                 /* 手机不再换行 —— 顶栏高度固定，正文不乱跳 */
    min-height: 52px;
    padding: calc(6px + env(safe-area-inset-top)) 10px 6px;
  }
  .brand { flex: 1 1 auto; min-width: 0; gap: 8px; }
  .brand .logo { width: 26px; height: 26px; }
  .brand > div { min-width: 0; }
  .brand-name { font-size: 1.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-sub { display: none; }                  /* 手机只留一行标题，副标题不再把顶栏撑成两行 */
  .topbar-right { display: none; }               /* 账号/退出搬到「三个点」里 */

  .nav-toggle, .more-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; flex: none;
    color: var(--ink-soft); border-radius: 11px;
  }
  .more-toggle { margin-left: auto; }

  /* 图标用 CSS 画，不依赖任何字体里的 ☰ ⋮ ✕ 字形 —— 老机型/精简字库里这些符号会变成方框 */
  .nav-toggle .bars,
  .nav-toggle .bars::before,
  .nav-toggle .bars::after {
    display: block; width: 19px; height: 2px; border-radius: 2px; background: currentColor;
  }
  .nav-toggle .bars { position: relative; }
  .nav-toggle .bars::before,
  .nav-toggle .bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle .bars::before { top: -6px; }
  .nav-toggle .bars::after { top: 6px; }
  .more-toggle .dots { display: flex; flex-direction: column; gap: 4px; }
  .more-toggle .dots i { display: block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
  .icon-btn .x,
  .icon-btn .x::before,
  .icon-btn .x::after { display: block; width: 15px; height: 2px; border-radius: 2px; background: currentColor; }
  .icon-btn .x { position: relative; transform: rotate(45deg); }
  .icon-btn .x::before,
  .icon-btn .x::after { content: ""; position: absolute; left: 0; }
  .icon-btn .x::before { transform: rotate(90deg); }
  #navClose { width: 34px; height: 34px; }

  /* —— 左侧抽屉 —— */
  .nav-drawer {
    display: flex; flex-direction: column; gap: 10px;
    position: fixed; z-index: 60; top: 0; bottom: 0; left: 0;
    width: min(80vw, 320px);
    padding: calc(10px + env(safe-area-inset-top)) 12px calc(20px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, #fdfeff, #eef6fd);
    border-right: 1px solid var(--line-strong);
    box-shadow: 10px 0 28px -16px rgba(30, 58, 85, 0.55);
    transform: translateX(-102%); visibility: hidden;
    transition: transform 0.22s ease, visibility 0.22s ease;
    overflow-y: auto; overscroll-behavior: contain;
  }
  .drawer-head { display: flex; align-items: center; gap: 8px; padding: 2px 2px 8px; border-bottom: 1px solid var(--line); }
  .drawer-title { font-weight: 700; }
  body.nav-open .nav-drawer { transform: translateX(0); visibility: visible; }
  body.nav-open { overflow: hidden; }            /* 抽屉开时背景不跟着滚 */

  .tabs { flex-direction: column; flex-wrap: nowrap; gap: 8px; }
  .tab {
    width: 100%; text-align: left; font-size: 1.06em;
    padding: 12px 16px; min-height: 46px; border-radius: 12px;   /* 手指好按 */
  }

  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(16, 34, 52, 0.42); }

  /* —— 右上角三个点菜单 —— */
  .more-menu {
    display: block; position: absolute; z-index: 70;
    top: calc(100% - 2px); right: 8px; width: min(86vw, 260px);
    padding: 10px; border-radius: var(--radius); border: 1px solid var(--line-strong);
    background: var(--card); box-shadow: 0 16px 36px -18px rgba(30, 58, 85, 0.6);
  }
  .more-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 10px; border-bottom: 1px solid var(--line); }
  .more-id { min-width: 0; }
  .more-name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .more-role { color: var(--muted); font-size: 0.92em; }
  .more-slot { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
  .more-slot .who { padding: 4px 2px; color: var(--ink-soft); }
  .more-slot .lang-switch { align-self: flex-start; }
  .more-slot .lang-switch button { padding: 6px 14px; }
  .more-slot .btn { width: 100%; min-height: 40px; }

  .wrap { padding: 10px 10px calc(28px + env(safe-area-inset-bottom)); }
}
