:root {
  --bg: #f4f7ff;
  --panel: rgba(255, 255, 255, 0.86);
  --line: rgba(118, 140, 196, 0.16);
  --text: #111827;
  --muted: #6b7280;
  --accent: #356dff;
  --accent-2: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --shadow: 0 24px 60px rgba(44, 83, 189, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(118, 140, 255, 0.22), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 42%, #eef2ff 100%);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 20px 40px;
}

.topbar,
.footer,
.brand,
.topbar-actions,
.task-head,
.dialog-actions {
  display: flex;
  align-items: center;
}

.topbar,
.footer {
  justify-content: space-between;
}

.topbar {
  padding: 18px 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.brand {
  gap: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(53, 109, 255, 0.15), rgba(139, 92, 246, 0.2));
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.brand-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, #171717 0%, #3548ff 48%, #8b5cf6 100%);
  -webkit-background-clip: text;
  color: transparent;
}

.brand-subtitle,
.hero-text,
.hint,
.task-meta,
.empty-state,
.footer,
.task-error {
  color: var(--muted);
}

.hero {
  padding: 54px 10px 0;
}

.hero-copy {
  text-align: center;
  margin: 0 auto 38px;
  max-width: 920px;
}

.hero h1 {
  font-size: clamp(40px, 6.4vw, 70px);
  margin: 8px 0 18px;
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.hero h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  color: transparent;
}

.hero h1 em {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: clamp(24px, 3vw, 34px);
  color: rgba(96, 92, 244, 0.9);
  letter-spacing: 0;
}

.hero-text {
  font-size: 18px;
  line-height: 1.7;
  max-width: 760px;
  margin: 0 auto;
}

.hero-actions {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.credit-warning {
  margin: 22px auto 0;
  max-width: 760px;
  padding: 20px 22px;
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(135deg, rgba(255, 110, 64, 0.14), rgba(198, 61, 255, 0.16));
  border: 1px solid rgba(255, 111, 97, 0.26);
  box-shadow: 0 24px 46px rgba(255, 106, 61, 0.16);
}

.credit-warning-copy {
  text-align: left;
}

.credit-warning-copy strong {
  display: block;
  font-size: 22px;
  color: #b42318;
  margin-bottom: 6px;
}

.credit-warning-copy p {
  margin: 0;
  color: #7a2230;
  line-height: 1.65;
  font-size: 15px;
}

.credit-warning-button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 15px 24px;
  background: linear-gradient(90deg, #ff7a18 0%, #ff4f6d 52%, #9f47ff 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 18px 34px rgba(255, 96, 86, 0.24);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.credit-warning-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 40px rgba(255, 96, 86, 0.3);
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hero-badges span,
.status,
.toast,
.ghost-button,
.primary-button {
  border-radius: 999px;
}

.hero-badges span {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.hero-badges .badge-danger {
  color: #b42318;
  background: rgba(255, 237, 232, 0.9);
  border-color: rgba(255, 112, 67, 0.3);
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(255, 112, 67, 0.12);
}

.mobile-summary {
  display: none;
}

.panel-grid,
.feature-strip,
.admin-grid,
.stats-grid,
.admin-panels {
  display: grid;
  gap: 20px;
}

.panel-grid {
  grid-template-columns: 1.4fr 0.9fr;
}

.step-card,
.side-card,
.admin-login-card,
.admin-panel,
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.step-card,
.side-card,
.admin-panel {
  padding: 24px;
}

.step-number,
.admin-panel h2,
.side-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}

.step-row,
.side-card-head,
.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.step-description,
.side-card-note {
  margin: 2px 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.side-card-head h3,
.panel-title-row h2 {
  margin: 0;
}

.upload-box {
  display: block;
  border: 1px dashed rgba(98, 121, 205, 0.3);
  border-radius: 22px;
  padding: 34px 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(240,244,255,0.72));
  text-align: center;
  margin-bottom: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.upload-box input {
  display: block;
  width: 100%;
  margin-bottom: 14px;
  font-size: 17px;
  font-weight: 600;
  color: #374151;
}

.upload-box input::file-selector-button {
  margin-right: 14px;
  min-width: 168px;
  padding: 16px 26px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 36px rgba(78, 104, 255, 0.28);
}

.upload-box input::-webkit-file-upload-button {
  margin-right: 14px;
  min-width: 168px;
  padding: 16px 26px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 36px rgba(78, 104, 255, 0.28);
}

.upload-box span {
  display: block;
  font-size: 18px;
  font-weight: 600;
}

.upload-box small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.primary-button,
.ghost-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-button {
  width: 100%;
  padding: 16px 18px;
  font-size: 17px;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 18px 36px rgba(78, 104, 255, 0.24);
}

.redeem-cta-button {
  border: 0;
  border-radius: 999px;
  padding: 18px 34px;
  min-width: 280px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: linear-gradient(90deg, #ff8a1e 0%, #ff5f43 50%, #b455ff 100%);
  box-shadow: 0 22px 44px rgba(255, 97, 85, 0.28);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.redeem-cta-button:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 28px 54px rgba(255, 97, 85, 0.34);
}

.ghost-button {
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.task-list {
  display: grid;
  gap: 14px;
}

.task-item {
  padding: 16px;
  border-radius: 20px;
  background: rgba(248, 250, 255, 0.92);
  border: 1px solid rgba(124, 146, 216, 0.16);
}

.task-head {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.status-queued,
.status-processing {
  background: rgba(53, 109, 255, 0.12);
  color: var(--accent);
}

.status-completed {
  background: rgba(16, 185, 129, 0.14);
  color: var(--success);
}

.status-failed,
.toast-error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.task-link {
  color: var(--accent);
  font-weight: 700;
}

.feature-strip {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 22px;
}

.feature-strip article,
.stat-card {
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.footer {
  padding: 30px 8px 10px;
}

.redeem-modal {
  width: min(480px, calc(100% - 24px));
  border: 0;
  padding: 0;
  border-radius: 24px;
}

.redeem-modal::backdrop {
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(6px);
}

.redeem-form,
.admin-login-card,
.stack-form {
  display: grid;
  gap: 16px;
}

.redeem-form {
  padding: 26px;
}

.redeem-form input,
.stack-form input,
.admin-login-card input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(118, 140, 196, 0.24);
  font-size: 16px;
}

.dialog-actions {
  justify-content: flex-end;
  gap: 10px;
}

.toast-stack {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(820px, calc(100% - 24px));
  z-index: 30;
  display: grid;
  gap: 10px;
}

.toast {
  padding: 18px 24px;
  border-radius: 22px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  box-shadow: var(--shadow);
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.toast-success {
  background: rgba(16, 185, 129, 0.92);
}

.toast-error {
  background: linear-gradient(90deg, #ff6a3d 0%, #ff3f6b 55%, #c63dff 100%);
  color: #fff;
  box-shadow: 0 26px 54px rgba(255, 82, 82, 0.26);
  border: 0;
}

.admin-login-shell {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
}

.admin-login-card {
  width: min(460px, 100%);
  padding: 34px;
}

.admin-grid {
  margin-top: 24px;
}

.stats-grid {
  grid-template-columns: repeat(4, 1fr);
}

.stat-card strong {
  display: block;
  font-size: 38px;
}

.admin-panels {
  grid-template-columns: 1fr 1.3fr;
}

.admin-panel-wide {
  grid-column: 1 / -1;
}

.table-action {
  width: auto;
  min-width: 88px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(118, 140, 196, 0.14);
  font-size: 14px;
}

@media (max-width: 960px) {
  .panel-grid,
  .feature-strip,
  .stats-grid,
  .admin-panels {
    grid-template-columns: 1fr;
  }

  .topbar,
  .footer {
    gap: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions,
  .topbar-button {
    width: 100%;
  }

  .topbar-button {
    text-align: center;
  }

  .brand-title {
    font-size: 26px;
  }

  .hero {
    padding-top: 32px;
  }

  .hero-copy {
    text-align: left;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .credit-warning {
    margin-left: 0;
    margin-right: 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .credit-warning-button {
    width: 100%;
  }

  .hero-badges {
    justify-content: flex-start;
  }

  .mobile-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
  }

  .mobile-summary article {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .mobile-summary strong {
    display: block;
    font-size: 28px;
    margin-bottom: 4px;
  }

  .step-card,
  .side-card,
  .admin-panel {
    padding: 20px;
    border-radius: 24px;
  }

  .step-row,
  .side-card-head,
  .panel-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .step-number,
  .admin-panel h2,
  .side-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
  }

  .upload-box {
    padding: 24px 16px;
  }

  .upload-box input::file-selector-button,
  .upload-box input::-webkit-file-upload-button {
    width: 100%;
    margin-right: 0;
    margin-bottom: 10px;
    min-width: 0;
    padding: 16px 18px;
    font-size: 17px;
  }

  .primary-button,
  .ghost-button,
  .redeem-cta-button {
    min-height: 48px;
  }

  .footer {
    padding-top: 20px;
  }

  .admin-login-card {
    padding: 24px;
  }
}

@media (max-width: 680px) {
  .site-shell {
    padding: 12px 12px 28px;
  }

  .topbar {
    padding: 16px;
    border-radius: 20px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .hero h1 {
    font-size: clamp(30px, 10vw, 44px);
    line-height: 1.12;
  }

  .hero-text {
    font-size: 16px;
    margin: 0;
  }

  .hero h1 em {
    margin-top: 6px;
    font-size: 22px;
  }

  .hero-actions {
    margin-top: 20px;
  }

  .credit-warning {
    padding: 18px;
    border-radius: 22px;
  }

  .credit-warning-copy strong {
    font-size: 19px;
  }

  .credit-warning-copy p {
    font-size: 14px;
  }

  .redeem-cta-button {
    width: 100%;
    min-width: 0;
    padding: 16px 18px;
    font-size: 19px;
  }

  .hero-badges span {
    width: 100%;
  }

  .mobile-summary {
    grid-template-columns: 1fr;
  }

  .task-item {
    padding: 14px;
  }

  .redeem-modal {
    width: calc(100% - 16px);
    margin: auto 8px;
    border-radius: 20px;
  }

  .redeem-form {
    padding: 20px;
  }

  .dialog-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .dialog-button {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 18px;
  }

  .stat-card strong {
    font-size: 30px;
  }

  .mobile-table thead {
    display: none;
  }

  .mobile-table,
  .mobile-table tbody,
  .mobile-table tr,
  .mobile-table td {
    display: block;
    width: 100%;
  }

  .mobile-table tr {
    padding: 14px 0;
    border-bottom: 1px solid rgba(118, 140, 196, 0.14);
  }

  .mobile-table td {
    border-bottom: 0;
    padding: 8px 0;
  }

  .mobile-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }
}

@media (max-width: 420px) {
  .brand-title {
    font-size: 22px;
  }

  .hero-badges span,
  .upload-box span,
  .upload-box small,
  th,
  td {
    font-size: 13px;
  }
}
