/* 任务大厅 — 深色主题，移动端优先 */
:root {
  --bg: #0b0e14;
  --bg-soft: #10141d;
  --panel: #131826;
  --panel-2: #171d2e;
  --line: #232b40;
  --text: #e7ebf4;
  --muted: #8b93a7;
  --accent: #5b8cff;
  --accent-2: #7c5bff;
  --ok: #35d18b;
  --warn: #ffb020;
  --danger: #ff5c6c;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124, 91, 255, .18), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(91, 140, 255, .16), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1180px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 14, 20, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.admin-topbar { border-bottom-color: #2c3550; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 58px; gap: 12px; }
.brand { color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: .3px; display: inline-flex; align-items: center; gap: 9px; }
.brand:hover { text-decoration: none; }
.brand-dot { width: 10px; height: 10px; border-radius: 3px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 12px rgba(91, 140, 255, .8); }
.brand-dot.admin { background: linear-gradient(135deg, var(--warn), var(--danger)); box-shadow: 0 0 12px rgba(255, 92, 108, .7); }
.nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.who { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.who b { color: var(--text); font-size: 13.5px; }
.who i { font-style: normal; font-size: 12px; }

main { flex: 1; padding: 18px 0 40px; }
.foot { color: var(--muted); font-size: 12px; padding: 18px 16px 26px; text-align: center; }

/* 面板与卡片 */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.panel h2 { margin: 0 0 12px; font-size: 16.5px; display: flex; align-items: baseline; gap: 10px; }

.cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-head h3 { margin: 0; font-size: 15.5px; line-height: 1.4; }
.card p { margin: 0; }
.card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.card-actions form { margin: 0; }

.clamp { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { color: var(--muted); margin: 6px 0; }

/* 数据统计条 */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat-num { font-size: 24px; font-weight: 700; letter-spacing: .5px; }
.stat-label { color: var(--muted); font-size: 12.5px; }
.stat.is-warn .stat-num { color: var(--warn); }
.stat.is-ok .stat-num { color: var(--ok); }
.stat.is-dim .stat-num { color: var(--muted); }

/* 状态标签 */
.chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; line-height: 1.7; white-space: nowrap;
  border: 1px solid var(--line); color: var(--muted); background: rgba(255, 255, 255, .03);
}
.chip-ready { color: #9db9ff; border-color: rgba(91, 140, 255, .5); background: rgba(91, 140, 255, .12); }
.chip-live { color: #c7b3ff; border-color: rgba(124, 91, 255, .5); background: rgba(124, 91, 255, .14); }
.chip-wait { color: #ffd28a; border-color: rgba(255, 176, 32, .5); background: rgba(255, 176, 32, .12); }
.chip-done, .chip-ok { color: #8ff0c0; border-color: rgba(53, 209, 139, .5); background: rgba(53, 209, 139, .12); }
.chip-warn { color: #ffd28a; border-color: rgba(255, 176, 32, .5); background: rgba(255, 176, 32, .12); }
.chip-bad { color: #ff9aa5; border-color: rgba(255, 92, 108, .5); background: rgba(255, 92, 108, .12); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text);
  font-size: 14px; font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: transform .06s ease, filter .15s ease, border-color .15s ease;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(91, 140, 255, .28); font-weight: 600; }
.btn-ok { background: rgba(53, 209, 139, .16); border-color: rgba(53, 209, 139, .55); color: #8ff0c0; }
.btn-danger { background: rgba(255, 92, 108, .12); border-color: rgba(255, 92, 108, .5); color: #ff9aa5; }
.btn-ghost { background: transparent; }

/* 表单 */
.stack { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); }
input[type="text"], input[type="password"], input[type="number"], textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #0d1119; color: var(--text);
  font: inherit; outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91, 140, 255, .18); }
textarea { resize: vertical; min-height: 88px; }
input[type="file"] { color: var(--muted); font-size: 13px; }
input.num { width: 88px; display: inline-block; padding: 6px 9px; }

.notice {
  border: 1px solid rgba(255, 176, 32, .4);
  background: rgba(255, 176, 32, .1);
  color: #ffd28a;
  border-radius: 10px; padding: 10px 12px; font-size: 13px;
}

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt { margin-top: 10px; }
.sep { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.back { color: var(--muted); font-size: 13.5px; }
.center { text-align: center; }
.err-code { font-size: 44px; margin: 6px 0; }

/* 提示条 */
.flashes { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.flash { border-radius: 10px; padding: 10px 13px; font-size: 13.5px; border: 1px solid var(--line); background: var(--panel); }
.flash-ok { border-color: rgba(53, 209, 139, .45); color: #8ff0c0; background: rgba(53, 209, 139, .08); }
.flash-warn { border-color: rgba(255, 176, 32, .45); color: #ffd28a; background: rgba(255, 176, 32, .08); }
.flash-error { border-color: rgba(255, 92, 108, .45); color: #ff9aa5; background: rgba(255, 92, 108, .08); }

/* 任务详情 */
.task-body { white-space: pre-wrap; color: var(--text); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.qr-box { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr-img { width: min(320px, 78vw); max-height: 420px; object-fit: contain; border-radius: 12px; background: #fff; padding: 10px; border: 1px solid var(--line); }
.qr-preview { width: 160px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 6px; }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.ops, th.ops { white-space: nowrap; }
td.ops form, .row-actions form { display: inline-flex; align-items: center; gap: 6px; margin: 2px 6px 2px 0; }
td.ops input[type="text"] { width: 130px; padding: 6px 9px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
code { background: #0d1119; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 12px; }
