:root {
  color-scheme: light;
  --bg: #f3f2ef;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-raised: rgba(255, 255, 255, 0.9);
  --surface-soft: rgba(245, 246, 246, 0.72);
  --line: rgba(87, 101, 111, 0.14);
  --line-strong: rgba(78, 92, 103, 0.22);
  --text: #29353d;
  --muted: #6f7c85;
  --subtle: #96a0a6;
  --accent: #d88a68;
  --accent-hover: #cd7655;
  --accent-soft: rgba(216, 138, 104, 0.15);
  --ok: #4f8a72;
  --ok-soft: rgba(79, 138, 114, 0.1);
  --danger: #b86f66;
  --radius: 14px;
  --shadow: 0 12px 34px rgba(73, 84, 91, 0.08), 0 2px 7px rgba(73, 84, 91, 0.04);
  --shadow-hover: 0 18px 42px rgba(73, 84, 91, 0.12), 0 4px 12px rgba(73, 84, 91, 0.06);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 8% -8%, rgba(220, 190, 176, 0.34), transparent 30rem),
    radial-gradient(circle at 90% 6%, rgba(190, 211, 206, 0.3), transparent 26rem),
    linear-gradient(180deg, #f8f7f4 0, var(--bg) 28rem);
  font-size: 15px;
  line-height: 1.55;
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(248, 248, 246, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 4px 22px rgba(75, 86, 93, 0.05);
}

.topbar-inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
  transform: rotate(12deg);
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.topbar nav a {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 120ms ease, background 120ms ease;
}

.topbar nav a:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.account {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.account form { margin: 0; }

.account-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 48px auto 80px;
}

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

.page-heading h1,
.login-card h1 {
  margin: 4px 0 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.heading-episode {
  color: var(--muted);
  font-size: 0.65em;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.eyebrow {
  margin: 0;
  color: var(--accent-hover);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.19em;
}

.page-description {
  max-width: 620px;
  margin: 9px 0 0;
  color: var(--muted);
}

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

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

.stats-grid article,
.panel,
.candidate-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(248, 249, 248, 0.62));
  backdrop-filter: blur(18px) saturate(115%);
  box-shadow: var(--shadow);
}

.stats-grid article,
.candidate-card {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.stats-grid article:hover,
.candidate-card:hover {
  transform: translateY(-2px);
  border-color: rgba(89, 103, 113, 0.2);
  box-shadow: var(--shadow-hover);
}

.stats-grid article { padding: 20px; }

.stats-grid span,
.stats-grid small {
  display: block;
  color: var(--muted);
}

.stats-grid strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 12px;
}

.panel {
  margin: 16px 0;
  padding: 22px;
}

.panel h2,
.candidate-card h2 { margin-top: 0; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(18px) saturate(110%);
  box-shadow: var(--shadow);
}

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

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--subtle);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

tbody tr { transition: background 120ms ease; }
tbody tr:hover { background: rgba(255, 255, 255, 0.52); }
tbody tr:last-child td { border-bottom: 0; }

.table-id,
.table-time,
.candidate-id {
  color: var(--subtle);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.anime-title-cell {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 190px;
}

.anime-cover {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(209, 221, 217, 0.9), rgba(233, 216, 207, 0.88));
  color: rgba(55, 71, 78, 0.66);
  font-weight: 780;
  box-shadow: 0 7px 18px rgba(73, 84, 91, 0.13);
}

.anime-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(53, 66, 73, 0.05);
  pointer-events: none;
}

.anime-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.anime-cover:hover img { transform: scale(1.035); }

.anime-cover span {
  font-family: ui-serif, "Noto Serif SC", serif;
  font-size: 1.2rem;
}

.cover-small {
  width: 42px;
  height: 56px;
  border-radius: 9px;
}

.cover-large {
  width: 104px;
  height: 140px;
}

.cover-large span { font-size: 2.1rem; }

