/* ============================================================
   陨石宠物养成记 · 全站样式表
   配色：深空藏蓝 / 星云淡紫 / 月光白 / 浅银河青 / 星光浅金
   字体：圆润无衬线柔和字体
   ============================================================ */

/* ---------- 全局重置与主题变量 ---------- */
:root {
  --color-deep-space: #0a1030;         /* 深空藏蓝 */
  --color-nebula-purple: #b7a6ff;      /* 星云淡紫 */
  --color-moon-white: #f5f6ff;         /* 月光白 */
  --color-galaxy-cyan: #a8d8ff;        /* 浅银河青 */
  --color-starlight-gold: #ffe6a8;     /* 星光浅金 */
  --color-glass-bg: rgba(255, 255, 255, 0.06);
  --color-glass-border: rgba(255, 255, 255, 0.14);
  --color-text-main: #eef1ff;
  --color-text-soft: rgba(238, 241, 255, 0.72);

  --radius-card: 16px;
  --shadow-soft: 0 8px 30px rgba(10, 16, 48, 0.35);
  --shadow-glow-gold: 0 0 18px rgba(255, 230, 168, 0.55);

  --font-round: "PingFang SC", "HarmonyOS Sans", "Microsoft YaHei UI",
                "Nunito", "Quicksand", "Comfortaa", "Segoe UI", system-ui, sans-serif;
}

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

html, body {
  width: 100%;
  min-height: 100%;
  background: var(--color-deep-space);
  color: var(--color-text-main);
  font-family: var(--font-round);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0.2px;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; }

/* ============================================================
   一、动态背景层（三层结构）
   1) starfield-canvas   —— 星云 + 星光 canvas，视差滚动
   2) watermark-layer    —— 45° 平铺「陨石宠物」水印
   3) particle-canvas    —— 迷你陨石碎片粒子层（最上层动态）
   页面内容位于 .page-wrap（最顶层）
   ============================================================ */

/* 星空 canvas */
#starfield-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(183, 166, 255, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(168, 216, 255, 0.14) 0%, transparent 60%),
    linear-gradient(180deg, #05081f 0%, #0a1030 50%, #0d1240 100%);
}

/* 全屏水印层：45° 平铺，位于星空之上、粒子之下、内容之下 */
#watermark-layer {
  position: fixed;
  top: -20%;
  left: -20%;
  width: 140vw;
  height: 140vh;
  z-index: 1;
  pointer-events: none;
  /* SVG 单元格 260x260，内含 45° 倾斜的「陨石宠物」文字，8% 透明度 */
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'>\
<text x='30' y='150' fill='%23f0f2ff' fill-opacity='0.08' \
font-family='PingFang SC, Microsoft YaHei, sans-serif' font-size='32' font-weight='300' letter-spacing='2' \
transform='rotate(-45 130 130)'>陨石宠物</text>\
</svg>");
  background-repeat: repeat;
  background-size: 260px 260px;
  background-position: 0 0;
  /* 水印随页面滚动同步移动 —— JS 通过反向偏移 background-position 实现视觉贴合，
     无法被内容遮挡去除；透明度通过 SVG 内 fill-opacity 集中控制。 */
}

/* 陨石粒子层 */
#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
}

/* 页面主内容 */
.page-wrap {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   二、页面载入开幕效果
   ============================================================ */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: radial-gradient(circle at 50% 50%, #0d1240 0%, #05081f 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.2s ease;
}
#page-loader.hide { opacity: 0; pointer-events: none; }
#page-loader .loader-star {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-starlight-gold) 0%, transparent 65%);
  filter: blur(2px);
  animation: loaderPulse 1.8s ease-in-out infinite;
}
@keyframes loaderPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.6; }
  50%      { transform: scale(1.15); opacity: 1; }
}

/* 分段渐进显示 */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.on {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   三、顶部导航
   ============================================================ */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(10, 16, 48, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.4s ease, padding 0.3s ease;
}
.nav-bar.scrolled {
  background: rgba(10, 16, 48, 0.72);
  padding: 12px 40px;
  border-bottom-color: rgba(255, 255, 255, 0.09);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 1.5px;
  color: var(--color-moon-white);
}
.nav-brand .brand-orb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0%, var(--color-nebula-purple) 45%, #4b3fa8 100%);
  box-shadow: 0 0 12px rgba(183, 166, 255, 0.6);
}
.nav-menu {
  display: flex;
  gap: 6px;
  list-style: none;
}
.nav-menu a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 12px;
  color: var(--color-text-soft);
  font-size: 14.5px;
  transition: color 0.3s ease, background 0.3s ease;
}
.nav-menu a:hover,
.nav-menu a.active {
  color: var(--color-starlight-gold);
  background: rgba(255, 230, 168, 0.08);
}

