:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --card: rgba(255, 255, 255, 0.94);
  --text: #122033;
  --muted: #66758b;
  --line: #dbe4ef;
  --accent: #ff6b2c;
  --accent-dark: #de5316;
  --soft: #eef4fb;
  --danger: #b63d2f;
  --success: #18794e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(255, 107, 44, 0.18), transparent 28%),
    linear-gradient(180deg, #111622 0, #182133 280px, var(--bg) 281px, var(--bg) 100%);
  color: var(--text);
}

code {
  font-family: "Cascadia Mono", Consolas, monospace;
}

.hidden {
  display: none !important;
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 28px 32px;
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(135deg, #161c2a, #29364a);
  box-shadow: 0 18px 40px rgba(15, 24, 40, 0.22);
}

.eyebrow {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.7;
}

.hero h1 {
  margin: 10px 0 8px;
  font-size: 36px;
}

.hero-copy,
.hero-meta {
  margin: 0;
  max-width: 720px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
}

.layout {
  margin-top: 24px;
}

.card {
  padding: 24px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 14px 32px rgba(18, 32, 51, 0.08);
}

.auth-card {
  max-width: 460px;
}

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

label span,
.table-header p,
.muted {
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
}

textarea.output-box {
  min-height: 260px;
  resize: vertical;
  background: #111622;
  color: #f7f9fc;
}

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

.checkbox-row input {
  width: 18px;
  height: 18px;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), #ff8b3d);
  color: #fff;
}

.primary-btn:hover {
  background: linear-gradient(135deg, var(--accent-dark), #ff7a24);
}

.secondary-btn {
  background: var(--soft);
  color: var(--text);
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 18px;
}

.stat-card {
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 20px rgba(18, 32, 51, 0.06);
}

.stat-card span {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

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

.table-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.table-wrap {
  overflow: auto;
}

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

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

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

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-unused {
  background: #edf3ff;
  color: #3157a6;
}

.status-active {
  background: #e9f8ee;
  color: var(--success);
}

.status-expired {
  background: #fff1e6;
  color: #b1630f;
}

.status-disabled {
  background: #fdecec;
  color: var(--danger);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-row button {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.action-row .danger {
  background: #fdecec;
  color: var(--danger);
}

.action-row .warning {
  background: #fff3df;
  color: #ab6500;
}

.action-row .success {
  background: #e8f8ed;
  color: var(--success);
}

.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 30px 12px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(17, 22, 34, 0.94);
  color: #fff;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

@media (max-width: 980px) {
  .hero,
  .toolbar,
  .grid-two {
    grid-template-columns: 1fr;
    display: grid;
  }

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