[hidden] { display: none !important; }

/* ================================================================== 设计变量
   取自 云购 apps/admin/src/styles.css（运营后台） */
:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1b1f29;
  --line: #232733;
  --line-2: #2a2f3a;
  --text: #e6e9ef;
  --muted: #8a93a6;
  --brand: #2f7ff7;
  --brand-dim: #1d2535;
  --brand-soft: #8ab8ff;
  --link: #6ab3ff;
  --ok: #7ce0a8;
  --ok-bg: #173d2a;
  --warn: #f0c674;
  --warn-bg: #4a3712;
  --danger: #ffb4be;
  --danger-bg: #4a1f28;
  --danger-line: #7a3340;
  --danger-fill: #5a2430;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, "Segoe UI", Roboto, "PingFang SC",
        "Microsoft YaHei", sans-serif;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h2 { margin: 0 0 14px; font-size: 18px; }
h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }

/* ================================================================== 版式 */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 180px;
  flex-shrink: 0;
  background: #14171e;
  border-right: 1px solid var(--line);
  padding: 16px 12px;
}
.sidebar .brand {
  display: block;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin: 4px 8px 16px;
}
.sidebar .brand span { color: var(--brand); }
.sidebar .sep { border-top: 1px solid var(--line); margin: 14px 0 10px; }
.sidebar .caption {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 8px 6px;
}
.sidebar a, .sidebar button {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 4px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.sidebar a:hover, .sidebar button:hover {
  background: #1a1e27;
  text-decoration: none;
}
.sidebar a.active, .sidebar button.active {
  background: var(--brand-dim);
  color: var(--brand-soft);
}
.sidebar .exit { margin-top: 24px; color: var(--danger); }
.sidebar .exit:hover { background: var(--danger-bg); }
.sidebar .who {
  color: var(--muted);
  font-size: 12px;
  margin: 14px 8px 6px;
  word-break: break-all;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 24px;
  max-width: 1100px;
}
.head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.head > div { flex: 1; min-width: 200px; }
.head h2 { margin-bottom: 4px; }
.head .sub { margin: 0; color: var(--muted); font-size: 13px; }
.head .btn { flex-shrink: 0; }

.foot {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 26px 0 8px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}

/* ================================================================== 卡片 */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.card:last-child { margin-bottom: 0; }

.sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.head .sub { margin: 0; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ================================================================== 行/字段 */
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { align-items: flex-end; }

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.field label, label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 4px;
}
label.big { margin-top: 12px; }

.small { font-size: 12px; }
.muted { color: var(--muted); }
.code, .mono, td .mono {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 11.5px;
}

/* ================================================================== 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  transition: .15s;
}
.btn:hover { background: #212632; border-color: #39404d; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #2570e6; border-color: #2570e6; }
.btn.danger {
  background: var(--danger-fill);
  border-color: var(--danger-line);
  color: var(--danger);
}
.btn.danger:hover { background: #6b2c39; border-color: #8f3d4c; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.block { width: 100%; }

/* ================================================================== 表单 */
input[type=text], input[type=password], input[type=search],
input[type=number], input[type=email], select, textarea {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
input::placeholder, textarea::placeholder { color: #6b7385; }
select { cursor: pointer; }
input[type=checkbox] { width: auto; accent-color: var(--brand); }

.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.inline-form input[type=search], .inline-form input[type=text] {
  flex: 1;
  min-width: 170px;
  width: auto;
}
.inline-form select { width: auto; min-width: 120px; }

/* ================================================================== 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 500; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #1a1e27; }

/* ================================================================== 徽标 */
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.7;
  background: var(--line);
  color: var(--text);
  white-space: nowrap;
}
.tag.ok   { background: var(--ok-bg);     color: var(--ok); }
.tag.warn { background: var(--warn-bg);   color: var(--warn); }
.tag.off  { background: var(--danger-bg); color: var(--danger); }
.tag.plat { background: var(--brand-dim); color: var(--brand-soft); }
.tag.muted { background: var(--line); color: var(--muted); }

/* ================================================================== 提示 */
.alert {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin: 10px 0;
  border: 1px solid;
}
.alert.err  { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.alert.ok   { background: var(--ok-bg);     border-color: #24503c; color: var(--ok); }
.alert.info { background: var(--brand-dim); border-color: #2a4470; color: var(--brand-soft); }

.empty { text-align: center; padding: 36px 0; color: var(--muted); }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 13px; }
.pager .muted { margin-left: auto; }

/* ================================================================== 详情列表 */
.kv { display: grid; grid-template-columns: 116px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

/* ================================================================== 登录页 */
.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-page .card { width: 340px; margin: 0; }
.login-page .card h2 { margin-bottom: 4px; }

/* ================================================================== 扫码区 */
.qr-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px 0 4px;
}
.qr-box {
  position: relative;
  background: #fff;
  padding: 14px;
  border-radius: 14px;
  line-height: 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}
.qr-box img, .qr-box canvas {
  display: block;
  width: 240px;
  height: 240px;
  image-rendering: pixelated;
}
.qr-box.hidden::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 21, .88);
  border-radius: 14px;
}
.qr-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  font-size: 13px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.pulse { animation: pulse 1.1s infinite; background: var(--warn); }
.dot.good { background: var(--ok); }
.dot.bad { background: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
}
.steps b { color: var(--text); font-weight: 600; }

.platforms { display: flex; gap: 10px; flex-wrap: wrap; }
.platforms button {
  flex: 1;
  min-width: 150px;
  padding: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.platforms button:hover { border-color: #39404d; }
.platforms button small { display: block; color: var(--muted); margin-top: 3px; }
.platforms button.active { border-color: var(--brand); background: var(--brand-dim); }

/* ================================================================== ck 展示 */
.ck-value {
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 11.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 260px;
  overflow: auto;
  user-select: all;
}

/* ================================================================== 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  width: min(680px, 100%);
  max-height: 85vh;
  overflow: auto;
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-head .btn { margin-left: auto; }

/* ================================================================== 响应式 */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
  }
  .sidebar .brand { margin: 0 8px 0 0; }
  .sidebar .sep, .sidebar .caption, .sidebar .who { display: none; }
  .sidebar a, .sidebar button {
    width: auto;
    margin-bottom: 0;
    padding: 6px 10px;
  }
  .sidebar .exit { margin-top: 0; }
  .content { padding: 16px 12px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .grid.cols-2 { grid-template-columns: 1fr; }
}
