:root {
  --bg: #05070b;
  --bg-2: #0a1018;
  --panel: rgba(8, 16, 26, 0.96);
  --panel-2: rgba(6, 12, 19, 0.94);
  --panel-3: rgba(10, 22, 36, 0.88);
  --line: rgba(98, 255, 228, 0.18);
  --line-strong: rgba(98, 255, 228, 0.44);
  --accent: #62ffe4;
  --accent-soft: #b8fff5;
  --accent-2: #14a9ff;
  --warn: #ffb54a;
  --danger: #ff5d87;
  --text: #e8fbff;
  --muted: #7ba5b7;
  --text-dim: #5a7480;
  --shadow: 0 0 0 1px rgba(98, 255, 228, 0.05), 0 18px 40px rgba(0, 0, 0, 0.42);
  --clip-lg: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  --clip-md: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Bahnschrift", "Microsoft JhengHei UI", "Noto Sans TC", sans-serif;
  background:
    linear-gradient(rgba(98, 255, 228, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98, 255, 228, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 15% 12%, rgba(20, 169, 255, 0.14), transparent 24%),
    radial-gradient(circle at 82% 20%, rgba(98, 255, 228, 0.12), transparent 18%),
    linear-gradient(180deg, #04070b 0%, #08111a 52%, #05080d 100%);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 4px
    );
  opacity: 0.2;
}

body::after {
  background:
    linear-gradient(90deg, transparent 0, rgba(98, 255, 228, 0.04) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: sweep 12s linear infinite;
  opacity: 0.45;
}

.background-orb {
  position: fixed;
  width: 40vw;
  height: 1px;
  pointer-events: none;
  z-index: 0;
  filter: blur(7px);
  opacity: 0.75;
}

.orb-a {
  top: 10vh;
  left: -6vw;
  box-shadow: 0 0 160px 22px rgba(20, 169, 255, 0.5);
  transform: rotate(-18deg);
}

.orb-b {
  right: -10vw;
  bottom: 18vh;
  box-shadow: 0 0 180px 24px rgba(98, 255, 228, 0.45);
  transform: rotate(16deg);
}

.page-shell {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
  position: relative;
  z-index: 1;
}

.hero {
  margin-bottom: 22px;
  padding: 20px 22px 24px;
  background:
    linear-gradient(180deg, rgba(98, 255, 228, 0.06), transparent 65%),
    linear-gradient(135deg, rgba(8, 16, 26, 0.98), rgba(6, 12, 19, 0.96));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  clip-path: var(--clip-lg);
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  top: 15px;
  right: 18px;
  width: 88px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent));
  box-shadow: 0 0 12px rgba(98, 255, 228, 0.65);
}

.eyebrow,
.panel-kicker,
.stat-label,
.footer-note,
thead th,
.setup-form span,
.setup-meta,
.status-item p,
.current-entry span,
.current-entry small {
  font-family: "Consolas", "Cascadia Mono", "Courier New", monospace;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

h1,
h2 {
  margin: 0;
  font-family: "Consolas", "Cascadia Mono", "Courier New", monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  line-height: 0.92;
  text-shadow: 0 0 24px rgba(98, 255, 228, 0.12);
}

h2 {
  font-size: 1.26rem;
}

.hero-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.75;
  margin-top: 14px;
}

.stats-grid,
.panel-grid {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.panel-grid {
  grid-template-columns: 1.08fr 1.92fr;
}

.panel,
.stat-card,
.flash {
  position: relative;
  background:
    linear-gradient(180deg, rgba(98, 255, 228, 0.045), transparent 36%),
    linear-gradient(135deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  clip-path: var(--clip-lg);
}

.panel::before,
.stat-card::before,
.flash::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 42px;
  height: 42px;
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(98, 255, 228, 0.22) 48% 52%, transparent 52%);
  opacity: 0.9;
}

.stat-card {
  min-height: 124px;
  padding: 20px 20px 18px;
}

.stat-card.accent {
  border-color: rgba(98, 255, 228, 0.34);
  background:
    linear-gradient(180deg, rgba(98, 255, 228, 0.12), rgba(20, 169, 255, 0.05)),
    linear-gradient(135deg, rgba(8, 20, 31, 0.98), rgba(5, 11, 18, 0.98));
}

.stat-label {
  color: var(--muted);
  display: block;
  margin-bottom: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.stat-value {
  display: block;
  color: var(--accent-soft);
  font-family: "Consolas", "Cascadia Mono", "Courier New", monospace;
  font-size: clamp(1.75rem, 4vw, 2.7rem);
  line-height: 1;
  text-shadow: 0 0 16px rgba(98, 255, 228, 0.18);
}

.stat-value.compact {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}

.panel {
  padding: 22px;
}

.panel-header {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel-kicker {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
}

.current-entry {
  min-height: 270px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(20, 169, 255, 0.08), rgba(98, 255, 228, 0.02)),
    linear-gradient(135deg, rgba(9, 19, 31, 0.98), rgba(5, 12, 20, 0.98));
  border: 1px solid rgba(98, 255, 228, 0.28);
  clip-path: var(--clip-md);
  position: relative;
  overflow: hidden;
}

.current-entry::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(98, 255, 228, 0.08);
  clip-path: var(--clip-md);
}

