/*!
 * 星月夜 · 开屏动画与整体美术调性
 *
 * 这个文件在 hsad-theme.css 之后加载，只做两件事：
 *   1. 承载开屏动画的遮罩层（#intro）与主界面的入场
 *   2. 把整站的色彩调性向「夜的余温」靠拢——夜蓝墨色、星金色点缀、
 *      冷调羊皮纸底，以及更细的纸面颗粒
 *
 * 刻意不改的：布局结构、栅格、字号体系、头像与背景图本身
 */

/* ================================================================== */
/* 一、开屏动画                                                        */
/* ================================================================== */

#intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #04070d;
  overflow: hidden;
  /* 收尾时 JS 会逐帧写 opacity / transform，这里不要加 transition，否则会拖慢 */
  will-change: opacity, transform;
}

#intro-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.intro__hint {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  color: rgba(226, 236, 248, 0.34);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.34em;
  opacity: 0;
  pointer-events: none;
  animation: intro-hint-in 1.1s ease 1s forwards;
}

@keyframes intro-hint-in {
  to { opacity: 1; }
}

/* 定格之后：提示变成"点击进入"，轻轻呼吸，整层可点 */
#intro.intro--ready {
  cursor: pointer;
}

.intro__hint.is-ready {
  opacity: 1;
  color: rgba(255, 246, 210, 0.95);
  font-size: 0.82rem;
  letter-spacing: 0.42em;
  animation: intro-hint-pulse 2.4s ease-in-out infinite;
}

@keyframes intro-hint-pulse {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(-3px); }
}

/* 动画期间锁住滚动，避免用户先滚到下面再看到画面 */
html.intro-active,
html.intro-active body {
  overflow: hidden;
}

/* 幕布拉开时，主界面轻轻淡入（不再上浮，避免和幕布运动打架） */
html.intro-exit .site-shell {
  animation: shell-fade 0.7s ease both;
}

