:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3f8;
  --ink: #151820;
  --muted: #5d6675;
  --subtle: #8a94a6;
  --line: #dde3eb;
  --blue: #0a66c2;
  --blue-dark: #064f9e;
  --green: #1d8a64;
  --amber: #b56b00;
  --red: #bd3b3b;
  --nav: rgba(255, 255, 255, 0.9);
  --shadow: 0 18px 48px rgba(22, 31, 45, 0.08);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid rgba(10, 102, 194, 0.25);
  outline-offset: 2px;
}

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
}

.boot-mark {
  width: 52px;
  height: 52px;
  font-size: 18px;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 48px;
}

.toast {
  position: fixed;
  right: 18px;
  top: 78px;
  z-index: 90;
  width: min(360px, calc(100vw - 28px));
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid rgba(29, 138, 100, 0.24);
  border-radius: var(--radius);
  background: #f0fbf6;
  color: var(--green);
  box-shadow: var(--shadow);
}

.toast span {
  color: #355f4d;
  font-size: 13px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--nav);
  border-bottom: 1px solid rgba(221, 227, 235, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
}

.topbar-inner {
  max-width: var(--max);
  min-height: 62px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), #5ba4f3);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.brand span {
  display: block;
  color: var(--subtle);
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
}

.nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
}

.nav a[aria-current="page"] {
  color: var(--blue);
  background: rgba(10, 102, 194, 0.09);
}

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

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.avatar-fallback {
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, #edf5ff, #dbe9fb);
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 700;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 20px 0;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 12px;
  font-size: 25px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.3;
}