.anime-heading-main {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.anime-detail-heading { align-items: center; }

.title-link {
  color: var(--text);
  font-weight: 680;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}

.title-link:hover {
  color: #1f2b32;
  text-decoration-color: var(--accent);
}

.episode-label { white-space: nowrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.73rem;
  white-space: nowrap;
}

.badge.success {
  border-color: rgba(79, 138, 114, 0.28);
  color: var(--ok);
  background: var(--ok-soft);
}

.badge.review {
  border-color: rgba(216, 138, 104, 0.32);
  color: #a86146;
  background: var(--accent-soft);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

button,
.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  font-weight: 620;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

button:hover,
.button:hover {
  border-color: rgba(78, 92, 103, 0.32);
  background: #fff;
  box-shadow: 0 7px 18px rgba(73, 84, 91, 0.08);
}

button:active,
.button:active { transform: translateY(1px); }

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

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

.video-link { flex: 0 0 auto; }

.button.disabled {
  color: var(--subtle);
  cursor: not-allowed;
  opacity: 0.75;
}

.danger-ghost { color: var(--danger); }

.link-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 500;
}

.link-button:hover {
  border: 0;
  background: none;
  color: var(--text);
}

input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: 0;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font: inherit;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.stack { display: grid; gap: 16px; }

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}

.inline-form input { margin: 0; }

.actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.actions-grid form { margin: 0; }

.filter {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.filter a {
  padding: 6px 12px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  text-decoration: none;
}

.filter a:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.filter a.selected {
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: 0 4px 12px rgba(73, 84, 91, 0.07);
}

.candidate-list { display: grid; gap: 12px; }

.candidate-card {
  margin: 0;
  padding: 20px;
}

.candidate-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.candidate-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.candidate-copy {
  min-width: 0;
  max-width: 820px;
}

.candidate-card h2 {
  margin-bottom: 8px;
  font-size: 1.15rem;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.candidate-card h2 span {
  color: var(--muted);
  font-size: 0.82em;
  white-space: nowrap;
}

.candidate-title {
  margin: 0;
  color: #46535c;
  overflow-wrap: anywhere;
}

.candidate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.evaluation {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.86rem;
}

.evaluation summary {
  width: fit-content;
  cursor: pointer;
  user-select: none;
}

.candidate-card pre {
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(241, 243, 243, 0.86);
  color: var(--muted);
}

.candidate-actions {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.candidate-select { margin-top: 16px; }

.submit-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(360px, 1fr);
  align-items: end;
  gap: 24px;
  margin-top: 24px;
}

.submit-panel h2 { margin-bottom: 4px; }
.submit-panel p { margin: 0; }

.details dl {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 11px 20px;
  margin: 0;
}

.details dt { color: var(--muted); }
.details dd { margin: 0; }

.empty,
.alert {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.52);
}

.alert {
  border-style: solid;
  border-color: rgba(190, 119, 91, 0.3);
  background: rgba(251, 234, 225, 0.72);
  color: #8d5240;
}

.login-page { display: grid; place-items: center; }

.login-card {
  width: min(420px, calc(100% - 32px));
  margin: 10vh auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(115%);
  box-shadow: var(--shadow);
}

.login-card code { overflow-wrap: anywhere; }

.check { display: flex; align-items: center; }
.check input[type="checkbox"] { width: auto; margin: 0 8px 0 0; }

@media (max-width: 800px) {
  .topbar-inner {
    width: min(100% - 28px, 1120px);
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 12px 0;
  }

  .topbar nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .account { margin-left: auto; }

  .container {
    width: min(100% - 28px, 1120px);
    margin-top: 32px;
  }

  .page-heading { align-items: flex-start; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .two-column { grid-template-columns: 1fr; }
  .candidate-main { gap: 16px; }
  .submit-panel { grid-template-columns: 1fr; }
  .details dl { grid-template-columns: 1fr; gap: 3px; }
  .details dd { margin-bottom: 10px; }
}

@media (max-width: 620px) {
  .account-name { display: none; }

  .page-heading {
    display: grid;
    gap: 18px;
  }

  .page-heading > .button { width: fit-content; }
  .page-heading h1, .login-card h1 { font-size: 2rem; }
  .stats-grid { grid-template-columns: 1fr; }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td { display: block; width: 100%; }

  .responsive-table { min-width: 0; }
  .responsive-table thead { display: none; }

  .responsive-table tbody {
    display: grid;
    gap: 10px;
  }

  .responsive-table tbody tr {
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
  }

  .responsive-table td {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 10px;
    padding: 7px 0;
    border: 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--subtle);
    font-size: 0.75rem;
  }

  .candidate-main { display: grid; }
  .video-link, .button.disabled { width: fit-content; }
  .candidate-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .candidate-actions form button { width: 100%; }
  .inline-form { display: grid; }
  .anime-detail-heading { align-items: flex-start; }
  .anime-heading-main { align-items: flex-start; gap: 15px; }
  .cover-large { width: 72px; height: 98px; border-radius: 9px; }
  .anime-detail-heading .page-description { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
