/* ============================================================
   铁锤小站 · 全站基础样式（动漫少年风）
   主题名：亮色「晴空少年」/ 暗色「星夜航路」
   设计语言：赛璐璐上色、天空蓝主色 + 落日橙撞色、
             粗墨线描边、硬偏移影、顶部受光高光、闪光星点缀
   ============================================================ */

/* ---------- 变量 ---------- */
:root {
  --bg: #eef6ff;
  --bg-soft: #dcecff;
  --card: #ffffff;
  --ink: #22315c;
  --ink-soft: #7f8bb0;
  --line: #c9dcf6;

  --blue: #2f8bff;
  --blue-deep: #1f6fe0;
  --blue-soft: #dcecff;
  --yellow: #ffc63f;
  --yellow-soft: #fff3d2;
  --pink: #ff6b81;
  --pink-deep: #f04a68;
  --pink-soft: #ffe3e8;
  --mint: #23c9a0;
  --mint-soft: #d9f7ee;
  --orange: #ff9a3d;
  --orange-soft: #ffeeda;
  --purple: #8f7bff;
  --purple-soft: #e9e4ff;

  --shadow-c: rgba(34, 49, 92, 0.16);
  --inset-top: inset 0 2px 0 rgba(255, 255, 255, 0.85);
  --title-pop: 0 3px 0 rgba(34, 49, 92, 0.12);
  --header-bg: rgba(238, 246, 255, 0.85);
  --quote-bg: #fff3d2;
  --code-inline-bg: #ddefff;
  --dot: rgba(110, 150, 220, 0.09);
  --pix: rgba(255, 255, 255, 0.5);
  --sky1: #6db9ff;
  --sky2: #ffe9d2;
  --blob-bg: radial-gradient(circle at 32% 26%, #ffffff 0%, #d9ecff 52%, #a9d3ff 100%);

  --radius: 20px;
  --btn-grad-top: #5ea9ff;
  --btn-grad-bottom: #2470e8;
  --font-display: "ZCOOL KuaiLe", "Yuanti SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] {
  --bg: #151a33;
  --bg-soft: #1c2342;
  --card: #232b52;
  --ink: #eef2ff;
  --ink-soft: #97a3cc;
  --line: #3c4a7e;

  --blue: #5aa8ff;
  --blue-deep: #7cbcff;
  --blue-soft: #1e3260;
  --yellow: #ffd23f;
  --yellow-soft: #3b3568;
  --pink: #ff7f95;
  --pink-deep: #ff92a6;
  --pink-soft: #452c44;
  --mint: #3fdcb2;
  --mint-soft: #1c4a44;
  --orange: #ffab57;
  --orange-soft: #4b3546;
  --purple: #ab9bff;
  --purple-soft: #352e66;

  --shadow-c: rgba(4, 8, 26, 0.55);
  --inset-top: inset 0 2px 0 rgba(255, 255, 255, 0.09);
  --title-pop: 0 3px 0 rgba(3, 6, 20, 0.5);
  --header-bg: rgba(21, 26, 51, 0.85);
  --quote-bg: #2c3260;
  --code-inline-bg: #1d2c54;
  --dot: rgba(255, 255, 255, 0.055);
  --pix: rgba(255, 255, 255, 0.3);
  --sky1: #2c2f6b;
  --sky2: #1a1c44;
  --blob-bg: radial-gradient(circle at 32% 26%, #3a447e 0%, #2f3768 52%, #262d57 100%);
  --btn-grad-top: #6fb2ff;
  --btn-grad-bottom: #3a7ce8;
}

/* ---------- Reset & 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.6px, transparent 1.6px);
  background-size: 26px 26px;
  min-height: 100vh;
  transition: background-color 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}

/* 背景空气光斑：像动画背景里柔焦的色光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(640px circle at 92% -8%, rgba(255, 190, 90, 0.2), transparent 62%),
    radial-gradient(560px circle at -6% 14%, rgba(80, 170, 255, 0.18), transparent 60%),
    radial-gradient(620px circle at 104% 86%, rgba(60, 205, 170, 0.12), transparent 62%),
    radial-gradient(540px circle at 16% 108%, rgba(140, 120, 255, 0.13), transparent 60%);
}

img, svg { max-width: 100%; vertical-align: middle; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
ul, ol { list-style-position: outside; }

::selection { background: var(--blue); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb {
  background: var(--blue);
  border-radius: 999px;
  border: 2px solid var(--bg-soft);
}
::-webkit-scrollbar-thumb:hover { background: var(--blue-deep); }

:focus-visible {
  outline: 3px dashed var(--blue-deep);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- 通用工具 ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

.icon-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--inset-top), 3px 3px 0 var(--shadow-c);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.icon-btn:hover { transform: translate(-2px, -2px); box-shadow: var(--inset-top), 5px 5px 0 var(--shadow-c); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: var(--inset-top), 1px 1px 0 var(--shadow-c); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.5px;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--inset-top), 4px 4px 0 var(--shadow-c);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--inset-top), 6px 6px 0 var(--shadow-c); }
.btn:active { transform: translate(3px, 3px); box-shadow: var(--inset-top), 1px 1px 0 var(--shadow-c); }
.btn-primary {
  background: linear-gradient(180deg, var(--btn-grad-top) 0%, var(--btn-grad-bottom) 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(15, 60, 140, 0.4);
}
[data-theme="dark"] .btn-primary {
  color: #0e2148;
  text-shadow: none;
}
.btn-sun { background: linear-gradient(180deg, #ffdf70 0%, #ffbd1f 100%); }
.btn-sm { padding: 8px 18px; font-size: 15px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--card);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink);
  box-shadow: var(--inset-top), 2px 2px 0 var(--shadow-c);
  white-space: nowrap;
}
.chip.c-blue   { background: var(--blue-soft); }
.chip.c-orange { background: var(--orange-soft); }
.chip.c-mint   { background: var(--mint-soft); }
.chip.c-pink   { background: var(--pink-soft); }
.chip.c-purple { background: var(--purple-soft); }
.chip.c-yellow { background: var(--yellow-soft); }

.tag-mini {
  display: inline-block;
  font-size: 12px;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  text-decoration: none;
  transition: all 0.18s ease;
}
.tag-mini:hover { color: var(--blue-deep); border-color: var(--blue-deep); background: var(--blue-soft); }

/* 表单控件 */
.input, .textarea {
  width: 100%;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 14.5px;
  color: var(--ink);
  outline: none;
  box-shadow: var(--inset-top);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-soft); }
.input:focus, .textarea:focus {
  border-color: var(--blue-deep);
  box-shadow: var(--inset-top), 3px 3px 0 var(--shadow-c);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.7; }

/* 滚动渐显 */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ---------- 天空装饰（动漫云 / 闪光星 / 贴纸飘浮） ---------- */
.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.sky .cloud {
  position: absolute;
  width: 130px; height: 38px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  animation: drift linear infinite;
  filter: drop-shadow(0 3px 0 rgba(90, 140, 210, 0.1));
}
.sky .cloud::before, .sky .cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.sky .cloud::before { width: 54px; height: 54px; top: -26px; left: 22px; }
.sky .cloud::after  { width: 40px; height: 40px; top: -18px; right: 20px; }

/* 闪光四角星（动漫里「キラッ☆」那种形状） */
.sky .star {
  position: absolute;
  width: 10px; height: 10px;
  background: #ffe98a;
  clip-path: polygon(50% 0%, 59% 41%, 100% 50%, 59% 59%, 50% 100%, 41% 59%, 0% 50%, 41% 41%);
  filter: drop-shadow(0 0 6px rgba(255, 233, 138, 0.75));
  animation: twinkle 3.2s ease-in-out infinite;
}
.sky .balloon {
  position: absolute;
  font-size: 26px;
  opacity: 0.9;
  animation: floaty 6s ease-in-out infinite;
  filter: drop-shadow(2px 3px 0 rgba(50, 90, 160, 0.14));
}

.sky .cloud, .sky .balloon { display: block; }
.sky .star { display: none; }
[data-theme="dark"] .sky .cloud, [data-theme="dark"] .sky .balloon { display: none; }
[data-theme="dark"] .sky .star { display: block; }

@keyframes drift {
  from { transform: translateX(-25vw); }
  to   { transform: translateX(115vw); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-13px) rotate(4deg); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.6) rotate(0deg); }
  50%      { opacity: 1; transform: scale(1.2) rotate(20deg); }
}
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.3) rotate(-8deg); }
  100% { transform: scale(1); }
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2.5px solid var(--ink);
}
.site-header.scrolled {
  box-shadow: 0 5px 0 var(--shadow-c);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  text-shadow: var(--title-pop);
}
.logo-mascot {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--yellow-soft);
  border: 2.5px solid var(--ink);
  box-shadow: var(--inset-top), 2px 2px 0 var(--shadow-c);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.logo:hover .logo-mascot { transform: rotate(-12deg) scale(1.08); }
