/* =========================================================
   星际空间站 · 样式表 (style.css)
   主题: 深空 · 炫酷宇宙 · 动画特效
   ========================================================= */

/* ---------- 变量 (可一键切换主题) ---------- */
:root {
  --bg: #0a0e1a;
  --bg-soft: #111830;
  --surface: rgba(22, 32, 64, 0.75);
  --surface-solid: #161f40;
  --border: rgba(120, 160, 255, 0.25);
  --text: #dce6ff;
  --text-dim: #8fa3c8;
  --accent: #4fd1ff;
  --accent2: #b06bff;
  --accent3: #ffd76b;
  --danger: #ff5f7a;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent2));
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* 浅色主题 (通过 body.light 触发) */
body.light {
  --bg: #eef2ff;
  --bg-soft: #dde5ff;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #ffffff;
  --border: rgba(80, 110, 200, 0.3);
  --text: #1b2340;
  --text-dim: #4a5678;
}

/* ---------- 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.5s ease;
  position: relative;
}

/* =========================================================
   星空背景 (三层星星叠加)
   ========================================================= */
.stars {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -3;
  pointer-events: none;
}
/* 第一层：静态星星 */
.stars::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 25px 5px, #fff, transparent),
    radial-gradient(1px 1px at 50px 25px, #9be6ff, transparent),
    radial-gradient(1.5px 1.5px at 125px 35px, #fff, transparent),
    background-image: none;
  background-size: 150px 150px, 150px 150px, 300px 300px;
}
/* 用 box-shadow 生成大量随机星星 */
.stars:nth-child(1) {
  background-position: 0 0;
}
.twinkling {
  z-index: -2;
  animation: twinkle 4s ease-in-out infinite alternate;
}
.shooting {
  z-index: -1;
}

@keyframes twinkle {
  0%   { opacity: 0.4; }
  100% { opacity: 1; }
}

/* 用 JS 动态注入的星星 (见 main.js) */
.js-star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
}

/* =========================================================
   导航栏
   ========================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 5vw, 48px);
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
body.light .navbar { background: rgba(255, 255, 255, 0.7); }

.nav-brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 1.6rem; animation: float 3s ease-in-out infinite; }
.brand-text { font-size: 1.15rem; font-weight: 700; letter-spacing: 1px; }

.nav-links { display: flex; gap: 6px; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 10px;
  transition: all 0.25s ease;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--text); background: rgba(120,160,255,0.12); }
.nav-links a.active {
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 4px 14px rgba(79, 209, 255, 0.35);
}
body.light .nav-links a.active { color: #fff; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.4rem;
  padding: 4px 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* =========================================================
   容器与主视觉
   ========================================================= */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 32px);
}

.hero {
  display: flex;
  align-items: center;
  gap: 40px;
  min-height: 74vh;
  flex-wrap: wrap;
}
.hero-text { flex: 1 1 460px; }

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.15;
  margin-bottom: 18px;
  font-weight: 800;
}
.gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hue 6s linear infinite alternate;
}

.hero-sub {
  color: var(--text-dim);
  line-height: 1.8;
  font-size: 1.05rem;
  margin-bottom: 28px;
}

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

/* 按钮 */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 6px 20px rgba(79, 209, 255, 0.4);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(79, 209, 255, 0.55); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: rgba(120,160,255,0.1); border-color: var(--accent); }

.server-badge {
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: inline-block;
}

/* =========================================================
   主视觉区：星球 + 轨道
   ========================================================= */
