/* 日夜开关（js/about-dayswitch.js，设计见 docs/个人页设计/14-日夜开关.md）：电脑版页眉正中的像素滑动开关；切换时弹到主界面正中。
   开关挂上了（html.ab-ds-on，about-dayswitch.js 加）才藏掉右上角原来的日 / 月按钮；手机版不加载开关，照旧用那个按钮 */
html.ab-ds-on #ab-theme-btn { display: none; }

.ab-ds {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 0;
  background: none;
  line-height: 0;
  cursor: var(--ab-cursor-hand, pointer);
}
.ab-ds.is-out { visibility: hidden; }
.ab-ds:focus-visible { outline: 2px dashed var(--ab-accent); outline-offset: 4px; border-radius: 14px; }

.ab-ds-sw { position: relative; }
/* 日月的光（在开关本体下面）：常规的柔光（.ab-ds-soft：日 / 月两层径向渐变，尺寸、颜色、位置、浓度由 js 设）+ 像素光芒（.ab-ds-glow 画布） */
.ab-ds-lights { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.ab-ds-soft { position: absolute; left: 0; top: 0; pointer-events: none; transform-origin: 50% 50%; }
.ab-ds-soft > div { position: absolute; inset: 0; }
.ab-ds-glow { position: absolute; image-rendering: pixelated; pointer-events: none; }
/* 胶囊浮起来的一层淡投影；圆角由 js 设（和滑块的圆角同心）。弹出来的大开关的投影 js 按比例放大，缩回页眉时正好等于这条 */
.ab-ds-body { position: relative; display: block; image-rendering: pixelated; box-shadow: 0 2px 6px rgba(40, 28, 20, 0.22), 0 0.5px 1px rgba(40, 28, 20, 0.2); }

/* 切换时：开关所在的层（在页眉之上，挡住点击）和模糊截图那层（在页眉之下、正文之上） */
.ab-ds-stage { position: fixed; inset: 0; z-index: 40; }
.ab-ds-stage .ab-ds-sw { position: absolute; transform-origin: 50% 50%; }
.ab-ds-veil { position: fixed; inset: 0; z-index: 23; pointer-events: none; overflow: hidden; }
.ab-ds-veil canvas { position: absolute; }

/* 只剩背景时：咖啡厅上那层纸色纱也淡掉 */
.ab-cafe.ab-ds-noveil::after { opacity: 0; }

/* 切换期间页眉这一行跟着滑块一起变到新主题：和滑块同时开始，时长、缓动和滑块的路径一样（0.8 秒、慢起慢停）。只这几个元素，开销很小。
   这里只过渡不继承的属性（背景、边框、阴影）。颜色 / 填充 / 描边这些会继承的由 dayswitch.js 用 Web Animations 显式地从旧值动到新值：
   用 CSS 过渡的话，外层（比如 .about-nav）的颜色一动，里面自己指定了颜色的元素（时钟、咖啡杯、纯享、锁）每帧都把自己的颜色过渡重开一次，
   缓动开头又慢，几乎不动、最后一下跳到终点（用户发现「右上角的按钮会被淡化、然后突然恢复」） */
html.ab-ds-theming .ab-bar,
html.ab-ds-theming .ab-bar *,
html.ab-ds-theming .ab-marks,
html.ab-ds-theming .ab-marks *,
html.ab-ds-theming .about-nav,
html.ab-ds-theming .about-nav * {
  --ab-ds-ease: cubic-bezier(0.65, 0, 0.35, 1);
  transition: background-color 0.8s var(--ab-ds-ease), border-color 0.8s var(--ab-ds-ease), box-shadow 0.8s var(--ab-ds-ease) !important;
}

/* 风铃（长按页眉里的开关变出来的，js/about-dayswitch.js 的 chimeOut / chimeBack）：挂在页眉底边下面，跟着页眉出现 / 收起 / 被分割段推走（和页眉同一套推法）。
   整个是一个 0×0 的挂点：swing 绕挂点摆（js 每帧写 rotate），里面线、铃（画布）、tail（绕铃口摆的短册）。只有铃和短册接收指针，其余不挡页面 */
.ab-chime { position: fixed; top: var(--ab-bar-h, 56px); left: 0; z-index: 24; width: 0; height: 0; translate: 0 calc(var(--ab-push, 0) * -25vh); transition: opacity 0.3s ease 0.26s; }
body:not(.ab-bar-on) .ab-chime, body.ab-solo .ab-chime { opacity: 0; transition: opacity 0.25s ease; }
body:not(.ab-bar-on) .ab-chime *, body.ab-solo .ab-chime *, body.ab-chrome-away .ab-chime * { pointer-events: none !important; }   /* 分割段展开时风铃跟着页眉被推走、淡掉（js 每帧抄 --ab-push、写 opacity），这期间不接收指针 */
.ab-chime-hook { position: absolute; left: -3.5px; top: -4px; width: 7px; height: 7px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid rgba(118, 92, 66, 0.85); }
.ab-chime-swing { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.ab-chime-cord, .ab-chime-thread { position: absolute; left: -0.5px; top: 0; width: 1px; background: rgba(118, 92, 66, 0.8); transform-origin: 50% 0; }
.ab-chime-bell { position: absolute; transform-origin: 50% 0; pointer-events: auto; cursor: grab; touch-action: none; }
.ab-chime-lens { position: absolute; border-radius: 50%; pointer-events: none; }
.ab-chime-halo { position: absolute; pointer-events: none; }   /* 透出来的光：铃外一圈 + 铃口漏下去的一锥（低分辨率画、放大，光本来就是糊的） */
.ab-chime-knot { position: absolute; left: -3px; width: 6px; height: 5.5px; border-radius: 48% 48% 52% 52%; background: radial-gradient(circle at 35% 30%, #b08c6a 0 20%, #6c4e36 64%); box-shadow: 0 0.5px 1px rgba(40, 26, 14, 0.35); pointer-events: none; }   /* 线穿过短册的孔打的结 */
.ab-chime-knot::before { content: ''; position: absolute; left: 50%; bottom: 100%; width: 1px; height: 3px; margin-left: -0.5px; background: rgba(118, 92, 66, 0.8); }
.ab-chime-knot::after { content: ''; position: absolute; left: 3.4px; top: 3.6px; width: 1.2px; height: 5.5px; border-radius: 1px; background: rgba(110, 84, 60, 0.85); transform: rotate(-30deg); transform-origin: 50% 0; }   /* 线头 */
.ab-chime-light { position: absolute; left: 0; right: 0; top: 0; bottom: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
html[data-theme='dark'] .ab-chime-light { background: linear-gradient(180deg, rgba(12, 16, 34, 0.24) 0, rgba(12, 16, 34, 0.3) 30%, rgba(12, 16, 34, 0.46) 100%); }   /* 夜里短册在暗处，只有上面被铃口的光照着 */
.ab-chime-light i { position: absolute; left: 50%; top: 0; width: 56px; height: 84px; margin: -42px 0 0 -28px; border-radius: 50%; opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.5), rgb(var(--lc, 255 244 214) / 0.42) 32%, rgb(var(--lc, 255 244 214) / 0.14) 66%, rgb(var(--lc, 255 244 214) / 0)); }   /* 厚玻璃的折射层（backdrop-filter 由 js 设：Chromium 用 SVG 位移滤镜，别的退回磨砂） */
.ab-chime-caus { position: absolute; left: 0; top: 0; width: 100%; height: 150px; pointer-events: none; }   /* 短册上的焦散：光透过玻璃落在纸上的那种亮纹（js 每帧画，低分辨率放大：本来就是柔的） */
.ab-chime-tail { position: absolute; left: 0; transform-origin: 0 0; }
.ab-chime-strip {   /* 短册：和纸（细的纤维）、顶上一道色带（按时间，抽到的签是朱红）+ 穿线的小孔、一圈细框、底下一枚小红印。固定长度，竖排 */
  position: absolute; left: 0; transform: translateX(-50%); transform-origin: 50% 0;
  writing-mode: vertical-rl; min-width: 30px; height: 236px; padding: 24px 6px 30px; box-sizing: border-box;   /* 外层挂点高度是 0，竖排必须给定高度，不然每个字自成一列 */
  font-family: var(--ab-hand); font-size: 13px; line-height: 1.65; letter-spacing: 0.1em; color: #45362a;
  --band: #9cbfdc;
  background:
    linear-gradient(180deg, var(--band) 0 12px, rgba(60, 40, 20, 0.08) 12px 13px, transparent 13px),
    repeating-linear-gradient(90deg, rgba(120, 90, 60, 0.035) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(0deg, rgba(120, 90, 60, 0.025) 0 1px, transparent 1px 7px),
    linear-gradient(90deg, #efe4cf, #fbf6ec 45%, #ede0c8);
  border-radius: 1px 1px 2px 2px;
  box-shadow: 0 5px 12px -4px rgba(40, 28, 20, 0.32), inset 0 0 0 1px rgba(150, 110, 70, 0.14);
  pointer-events: auto; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.ab-chime-strip[data-tone='dawn'] { --band: #e8aaa4; }
.ab-chime-strip[data-tone='dusk'] { --band: #e9a66c; }
.ab-chime-strip[data-tone='night'] { --band: #8e8cc4; }
.ab-chime-strip[data-tone='lamp'] { --band: #d98a5a; }   /* 夜樱点灯（咖啡厅夜里开灯）：灯笼橙 */
.ab-chime-strip[data-tone='rain'] { --band: #8fa4b8; }   /* 下雨：雨云的灰蓝 */
.ab-chime-strip[data-tone='rainnight'] { --band: #b08a7c; }   /* 雨夜：雨里晕开的灯色 */
.ab-chime-strip[data-tone='kuji'] { --band: #c8503a; }
.ab-chime-strip::before { content: ''; position: absolute; top: 3px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: rgba(70, 48, 32, 0.55); box-shadow: 0 0 0 1.5px rgba(255, 250, 240, 0.85); }   /* 穿线的孔 */
.ab-chime-strip::after { content: ''; position: absolute; top: 17px; right: 3px; bottom: 5px; left: 3px; border: 1px solid rgba(176, 72, 48, 0.28); border-radius: 1px; pointer-events: none; }   /* 一圈细框 */
.ab-chime-strip b { display: block; inline-size: max-content; color: #b8402c; font-size: 13px; letter-spacing: 0.24em; margin-left: 5px; margin-bottom: 4px; padding: 5px 1px 3px; border: 1.5px solid rgba(184, 64, 44, 0.82); border-radius: 3px; line-height: 1.4; }   /* 吉凶：朱红框，像盖的章 */
.ab-chime-strip span { display: block; }
.ab-chime-seal { position: absolute; bottom: 9px; left: 50%; width: 16px; height: 16px; margin-left: -8px; writing-mode: horizontal-tb; font-style: normal; font-size: 10px; line-height: 16px; letter-spacing: 0; text-align: center; color: #fff6ef; background: #c0452f; border-radius: 2px; transform: rotate(-8deg); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); opacity: 0.9; }   /* 底下的小红印 */
.ab-chime-bell:active, .ab-chime-strip:active { cursor: grabbing; }
.ab-chime-flash { position: absolute; left: -40px; width: 80px; height: 80px; margin-top: -40px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 68%); }

/* 大屏（about.css 末尾「大屏」）：页眉整体放大了，风铃挂在放大后的页眉下沿（风铃本身不放大：用户 2026-11-28「风铃不需要放大」） */
@supports (zoom: 1) {
  @media (min-width: 1760px) and (min-height: 924px) { .ab-chime { top: calc(var(--ab-bar-h, 56px) * var(--ab-zoom, 1)); } }
}
