:root {
  --bg0: #070a12;
  --bg1: #0c1224;
  --card: rgba(18, 26, 48, 0.72);
  --stroke: rgba(120, 160, 255, 0.18);
  --text: #e8ecff;
  --muted: #9aa4c7;
  --accent: #5ee1ff;
  --accent2: #a78bfa;
  --danger: #fb7185;
  --ok: #34d399;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 10% -10%, #1a2454 0%, transparent 55%),
    radial-gradient(900px 600px at 90% 0%, #301c4d 0%, transparent 50%), var(--bg0);
}

body {
  position: relative;
  overflow-x: hidden;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.88rem;
}

.bg-grid {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  opacity: 0.35;
}

.glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
}
.glow-a {
  background: var(--accent);
  top: -120px;
  left: -80px;
}
.glow-b {
  background: var(--accent2);
  bottom: -160px;
  right: -100px;
}

#app {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  position: relative;
  z-index: 1;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  padding: 4px;
  box-sizing: border-box;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.15rem;
}
.brand-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-quota-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.user-code-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.user-remaining-block {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1;
}

.user-remaining-prefix,
.user-remaining-suffix {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.user-remaining-num {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: "DM Sans", system-ui, sans-serif;
  letter-spacing: 0.02em;
  line-height: 1;
}

.rem-tier-green {
  color: var(--ok);
}

.rem-tier-yellow {
  color: #facc15;
}

.rem-tier-orange {
  color: #fb923c;
}

.rem-tier-red {
  color: var(--danger);
}

.layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel h1,
.panel h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}
.panel h2 {
  font-size: 1.15rem;
}

.panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.panel-head-row h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.form.row {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
}

.form.row input {
  flex: 1 1 240px;
}

label {
  font-size: 0.85rem;
  color: var(--muted);
}

input {
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(8, 12, 28, 0.65);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus {
  border-color: rgba(94, 225, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(94, 225, 255, 0.12);
}

.btn {
  border-radius: 12px;
  border: 1px solid var(--stroke);
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s;
}
.btn:active {
  transform: translateY(1px);
}
.btn.primary {
  background: linear-gradient(135deg, rgba(94, 225, 255, 0.25), rgba(167, 139, 250, 0.35));
  border-color: rgba(94, 225, 255, 0.35);
}
.btn.primary:hover {
  border-color: rgba(94, 225, 255, 0.55);
}
.btn.ghost:hover {
  border-color: rgba(255, 255, 255, 0.22);
}
.btn.success {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.12);
  color: var(--ok);
}
.btn.success:hover {
  border-color: rgba(52, 211, 153, 0.65);
  background: rgba(52, 211, 153, 0.18);
}
.btn.small {
  padding: 7px 12px;
  font-size: 0.85rem;
  border-radius: 10px;
}
.btn.danger {
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.1);
  color: var(--danger);
}
.btn.danger:hover {
  border-color: rgba(251, 113, 133, 0.65);
  background: rgba(251, 113, 133, 0.16);
}

.err {
  color: var(--danger);
  margin: 0;
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

.progress-wrap {
  margin-top: 16px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  overflow: hidden;
  background: rgba(8, 12, 28, 0.55);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
  font-size: 0.9rem;
  color: var(--muted);
}

.badge-row {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 10px;
  max-width: min(100%, 72%);
  flex-wrap: wrap;
  text-align: right;
}

.clone-pct {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  line-height: 1.35;
  max-width: 100%;
}

.clone-pct:not(.hidden) {
  color: #a5b4fc;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  font-size: 0.78rem;
  color: var(--text);
}

.log {
  margin: 0;
  padding: 12px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #c7d2fe;
  line-height: 1.45;
}

.log-lfs-warn {
  margin: 0;
  padding: 0 12px 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--danger);
  font-weight: 600;
}

.job-meta {
  margin-top: 10px;
  color: var(--muted);
}

.dl-wrap {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.job-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.job-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(8, 12, 28, 0.45);
}
.job-item a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.job-item a:hover {
  text-decoration: underline;
}

.foot {
  margin-top: 28px;
  text-align: center;
  font-size: 0.85rem;
}

.foot-policy {
  margin: 0 0 16px;
  font-size: 0.88rem;
}

.foot-policy p {
  margin: 0 0 6px;
}

.foot-policy p:last-child {
  margin-bottom: 0;
}

.foot-tips {
  text-align: left;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 20px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: rgba(8, 12, 28, 0.42);
  backdrop-filter: blur(8px);
}

.foot-tips-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.foot-tip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(120, 160, 255, 0.12);
  background: rgba(18, 26, 48, 0.55);
}

.foot-tip-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1.2;
  margin-top: 2px;
}

.foot-tip strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.foot-tip p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
}

.foot-tip p strong {
  display: inline;
  margin: 0;
  color: #c7d2fe;
  font-size: inherit;
}

.foot-code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(94, 225, 255, 0.25);
  background: rgba(94, 225, 255, 0.08);
  color: var(--accent);
}

.foot-notice {
  padding-top: 14px;
  border-top: 1px solid var(--stroke);
}

.foot-notice p {
  margin: 0 0 8px;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--muted);
}

.foot-notice p:last-child {
  margin-bottom: 0;
}

.foot-notice strong {
  color: #c7d2fe;
  font-weight: 600;
}

.foot-notice-soft {
  text-align: center;
  font-size: 0.8rem !important;
  color: rgba(154, 164, 199, 0.85) !important;
  padding-top: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-create-hint {
  margin: 0 0 14px;
  font-size: 0.86rem;
  line-height: 1.55;
}

.admin-create-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-create-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.admin-field input {
  width: 100%;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(154, 164, 199, 0.9);
}

.admin-create-submit {
  align-self: flex-start;
}

.admin-custom-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--stroke);
}

.admin-custom-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

.admin-custom-hint {
  margin: 0 0 12px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.admin-code-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  max-height: 420px;
  overflow: auto;
}

.admin-code-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(8, 12, 28, 0.45);
}

.admin-code-value {
  font-size: 0.9rem;
  color: var(--accent);
  word-break: break-all;
}

.admin-code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .form.row {
    flex-direction: column;
  }
  .top {
    flex-direction: column;
    align-items: flex-start;
  }
  .foot-tips {
    padding: 14px 14px 12px;
  }
  .foot-tips-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .admin-create-fields {
    grid-template-columns: 1fr;
  }
}
