/* 智学星球 · 星辰深空风主题 */
:root {
  --space-1: #070d1f;
  --space-2: #0b1e3a;
  --space-3: #16305c;
  --space-4: #1f3f74;
  --star-silver: #e8eefc;
  --star-dim: #8fa3c8;
  --gold: #f2a93b;
  --gold-soft: #ffd58a;
  --teal: #2f9e8f;
  --glass: rgba(15, 32, 66, 0.66);
  --card-border: rgba(122, 158, 214, 0.22);
  --text-main: #eef3ff;
  --text-dim: #9fb0cf;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-glow: 0 0 24px rgba(242, 169, 59, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  color: var(--text-main);
  background: radial-gradient(1200px 700px at 75% -10%, #1a3a6e 0%, transparent 55%),
    radial-gradient(900px 600px at -10% 30%, #12305c 0%, transparent 50%),
    linear-gradient(165deg, #070d1f 0%, #0b1e3a 55%, #0e2345 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* 星空层：多组微光星点 + 闪烁 */
.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 22%, rgba(255, 255, 255, 0.9), transparent 60%),
    radial-gradient(1.2px 1.2px at 28% 66%, rgba(242, 169, 59, 0.8), transparent 60%),
    radial-gradient(1.4px 1.4px at 41% 12%, rgba(255, 255, 255, 0.75), transparent 60%),
    radial-gradient(1.1px 1.1px at 55% 38%, rgba(143, 163, 200, 0.9), transparent 60%),
    radial-gradient(1.5px 1.5px at 64% 74%, rgba(255, 255, 255, 0.8), transparent 60%),
    radial-gradient(1.2px 1.2px at 73% 18%, rgba(242, 169, 59, 0.7), transparent 60%),
    radial-gradient(1.4px 1.4px at 85% 52%, rgba(255, 255, 255, 0.72), transparent 60%),
    radial-gradient(1px 1px at 92% 84%, rgba(143, 163, 200, 0.85), transparent 60%),
    radial-gradient(1.3px 1.3px at 33% 88%, rgba(255, 255, 255, 0.78), transparent 60%),
    radial-gradient(1.2px 1.2px at 78% 90%, rgba(242, 169, 59, 0.65), transparent 60%);
  animation: twinkle 5s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

.hero {
  position: relative;
  z-index: 1;
  padding: 26px 5vw 92px;
  min-height: 78vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

/* 星球光晕：首屏右侧发光体 */
.hero::after {
  content: "";
  position: absolute;
  top: 6%;
  right: -7vw;
  z-index: -1;
  width: 46vw;
  height: 46vw;
  max-width: 640px;
  max-height: 640px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 35%, rgba(47, 158, 143, 0.5) 0%, transparent 42%),
    radial-gradient(circle at 42% 38%, rgba(242, 169, 59, 0.16) 48%, transparent 62%),
    radial-gradient(circle at 45% 40%, transparent 58%, rgba(47, 158, 143, 0.16) 68%, transparent 78%);
  filter: blur(2px);
  animation: pulse-planet 9s ease-in-out infinite;
}

@keyframes pulse-planet {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.06); opacity: 1; }
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 10px rgba(242, 169, 59, 0.35));
}

.brand span { display: flex; flex-direction: column; line-height: 1.25; }
.brand strong { font-size: 19px; letter-spacing: 0.5px; }
.brand small { color: var(--text-dim); font-size: 12px; }

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

.nav-button, .action-button, .submit-button {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.nav-button:hover, .action-button:hover, .submit-button:hover { transform: translateY(-1px); }

.nav-button-solid, .action-primary, .submit-button {
  background: linear-gradient(135deg, var(--gold) 0%, #e0882a 100%);
  color: #1a1023;
  font-weight: 700;
  box-shadow: 0 6px 22px rgba(242, 169, 59, 0.32);
}

.nav-button-solid:hover, .action-primary:hover, .submit-button:hover {
  box-shadow: 0 10px 30px rgba(242, 169, 59, 0.46);
}

.nav-button-light, .action-secondary {
  background: rgba(20, 42, 84, 0.55);
  color: var(--star-silver);
  border-color: rgba(143, 163, 200, 0.4);
}

.nav-button-light:hover, .action-secondary:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
  box-shadow: 0 0 16px rgba(242, 169, 59, 0.25);
}

.hero-content {
  margin: auto 0;
  max-width: 780px;
  padding: 120px 22px 60px;
}

.hero-content h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 6.2vw, 76px);
  line-height: 1.08;
  letter-spacing: 2px;
  background: linear-gradient(120deg, #ffffff 20%, var(--gold-soft) 52%, #68c9bc 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(242, 169, 59, 0.18);
}

