/* ===== 主题变量：深空科技蓝 ===== */
:root, [data-theme="dark"] {
  --bg: #070b16;
  --bg-2: #0a1024;
  --surface: #0f1730;
  --surface-2: #131d3a;
  --text: #e9eefc;
  --text-soft: #8ea0c6;
  --accent: #4da3ff;
  --accent-2: #7ee0ff;
  --border: #1d2b4d;
  --glow: rgba(77, 163, 255, 0.5);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  --radius: 16px;
  --max: 1080px;
}

[data-theme="light"] {
  --bg: #eef3fc;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f7ff;
  --text: #0b1428;
  --text-soft: #566280;
  --accent: #2b7fff;
  --accent-2: #17b0d8;
  --border: #d9e3f5;
  --glow: rgba(43, 127, 255, 0.35);
  --shadow: 0 16px 40px rgba(20, 40, 90, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background: transparent;
  color: var(--text);
  line-height: 1.7;
  transition: color 0.3s;
}

a { color: inherit; text-decoration: none; }
section { scroll-margin-top: 80px; }
strong { color: var(--text); font-weight: 700; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* 科技感标题字体：本地自托管（Google Fonts 国内访问超时，字体文件已下载到 assets/fonts/） */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("assets/fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("assets/fonts/space-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

.nav__logo, .hero__name, .section__title, .feature__title, .stat__num {
  font-family: "Space Grotesk", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ===== 星空背景 ===== */
#stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
[data-theme="light"] #stars { opacity: 0; }
html { background: radial-gradient(ellipse at 50% -10%, var(--bg-2), var(--bg) 60%); }

/* ===== 滚动进度条 ===== */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 100;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--glow);
}

/* ===== 导航 ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.8rem;
  padding: 1rem clamp(1rem, 5vw, 3rem);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav__logo { font-weight: 700; font-size: 1.2rem; letter-spacing: 0.5px; }
.nav__logo span { color: var(--accent); }
.nav__links { margin-left: auto; display: flex; gap: 1.5rem; }
.nav__links a { color: var(--text-soft); font-size: 0.95rem; transition: color 0.2s; position: relative; }
.nav__links a:hover { color: var(--accent); }
.nav__links a.active { color: var(--accent); }
.nav__links a.active::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 2px; background: var(--accent); border-radius: 2px;
  box-shadow: 0 0 8px var(--glow);
}

.pill-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 40px; height: 40px;
  padding: 0 0.55rem;
  font-size: 1rem; font-weight: 600; font-family: inherit;
  cursor: pointer; color: var(--text);
  transition: transform 0.15s, border-color 0.2s;
}
.pill-btn:hover { border-color: var(--accent); }
.pill-btn:active { transform: scale(0.9); }
.menu-toggle { display: none; }

/* ===== 首页 ===== */
.hero {
  position: relative;
  min-height: calc(100vh - 70px);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  padding: 2rem clamp(1rem, 5vw, 3rem);
  overflow: hidden;
}
/* 发光圆环（呼应海豹游戏） */
.hero__ring {
  position: absolute;
  width: min(560px, 90vw); height: min(560px, 90vw);
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: 0 0 80px 10px var(--glow) inset, 0 0 60px var(--glow);
  opacity: 0.35;
  animation: pulse 6s ease-in-out infinite;
}
.hero__spot {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 40%),
    color-mix(in srgb, var(--accent) 20%, transparent), transparent 60%);
  opacity: 0; transition: opacity 0.4s;
}
.hero:hover .hero__spot { opacity: 1; }
.hero__inner { position: relative; max-width: 700px; animation: rise 0.8s ease both; }

.hero__badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-2);
  font-size: 0.85rem;
  margin-bottom: 1.4rem;
  transition: border-color 0.2s, transform 0.2s;
}
.hero__badge:hover { border-color: var(--accent); transform: translateY(-2px); }
.hero__hi { color: var(--accent); font-weight: 600; margin-bottom: 0.4rem; }
.hero__name {
  font-size: clamp(2.8rem, 9vw, 5rem);
  font-weight: 700; letter-spacing: 1px; line-height: 1.05;
  text-shadow: 0 0 30px var(--glow);
}
.hero__role {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: var(--text-soft); font-weight: 500;
  margin: 0.6rem 0 1.2rem; min-height: 1.6em;
}
.type-caret { color: var(--accent); animation: blink 1s step-end infinite; }
.hero__desc { color: var(--text-soft); margin-bottom: 2rem; }
.hero__cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
  padding: 0.8rem 1.9rem; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
  border: none; font-family: inherit;
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06131f;
  box-shadow: 0 8px 24px var(--glow);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px var(--glow); }
