/* 星际学园 · 暖色萌系官网主题 */
:root {
  --bg0: #fff6ea;
  --card: rgba(255, 252, 246, 0.88);
  --card-solid: #fffdf9;
  --card-edge: rgba(230, 180, 120, 0.45);
  --line: rgba(210, 160, 110, 0.35);
  --text: #5a3d28;
  --muted: #8a6a52;
  --accent: #f0a060;
  --accent2: #f5c06a;
  --accent-deep: #e8893a;
  --pink: #f7b8c8;
  --green: #9fd4a3;
  --danger: #e07070;
  --shadow: 0 12px 36px rgba(180, 120, 70, 0.16);
  --header-h: 64px;
  --radius: 20px;
  --radius-sm: 14px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg0);
}

/* 田园背景 */
.pastoral-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: #ffe8c8;
  background-image: url("bg-pastoral.jpg");
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

.pastoral-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 246, 230, 0.55) 0%, rgba(255, 246, 230, 0.2) 35%, rgba(255, 250, 240, 0.35) 70%, rgba(255, 248, 235, 0.75) 100%);
}

/* 兼容旧 class 名，避免子页漏改时空白 */
.space-bg { display: none !important; }
.space-grid, .space-scan { display: none !important; }

body {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--header-h) + 12px) 16px 32px;
}

/* —— 顶栏 —— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--header-h);
  padding: 8px 20px;
  background: rgba(255, 252, 246, 0.82);
  border-bottom: 1px solid rgba(240, 200, 150, 0.45);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: 0 4px 20px rgba(200, 150, 90, 0.12);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  border-radius: 999px;
  transition: transform 0.12s ease;
}

.site-brand:hover { transform: translateY(-1px); }

.site-brand img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(200, 140, 80, 0.25);
  background: #fff8ee;
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.site-brand-text strong {
  font-size: 16px;
  font-weight: 750;
  color: #6b4528;
  letter-spacing: 0.04em;
}

.site-brand-text span {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 6px;
  flex: 1;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.12s ease, background 0.12s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent-deep);
  background: rgba(255, 200, 140, 0.28);
}

.site-nav a.active {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.site-auth {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* —— 落地页布局 —— */
.landing {
  width: min(1120px, 100%);
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px 36px;
  align-items: start;
  padding: 20px 8px 8px;
}

.hero-left { position: relative; }

.hero-title {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 4rem);
  font-weight: 850;
  letter-spacing: 0.08em;
  color: #6b4228;
  text-shadow:
    0 2px 0 #fff8ee,
    0 6px 18px rgba(200, 140, 80, 0.22);
  line-height: 1.15;
}

.hero-title .star {
  display: inline-block;
  color: #f0b040;
  font-size: 0.55em;
  vertical-align: super;
  margin-right: 2px;
}

.ribbon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 12px;
  padding: 8px 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f8e0b0, #fde8c0 40%, #f8e0b0);
  border: 1px solid rgba(230, 180, 100, 0.45);
  color: #8a5a30;
  font-size: 14.5px;
  font-weight: 650;
  box-shadow: 0 6px 16px rgba(200, 150, 80, 0.15);
}

.hero-desc {
  margin: 0;
  max-width: 34em;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.hero-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

.download-card {
  background: linear-gradient(160deg, #fff9f0, #fff3e4);
  border: 1px solid rgba(240, 190, 130, 0.55);
  border-radius: 28px;
  padding: 22px 20px 18px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  text-align: center;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  text-decoration: none;
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(135deg, #f5b06a, #f08a48 55%, #e87838);
  box-shadow: 0 10px 28px rgba(232, 120, 56, 0.35);
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-download:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.btn-download .cloud {
  font-size: 1.35em;
  line-height: 1;
}

.download-meta {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.download-meta strong {
  color: var(--text);
  font-weight: 650;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 16px;
  background: rgba(255, 252, 246, 0.75);
  border: 1px solid rgba(240, 200, 150, 0.35);
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
  font-weight: 600;
}

.trust-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #fff8ee;
  box-shadow: 0 2px 8px rgba(200, 150, 90, 0.12);
  font-size: 18px;
}

.float-chip {
  position: absolute;
  right: 0;
  top: -6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.9);
  border: 1px solid rgba(240, 200, 150, 0.5);
  font-size: 12px;
  font-weight: 650;
  color: #b07a30;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

/* 特色区 */
.section {
  margin-top: 28px;
  padding: 8px 4px;
}

.section-title {
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 750;
  color: #6b4528;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  border-radius: 20px;
  background: rgba(255, 252, 246, 0.78);
  border: 1px solid rgba(240, 200, 150, 0.4);
  text-align: center;
  box-shadow: 0 6px 18px rgba(200, 150, 90, 0.1);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: linear-gradient(160deg, #fff, #fff4e6);
  border: 1px solid rgba(240, 200, 150, 0.45);
  box-shadow: 0 4px 12px rgba(200, 150, 90, 0.12);
}

.feature-item strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.feature-item span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.two-col {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-top: 16px;
}

.info-card {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.info-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
}

.luck-card {
  position: relative;
  background: linear-gradient(160deg, #fff9f2, #fff0f4);
  border: 1px solid rgba(240, 180, 190, 0.45);
  border-radius: var(--radius);
  padding: 16px 16px 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 140px;
}

.luck-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #8a4a58;
}

.luck-card .stars {
  color: #f0b040;
  letter-spacing: 2px;
  font-size: 15px;
}

.luck-card .luck-mascot {
  position: absolute;
  right: 4px;
  bottom: 0;
  width: 96px;
  height: auto;
  pointer-events: none;
  user-select: none;
}

/* 角色区 */
.characters {
  position: relative;
  margin-top: 12px;
  min-height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 0;
}

.mascot {
  display: block;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(120, 90, 50, 0.18));
  user-select: none;
  pointer-events: none;
}

.mascot-rabbit { width: min(160px, 28vw); }
.mascot-bear { width: min(200px, 34vw); }
.mascot-luck-inline { width: min(140px, 26vw); }

/* 新闻 / 家长 */
.placeholder-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}

/* 页脚 */
.site-footer {
  width: min(1120px, 100%);
  margin-top: 28px;
  padding: 16px 12px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}

.site-footer .age-note {
  display: inline-block;
  max-width: 40em;
  padding: 8px 16px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.85);
  border: 1px solid rgba(230, 190, 140, 0.4);
}

.site-footer a {
  color: #b07a40;
  text-decoration: none;
}

.site-footer a:hover { text-decoration: underline; }

.site-footer .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin: 6px 0;
}

.status {
  margin-top: 10px;
  min-height: 1.2em;
  font-size: 12.5px;
  color: var(--muted);
}
.status.err { color: var(--danger); }
.status.ok { color: #4a9a5a; }

/* —— 账号子页 shell（登录/注册/管理） —— */
.shell {
  width: min(760px, 100%);
  position: relative;
  z-index: 1;
  margin-top: 8px;
}
.shell.wide { width: min(920px, 100%); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  background: rgba(255, 252, 246, 0.85);
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(200, 150, 90, 0.1);
}
.badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent2);
}

