/* DeepTalk review console: a standard admin shell. Top bar, dark left nav with queue badges,
   list + detail split for queues. Light and dark follow the system setting. */
:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --ink: #1f2328;
  --ink-2: #5b636d;
  --ink-3: #8a929b;
  --line: #e2e5e9;
  --line-2: #d0d5db;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --accent-soft: #e4efeb;
  --red: #b03a2e;
  --red-soft: #fbeae7;
  --amber: #a86b00;
  --amber-soft: #fbf0d9;
  --blue: #2b5c9e;
  --blue-soft: #e6eef9;
  --nav: #1b1f24;
  --nav-ink: #c9ced4;
  --nav-ink-2: #7f8790;
  --nav-on: #2a3038;
  --focus: #4d8f7d;
  font-family:
    'PingFang SC',
    'Hiragino Sans GB',
    'Noto Sans SC',
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1c2024;
    --surface-2: #22272c;
    --ink: #e6e8ea;
    --ink-2: #a3abb3;
    --ink-3: #79818a;
    --line: #2d3338;
    --line-2: #3a4148;
    --accent: #5fa893;
    --accent-ink: #0f1a16;
    --accent-soft: #1f3330;
    --red: #e7786a;
    --red-soft: #3a2220;
    --amber: #e0aa4a;
    --amber-soft: #352b18;
    --blue: #7fa8e0;
    --blue-soft: #1d2a3b;
    --nav: #0f1214;
    --nav-ink: #c9ced4;
    --nav-ink-2: #6f777f;
    --nav-on: #22282e;
    --focus: #6fbca6;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

a {
  color: var(--accent);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

h4 {
  font-size: 13px;
  margin: 14px 0 6px;
  color: var(--ink-2);
}

p {
  margin: 0 0 8px;
}

.muted {
  color: var(--ink-2);
}

.faint {
  color: var(--ink-3);
}

.small {
  font-size: 12px;
}

.mono {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12.5px;
  word-break: break-all;
}

.error {
  color: var(--red);
}

.pre {
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  padding: 6px 14px;
  border-radius: 6px;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--ink-3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.danger {
  border-color: var(--red);
  color: var(--red);
  background: transparent;
}

.btn.danger.solid {
  background: var(--red);
  color: #fff;
}

.btn.small {
  padding: 2px 10px;
  font-size: 12px;
}

.link {
  border: 0;
  background: none;
  color: var(--accent);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

input,
textarea,
select {
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--surface);
  padding: 6px 10px;
  min-width: 0;
}

textarea {
  width: 100%;
  resize: vertical;
}

input.time {
  width: 90px;
}

input.grow,
textarea.grow {
  flex: 1;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-2);
}

label.field input {
  font-size: 14px;
  color: var(--ink);
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0;
}

.chip {
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--ink-2);
}

.chip:hover,
.chip.on {
  border-color: var(--accent);
  color: var(--accent);
}

.radios {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 6px 0;
}

.radios label {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

/* Inline confirmation instead of window.confirm. */
.confirm {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--amber);
  background: var(--amber-soft);
  border-radius: 6px;
}

.confirm.danger {
  border-color: var(--red);
  background: var(--red-soft);
}

.confirm .msg {
  flex: 1 1 260px;
}

/* ---------- tags ---------- */

.tag {
  display: inline-block;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 20px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.tag.warn {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: transparent;
}

.tag.ok {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.tag.bad {
  background: var(--red-soft);
  color: var(--red);
  border-color: transparent;
}

.tag.info {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: transparent;
}

/* ---------- login ---------- */

.login {
  max-width: 380px;
  margin: 14vh auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.login h1 {
  font-size: 20px;
}

/* ---------- shell ---------- */

.shell {
  display: grid;
  grid-template-columns: 208px 1fr;
  grid-template-rows: 52px 1fr;
  height: 100vh;
}

.top {
  grid-column: 1 / 3;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 600;
  width: 176px;
  flex: none;
}

.search {
  display: flex;
  gap: 6px;
  flex: 1;
  max-width: 460px;
}

.search input {
  flex: 1;
}

.me {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink-2);
  font-size: 13px;
}

.nav {
  background: var(--nav);
  color: var(--nav-ink);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--nav-ink);
  text-decoration: none;
}

.nav a:hover {
  background: var(--nav-on);
}

.nav a.on {
  background: var(--nav-on);
  color: #fff;
  font-weight: 600;
}

.badge {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #c4553f;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 600;
}

.nav-foot {
  margin-top: auto;
  padding: 12px 20px 16px;
  font-size: 12px;
  color: var(--nav-ink-2);
  border-top: 1px solid var(--nav-on);
}

.nav-foot dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  margin: 6px 0 0;
}