/* 移动端汉堡 */
.nav-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-moon-white);
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ============================================================
   四、通用容器 / 排版
   ============================================================ */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

.section {
  padding: 90px 0;
  position: relative;
}
.section-title {
  font-size: 30px;
  font-weight: 600;
  color: var(--color-moon-white);
  margin-bottom: 14px;
  letter-spacing: 2px;
}
.section-subtitle {
  color: var(--color-text-soft);
  font-size: 15px;
  margin-bottom: 40px;
  letter-spacing: 1px;
}

/* ============================================================
   五、磨砂玻璃卡片（全站通用）
   ============================================================ */
.glass-card {
  position: relative;
  background: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: var(--shadow-soft);
  transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.4s ease, border-color 0.4s ease;
  overflow: hidden;
}
.glass-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 230, 168, 0.35);
  box-shadow: 0 12px 40px rgba(10, 16, 48, 0.45), var(--shadow-glow-gold);
}

/* ============================================================
   六、按钮
   ============================================================ */
.btn-starlight {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  color: #23204a;
  font-weight: 600;
  letter-spacing: 1.5px;
  background: linear-gradient(120deg, #ffe6a8 0%, #f5f6ff 45%, #a8d8ff 100%);
  box-shadow: 0 0 18px rgba(255, 230, 168, 0.35), inset 0 0 12px rgba(255, 255, 255, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.btn-starlight:hover {
  filter: brightness(1.05);
  box-shadow: 0 0 24px rgba(255, 230, 168, 0.55), inset 0 0 14px rgba(255, 255, 255, 0.55);
}
.btn-starlight:active {
  transform: scale(0.94);
}

/* ============================================================
   七、图片占位符（全站统一）
   替换本地素材后，通过 JS 或直接改 <img src> 即可；
   有 src 且加载成功时，.placeholder-hint 会被隐藏。
   ============================================================ */
.img-slot {
  position: relative;
  width: 100%;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px dashed rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  letter-spacing: 1px;
  transition: border-color 0.3s ease;
}
.img-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;               /* 有真实图片替换后由 JS 显示 */
}
.img-slot.has-image { border: none; }
.img-slot.has-image img { display: block; }
.img-slot.has-image .placeholder-hint { display: none; }

.img-slot .placeholder-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  pointer-events: none;
}

/* 尺寸档位（保持宽高比，宽度由父容器控制） */
.slot-banner  { aspect-ratio: 1920 / 600; }   /* 首页主视觉 */
.slot-pet     { aspect-ratio: 1 / 1;      }   /* 400*400 萌宠 */
.slot-diary   { aspect-ratio: 600 / 320;  }   /* 600*320 日记 */
.slot-atlas   { aspect-ratio: 1 / 1;      }   /* 350*350 图鉴 */
.slot-mini    { aspect-ratio: 1 / 1;      }   /* 语录页迷你装饰位 */

/* ============================================================
   八、首页 HERO
   ============================================================ */
.hero {
  padding: 160px 0 60px;
  text-align: center;
}
.hero-title {
  font-size: 42px;
  font-weight: 700;
  color: var(--color-moon-white);
  line-height: 1.35;
  letter-spacing: 3px;
  margin-bottom: 18px;
  text-shadow: 0 0 20px rgba(183, 166, 255, 0.35);
}
.hero-subtitle {
  font-size: 16px;
  color: var(--color-galaxy-cyan);
  letter-spacing: 6px;
  margin-bottom: 44px;
}
.hero-banner {
  max-width: 1080px;
  margin: 0 auto 40px;
}
.hero-intro {
  max-width: 720px;
  margin: 0 auto;
  color: var(--color-text-soft);
  font-size: 15.5px;
  letter-spacing: 1px;
  line-height: 2;
}

/* 首页四大入口 */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 20px;
}
.entry-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}
.entry-card .img-slot { margin-bottom: 4px; }
.entry-card h3 {
  font-size: 19px;
  color: var(--color-moon-white);
  letter-spacing: 2px;
}
.entry-card p {
  color: var(--color-text-soft);
  font-size: 13.5px;
  line-height: 1.75;
}
.entry-card .entry-link {
  margin-top: auto;
  color: var(--color-starlight-gold);
  font-size: 13px;
  letter-spacing: 2px;
}

