:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(15, 27, 45, 0.82);
  --panel-strong: #101f34;
  --line: rgba(148, 163, 184, 0.18);
  --text: #ecf5ff;
  --muted: #91a4bd;
  --primary: #63e6be;
  --primary-strong: #20c997;
  --danger: #ff8787;
  --warning: #ffd43b;
  --blue: #74c0fc;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 5%, rgba(32, 201, 151, .16), transparent 27rem),
    radial-gradient(circle at 90% 20%, rgba(59, 130, 246, .13), transparent 30rem),
    var(--bg);
}
a { color: var(--blue); text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 31, .7);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.brand-dot { width: 13px; height: 13px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 24px var(--primary); }
.top-actions { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 14px; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 72px; }
.hero { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; margin-bottom: 28px; }
.eyebrow { color: var(--primary); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; font-weight: 800; }
.profile-switcher { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(148, 163, 184, .08); font-size: 13px; }
.profile-arrow { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; color: var(--text); background: rgba(148, 163, 184, .1); line-height: 1; }
.profile-arrow:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.profile-arrow:disabled { cursor: not-allowed; opacity: .35; }
h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1.08; margin: 10px 0 12px; }
h2 { margin: 0; font-size: 20px; }
.hero p, .muted { color: var(--muted); }
.hero p { max-width: 700px; margin: 0; line-height: 1.8; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat, .card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .18);
}
.stat { padding: 20px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; font-size: 30px; margin-top: 8px; }
.card { padding: 24px; margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 12px var(--primary); }
.live.running i { animation: pulse 1.1s infinite; background: var(--blue); box-shadow: 0 0 12px var(--blue); }
@keyframes pulse { 50% { opacity: .35; transform: scale(.75); } }