.hero-visual {
  flex: 1 1 320px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 340px;
}
.planet {
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffd76b, #ff9a5a 45%, #b06bff);
  box-shadow: 0 0 60px rgba(255, 154, 90, 0.5), inset -20px -20px 60px rgba(0,0,0,0.4);
  animation: float 4s ease-in-out infinite;
  position: relative;
  z-index: 2;
}
/* 星球上的环形山 */
.planet::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 60% 60%, rgba(0,0,0,0.18) 0 6px, transparent 7px),
             radial-gradient(circle at 25% 75%, rgba(0,0,0,0.2) 0 10px, transparent 11px);
}
.orbit {
  position: absolute;
  border: 1px dashed rgba(255,255,255,0.3);
  border-radius: 50%;
  z-index: 1;
}
.orbit-a { width: 250px; height: 250px; animation: rotate 18s linear infinite; }
.orbit-b { width: 320px; height: 320px; animation: rotate 26s linear infinite reverse; }
.orbit span {
  position: absolute;
  top: -8px; left: 50%;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.orbit-b span { background: var(--accent2); box-shadow: 0 0 10px var(--accent2); top: 50%; left: -8px; }
.astronaut {
  position: absolute;
  font-size: 3rem;
  bottom: 10px; right: 20px;
  z-index: 3;
  animation: float 2.5s ease-in-out infinite;
}

/* =========================================================
   卡片 / 功能区
   ========================================================= */
.section-title {
  font-size: 1.8rem;
  margin: 24px 0 28px;
  text-align: center;
  font-weight: 800;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 10px;
}
.card {
  background: var(--surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.card:hover { transform: translateY(-6px); border-color: var(--accent); }
.card-icon { font-size: 2.2rem; margin-bottom: 14px; }
.card h3 { margin-bottom: 8px; font-size: 1.2rem; }
.card p { color: var(--text-dim); font-size: 0.94rem; line-height: 1.6; }

/* 倒计时 */
.countdown {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: space-between;
}
.countdown div {
  background: var(--surface-solid);
  border-radius: 10px;
  padding: 10px 0;
  text-align: center;
  flex: 1;
  border: 1px solid var(--border);
}
.countdown .num {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
}
.countdown label { font-size: 0.78rem; color: var(--text-dim); }

/* 计算器 */
.calc-panel { margin-top: 14px; }
.calc-panel input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 12px;
  font-family: inherit;
}
.calc-panel input:focus { outline: 2px solid var(--accent); }
.calc-result { margin-top: 12px; color: var(--accent3); font-weight: 600; min-height: 22px; }

/* =========================================================
   关于页
   ========================================================= */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.avatar {
  font-size: 4.5rem;
  background: var(--gradient);
  width: 110px; height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 3s ease-in-out infinite;
}
.profile-info { flex: 1 1 360px; }
.profile-info h3 { font-size: 1.4rem; margin-bottom: 10px; }
.profile-info p { color: var(--text-dim); line-height: 1.8; }
.profile-info .quote {
  margin-top: 16px;
  color: var(--accent);
  font-style: italic;
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}

/* 技能条 */
.skills { display: flex; flex-direction: column; gap: 18px; margin-top: 10px; }
.skill { display: flex; align-items: center; gap: 16px; }
.skill-name { width: 90px; font-weight: 700; text-align: right; }
.skill-bar {
  flex: 1;
  height: 26px;
  background: var(--surface-solid);
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.skill-fill {
  height: 100%;
  background: var(--gradient);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 30px;
  animation: fillBar 1.5s ease;
}

/* =========================================================
   时钟页
   ========================================================= */
.clock-page { text-align: center; }
.clock-note { color: var(--text-dim); margin-bottom: 30px; }
.clock-display {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  margin: 0 auto;
  max-width: 480px;
  box-shadow: var(--shadow);
}
.clock-time {
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(79, 209, 255, 0.5);
  font-variant-numeric: tabular-nums;
}
.clock-date { margin-top: 12px; color: var(--text-dim); font-size: 1.1rem; }
.clock-extra { margin-top: 24px; color: var(--text-dim); line-height: 2; }

/* =========================================================
   联络页 / 表单
   ========================================================= */
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
}
.contact-form label { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--accent); }
.contact-form .btn { margin-top: 6px; align-self: flex-start; }

/* =========================================================
   页脚
   ========================================================= */
.footer {
  text-align: center;
  padding: 28px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  margin-top: 40px;
}
.footer-tech { font-size: 0.8rem; margin-top: 6px; letter-spacing: 1px; }

/* =========================================================
   动画定义
   ========================================================= */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes hue {
  from { filter: hue-rotate(0deg); }
  to   { filter: hue-rotate(30deg); }
}
@keyframes fillBar {
  from { width: 0; }
}
@keyframes drift {
  from { transform: translateX(-60px); }
  to   { transform: translateX(calc(100vw + 60px)); }
}

/* 流星 */
.shooting::after {
  content: "";
  position: absolute;
  top: 20%;
  left: -10%;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, #fff, transparent);
  border-radius: 2px;
  animation: drift 8s linear infinite;
  animation-delay: 2s;
  box-shadow: 0 0 10px #fff;
}

/* =========================================================
   响应式 (移动端)
   ========================================================= */
@media (max-width: 760px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 60px; left: 0; right: 0;
    flex-direction: column;
    background: rgba(10, 14, 26, 0.98);
    padding: 16px;
    gap: 8px;
    border-bottom: 1px solid var(--border);
  }
  body.light .nav-links { background: rgba(255,255,255,0.98); }
  .nav-links.show { display: flex; }
  .nav-toggle { display: block; }
  .hero { min-height: auto; padding-top: 30px; }
  .hero-visual { margin-top: 20px; min-height: 260px; }
}
