:root {
  --bg: #07111f;
  --bg-soft: rgba(255, 255, 255, 0.06);
  --panel: rgba(10, 18, 34, 0.65);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #e8f1ff;
  --text-soft: #adc0df;
  --title: #ffffff;
  --accent: #7ac9ff;
  --accent-2: #b7a8ff;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  --button-text: #02111e;
  --hero-glow: radial-gradient(circle at top left, rgba(122, 201, 255, 0.18), transparent 40%), radial-gradient(circle at bottom right, rgba(183, 168, 255, 0.16), transparent 35%);
}

body[data-theme="light"] {
  --bg: #eef6ff;
  --bg-soft: rgba(255, 255, 255, 0.66);
  --panel: rgba(255, 255, 255, 0.7);
  --panel-border: rgba(124, 151, 187, 0.2);
  --text: #23374f;
  --text-soft: #546a87;
  --title: #0f2238;
  --accent: #4e86ff;
  --accent-2: #9b78ff;
  --shadow: 0 16px 40px rgba(65, 102, 146, 0.16);
  --button-text: #ffffff;
  --hero-glow: radial-gradient(circle at top left, rgba(78, 134, 255, 0.12), transparent 40%), radial-gradient(circle at bottom right, rgba(155, 120, 255, 0.14), transparent 35%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Noto Sans TC', sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; }
.shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}
.glass-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}
.brand strong {
  display: block;
  color: var(--title);
  font-size: 1rem;
}
.brand small {
  display: block;
  color: var(--text-soft);
}
.brand-mark {
  width: 2.65rem;
  height: 2.65rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 8px 26px rgba(122, 201, 255, 0.28);
}
.top-nav {
  display: flex;
  gap: 1.15rem;
  flex-wrap: wrap;
}
.top-nav a {
  text-decoration: none;
  color: var(--text-soft);
}
.top-nav a:hover { color: var(--title); }
.theme-toggle {
  border: 1px solid var(--panel-border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 1.25rem;
  align-items: stretch;
  padding: 2.25rem 0 1rem;
}
.hero-copy, .hero-panel {
  border-radius: 28px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  background-image: var(--hero-glow);
}
.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  color: var(--title);
  font-size: clamp(2.2rem, 4.8vw, 4rem);
  line-height: 1.08;
}
.hero-lead, .section-desc, .feature-item p, .tool-card p, .status-card p, .site-footer p, .mini-title, .status-list span {
  color: var(--text-soft);
}
.hero-lead {
  margin: 1.2rem 0 1.5rem;
  font-size: 1.02rem;
  line-height: 1.85;
}
.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.button {
  text-decoration: none;
  padding: 0.9rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--button-text);
}
.button-secondary {
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--text);
}
.hero-panel {
  min-height: 320px;
}
.constellation-card {
  position: relative;
  z-index: 2;
}
.mini-title {
  margin: 0 0 1rem;
}
.status-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.8rem;
}
.status-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 0.65rem;
}
.status-list strong {
  color: var(--title);
}
.orbit {
  position: absolute;
  border-radius: 999px;
  border: 1px dashed rgba(255,255,255,0.25);
  opacity: 0.6;
}
.orbit-1 { width: 240px; height: 240px; right: 1rem; bottom: 0.5rem; }
.orbit-2 { width: 160px; height: 160px; right: 3.2rem; bottom: 2.8rem; }
.planet {
  position: absolute;
  right: 4.2rem;
  bottom: 6.4rem;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff, var(--accent) 25%, var(--accent-2) 68%, transparent 75%);
  box-shadow: 0 0 36px rgba(122, 201, 255, 0.38);
}
.section { padding: 3.2rem 0 1rem; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.section-head h2 {
  margin: 0;
  color: var(--title);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}
.tool-grid, .feature-grid, .status-grid {
  display: grid;
  gap: 1rem;
}
.tool-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tool-card, .feature-item, .status-card, .tool-page-panel {
  border-radius: 24px;
  padding: 1.4rem;
}
.tool-card {
  text-decoration: none;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(122, 201, 255, 0.38);
}
.tool-card h3, .feature-item h3, .status-card h3, .tool-page-panel h2 {
  margin: 0;
  color: var(--title);
}
.tool-link {
  margin-top: auto;
  color: var(--accent);
  font-weight: 700;
}
.tool-icon {
  width: 3.15rem;
  height: 3.15rem;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 1.35rem;
  background: linear-gradient(135deg, rgba(122, 201, 255, 0.24), rgba(183, 168, 255, 0.24));
}
.feature-item p, .tool-card p { line-height: 1.75; }
.status-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: none;
}
.is-online { background: #4ade80; box-shadow: 0 0 16px rgba(74, 222, 128, 0.5); }
.is-idle { background: #fbbf24; box-shadow: 0 0 16px rgba(251, 191, 36, 0.4); }
.site-footer {
  padding: 2.5rem 0 3rem;
  text-align: center;
}

/* tool pages */
.tool-layout {
  padding: 2rem 0 3rem;
}
.page-back {
  display: inline-flex;
  margin: 1rem 0 1.4rem;
  color: var(--accent);
  text-decoration: none;
}
.tool-page-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}
.field-block {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
label {
  font-weight: 700;
  color: var(--title);
}
input, textarea, select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 0.95rem 1rem;
  font: inherit;
}
body[data-theme="light"] input,
body[data-theme="light"] textarea,
body[data-theme="light"] select {
  background: rgba(255,255,255,0.78);
}
textarea {
  min-height: 200px;
  resize: vertical;
}
.tool-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
button.action-btn {
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--button-text);
}
button.ghost-btn {
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--text);
}
.result-box {
  min-height: 300px;
  white-space: pre-wrap;
  line-height: 1.75;
  color: var(--text);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  background: rgba(122, 201, 255, 0.15);
  color: var(--accent);
  font-size: 0.85rem;
}
.tip-list {
  padding-left: 1.1rem;
  color: var(--text-soft);
  line-height: 1.85;
}
.stars, .aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}
.stars-a {
  background-image: radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.9), transparent), radial-gradient(1.5px 1.5px at 60% 10%, rgba(255,255,255,0.65), transparent), radial-gradient(2px 2px at 80% 24%, rgba(255,255,255,0.8), transparent), radial-gradient(1.5px 1.5px at 75% 70%, rgba(255,255,255,0.6), transparent), radial-gradient(2px 2px at 30% 80%, rgba(255,255,255,0.7), transparent), radial-gradient(1.5px 1.5px at 55% 58%, rgba(255,255,255,0.8), transparent);
  opacity: 0.5;
}
.stars-b {
  background-image: radial-gradient(1px 1px at 15% 55%, rgba(255,255,255,0.65), transparent), radial-gradient(1px 1px at 47% 18%, rgba(255,255,255,0.55), transparent), radial-gradient(1px 1px at 88% 38%, rgba(255,255,255,0.55), transparent), radial-gradient(1px 1px at 68% 88%, rgba(255,255,255,0.55), transparent), radial-gradient(1px 1px at 10% 85%, rgba(255,255,255,0.55), transparent);
  opacity: 0.4;
}
.aurora-1 {
  background: radial-gradient(circle at 20% 0%, rgba(122, 201, 255, 0.16), transparent 32%);
}
.aurora-2 {
  background: radial-gradient(circle at 90% 20%, rgba(183, 168, 255, 0.14), transparent 26%);
}

@media (max-width: 1024px) {
  .hero,
  .tool-page-grid,
  .tool-grid,
  .feature-grid,
  .status-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-panel { min-height: 280px; }
}

@media (max-width: 760px) {
  .site-header {
    flex-wrap: wrap;
    justify-content: center;
  }
  .top-nav { justify-content: center; }
  .hero,
  .tool-page-grid,
  .tool-grid,
  .feature-grid,
  .status-grid,
  .section-head {
    grid-template-columns: 1fr;
    display: grid;
  }
  .section-head { align-items: start; }
  .hero-copy, .hero-panel { padding: 1.4rem; }
  .hero { padding-top: 1.25rem; }
  .shell { width: min(100% - 1rem, 1180px); }
}