.benchmark-stack { display: flex; flex-direction: column; gap: 24px; }
.benchmark-card { margin-bottom: 0; }
.section-caption { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.benchmark-latest { display: flex; flex-direction: column; gap: 22px; margin-bottom: 30px; }
.benchmark-summary { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; }
.verdict { min-height: 126px; border-radius: 16px; display: grid; place-content: center; text-align: center; background: rgba(148, 163, 184, .08); }
.verdict strong { font-size: 26px; }
.verdict small { display: block; margin-top: 6px; color: var(--muted); }
.verdict.passed { color: var(--primary); background: rgba(32, 201, 151, .11); }
.verdict.incorrect { color: var(--danger); background: rgba(255, 107, 107, .1); }
.verdict.error { color: var(--warning); background: rgba(255, 212, 59, .08); }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.meta-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.meta-item span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.answer { white-space: pre-wrap; word-break: break-word; line-height: 1.7; color: #cad8e8; max-height: 190px; overflow: auto; margin-top: 14px; }
.benchmark-summary > .answer { grid-column: 1 / -1; }
.subsection-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 6px 0 10px; }
.subsection-head h3 { margin: 0; font-size: 16px; }
.pelican-gallery { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.pelican-tile { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: rgba(4, 12, 23, .58); }
.pelican-tile.has-preview { transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.pelican-tile.has-preview:hover { transform: translateY(-2px); border-color: rgba(99, 230, 190, .55); box-shadow: 0 14px 32px rgba(0, 0, 0, .25); }
.pelican-tile-stage { aspect-ratio: 4 / 3; overflow: hidden; background: #fff; }
.pelican-tile-stage iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; pointer-events: none; }
.pelican-tile-empty, .pelican-gallery-empty { display: grid; place-items: center; color: var(--muted); text-align: center; }
.pelican-tile-empty { height: 100%; padding: 14px; background: rgba(4, 12, 23, .92); }
.pelican-gallery-empty { grid-column: 1 / -1; min-height: 160px; border: 1px dashed var(--line); border-radius: 13px; }
.pelican-tile-body { display: grid; gap: 8px; padding: 10px; }
.pelican-tile-body strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.pelican-tile-body time { color: var(--muted); font-size: 11px; }
.pelican-tile-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 11px; }
.pelican-tile-open { position: absolute; z-index: 2; inset: 0; display: flex; align-items: flex-start; justify-content: flex-end; width: 100%; padding: 8px; border: 0; border-radius: 13px; color: var(--text); background: transparent; }
.pelican-tile-open span { padding: 5px 8px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; color: #fff; background: rgba(7, 17, 31, .78); font-size: 11px; opacity: 0; transform: translateY(-3px); transition: opacity .18s ease, transform .18s ease; }
.pelican-tile:hover .pelican-tile-open span, .pelican-tile-open:focus-visible span { opacity: 1; transform: translateY(0); }
.pelican-tile-open:focus-visible { outline: 3px solid rgba(99, 230, 190, .82); outline-offset: -3px; }

body.dialog-open { overflow: hidden; }
.pelican-preview-dialog { width: min(1180px, calc(100vw - 32px)); max-width: none; height: min(840px, calc(100vh - 32px)); max-height: none; padding: 0; border: 1px solid rgba(148, 163, 184, .3); border-radius: 18px; color: var(--text); background: #07111f; box-shadow: 0 28px 90px rgba(0, 0, 0, .65); }
.pelican-preview-dialog::backdrop { background: rgba(0, 5, 13, .78); backdrop-filter: blur(7px); }
.pelican-preview-shell { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
.pelican-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #0d1b2e; }
.pelican-preview-head > div { min-width: 0; display: grid; gap: 3px; }
.pelican-preview-head strong, .pelican-preview-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pelican-preview-head strong { font-size: 16px; }
.pelican-preview-head span { font-size: 12px; }
.pelican-preview-close { flex: 0 0 auto; padding: 8px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: rgba(148, 163, 184, .12); }
.pelican-preview-close:hover { background: rgba(148, 163, 184, .22); }
.pelican-preview-stage { min-height: 0; background: #fff; }
.pelican-preview-stage iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
th { color: var(--muted); font-size: 12px; font-weight: 600; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: rgba(148, 163, 184, .1); font-size: 12px; }
.badge.passed { color: var(--primary); background: rgba(32, 201, 151, .12); }
.badge.incorrect { color: var(--danger); background: rgba(255, 107, 107, .12); }
.badge.error { color: var(--warning); background: rgba(255, 212, 59, .1); }
.answer-cell { max-width: 360px; color: #cad8e8; }
.empty { text-align: center; padding: 44px 16px; color: var(--muted); }

.admin-shell { width: min(900px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 80px; }
.login-card { width: min(440px, 100%); margin: 8vh auto 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
label { color: #cbd8e8; font-size: 14px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(4, 12, 23, .72);
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}
input:focus, select:focus { border-color: rgba(99, 230, 190, .7); box-shadow: 0 0 0 3px rgba(99, 230, 190, .09); }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn {
  border: 0;
  border-radius: 11px;
  padding: 11px 18px;
  color: #04241a;
  background: var(--primary);
  font-weight: 800;
}
.btn:hover { background: #8ce9ce; }
.btn.secondary { color: var(--text); background: rgba(148, 163, 184, .12); border: 1px solid var(--line); }
.btn.danger { color: #ffe3e3; background: rgba(255, 107, 107, .16); }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.notice { margin-top: 16px; border-radius: 11px; padding: 12px 14px; background: rgba(116, 192, 252, .1); color: #cce9ff; display: none; }
.notice.show { display: block; }
.notice.error { color: #ffe3e3; background: rgba(255, 107, 107, .12); }
.hidden { display: none !important; }
.section-note { padding: 13px 15px; border-left: 3px solid var(--blue); background: rgba(116, 192, 252, .07); color: var(--muted); line-height: 1.7; margin-bottom: 20px; }
.schedule-grid { align-items: start; }
.schedule-option { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(4, 12, 23, .3); }
.schedule-toggle { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.schedule-toggle input { width: 18px; height: 18px; accent-color: var(--primary); }
.schedule-status { min-height: 38px; line-height: 1.6; }
.profile-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end; margin-bottom: 16px; }
.profile-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.profile-chip { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: rgba(4, 12, 23, .35); text-align: left; }
.profile-chip:hover, .profile-chip.active { border-color: rgba(99, 230, 190, .65); background: rgba(32, 201, 151, .1); }
.profile-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip span, .profile-chip em { color: var(--muted); font-size: 12px; font-style: normal; }
.profile-chip em { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--primary); }
.field-check { justify-content: center; }
.field-check label { display: flex; align-items: center; gap: 10px; }
.field-check input { width: 18px; height: 18px; accent-color: var(--primary); }

@media (max-width: 980px) {
  .pelican-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .benchmark-summary, .form-grid { grid-template-columns: 1fr; }
  .profile-toolbar, .profile-list { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .top-actions span { display: none; }
  .card { padding: 18px; }
  .card-head, .subsection-head { align-items: flex-start; flex-direction: column; }
  .pelican-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pelican-preview-dialog { width: calc(100vw - 16px); height: calc(100vh - 16px); }
}
