:root {
  --bg: #f1f2f5; --panel: #fff; --text: #000000e6; --muted: #00000066; --line: #e7eaef;
  --primary: #006eff; --primary-weak: #ebf3ff; --danger: #dc2626; --danger-weak: #fde8e8;
  --ok: #16a34a; --ok-weak: #e3f6e9; --warn: #b45309; --warn-weak: #fdf1dc;
  --side: #111827; --side-text: #cbd5e1; --side-active: #1f2937;
  --radius: 2px; --shadow: 0 2px 4px rgba(54,58,80,.08);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px; color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
.boot { padding: 40px; color: var(--muted); }
.hidden { display: none !important; }

/* 登录 */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card .sub { color: var(--muted); margin-bottom: 20px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: none; padding: 8px 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; font: inherit; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
.field { margin-bottom: 12px; }
.field label { display: block; color: var(--muted); margin-bottom: 4px; font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
input, textarea, select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); font: inherit; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary-weak); border-color: var(--primary); }
textarea { resize: vertical; }
.row input { width: auto; }
.row input.grow { width: 100%; }
button.btn { padding: 7px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); cursor: pointer; font: inherit; white-space: nowrap; }
button.btn:hover { border-color: var(--primary); color: var(--primary); }
button.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
button.btn.primary:hover { opacity: .9; color: #fff; }
button.btn.danger { color: var(--danger); border-color: var(--danger); }
button.btn.danger:hover { background: var(--danger-weak); }
button.btn.sm { padding: 3px 8px; font-size: 12px; }
button.btn:disabled { opacity: .5; cursor: not-allowed; }
.block { width: 100%; }
.err { color: var(--danger); min-height: 20px; margin: 8px 0; font-size: 13px; }
.note { color: var(--muted); font-size: 12px; margin-top: 12px; line-height: 1.6; }

/* 框架见文件末尾(仿腾讯云控制台) */
.main h2 { font-size: 18px; margin: 0 0 16px; }
.main h3 { font-size: 15px; margin: 0 0 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card .k { color: var(--muted); font-size: 12px; }
.card .v { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.card .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
tr:hover td { background: var(--bg); }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
th.num { text-align: right; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag.ok { background: var(--ok-weak); color: var(--ok); border-color: transparent; }
.tag.bad { background: var(--danger-weak); color: var(--danger); border-color: transparent; }
.tag.warn { background: var(--warn-weak); color: var(--warn); border-color: transparent; }
.tag.blue { background: var(--primary-weak); color: var(--primary); border-color: transparent; }
.avatar { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; background: var(--line); vertical-align: middle; }
.avatar.lg { width: 56px; height: 56px; border-radius: 10px; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; }
.kv .k { color: var(--muted); }
.msg-text { white-space: pre-wrap; word-break: break-word; max-width: 560px; }
.msg-text.recalled { text-decoration: line-through; color: var(--muted); }
.msg-img { max-width: 160px; max-height: 120px; border-radius: 4px; display: block; margin-top: 4px; }
.pager { margin-top: 12px; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

/* 趋势图 */
.chart { width: 100%; height: auto; max-height: 240px; display: block; }
.chart .bar { fill: var(--primary); opacity: .8; }
.chart .bar2 { fill: var(--ok); opacity: .8; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 10px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.legend i.c1 { background: var(--primary); }
.legend i.c2 { background: var(--ok); }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.dialog { background: var(--panel); border-radius: 10px; width: 100%; max-width: 440px; padding: 20px; border: 1px solid var(--line); }
.dialog h3 { margin: 0 0 14px; font-size: 16px; }
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 6px; z-index: 20; font-size: 13px; }
.toast.bad { background: var(--danger); color: #fff; }
.check { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.check input { width: auto; }

.chart .line { fill: none; stroke: var(--primary); stroke-width: 2; }
.chart .dot { fill: var(--primary); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 80px 1fr 70px; gap: 8px; align-items: center; font-size: 13px; }
.bar-track { background: var(--bg); border-radius: 4px; height: 12px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--primary); opacity: .8; border-radius: 4px; }
.bar-fill.w1 { width: 5%; }
.bar-fill.w2 { width: 10%; }
.bar-fill.w3 { width: 15%; }
.bar-fill.w4 { width: 20%; }
.bar-fill.w5 { width: 25%; }
.bar-fill.w6 { width: 30%; }
.bar-fill.w7 { width: 35%; }
.bar-fill.w8 { width: 40%; }
.bar-fill.w9 { width: 45%; }
.bar-fill.w10 { width: 50%; }
.bar-fill.w11 { width: 55%; }
.bar-fill.w12 { width: 60%; }
.bar-fill.w13 { width: 65%; }
.bar-fill.w14 { width: 70%; }
.bar-fill.w15 { width: 75%; }
.bar-fill.w16 { width: 80%; }
.bar-fill.w17 { width: 85%; }
.bar-fill.w18 { width: 90%; }
.bar-fill.w19 { width: 95%; }
.bar-fill.w20 { width: 100%; }
.bar-v { text-align: right; font-variant-numeric: tabular-nums; }
h3.gap { margin-top: 18px; }
.rules p { margin: 0 0 8px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 16px; }
.cmds { display: flex; flex-wrap: wrap; gap: 6px; }
.cmds code, .kv .mono { white-space: normal; word-break: break-all; }
.kv.form { grid-template-columns: 120px minmax(0, 320px); align-items: center; }
.kv.form .k { color: var(--text); }


/* ---------------------------------------------------------------- 仿腾讯云控制台 */
body { font-size: 12px; }
.topbar { height: 50px; background: #1d2129; color: #fff; display: flex; align-items: center; gap: 4px; padding: 0 16px; position: sticky; top: 0; z-index: 5; }
.topbar .logo { color: #fff; font-size: 16px; margin-right: 12px; text-decoration: none; letter-spacing: .5px; }
.topbar .logo b { color: #fff; }
.topbar .tlink { color: #ffffffcc; padding: 0 12px; text-decoration: none; font-size: 13px; line-height: 50px; }
.topbar .tlink:hover { color: #fff; background: #ffffff14; }
.tsearch { width: 300px !important; margin-left: 12px; height: 30px; background: #ffffff1a; border: 1px solid transparent; color: #fff; border-radius: 2px; padding: 4px 10px; }
.tsearch::placeholder { color: #ffffff80; }
.tsearch:focus { background: #fff; color: #000; outline: none; }
.tuser { display: flex; flex-direction: column; line-height: 1.2; padding: 0 12px; font-size: 13px; }
.tuser .tsub { font-size: 11px; color: #ffffff80; }
.shell { display: flex; min-height: calc(100vh - 50px); }
.side { width: 208px; background: #fff; border-right: 1px solid var(--line); flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 50px; height: calc(100vh - 50px); overflow-y: auto; }
.side .prod { display: flex; align-items: center; gap: 8px; padding: 16px 20px; font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--line); }
.prod-ic { width: 24px; height: 24px; border-radius: 4px; background: linear-gradient(135deg, #00a4ff, #006eff); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.menu { padding: 8px 0; flex: 1; }
.menu .mi { display: block; padding: 0 20px; line-height: 40px; color: #000000e6; text-decoration: none; font-size: 13px; }
.menu .mi.sub { padding-left: 36px; line-height: 36px; }
.menu .mi:hover { background: #f3f4f7; text-decoration: none; }
.menu .mi.on { background: #ebf3ff; color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.menu .mg { padding: 14px 20px 6px; color: #00000066; font-size: 12px; }
.menu .ms { display: flex; align-items: center; padding: 0 20px; line-height: 40px; cursor: pointer; font-size: 13px; color: #000000e6; user-select: none; }
.menu .ms:hover { background: #f3f4f7; }
.menu .ms .caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid #00000066; transition: transform .15s; }
.menu .ms.closed .caret { transform: rotate(-90deg); }
.side .fold { border-top: 1px solid var(--line); padding: 12px 20px; color: #00000066; cursor: pointer; }
.shell.folded .side { width: 56px; }
.shell.folded .side .menu, .shell.folded .side .prod span:not(.prod-ic) { display: none; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.phead { height: 50px; background: #fff; display: flex; align-items: center; gap: 16px; padding: 0 24px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.phead .crumb { font-size: 16px; }
.phead .crumb b { font-weight: 600; }
.appsel { border: 1px solid var(--line); padding: 4px 10px; font-size: 12px; background: #fff; }
.small { font-size: 12px; }
.main { flex: 1; min-width: 0; padding: 20px 24px 40px; }
.panel { border: none; box-shadow: var(--shadow); padding: 20px; }
.main h3 { font-size: 14px; font-weight: 600; }
.card { border: none; box-shadow: var(--shadow); }
.card .v { font-size: 26px; font-weight: 500; }
button.btn, a.btn { border-radius: 2px; padding: 6px 16px; font-size: 12px; display: inline-block; border: 1px solid #dcdfe6; background: #fff; color: #000000e6; text-decoration: none; cursor: pointer; }
a.btn.primary, button.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
a.btn:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
a.btn.primary:hover { color: #fff; opacity: .9; }
a.btn.sm { padding: 3px 10px; }
input, textarea, select { border-radius: 2px; border-color: #dcdfe6; font-size: 12px; }
th { background: #f7f8fa; color: #00000099; font-size: 12px; padding: 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; }
tr:hover td { background: #f3f4f7; }
.tag { border-radius: 2px; }
.banner-tip { background: #ebf3ff; color: #000000cc; padding: 10px 16px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; }
.ptabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.ptabs a { padding: 8px 16px; color: #000000b3; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13px; }
.ptabs a.on { color: var(--primary); border-bottom-color: var(--primary); }
.row.orange .ptabs { margin-bottom: 0; border-bottom: none; }
.row.orange input[type=date] { width: 140px; }
.ogrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.ostats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 8px 0 20px; }
.ostat { padding: 0 16px; border-left: 1px solid var(--line); }
.ostat:first-child { border-left: none; padding-left: 0; }
.olabel { color: #00000099; font-size: 12px; }
.ov { font-size: 30px; font-weight: 500; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.osub { font-size: 12px; }
.up { color: #e54545; } .down { color: #0abf5b; }
.okv { display: grid; grid-template-columns: 90px 1fr; padding: 6px 0; font-size: 12px; }
.okv .k { color: #00000099; }
.doclinks { display: flex; flex-direction: column; gap: 12px; }
.doclinks a { color: #000000e6; text-decoration: none; }
.doclinks a b { color: var(--primary); font-weight: 500; }
.demos { display: flex; gap: 16px; }
.demos a { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #000000b3; text-decoration: none; font-size: 12px; cursor: pointer; }
.demos .dic { width: 48px; height: 48px; border-radius: 4px; background: #f3f4f7; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--primary); font-weight: 600; }
.lchart { width: 100%; height: 240px; display: block; }
.lchart .grid { stroke: #eef0f3; }
.lchart text { fill: #00000066; font-size: 11px; }
.lchart .ln { fill: none; stroke-width: 2; }
.lchart .ln.c0, .legend i.c0 { stroke: #006eff; background: #006eff; } .lchart .pt.c0 { fill: #006eff; }
.lchart .ln.c1, .legend i.c1 { stroke: #0abf5b; background: #0abf5b; } .lchart .pt.c1 { fill: #0abf5b; }
.lchart .ln.c2, .legend i.c2 { stroke: #ff9c19; background: #ff9c19; } .lchart .pt.c2 { fill: #ff9c19; }
.lchart .ln.c3, .legend i.c3 { stroke: #e54545; background: #e54545; } .lchart .pt.c3 { fill: #e54545; }
.kvt td { border-bottom: 1px solid var(--line); }
.kvt td.k { width: 140px; color: #00000099; background: #fafbfc; }
.feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.feat { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fafbfc; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c9cdd4; } .dot.on { background: #0abf5b; }
.plugins { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.plugin p { min-height: 36px; }
.form .frow { display: grid; grid-template-columns: 110px minmax(0, 520px); gap: 10px; align-items: start; }
.form .frow label { color: #00000099; padding-top: 7px; font-size: 12px; }
.code { background: #f7f8fa; padding: 10px 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-all; margin: 6px 0; }
.code.resp { min-height: 300px; max-height: 560px; overflow: auto; }
.gstep { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.gn { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hints { margin: 0 0 10px; padding-left: 18px; line-height: 1.8; }
.note { font-size: 12px; margin: 0 0 12px; }
.topbar .tmenu { display: none; background: none; border: 0; color: #fff; font-size: 20px; padding: 0 10px 0 0; cursor: pointer; }
.topbar .tlink, .topbar .tuser { white-space: nowrap; }
@media (max-width: 900px) {
  .side { display: none; }
  /* 窄屏:顶栏只留菜单按钮、标志和退出;侧栏改为左侧抽屉 */
  .topbar .tmenu { display: block; }
  .topbar .tlink:not(:last-child), .topbar .tuser { display: none; }
  body.nav-open .side { display: flex; position: fixed; left: 0; top: 50px; bottom: 0; height: auto; z-index: 20; box-shadow: 4px 0 16px rgba(0, 0, 0, .15); }
  body.nav-open::after { content: ''; position: fixed; inset: 50px 0 0 0; background: rgba(0, 0, 0, .3); z-index: 19; }
  .ogrid, .grid2 { grid-template-columns: 1fr; }
  .ostats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tsearch { display: none; }
  .form .frow { grid-template-columns: 1fr; }
}
.main > h2, .main > .row > h2, .main > .page > h2, .main > .page > .row > h2 { display: none; }
.main > .row:has(> h2.grow) { justify-content: flex-end; margin-bottom: 12px; }
.mbadge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: #e54545; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.fbimgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fbimgs img { width: 120px; height: 120px; object-fit: cover; border: 1px solid var(--line); }
.fbcontent { font-size: 14px; line-height: 1.7; }
.fbmsg { padding: 10px 12px; margin-bottom: 8px; background: #fafbfc; border-left: 3px solid #c9cdd4; }
.fbmsg.admin { background: #ebf3ff; border-left-color: var(--primary); }
.fbline { color: inherit; }
