/* ZERO桌面管理后台：浅色、信息密度高的后台风格。 */
:root {
  --bg: #f4f6fa;
  --panel: #fff;
  --line: #e3e8ef;
  --text: #1c2433;
  --muted: #637087;
  --accent: #1f6fe0;
  --accent-soft: #e8f0fd;
  --danger: #d93025;
  --ok: #188038;
  --side: #0f1a2c;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.6 "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
a { color: var(--accent); text-decoration: none; }

button { cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 7px; padding: 6px 14px; }
button:hover { border-color: #c5cfdd; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--danger); }
button.link { border: 0; background: none; padding: 0; color: inherit; text-decoration: underline; }
button:disabled { opacity: 0.55; cursor: default; }
input, select { border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; background: #fff; color: var(--text); }
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* ---------- 登录 ---------- */
.login { min-height: 100%; display: grid; place-items: center; background: radial-gradient(800px 500px at 80% 0%, #dbe7ff, transparent 60%), var(--bg); padding: 16px; }
.login-card { width: min(360px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; display: grid; gap: 14px; box-shadow: 0 20px 50px rgba(20, 40, 80, 0.08); }
.login-logo { width: 52px; height: 52px; margin: 0 auto; }
.login h1 { font-size: 20px; text-align: center; margin: 0 0 6px; }
.login label { display: grid; gap: 6px; color: var(--muted); }
.login input { padding: 9px 12px; }
.login .primary { padding: 10px; margin-top: 4px; }
.error { color: var(--danger); margin: 0; min-height: 1.4em; }

/* ---------- 框架 ---------- */
.shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100%; }
.side { background: var(--side); color: #c8d3e6; display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; padding: 0 8px 18px; }
.brand img { width: 28px; height: 28px; }
.side nav { display: grid; gap: 2px; }
.side nav a { color: #c8d3e6; padding: 9px 12px; border-radius: 8px; }
.side nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side nav a.active { background: rgba(79, 155, 255, 0.18); color: #fff; }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: #f29b38; color: #fff; font-size: 11px; text-align: center; margin-left: 4px; }
.fb-list { display: grid; gap: 12px; }
.fb { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fff; }
.fb.done { background: #fafbfc; }
.fb-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.fb-body { white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.fb-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.fb-foot input { flex: 1; min-width: 200px; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }

.main { padding: 22px 28px 40px; min-width: 0; }
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.top h2 { margin: 0; font-size: 20px; }
.tz { color: var(--muted); font-size: 12px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.muted { color: var(--muted); }

/* 概览数字卡片 */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card .label { color: var(--muted); font-size: 13px; }
.card .value { font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.card .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.two { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }

/* 14 天柱状图：访问和下载并排 */
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 180px; padding-top: 8px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar .cols { display: flex; gap: 2px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bar .v, .bar .d { width: 40%; min-height: 2px; border-radius: 3px 3px 0 0; }
.bar .v { background: var(--accent); }
.bar .d { background: #f29b38; }
.bar .x { font-size: 10px; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank li { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.rank .track { grid-column: 1 / -1; height: 6px; background: var(--accent-soft); border-radius: 3px; overflow: hidden; }
.rank .track span { display: block; height: 100%; background: var(--accent); }

/* 筛选栏和表格 */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.filters label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: #f8fafc; position: sticky; top: 0; }
td.wrap { white-space: normal; max-width: 360px; word-break: break-all; color: var(--muted); }
tr:hover td { background: #fafcff; }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 12px; background: #eef1f6; color: var(--muted); }
.tag.ok { background: #e6f4ea; color: var(--ok); }
.tag.warn { background: #fdecea; color: var(--danger); }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 28px; }

/* 安装包上传 */
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
progress { width: 100%; height: 8px; margin-top: 12px; }
.form { display: grid; gap: 12px; max-width: 360px; }
.form label { display: grid; gap: 6px; color: var(--muted); }
.notice { padding: 10px 14px; border-radius: 8px; background: #fff8e6; color: #8a5a00; margin-bottom: 14px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .side nav { display: flex; flex-wrap: wrap; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: 1fr; }
  .main { padding: 16px; }
}