.logo-mascot svg { width: 34px; height: auto; }

.site-nav { display: flex; gap: 4px; }
.nav-link {
  padding: 7px 14px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: all 0.18s ease;
}
.nav-link:hover { color: var(--ink); background: var(--blue-soft); }
.nav-link.active {
  color: var(--ink);
  background: var(--card);
  border-color: var(--ink);
  box-shadow: var(--inset-top), 2px 2px 0 var(--shadow-c);
  font-weight: 700;
}

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

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  border: 2.5px solid var(--ink);
  background: var(--card);
  border-radius: 12px;
  width: 42px; height: 42px;
  align-items: center;
  justify-content: center;
  box-shadow: var(--inset-top), 3px 3px 0 var(--shadow-c);
}
.nav-burger span {
  width: 18px; height: 2.5px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 90px;
  border-top: 2.5px solid var(--ink);
  background:
    radial-gradient(var(--dot) 1.5px, transparent 1.5px),
    var(--bg-soft);
  background-size: 24px 24px, auto;
  padding: 40px 0 30px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.footer-brand { font-family: var(--font-display); font-size: 24px; text-shadow: var(--title-pop); }
.footer-slogan { color: var(--ink-soft); font-size: 14px; margin: 6px 0 16px; }
.footer-links { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.footer-links a {
  font-size: 13.5px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 5px 14px;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: all 0.18s ease;
}
.footer-links a:hover { color: var(--ink); border-color: var(--ink); background: var(--card); }
.footer-copy { font-size: 13px; color: var(--ink-soft); }
.footer-copy .heart { display: inline-block; animation: pop 1.6s ease infinite; }

/* ---------- 悬浮组件 ---------- */
.backtop {
  position: fixed;
  right: 22px; bottom: 26px;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: linear-gradient(180deg, var(--btn-grad-top) 0%, var(--btn-grad-bottom) 100%);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--inset-top), 3px 3px 0 var(--shadow-c);
  cursor: pointer;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: all 0.3s ease;
}
.backtop.show { opacity: 1; visibility: visible; transform: translateY(0); }
.backtop:hover { transform: translateY(-4px); }
[data-theme="dark"] .backtop { color: #0e2148; }

.toast {
  position: fixed;
  left: 50%; bottom: 34px;
  transform: translateX(-50%) translateY(24px);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 5px;
  width: 0;
  z-index: 80;
  background: linear-gradient(90deg, var(--blue), var(--yellow), var(--orange), var(--purple));
  border-radius: 0 4px 4px 0;
  transition: width 0.08s linear;
}

/* ---------- 响应式（基础部分） ---------- */
@media (max-width: 880px) {
  .site-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 14px;
    right: 14px;
    flex-direction: column;
    gap: 6px;
    background: var(--card);
    border: 2.5px solid var(--ink);
    border-radius: 18px;
    padding: 12px;
    box-shadow: 6px 6px 0 var(--shadow-c);
    display: none;
  }
  .site-nav.open { display: flex; }
  .nav-link { padding: 10px 16px; font-size: 15.5px; }
  .nav-burger { display: inline-flex; }
  .header-inner { height: 62px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
