:root {
  color-scheme: light;
  --paper: #f6f1e7;
  --paper-deep: #eee6d7;
  --surface: #fffdf8;
  --ink: #19241e;
  --muted: #626b62;
  --line: #d8d2c5;
  --green: #164c3a;
  --green-dark: #0f392c;
  --green-soft: #dce9df;
  --amber: #d8a33d;
  --red: #b64a3d;
  --red-soft: #f4dfda;
  --blue: #4a7284;
  --shadow: 0 18px 55px rgba(48, 45, 35, 0.09);
  --radius: 18px;
  font-family: "Aptos Narrow", "Noto Sans SC", "Microsoft YaHei UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(22, 76, 58, 0.25);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #fff;
  background: var(--green);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(105, 101, 89, 0.18);
  background: rgba(246, 241, 231, 0.94);
  backdrop-filter: blur(14px);
}

.header-inner,
.page-shell,
.admin-shell,
.site-footer {
  width: min(1440px, calc(100% - 48px));
  margin-inline: auto;
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 19px;
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--paper);
  background: var(--green);
  font-size: 16px;
}

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

.nav-link,
.text-button {
  border: 0;
  padding: 9px 13px;
  color: var(--muted);
  background: transparent;
}

.nav-link {
  border-radius: 8px;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.72);
}

.view {
  min-height: calc(100vh - 150px);
}

.page-shell,
.admin-shell {
  padding-block: 54px 76px;
}

.monitor-layout {
  display: flex;
  align-items: flex-start;
  gap: 30px;
}

.monitor-column {
  min-width: 0;
  flex: 1 1 auto;
}

.visitor-card {
  position: sticky;
  top: 96px;
  width: clamp(360px, 27vw, 390px);
  flex: 0 0 clamp(360px, 27vw, 390px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.page-heading,
.section-heading,
.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-heading {
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Noto Serif SC", serif;
  font-weight: 700;
}

h1 {
  font-size: clamp(36px, 4.5vw, 62px);
  line-height: 1.05;
}

h2 {
  font-size: 25px;
  line-height: 1.18;
}

h3 {
  font-size: 21px;
}

.lead,
.visitor-card-heading p:last-child,
.panel-note {
  color: var(--muted);
  line-height: 1.7;
}

.lead {
  max-width: 650px;
  margin: 15px 0 0;
  font-size: 16px;
}

.schedule-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.65);
  font-size: 13px;
  white-space: nowrap;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(216, 163, 61, 0.15);
}

.live-dot.is-on {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 76, 58, 0.13);
}

.group-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.group-card,
.admin-panel,
.auth-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.82);
}

.group-card {
  min-width: 0;
  padding: 24px;
}

.group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.group-meta {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.configuration-badge,
.status-badge,
.benchmark-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.configuration-badge {
  padding: 6px 9px;
  color: var(--green);
  background: var(--green-soft);
}

.configuration-badge.is-off {
  color: var(--muted);
  background: var(--paper-deep);
}

.benchmark-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 10px;
  background: var(--paper-deep);
}

.benchmark-tab {
  border: 0;
  border-radius: 7px;
  padding: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.benchmark-tab.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 2px 9px rgba(46, 43, 34, 0.08);
}

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

.stat {
  min-width: 0;
  padding-right: 8px;
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: 0;
}

.stat dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.stat dd {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 700;
}