/* ============================================================
   九、萌宠档案页
   ============================================================ */
.profile-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 48px;
  align-items: start;
}
.profile-avatar {
  padding: 22px;
}
.profile-avatar .img-slot { max-width: 356px; margin: 0 auto; }
.profile-avatar .avatar-caption {
  text-align: center;
  margin-top: 18px;
  color: var(--color-galaxy-cyan);
  font-size: 14px;
  letter-spacing: 3px;
}
.profile-info {
  padding: 32px 36px;
}
.profile-info h2 {
  font-size: 26px;
  color: var(--color-moon-white);
  margin-bottom: 22px;
  letter-spacing: 2px;
}
.info-list { list-style: none; margin-bottom: 24px; }
.info-list li {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 15px;
}
.info-list li:last-child { border-bottom: none; }
.info-list .label {
  flex-shrink: 0;
  width: 90px;
  color: var(--color-starlight-gold);
  letter-spacing: 2px;
}
.info-list .value {
  color: var(--color-text-main);
  letter-spacing: 0.5px;
}
.profile-intro {
  color: var(--color-text-soft);
  line-height: 2;
  font-size: 14.5px;
  padding: 18px 20px;
  background: rgba(183, 166, 255, 0.06);
  border-left: 2px solid var(--color-nebula-purple);
  border-radius: 8px;
}

/* ============================================================
   十、养成日记页
   ============================================================ */
.diary-list {
  display: flex;
  flex-direction: column;
  gap: 34px;
}
.diary-item {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  padding: 24px;
  align-items: center;
}
.diary-item .img-slot { width: 100%; }
.diary-content h3 {
  font-size: 20px;
  color: var(--color-moon-white);
  margin-bottom: 6px;
  letter-spacing: 1.5px;
}
.diary-date {
  color: var(--color-galaxy-cyan);
  font-size: 13px;
  letter-spacing: 2px;
  margin-bottom: 14px;
}
.diary-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 20px;
  font-size: 14px;
}
.diary-fields .field-label {
  color: var(--color-starlight-gold);
  letter-spacing: 1.5px;
  margin-right: 8px;
}
.diary-fields .field-value {
  color: var(--color-text-soft);
}
.diary-fields .full {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  margin-top: 4px;
}

/* ============================================================
   十一、星光图鉴页
   ============================================================ */