.lead {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.band {
  margin-top: 18px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.band.dark {
  background: #16202f;
  color: #fff;
  border-color: #16202f;
}

.band.dark .muted,
.band.dark .metric span,
.band.dark .task p {
  color: rgba(255, 255, 255, 0.72);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.sidebar {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.card.soft {
  background: var(--surface-soft);
}

.card.action {
  display: grid;
  gap: 12px;
  align-content: space-between;
  min-height: 178px;
}

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

.fine {
  color: var(--subtle);
  font-size: 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}

.metric strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.task {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.task:first-child {
  border-top: 0;
  padding-top: 0;
}

.task:last-child {
  padding-bottom: 0;
}

.task p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.tag,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #edf3fa;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag.green,
.status.ok {
  background: #eaf7f1;
  color: var(--green);
}

.tag.amber,
.status.warn {
  background: #fff3df;
  color: var(--amber);
}

.tag.red,
.status.danger {
  background: #ffecec;
  color: var(--red);
}

.link-tag {
  border: 0;
  cursor: pointer;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  width: 100%;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.check-row input {
  margin: 0;
  flex: 0 0 auto;
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.check-row span {
  flex: 1 1 auto;
}

.switch-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  color: var(--ink);
}

.switch-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.switch-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.switch-control i {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #d6deea;
  position: relative;
  transition: background 0.2s ease;
}

.switch-control i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.switch-control input:checked + i {
  background: var(--blue);
}

.switch-control input:checked + i::after {
  transform: translateX(20px);
}

.btn,
.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius);
  min-height: 38px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.btn.primary:hover {
  background: var(--blue-dark);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  border-color: rgba(189, 59, 59, 0.22);
  color: var(--red);
  background: #fff7f7;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

textarea {
  min-height: 126px;
  resize: vertical;
}

.list {
  display: grid;
  gap: 10px;
}

.list.compact {
  gap: 8px;
}

.list.compact .list-item {
  padding: 11px;
}

.list-item {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.list-head strong {
  font-size: 15px;
}

.progress {
  height: 8px;
  background: #e8edf4;
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

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

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(310px, 0.8fr);
  gap: 18px;
  align-items: stretch;
}

.ai-console {
  display: grid;
  gap: 12px;
}

.quote {
  border-left: 4px solid var(--blue);
  padding-left: 12px;
  color: var(--muted);
}

.empty-state,
.notice-line {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.notice-line {
  border-style: solid;
  border-color: rgba(10, 102, 194, 0.18);
  background: #f2f7fd;
  color: var(--blue);
}

.table-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #f7f9fc;
  color: var(--muted);
  font-size: 13px;
}

.choice-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.question-switcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
}

.question-switcher select {
  min-width: 0;
}

.choice-panel .list-item,
.card.soft .list-item {
  margin: 0;
}

.question-card {
  display: grid;
  gap: 12px;
}

.options {
  display: grid;
  gap: 9px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.option input {
  width: auto;
  min-height: auto;
  margin-top: 4px;
}

.option.success {
  border-color: rgba(29, 138, 100, 0.28);
  background: #f0fbf6;
}

.option.danger {
  border-color: rgba(189, 59, 59, 0.22);
  background: #fff6f6;
}

.preline {
  white-space: pre-line;
}

.filter-panel,
.table-panel {
  display: grid;
  gap: 14px;
}

.filter-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.table-panel .table-note {
  margin-bottom: 0;
}

.bank-ima-panel {
  border-color: rgba(10, 102, 194, 0.18);
  background: #f8fbff;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.pager .row {
  gap: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: rgba(14, 21, 32, 0.55);
  padding: 20px;
  overflow: auto;
}

.modal[data-open="true"] {
  display: grid;
  place-items: center;
}

.modal-panel {
  width: min(940px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-top,
.modal-bottom {
  position: sticky;
  z-index: 2;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-bottom {
  bottom: 0;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-body {
  padding: 16px;
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.evaluation-paper {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.evaluation-paper p {
  margin: 0;
  color: var(--ink);
}

.evaluation-paper mark {
  padding: 2px 4px;
  border-radius: 4px;
  background: #fff3df;
  color: var(--ink);
}

.evidence-detail {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.evidence-detail summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.evidence-detail p {
  margin-bottom: 8px;
}

.video-shell {
  margin: 14px 0;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101824;
  color: #dce8f5;
  display: grid;
  place-items: center;
}

.video-placeholder {
  padding: 12px;
  text-align: center;
  font-weight: 700;
}

.video-player {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius);
  background: #101824;
  object-fit: cover;
}

.mobile-bar {
  display: none;
}

.admin-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
}

.admin-subtab {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.admin-subtab.active {
  border-color: var(--blue);
  background: rgba(10, 102, 194, 0.08);
  color: var(--blue);
}

.admin-question-split {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-question-sidebar {
  position: sticky;
  top: 86px;
}

.admin-question-main {
  min-width: 0;
}

.admin-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.admin-side-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.admin-side-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.admin-side-item span {
  color: var(--muted);
  font-size: 12px;
}

.admin-side-item.active {
  border-color: var(--blue);
  background: #f4f8ff;
}

.admin-detail {
  display: grid;
  gap: 14px;
}

.admin-detail h3 {
  margin: 0;
}

.admin-detail ~ table,
.admin-detail ~ .pager,
.admin-detail ~ .table-note,
.admin-question-split ~ table,
.admin-question-split ~ .pager {
  display: none;
}

.admin-bars {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.admin-bar-row {
  display: grid;
  grid-template-columns: minmax(72px, 118px) minmax(120px, 1fr) 48px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.admin-bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e8eef6;
  overflow: hidden;
}

.admin-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a66c2, #19a974);
}

.admin-sync-report {
  margin-bottom: 12px;
}

.transfer-actions {
  width: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.transfer-option {
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.transfer-option.active {
  background: rgba(10, 102, 194, 0.12) !important;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.46);
}

.admin-modal-panel {
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.admin-modal-panel > .band {
  margin-top: 0 !important;
}

@media (max-width: 980px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .brand {
    min-width: 0;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .top-actions {
    position: absolute;
    top: 15px;
    right: 20px;
  }

  .hero-panel,
  .grid.sidebar,
  .grid.two,
  .grid.three,
  .grid.four,
  .metrics,
  .form-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .admin-question-split {
    grid-template-columns: 1fr;
  }

  .admin-question-sidebar {
    position: static;
  }

  .page-head {
    display: grid;
    align-items: start;
  }

  .question-switcher {
    grid-template-columns: 1fr;
  }

  .pager {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 18px 14px 80px;
  }

  .topbar {
    display: none;
  }

  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid var(--line);
  }

  .mobile-bar a {
    display: grid;
    place-items: center;
    min-height: 44px;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-bar a[aria-current="page"] {
    background: rgba(10, 102, 194, 0.09);
    color: var(--blue);
  }

  .toast {
    top: 12px;
    right: 14px;
    left: 14px;
    width: auto;
  }

  .band,
  .card {
    padding: 14px;
  }

  .row {
    align-items: stretch;
  }

  .row .btn,
  .row .tag {
    width: 100%;
  }
}
