/*!
 * home.css — 首页版式（点阵纸 + 立绘 + 便签卡片）
 * ------------------------------------------------------------------
 * 放在 source/css/home.css，由 _config.butterfly.yml 的 inject.head 引入。
 * 所有选择器都以 .yvh 开头，只作用于首页新版式；其他页面完全不受影响。
 * 亮暗跟随 Butterfly 的 html[data-theme]，不另建开关。
 *
 * ★ 顶栏：首页用 demo 那套自带顶栏（.yvh-topbar，LOGO 写 Yevirena），
 *   Butterfly 的 #nav / #page-header 在首页隐藏。不要把它们"合并"，
 *   两套顶栏叠在一起就是双导航。
 */

/* ============================================================
   0. 开关与层级
   ============================================================ */
/* 首页底色：与内页 --page-bg 同色，不再是一片纯白。
   之前这里写的是 var(--yvh-bg, #fff)，但 --yvh-bg 定义在 .yvh 上（body 的后代），
   body 自己取不到，于是一直回退成 #fff。 */
body.home-lock {
  --yvh-page-bg: #f4f8f5;
  overflow: hidden;
  background: var(--yvh-page-bg);
  transition: background-color .55s cubic-bezier(.4, 0, .2, 1);
}

/* 首页自带顶栏，把主题的两层顶部元素收掉 */
body.home-lock #nav,
body.home-lock #page-header { display: none !important; }

/* 主题右下角那组悬浮按钮（目录 / 评论 / 回到顶部 / 暗色）：
   首页锁一屏、不滚动，目录和回顶用不上，暗色开关已经做进顶栏，
   留着只会压在新版式上。不想要这条就整行删掉——
   删了也只是多个悬浮按钮，功能不坏。 */
body.home-lock #rightside { display: none !important; }

/* 归零：任何顶部留白都会把 100dvh 的版式顶下去，底部被裁掉
   （上线后如果页面整体下移了十几像素，先回来查这三行） */
body.home-lock #body-wrap { position: relative; z-index: 1; margin: 0; padding: 0; }
body.home-lock #content-inner { margin: 0; padding: 0; max-width: none; width: 100%; }

/* 旧的 dashboard 容器原本有 max-width / 内边距，新版式要通栏，摊平 */
body.home-lock .home-dashboard { max-width: none; width: 100%; margin: 0; padding: 0; }
/* 旧版首页 Stylus 在 body-wrap 和 dashboard 上铺了不透明的浅绿底，
   会把 z-index:0 的点阵画布整个遮住。新版首页只保留白纸底色。 */
body.home-lock #body-wrap,
body.home-lock #content-inner,
body.home-lock .home-dashboard {
  background: transparent !important;
}

/* canvas 由 JS 动态插入；这里再声明一次，防止内联样式被主题覆盖 */
#yvh-bg {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none; display: block;
}

/* 暗色那层"房间里有一盏灯"的暖光。
   渐变没法用 transition 补间，所以单独做成一层淡入淡出；
   和 body 底色同时走 0.55s，中间不会出现"底色已黑、暖光没跟上"。 */
body.home-lock::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(125% 95% at 26% 8%, #294234 0%, #1b2d24 45%, #142019 100%);
  opacity: 0;
  transition: opacity .55s cubic-bezier(.4, 0, .2, 1);
}
html[data-theme='dark'] body.home-lock::before { opacity: 1; }

/* ============================================================
   1. 配色变量（只挂在 .yvh 上，不污染全站）
   ============================================================ */
.yvh {
  --yvh-ink: #2d4038;
  --yvh-ink-soft: rgba(45, 64, 56, .8);
  --yvh-logo: #39765f;
  --yvh-menu: #2d4038;
  --yvh-note-bg: rgba(255, 255, 255, .92);
  --yvh-note-border: rgba(96, 145, 120, .06);
  --yvh-note-rule: rgba(96, 145, 120, .18);
  --yvh-note-shadow: 0 3px 10px rgba(57, 118, 95, .16), 0 12px 28px rgba(57, 118, 95, .08);
  --yvh-halo: rgba(168, 213, 194, .20);
  --yvh-ground: rgba(57, 118, 95, .20);

  font-family: var(--yvh-font-family);
  color: var(--yvh-ink);
}

html[data-theme='dark'] .yvh {
  --yvh-ink: #e4f0e9;
  --yvh-ink-soft: rgba(228, 240, 233, .72);
  --yvh-logo: #a8d5c2;
  --yvh-menu: #e4f0e9;
  --yvh-note-bg: rgba(34, 53, 44, .93);
  --yvh-note-border: rgba(168, 213, 194, .07);
  --yvh-note-rule: rgba(168, 213, 194, .16);
  --yvh-note-shadow: 0 3px 10px rgba(0, 0, 0, .42), 0 12px 28px rgba(0, 0, 0, .3);
  --yvh-halo: rgba(168, 213, 194, .10);
  --yvh-ground: rgba(0, 0, 0, .55);
}