.history-heading,
.history-axis {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.history-heading {
  flex-wrap: wrap;
  margin-top: 20px;
  margin-bottom: 12px;
}

.history-heading strong {
  color: var(--ink);
  font-size: 14px;
}

.history-capacity {
  margin-left: 9px;
}

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

.history-refresh {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0;
  color: var(--green);
  background: var(--surface);
  font-size: 20px;
}

.history-viewport {
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 5px 3px;
}

.history-strip {
  display: grid;
  grid-template-columns: repeat(60, minmax(24px, 1fr));
  gap: 4px;
  min-width: 1676px;
  min-height: 48px;
}

.history-point {
  min-width: 24px;
  height: 48px;
  display: flex;
  align-items: end;
  border: 0;
  padding: 0;
  background: transparent;
}

.history-point::before {
  content: "";
  display: block;
  width: 100%;
  height: 44px;
  border-radius: 4px;
  background: var(--status-color, #c8c5bd);
  transition: height 150ms ease, transform 150ms ease;
}

.history-point:hover::before,
.history-point:focus-visible::before,
.history-point[aria-pressed="true"]::before {
  height: 48px;
  transform: translateY(-2px);
}

.history-point.is-passed,
.history-point.is-normal,
.legend-mark.is-passed,
.status-badge.is-passed,
.status-badge.is-normal {
  color: var(--green);
  --status-color: #52a77b;
}

.history-point.is-incorrect,
.status-badge.is-incorrect,
.history-point.is-degraded,
.legend-mark.is-incorrect,
.status-badge.is-degraded {
  color: #76510b;
  --status-color: #df766e;
}

.history-point.is-error,
.status-badge.is-error,
.history-point.is-failed,
.legend-mark.is-error,
.status-badge.is-failed {
  color: var(--red);
  --status-color: #e7bd50;
}

.history-point.is-running,
.history-point.is-queued,
.legend-mark.is-running,
.status-badge.is-running,
.status-badge.is-queued {
  color: var(--blue);
  --status-color: #8eb3c0;
}

.history-point.is-empty,
.legend-mark.is-empty {
  --status-color: #e1ddd3;
}

.history-axis {
  margin-top: 8px;
}

.history-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px 16px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
}

.history-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-mark {
  width: 6px;
  height: 12px;
  border-radius: 2px;
  background: var(--status-color);
}

.status-badge {
  padding: 6px 9px;
  color: var(--ink) !important;
  background: var(--status-color, var(--paper-deep));
}

.detail-panel {
  min-height: 84px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.detail-panel .empty-state {
  padding: 8px 0 0;
}

.test-detail-head,
.task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.test-detail-meta,
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
}

.test-output {
  max-height: 220px;
  margin: 10px 0 0;
  overflow: auto;
  border-radius: 9px;
  padding: 12px;
  color: #e9efe9;
  background: #17201b;
  font: 12px/1.55 Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.community-section {
  margin-top: 52px;
}

.pelican-preview {
  display: block;
  width: 100%;
  height: 320px;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}

.output-source summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}

.community-item {
  cursor: pointer;
}

.community-record > .detail-panel {
  margin: 0;
  padding: 16px 4px;
}

.section-heading {
  margin-bottom: 18px;
}

.privacy-note {
  color: var(--muted);
  font-size: 12px;
}

.community-list {
  border-top: 1px solid var(--line);
}

.community-item {
  display: grid;
  grid-template-columns: 110px minmax(140px, 1fr) minmax(120px, 0.7fr) 100px;
  gap: 18px;
  align-items: center;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}

.community-item strong {
  font-size: 14px;
}

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

.benchmark-badge {
  width: fit-content;
  padding: 5px 8px;
  color: var(--green);
  background: var(--green-soft);
}

.visitor-card-heading {
  margin-bottom: 24px;
}

.visitor-card-heading h2 {
  font-size: 30px;
}

.visitor-card-heading p:last-child {
  margin: 10px 0 0;
  font-size: 13px;
}

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

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > span,
.check-field {
  color: #454c47;
  font-size: 12px;
  font-weight: 750;
}

.field input,
.field select {
  width: 100%;
  min-height: 43px;
  border: 1px solid #cbc5b8;
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffefb;
}

.field input::placeholder {
  color: #aaa69d;
}

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

.field-help {
  margin: -5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-field input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.primary-button {
  min-height: 44px;
  border: 1px solid var(--green);
  border-radius: 9px;
  padding: 10px 17px;
  color: #fff;
  background: var(--green);
  font-weight: 750;
  transition: background 150ms ease, transform 150ms ease;
}

.primary-button:hover {
  background: var(--green-dark);
}

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

.primary-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.form-message {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.visitor-results {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.visitor-task {
  border-top: 1px solid var(--line);
  padding-top: 15px;
}

.task-title {
  font-weight: 800;
  text-transform: capitalize;
}

.notice {
  margin-bottom: 18px;
  border-radius: 10px;
  padding: 12px 14px;
}

.notice-error {
  color: #7f2d24;
  background: var(--red-soft);
}

.empty-state {
  margin: 0;
  padding: 30px 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.skeleton-card {
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(255, 253, 248, 0.55), rgba(255, 255, 255, 0.92), rgba(255, 253, 248, 0.55));
  background-size: 240% 100%;
  animation: shimmer 1.25s infinite linear;
}

@keyframes shimmer {
  to { background-position: -140% 0; }
}

.admin-shell {
  max-width: 1080px;
}

.admin-heading {
  align-items: center;
}

.text-button {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-panel {
  width: min(420px, 100%);
  margin: 60px auto 0;
  padding: 30px;
  box-shadow: var(--shadow);
}

.auth-panel h2 {
  margin-bottom: 24px;
}

.admin-grid {
  display: grid;
  gap: 18px;
}

.admin-panel {
  padding: 25px;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 700;
}

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

.switch-track {
  position: relative;
  width: 43px;
  height: 24px;
  border-radius: 999px;
  background: #b7b5ae;
  transition: background 150ms ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 150ms ease;
}

.switch-control input:checked + .switch-track {
  background: var(--green);
}

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

.switch-control input:focus-visible + .switch-track {
  outline: 3px solid rgba(22, 76, 58, 0.25);
  outline-offset: 3px;
}

.settings-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 24px 0 0;
}

.settings-facts div {
  padding: 14px 18px;
  border-left: 1px solid var(--line);
}

.settings-facts div:first-child {
  padding-left: 0;
  border-left: 0;
}

.settings-facts dt {
  color: var(--muted);
  font-size: 12px;
}

.settings-facts dd {
  margin: 5px 0 0;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 700;
}

.admin-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-group-fields {
  display: grid;
  gap: 17px;
  margin-top: 20px;
}

.manual-run {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: end;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.manual-run .primary-button {
  white-space: nowrap;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-block: 24px 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1120px) {
  .monitor-layout {
    display: grid;
  }

  .visitor-card {
    position: static;
    width: 100%;
    max-width: none;
  }

  .visitor-card .form-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visitor-card-heading,
  .visitor-results,
  .visitor-card .form-message,
  .visitor-card .primary-button,
  .visitor-card .check-field,
  .visitor-card .field-help {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .header-inner,
  .page-shell,
  .admin-shell,
  .site-footer {
    width: min(100% - 28px, 1440px);
  }

  .header-inner {
    min-height: 64px;
  }

  .brand {
    font-size: 16px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .main-nav {
    gap: 0;
  }

  .nav-link {
    padding: 8px;
    font-size: 13px;
  }

  .page-shell,
  .admin-shell {
    padding-block: 34px 52px;
  }

  .page-heading,
  .section-heading,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-summary {
    white-space: normal;
  }

  .group-grid,
  .admin-groups {
    grid-template-columns: 1fr;
  }

  .visitor-card {
    min-width: 0;
    padding: 22px;
  }

  .visitor-card .form-stack,
  .field-row {
    grid-template-columns: 1fr;
  }

  .community-item {
    grid-template-columns: 90px 1fr;
    gap: 7px 14px;
  }

  .community-item .status-badge {
    justify-self: start;
  }

  .settings-actions,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 460px) {
  .brand span:last-child {
    display: none;
  }

  h1 {
    font-size: 37px;
  }

  .group-card {
    padding: 19px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat dd {
    font-size: 19px;
  }

  .manual-run {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
