:root {
  --bg: #0b1020;
  --panel: rgba(16, 24, 48, 0.82);
  --line: rgba(255, 255, 255, 0.08);
  --text: #ecf3ff;
  --muted: #95a4c6;
  --primary: linear-gradient(135deg, #5b8cff, #7b5cff);
  --ok: #21c77a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #18284f, #0b1020 55%);
}
.page { max-width: 1320px; margin: 0 auto; padding: 32px 20px 48px; }
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.hero { margin-bottom: 24px; }
.hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.header-actions form { margin: 0; }
.eyebrow { color: #8cb3ff; text-transform: uppercase; letter-spacing: .18em; font-size: 12px; }
h1 { margin: 8px 0 10px; font-size: 40px; }
.sub { margin: 0; color: var(--muted); max-width: 760px; line-height: 1.7; }
.grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; align-items: start; }
.admin-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 20px; align-items: start; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.22);
}
.auth-card { width: min(100%, 520px); }
h2, h3 { margin-top: 0; }
label, .checkbox-wrap { display: block; }
label span, .checkbox-wrap span { display: block; margin-bottom: 8px; color: #c7d5f7; font-size: 14px; }
input, select, textarea {
  width: 100%; border: 1px solid rgba(255,255,255,.1); background: rgba(6,11,27,.66);
  color: var(--text); border-radius: 14px; padding: 12px 14px; outline: none;
}
textarea { resize: vertical; }
.row { display: grid; gap: 14px; margin-bottom: 14px; }
.row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel, .upload-box {
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 14px;
}
.checkbox-wrap { display: flex; flex-direction: column; justify-content: flex-end; }
.checkbox-wrap input { width: 22px; height: 22px; }
.primary, .download {
  display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px;
  padding: 14px 20px; color: #fff; background: var(--primary); cursor: pointer; text-decoration: none; font-weight: 700;
}
.ghost {
  display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 16px; color: var(--text); background: rgba(255,255,255,.04); cursor: pointer; text-decoration: none; font-weight: 600;
}
.danger {
  display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 102, 128, 0.42); border-radius: 8px;
  padding: 12px 16px; color: #ffd3dc; background: rgba(255, 102, 128, 0.12); cursor: pointer; text-decoration: none; font-weight: 700;
}
.danger:disabled, .ghost:disabled, .primary:disabled { opacity: .5; cursor: not-allowed; }
.hint, .empty { color: var(--muted); line-height: 1.7; }
.error-box {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(91, 140, 255, 0.35);
  background: rgba(91, 140, 255, 0.12);
  color: #d6e8ff;
  border-radius: 14px;
}
.success-box {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(33, 199, 122, 0.35);
  background: rgba(33, 199, 122, 0.12);
  color: #bcf7d6;
  border-radius: 14px;
}
.hidden { display: none !important; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats div { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.stats span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.stats strong { font-size: 18px; }
.progress { height: 12px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
#progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #45d483, #5b8cff); transition: width .25s ease; }
.message { color: #d6e2ff; }
.preview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.preview-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.logs {
  white-space: pre-wrap; background: rgba(7, 11, 25, 0.85); color: #b8c7ea; border-radius: 16px; padding: 14px; min-height: 260px;
  border: 1px solid var(--line); overflow: auto;
}
.history-block { margin-top: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h3 { margin: 0; }
.history-list { display: grid; gap: 12px; }
.history-item {
  width: 100%; text-align: left; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text);
  border-radius: 16px; padding: 14px; cursor: pointer;
}
.history-item.active { border-color: rgba(91, 140, 255, 0.8); background: rgba(91, 140, 255, 0.12); }
.history-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.history-meta, .history-stats { color: var(--muted); font-size: 13px; line-height: 1.6; }
.history-status { padding: 4px 10px; border-radius: 999px; font-size: 12px; }
.history-success { background: rgba(33, 199, 122, 0.15); color: #8df0bc; }
.history-failed { background: rgba(91, 140, 255, 0.15); color: #bad0ff; }
.history-running, .history-queued { background: rgba(91, 140, 255, 0.15); color: #bad0ff; }
.user-list { display: grid; gap: 14px; }
.user-item { border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 8px; padding: 16px; }
.user-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.user-form { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 14px; }
.account-actions { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.account-actions form { margin: 0; }
.account-actions label { margin-bottom: 10px; }
@media (max-width: 1080px) {
  .grid, .admin-grid, .row.two, .row.three, .stats, .preview-grid, .account-actions { grid-template-columns: 1fr; }
  .hero-row { flex-direction: column; }
  .header-actions { justify-content: flex-start; }
  h1 { font-size: 32px; }
}