.atlas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}
.atlas-card {
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.atlas-card .img-slot { max-width: 100%; }
.atlas-card .stage-tag {
  display: inline-block;
  align-self: center;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(255, 230, 168, 0.12);
  color: var(--color-starlight-gold);
  font-size: 12px;
  letter-spacing: 2px;
}
.atlas-card h3 {
  font-size: 18px;
  color: var(--color-moon-white);
  letter-spacing: 2px;
}
.atlas-card p {
  color: var(--color-text-soft);
  font-size: 13.5px;
  line-height: 1.85;
}

/* ============================================================
   十二、星河小馆页（语录）
   ============================================================ */
.cafe-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
.cafe-card {
  padding: 32px 28px;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 140px;
}
.cafe-card .img-slot {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  aspect-ratio: 1/1;
}
.cafe-card .cafe-num {
  color: var(--color-starlight-gold);
  font-size: 13px;
  letter-spacing: 3px;
  margin-bottom: 8px;
}
.cafe-card p {
  color: var(--color-moon-white);
  font-size: 16px;
  letter-spacing: 1.2px;
  line-height: 1.9;
}

/* ============================================================
   十三、页脚
   ============================================================ */
.site-footer {
  margin-top: auto;
  padding: 40px 20px 30px;
  text-align: center;
  background: linear-gradient(180deg,
    rgba(10, 16, 48, 0)   0%,
    rgba(183, 166, 255, 0.10) 40%,
    rgba(10, 16, 48, 0.85) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--color-text-soft);
  letter-spacing: 2px;
}
.site-footer .footer-title {
  font-size: 15px;
  color: var(--color-moon-white);
  margin-bottom: 8px;
}
.site-footer .footer-slogan {
  font-size: 12px;
  color: var(--color-galaxy-cyan);
  letter-spacing: 4px;
}

/* ============================================================
   十四、响应式（PC / 平板 / 手机）
   ============================================================ */
@media (max-width: 1024px) {
  .entry-grid { grid-template-columns: repeat(2, 1fr); }
  .atlas-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-layout { grid-template-columns: 1fr; }
  .diary-item { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-bar { padding: 14px 20px; }
  .nav-bar.scrolled { padding: 10px 20px; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 12px 20px;
    background: rgba(10, 16, 48, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 12px 8px; border-bottom: 1px dashed rgba(255,255,255,0.06); }
  .nav-toggle { display: inline-flex; }

  .section { padding: 60px 0; }
  .hero { padding: 130px 0 30px; }
  .hero-title { font-size: 26px; letter-spacing: 2px; }
  .hero-subtitle { font-size: 13px; letter-spacing: 3px; }
  .section-title { font-size: 24px; }

  .entry-grid { grid-template-columns: 1fr; gap: 18px; }
  .atlas-grid { grid-template-columns: 1fr; gap: 18px; }
  .cafe-list  { grid-template-columns: 1fr; }
  .diary-item { padding: 18px; gap: 20px; }
  .profile-info { padding: 22px; }
  .diary-fields { grid-template-columns: 1fr; }
}

/* 兼容不支持 backdrop-filter 的浏览器 */
@supports not (backdrop-filter: blur(8px)) {
  .glass-card, .nav-bar {
    background: rgba(15, 22, 58, 0.85);
  }
}

/* ============================================================
   十五、【新增】首页公开留言板
   ============================================================ */
.messages-section { padding: 90px 0 60px; }
.messages-section .container { max-width: 900px; }

.message-form-wrap { padding: 28px 30px; margin-bottom: 30px; }
.message-form { display: flex; flex-direction: column; gap: 14px; }
.message-form label {
  color: var(--color-starlight-gold);
  font-size: 13px;
  letter-spacing: 2px;
}
.message-form input,
.message-form textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  color: var(--color-text-main);
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
  transition: border-color .3s, background .3s;
}
.message-form input::placeholder,
.message-form textarea::placeholder { color: rgba(238,241,255,0.35); }
.message-form input:focus,
.message-form textarea:focus {
  border-color: rgba(255,230,168,0.55);
  background: rgba(255,255,255,0.09);
}
.message-form textarea { min-height: 100px; resize: vertical; line-height: 1.7; }
.message-form .form-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.message-form .form-row input { flex: 1; min-width: 180px; }
.message-form .form-tip {
  color: var(--color-galaxy-cyan);
  font-size: 13px;
  min-height: 20px;
  letter-spacing: 1px;
}
.message-form .form-tip.error { color: #ffb3b3; }
.message-form .form-tip.success { color: var(--color-starlight-gold); }

.message-list { display: flex; flex-direction: column; gap: 14px; }
.message-item {
  padding: 18px 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.message-avatar {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0%, var(--color-nebula-purple) 45%, #4b3fa8 100%);
  color: #1e1b4a;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  box-shadow: 0 0 10px rgba(183,166,255,0.35);
}
.message-body { flex: 1; min-width: 0; }
.message-header {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 6px; flex-wrap: wrap;
}
.message-nickname { color: var(--color-moon-white); font-weight: 600; letter-spacing: 1px; }
.message-time { color: var(--color-text-soft); font-size: 12.5px; letter-spacing: 1px; }
.message-content {
  color: var(--color-text-soft); font-size: 14.5px; line-height: 1.9;
  word-break: break-word; white-space: pre-wrap;
}
.messages-empty {
  text-align: center; padding: 40px 20px;
  color: var(--color-text-soft); font-size: 14px; letter-spacing: 1.5px;
}

/* ============================================================
   十六、【新增】右下角悬浮按钮组
   （自定义跳转按钮 + 添加到桌面按钮）
   ============================================================ */
.floating-actions {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none; /* 让容器点透，只让子按钮响应 */
}
.floating-actions .fab-btn {
  pointer-events: auto;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: rgba(10,16,48,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  color: var(--color-moon-white);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease, background .28s ease;
  box-shadow: 0 6px 24px rgba(10,16,48,0.4);
  text-decoration: none;
  position: relative;
}
.floating-actions .fab-btn::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,230,168,0.4) 0%, transparent 70%);
  opacity: 0;
  transition: opacity .3s;
  z-index: -1;
}
.floating-actions .fab-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(255,230,168,0.55);
  box-shadow: 0 10px 30px rgba(10,16,48,0.55), var(--shadow-glow-gold);
  background: rgba(30,25,72,0.65);
}
.floating-actions .fab-btn:hover::before { opacity: 1; }
.floating-actions .fab-btn:active { animation: fabStarPulse .5s ease; }
.floating-actions .fab-btn .fab-icon { font-size: 20px; line-height: 1; margin-bottom: 2px; }
.floating-actions .fab-btn .fab-label { font-size: 10px; letter-spacing: 1px; opacity: 0.9; }

@keyframes fabStarPulse {
  0%   { transform: scale(1) translateY(-3px); }
  40%  { transform: scale(0.85) translateY(-3px); box-shadow: 0 0 0 14px rgba(255,230,168,0.25); }
  100% { transform: scale(1) translateY(-3px); box-shadow: 0 10px 30px rgba(10,16,48,0.55), var(--shadow-glow-gold); }
}

/* ============================================================
   十七、【新增】"添加到桌面"引导弹窗
   ============================================================ */
.desktop-guide-mask {
  position: fixed; inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5,8,31,0.65);
  backdrop-filter: blur(10px);
  animation: dgFadeIn .35s ease;
}
.desktop-guide-mask.show { display: flex; }
@keyframes dgFadeIn { from { opacity: 0 } to { opacity: 1 } }

