/* ============================================================
   ziyue. 首页颜值精修层（home-polish.css）
   - 只做质感与细节，不改结构、文案、布局与配色基调
   - 全部作用域限定在 body.home-page，不影响其他页面
   - 放在所有样式表之后引入即可；删掉此文件即可完全还原
   ============================================================ */

.home-page {
  --polish-kaiti: "Kaiti SC", "STKaiti", "KaiTi", "KaiTi_GB2312", "DFKai-SB", "FZKai-Z03S", "Zhuque Fangsong", "Noto Serif SC", serif;
  --polish-song: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
  --polish-hair: rgba(139, 115, 85, 0.24);
  --polish-glow: rgba(139, 115, 85, 0.12);

  /* 全局告别呆板的微软雅黑，改用儒雅的思源宋体/宋体，诗句用楷体 */
  font-family: var(--polish-song);
  background-image: radial-gradient(ellipse 80% 60% at 58% 38%, #fcfbf8 0%, rgba(252, 251, 248, 0) 70%);
  background-attachment: fixed;
}
body.home-page.dark {
  background-image: radial-gradient(ellipse 70% 55% at 58% 38%, #202024 0%, rgba(32, 32, 36, 0) 70%);
}

/* ── 宣纸纤维肌理：极轻噪点，置于所有内容之下 ── */
.home-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.36 0 0 0 0 0.28 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.home-page.dark::before {
  opacity: 0.6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.96 0 0 0 0 0.9 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.home-page ::selection { background: rgba(139, 115, 85, 0.85); color: #fff; }

/* ── 墨点：由硬边灰点改为晕开的墨痕 ── */
.home-page #ink-canvas {
  filter: blur(3px) sepia(0.35);
  opacity: 0.6;
}
body.home-page.dark #ink-canvas {
  filter: blur(3px);
  opacity: 0.5;
}

/* ── 加载遮罩：字下加一道走笔细线 ── */
.home-page .loader { flex-direction: column; gap: 14px; }
.home-page .loader::after {
  content: '';
  width: 72px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform-origin: center;
  animation: polish-stroke 1.2s var(--ease-in-out) infinite alternate;
}
@keyframes polish-stroke {
  from { transform: scaleX(0.2); opacity: 0.3; }
  to { transform: scaleX(1); opacity: 1; }
}

/* ============================================================
   左侧导航
   ============================================================ */
.home-page .sidebar::after {
  content: '';
  position: absolute;
  top: 18%;
  bottom: 18%;
  right: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--polish-hair), transparent);
  opacity: 0.7;
  transition: opacity 0.5s var(--ease-out);
}
body.home-page.sidebar-collapsed .sidebar::after { opacity: 0; }

.home-page .logo {
  font-family: "Cormorant Garamond", "Palatino Linotype", "Book Antiqua", Georgia, var(--polish-song);
  font-size: 28px;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 2.5px;
  color: var(--text-light);
}
body.home-page.dark .logo { color: var(--text-dark); }
.home-page .logo a { display: inline-block; position: relative; }
.home-page .logo a::after { display: none; } /* 不继承导航下划线 */
.home-page .logo a:hover { opacity: 0.7; transform: none; }

.home-page .sidebar li { margin: 18px 0; }
.home-page .sidebar ul a {
  font-family: var(--polish-kaiti);
  font-size: 16.5px;
  font-weight: 400;
  padding: 2px 0;
  letter-spacing: 0.26em;
  color: #6a635b;
}
body.home-page.dark .sidebar ul a {
  color: #b4aea6;
}
.home-page .sidebar ul a.active {
  color: var(--text-light);
}
body.home-page.dark .sidebar ul a.active {
  color: #f0ece6;
}
.home-page .sidebar ul a::after {
  bottom: -3px;
  background: linear-gradient(90deg, var(--accent), rgba(139, 115, 85, 0));
}
.home-page .sidebar ul a.active::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--polish-glow);
}