.btn--ghost { border: 1px solid var(--border); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero__scroll {
  position: absolute; bottom: 1.5rem; font-size: 1.5rem;
  color: var(--text-soft); animation: bounce 1.8s infinite;
}

/* ===== 通用区块 ===== */
.section { max-width: var(--max); margin: 0 auto; padding: 5rem clamp(1rem, 5vw, 3rem); }
.section__head { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 2.5rem; }
.section__num { color: var(--accent); font-weight: 700; font-family: monospace; }
.section__title { font-size: clamp(1.7rem, 5vw, 2.3rem); font-weight: 700; }

/* ===== 关于 ===== */
.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.5rem; align-items: start; }
.about__text p { color: var(--text-soft); margin-bottom: 1rem; }
.about__skills { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }
.about__skills li {
  background: var(--surface); border: 1px solid var(--border);
  padding: 0.4rem 1rem; border-radius: 999px;
  font-size: 0.85rem; color: var(--text-soft);
}
.about__card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; text-align: center; box-shadow: var(--shadow);
}
.about__avatar {
  width: 90px; height: 90px; margin: 0 auto 1rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 2.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 30px var(--glow);
}
.about__meta { color: var(--text-soft); font-size: 0.9rem; margin: 0.35rem 0; }

/* ===== 数据 ===== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-top: 3.5rem; }
.stat {
  text-align: center; padding: 1.5rem 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.stat__num {
  display: block; font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700; color: var(--accent); line-height: 1; text-shadow: 0 0 20px var(--glow);
}
.stat__label { font-size: 0.85rem; color: var(--text-soft); margin-top: 0.4rem; display: block; }

/* ===== 精选项目 ===== */
.features { display: flex; flex-direction: column; gap: 1.8rem; }
.feature--flip { direction: rtl; }
.feature--flip > * { direction: ltr; }
.feature__media--emoji {
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, #4ade80 25%, transparent), transparent 55%),
    linear-gradient(135deg, var(--surface-2), var(--bg-2));
}
.feature__emoji { font-size: clamp(4rem, 12vw, 7rem); filter: drop-shadow(0 0 24px rgba(74, 222, 128, 0.45)); }
.feature {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.2rem;
  align-items: center;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 20px; padding: 1.4rem;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.feature::before {
  content: ""; position: absolute; top: -40%; right: -20%;
  width: 60%; height: 160%;
  background: radial-gradient(circle, var(--glow), transparent 60%);
  opacity: 0.4; pointer-events: none;
}
.feature__media {
  position: relative; border-radius: 14px; overflow: hidden;
  aspect-ratio: 1 / 1; cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.15s ease;
}
.feature__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature__play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(6, 12, 26, 0.35); opacity: 0; transition: opacity 0.25s;
}
.feature__media:hover .feature__play { opacity: 1; }
.feature__play span {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: #06131f;
  display: grid; place-items: center; font-size: 1.6rem;
  box-shadow: 0 0 30px var(--glow);
}
.feature__info { position: relative; }
.feature__label {
  color: var(--accent-2); font-weight: 600; font-size: 0.8rem;
  letter-spacing: 2px; text-transform: uppercase;
}
.feature__title { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; margin: 0.4rem 0 0.8rem; }
.feature__desc { color: var(--text-soft); margin-bottom: 1rem; }
.feature__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.feature__tags span {
  font-size: 0.78rem; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 0.25rem 0.7rem; border-radius: 7px;
}
.feature__cta { display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* ===== 小游戏合集 ===== */
.works__sub { margin: 3rem 0 1.2rem; font-size: 1.2rem; font-weight: 700; }
.works__more { margin-top: 1.2rem; text-align: center; color: var(--text-soft); font-size: 0.85rem; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.2rem; }
.game-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.2rem; cursor: pointer;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform 0.15s ease, border-color 0.2s;
}
.game-card:hover { border-color: var(--accent); }
.game-card__icon {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.7rem;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.game-card__body { flex: 1; min-width: 0; }
.game-card__title { font-weight: 700; font-size: 1.02rem; }
.game-card__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.game-card__tags span {
  font-size: 0.72rem; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 0.15rem 0.5rem; border-radius: 6px;
}
.game-card__play {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.85rem;
  background: var(--accent); color: #06131f; box-shadow: 0 0 16px var(--glow);
}

/* ===== 时间线 ===== */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 2.2rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -1.68rem; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent), 0 0 12px var(--glow);
}
.tl-date { font-size: 0.8rem; color: var(--accent); font-weight: 700; font-family: monospace; }
.tl-title { font-size: 1.1rem; font-weight: 700; margin: 0.2rem 0; }
.tl-desc { color: var(--text-soft); font-size: 0.9rem; }

