:root {
  color-scheme: dark;
  --bg: #07101d;
  --panel: #0d1928;
  --panel-2: #111f31;
  --line: #21334a;
  --text: #edf4ff;
  --muted: #8ea1b8;
  --cyan: #28d7c0;
  --blue: #4d8dff;
  --red: #ff626d;
  --gold: #f4c95d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, rgba(77, 141, 255, .18), transparent 32rem),
    radial-gradient(circle at 95% 0%, rgba(40, 215, 192, .11), transparent 28rem),
    var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.shell { width: min(1560px, calc(100% - 28px)); margin: 0 auto; padding: 14px 0 32px; }
.topbar { display: flex; min-height: 46px; align-items: center; justify-content: space-between; gap: 24px; }
.brand-row { display: flex; align-items: center; gap: 18px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(23px, 2.4vw, 30px); letter-spacing: -.03em; }
h2 { font-size: 18px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.badge, .count-label, .user-chip { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: var(--muted); background: rgba(13, 25, 40, .8); font-size: 13px; }
.quiet { border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; color: var(--text); background: transparent; }

.inline-boundary { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(40, 215, 192, .3); border-radius: 5px; padding: 7px 11px; color: var(--cyan); background: rgba(40, 215, 192, .055); font-size: 12px; font-weight: 650; }
.boundary-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 16px var(--cyan); }

.login-card { width: min(610px, 100%); margin: 7vh auto 0; padding: clamp(28px, 5vw, 46px); border: 1px solid var(--line); border-radius: 7px; text-align: center; background: linear-gradient(145deg, rgba(17,31,49,.98), rgba(10,20,34,.94)); box-shadow: 0 28px 80px rgba(0,0,0,.25); }
.security-mark { width: 52px; height: 52px; margin-bottom: 18px; fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.login-card h2 { font-size: 24px; }
.login-boundary { margin-top: 14px; color: var(--cyan); font-size: 13px; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 24px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: rgba(7,19,32,.72); }
.auth-switch .auth-tab { margin: 0; border: 0; border-radius: 6px; padding: 9px 12px; color: var(--muted); background: transparent; font-weight: 700; }
.auth-switch .auth-tab.active { color: var(--text); background: rgba(77,141,255,.2); }
.login-card form { text-align: left; }
.login-card .auth-form { margin-top: 18px; }
.login-card label, .search-field span, legend { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
input, select, textarea { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; outline: 0; color: var(--text); background: #071320; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(77,141,255,.14); }
.login-card input, .login-card button { width: 100%; }
.login-card input { padding: 12px 14px; }
.login-card label:not(:first-child) { margin-top: 12px; }
.login-card button { margin-top: 12px; border: 0; border-radius: 7px; padding: 12px 18px; color: #f7fbff; background: #236ee8; font-weight: 800; }
.form-message { min-height: 18px; margin-top: 7px; color: var(--red); font-size: 13px; }
.risk-check { display:flex; align-items:flex-start; gap:8px; color:var(--muted); font-size:12px; line-height:1.6; }
.risk-check input { width:auto; margin-top:3px; }
.risk-check a { color:var(--cyan); }
.login-helper { color: var(--muted); font-size: 12px; }

.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 10px 0 0; border: 1px solid var(--line); border-radius: 6px; background: linear-gradient(145deg, var(--panel-2), var(--panel)); }
.summary-card { min-height: 65px; padding: 11px 18px; border-right: 1px solid var(--line); }
.summary-card:last-child { border-right: 0; }
.summary-card span, .summary-card small { display: block; color: var(--muted); }
.summary-card span { font-size: 11px; }
.summary-card strong { display: block; margin: 3px 0 1px; font-size: 19px; }
.summary-card small { font-size: 10px; }

.tabs { display: flex; gap: 24px; height: 43px; margin: 3px 0 0; border-bottom: 1px solid var(--line); }
.tab { border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 10px 4px 8px; color: var(--muted); background: transparent; font-weight: 700; }
.tab.active { border-bottom-color: var(--blue); color: var(--text); background: transparent; }
.pool-panel { border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: rgba(13,25,40,.93); }
.panel-heading { display: flex; min-height: 48px; align-items: center; justify-content: space-between; padding: 10px 17px; border-bottom: 1px solid var(--line); }
.panel-heading .count-label { padding: 5px 9px; font-size: 11px; }
.filters { display: grid; min-height: 67px; grid-template-columns: minmax(180px, .65fr) 1fr 1.5fr; align-items: end; gap: 16px; padding: 9px 17px 10px; border-bottom: 1px solid var(--line); background: rgba(7,16,29,.42); }
.compact-filters { grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px); }
.search-field input, .search-field select { width: 100%; }
fieldset { margin: 0; padding: 0; border: 0; }
.choice-row { display: flex; flex-wrap: wrap; gap: 7px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: block; border: 1px solid var(--line); border-radius: 5px; padding: 6px 9px; color: var(--muted); background: #091522; font-size: 11px; transition: .15s ease; }
.choice input:checked + span { border-color: var(--blue); color: #dce9ff; background: rgba(77,141,255,.2); }

.table-wrap { max-height: calc(100vh - 300px); min-height: 340px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; padding: 9px 13px; text-align: left; color: var(--muted); background: #0b1725; font-weight: 600; }
td { padding: 8px 13px; border-top: 1px solid rgba(33,51,74,.72); white-space: nowrap; }
tbody tr:hover { background: rgba(77,141,255,.06); }
.positive { color: var(--red); }
.negative { color: var(--cyan); }
.tag-list { color: #b7c9e3; font-size: 12px; }
.empty-row td { padding: 42px; text-align: center; color: var(--muted); }

.discussion-panel { margin-top: 14px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: rgba(13,25,40,.93); }
.discussion-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.section-kicker { display: block; margin-bottom: 4px; color: var(--cyan); font-size: 11px; letter-spacing: .14em; }
.comment-notice { margin: 14px 18px 0; border: 1px solid rgba(244,201,93,.35); border-radius: 7px; padding: 11px 13px; color: var(--gold); background: rgba(244,201,93,.06); font-size: 13px; }
.comment-form { margin: 16px 18px; }
.comment-form textarea { width: 100%; resize: vertical; line-height: 1.65; }
.comment-form-footer { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 8px; }
.comment-form-footer span { color: var(--muted); font-size: 12px; }
.comment-form-footer button { border: 0; border-radius: 7px; padding: 9px 18px; color: #f7fbff; background: #236ee8; font-weight: 750; }
.comment-form .form-message { text-align: right; }
.comment-list { border-top: 1px solid var(--line); }
.comment-item { padding: 15px 18px; border-top: 1px solid rgba(33,51,74,.62); }
.comment-item:first-child { border-top: 0; }
.comment-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.comment-meta strong { color: #dbe8fb; font-size: 13px; }
.comment-meta time { margin-left: auto; }
.comment-delete { border: 0; padding: 3px 5px; color: var(--muted); background: transparent; font-size: 12px; }
.comment-delete:hover { color: var(--red); }
.comment-delete.armed { border-radius: 4px; color: #fff; background: rgba(255,98,109,.18); }
.comment-body { margin-top: 8px; color: #d3dfef; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-empty { padding: 28px 18px; color: var(--muted); text-align: center; }
.comment-empty.error { color: var(--red); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 880px) {
  .brand-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .filters, .compact-filters { grid-template-columns: 1fr; }
  .table-wrap { max-height: 58vh; }
  .topbar-actions { align-self: flex-start; }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 20px, 1480px); padding-top: 12px; }
  .topbar { align-items: flex-start; }
  .topbar-actions { flex-direction: column; align-items: flex-end; }
  .inline-boundary { max-width: 240px; }
  .summary-card { min-height: 55px; padding: 8px 9px; }
  .summary-card strong { font-size: 15px; }
  .summary-card small { display: none; }
  .discussion-heading { align-items: flex-start; }
  .comment-meta { flex-wrap: wrap; }
  .comment-meta time { margin-left: 0; }
  .comment-delete { margin-left: auto; }
}
