/* ------------------------------ Reset ------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* ------------------------------ Theme ------------------------------ */
:root {
  --bg: #070a15;
  --bg-soft: #0d1225;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #e9edfa;
  --muted: #96a0c0;
  --accent: #6d8dff;
  --accent-2: #35d0ba;
  --accent-grad: linear-gradient(135deg, #6d8dff 0%, #9b6dff 50%, #35d0ba 100%);
  --danger: #ff6b81;
  --ok: #35d0ba;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.85);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 50% -10%, #1c2a68 0%, rgba(7, 10, 21, 0) 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(53, 208, 186, 0.10) 0%, rgba(7, 10, 21, 0) 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.muted-inline {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.85em;
}

.grad {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------ Buttons ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.94rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease,
    opacity 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary {
  background: var(--accent-grad);
  color: #0a0e1c;
  box-shadow: 0 10px 30px -12px rgba(109, 141, 255, 0.9);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 14px 34px -10px rgba(109, 141, 255, 1);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1rem;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

.linklike {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.linklike:hover {
  text-decoration: underline;
}

/* ------------------------------ Top bar ------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(7, 10, 21, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-grad);
  color: #0a0e1c;
  font-size: 1rem;
}

.brand-text b {
  color: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

#nav-credits {
  color: var(--accent-2);
  border-color: rgba(53, 208, 186, 0.35);
  background: rgba(53, 208, 186, 0.08);
}

/* ------------------------------ Layout ------------------------------ */
.main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.view {
  animation: fade-in 0.28s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section {
  padding: 64px 0 16px;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  text-align: center;
}

.section-sub {
  text-align: center;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 36px;
}

/* ------------------------------ Hero ------------------------------ */
.hero {
  text-align: center;
  padding: 72px 0 16px;
  max-width: 820px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(109, 141, 255, 0.35);
  background: rgba(109, 141, 255, 0.10);
  color: #aab8ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
  font-weight: 800;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.14rem);
  color: var(--muted);
  max-width: 660px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 34px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* 👈 新增的免费试用高亮样式 */
.highlight-point {
  color: var(--ok);
  font-weight: 600;
  background: rgba(53, 208, 186, 0.1);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(53, 208, 186, 0.3);
}

/* ------------------------------ Pricing ------------------------------ */
.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.pricing.compact {
  margin-top: 22px;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.plan:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.plan.featured {
  border-color: rgba(109, 141, 255, 0.55);
  box-shadow: 0 24px 60px -26px rgba(109, 141, 255, 0.85);
}

.plan-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-grad);
  color: #0a0e1c;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.plan-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.plan-price {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 6px 0 2px;
}

.plan-price small {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

.plan-credits {
  color: var(--accent-2);
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
}

.plan-features li {
  padding: 6px 0 6px 22px;
  position: relative;
}

.plan-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-2);
  font-weight: 800;
}

/* ------------------------------ Features ------------------------------ */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  padding-top: 56px;
}

.feature {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.feature h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.feature p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

/* ------------------------------ Footer ------------------------------ */
.footer {
  padding: 56px 0 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ------------------------------ Auth ------------------------------ */
.auth-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 140px);
  padding: 40px 0;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
}

.auth-card h2 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.auth-card > .muted {
  font-size: 0.9rem;
  margin-bottom: 22px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field > span {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.field em {
  color: var(--danger);
  font-style: normal;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(4, 7, 16, 0.6);
  color: var(--text);
  font-family: inherit;
  font-size: 0.94rem;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(109, 141, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(109, 141, 255, 0.18);
  background: rgba(4, 7, 16, 0.85);
}

input::placeholder,
textarea::placeholder {
  color: #616c8c;
}

select option {
  background: #10162b;
  color: var(--text);
}

.auth-switch {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

/* 👈 新增注册送积分提示样式 */
.bonus-hint {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(53, 208, 186, 0.1);
  border: 1px dashed rgba(53, 208, 186, 0.5);
  color: var(--ok);
  font-size: 0.9rem;
  text-align: center;
}

.fineprint {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.76rem;
  color: #6b769b;
}

/* ------------------------------ Dashboard ------------------------------ */
.dash-head {
  padding: 44px 0 20px;
}

.dash-head h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin-bottom: 4px;
}

.dash-head .muted {
  font-size: 0.9rem;
  margin: 0;
}

.paywall {
  padding: 32px 26px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--surface);
  text-align: center;
}

.paywall h3 {
  font-size: 1.15rem;
}

.paywall .muted {
  margin-bottom: 6px;
}

.workbench {
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 20px;
}

.span-2 {
  grid-column: span 2;
}

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

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

#err-msg {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 107, 129, 0.10);
  border: 1px solid rgba(255, 107, 129, 0.35);
}

#auth-error {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 107, 129, 0.10);
  border: 1px solid rgba(255, 107, 129, 0.35);
}

/* ------------------------------ Loading ------------------------------ */
.loading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.75s linear infinite;
  flex: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ------------------------------ Results ------------------------------ */
.results {
  margin-top: 26px;
}

.reason {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(53, 208, 186, 0.35);
  background: rgba(53, 208, 186, 0.08);
  color: #a6f0e5;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.reason b {
  color: var(--accent-2);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.result-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.result-card.recommended {
  border-color: rgba(109, 141, 255, 0.7);
  background: linear-gradient(180deg, rgba(109, 141, 255, 0.12), rgba(109, 141, 255, 0.03));
  box-shadow: 0 20px 50px -26px rgba(109, 141, 255, 0.95);
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.result-head h3 {
  font-size: 0.98rem;
  margin: 0;
}

.badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-grad);
  color: #0a0e1c;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.result-body {
  flex: 1;
  margin: 0 0 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(4, 7, 16, 0.62);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d8e0f5;
  max-height: 380px;
  overflow-y: auto;
}

.result-actions {
  display: flex;
  justify-content: flex-end;
}

/* ------------------------------ Legal Pages ------------------------------ */
.legal-wrap {
  max-width: 800px;
  margin: 40px auto;
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.legal-content h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.legal-content p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.legal-content h2 {
  font-size: 1.2rem;
  margin-top: 30px;
  margin-bottom: 12px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.legal-content strong {
  color: var(--text);
}

/* ------------------------------ Toast ------------------------------ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(10px);
  z-index: 100;
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(20, 26, 48, 0.96);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  max-width: min(92vw, 520px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  border-color: rgba(255, 107, 129, 0.6);
  color: #ffc3cc;
}

.toast.ok {
  border-color: rgba(53, 208, 186, 0.6);
  color: #b3f2e8;
}

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 760px) {
  .topbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .brand {
    font-size: 0.95rem;
    gap: 6px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .topbar-actions {
    gap: 6px;
  }

  .btn-ghost {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .nav-user {
    gap: 6px;
  }

  .nav-user .pill#nav-plan {
    display: none;
  }

  .nav-user #nav-credits {
    display: inline-block;
    font-size: 0.72rem;
    padding: 4px 8px;
  }

  .main {
    padding: 0 16px 64px;
  }

  .hero {
    padding-top: 48px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .workbench {
    padding: 18px;
  }

  .legal-wrap {
    margin: 20px auto;
    padding: 20px;
  }

  .hero-points {
    font-size: 0.85rem;
  }
}
