:root {
  --bg0: #070a12;
  --bg1: #0b1022;
  --card: rgba(255, 255, 255, 0.06);
  --card2: rgba(255, 255, 255, 0.08);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --muted2: rgba(255, 255, 255, 0.52);
  --good: #26e4a6;
  --warn: #ffcc66;
  --bad: #ff5c7a;
  --accent: #6d5efc;
  --accent2: #28d8ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --radius: 18px;
  --radius2: 14px;
}

body.light-theme {
  --bg0: #f4f7ff;
  --bg1: #ecf1fb;
  --text: #0f1733;
  --muted: rgba(15, 23, 51, 0.72);
  --muted2: rgba(15, 23, 51, 0.56);
  --card: rgba(255, 255, 255, 0.75);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.light-theme {
  background: radial-gradient(1200px 800px at 20% 10%, #d4e5ff 0%, transparent 50%),
    radial-gradient(1000px 700px at 80% 20%, #d7fff0 0%, transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% 10%, #16204a 0%, transparent 50%),
    radial-gradient(1000px 700px at 80% 20%, #1b3f3a 0%, transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x: hidden;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.95em;
  padding: 0.12em 0.4em;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.grid {
  position: absolute;
  inset: -20%;
  background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: rotate(-8deg);
  opacity: 0.25;
  filter: blur(0.2px);
}

.glow {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.45;
}

.glow-1 {
  left: -100px;
  top: -130px;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 60%);
}

.glow-2 {
  right: -160px;
  top: 40px;
  background: radial-gradient(circle at 30% 30%, var(--accent2), transparent 60%);
}

.header {
  max-width: 1080px;
  margin: 28px auto 0;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 600;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 12px 40px rgba(109, 94, 252, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.brand-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-sub {
  color: var(--muted2);
  font-size: 13px;
  margin-top: 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(38, 228, 166, 0.16);
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 18px 44px;
}

.hero {
  padding: 18px 6px 14px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(26px, 3.8vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  font-family: Inter, "Segoe UI", sans-serif;
}

.hero p {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 820px;
  line-height: 1.55;
}

.muted {
  color: var(--muted);
}

.animated-text {
  display: inline-block;
  background: linear-gradient(90deg, #ffffff, #b8dcff, #ffffff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: shine 3.2s linear infinite;
}

body.light-theme .animated-text {
  background: linear-gradient(90deg, #14204d, #2c69d1, #14204d);
  -webkit-background-clip: text;
  background-clip: text;
}

.panel {
  margin-top: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

body.light-theme .panel,
body.light-theme .card,
body.light-theme .drop,
body.light-theme .select,
body.light-theme .textarea,
body.light-theme .preview,
body.light-theme .notice,
body.light-theme .pill {
  border-color: rgba(15, 23, 51, 0.14);
  background: rgba(255, 255, 255, 0.74);
}

.form {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.db-wrap {
  display: flex;
  justify-content: center;
}

.db-field {
  width: min(460px, 100%);
}

.row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}

.row-two {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 820px) {
  .row {
    grid-template-columns: 1fr;
  }
  .pill {
    display: none;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card {
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.card-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.hint {
  color: var(--muted2);
  font-size: 12.5px;
}

.stat {
  color: var(--muted);
  font-size: 13px;
}

.hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drop {
  position: relative;
  border-radius: var(--radius2);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  min-height: 104px;
  transition: 180ms ease;
}

.drop:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.05);
}

.drop.dragover {
  border-color: rgba(40, 216, 255, 0.6);
  background: rgba(40, 216, 255, 0.08);
}

.drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-inner {
  padding: 16px;
}

.drop-title {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.drop-sub {
  margin-top: 6px;
  color: var(--muted2);
  font-size: 13px;
}

.file-meta {
  padding: 10px 16px 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  display: none;
}

.file-meta.show {
  display: block;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.15);
}

.select,
.textarea {
  width: 100%;
  border-radius: var(--radius2);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(12, 16, 31, 0.7);
  color: var(--text);
  outline: none;
  padding: 12px 12px;
  transition: 160ms ease;
}

body.light-theme .select,
body.light-theme .textarea {
  background: rgba(255, 255, 255, 0.88);
}

.select {
  padding: 12px 12px;
}

.textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.45;
}

.select:focus,
.textarea:focus {
  border-color: rgba(109, 94, 252, 0.55);
  box-shadow: 0 0 0 4px rgba(109, 94, 252, 0.18);
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.text-actions {
  margin-top: 2px;
}

.btn {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  transition: 160ms ease;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.btn:active {
  transform: translateY(0px);
}

.btn.primary {
  border-color: rgba(109, 94, 252, 0.55);
  background: linear-gradient(135deg, rgba(109, 94, 252, 0.98), rgba(40, 216, 255, 0.78));
  box-shadow: 0 18px 60px rgba(109, 94, 252, 0.22);
}

.btn.primary:hover {
  box-shadow: 0 22px 70px rgba(109, 94, 252, 0.28);
}

.btn.ghost {
  color: rgba(255, 255, 255, 0.82);
}

.btn.ghost.strong-ghost {
  border-color: rgba(40, 216, 255, 0.46);
  background: rgba(40, 216, 255, 0.16);
  color: rgba(255, 255, 255, 0.96);
}

.btn.ghost.strong-ghost:hover {
  background: rgba(40, 216, 255, 0.24);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.link {
  border: 0;
  background: transparent;
  color: rgba(40, 216, 255, 0.92);
  cursor: pointer;
  font-weight: 600;
  padding: 0;
}

.link:hover {
  text-decoration: underline;
}

.notice {
  display: none;
  margin-top: 2px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.35;
}

.notice.show {
  display: block;
}

.notice.good {
  border-color: rgba(38, 228, 166, 0.4);
  background: rgba(38, 228, 166, 0.1);
}

.notice.bad {
  border-color: rgba(255, 92, 122, 0.45);
  background: rgba(255, 92, 122, 0.12);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.84);
}

.sep {
  color: rgba(255, 255, 255, 0.25);
  margin: 0 8px;
}

.spinner {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: rgba(255, 255, 255, 0);
  opacity: 0;
  animation: spin 0.9s linear infinite;
}

.btn.loading .spinner {
  opacity: 1;
}

.btn.loading .btn-text {
  padding-right: 20px;
}

.preview {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 10px;
  background: rgba(5, 9, 20, 0.55);
}

.preview-title {
  font-size: 12px;
  color: var(--muted2);
  margin-bottom: 8px;
}

.preview-list {
  min-height: 44px;
  max-height: 160px;
  overflow: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.empty-chip {
  color: var(--muted2);
  font-size: 12px;
}

.table-wrap {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(6, 10, 22, 0.52);
  padding: 10px;
  animation: fadeUp 300ms ease;
}

.table-wrap.show {
  display: block;
}

.table-title {
  color: var(--muted2);
  font-size: 13px;
  margin: 2px 2px 8px;
}

.table-scroll {
  overflow: auto;
  max-height: 300px;
}

.table-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
}

.preview-table th,
.preview-table td {
  text-align: left;
  padding: 9px 10px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-table th {
  position: sticky;
  top: 0;
  background: rgba(18, 27, 56, 0.95);
  z-index: 1;
}

body.light-theme .preview-table th {
  background: rgba(230, 239, 255, 0.97);
}

body.light-theme .preview-table th,
body.light-theme .preview-table td {
  border-bottom-color: rgba(15, 23, 51, 0.12);
}

body.light-theme .btn.ghost {
  color: rgba(15, 23, 51, 0.86);
  background: rgba(15, 23, 51, 0.08);
  border-color: rgba(15, 23, 51, 0.18);
}

body.light-theme .btn.ghost.strong-ghost {
  background: rgba(26, 112, 255, 0.16);
  border-color: rgba(26, 112, 255, 0.42);
  color: #103b86;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

