:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-elevated: rgba(10, 18, 33, 0.86);
  --bg-soft: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(154, 182, 255, 0.16);
  --panel-shadow: 0 20px 60px rgba(2, 6, 23, 0.42);
  --text: #e7edf9;
  --text-muted: #95a6c9;
  --primary: #7c9bff;
  --primary-strong: #8f7cff;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #fb7185;
  --info: #60a5fa;
  --focus-ring: #f8e16c;
  --focus-ring-shadow: rgba(248, 225, 108, 0.28);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3ff;
  --bg-elevated: rgba(255, 255, 255, 0.88);
  --bg-soft: rgba(15, 23, 42, 0.04);
  --panel-border: rgba(79, 108, 177, 0.16);
  --panel-shadow: 0 20px 50px rgba(106, 131, 177, 0.18);
  --text: #10203a;
  --text-muted: #54657f;
  --primary: #496dff;
  --primary-strong: #715dff;
  --success: #0f9f58;
  --warning: #c58110;
  --danger: #dc3f63;
  --info: #2563eb;
  --focus-ring: #7c4d00;
  --focus-ring-shadow: rgba(124, 77, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 155, 255, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(143, 124, 255, 0.14), transparent 35%),
    linear-gradient(180deg, rgba(7, 17, 31, 0.96), rgba(4, 10, 20, 1));
  color: var(--text);
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at top left, rgba(73, 109, 255, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(113, 93, 255, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(238, 243, 255, 1), rgba(228, 237, 255, 1));
}

body {
  padding: 20px;
}

button,
input,
textarea,
select {
  font: inherit;
}

.page-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.embed-shell {
  padding: 0;
}

.panel-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

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

.admin-layout {
  align-items: start;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(18px);
  padding: 22px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(124, 155, 255, 0.2), rgba(143, 124, 255, 0.08)),
    var(--bg-elevated);
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -55% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 155, 255, 0.2), transparent 70%);
  pointer-events: none;
}

.compact-hero {
  margin-bottom: 0;
}

.eyebrow,
.panel-kicker {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.12;
}

h2 {
  margin-top: 6px;
  font-size: 20px;
  line-height: 1.3;
}

h3 {
  font-size: 18px;
  line-height: 1.3;
}

.hero-copy,
.muted {
  color: var(--text-muted);
}

.hero-copy {
  margin-top: 12px;
  max-width: 720px;
  line-height: 1.7;
}

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

.wrap-actions {
  flex-wrap: wrap;
}

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

.field {
  display: grid;
  gap: 8px;
}

.inline-field {
  align-items: center;
  grid-auto-flow: column;
}

.compact-field {
  gap: 10px;
}

.field-label {
  font-size: 13px;
  color: var(--text-muted);
}

.field-help {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.field-error {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(251, 113, 133, 0.28);
  background: rgba(251, 113, 133, 0.12);
  color: #ffd8df;
  line-height: 1.5;
}

:root[data-theme="light"] .field-error {
  color: #7d1832;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(154, 182, 255, 0.18);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(124, 155, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(124, 155, 255, 0.14);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: rgba(251, 113, 133, 0.7);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.14);
}

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

.toolbar,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover:enabled {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.btn-primary {
  color: #f7fbff;
  background: linear-gradient(135deg, #345cff, #5e4de8);
  box-shadow: 0 12px 30px rgba(63, 82, 221, 0.3);
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
}

.btn-success {
  color: #ffffff;
  background: linear-gradient(135deg, #065f46, #047857);
  box-shadow: 0 10px 24px rgba(4, 120, 87, 0.26);
}

.btn-danger {
  color: #ffffff;
  background: linear-gradient(135deg, #991b1b, #b91c1c);
  box-shadow: 0 10px 24px rgba(185, 28, 28, 0.24);
}

a,
button,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--focus-ring-shadow);
}

.notice,
.result-item,
.empty-row,
.clipboard-fallback {
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.notice,
.result-item {
  padding: 12px 14px;
  line-height: 1.6;
}

.notice-info,
.result-info {
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.2);
}

.notice-success,
.result-success {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.22);
}

.notice-warning,
.result-warning {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.24);
}

.notice-error,
.result-error {
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.22);
}

.result-block {
  display: grid;
  gap: 10px;
}

.result-item a {
  color: inherit;
  word-break: break-all;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(154, 182, 255, 0.12);
}

.submissions-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

.submissions-table th,
.submissions-table td {
  text-align: left;
  vertical-align: top;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(154, 182, 255, 0.08);
}

.submissions-table th {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

.submissions-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-pending {
  color: #ffe08a;
}

.status-imported {
  color: #7ef0b2;
}

.status-rejected {
  color: #ff9eb0;
}

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

.clipboard-fallback {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(154, 182, 255, 0.16);
}

.clipboard-fallback-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  body {
    padding: 12px;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  .toolbar,
  .panel-header,
  .inline-actions,
  .clipboard-fallback-header {
    align-items: stretch;
  }

  .toolbar > *,
  .panel-header > .btn,
  .inline-actions > .btn,
  .clipboard-fallback-header > .btn {
    width: 100%;
  }

  .inline-field {
    grid-auto-flow: row;
  }
}