.nav-foot dd {
  margin: 0;
  color: var(--nav-ink);
}

.nav-foot .on-state {
  color: #e8b45a;
}

.main {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.alert {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 16px;
  background: var(--red-soft);
  color: var(--red);
  border-bottom: 1px solid var(--red);
}

.alert .msg {
  flex: 1;
}

.view {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.page {
  padding: 20px 24px 40px;
  max-width: 1200px;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* ---------- queues: list + detail ---------- */

.split {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: 100%;
}

.pane {
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pane-head {
  padding: 12px 12px 0;
  border-bottom: 1px solid var(--line);
}

.pane-head .hint {
  font-size: 12px;
  color: var(--ink-3);
  padding: 6px 2px 8px;
}

.tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.tab {
  border: 0;
  background: none;
  padding: 6px 10px;
  border-bottom: 2px solid transparent;
  color: var(--ink-2);
}

.tab.on {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tabs.big {
  margin-bottom: 8px;
}

.tabs.big .tab {
  font-size: 15px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  background: none;
  padding: 10px 12px;
}

.item:hover {
  background: var(--surface-2);
}

.item.on {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.item .line1 {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.item .who {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item .meta {
  font-size: 12px;
  color: var(--ink-2);
}

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-2);
}

.pane-foot {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.detail {
  overflow-y: auto;
  padding: 20px 24px 48px;
  min-width: 0;
}

.detail-head {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.placeholder {
  color: var(--ink-3);
  padding: 40px 0;
  text-align: center;
}

/* ---------- blocks ---------- */

.block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.block.decision {
  border-color: var(--accent);
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 0;
}

.facts dt {
  color: var(--ink-2);
}

.facts dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--ink-2);
  font-weight: 500;
  background: var(--surface-2);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink);
}

.card:hover {
  border-color: var(--accent);
}

.card .num {
  font-size: 26px;
  font-weight: 600;
}

.card .num.zero {
  color: var(--ink-3);
}

.amount {
  font-size: 18px;
}

.quote {
  border-left: 3px solid var(--line-2);
  padding: 4px 10px;
  margin: 6px 0;
  background: var(--surface-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.notice {
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--amber-soft);
  color: var(--amber);
  margin-bottom: 10px;
}

.links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

/* ---------- talk review (ported) ---------- */

.spans {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.span-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.span-row .reason {
  flex: 1;
  min-width: 160px;
}

.preview {
  margin: 10px 0 0;
  font-weight: 500;
}

.timeline {
  position: relative;
  height: 10px;
  background: var(--accent-soft);
  border-radius: 5px;
  margin: 8px 0 4px;
  overflow: hidden;
}

.timeline .cut {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--red);
  opacity: 0.7;
}

.rec-downloads {
  margin: 6px 0 10px;
  padding-left: 18px;
}

.rec-seg {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.rec-seg-head {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: baseline;
  margin-bottom: 6px;
}

.rec-track {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 4px 0;
}

.rec-track .who {
  min-width: 140px;
}

.rec-player audio {
  height: 32px;
  max-width: 100%;
}

.excluded {
  margin: 0;
  padding-left: 18px;
}

/* ---------- misc ---------- */

.more {
  margin-top: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.15s,
    transform 0.15s;
  pointer-events: none;
  z-index: 10;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast.error {
  background: var(--red);
  color: #fff;
}

.kbd {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: 0 4px;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    height: auto;
    min-height: 100vh;
  }
  .top {
    grid-column: 1;
    flex-wrap: wrap;
    padding: 8px 16px;
  }
  .brand {
    width: auto;
  }
  .nav ul {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav-foot {
    display: none;
  }
  .split {
    grid-template-columns: 1fr;
    height: auto;
  }
  .pane {
    border-right: 0;
    max-height: 50vh;
  }
  .detail,
  .page {
    padding: 16px;
  }
}

.thumb {
  display: block;
  max-width: 100%;
  max-height: 360px;
  border-radius: 6px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
}

.pane-note {
  padding: 10px 16px 14px;
  margin: 0;
  border-top: 1px solid var(--line);
}

/* 学历核对: the 学信网 code is the one thing to read and copy. */
.mono.big {
  font-size: 18px;
  letter-spacing: 1px;
}
.edu-review .field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