.card {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  padding: 24px 22px 20px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 4.5vw, 2rem);
  letter-spacing: 0.04em;
  font-weight: 750;
  color: #6b4528;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 650;
  color: #6b4528;
}

.sub {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14.5px;
}

.meta {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 245, 230, 0.65);
  border: 1px solid rgba(230, 180, 120, 0.28);
  font-size: 14px;
}
.meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.meta span:first-child { color: var(--muted); }
.meta strong {
  font-weight: 600;
  word-break: break-all;
  text-align: right;
}

.actions { display: flex; flex-direction: column; gap: 10px; }
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  color: inherit;
  background: transparent;
  font-family: inherit;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.03); }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #f5b06a, #e8893a);
  box-shadow: 0 8px 22px rgba(232, 137, 58, 0.28);
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 252, 246, 0.7);
  color: var(--text);
}

.btn-danger {
  border-color: rgba(224, 112, 112, 0.45);
  color: var(--danger);
  background: rgba(255, 230, 230, 0.65);
}

.btn-block { width: 100%; }
.btn-sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
}

.btn-auth {
  background: linear-gradient(135deg, #f8d48a, #f0b050);
  color: #6b4528;
  border: 1px solid rgba(230, 170, 70, 0.45);
  box-shadow: 0 4px 14px rgba(230, 170, 70, 0.22);
  font-weight: 700;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
}
.field { margin-bottom: 12px; }

input {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.95);
  color: var(--text);
  padding: 8px 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
input:focus {
  border-color: rgba(232, 137, 58, 0.65);
  box-shadow: 0 0 0 3px rgba(240, 180, 100, 0.2);
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.topbar .session {
  margin: 0;
  flex: 1;
  min-width: 180px;
}
.session {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 245, 230, 0.65);
  border: 1px solid rgba(230, 180, 120, 0.28);
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.55;
}
.session strong { color: var(--accent-deep); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  border-bottom: 1px solid rgba(230, 180, 120, 0.22);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; }
tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}
tbody tr:hover {
  background: rgba(255, 210, 150, 0.18);
}

.pager {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

footer {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
footer a { color: #b07a40; text-decoration: none; }

.hidden { display: none !important; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(80, 50, 30, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  width: min(440px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--card-solid);
  border: 1px solid var(--card-edge);
  border-radius: 18px;
  padding: 20px 18px 16px;
  box-shadow: var(--shadow);
}
.modal h2 { margin-bottom: 10px; }
.modal .meta { margin-bottom: 14px; }
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.danger-zone {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(224, 112, 112, 0.25);
}

code {
  font-size: 0.92em;
  background: rgba(255, 240, 220, 0.8);
  padding: 1px 6px;
  border-radius: 6px;
}

/* 响应式 */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .float-chip { position: static; margin-bottom: 10px; display: inline-flex; }
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .two-col,
  .placeholder-row {
    grid-template-columns: 1fr;
  }
  .site-nav { display: none; }
  .mascot-luck-inline { display: none; }
}

@media (max-width: 560px) {
  .site-brand-text span { display: none; }
  .trust-row { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 2.4rem; }
  .mascot-rabbit { width: 110px; }
  .mascot-bear { width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .btn-download, .site-brand { transition: none; }
}