@keyframes shell-fade {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

/* 系统开了「减少动态效果」：不做动画，直接给界面 */
@media (prefers-reduced-motion: reduce) {
  #intro { display: none !important; }
  html.intro-done .site-shell { animation: none; }
  html.intro-active,
  html.intro-active body { overflow: auto; }
}

/* ================================================================== */
/* 二、色彩与质感                                                      */
/* ================================================================== */

:root {
  /* 底：冷调羊皮纸，比原来的暖米色更靠近夜色退去后的晨蓝 */
  --bg: #f4f6fa;
  --bg-soft: #fdfeff;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.92);

  /* 字：夜蓝墨色 */
  --text: #1d2b3c;
  --text-soft: #62748a;
  --line: rgba(38, 58, 82, 0.10);
  --line-strong: rgba(38, 58, 82, 0.18);

  /* 主色：更清透的群青蓝（原为灰蓝 #5c7793） */
  --accent: #3f6a97;
  --accent-soft: #dde7f2;
  --accent-strong: #22384f;

  /* 新增：星金与夜蓝，供细节点缀 */
  --star: #d9b365;
  --star-soft: rgba(217, 179, 101, 0.14);
  --night: #0b1f3a;
  --night-soft: rgba(11, 31, 58, 0.06);

  --shadow: 0 24px 60px rgba(22, 40, 62, 0.07);
}

/* 页面底色：左上角一点星金、右上角一点夜蓝，向下过渡到近白 */
body {
  background:
    radial-gradient(58rem 40rem at 82% -14%, rgba(41, 92, 143, 0.15), transparent 62%),
    radial-gradient(44rem 32rem at 4% 2%, rgba(217, 179, 101, 0.13), transparent 60%),
    linear-gradient(180deg, #f1f5fa 0%, #f8fafc 46%, #fdfeff 100%);
}

/* 纸面颗粒：极淡，只在空白处显形，不压字 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 原有的两团柔光改配色：一团夜蓝、一团星金 */
.page-aura--one {
  background: rgba(41, 92, 143, 0.22);
}

.page-aura--two {
  background: rgba(217, 179, 101, 0.20);
}

::selection {
  background: rgba(217, 179, 101, 0.34);
  color: var(--text);
}

/* ================================================================== */
/* 三、侧边栏：让动漫背景染上夜色，但图片本身不动                       */
/* ================================================================== */

.sidebar__overlay {
  background:
    linear-gradient(180deg, rgba(9, 24, 43, 0.42), rgba(5, 13, 24, 0.76)),
    linear-gradient(150deg, rgba(88, 138, 190, 0.20), rgba(217, 179, 101, 0.05));
}

.sidebar__backdrop {
  filter: blur(5px) saturate(0.86) brightness(0.94);
}

.sidebar__avatar {
  border-color: rgba(240, 246, 253, 0.8);
  box-shadow: 0 16px 32px rgba(6, 16, 30, 0.34);
}

.sidebar__title {
  color: #f6f9fd;
  text-shadow: 0 2px 18px rgba(6, 16, 30, 0.35);
}

.sidebar__subtitle {
  color: rgba(226, 237, 249, 0.82);
}

.sidebar__description {
  color: rgba(214, 228, 243, 0.68);
}

.sidebar__nav a,
.sidebar__social a {
  color: rgba(232, 241, 251, 0.84);
}

.sidebar__nav a:hover,
.sidebar__nav a.is-active,
.sidebar__social a:hover {
  color: #ffffff;
}

/* 当前页：左侧一道星金短线，呼应夜空里的星光 */
.sidebar__nav a.is-active {
  position: relative;
  text-shadow: 0 0 20px rgba(217, 179, 101, 0.35);
}

.sidebar__nav a.is-active::before {
  content: "";
  position: absolute;
  left: -0.72rem;
  top: 50%;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--star);
  box-shadow: 0 0 10px rgba(217, 179, 101, 0.75);
}

/* ================================================================== */
/* 四、正文与组件细节                                                  */
/* ================================================================== */

/* 阅读进度条：夜蓝 → 星金 */
.reading-progress__bar {
  background: linear-gradient(90deg, var(--accent), var(--star));
}

/* 小标签（来自DS 这类 eyebrow）：星金 + 细字距 */
.article__eyebrow {
  color: var(--star);
  letter-spacing: 0.12em;
  font-weight: 600;
}

/* 正文链接：默认淡蓝下划线，悬停转星金 */
.article__content a {
  color: var(--accent);
  text-decoration-color: rgba(63, 106, 151, 0.32);
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.article__content a:hover {
  color: #2d5880;
  text-decoration-color: rgba(217, 179, 101, 0.85);
}

/* 引用块：左侧一道星金 */
.article__content blockquote {
  border-left: 3px solid var(--star);
  background: linear-gradient(90deg, var(--star-soft), rgba(63, 106, 151, 0.05));
  color: #4a5c72;
}

/* 行内代码 */
.article__content code {
  background: rgba(34, 56, 79, 0.08);
  color: #2b4058;
}

/* 标题：夜蓝墨色，二级标题下面一点若有若无的暖线 */
.article__content h2 {
  position: relative;
  padding-bottom: 0.32rem;
}

.article__content h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.2rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--star), rgba(217, 179, 101, 0));
}

/* 文章列表卡片：悬停时浮起一点，左边的竖线是星金 */
.post-card {
  position: relative;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.post-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.4rem;
  bottom: 1.4rem;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--star), rgba(217, 179, 101, 0));
  opacity: 0;
  transition: opacity 0.22s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(22, 40, 62, 0.09);
}

.post-card:hover::before {
  opacity: 1;
}

/* 标签、分类的小圆片 */
.article__tag,
.tag-cloud__item,
.tax-row__count {
  border-color: rgba(63, 106, 151, 0.18);
}

.article__tag:hover,
.tag-cloud__item:hover {
  border-color: rgba(217, 179, 101, 0.55);
  background: var(--star-soft);
}

/* 页脚：上面一条极细的线，颜色偏夜蓝 */
.site-footer {
  border-top: 1px solid rgba(38, 58, 82, 0.08);
}

/* 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(63, 106, 151, 0.32) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(63, 106, 151, 0.28);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(63, 106, 151, 0.45);
  background-clip: content-box;
}