.desktop-guide-modal {
  width: min(540px, 92vw);
  max-height: 88vh;
  overflow: auto;
  padding: 34px 32px 28px;
  position: relative;
  background: rgba(20,26,60,0.75);
  border: 1px solid rgba(255,230,168,0.28);
  border-radius: var(--radius-card);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 12px 60px rgba(0,0,0,0.6), 0 0 30px rgba(255,230,168,0.15);
  color: var(--color-text-main);
  animation: dgModalPop .5s cubic-bezier(.2,1.2,.4,1);
}
@keyframes dgModalPop {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.desktop-guide-modal h3 {
  color: var(--color-moon-white);
  font-size: 20px;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.desktop-guide-modal .dg-subtitle {
  color: var(--color-galaxy-cyan);
  font-size: 13px;
  letter-spacing: 3px;
  margin-bottom: 22px;
}

.desktop-guide-modal .guide-tabs {
  display: flex; gap: 8px; margin-bottom: 18px;
}
.desktop-guide-modal .guide-tab {
  flex: 1;
  padding: 9px 4px;
  text-align: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--color-text-soft);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 1px;
  transition: all .3s ease;
}
.desktop-guide-modal .guide-tab:hover { color: var(--color-moon-white); }
.desktop-guide-modal .guide-tab.active {
  background: rgba(255,230,168,0.12);
  border-color: rgba(255,230,168,0.4);
  color: var(--color-starlight-gold);
}

.desktop-guide-modal .guide-content { display: none; font-size: 14px; line-height: 2; color: var(--color-text-soft); }
.desktop-guide-modal .guide-content.active { display: block; }
.desktop-guide-modal .guide-content ol { padding-left: 22px; margin: 4px 0; }
.desktop-guide-modal .guide-content li { margin: 6px 0; }
.desktop-guide-modal .guide-content .key {
  color: var(--color-starlight-gold);
  padding: 1px 8px;
  border-radius: 6px;
  background: rgba(255,230,168,0.08);
  margin: 0 3px;
  font-size: 13px;
  border: 1px solid rgba(255,230,168,0.15);
}

.desktop-guide-modal .close-btn {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: var(--color-moon-white);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .3s ease;
}
.desktop-guide-modal .close-btn:hover {
  background: rgba(255,255,255,0.12);
  transform: rotate(90deg);
}

.desktop-guide-modal .footer-note {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255,255,255,0.1);
  color: var(--color-text-soft);
  font-size: 12.5px;
  text-align: center;
  letter-spacing: 1.5px;
}

/* 悬浮按钮移动端适配 */
@media (max-width: 720px) {
  .floating-actions { right: 14px; bottom: 14px; gap: 10px; }
  .floating-actions .fab-btn { width: 50px; height: 50px; }
  .floating-actions .fab-btn .fab-icon { font-size: 18px; }
  .floating-actions .fab-btn .fab-label { font-size: 9px; }
  .messages-section { padding: 60px 0 40px; }
  .message-form-wrap { padding: 22px 20px; }
}

