/* 站群后台：墨黑侧栏 + 荧光黄绿点缀，浅色纸面内容区（源自 docs/设计图/admin.css） */
:root {
  --bg: #f3f3ef;
  --surface: #fcfcfb;
  --line: #e4e4de;
  --line-soft: #eeeee9;
  --ink: #17191c;
  --ink-2: #5d626b;
  --ink-3: #8c9099;
  --side: #121417;
  --side-2: #1c1f24;
  --side-line: #262a30;
  --side-ink: #a4a9b2;
  --lime: #c6f432;
  --lime-ink: #4d6b0f;
  --bar: #6f9a12;
  --good: #1f9d55;
  --warn: #c27c0e;
  --bad: #d64545;
  --radius: 10px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-3); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.vip-on { color: var(--good); font-weight: 600; }

/* ---- 品牌 ---- */
.mark { width: 34px; height: 34px; flex: none; border-radius: 9px; display: block; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .5px; }
.brand-sub { display: block; font-size: 11.5px; color: var(--side-ink); font-weight: 400; letter-spacing: 0; }


/* ---- 按钮与输入 ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; border-color: #000; color: var(--lime); }
.field { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-3); transition: border-color .15s, box-shadow .15s; }
.field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 25, 28, .08); color: var(--ink); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.field input::placeholder { color: var(--ink-3); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: #e9e9e3; }
.seg a { padding: 4px 12px; border-radius: 7px; font-size: 13px; color: var(--ink-2); }
.seg a.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg.sm a { padding: 2px 10px; font-size: 12px; }

/* ================= 登录页 ================= */
.login { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }
.login-art {
  position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 44px 52px;
  background:
    radial-gradient(600px 420px at 78% 70%, rgba(198, 244, 50, .13), transparent 70%),
    linear-gradient(var(--side-line) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--side-line) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--side);
  color: #fff;
}
.login-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--side) 0%, transparent 22%, transparent 70%, var(--side) 100%); pointer-events: none; }
.login-art > * { position: relative; z-index: 1; }
.login-hero { margin: auto 0; }
.login-hero h1 { font-size: 46px; line-height: 1.15; font-weight: 800; letter-spacing: 1px; }
.login-hero h1 em { font-style: normal; color: var(--lime); }
.login-hero p { margin-top: 16px; color: var(--side-ink); font-size: 15px; max-width: 420px; }

