:root {
  --bg: #f5fbff;
  --panel: #ffffff;
  --panel-soft: #effdff;
  --ink: #102033;
  --muted: #60738d;
  --line: #d8eaf3;
  --accent: #17d4bb;
  --accent-dark: #0a9fbd;
  --accent-soft: #d9fff8;
  --danger: #d14b4b;
  --warn-bg: #fff8e6;
  --warn-line: #f3d27b;
  --shadow: 0 18px 44px rgba(50, 107, 135, 0.12);
  --glow: 0 14px 28px rgba(23, 212, 187, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #f7fcff 0%, #e8f9ff 44%, #ecfff8 100%);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(25, 179, 255, 0.1), rgba(23, 212, 187, 0.12)),
    radial-gradient(circle at 18% 8%, rgba(84, 214, 255, 0.16), transparent 26%);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1510px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 28px 0 38px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.12;
}

h2 {
  font-size: 18px;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(23, 212, 187, 0.28);
  border-radius: 8px;
  color: var(--accent-dark);
  padding: 10px 14px;
  font-weight: 700;
  background: rgba(229, 255, 251, 0.88);
  box-shadow: 0 8px 20px rgba(23, 212, 187, 0.12);
}

.guardrail {
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  background: var(--warn-bg);
  padding: 13px 16px;
  margin-bottom: 18px;
  line-height: 1.6;
}

.login-panel {
  margin-bottom: 16px;
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: end;
}

.login-grid label {
  margin-bottom: 0;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.results,
.audit-panel,
.login-panel {
  background: rgba(255, 255, 255, 0.92);
}

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

.panel-heading span {
  color: var(--muted);
  font-size: 13px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.numeric-email {
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1.4fr;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 14px;
  outline: none;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(23, 212, 187, 0.16);
}

.template-email {
  display: none;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hint.compact {
  margin: -2px 0 12px;
}

code {
  background: var(--accent-soft);
  border-radius: 6px;
  color: var(--accent-dark);
  padding: 2px 5px;
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

button {
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(135deg, #12d7bd, #28c8f0);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

button:hover:not(:disabled) {
  background: linear-gradient(135deg, #0fc6ad, #14aee0);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(23, 212, 187, 0.28);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button.danger {
  border-color: var(--danger);
  background: #fff1f1;
  color: var(--danger);
  box-shadow: none;
}

.results,
.audit-panel {
  margin-top: 16px;
}

.message {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  background: #ffffff;
}

.message.error {
  border-color: #d9a0a0;
  color: var(--danger);
  background: #fff0f0;
}

.message.success {
  border-color: rgba(23, 212, 187, 0.28);
  color: var(--accent-dark);
  background: #eafff9;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #f6fffc;
}

pre {
  overflow-x: auto;
  margin: 0;
  border-radius: 8px;
  padding: 14px;
  background: #0f172a;
  color: #d7fff8;
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 820px) {
  .layout,
  .field-row,
  .numeric-email,
  .login-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    grid-template-columns: 1fr;
  }
}