/* ============================================================
   十八、【新增】后台管理页样式
   ============================================================ */
.admin-page-body {
  background: var(--color-deep-space);
  min-height: 100vh;
}
.admin-wrap {
  max-width: 1000px;
  margin: 60px auto 40px;
  padding: 0 22px;
  position: relative;
  z-index: 10;
}
.admin-title-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.admin-title-bar h1 {
  color: var(--color-moon-white);
  font-size: 24px;
  letter-spacing: 2px;
}
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-btn {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: var(--color-moon-white);
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all .3s ease;
  font-family: inherit;
}
.admin-btn:hover { border-color: rgba(255,230,168,0.5); color: var(--color-starlight-gold); background: rgba(255,230,168,0.06); }
.admin-btn.danger { border-color: rgba(255,120,120,0.4); color: #ffb3b3; }
.admin-btn.danger:hover { background: rgba(255,120,120,0.15); color: #ffd4d4; }

.admin-login {
  max-width: 400px;
  margin: 140px auto;
  padding: 34px 30px;
}
.admin-login h2 {
  color: var(--color-moon-white);
  margin-bottom: 6px;
  letter-spacing: 2px;
  font-size: 22px;
  text-align: center;
}
.admin-login .subtitle {
  color: var(--color-galaxy-cyan);
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 3px;
  margin-bottom: 20px;
}
.admin-login input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: var(--color-text-main);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .3s;
}
.admin-login input:focus { border-color: rgba(255,230,168,0.5); }
.admin-login .btn-starlight { width: 100%; padding: 12px; margin-top: 4px; }
.admin-login .tip { color: var(--color-galaxy-cyan); font-size: 12.5px; margin-top: 10px; min-height: 20px; text-align: center; letter-spacing: 1px; }
.admin-login .tip.error { color: #ffb3b3; }

.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-empty { text-align: center; padding: 60px 20px; color: var(--color-text-soft); }
.admin-item {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 16px;
  align-items: center;
}
.admin-item .idx { color: var(--color-starlight-gold); font-size: 13px; letter-spacing: 1px; }
.admin-item .body { min-width: 0; }
.admin-item .body .nick { color: var(--color-moon-white); font-weight: 600; margin-bottom: 4px; letter-spacing: 1px; }
.admin-item .body .time { color: var(--color-text-soft); font-size: 12px; margin-bottom: 6px; letter-spacing: 1px; }
.admin-item .body .content { color: var(--color-text-soft); font-size: 14px; word-break: break-word; line-height: 1.8; }
.admin-item .del-btn {
  padding: 6px 14px; border-radius: 8px;
  border: 1px solid rgba(255,120,120,0.35);
  background: rgba(255,120,120,0.08);
  color: #ffb3b3; cursor: pointer; font-size: 13px;
  transition: all .3s ease;
  font-family: inherit;
}
.admin-item .del-btn:hover { background: rgba(255,120,120,0.2); color: #ffd4d4; }

@media (max-width: 720px) {
  .admin-item { grid-template-columns: 1fr; }
  .admin-item .idx { color: var(--color-starlight-gold); }
  .admin-item .del-btn { justify-self: flex-start; }
}

/* ============================================================
   📚 v2.1 新增：右上角"后台"入口 + 后台流量统计
   ------------------------------------------------------------
   - .nav-admin-entry：全站导航栏右上角的登录入口（JS 自动注入）
   - .admin-tabs / .stats-*：后台管理页的流量统计面板
   全部沿用星空磨砂玻璃质感，与全站视觉统一。
   ============================================================ */

/* -------- 右上角后台入口 -------- */
.nav-admin-item { margin-left: 10px; }
.nav-admin-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,214,120,0.35);
  background: linear-gradient(135deg, rgba(255,214,120,0.14), rgba(178,168,255,0.12));
  color: var(--color-moon-white, #eef2ff);
  font-size: 13px;
  letter-spacing: 1px;
  text-decoration: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all .3s ease;
  box-shadow: 0 0 0 rgba(255,214,120,0);
}
.nav-admin-entry:hover {
  transform: translateY(-1px);
  border-color: rgba(255,214,120,0.6);
  box-shadow: 0 0 16px rgba(255,214,120,0.28);
  color: #fff5d6;
}
.nav-admin-entry .nav-admin-icon { font-size: 14px; line-height: 1; }
.nav-admin-entry .nav-admin-text { line-height: 1; }
/* 移动端：导航展开时也保持一致视觉 */
@media (max-width: 720px) {
  .nav-admin-item { margin: 8px 0 0 0; }
  .nav-admin-entry { padding: 8px 16px; width: fit-content; }
}

/* -------- 后台 Tab 切换 -------- */
.admin-tabs {
  display: flex; gap: 10px;
  margin: 0 0 22px 0;
  flex-wrap: wrap;
}
.admin-tab-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(178,168,255,0.28);
  background: rgba(24,26,54,0.42);
  color: var(--color-text-soft, #c9d0f0);
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: inherit;
  transition: all .3s ease;
  backdrop-filter: blur(6px);
}
.admin-tab-btn:hover { color: #fff; border-color: rgba(178,168,255,0.55); }
.admin-tab-btn.active {
  background: linear-gradient(135deg, rgba(255,214,120,0.22), rgba(178,168,255,0.20));
  color: #fff;
  border-color: rgba(255,214,120,0.55);
  box-shadow: 0 0 12px rgba(255,214,120,0.24);
}
.admin-panel { display: none; }
.admin-panel.active { display: block; animation: adminFadeIn .4s ease both; }
@keyframes adminFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* -------- 流量统计：汇总卡片 -------- */
.stats-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.stats-toolbar label { color: var(--color-text-soft); font-size: 13px; letter-spacing: 1px; }
.stats-toolbar select,
.stats-toolbar button {
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(178,168,255,0.28);
  background: rgba(24,26,54,0.42);
  color: var(--color-moon-white, #eef2ff);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.stats-toolbar button:hover { border-color: rgba(255,214,120,0.55); color: #fff5d6; }

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stats-card {
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(28,30,60,0.65), rgba(20,22,48,0.55));
  border: 1px solid rgba(178,168,255,0.20);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.24);
}
.stats-card .k {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--color-text-soft, #a9b0d6);
  margin-bottom: 8px;
}
.stats-card .v {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-moon-white, #f2f5ff);
  letter-spacing: 1px;
  background: linear-gradient(135deg, #fff5d6, #b7c7ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stats-card .sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-text-soft, #a9b0d6);
}

/* -------- 流量统计：表格 -------- */
.stats-block { margin-bottom: 28px; }
.stats-block h3 {
  color: var(--color-moon-white, #eef2ff);
  font-size: 15px;
  letter-spacing: 2px;
  margin: 0 0 12px 0;
  padding-left: 10px;
  border-left: 3px solid rgba(255,214,120,0.6);
}
.stats-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(20,22,48,0.42);
  border: 1px solid rgba(178,168,255,0.18);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.stats-table th, .stats-table td {
  padding: 10px 14px;
  text-align: left;
  font-size: 13px;
  color: var(--color-text-soft, #c9d0f0);
  border-bottom: 1px solid rgba(178,168,255,0.10);
}
.stats-table th {
  color: var(--color-moon-white, #eef2ff);
  background: rgba(178,168,255,0.08);
  letter-spacing: 1px;
  font-weight: 600;
}
.stats-table tr:last-child td { border-bottom: none; }
.stats-table td.num { text-align: right; font-variant-numeric: tabular-nums; color: #fff5d6; }
.stats-table td.path { color: #b7c7ff; word-break: break-all; }
.stats-empty {
  text-align: center;
  color: var(--color-text-soft, #a9b0d6);
  padding: 24px 0;
  font-size: 13px;
  letter-spacing: 1px;
}
.stats-daily-group {
  margin-bottom: 18px;
  border-radius: 14px;
  background: rgba(20,22,48,0.36);
  border: 1px solid rgba(178,168,255,0.16);
  overflow: hidden;
}
.stats-daily-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(178,168,255,0.08);
  color: var(--color-moon-white, #eef2ff);
  font-size: 13px;
  letter-spacing: 1px;
}
.stats-daily-header .date { font-weight: 600; }
.stats-daily-header .totals span { margin-left: 14px; color: #fff5d6; }

@media (max-width: 720px) {
  .stats-table th, .stats-table td { padding: 8px 10px; font-size: 12px; }
  .stats-summary { grid-template-columns: repeat(2, 1fr); }
}