html[data-theme='dark'] body.home-lock { --yvh-page-bg: #17251f; }

/* ============================================================
   2. 外壳：一屏一列（顶栏 + 舞台）
   ============================================================ */
.yvh {
  position: relative; z-index: 1;
  height: 100dvh;
  display: flex; flex-direction: column;
}

/* ============================================================
   3. 顶栏（=== 与 demo 完全一致，不要改 ===）
   LOGO 左、菜单居中占满剩余空间。
   ============================================================ */
.yvh-topbar {
  display: flex; align-items: center;
  padding: 16px 40px; gap: 30px;
  flex: none;
}
.yvh-logo {
  font-weight: 700; letter-spacing: .5px;
  color: var(--yvh-logo);
  transition: color .55s ease;
}
.yvh-menu {
  display: flex; gap: 34px; flex: 1; justify-content: center;
  /* 交叉轴居中：否则 flex 项被 stretch 撑满顶栏高度，
     a 的文字贴顶、「关于」按钮因 inline-flex 基线再多下沉几像素 */
  align-items: center;
}
.yvh-menu a {
  color: var(--yvh-menu); text-decoration: none;
  font-weight: 600; font-size: 15px;
  transition: color .55s ease;
}

/* ---- 顶栏右侧按钮组：音乐在左、暗色在右 ----
   内页是绝对定位（音乐 right:88 / 暗色 right:40），两者间距 8px；
   首页走 flex + gap 30px，会散开一截。这里补一个负边距，让两页观感一致。
   ★ 只给桌面。窄屏靠 .yvh-theme-btn 的 margin-left:auto 把按钮推到右边，
     这条 -22px 权重更高，会把三个按钮一起拽回左侧并互相压住。 */
@media (min-width: 881px) {
  .home-dashboard .yvh-music-mini + .yvh-theme-btn { margin-left: -22px; }
}

/* ---- 顶栏右侧的暗色开关 ----
   图标两枚都写在 DOM 里，靠 html[data-theme] 决定显示哪一枚：
   这样按钮状态不依赖 JS，pjax 重建、主题自己改属性都不会出现"图标没跟上"。
   亮的圆点是无障碍：触控区 40px，::focus-visible 给键盘用户一圈描边。 */
.yvh-theme-btn {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  background: none; border: 0; border-radius: 50%;
  color: var(--yvh-menu); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s ease, color .55s ease;
}
.yvh-theme-btn:hover { background: var(--yvh-halo); }
.yvh-theme-btn:focus-visible {
  outline: 2px solid var(--yvh-logo); outline-offset: 2px;
}
.yvh-theme-btn svg { width: 20px; height: 20px; display: block; stroke-width: 1.8; }
/* 默认（亮色）只出月亮，太阳藏起来 —— 用 display 而不是 opacity，
   避免两枚图标同时可点读为"两个按钮" */
.yvh-theme-btn .i-sun { display: none; }
html[data-theme='dark'] .yvh-theme-btn .i-moon { display: none; }
html[data-theme='dark'] .yvh-theme-btn .i-sun { display: block; }

/* 汉堡按钮 / 抽屉遮罩：桌面一律不出现，≤880 才启用 */
.yvh-menu-btn { display: none; }
.yvh-veil { display: none; }
/* 抽屉头部的作者信息：桌面不占位，宽屏菜单是一行纯链接 */
.yvh-user { display: none; }

/* ============================================================
   4. 舞台：左立绘 / 右卡片
   ============================================================ */
.yvh-stage {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  align-items: stretch;
  gap: clamp(18px, 3vw, 54px);
  padding: 0 clamp(22px, 4vw, 64px) clamp(18px, 3vh, 40px);
}

/* ---------------- 左侧立绘 ----------------
   用 max-width/max-height 双向约束 + object-fit:contain：
   横构图（现在的占位图）和竖构图（约稿交付后）都不用改这里。
   入场照搬 kashiwade.works：延迟 1s、1.5s、cubic-bezier(.7,0,.3,1)、上移 12px。
   用 both 而不是基础样式写 opacity:0 —— 万一动画失效，内容仍可见。 */
.yvh-char {
  position: relative; min-width: 0; margin: 0;
  display: flex; align-items: flex-end; justify-content: center;
  animation: yvh-mascot-in 1.5s cubic-bezier(.7, 0, .3, 1) 1s both;
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
}
.yvh-char img {
  position: relative; z-index: 1;
  display: block; width: auto; height: auto;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  user-select: none; -webkit-user-drag: none;
  pointer-events: none;            /* 右键直接穿透，菜单里没有"图片另存为" */
  filter: drop-shadow(0 14px 20px var(--yvh-ground));
  transition: filter .55s cubic-bezier(.4, 0, .2, 1);
}
/* 身后一圈极淡的光，让她不是"贴"在底上 */
.yvh-char::before {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  left: 50%; bottom: 2%; transform: translateX(-50%);
  width: min(94%, 660px); aspect-ratio: 1.55 / 1;
  background: radial-gradient(closest-side, var(--yvh-halo), transparent);
}

@keyframes yvh-mascot-in {
  0%   { opacity: 0; transform: translateY(-12px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes yvh-content-in {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---------------- 右栏：12 列栅格 ---------------- */
.yvh-col {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-content: center;
  gap: 16px;
  animation: yvh-content-in .9s ease-out .35s both;
}

/* ---------------- 纸面（便签卡片） ----------------
   4px 小圆角、米白/暗褐纸色、细描边、柔和投影。
   刻意不做大圆角——这一版就是为了避开"AI 白卡"的观感。 */
.yvh-note {
  background: var(--yvh-note-bg);
  border-radius: 4px;
  border: 1px solid var(--yvh-note-border);
  box-shadow: var(--yvh-note-shadow);
  padding: 16px 20px 20px;
  transition: background-color .55s cubic-bezier(.4, 0, .2, 1),
              border-color .55s cubic-bezier(.4, 0, .2, 1),
              box-shadow .55s cubic-bezier(.4, 0, .2, 1);
}

/* 卡片头：左边小标签，右边附注 */
.yvh-hd {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 10px;
}
.yvh-hd b {
  font-size: 10.5px; font-weight: 700; letter-spacing: .18em;
  color: var(--yvh-logo); transition: color .55s ease;
}
.yvh-hd span {
  font-size: 10.5px; letter-spacing: .06em;
  color: var(--yvh-ink-soft); transition: color .55s ease;
}

/* 栅格占位 */
.yvh-title { grid-column: span 12; padding: 22px 26px; }
.yvh-time  { grid-column: span 4; display: flex; flex-direction: column; }
.yvh-wx    { grid-column: span 8; }
.yvh-post  { grid-column: span 12; }

/* 大标题便签 */
.yvh-h1 {
  font-size: 30px; line-height: 1.2; font-weight: 700;
  color: var(--yvh-logo); margin: 0 0 8px;
  transition: color .55s ease;
}
.yvh-title p {
  font-size: 13px; line-height: 1.8; margin: 0;
  color: var(--yvh-ink-soft); transition: color .55s ease;
}

.yvh-time-progress { display: none; }

/* ---------------- 时间卡 ----------------
   站上的 #home-clock-time 是单节点 "HH:MM:SS"，整串一起排。
   等宽数字，秒跳时不抖宽。 */
.yvh-clockwrap { margin-top: auto; }
.yvh-clock {
  display: block;
  font-size: clamp(26px, 3.1vw, 36px); font-weight: 700; line-height: 1;
  letter-spacing: .01em; color: var(--yvh-logo);
  font-variant-numeric: tabular-nums;
  transition: color .55s ease;
}
.yvh-date {
  display: block; margin-top: auto; padding-top: 10px;
  font-size: 11.5px; letter-spacing: .05em;
  color: var(--yvh-ink-soft); transition: color .55s ease;
}

/* ---------------- 天气卡 ----------------
   节点全是站上现成的 id，只换排版。JS 注入的预报行是
   div.home-weather__day > span + strong，必须一并给样式。 */
.yvh-wx-now { display: flex; align-items: center; gap: 10px; }
.yvh-wx-icon {
  flex: none; font-size: 26px; line-height: 1;
  /* 站上天气图标是 emoji 文本，不是图片；大小在这里控 */
}
.yvh-wx-temp {
  font-size: clamp(24px, 2.8vw, 32px); font-weight: 700; line-height: 1;
  color: var(--yvh-logo); font-variant-numeric: tabular-nums;
  transition: color .55s ease;
}
.yvh-wx-cond {
  font-size: 13px; font-weight: 600; letter-spacing: .04em;
  color: var(--yvh-ink); transition: color .55s ease;
}
.yvh-wx-meta {
  margin-top: 7px; display: flex; gap: 14px;
  font-size: 10.5px; letter-spacing: .03em;
  color: var(--yvh-ink-soft); transition: color .55s ease;
}
.yvh-wx-meta strong { font-weight: 700; color: var(--yvh-ink); }
.yvh-wx-days {
  display: flex; gap: 4px; margin-top: 11px; padding-top: 10px;
  border-top: 1px dashed var(--yvh-note-rule);
  transition: border-color .55s ease;
}
.yvh-wx-hours { display: none; }
.yvh-wx-hour {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  color: var(--yvh-ink-soft);
}
.yvh-wx-hour-time,
.yvh-wx-hour small { font-size: 10px; letter-spacing: .02em; }
.yvh-wx-hour-icon { font-size: 18px; line-height: 1; }
.yvh-wx-hour strong {
  color: var(--yvh-ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.yvh-wx-hour small { min-height: 1.1em; color: var(--yvh-ink-soft); }
.home-weather__day {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--yvh-ink-soft); letter-spacing: .04em;
  text-align: center;
}
.home-weather__day strong {
  font-size: 11.5px; font-weight: 700;
  color: var(--yvh-ink); font-variant-numeric: tabular-nums;
}
/* 定位按钮：收成一行小字链接，不抢视觉 */
.yvh-wx-src {
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.55;
  letter-spacing: .02em;
  color: var(--yvh-ink-soft);
  opacity: .82;
}

.yvh-wx-btn {
  all: unset; cursor: pointer;
  display: inline-block; margin-top: 8px;
  font-size: 10.5px; letter-spacing: .04em;
  color: var(--yvh-ink-soft);
  border-bottom: 1px dashed var(--yvh-note-rule);
  transition: color .2s ease, border-color .2s ease;
}
.yvh-wx-btn:hover { color: var(--yvh-logo); border-color: var(--yvh-logo); }

/* ---------------- 最新文章（只放最新一篇） ---------------- */
.yvh-post-title {
  font-size: 17px; font-weight: 700; line-height: 1.45; letter-spacing: .01em;
  margin: 0 0 6px; transition: color .55s ease;
}
.yvh-post-title a {
  color: var(--yvh-ink); text-decoration: none;
  transition: color .2s ease;
}
.yvh-post-title a:hover { color: var(--yvh-logo); }
.yvh-post p {
  font-size: 12.5px; line-height: 1.85; margin: 0;
  color: var(--yvh-ink-soft);
}

/* ============================================================
   5. 矮屏 / 窄屏降级
   ============================================================ */
@media (max-height: 760px) {
  .yvh-stage { gap: 12px; }
  .yvh-note { padding: 13px 18px 15px; }
  .yvh-title { padding: 18px 22px; }
  .yvh-wx-days { margin-top: 9px; padding-top: 8px; }
}

@media (max-width: 1080px) and (min-width: 881px) {
  .yvh-time { grid-column: span 5; }
  .yvh-wx   { grid-column: span 7; }
}

/* ≤880：改上下堆叠，恢复滚动。一屏锁定必须在这一档解除，
   否则手机上内容会被裁掉。
   顶栏在这一档换成"LOGO + 右上角三条横线"，点横线从右侧滑出抽屉，
   和站上现有侧边栏的手感一致（菜单文字一项一行，点击后自动收起）。 */
@media (max-width: 880px) {
  body.home-lock { overflow: auto; }
  .yvh { height: auto; min-height: 100dvh; }

  /* ---- 顶栏：只剩 LOGO 和按钮 ---- */
  .yvh-topbar {
    padding: 12px 18px;
    gap: 0;
    flex-wrap: nowrap;
    align-items: center;
  }
  /* 暗色按钮靠右排，汉堡紧跟其后 —— margin-left:auto 只给前者，
     两个都给 auto 的话剩余空间会被对半分，按钮会飘到中间去 */
  .yvh-theme-btn {
    margin-left: auto; margin-right: 4px;
    width: 44px; height: 44px;      /* 触控下限，和汉堡对齐 */
    /* 抽屉打开后和 ✕ 一起浮在上面：抽屉里也能切暗色，不用先关掉 */
    position: relative; z-index: 61;
  }
  .yvh-menu-btn {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    margin-left: 6px;
    width: 44px; height: 44px; padding: 11px;   /* 44px 是触控下限 */
    background: none; border: 0; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    /* 抽屉滑出后按钮要浮在它上面，否则看不见也点不到那个叉 */
    position: relative; z-index: 61;
  }
  .yvh-menu-btn span {
    display: block; height: 1.8px; width: 100%;
    background: var(--yvh-menu); border-radius: 2px;
    transition: transform .28s cubic-bezier(.4, 0, .2, 1),
                opacity .18s ease,
                background-color .55s ease;
  }
  /* 打开时三条线并成叉，给一个"已打开"的反馈 */
  .yvh-menu-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .yvh-menu-btn.is-open span:nth-child(2) { opacity: 0; }
  .yvh-menu-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ---- 抽屉：从右侧滑出 ---- */
  .yvh-menu {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
    width: min(76vw, 300px);
    flex: none;
    flex-direction: column; justify-content: flex-start;
    align-items: stretch;                        /* 抽屉里恢复整行宽，边框和点击区才满宽 */
    gap: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 76px) 26px
             calc(env(safe-area-inset-bottom, 0px) + 26px);
    background: var(--yvh-note-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-left: 1px solid var(--yvh-note-border);
    box-shadow: -16px 0 36px rgba(24, 20, 16, .18);
    transform: translateX(100%);
    pointer-events: none;                        /* 关着的时候不挡点击 */
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  }
  .yvh-menu.is-open { transform: translateX(0); pointer-events: auto; }

  /* 抽屉头部：头像 + 作者名 */
  .yvh-user {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 14px; padding-bottom: 16px;
    border-bottom: 1px solid var(--yvh-note-border);
  }
  .yvh-avatar {
    width: 46px; height: 46px; flex: none;
    border-radius: 50%;
    object-fit: cover;
    background: var(--yvh-halo);
    border: 1px solid var(--yvh-note-border);
  }
  .yvh-username {
    font-size: 15px; font-weight: 700; letter-spacing: .02em;
    color: var(--yvh-logo);
    transition: color .55s ease;
  }

  .yvh-menu a {
    padding: 15px 2px;
    font-size: 16px;
    border-bottom: 1px solid var(--yvh-note-border);
  }
  .yvh-menu a:last-child { border-bottom: 0; }

  /* ---- 遮罩 ---- */
  .yvh-veil {
    display: block;
    position: fixed; inset: 0; z-index: 59;
    background: rgba(20, 16, 13, .42);
    opacity: 0; pointer-events: none;
    transition: opacity .3s ease;
  }
  .yvh-veil.is-open { opacity: 1; pointer-events: auto; }

  .yvh-stage {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 20px 40px;
  }
  .yvh-char { height: 40vh; min-height: 220px; }
  .yvh-col { grid-template-columns: 1fr; gap: 14px; }
  .yvh-col > * { grid-column: auto; }
}

/* ============================================================
   6. 尊重"减少动态效果"
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .yvh-char, .yvh-col { animation: none; opacity: 1; transform: none; }
  body.home-lock::before,
  .yvh-menu, .yvh-veil, .yvh-menu-btn span,
  .yvh-note, .yvh-char img, .yvh-logo, .yvh-menu a,
  .yvh-h1, .yvh-title p, .yvh-clock, .yvh-date,
  .yvh-wx-temp, .yvh-wx-cond, .yvh-wx-meta, .yvh-wx-days,
  .yvh-hd b, .yvh-hd span, .yvh-post-title, .yvh-username {
    transition: none !important;
  }
}

/* Responsive sizing: cards and type scale with the available viewport. */
.yvh-logo { font-size: clamp(14px, .95vw, 16px); }
.yvh-menu a { font-size: clamp(13px, .95vw, 15px); line-height: 1.5; }
/* 「关于」是 button，字号线高与菜单项完全看齐（原来写死 15px + 继承行高 2，
   窄屏时比兄弟项大一圈还偏移） */
.yvh-menu-group__toggle { line-height: 1.5; }
.yvh-stage { gap: clamp(16px, 2.4vw, 42px); }
.yvh-col { gap: clamp(10px, 1.15vw, 16px); }
.yvh-note {
  padding: clamp(12px, 1.1vw, 17px) clamp(14px, 1.45vw, 21px);
}
.yvh-title {
  padding: clamp(16px, 1.8vw, 24px) clamp(18px, 2vw, 28px);
}
.yvh-hd { margin-bottom: clamp(7px, .75vw, 10px); }
.yvh-hd b,
.yvh-hd span { font-size: clamp(10px, .74vw, 11.5px); }
.yvh-h1 { font-size: clamp(22px, 2vw, 30px); }
.yvh-title p { font-size: clamp(12px, .88vw, 13px); }
.yvh-clock { font-size: clamp(22px, 2.45vw, 36px); }
.yvh-date { font-size: clamp(10.5px, .78vw, 12px); }
.yvh-wx-icon { font-size: clamp(22px, 1.8vw, 26px); }
.yvh-wx-temp { font-size: clamp(24px, 2.25vw, 32px); }
.yvh-wx-cond { font-size: clamp(12px, .88vw, 13px); }
.yvh-wx-meta,
.yvh-wx-btn { font-size: clamp(10px, .74vw, 11.5px); }
.home-weather__day { font-size: clamp(10px, .74vw, 11.5px); }
.home-weather__day strong { font-size: clamp(10.5px, .8vw, 12px); }
.yvh-post-title { font-size: clamp(15px, 1.1vw, 17px); }
.yvh-post p { font-size: clamp(11.5px, .85vw, 12.5px); }

@media (max-width: 880px) {
  /* Mobile navigation opens the shared Butterfly drawer. */
  .yvh-menu { display: none !important; }
  .yvh-veil { display: none !important; }
  .yvh-stage {
    gap: clamp(12px, 3vw, 18px);
    padding: 0 clamp(14px, 4vw, 24px) 32px;
  }
  .yvh-char { height: clamp(220px, 40vh, 420px); min-height: 0; }
  .yvh-note { padding: clamp(13px, 3vw, 18px); }
  .yvh-title { padding: clamp(16px, 4vw, 22px); }
  .yvh-col { gap: clamp(10px, 2.8vw, 14px); }
}

@media (max-width: 520px) {
  .yvh-topbar { padding: 10px 14px; }
  .yvh-h1 { font-size: clamp(20px, 6vw, 26px); }
  .yvh-title p { font-size: clamp(12px, 3.5vw, 13px); }
  .yvh-clock { font-size: clamp(24px, 7vw, 32px); }
  .yvh-wx-temp { font-size: clamp(24px, 6.4vw, 30px); }
  .yvh-post-title { font-size: clamp(15px, 4.2vw, 17px); }
  .yvh-post p { font-size: clamp(11.5px, 3.2vw, 12.5px); }
  .yvh-wx-meta { gap: 10px; flex-wrap: wrap; }
}

@media (max-height: 760px) and (min-width: 881px) {
  .yvh-stage { gap: clamp(10px, 1.4vw, 18px); }
  .yvh-col { gap: clamp(8px, .8vw, 12px); }
  .yvh-note { padding: 11px clamp(13px, 1.25vw, 18px); }
  .yvh-title { padding: 15px clamp(16px, 1.6vw, 22px); }
  .yvh-h1 { font-size: clamp(21px, 1.8vw, 27px); }
  .yvh-clock { font-size: clamp(21px, 2.2vw, 32px); }
  .yvh-wx-days { margin-top: 7px; padding-top: 7px; }
}

@media (max-height: 620px) and (max-width: 880px) {
  .yvh-char { height: 32vh; }
  .yvh-stage { padding-bottom: 22px; }
}

/* The drawer control is reserved for compact screens. */
.yvh-menu-btn {
  display: none;
  flex: none;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 10px;
  color: var(--yvh-menu);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s ease;
}
.yvh-menu-btn:hover { background: var(--yvh-halo); }
.yvh-menu-btn:focus-visible {
  outline: 2px solid var(--yvh-logo);
  outline-offset: 2px;
}
.yvh-menu-btn span {
  display: block;
  width: 100%;
  height: 1.8px;
  background: var(--yvh-menu);
  border-radius: 2px;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), opacity .18s ease,
              background-color .55s ease;
}
.yvh-menu-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.yvh-menu-btn.is-open span:nth-child(2) { opacity: 0; }
.yvh-menu-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 880px) {
  .yvh-menu-btn { display: inline-flex; width: 44px; height: 44px; }
}

/* Add the deeper weather detail only when the viewport has room to use it. */
@media (min-width: 2200px) and (min-height: 1000px) {
  .yvh-time,
  .yvh-wx {
    min-height: clamp(300px, 28vh, 440px);
  }
  .yvh-clock { font-size: clamp(36px, 2.1vw, 50px); }
  .yvh-time-progress {
    display: grid;
    gap: clamp(9px, .8vh, 13px);
    margin-top: clamp(18px, 2.2vh, 32px);
  }
  .yvh-time-progress__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: clamp(12px, .72vw, 15px);
    color: var(--yvh-ink-soft);
  }
  .yvh-time-progress__item strong {
    color: var(--yvh-logo);
    font-size: clamp(14px, .9vw, 18px);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .yvh-date { font-size: clamp(12px, .72vw, 15px); }
  .yvh-wx { display: flex; flex-direction: column; }
  .yvh-wx-days { margin-top: 16px; }
  .yvh-wx-hours {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px dashed var(--yvh-note-rule);
  }
  .yvh-wx-hour-icon { font-size: 22px; }
  .yvh-wx-hour-time,
  .yvh-wx-hour small { font-size: clamp(10px, .62vw, 12px); }
  .yvh-wx-hour strong { font-size: clamp(13px, .82vw, 17px); }
}

/* Keep topbar controls reachable over the shared drawer. */
body.home-lock .yvh-topbar .yvh-theme-btn,
body.home-lock .yvh-topbar .yvh-menu-btn {
  z-index: 105;
}

/* Keep the home scrollbar within the existing sage palette. */
body.home-lock { --scrollbar-color: rgba(96, 145, 120, .38); }
html[data-theme='dark'] body.home-lock { --scrollbar-color: rgba(168, 213, 194, .38); }
html:has(body.home-lock) { --scrollbar-color: rgba(96, 145, 120, .38); }
html[data-theme='dark']:has(body.home-lock) { --scrollbar-color: rgba(168, 213, 194, .38); }

/* 首页导航里的悬停迷你播放器。 */
.yvh-music-mini {
  position: relative;
  z-index: 62;
  flex: none;
  width: 40px;
  height: 40px;
}
@media (hover: hover) and (pointer: fine) {
  .yvh-music-mini::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 119;
    width: min(340px, calc(100vw - 28px));
    height: 10px;
    pointer-events: auto;
  }
}
.yvh-music-mini__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--yvh-menu);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s ease, color .55s ease;
}
.yvh-music-mini__trigger:hover,
.yvh-music-mini__trigger:focus-visible { background: var(--yvh-halo); }
.yvh-music-mini__trigger:focus-visible { outline: 2px solid var(--yvh-logo); outline-offset: 2px; }
.yvh-music-mini__trigger svg { width: 20px; height: 20px; display: block; stroke-width: 1.8; }
.yvh-music-mini__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 120;
  box-sizing: border-box;
  width: min(340px, calc(100vw - 28px));
  padding: 16px;
  color: var(--yvh-ink);
  background: var(--yvh-note-bg);
  border: 1px solid var(--yvh-note-border);
  border-radius: 14px;
  box-shadow: var(--yvh-note-shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-7px) scale(.98);
  transform-origin: top right;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.yvh-music-mini:hover .yvh-music-mini__panel,
.yvh-music-mini:focus-within .yvh-music-mini__panel,
.yvh-music-mini.is-open .yvh-music-mini__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.yvh-music-mini__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--yvh-ink);
  font-size: .82rem;
}
.yvh-music-mini .home-music__cover { margin-bottom: 12px; }
.yvh-music-mini .home-music__track strong { color: var(--yvh-ink); }
.yvh-music-mini .home-music__track span,
.yvh-music-mini .home-music__status,
.yvh-music-mini .home-music__time,
.yvh-music-mini .home-music__message { color: var(--yvh-ink-soft); }
.yvh-music-mini .home-music__controls button { color: var(--yvh-menu); }
.yvh-music-mini .home-music__controls button:nth-child(2) { color: #fff; }
.yvh-music-mini .home-music__timeline { grid-template-columns: 34px minmax(0, 1fr) 34px; }
.yvh-music-mini .home-music__progress { accent-color: var(--yvh-logo); }
.yvh-music-mini .home-music__message { margin: 9px 0 0; }
.yvh-music-mini #home-music-cover { display: block; }
@media (max-width: 880px) {
  .yvh-music-mini { width: 44px; height: 44px; }
  .yvh-music-mini__trigger { width: 44px; height: 44px; }
  .yvh-music-mini__panel { right: -48px; }
}
@media (max-width: 360px) {
  .yvh-music-mini__panel { right: -48px; width: calc(100vw - 24px); }
}
/* Keep the seek bar directly interactive and visually consistent in both players. */
.home-music__progress {
  display: block;
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  touch-action: pan-y;
  -webkit-appearance: none;
  appearance: none;
}
.home-music__progress:focus-visible { outline: 2px solid var(--yvh-logo, #2e634f); outline-offset: 3px; }
.home-music__progress::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: rgba(104, 128, 86, .25); }
.home-music__progress::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4px; border: 2px solid var(--yvh-note-bg, #ffffff); border-radius: 50%; background: var(--yvh-logo, #39765f); box-shadow: 0 1px 4px rgba(30, 40, 28, .24); cursor: grab; -webkit-appearance: none; }
.home-music__progress:active::-webkit-slider-thumb { cursor: grabbing; }
.home-music__progress::-moz-range-track { height: 4px; border: 0; border-radius: 999px; background: rgba(104, 128, 86, .25); }
.home-music__progress::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--yvh-logo, #39765f); }
.home-music__progress::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid var(--yvh-note-bg, #ffffff); border-radius: 50%; background: var(--yvh-logo, #39765f); box-shadow: 0 1px 4px rgba(30, 40, 28, .24); cursor: grab; }

/* About submenu on the home header; compact screens use the shared drawer instead. */
.yvh-menu-group { position: relative; flex: none; display: flex; align-items: center; }
.yvh-menu-group__toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  color: var(--yvh-menu);
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: clamp(13px, .95vw, 15px);
  line-height: 1.5;
  cursor: pointer;
  transition: color .55s ease;
}
.yvh-menu-group__toggle:hover,
.yvh-menu-group__toggle:focus-visible { color: var(--yvh-logo); }
.yvh-menu-group__toggle:focus-visible { outline: 2px solid var(--yvh-logo); outline-offset: 5px; border-radius: 2px; }
.yvh-menu-group__chevron {
  display: block;
  flex: none;
  width: 12px;
  height: 12px;
  transition: transform .2s ease;
}
.yvh-menu-group.is-expanded .yvh-menu-group__chevron { transform: rotate(180deg); }
.yvh-menu-submenu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 100;
  display: none;
  min-width: 164px;
  padding: 7px;
  border: 1px solid var(--yvh-note-border);
  border-radius: 8px;
  background: var(--yvh-note-bg);
  box-shadow: var(--yvh-shadow, 0 8px 24px rgba(30, 40, 28, .16));
  transform: translate(-50%, 6px);
}
.yvh-menu-group:hover .yvh-menu-submenu,
.yvh-menu-group:focus-within .yvh-menu-submenu,
.yvh-menu-group.is-expanded .yvh-menu-submenu { display: grid; }
.yvh-menu-submenu a {
  display: block;
  padding: 9px 11px;
  border: 0;
  border-radius: 5px;
  color: var(--yvh-ink) !important;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.yvh-menu-submenu a:hover,
.yvh-menu-submenu a:focus-visible { color: var(--yvh-logo) !important; background: var(--yvh-halo); }
@media (max-width: 880px) {
  .yvh-menu-group { width: 100%; border-bottom: 1px solid var(--yvh-note-border); }
  .yvh-menu-group__toggle { justify-content: space-between; width: 100%; padding: 15px 2px; font-size: 16px; text-align: left; }
  .yvh-menu-submenu { position: static; min-width: 0; padding: 0 0 8px 12px; border: 0; border-radius: 0; background: transparent; box-shadow: none; transform: none; }
  .yvh-menu-submenu a { padding: 10px 2px; font-size: 14px; }
}

/* Keep the desktop About dropdown open while the pointer crosses its visual gap. */
@media (min-width: 881px) {
  .yvh-menu-group::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    z-index: 99;
    display: none;
    width: 164px;
    height: 18px;
    transform: translateX(-50%);
  }
  .yvh-menu-group:hover::after,
  .yvh-menu-group:focus-within::after,
  .yvh-menu-group.is-expanded::after {
    display: block;
  }
}
/* Keep the About submenu physically attached to its trigger. The old offset left
   a narrow hover gap where the menu vanished before the pointer could reach it. */
@media (min-width: 881px) {
  .yvh-menu-submenu {
    top: 100%;
    transform: translateX(-50%);
  }
  .yvh-menu-group::after { display: none !important; }
}
/* Ultra-wide viewports use a fade-only entrance. Stacking the theme's content
   rise with both dashboard entrances made the first paint feel like a zoom. */
@media (min-width: 2200px) and (min-height: 1000px) {
  body.home-lock #content-inner:has(.home-dashboard) {
    animation: none !important;
    transform: none !important;
  }
}
@media (min-width: 2200px) and (min-height: 1000px) {
  .home-dashboard .yvh-char,
  .home-dashboard .yvh-col {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   7. 窄屏顶栏：只留 LOGO + 汉堡（音乐 / 暗色开关收进抽屉）
   抽屉那一份在 inner-pages.css 的 #sidebar-menus 区块里，
   按钮只是"遥控器"，真正的播放器还在顶栏的 .yvh-music-mini 上。
   ============================================================ */
@media (max-width: 880px) {
  .yvh > .yvh-topbar > .yvh-music-mini,
  .yvh > .yvh-topbar > .yvh-theme-btn { display: none !important; }
  /* 顶栏只剩 LOGO 和汉堡：汉堡靠 auto 贴右，别再跟着左侧排 */
  .yvh > .yvh-topbar > .yvh-menu-btn { margin-left: auto !important; }
}
/* Rounded reference-card shapes, using the homepage's existing sage palette. */
.home-dashboard .yvh-col > .yvh-note {
  --yvh-card-shadow: #d6e7dd;
  --yvh-card-shadow-hover: #c8dfd1;
  border: 2px solid rgba(96, 145, 120, .2);
  border-radius: 23px;
  box-shadow: 5px 6px 0 var(--yvh-card-shadow);
}
.home-dashboard .yvh-col > .yvh-title {
  border-radius: 30px;
}
html[data-theme='dark'] .home-dashboard .yvh-col > .yvh-note {
  --yvh-card-shadow: #17291f;
  --yvh-card-shadow-hover: #2d4839;
  border-color: rgba(168, 213, 194, .2);
}
/* Home cards: reference-page reveal and hover motion, scoped to the dashboard. */
.home-dashboard .yvh-col {
  animation: none !important;
}
.home-dashboard .yvh-col > .yvh-note {
  transition: opacity .7s ease, translate .7s ease,
              transform .3s ease, box-shadow .3s ease,
              background-color .55s cubic-bezier(.4, 0, .2, 1),
              border-color .55s cubic-bezier(.4, 0, .2, 1);
}
.home-dashboard .yvh-note.yvh-card-reveal {
  opacity: 0;
  translate: 0 18px;
}
.home-dashboard .yvh-note.yvh-card-reveal.is-visible {
  opacity: 1;
  translate: 0 0;
}
@media (hover: hover) and (pointer: fine) {
  .home-dashboard .yvh-col > .yvh-note:hover {
    transform: translateY(-7px) rotate(-.5deg);
    box-shadow: 8px 12px 0 var(--yvh-card-shadow-hover);
  }
  .home-dashboard .yvh-col > .yvh-note:nth-child(even):hover {
    transform: translateY(-7px) rotate(.5deg);
  }
  [data-theme='dark'] .home-dashboard .yvh-col > .yvh-note:hover {
    box-shadow: 8px 12px 0 var(--yvh-card-shadow-hover);
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-dashboard .yvh-col > .yvh-note,
  .home-dashboard .yvh-note.yvh-card-reveal {
    opacity: 1;
    translate: none;
    transform: none !important;
    transition: none !important;
  }
}
/* Yevirena: white dress, soft mint hair and a small amber eye-colour accent. */
.home-dashboard {
  --home-card: #ffffff;
  --home-border: #d6e7dd;
  --home-text: #2d4038;
  --home-muted: #5d7569;
  --home-accent: #39765f;
  --home-accent-strong: #2e634f;
  --home-accent-soft: rgba(168, 213, 194, .2);
  --home-warm: #93672e;
}
.home-dashboard .yvh-col > .yvh-note {
  background: linear-gradient(145deg, #ffffff 0%, #ffffff 65%, #f0f7f3 100%);
}
.home-dashboard .yvh-post { border-top-color: rgba(231, 184, 117, .65); }
html[data-theme='dark'] .home-dashboard {
  --home-card: #22352c;
  --home-border: rgba(168, 213, 194, .2);
  --home-text: #e4f0e9;
  --home-muted: #b4cbbf;
  --home-accent: #a8d5c2;
  --home-accent-strong: #c4e5d6;
  --home-accent-soft: rgba(168, 213, 194, .12);
  --home-warm: #d9ac72;
}
html[data-theme='dark'] .home-dashboard .yvh-col > .yvh-note {
  background: linear-gradient(145deg, #22352c 0%, #22352c 65%, #263c31 100%);
}
html[data-theme='dark'] .home-dashboard .yvh-post { border-top-color: rgba(217, 172, 114, .6); }
html[data-theme='dark'] .home-dashboard .home-music__controls button:nth-child(2) { color: #17251f; }


/* Character stage and automatically rotating dialogue inside the title card. */
.home-dashboard .yvh-char { isolation: isolate; }
.home-dashboard .yvh-char .yvh-character-art {
  position: absolute; inset: auto 0 24px; margin: auto;
  width: 100%; height: calc(100% - 32px); max-width: 100%; max-height: none;
  object-fit: contain; object-position: 24% bottom;
  /* Alpha-based shadow follows any replacement transparent portrait automatically. */
  filter: drop-shadow(clamp(6px, 1.1vw, 16px) clamp(8px, 1.4vw, 20px) clamp(4px, .6vw, 9px) rgba(31, 66, 53, .28));
}
.home-dashboard .yvh-char::before {
  left: 43%; bottom: 10%; width: min(90%,640px); aspect-ratio: 1;
  background: radial-gradient(ellipse, rgba(168,213,194,.2), rgba(168,213,194,.05) 48%, transparent 70%);
}
.home-dashboard .yvh-char::after {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: 12%; right: 18%; top: auto; bottom: 4%; height: 15%;
  box-sizing: border-box; border: 2px solid rgba(57,118,95,.35); border-radius: 50%; background: #ffffff; transform: none;
  box-shadow: 0 10px 24px rgba(45,64,56,.16), 0 2px 0 rgba(57,118,95,.18);
}
.yvh-character-caption { position: absolute; bottom: 0; left: 0; right: 0; color: var(--yvh-ink-soft); font-size: 10px; text-align: center; letter-spacing: .12em; }
.home-dashboard .yvh-title__heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.home-dashboard .yvh-title__heading .yvh-h1 { min-width: 0; margin: 0; }
.yvh-dialogue-toggle { flex: none; border: 0; border-radius: 5px; padding: 3px 5px; color: var(--yvh-ink-soft); background: transparent; font: inherit; font-size: 10px; line-height: 1.4; cursor: pointer; }
.yvh-dialogue-toggle:hover { color: var(--yvh-logo); background: var(--yvh-halo); }
.yvh-dialogue-toggle:focus-visible { outline: 2px solid var(--yvh-logo); outline-offset: 3px; }
.yvh-typewriter { display: grid; margin-top: 10px; }
.home-dashboard .yvh-title p.yvh-dialogue__text,
.home-dashboard .yvh-title p.yvh-typewriter__sizer { grid-area: 1 / 1; min-height: 3.6em; margin: 0; font-size: clamp(12px,.88vw,13px); line-height: 1.8; overflow-wrap: anywhere; }
.yvh-typewriter__sizer { visibility: hidden; pointer-events: none; user-select: none; }
.yvh-dialogue__text::after { content: ''; display: inline-block; width: 1px; height: 1em; margin-left: 3px; vertical-align: -.12em; background: currentColor; opacity: .65; animation: yvh-typewriter-caret 1.1s step-end infinite; }
.yvh-title.is-dialogue-paused .yvh-dialogue__text::after { animation: none; opacity: .35; }
@keyframes yvh-typewriter-caret { 50% { opacity: 0; } }
html[data-theme='dark'] .home-dashboard .yvh-char::after { background: #090f0c; border-color: rgba(168,213,194,.42); box-shadow: 0 12px 28px rgba(0,0,0,.4), 0 2px 0 rgba(168,213,194,.12); }
html[data-theme='dark'] .home-dashboard .yvh-char .yvh-character-art { filter: drop-shadow(clamp(6px, 1.1vw, 16px) clamp(8px, 1.4vw, 20px) clamp(4px, .6vw, 9px) rgba(0, 0, 0, .48)); }
@media (max-width: 880px) {
  .home-dashboard .yvh-char { height: clamp(400px,65svh,620px); min-height: 0; margin-bottom: 12px; }
  .home-dashboard .yvh-char .yvh-character-art { height: calc(100% - 32px); object-position: 24% bottom; }
}
@media (max-width: 420px) { .home-dashboard .yvh-char { height: 440px; } }
@media (prefers-reduced-motion: reduce) { .yvh-dialogue__text::after { animation: none; } }

/* A character-led reading homepage: introduction, recent writing, quiet utilities. */
.home-editorial .yvh-stage {
  box-sizing: border-box; width: 100%; max-width: 1440px; margin-inline: auto;
  grid-template-columns: minmax(0,1fr) minmax(0,.98fr);
  gap: clamp(20px,3vw,44px); padding-inline: clamp(22px,3.5vw,56px);
  padding-bottom: clamp(20px,3vh,36px);
}
.home-editorial .yvh-col {
  display: flex; flex-direction: column; justify-content: center;
  gap: clamp(12px,1.5vh,20px); min-width: 0; padding-block: 8px;
}
.home-editorial .yvh-col > * { flex: none; min-width: 0; }
.home-editorial .yvh-char .yvh-character-art {
  bottom: 18px; height: calc(100% - 20px); object-position: 70% bottom;
}
.home-editorial .yvh-char::before { left: 54%; bottom: 9%; width: 86%; }
.home-editorial .yvh-char::after {
  left: 34%; right: 20%; bottom: 3.8%; height: clamp(24px,7.5%,58px);
  border-width: 1.5px; box-shadow: 0 7px 16px rgba(45,64,56,.12);
}
.home-editorial .yvh-character-caption { left: 12%; font-size: 9px; }
.home-editorial .yvh-reading { padding: 20px 24px 8px; border-top-color: rgba(231,184,117,.6); }
.yvh-reading__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 0 0 12px; }
.yvh-reading__heading h2 { margin: 0; color: var(--yvh-logo); font-size: 15px; font-weight: 700; line-height: 1.5; }
.yvh-reading__heading > a { display: inline-flex; align-items: center; gap: 7px; flex: none; color: var(--yvh-ink-soft); font-size: 11px; text-decoration: none; }
.yvh-reading__heading > a:hover { color: var(--yvh-logo); }
.yvh-reading-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; color: var(--yvh-ink); text-decoration: none; }
.yvh-reading-item + .yvh-reading-item { border-top: 1px solid var(--yvh-note-rule); }
.yvh-reading-item__body { min-width: 0; }
.yvh-reading-item__meta { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; color: var(--yvh-ink-soft); font-size: 10px; line-height: 1.5; }
.yvh-reading-item__meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yvh-reading-item__meta span::before { content: '·'; margin-right: 10px; }
.yvh-reading-item h3 { overflow: hidden; margin: 0; color: var(--yvh-ink); font-size: clamp(14px,1.15vw,17px); font-weight: 600; line-height: 1.6; text-overflow: ellipsis; white-space: nowrap; transition: color .2s; }
.yvh-reading-item p { overflow: hidden; margin: 4px 0 0; color: var(--yvh-ink-soft); font-size: 11.5px; line-height: 1.7; text-overflow: ellipsis; white-space: nowrap; }
.yvh-reading-item__arrow { flex: none; color: var(--yvh-logo); font-size: 17px; opacity: .55; transition: transform .2s, opacity .2s; }
.yvh-reading-item__meta, .yvh-reading-item p { transition: color .2s ease; }
.yvh-reading-item:is(:hover,:focus-visible) :is(h3,.yvh-reading-item__meta,p) { color: var(--yvh-logo); }
@media(prefers-reduced-motion:reduce) {
  .yvh-reading-item__meta, .yvh-reading-item p { transition: none; }
}
.yvh-reading-item:hover .yvh-reading-item__arrow { opacity: 1; transform: translate(2px,-2px); }
.yvh-reading-item:focus-visible, .yvh-reading__heading > a:focus-visible { outline: 2px solid var(--yvh-logo); outline-offset: 4px; border-radius: 4px; }
.yvh-reading__empty { padding: 16px 0; color: var(--yvh-ink-soft); font-size: 13px; }
.home-editorial .yvh-utility { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 18px; padding: 15px 20px; border-radius: 20px; }
.home-editorial .yvh-utility .yvh-time,
.home-editorial .yvh-utility .yvh-wx { display: flex; flex-direction: column; justify-content: center; gap: 5px; grid-column: auto; min-height: 0; min-width: 0; }
.home-editorial .yvh-utility .yvh-wx { border-left: 1px solid var(--yvh-note-rule); padding-left: 18px; }
.yvh-utility__time-heading { display: flex; align-items: baseline; gap: 10px; }
.yvh-utility__label { color: var(--yvh-ink-soft); font-size: 10px; }
.home-editorial .yvh-utility .yvh-clock { font-size: 20px; line-height: 1.3; }
.home-editorial .yvh-utility .yvh-date { margin: 0; padding: 0; font-size: 10px; letter-spacing: .02em; line-height: 1.5; }
.home-editorial .yvh-utility .yvh-wx-now { gap: 7px; min-height: 26px; }
.home-editorial .yvh-utility .yvh-wx-icon { font-size: 20px; }
.home-editorial .yvh-utility .yvh-wx-temp { font-size: 21px; }
.home-editorial .yvh-utility .yvh-wx-cond { overflow: hidden; font-size: 11px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.yvh-utility__weather-footer { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.yvh-utility__location { overflow: hidden; color: var(--yvh-ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.home-editorial .yvh-utility .yvh-wx-btn { flex: none; margin: 0; font-size: 9px; }
html[data-theme='dark'] .home-editorial .yvh-char::after { box-shadow: 0 7px 18px rgba(0,0,0,.3); }
@media (max-height: 780px) and (min-width: 881px) {
  .home-editorial .yvh-reading { padding: 16px 20px 5px; }
  .home-editorial .yvh-reading__heading { padding-bottom: 6px; }
  .home-editorial .yvh-reading-item { padding: 10px 0; }
  .home-editorial .yvh-reading-item p { display: none; }
  .home-editorial .yvh-utility { padding: 12px 18px; }
}
@media (max-width: 880px) {
  .home-editorial .yvh-stage { grid-template-columns: minmax(0,1fr); max-width: 680px; gap: 18px; padding-inline: 20px; padding-bottom: 36px; }
  .home-editorial .yvh-col { padding: 0; gap: 16px; }
  .home-editorial .yvh-char { height: clamp(360px,57svh,500px); margin-bottom: 0; }
  .home-editorial .yvh-char .yvh-character-art { object-position: 50% bottom; }
  .home-editorial .yvh-char::after { left: 28%; right: 28%; }
  .home-editorial .yvh-character-caption { left: 0; }
  .home-editorial .yvh-reading { padding: 20px 20px 6px; }
  .home-editorial .yvh-reading-item h3 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (max-width: 420px) {
  .home-editorial .yvh-utility { gap: 12px; padding: 13px 14px; }
  .home-editorial .yvh-utility .yvh-wx { padding-left: 12px; }
  .home-editorial .yvh-utility .yvh-clock { font-size: 17px; }
  .home-editorial .yvh-utility .yvh-wx-cond { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .yvh-reading-item__arrow { transition: none; } }

/* Enlarge the existing full-body asset into a waist-up editorial portrait. */
.home-editorial .yvh-char {
  height: min(100%,680px); min-height: 0; align-self: center;
  overflow: hidden; border-radius: 28px;
}
.home-editorial .yvh-char .yvh-character-art {
  inset: 0 auto auto 50%; margin: 0; transform: translateX(-50%);
  width: auto; height: 190%; max-width: none; max-height: none;
  object-fit: contain; object-position: center top;
  mask-image: linear-gradient(to bottom,#000 0%,#000 83%,transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom,#000 0%,#000 83%,transparent 100%);
}
.home-editorial .yvh-char::before { left: 50%; bottom: 0; width: 110%; }
.home-editorial .yvh-char::after {
  left: 50%; right: auto; top: auto; bottom: -7%; transform: translateX(-50%);
  width: 92%; height: auto; aspect-ratio: 1;
  border-radius: 50%; border-width: 1.5px;
}
.home-editorial .yvh-character-caption { left: 0; bottom: 8px; z-index: 2; }
@media (max-width: 880px) {
  .home-editorial .yvh-char { height: clamp(350px,55svh,480px); width: 100%; margin: 0; }
  .home-editorial .yvh-char .yvh-character-art { height: 190%; }
  .home-editorial .yvh-char::after { left: 50%; right: auto; width: 92%; }
}

/* The waist-up illustration meets the bottom edge of the desktop viewport. */
@media (min-width: 881px) {
  .home-editorial .yvh-char {
    height: calc(100% + clamp(20px,3vh,36px)); align-self: stretch;
    margin-bottom: calc(-1 * clamp(20px,3vh,36px)); border-radius: 0;
    animation: none; opacity: 1; transform: none;
  }
  .home-editorial .yvh-char .yvh-character-art {
    mask-image: none; -webkit-mask-image: none;
  }
  .home-editorial .yvh-char::after { bottom: -15%; }
  .home-editorial .yvh-character-caption { display: none; }
}

/* Keep the attached portrait steady during page entry and give it room on wide displays. */
body.home-lock #content-inner:has(.home-editorial) {
  animation: none !important; transform: none !important;
}
@media (min-width: 881px) {
  .home-editorial .yvh-stage {
    max-width: 1840px;
    grid-template-columns: minmax(0,1fr) minmax(0,min(48%,640px));
  }
}
/* Remove the legacy theme's 54px dashboard footer space, which allowed a stale scroll offset. */
@media (min-width: 881px) {
  body.home-lock #content-inner > .home-editorial { padding: 0 !important; min-height: 0 !important; }
  body.home-lock #content-inner { height: 100dvh; min-height: 0 !important; }
  html:has(body.home-lock) { overflow: hidden; }
}
/* Runtime framing uses the replacement artwork's own dimensions and alpha bounds. */
.home-editorial .yvh-char .yvh-character-art[data-auto-portrait] {
  inset: auto; top: 0; left: 0; width: 100%; height: auto; margin: 0;
  max-width: none; max-height: none; transform: none;
  mask-image: none; -webkit-mask-image: none; visibility: hidden;
}
.home-editorial .yvh-char .yvh-character-art.is-portrait-ready { visibility: visible; }
@media (max-width: 880px) {
  .home-editorial .yvh-char { border-radius: 0; }
  .home-editorial .yvh-character-caption { display: none; }
}

/* Cursor parallax moves the artwork and its alpha shadow together, without moving its frame. */
.home-editorial .yvh-char .yvh-character-art[data-auto-portrait] {
  translate: var(--portrait-parallax-x, 0px) var(--portrait-parallax-y, 0px);
}
.home-editorial .yvh-character-art.is-portrait-tracking { will-change: translate; }
@media (prefers-reduced-motion: reduce), (hover: none), (pointer: coarse) {
  .home-editorial .yvh-char .yvh-character-art[data-auto-portrait] { translate: none; }
}

/* On narrow screens the portrait emerges directly from behind the title card. */
@media (max-width: 880px) {
  body.home-lock #content-inner > .home-editorial { padding: 0 !important; min-height: 0 !important; }
  .home-editorial .yvh-stage { padding-bottom: 36px; row-gap: 0; }
  .home-editorial .yvh-col { order: 0; position: relative; z-index: 1; }
  .home-editorial .yvh-char {
    order: -1; align-self: end; z-index: 0;
    width: calc(100% + 40px); height: clamp(320px,95vw,520px);
    margin: 0 -20px -12px; padding: 0; border: 0; border-radius: 0;
    animation: none; opacity: 1; transform: none;
  }
  .home-editorial .yvh-char::after { bottom: -18%; }
}
/* The circle shares the auto portrait's measured scale, including short/wide windows. */
.home-editorial .yvh-char::after {
  box-sizing: border-box;
  left: var(--portrait-disc-left,50%); right: auto; top: auto;
  bottom: var(--portrait-disc-bottom,0px);
  width: var(--portrait-disc-size,0px); height: var(--portrait-disc-size,0px);
  aspect-ratio: auto; transform: translateX(-50%);
}

/* A washed mint face close-up; its source and crop follow the foreground artwork. */
.home-dashboard.home-editorial .yvh-char::after,
html[data-theme='dark'] .home-dashboard.home-editorial .yvh-char::after {
  --portrait-face-wash: rgba(201, 224, 207, .84);
  background-color: #c9e0cf;
  background-image: linear-gradient(var(--portrait-face-wash), var(--portrait-face-wash)), var(--portrait-face-image, none);
  background-size: 100% 100%, var(--portrait-face-size, auto);
  background-position: center, var(--portrait-face-position, center);
  background-repeat: no-repeat;
  border-color: rgba(74, 116, 95, .23);
}
html[data-theme='dark'] .home-dashboard.home-editorial .yvh-char::after {
  --portrait-face-wash: rgba(32, 53, 47, .86);
  background-color: #20352f;
  border-color: rgba(182, 205, 191, .24);
}

/* Restore the original mascot entrance on the artwork, leaving its crop frame fixed. */
.home-editorial .yvh-char .yvh-character-art.is-portrait-ready {
  animation: yvh-mascot-in 1.5s cubic-bezier(.7,0,.3,1) 1s both;
}
.home-editorial .yvh-char[data-portrait-ready='true']::after {
  animation: yvh-portrait-disc-in 1.5s cubic-bezier(.7,0,.3,1) 1s both;
}
@keyframes yvh-portrait-disc-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .home-editorial .yvh-char .yvh-character-art.is-portrait-ready,
  .home-editorial .yvh-char[data-portrait-ready='true']::after {
    animation: none !important; opacity: 1;
  }
}

/* Narrow homepage: portrait and introduction fill the first viewport together. */
@media (max-width: 880px) {
  .home-editorial .yvh-stage { align-content: start; }
  .home-editorial .yvh-char {
    height: max(0px, calc(100dvh - 80px - var(--home-title-height, 180px) + 4px));
    min-height: 0;
  }
}