.hero-lead {
  margin: 0 0 34px;
  font-size: clamp(15px, 2vw, 19px);
  line-height: 1.8;
  color: var(--text-dim);
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* 工具区 */
.tools-section {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 5vw 90px;
}

.tool-group { margin-bottom: 54px; }

.tool-group header { margin-bottom: 22px; }
.tool-group header span {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.tool-group header h3 {
  margin: 6px 0 6px;
  font-size: 26px;
  letter-spacing: 1px;
}
.tool-group header p { margin: 0; color: var(--text-dim); font-size: 14px; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.tool-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(22, 48, 92, 0.72) 0%, rgba(12, 28, 58, 0.82) 100%);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 160px at 20% -20%, rgba(242, 169, 59, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.tool-card:hover {
  transform: translateY(-5px);
  border-color: rgba(242, 169, 59, 0.6);
  box-shadow: var(--shadow-glow);
}
.tool-card:hover::before { opacity: 1; }

.tool-card > span {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 30px;
  line-height: 1;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

.tool-card div { position: relative; z-index: 1; }
.tool-card strong { display: block; font-size: 17px; margin-bottom: 6px; }
.tool-card p { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.6; }
.tool-card i {
  font-style: normal;
  position: absolute;
  top: 16px;
  right: 18px;
  color: var(--text-dim);
  font-size: 16px;
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.tool-card:hover i { opacity: 1; transform: none; }

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 26px 5vw 40px;
  border-top: 1px solid rgba(122, 158, 214, 0.18);
  color: var(--text-dim);
}
.site-footer strong { color: var(--text-main); margin-right: 10px; }
.site-footer a { color: var(--gold); text-decoration: none; }

/* 弹窗（深色磨砂） */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(4, 9, 22, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 30px 32px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(25, 50, 96, 0.92) 0%, rgba(10, 24, 50, 0.96) 100%);
  border: 1px solid rgba(122, 158, 214, 0.3);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 40px rgba(47, 158, 143, 0.12);
  color: var(--text-main);
}

.modal-kicker {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 2px;
}

.modal-panel h2 { margin: 0 0 18px; font-size: 22px; }

.icon-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(143, 163, 200, 0.4);
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.icon-close:hover { color: var(--gold); border-color: var(--gold); }

.modal-panel form { display: flex; flex-direction: column; gap: 14px; }
.modal-panel form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }
.modal-panel form input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(122, 158, 214, 0.3);
  background: rgba(8, 20, 44, 0.7);
  color: var(--text-main);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.modal-panel form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 169, 59, 0.18);
}

.modal-panel .submit-button { margin-top: 6px; font-size: 15px; padding: 13px; }

.account-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(47, 158, 143, 0.12);
  border: 1px solid rgba(47, 158, 143, 0.35);
}
.account-summary span { color: var(--text-dim); font-size: 13px; }

.segment-control {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(8, 20, 44, 0.6);
  border: 1px solid rgba(122, 158, 214, 0.25);
}
.segment-control button {
  flex: 1;
  padding: 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
}
.segment-control button.is-active {
  background: linear-gradient(135deg, var(--gold), #e0882a);
  color: #1a1023;
  font-weight: 700;
}

.form-message { min-height: 20px; font-size: 13px; color: var(--text-dim); }
.form-message[aria-hidden="true"] { display: none; }
.form-message.is-error { color: #ff7a70; }
.form-message.is-success { color: #6ee7d2; }

.text-button {
  border: 0;
  background: none;
  color: var(--gold);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 100;
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(20, 42, 84, 0.92);
  border: 1px solid rgba(242, 169, 59, 0.45);
  color: var(--text-main);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 720px) {
  .hero { padding-bottom: 60px; }
  .site-nav { flex-wrap: wrap; }
  .tool-grid { grid-template-columns: 1fr; }
  .hero-content { padding-top: 70px; }
}