/* 底部：日/夜 独占一行，登录 / 注册 并排，同用温润楷体 */
.home-page .sidebar-bottom {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 0;
  border-top: none;
  position: relative;
}
.home-page .sidebar-bottom::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--polish-hair), transparent);
}
.home-page .sidebar-bottom .theme-toggle-btn {
  font-family: var(--polish-kaiti);
  font-size: 13.5px;
  flex: 0 0 auto;
  margin-right: 100%;
  padding: 3px 13px 3px 10px;
  border: 1px solid rgba(139, 115, 85, 0.26);
  border-radius: 999px;
  letter-spacing: 0.14em;
  color: #6a635b;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
body.home-page.dark .sidebar-bottom .theme-toggle-btn {
  border-color: rgba(178, 151, 116, 0.28);
  color: #b8b2aa;
}
.home-page .sidebar-bottom .theme-toggle-btn:hover {
  border-color: var(--accent-light);
  color: var(--accent-light);
  background: var(--polish-glow);
}
.home-page .theme-toggle-btn svg { transition: transform 0.6s var(--ease-out); }
.home-page .theme-toggle-btn:hover svg { transform: rotate(-25deg); }

.home-page .sidebar-bottom a {
  font-family: var(--polish-kaiti);
  font-size: 14px;
  letter-spacing: 0.18em;
  color: #756e66;
}
body.home-page.dark .sidebar-bottom a {
  color: #aba59d;
}
.home-page .sidebar-bottom a:hover {
  color: var(--accent-light);
}
.home-page .sidebar-bottom .sidebar-register::before {
  content: '·';
  margin: 0 9px;
  color: var(--accent);
  opacity: 0.6;
}

/* 收起按钮：提高日间与夜间的清晰度与精致度 */
.home-page .sidebar-toggle {
  width: 26px;
  height: 26px;
  margin-top: -13px;
  border: 1px solid rgba(139, 115, 85, 0.32);
  border-radius: 50%;
  background: rgba(252, 250, 246, 0.85);
  color: #5c5349;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: Georgia, serif;
  font-size: 15px;
  line-height: 23px;
  text-align: center;
  left: 207px;
  opacity: 0.82;
  box-shadow: 0 2px 10px -2px rgba(60, 48, 34, 0.14);
  transition: opacity 0.3s, left 0.5s var(--ease-out), border-color 0.3s, color 0.3s, background 0.3s, transform 0.25s;
}
body.home-page.dark .sidebar-toggle {
  border-color: rgba(178, 151, 116, 0.42);
  background: rgba(38, 38, 43, 0.88);
  color: #dcd6ce;
  opacity: 0.88;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.home-page .sidebar-toggle:hover,
.home-page .sidebar-toggle:focus-visible {
  opacity: 1;
  border-color: var(--accent-light);
  color: var(--accent-light);
  transform: scale(1.08);
}
body.home-page.sidebar-collapsed .sidebar-toggle { left: 16px; }

/* ============================================================
   首屏
   ============================================================ */

/* 银铬图腾：背后一圈柔光 + 脚下一抹落影，让它“立”在纸上 */
.home-page .hero-mark { position: relative; }
.home-page .hero-mark::before {
  content: '';
  position: absolute;
  inset: -22%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.4) 35%, rgba(255, 255, 255, 0) 68%);
  pointer-events: none;
}
body.home-page.dark .hero-mark::before {
  background: radial-gradient(circle, rgba(160, 175, 195, 0.10) 0%, rgba(139, 115, 85, 0.05) 40%, rgba(0, 0, 0, 0) 68%);
}
.home-page .hero-mark::after {
  content: '';
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -4%;
  height: 7%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(70, 60, 48, 0.16) 0%, rgba(70, 60, 48, 0) 70%);
  filter: blur(4px);
  pointer-events: none;
}
body.home-page.dark .hero-mark::after {
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 70%);
}

/* Slogan：楷体题签，中点改为檀木色 */
.home-page .slogan {
  font-family: var(--polish-kaiti);
  font-size: 17.5px;
  gap: 12px;
  margin-bottom: 2.2rem;
  letter-spacing: 0;
}
.home-page .slogan .dot {
  color: var(--accent);
  opacity: 0.9;
  margin: 0 2px;
}

/* 诗句：楷体，上方一道渐隐细线，像信笺分隔 */
.home-page .poem {
  font-family: var(--polish-kaiti);
  font-size: 1.26rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  position: relative;
  padding-top: 1.4rem;
}
.home-page .poem::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 40px;
  height: 1px;
  margin-left: -20px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.55;
}

/* 底部署名：两行之间的细节 */
.home-page .hero-meta {
  font-family: var(--polish-kaiti);
  font-size: 13px;
  letter-spacing: 0.16em;
  gap: 3px;
}
.home-page .hero-meta span:first-child {
  font-family: Georgia, var(--polish-song);
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.2em;
  opacity: 0.82;
}

/* ============================================================
   提示与可达性
   ============================================================ */
.home-page #toast {
  padding: 10px 22px 10px 18px;
  border-radius: 999px;
  border-color: rgba(139, 115, 85, 0.18);
  background: rgba(252, 251, 248, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px -10px rgba(60, 48, 34, 0.22);
  letter-spacing: 0.1em;
}
.home-page #toast::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 10px 2px 0;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}
body.home-page.dark #toast {
  background: rgba(34, 34, 37, 0.82);
  border-color: rgba(160, 139, 110, 0.2);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}

.home-page a:focus-visible,
.home-page button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ============================================================
   手机端
   ============================================================ */
@media (max-width: 768px) {
  .home-page .mobile-menu-btn { opacity: 0.7; }

  .home-page .sidebar {
    background: rgba(248, 247, 244, 0.86);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
  body.home-page.dark .sidebar { background: rgba(24, 24, 27, 0.86); }
  .home-page .sidebar::after { display: none; }
  .home-page .sidebar ul a { font-size: 16px; }
  .home-page .sidebar li { margin: 20px 0; }
  .home-page .sidebar ul a.active::before { left: -14px; }

  .home-page .slogan { margin-bottom: 1.8rem; }
  .home-page .poem { padding-top: 1.2rem; letter-spacing: 0.12em; }
}

/* 尊重系统“减少动态效果” */
@media (prefers-reduced-motion: reduce) {
  .home-page .loader::after { animation: none; }
  .home-page .theme-toggle-btn svg { transition: none; }
}