/* ===== 联系 ===== */
.section--contact { text-align: center; }
.section--contact .section__head { justify-content: center; }
.contact__lead { color: var(--text-soft); margin-bottom: 2rem; }
.contact__form { max-width: 520px; margin: 0 auto 2rem; display: flex; flex-direction: column; gap: 0.9rem; text-align: left; }
.form-row { display: flex; gap: 0.9rem; }
.form-row input { flex: 1; }
.contact__form input, .contact__form textarea {
  width: 100%; padding: 0.8rem 1rem; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 0.95rem; resize: vertical;
}
.contact__form input:focus, .contact__form textarea:focus { outline: none; border-color: var(--accent); }
.contact__form .btn { align-self: center; }
.contact__links { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.contact__link {
  background: var(--surface); border: 1px solid var(--border);
  padding: 0.8rem 1.6rem; border-radius: 12px; font-weight: 600;
  font-family: inherit; font-size: 0.95rem; color: var(--text); cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
}
.contact__link:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent); }

/* ===== 页脚 ===== */
.footer { text-align: center; padding: 2.5rem 1rem; color: var(--text-soft); font-size: 0.85rem; border-top: 1px solid var(--border); }
.footer__beian { margin-top: 0.6rem; font-size: 0.78rem; opacity: 0.75; }
.footer__beian a { color: inherit; text-decoration: none; }
.footer__beian a:hover { text-decoration: underline; }

/* ===== 返回顶部 ===== */
.to-top {
  position: fixed; right: 1.5rem; bottom: 1.5rem;
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: var(--accent); color: #06131f; font-size: 1.2rem; cursor: pointer;
  box-shadow: 0 0 20px var(--glow); opacity: 0; pointer-events: none;
  transform: translateY(10px); transition: opacity 0.3s, transform 0.3s; z-index: 40;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%) translateY(20px);
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  padding: 0.7rem 1.4rem; border-radius: 999px; font-size: 0.9rem;
  opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s; z-index: 100;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 动画 ===== */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.3; } 50% { transform: scale(1.05); opacity: 0.5; } }
.reveal { opacity: 0; }
.reveal.in { animation: rise 0.7s ease both; }

/* ===== 响应式 ===== */
@media (max-width: 760px) {
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: var(--surface);
    border-bottom: 1px solid var(--border); padding: 1rem 2rem; gap: 1rem; display: none;
  }
  .nav__links.open { display: flex; }
  .menu-toggle { display: block; }
  .about { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .feature { grid-template-columns: 1fr; }
  .soon { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
}

/* ===== 入场加载动画 ===== */
#loader {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 40%, var(--bg-2), var(--bg) 70%);
  transition: opacity 0.6s ease, visibility 0.6s;
}
#loader.hide { opacity: 0; visibility: hidden; }
.loader__ring {
  position: absolute;
  width: 130px; height: 130px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--accent);
  box-shadow: 0 0 30px var(--glow);
  animation: spin 1s linear infinite;
}
.loader__seal { font-size: 3rem; animation: floaty 2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floaty { 0%, 100% { transform: translateY(-4px); } 50% { transform: translateY(4px); } }

/* ===== 页面内试玩窗口 ===== */
.play {
  position: fixed; inset: 0; z-index: 250;
  display: none; flex-direction: column;
  background: rgba(4, 8, 18, 0.92); backdrop-filter: blur(6px);
}
.play.open { display: flex; }
.play__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.play__title { font-weight: 600; color: var(--text); }
.play__actions { display: flex; gap: 0.5rem; }
.play__actions .pill-btn { display: grid; place-items: center; text-decoration: none; }
#playFrame { flex: 1; width: 100%; border: 0; background: #000; }

/* ===== 分享面板 ===== */
.share {
  position: fixed; inset: 0; z-index: 260;
  display: none; place-items: center; padding: 1rem;
  background: rgba(4, 8, 18, 0.82); backdrop-filter: blur(6px);
}
.share.open { display: grid; }
.share__box {
  width: min(420px, 100%);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.4rem; text-align: center;
  animation: rise 0.25s ease both;
}
.share__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.share__title { font-size: 1.05rem; margin: 0; }
.share__qr {
  width: 180px; height: 180px; margin: 0 auto;
  display: grid; place-items: center;
  background: #fff; border-radius: 12px; padding: 8px;
}
.share__qr canvas, .share__qr img { width: 100%; height: 100%; display: block; }
.share__tip { font-size: 0.8rem; color: var(--text-soft); margin: 0.6rem 0 1rem; }
.share__url { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.share__url input {
  flex: 1; min-width: 0;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.6rem 0.8rem; color: var(--text); font-size: 0.85rem; font-family: inherit;
}
.share__url .btn { white-space: nowrap; padding: 0.6rem 1rem; font-size: 0.85rem; }
.share__targets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.share__target {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.6rem 0.3rem; font-size: 0.75rem; font-family: inherit;
  color: var(--text); cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
}
.share__target:hover { border-color: var(--accent); }
.share__target:active { transform: scale(0.94); }

/* ===== 彩蛋：掉落的小海豹 ===== */
.seal-drop {
  position: fixed; top: -50px; z-index: 400; pointer-events: none;
  font-size: 2rem; will-change: transform;
  animation: drop linear forwards;
}
@keyframes drop { to { transform: translateY(110vh) rotate(360deg); } }

/* ===== 尊重「减弱动效」 ===== */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