.login-main { display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; font-weight: 700; }
.login-card .lead { margin-top: 6px; color: var(--ink-2); }
.login-form { display: grid; gap: 16px; margin-top: 32px; }
.login-form label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; }
.login-form .btn { height: 46px; font-size: 15px; margin-top: 8px; }
.login-error { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: #fdf0f0; color: #a83232; font-size: 13px; border: 1px solid #f4d3d3; }

/* ================= 后台框架 ================= */
.shell { display: grid; grid-template-columns: 212px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--side); color: var(--side-ink); padding: 20px 14px 14px; }
.sidebar .brand { padding: 0 8px 16px; }
.nav { flex: 1; overflow-y: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-title { padding: 14px 10px 6px; font-size: 11.5px; letter-spacing: 1px; color: #6b717b; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; height: 34px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.active { background: var(--side-2); color: #fff; font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--lime); }
.nav a.active .icon { color: var(--lime); }
.nav .badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--lime); color: var(--side); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.nav .badge.alert { background: var(--bad); color: #fff; }
.side-foot { border-top: 1px solid var(--side-line); padding-top: 14px; }
.account { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2d323a; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.account-name { color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2; }
.account-name small { display: block; color: var(--side-ink); font-weight: 400; font-size: 11.5px; }
.account form { margin-left: auto; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--side-ink); cursor: pointer; }
.icon-btn:hover { background: var(--side-2); color: #fff; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 20px; height: 68px; padding: 0 20px; background: rgba(243, 243, 239, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 19px; font-weight: 700; }
.topbar .date { color: var(--ink-3); font-size: 12.5px; }
.topbar .spacer { flex: 1; }
.topbar .field { height: 36px; width: 260px; }
.content { padding: 20px 20px 32px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }

/* ---- 卡片 ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 0; }
.card-head h2 { font-size: 15px; font-weight: 700; }
.card-head .spacer { flex: 1; }
.card-head .more { font-size: 12.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 2px; }
.card-head .more:hover { color: var(--ink); }
.card-head .more .icon { width: 14px; height: 14px; }
.card-body { padding: 16px 20px 20px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 20px; }

/* ---- 指标 ---- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.kpi { padding: 18px 20px 16px; display: grid; grid-template-columns: 1fr auto; row-gap: 4px; }
.kpi-label { font-size: 13px; color: var(--ink-2); }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1.25; }
.kpi-value small { font-size: 16px; font-weight: 600; margin-right: 2px; }
.kpi-meta { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--ink-3); }
.kpi-meta .spacer { flex: 1; }
.kpi .spark { grid-row: 1 / 3; grid-column: 2; align-self: end; }
.delta { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-2); font-weight: 600; }
.delta .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.delta.up .icon { color: var(--good); }
.delta.down .icon { color: var(--bad); }

/* ---- 图表 ---- */
.chart { position: relative; height: 250px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line-soft); }
.chart .axis text { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--bar); }
.chart .hit:hover + .bar, .chart .bar.on { fill: var(--lime-ink); }
.chart .lbl { fill: var(--ink-2); font-size: 11px; font-weight: 600; text-anchor: middle; }
.tip { position: absolute; pointer-events: none; transform: translate(-50%, -100%); margin-top: -8px; padding: 6px 10px; border-radius: 7px; background: var(--ink); color: #fff; font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity .1s; }
.tip b { color: var(--lime); margin-left: 6px; }
.chart-sum { display: flex; gap: 28px; padding: 4px 20px 0; }
.chart-sum div { font-size: 12px; color: var(--ink-3); }
.chart-sum b { display: block; font-size: 17px; color: var(--ink); font-weight: 700; }

/* ---- 待处理 ---- */
.todo { list-style: none; margin: 0; padding: 6px 8px 8px; }
.todo a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px; }
.todo a:hover { background: var(--bg); }
.todo-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--bg); color: var(--ink-2); }
.todo-body { flex: 1; min-width: 0; }
.todo-name, .todo-desc { display: block; }
.todo-name { font-weight: 600; font-size: 13.5px; }
.todo-desc { font-size: 12px; color: var(--ink-3); }
.todo-count { font-size: 20px; font-weight: 700; }
.todo-count small { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 3px; }
.todo .chev { color: var(--ink-3); width: 16px; }
.todo li.hot .todo-ico { background: var(--ink); color: var(--lime); }
.todo li.alert .todo-ico { background: #fbe9e9; color: var(--bad); }
.todo li.zero .todo-count { color: var(--ink-3); font-weight: 500; font-size: 15px; }

/* ---- 表格 ---- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table td.empty, .health li.empty { justify-content: center; text-align: center; color: var(--ink-3); padding: 28px 0; }
.table tbody tr:hover { background: #f7f7f3; }
.table .r { text-align: right; }
.sub { display: block; font-size: 11px; color: var(--ink-3); }
.table-wrap { overflow-x: auto; }
.site-tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--bg); border: 1px solid var(--line); font-size: 11.5px; color: var(--ink-2); }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; }
.status .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.status.good .icon { color: var(--good); }
.status.warn .icon { color: var(--warn); }
.status.bad .icon { color: var(--bad); }

/* ---- 列表页：筛选栏与分页 ---- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; }
.filters .field { height: 34px; width: 240px; padding: 0 12px; border-radius: 8px; }
.select {
  height: 34px; padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c9099' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
}
.select:focus { outline: 0; border-color: var(--ink); }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.pager .spacer { flex: 1; }
.btn.disabled { opacity: .45; pointer-events: none; }

/* ---- 统计 ---- */
.kpis.three { grid-template-columns: repeat(3, 1fr); }
.ratio { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.ratio i { display: block; max-width: 90px; height: 6px; border-radius: 3px; background: var(--bar); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: #fbe9e9; color: var(--bad); font-size: 11.5px; }
.bad-text { color: var(--bad); }
.table td.wrap { white-space: normal; min-width: 120px; overflow-wrap: anywhere; }
.table td.wrap.wide { min-width: 260px; }

/* ---- 可展开的长文本（错误详情、执行日志）与提示条 ---- */
.fold summary { cursor: pointer; }
.notice { padding: 12px 18px; font-size: 13px; background: #f4f8ee; border-color: #d8e6c6; }
.fold pre { margin: 8px 0 0; max-height: 320px; overflow: auto; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line-soft); font-family: var(--mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- 游戏封面缩略图 ---- */
.cover { display: block; width: 60px; height: 34px; border-radius: 5px; object-fit: cover; background: var(--bg); border: 1px solid var(--line-soft); }

/* ---- 详情页：属性列表 ---- */
.props { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 28px; margin: 0; padding: 16px 20px 20px; }
.props dt { font-size: 12px; color: var(--ink-3); }
.props dd { margin: 3px 0 0; font-size: 13.5px; overflow-wrap: anywhere; }
.props .wide { grid-column: 1 / -1; }

/* ---- 服务状态 ---- */
.health { list-style: none; margin: 0; padding: 4px 20px 12px; }
.health li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.health li:last-child { border-bottom: 0; }
.health .name { flex: 1; min-width: 0; font-size: 13.5px; }
.health .name small { display: block; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health .ms { font-size: 12px; color: var(--ink-3); width: 56px; text-align: right; }

/* ---- 404 ---- */
.notfound { max-width: 520px; width: 100%; justify-self: center; margin-top: 60px; padding: 44px 40px; text-align: center; display: grid; justify-items: center; gap: 10px; }
.notfound-code { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -2px; color: var(--lime-ink); }
.notfound h2 { font-size: 18px; font-weight: 700; }
.notfound p { color: var(--ink-2); }
.notfound .btn { margin-top: 14px; }

/* ---- 确认弹窗（data-confirm，见 admin.js） ---- */
.dialog { width: min(380px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 50px rgba(0, 0, 0, .18); }
.dialog::backdrop { background: rgba(18, 20, 23, .45); backdrop-filter: blur(2px); }
.dialog form { padding: 22px 22px 18px; }
.dialog-title { margin: 0; font-size: 16px; font-weight: 700; }
.dialog-message { margin-top: 8px; color: var(--ink-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---- 内容审核 ---- */
.match-side { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.match-side .site-tag { flex: none; }
.row-actions { display: flex; gap: 6px; }
.row-actions .btn, .decide .btn { height: 30px; padding: 0 12px; }
.decide { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; padding: 14px 20px 20px; }
.decide .reject { display: flex; flex: 1; gap: 10px; min-width: 320px; }
.textarea { flex: 1; min-height: 34px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; resize: vertical; }
.textarea:focus { outline: 0; border-color: var(--ink); }
.pan-trees { display: grid; gap: 10px; padding: 14px 20px 20px; }
