/* 堪野户外 · 管理后台（参考滴滴出行管理后台风格：干净、卡片化、字段对齐） */
:root {
  --bg: #f5f6f5;
  --panel: #ffffff;
  --line: #e7eae7;
  --line-strong: #d8ddd7;
  --text: #1f2d20;
  --muted: #78857a;
  --faint: #aab5a9;
  --brand: #2f7d51;
  --brand-dark: #256340;
  --brand-bg: #eaf4ee;
  --danger: #c0392b;
  --danger-bg: #fdefed;
  --ok: #2f7d51;
  --ok-bg: #eaf4ee;
  --warn: #b8801a;
  --warn-bg: #fdf3e2;
  --info: #3d6ea6;
  --info-bg: #e8f0fa;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(31, 45, 32, .05);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }

/* ===== 登录 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #eaf4ee 0%, #f5f6f5 55%); }
.login-card { width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 36px 36px 28px; box-shadow: 0 12px 40px rgba(31, 45, 32, .08); }
.brand { text-align: center; margin-bottom: 24px; }
.brand h1 { font-size: 19px; margin: 12px 0 4px; }
.brand p { margin: 0; color: var(--muted); font-size: 12px; }
.logo { display: inline-block; background: var(--brand); color: #fff; border-radius: 8px; padding: 5px 12px; font-weight: 700; letter-spacing: 2px; }
form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
form input { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 14px; background: #fff; }
form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 125, 81, .12); }
.err { color: var(--danger); font-size: 13px; min-height: 18px; text-align: center; margin: 4px 0 0; }

/* ===== 布局框架 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 208px; flex-shrink: 0; background: #1e2b22; color: #d8e2d5; padding: 20px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand-mini { font-size: 14px; font-weight: 600; padding: 4px 10px 20px; color: #fff; }
.brand-mini .logo { font-size: 12px; padding: 3px 8px; margin-right: 6px; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: #c3d0c0; border-left: 3px solid transparent; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: rgba(47, 125, 81, .28); color: #fff; border-left-color: #5cb884; }
.badge { background: var(--danger); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 11px; line-height: 1.5; }
.badge.hidden { display: none; }
/* 一级菜单（可折叠，下挂二级菜单） */
.nav-group { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: #c3d0c0; border-left: 3px solid transparent; user-select: none; }
.nav-group:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-group.active { color: #fff; }
.nav-group .caret { font-size: 10px; opacity: .7; transition: transform .15s; }
.nav-group.open .caret { transform: rotate(0deg); }
.nav-group:not(.open) .caret { transform: rotate(-90deg); }
.nav-sub { display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.nav-sub:not(.open) { display: none; }
.nav-sub .nav-item { padding: 8px 12px 8px 24px; font-size: 13px; color: #b3c1b0; border-left: 3px solid transparent; position: relative; }
.nav-sub .nav-item::before { content: ""; position: absolute; left: 13px; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.nav-sub .nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-sub .nav-item.active { background: rgba(47, 125, 81, .28); color: #fff; border-left-color: #5cb884; }
.nav-sub .nav-item.active::before { background: #5cb884; }
.side-foot { font-size: 12px; color: #9aab96; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 12px; margin-top: 8px; }
.side-foot .btn.tiny { background: transparent; border-color: rgba(255, 255, 255, .25); color: #c3d0c0; }
.side-foot .btn.tiny:hover { border-color: #fff; color: #fff; }

.main { flex: 1; min-width: 0; overflow-x: hidden; }
/* 页面容器：整体居中，约束阅读宽度 */
.page { max-width: 1240px; margin: 0 auto; padding: 24px 32px 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 20px; letter-spacing: .5px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ===== 筛选条（tabs + 搜索 + 下拉，独立白条，自动换行） ===== */
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.filter-bar .spacer { flex: 1; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line-strong); background: #fff; border-radius: 8px; padding: 7px 16px; cursor: pointer; font-size: 13px; color: var(--muted); transition: all .15s; }
.tab:hover { border-color: var(--brand); color: var(--brand); }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ===== 组件 ===== */
.btn { border: 1px solid var(--line-strong); background: #fff; color: var(--text); border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 13px; transition: all .15s; white-space: nowrap; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #a93226; color: #fff; }
.btn.block { width: 100%; padding: 11px; margin-top: 8px; }
.btn.tiny { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.input { padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 13px; min-width: 220px; background: #fff; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 125, 81, .12); }
select.input { min-width: 140px; cursor: pointer; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.code { background: #f2f5f2; border-radius: 8px; padding: 12px 14px; font-size: 12px; overflow: auto; margin: 0; line-height: 1.7; white-space: pre-wrap; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.hint code { background: #f2f5f2; border-radius: 4px; padding: 1px 5px; font-size: 11px; }

/* ===== 概览 ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); text-align: center; }
.card .num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card .cap { color: var(--muted); font-size: 12px; margin-top: 6px; }
.probe-ok { color: var(--ok); font-weight: 600; }
.probe-err { color: var(--danger); font-weight: 600; }

/* ===== 表格（类别 / 用户 / 配置） ===== */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { background: #f7f9f7; color: var(--muted); font-weight: 500; white-space: nowrap; position: sticky; top: 0; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f4f9f5; }
.table td.num { font-variant-numeric: tabular-nums; }
.table td.nw, .table th.nw { white-space: nowrap; }
.table .idcell { color: var(--faint); font-variant-numeric: tabular-nums; }
.ops { display: flex; gap: 6px; flex-wrap: nowrap; }
.ops .btn.tiny { min-width: 52px; }
.cfg-input { min-width: 130px; padding: 6px 10px; font-size: 13px; }
.empty-row td { text-align: center; color: var(--faint); padding: 36px 0 !important; }

/* ===== 审核卡片（点位 / 朋友圈） ===== */
.spot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.spot { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.spot-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.spot-head .title { font-size: 15px; font-weight: 600; line-height: 1.4; word-break: break-all; }
.spot-head .id-badge { font-size: 11px; font-weight: 400; color: var(--faint); margin-left: auto; flex-shrink: 0; }
/* 字段行：定宽标签 + 自适应值，flex 换行，多字段不错位 */
.spot-fields { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.kv { display: flex; align-items: baseline; min-width: 240px; flex: 1 1 240px; }
.kv .k { flex-shrink: 0; width: 76px; color: var(--muted); font-size: 12px; }
.kv .v { flex: 1; min-width: 0; font-size: 13px; line-height: 1.6; word-break: break-all; }
.kv .v .tag { margin: 0 4px 2px 0; }
.spot-imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.spot-imgs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #f2f5f2; }
.spot-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; border-top: 1px dashed var(--line); padding-top: 12px; margin-top: auto; }

/* ===== 标签 ===== */
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; background: #eef2ee; color: var(--muted); line-height: 1.5; }
.tag.pending { background: var(--warn-bg); color: var(--warn); }
.tag.approved { background: var(--ok-bg); color: var(--ok); }
.tag.rejected { background: var(--danger-bg); color: var(--danger); }
.tag.t { background: var(--info-bg); color: var(--info); }
.tag code { font-size: 11px; opacity: .75; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ===== 头像 / Logo ===== */
.mini-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); vertical-align: middle; background: #f2f5f2; }
.cat-logo-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); vertical-align: middle; background: #f2f5f2; }
.fields-cell { min-width: 200px; }
.fields-cell .tag { margin: 0 4px 4px 0; }

/* ===== Logo 拖拽上传（弹窗内） ===== */
.logo-drop { position: relative; width: 100%; height: 148px; border: 1.5px dashed var(--line-strong); border-radius: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; background: #fafbfa; transition: border-color .15s, background .15s; }
.logo-drop:hover { border-color: var(--brand); }
.logo-drop.drag { border-color: var(--brand); background: var(--brand-bg); }
.logo-drop .logo-preview { position: absolute; inset: 0; width: 100%; height: 100%; border: none; border-radius: 0; object-fit: contain; background: #fff; }
.logo-drop-hint { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; pointer-events: none; text-align: center; }
.logo-drop-ico { font-size: 30px; }
.logo-ops-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.logo-ops-row .hint { margin-left: auto; }
.adv { margin-top: 8px; }
.adv summary { font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.adv summary:hover { color: var(--brand); }
.adv .input { margin-top: 6px; }

/* ===== 专属字段可视化编辑 ===== */
.field-rows { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; }
.field-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.modal-card .fld .field-row input, .modal-card .fld .field-row select { width: auto; margin: 0; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 13px; font-family: inherit; background: #fff; }
.modal-card .fld .field-row input:focus, .modal-card .fld .field-row select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 125, 81, .12); }
.field-row .f-label { flex: 1.4; min-width: 0; }
.field-row .f-opts { flex: 1.6; min-width: 0; }
.field-row .f-multi { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; cursor: pointer; }
.field-row .f-multi input { margin: 0; cursor: pointer; }
.field-row .f-type { width: 92px; flex-shrink: 0; cursor: pointer; }
.field-row .f-del { flex-shrink: 0; padding: 6px 10px; line-height: 1.2; }
.field-ops-row { display: flex; align-items: center; gap: 14px; }
.link { font-size: 12px; color: var(--brand); cursor: pointer; }
.link:hover { text-decoration: underline; }
.fields-preview { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.pv-err { color: var(--danger); font-size: 12px; }

/* ===== 分页 / 空态 ===== */
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 20px; color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--faint); padding: 48px 0; background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--radius); font-size: 13px; }

/* ===== 积分管理 ===== */
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 18px; }
.rule-group { background: #fafbfa; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.rule-gtitle { font-weight: 600; color: var(--text); margin-bottom: 12px; font-size: 14px; }
.rule-group .fld { margin-bottom: 14px; }
.rule-group .fld:last-child { margin-bottom: 0; }
.rules-grid .input { width: 100%; min-width: 0; }
.rule-group label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; margin: 4px 0 12px; }
.rule-group label.check input { width: auto; margin: 0; }
.table td.num.up { color: var(--ok); font-weight: 600; }
.table td.num.down { color: var(--danger); font-weight: 600; }
@media (max-width: 720px) { .rules-grid { grid-template-columns: 1fr; } }

/* ===== 系统信息 ===== */
.logo-edit { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.site-logo-box { width: 132px; height: 132px; flex-shrink: 0; border: 1px dashed var(--line-strong); border-radius: 12px; background: #fafbfa; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 8px; text-align: center; }
.site-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-ops { flex: 1; min-width: 260px; }
.logo-ops .fld { margin-bottom: 12px; }
.logo-btns { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.site-preview { display: flex; align-items: center; gap: 14px; background: linear-gradient(160deg, #eaf4ee 0%, #f5f6f5 100%); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.site-preview .sp-logo { width: 44px; height: 44px; border-radius: 8px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; letter-spacing: 1px; overflow: hidden; flex-shrink: 0; }
.site-preview .sp-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.sp-txt { min-width: 0; }
.sp-name { font-size: 16px; font-weight: 600; }
.sp-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.sp-icp { color: var(--faint); font-size: 11px; margin-top: 4px; }
.save-bar { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.icp { color: var(--faint); font-size: 11px; text-align: center; margin: 8px 0 0; }
.icp:empty { display: none; }
/* 有 Logo 图片时，品牌方块改为白底衬托图片 */
.logo.has-img { background: #fff; padding: 3px; }
.logo img { display: block; max-height: 36px; max-width: 140px; object-fit: contain; }
.brand-mini .logo.has-img img { max-height: 22px; max-width: 84px; }
@media (max-width: 720px) { .logo-edit { flex-direction: column; } }

/* ===== 通知管理 ===== */
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.panel-head h3 { margin: 0 0 10px; }
.panel-head .btn.tiny, .panel-head label.check { margin-bottom: 10px; }
.panel > h3 { margin: 0 0 14px; font-size: 15px; }

.bot-list { display: flex; flex-direction: column; gap: 12px; }
.bot-card { background: #fafbfa; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.bot-card.off { opacity: .6; }
.bot-card.env { border-style: dashed; background: #f7faf8; }
.bot-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.bot-head .bot-name { font-weight: 600; }
.bot-head .hint { flex: 1 1 240px; min-width: 0; }
.bot-name-input { min-width: 180px; flex: 1 1 200px; max-width: 320px; }
.bot-ops { display: flex; gap: 6px; margin-left: auto; }
.bot-ops .btn.tiny { min-width: 38px; padding: 5px 9px; }
.bot-card .fld-err { margin-top: 8px; }

/* 凭据字段：锁定态只读置灰，解锁态可编辑 */
.secret-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.secret-row .input { flex: 1 1 260px; min-width: 0; }
.secret-row .input.locked { background: #f4f6f4; color: var(--muted); cursor: default; }
.secret-row .btn.tiny { flex-shrink: 0; }
.fld-err { display: block; color: var(--danger); font-size: 12px; line-height: 1.6; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-bg); border: 1px solid #cfe6d8; color: var(--brand-dark); border-radius: 999px; padding: 4px 8px 4px 12px; font-size: 12px; font-variant-numeric: tabular-nums; }
.chip-x { border: none; background: transparent; color: var(--brand); cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; }
.chip-x:hover { color: var(--danger); }
.input.wide { width: 100%; min-width: 0; }
.input.ta { width: 100%; min-width: 0; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; padding: 8px 10px; }
.rule-group .input.ta { margin-top: 6px; }
label.check.inline { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; margin: 0; white-space: nowrap; }
label.check.inline input { width: auto; margin: 0; }
#nSummary { margin: 4px 0 0; word-break: break-word; }
.table td.detail-cell { max-width: 420px; white-space: normal; color: var(--muted); font-size: 12px; line-height: 1.6; }

/* 测试发送结果 */
.test-row { display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #fafbfa; }
.test-row.bad { background: var(--danger-bg); border-color: #f3d3ce; }
.test-row.ok { background: var(--brand-bg); border-color: #cfe6d8; }
.test-ch { flex-shrink: 0; font-size: 12px; color: var(--muted); min-width: 62px; }
.test-name { flex-shrink: 0; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-msg { flex: 1; min-width: 0; font-size: 12px; line-height: 1.6; word-break: break-all; }
.chg-list { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.9; color: var(--text); }
@media (max-width: 720px) {
  .bot-ops { margin-left: 0; }
  .secret-row .input { flex-basis: 100%; }
}

/* ===== 天气配置 ===== */
.head-ops { display: flex; gap: 10px; flex-wrap: wrap; }
.card-sub { color: var(--muted); font-size: 11px; margin-top: 4px; }
/* 测试连接结果 */
.wresult { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fafbfa; font-size: 13px; line-height: 1.7; }
.wresult.ok { background: var(--brand-bg); border-color: #cfe6d8; }
.wresult.bad { background: var(--danger-bg); border-color: #f3d3ce; }
.wresult .werr { color: var(--danger); font-weight: 600; margin-bottom: 10px; word-break: break-all; }
.wnow { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.wnow .wtemp { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand-dark); }
.wgrid { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.wgrid .wkv { display: flex; align-items: baseline; min-width: 200px; flex: 1 1 200px; }
.wgrid .wkv .k { flex-shrink: 0; width: 88px; color: var(--muted); font-size: 12px; }
.wgrid .wkv .v { flex: 1; min-width: 0; font-size: 13px; word-break: break-all; }
.wdaily { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; border-top: 1px dashed var(--line-strong); padding-top: 10px; }
/* 调用统计 */
.wstat-bars { margin: 0 0 16px; }
.wbar-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.wbar-row { display: flex; align-items: flex-end; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfa; }
.wbar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.wbar { width: 100%; height: 64px; display: flex; align-items: flex-end; background: #eef2ee; border-radius: 6px; overflow: hidden; }
.wbar i { display: block; width: 100%; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 3px; }
.wbar-v { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text); }
.wbar-t { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .wgrid .wkv { min-width: 100%; }
  .head-ops { width: 100%; }
}

/* ===== 弹窗（头尾固定，中间滚动，保证按钮永远可见） ===== */
.modal { position: fixed; inset: 0; background: rgba(31, 45, 32, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-card { background: #fff; border-radius: 12px; width: 560px; max-width: 94vw; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 16px 48px rgba(31, 45, 32, .18); }
.modal-card h3 { margin: 0; font-size: 16px; padding: 20px 24px 14px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
#modalBody { padding: 4px 24px 8px; overflow-y: auto; flex: 1; }
/* 表单字段块（替代 label，容纳复杂控件） */
.fld { margin-bottom: 16px; }
.fld-t { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.modal-card label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.modal-card label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.modal-card label.check input { width: auto; margin: 0; }
.modal-card .fld input, .modal-card .fld textarea { width: 100%; margin: 0; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 13px; font-family: inherit; background: #fff; }
.modal-card .fld input:focus, .modal-card .fld textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 125, 81, .12); }
.modal-card .fld textarea { min-height: 110px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 20px; border-top: 1px solid var(--line); background: #fff; flex-shrink: 0; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 36px; left: 50%; transform: translateX(-50%); background: #23301f; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 13px; z-index: 99; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }

/* ===== 移动端顶栏 + 抽屉导航（默认隐藏，仅窄屏显示） ===== */
.topbar { display: none; }
.drawer-backdrop { display: none; }

/* ===== 窄屏适配（手机 / 小平板竖屏）===== */
@media (max-width: 768px) {
  /* 顶栏：固定顶部，仅移动端显示 */
  .topbar {
    display: flex; align-items: center; gap: 10px;
    position: fixed; top: 0; left: 0; right: 0; height: 52px;
    padding: 0 12px; background: #1e2b22; color: #fff; z-index: 70;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .15);
  }
  .topbar-btn {
    border: none; background: transparent; color: #fff; font-size: 22px; line-height: 1;
    padding: 6px 8px; cursor: pointer; border-radius: 8px; margin-left: -8px;
  }
  .topbar-btn:hover { background: rgba(255, 255, 255, .1); }
  .topbar-brand { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
  .topbar-logo { background: var(--brand); color: #fff; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 700; letter-spacing: 1px; }

  /* 抽屉遮罩 */
  .drawer-backdrop { display: block; position: fixed; inset: 0; background: rgba(31, 45, 32, .45); z-index: 60; }
  .drawer-backdrop.hidden { display: none; }

  /* 侧栏变为左侧抽屉：默认移出屏幕，打开时滑入 */
  .layout { display: block; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 82%; max-width: 300px;
    height: 100%; z-index: 65; transform: translateX(-100%);
    transition: transform .25s ease; padding: 16px 12px; box-shadow: none;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  /* 抽屉内导航恢复可读文字（非图标态），便于触屏点选 */
  .brand-mini { font-size: 14px; padding: 4px 12px 18px; text-align: left; }
  .brand-mini .logo { font-size: 12px; margin-right: 6px; }
  .nav-item, .nav-group {
    justify-content: flex-start; padding: 13px 14px; font-size: 14px; gap: 8px;
    border-left: 3px solid transparent; border-bottom: none;
  }
  .nav-item.active { border-bottom: none; }
  .nav-item .badge { display: inline-block; }
  .nav-group .caret { display: inline-block; margin-left: auto; }
  .nav-sub .nav-item { font-size: 13px; padding: 11px 14px 11px 28px; }
  .nav-sub .nav-item::before { left: 16px; }
  .side-foot { flex-direction: row; justify-content: space-between; gap: 0; }
  .side-foot span { display: inline; }

  /* 主区域让出顶栏高度，占满宽度 */
  .main { margin-left: 0; width: 100%; padding-top: 52px; }

  /* 页面内边距收紧 */
  .page { padding: 14px 14px 48px; max-width: 100%; }
  .page-head { margin-bottom: 12px; }
  .page-head h2 { font-size: 18px; }

  /* 筛选条：纵向堆叠，控件占满整行，触屏友好 */
  .filter-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .filter-bar .spacer { display: none; }
  .tabs { width: 100%; }
  .tab { flex: 1; text-align: center; padding: 9px 8px; }
  .filter-bar .input, .filter-bar select.input { width: 100%; min-width: 0; }

  /* 输入 / 按钮触屏尺寸（≥44px 命中区） */
  .input { min-width: 0; width: 100%; padding: 11px 12px; font-size: 15px; }
  select.input { min-width: 0; width: 100%; }
  .btn { padding: 11px 18px; min-height: 42px; font-size: 14px; }
  .btn.tiny { min-height: 38px; }
  .btn.block { padding: 13px; }

  /* 审核卡片单列铺满，操作按钮平分整行 */
  .spot-list { grid-template-columns: 1fr; }
  .spot { padding: 14px; }
  .kv { min-width: 100%; }
  .spot-acts { justify-content: stretch; }
  .spot-acts .btn { flex: 1; }

  /* 表格：横向滚动容器已在 .table-wrap，缩小内边距，整表贴边铺满 */
  .table-wrap { margin: 0 -14px; border-radius: 0; border-left: none; border-right: none; }
  .table th, .table td { padding: 10px 12px; font-size: 12px; }

  /* 弹窗在手机上贴边全宽、接近全屏，保证头部标题与底部按钮始终可见 */
  .modal { padding: 0; }
  .modal-card { width: 100%; max-width: 100%; max-height: 100vh; height: 100%; border-radius: 0; }
  .modal-foot { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }

  /* 系统信息 Logo 区、保存条、页头操作按钮在窄屏占满一行 */
  .logo-edit { flex-direction: column; }
  .save-bar { flex-direction: column; align-items: stretch; }
  .save-bar .btn { width: 100%; }
  .head-ops { width: 100%; }
  .head-ops .btn { flex: 1; }
}