.current-entry::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  top: 34%;
  height: 1px;
  background: rgba(98, 255, 228, 0.7);
  box-shadow: 0 0 14px rgba(98, 255, 228, 0.58);
  animation: scanline 3.8s linear infinite;
}

.current-entry strong {
  position: relative;
  z-index: 1;
  font-family: "Consolas", "Cascadia Mono", "Courier New", monospace;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.92;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.current-entry span,
.current-entry small {
  position: relative;
  z-index: 1;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.current-entry.is-empty {
  justify-content: center;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(98, 255, 228, 0.1);
  clip-path: var(--clip-md);
  background: linear-gradient(180deg, rgba(7, 13, 20, 0.95), rgba(5, 10, 16, 0.98));
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(98, 255, 228, 0.08);
}

thead th {
  color: var(--text-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(98, 255, 228, 0.04);
}

tbody tr {
  transition: background-color 120ms ease, color 120ms ease;
}

tbody tr:hover {
  background: rgba(20, 169, 255, 0.07);
}

tbody td:first-child {
  width: 96px;
  font-family: "Consolas", "Cascadia Mono", "Courier New", monospace;
  color: var(--accent);
}

tbody tr.is-current {
  background:
    linear-gradient(90deg, rgba(98, 255, 228, 0.13), rgba(20, 169, 255, 0.06));
}

tbody tr.is-current td {
  color: var(--accent-soft);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 28px 14px;
}

.footer-note {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-shell {
  width: min(980px, calc(100vw - 32px));
}

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

.status-stack,
.setup-form,
.setup-meta {
  display: grid;
  gap: 14px;
}

.status-item {
  padding: 16px 18px;
  background:
    linear-gradient(180deg, rgba(98, 255, 228, 0.04), transparent 60%),
    linear-gradient(135deg, var(--panel-3), rgba(6, 12, 19, 0.96));
  border: 1px solid rgba(98, 255, 228, 0.13);
  clip-path: var(--clip-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.status-item strong {
  font-family: "Consolas", "Cascadia Mono", "Courier New", monospace;
  color: var(--accent-soft);
  text-transform: uppercase;
}

.status-item p {
  margin: 8px 0 0;
  color: var(--muted);
}

.setup-form label {
  display: grid;
  gap: 8px;
}

.setup-form span {
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(98, 255, 228, 0.18);
  background:
    linear-gradient(180deg, rgba(20, 32, 42, 0.8), rgba(7, 13, 20, 0.98));
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
  clip-path: var(--clip-md);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

input:focus,
textarea:focus {
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(98, 255, 228, 0.14), 0 0 0 1px rgba(98, 255, 228, 0.14);
}

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

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(98, 255, 228, 0.28);
  background:
    linear-gradient(180deg, rgba(98, 255, 228, 0.16), rgba(20, 169, 255, 0.1)),
    linear-gradient(135deg, rgba(7, 21, 31, 0.95), rgba(6, 13, 20, 0.98));
  color: var(--accent-soft);
  font-family: "Consolas", "Cascadia Mono", "Courier New", monospace;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  clip-path: var(--clip-md);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 0 18px rgba(98, 255, 228, 0.12);
}

.button.secondary {
  border-color: rgba(20, 169, 255, 0.34);
  color: #b6e8ff;
  background:
    linear-gradient(180deg, rgba(20, 169, 255, 0.14), rgba(98, 255, 228, 0.04)),
    linear-gradient(135deg, rgba(7, 18, 31, 0.96), rgba(6, 12, 19, 0.98));
}

.button.wide {
  width: 100%;
}

.flash {
  padding: 14px 16px;
  margin-bottom: 16px;
  color: var(--text);
}

.flash.success {
  border-color: rgba(98, 255, 228, 0.28);
}

.flash.error {
  border-color: rgba(255, 93, 135, 0.4);
  color: #ffd3df;
}

.setup-meta {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

@keyframes scanline {
  0% {
    transform: translateY(-80px);
    opacity: 0;
  }

  18% {
    opacity: 0.95;
  }

  100% {
    transform: translateY(170px);
    opacity: 0;
  }
}

@keyframes sweep {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 920px) {
  .stats-grid,
  .panel-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .footer-note,
  .status-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-shell {
    width: min(1120px, calc(100vw - 20px));
    padding-top: 24px;
  }

  .hero,
  .panel,
  .stat-card {
    clip-path: none;
  }

  .table-wrap,
  .current-entry,
  .status-item,
  input,
  textarea,
  .button {
    clip-path: none;
  }
}
