/* ==========================================================================
   博客样式表
   --------------------------------------------------------------------------
   目录
     0  变量与基础
     1  壁纸
     2  菜单栏
     3  锁屏
     4  桌面与小组件
     5  Dock
     6  首页的文章区
     7  内页通用
     8  文章排版
     9  代码块与语法高亮
     10 文章列表 / 标签 / 友链 / 相册
     11 弹窗：工具箱、小游戏、搜索、设置
     12 页脚
     13 动画
     14 响应式（窄屏适配）

   想换配色：改第 0 节里的变量。壁纸见第 1 节（默认是梵高《星月夜》，另有四张手画的备选）。
   ========================================================================== */


/* ==========================================================================
   0. 变量与基础
   ========================================================================== */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;

  /* 强调色：梵高黄（《星月夜》里月亮和星星的颜色） */
  --accent: #f7cf47;          /* 壁纸、深色玻璃上的强调色 */
  --on-accent: #1a2352;       /* 黄色底上配的文字 */
  --accent-text: #f7cf47;     /* 链接和按钮（深色外观下） */
  --on-accent-text: #1a2352;  /* 按钮上的文字 */
  --accent-bar: #f7cf47;      /* 标题旁边的装饰竖条 */
  --accent-soft: #f7cf47;     /* 深色玻璃弹窗里的强调色，不随外观变 */
  --focus: #f7cf47;           /* 用键盘操作时的聚焦描边 */

  /* 玻璃材质（壁纸上的卡片、Dock、弹窗） */
  /* 一层淡淡的白 + 一层暗色：这样不管壁纸哪里亮，白字都看得清 */
  --glass: linear-gradient(155deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04)), linear-gradient(155deg, rgba(10, 16, 48, .52), rgba(10, 16, 48, .62));
  --glass-hover: linear-gradient(155deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .08)), linear-gradient(155deg, rgba(10, 16, 48, .40), rgba(10, 16, 48, .52));
  --glass-line: rgba(255, 255, 255, .28);
  --glass-top: rgba(255, 255, 255, .55);
  --glass-shadow: 0 14px 40px rgba(0, 0, 0, .24), 0 2px 8px rgba(0, 0, 0, .12);
  --glass-blur: 26px;

  /* 壁纸上的文字 */
  --ink: #fff;
  --ink-2: rgba(255, 255, 255, .82);
  --ink-3: rgba(255, 255, 255, .70);
  --ink-4: rgba(255, 255, 255, .30);
  --ink-line: rgba(255, 255, 255, .16);
  --ink-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 14px rgba(0, 0, 0, .28);

  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* 内页的“纸张”配色：浅色 / 深色两套 */
html[data-theme="light"] {
  --frost: linear-gradient(180deg, rgba(248, 249, 252, .84), rgba(243, 246, 251, .92));
  --surface: rgba(255, 255, 255, .86);
  --surface-2: rgba(20, 22, 40, .05);
  --surface-3: rgba(20, 22, 40, .09);
  --text: #15171f;
  --text-2: #464b5a;
  --text-3: #6b7183;
  --accent-text: #2453a4;      /* 浅色纸面上的链接和按钮：群青蓝 */
  --on-accent-text: #ffffff;
  --accent-bar: #c7951b;      /* 浅色纸面上的黄色装饰条要深一点才看得清 */
  --focus: #2453a4;
  --line: rgba(20, 22, 40, .10);
  --line-strong: rgba(255, 255, 255, .90);
  --paper-shadow: 0 24px 70px rgba(16, 14, 40, .16), 0 2px 8px rgba(16, 14, 40, .06);
  --bar-bg: rgba(255, 255, 255, .62);
  --bar-line: rgba(20, 22, 40, .08);
  --code-inline: rgba(36, 83, 164, .10);
  --code-ink: #2b4ea3;
  --code-bg: #15182b;
  --code-line: rgba(255, 255, 255, .08);
  --code-muted: rgba(255, 255, 255, .42);
  --code-text: #e8eaf4;
  color-scheme: light;
}
html[data-theme="dark"] {
  --frost: linear-gradient(180deg, rgba(9, 12, 30, .80), rgba(6, 9, 24, .90));
  --surface: rgba(22, 24, 37, .86);
  --surface-2: rgba(255, 255, 255, .06);
  --surface-3: rgba(255, 255, 255, .11);
  --text: #eef0f6;
  --text-2: #b4bac9;
  --text-3: #9aa1b3;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .10);
  --paper-shadow: 0 24px 70px rgba(0, 0, 0, .40), 0 2px 8px rgba(0, 0, 0, .20);
  --bar-bg: rgba(16, 17, 28, .60);
  --bar-line: rgba(255, 255, 255, .08);
  --code-inline: rgba(247, 207, 71, .15);
  --code-ink: #f7d76c;
  --code-bg: #0b0e20;
  --code-line: rgba(255, 255, 255, .08);
  --code-muted: rgba(255, 255, 255, .42);
  --code-text: #e8eaf4;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: rgba(255, 255, 255, .35) transparent;
}
html[data-theme="light"]:not([data-view="home"]) { scrollbar-color: rgba(20, 22, 40, .30) transparent; }

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: #10214f;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body:not([class*="layout-home"]) { color: var(--text); }

body.is-locked { overflow: hidden; }
body.no-scroll { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ol, ul { padding: 0; }
[hidden] { display: none !important; }

::selection { background: rgba(247, 207, 71, .45); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 通用小图标：<svg class="icon"><use href="#i-xxx"/></svg> */
.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* 图标按钮（菜单栏、弹窗标题栏上的圆按钮） */
.btn-icon {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  color: inherit; transition: background .2s var(--ease), transform .2s var(--ease);
}
.btn-icon:hover { background: rgba(255, 255, 255, .14); }
html[data-theme="light"]:not([data-view="home"]) .bar .btn-icon:hover { background: rgba(20, 22, 40, .08); }
.btn-icon:active { transform: scale(.92); }

.skip {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  padding: 8px 14px; border-radius: 10px;
  background: var(--accent-text); color: var(--on-accent-text); font-weight: 600;
  transition: top .2s var(--ease);
}
.skip:focus { top: 12px; }

/* 内页：磨砂层，让壁纸变成淡淡的底色 */
.frost {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: var(--frost);
  -webkit-backdrop-filter: blur(26px) saturate(115%);
  backdrop-filter: blur(26px) saturate(115%);
  opacity: 0; transition: opacity .5s var(--ease);
}
html:not([data-view="home"]) .frost { opacity: 1; }


/* ==========================================================================
   1. 壁纸
   默认壁纸是梵高《星月夜》（一张图片，见下方 .wall-picture）。
   另外备选四张用代码画的“残阳远山”，下面这些变量是给它们用的：
   sky-1…5 是天空从上到下的颜色，sun / glow 是太阳和光晕，m1…m3 是从远到近的三层山，mist 是山间雾气。
   ========================================================================== */
html[data-wall="dusk"],
html:not([data-wall]) {
  --sky-1: #05081a; --sky-2: #101a3e; --sky-3: #2c2452; --sky-4: #6e3050; --sky-5: #d8623f;
  --glow: #ff7a45; --sun-core: #ffe0b0; --sun: #ff4d2e;
  --m1: #4a2f66; --m2: #201640; --m3: #0a0818; --mist: #ffb48a;
}
html[data-wall="ocean"] {
  --sky-1: #020a14; --sky-2: #05283c; --sky-3: #075068; --sky-4: #0b7f8c; --sky-5: #3cbcb4;
  --glow: #7fe9ff; --sun-core: #ffffff; --sun: #d9fbff;
  --m1: #0d4256; --m2: #041f2d; --m3: #010b12; --mist: #c4f4ff;
}
html[data-wall="ink"] {
  --sky-1: #07080b; --sky-2: #13151b; --sky-3: #22252e; --sky-4: #343845; --sky-5: #5c6270;
  --glow: #ffc27a; --sun-core: #fff6e2; --sun: #ffcf87;
  --m1: #2a2d37; --m2: #14161b; --m3: #08090c; --mist: #ffffff;
}
html[data-wall="sakura"] {
  --sky-1: #120a24; --sky-2: #2a1448; --sky-3: #5c2566; --sky-4: #a43c70; --sky-5: #f28e80;
  --glow: #ffa3b4; --sun-core: #fff3ea; --sun: #ffb5a8;
  --m1: #43204f; --m2: #1e1030; --m3: #0c0716; --mist: #ffd0cf;
}

.wall { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--sky-2); }
html[data-wall="starry"] .wall { background: #14245a; }
.wall-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* 《星月夜》是一张真正的图片：手机上用竖版裁剪，支持 avif 的浏览器用 avif，其余的自动退回 webp */
.wall-picture { position: absolute; inset: 0; display: none; }
html[data-wall="starry"] .wall-picture { display: block; }
html[data-wall="starry"] .wall-svg { visibility: hidden; }
.wall-picture img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 36%; transition: opacity .9s var(--ease); }
/* 图片下载完之前先不显示；脚本在加载完后去掉 is-wall-loading，图片就淡入 */
html.is-wall-loading .wall-picture img { opacity: 0; }

/* 画上的暗色渐变：让顶部菜单栏、底部 Dock 和直接压在画上的文字看得清，中间留亮 */
.wall-scrim { position: absolute; inset: 0; display: none; pointer-events: none; background: linear-gradient(180deg, rgba(5, 9, 30, .66) 0%, rgba(5, 9, 30, .26) 16%, rgba(5, 9, 30, .10) 40%, rgba(5, 9, 30, .14) 64%, rgba(5, 9, 30, .70) 100%); }
html[data-wall="starry"] .wall-scrim { display: block; }

/* 星星画在壁纸的 svg 里（_includes/wallpaper.html），其中一部分会缓慢闪烁 */
.wall-stars circle { transform-box: fill-box; transform-origin: center; }
.wall-stars .tw { animation: twinkle 4.8s ease-in-out infinite; }

/* 细微颗粒，让渐变像纸一样有质感 */
.wall-grain {
  position: absolute; inset: 0; opacity: .09; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

/* 自己上传的壁纸 */
.wall-custom { position: absolute; inset: 0; display: none; background: center / cover no-repeat; }
.wall-custom::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6, 8, 22, .62), rgba(6, 8, 22, .22) 46%, rgba(6, 8, 22, .66));
}
.wall.is-custom .wall-svg, .wall.is-custom .wall-picture { visibility: hidden; }
.wall.is-custom .wall-custom { display: block; }
.wall.is-custom .wall-scrim { display: none; }   /* 自己上传的图有它自带的暗角 */
/* 画和照片上不用加颗粒 */
html[data-wall="starry"] .wall-grain, .wall.is-custom .wall-grain { display: none; }

.wall-sun { transform-origin: 930px 556px; animation: sun-breathe 9s ease-in-out infinite; }


/* ==========================================================================
   2. 菜单栏
   ========================================================================== */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; gap: 16px;
  height: 54px; padding: 0 max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
  color: var(--ink);
  background: linear-gradient(180deg, rgba(8, 10, 26, .42), rgba(8, 10, 26, .16));
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, .10);
  transition: background .4s var(--ease), color .4s var(--ease);
}
html:not([data-view="home"]) .bar {
  color: var(--text);
  background: var(--bar-bg);
  border-bottom-color: var(--bar-line);
}
html[data-view="home"] .bar { background: linear-gradient(180deg, rgba(8, 10, 26, .62), rgba(8, 10, 26, 0)); border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.bar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.bar-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }
.bar-title { font-size: 15px; font-weight: 650; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bar-nav { display: flex; align-items: center; gap: 2px; margin-right: auto; }
.bar-nav a {
  padding: 6px 12px; border-radius: 999px;
  font-size: 14px; font-weight: 500; opacity: .78;
  transition: opacity .2s var(--ease), background .2s var(--ease);
}
.bar-nav a:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.bar-nav a[aria-current="page"] { opacity: 1; background: rgba(255, 255, 255, .16); }
html[data-theme="light"]:not([data-view="home"]) .bar-nav a:hover,
html[data-theme="light"]:not([data-view="home"]) .bar-nav a[aria-current="page"] { background: rgba(20, 22, 40, .08); }

.bar-actions { display: flex; align-items: center; gap: 4px; }


/* ==========================================================================
   3. 锁屏
   ========================================================================== */
.lock {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center;
  padding: max(16vh, 96px) 24px max(8vh, 48px);
  color: #fff; text-align: center; cursor: pointer;
  background: linear-gradient(180deg, rgba(4, 8, 26, .50), rgba(4, 8, 26, .26) 45%, rgba(4, 8, 26, .64));
  /* 只轻轻模糊：锁屏上还认得出是《星月夜》，白字靠压暗和阴影保证看得清 */
  -webkit-backdrop-filter: blur(8px) saturate(118%) brightness(.94);
  backdrop-filter: blur(8px) saturate(118%) brightness(.94);
  transition: opacity .7s var(--ease), transform .9s var(--ease-out), filter .7s var(--ease), visibility 0s .9s;
}
/* 脚本在 <html> 上加 is-ready 表示“已经进入”：锁屏淡出并放大消失 */
html.is-booting body { overflow: hidden; }
html.is-ready .lock { opacity: 0; transform: scale(1.08); visibility: hidden; pointer-events: none; transition: opacity .7s var(--ease), transform .9s var(--ease-out), visibility 0s .9s; }
html.no-lock .lock { display: none; }

.lock-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lock-avatar {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), 0 10px 30px rgba(0, 0, 0, .35);
}
.lock-name { font-size: 16px; font-weight: 600; letter-spacing: .34em; text-indent: .34em; opacity: .92; }

.lock-time {
  margin-top: 30px;
  font-family: var(--font-display); font-size: clamp(76px, 15vw, 132px); font-weight: 200;
  line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .35), 0 10px 40px rgba(0, 0, 0, .45);
}
.lock-date { margin-top: 12px; font-size: 17px; font-weight: 600; opacity: .92; }
.lock-lunar { margin-top: 4px; font-size: 13px; font-weight: 400; opacity: .62; }

.lock-hint {
  margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 13px; opacity: .62; animation: hint-float 2.6s ease-in-out infinite;
}
.lock-hint .icon { width: 22px; height: 22px; stroke-width: 2.4; }

.lock > * { animation: lock-in 1s var(--ease-out) both; }
.lock-brand { animation-delay: .05s; }
.lock-time { animation-delay: .12s; }
.lock-date, .lock-lunar { animation-delay: .2s; }
.lock-hint { animation: lock-in 1s var(--ease-out) .5s both, hint-float 2.6s ease-in-out 1.6s infinite; }


/* ==========================================================================
   4. 桌面与小组件
   ========================================================================== */
.desk {
  position: relative; z-index: 2;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 78px 24px 136px;
}

.widgets {
  width: 100%; max-width: 1080px;
  display: grid; gap: 16px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 172px;
  grid-auto-flow: row dense;
}

.widget {
  position: relative; isolation: isolate; overflow: hidden;
  grid-column: span 3;
  display: flex; flex-direction: column; min-width: 0;
  padding: 18px 22px;
  border-radius: var(--r-xl);
  color: var(--ink); text-shadow: var(--ink-shadow);
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-top), inset 0 0 0 1px var(--glass-line);
  transition: transform .35s var(--ease-out), background .35s var(--ease);
}
/* 玻璃上的一道反光 */
.widget::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(122deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, 0) 40%);
}
.widget.is-link { cursor: pointer; }
.widget.is-link:hover { transform: translateY(-3px); background: var(--glass-hover); }

.w-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); text-shadow: none;
}
.w-label .icon { width: 15px; height: 15px; stroke-width: 2.2; }
.w-more {
  margin-left: auto; display: inline-flex; align-items: center; gap: 2px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-3); text-shadow: none;
  transition: color .2s var(--ease);
}
.w-more:hover { color: var(--ink); }
.w-more .icon { width: 13px; height: 13px; }

/* —— 时钟 —— */
.w-now { grid-column: span 5; grid-row: span 2; padding: 26px 28px 24px; }
.now-time {
  font-family: var(--font-display); font-size: clamp(64px, 7.4vw, 100px); font-weight: 200;
  line-height: .96; letter-spacing: -.035em; font-variant-numeric: tabular-nums;
}
.now-date { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-top: 10px; font-size: 17px; font-weight: 600; }
.now-lunar { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.now-foot { margin-top: auto; }
.now-greet { font-size: 22px; font-weight: 650; line-height: 1.3; }
.now-sub { display: block; margin-top: 2px; font-size: 14px; font-weight: 400; color: var(--ink-2); }
.now-quote { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ink-line); }
.now-quote blockquote {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-family: var(--font-serif); font-size: 16px; line-height: 1.6; color: var(--ink-2);
}
.now-quote figcaption { margin-top: 4px; font-size: 12px; color: var(--ink-3); }

/* —— 最新文章 —— */
.w-posts { grid-column: span 4; grid-row: span 2; padding-bottom: 14px; }
.w-postlist { flex: 1; display: flex; flex-direction: column; margin: 8px -10px 0; list-style: none; }
.w-postlist a {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 10px 12px; border-radius: 16px;
  transition: background .2s var(--ease);
}
.w-postlist a:hover { background: rgba(255, 255, 255, .13); }
.w-postlist li + li::before {
  content: ""; display: block; height: 1px; margin: 0 12px; background: var(--ink-line);
}
.w-post__title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 15.5px; font-weight: 600; line-height: 1.45;
}
.w-post__meta { margin-top: 5px; font-size: 12px; color: var(--ink-3); text-shadow: none; }
.w-post__empty { flex: 1; display: grid; place-items: center; font-size: 14px; color: var(--ink-3); }

/* —— 天气 —— */
.wx-main { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.wx-icon { display: grid; place-items: center; width: 40px; height: 40px; }
.wx-icon .icon { width: 38px; height: 38px; stroke-width: 1.5; color: var(--ink); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .18)); }
.wx-temp { font-size: 42px; font-weight: 300; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.wx-desc { font-size: 13px; color: var(--ink-2); }
.wx-hours { display: flex; justify-content: space-between; margin-top: auto; padding-top: 9px; border-top: 1px solid var(--ink-line); list-style: none; }
.wx-hours li { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11.5px; color: var(--ink-2); text-shadow: none; }
.wx-hours .icon { width: 18px; height: 18px; stroke-width: 1.8; color: var(--ink); }
.wx-hours b { font-weight: 600; color: var(--ink); }
.wx-hours li.is-now b, .wx-hours li.is-now span { color: var(--accent-soft); }
/* “改回默认城市”的小叉 */
.wx-reset {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px; margin-left: 2px; border-radius: 50%;
  color: var(--ink); background: rgba(255, 255, 255, .16);
  transition: background .2s var(--ease);
}
.wx-reset:hover { background: rgba(255, 255, 255, .30); }
.wx-reset .icon { width: 11px; height: 11px; stroke-width: 2.6; }

/* —— 日历 —— */
.cal-week, .cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.cal-week { margin-top: 8px; font-size: 11px; color: var(--ink-2); text-shadow: none; }
.cal-days { flex: 1; align-items: center; grid-auto-rows: 1fr; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cal-days span { display: grid; place-items: center; justify-self: center; width: auto; height: min(100%, 26px); aspect-ratio: 1; line-height: 1; border-radius: 50%; }
.cal-days .is-out { color: rgba(255, 255, 255, .42); }
.cal-days .is-today { background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, .28); }

/* —— 三个入口：小游戏 / 工具箱 / 相册 —— */
.w-link { padding: 0; color: #fff; text-shadow: none; }
.w-link__bg { position: absolute; inset: 0; z-index: -2; background: center / cover no-repeat; transition: transform .8s var(--ease-out); }
.w-link__tint { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 8, 20, .10), rgba(8, 8, 20, .78)); }
.widget.is-link:hover .w-link__bg { transform: scale(1.05); }
.w-link__body { position: relative; margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 20px 18px; }
.w-link__title { font-size: 17px; font-weight: 650; }
.w-link__sub { margin-top: 2px; font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.w-link__go {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 50%; background: rgba(255, 255, 255, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
  transition: transform .3s var(--ease-out), background .3s var(--ease);
}
.w-link__go .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.widget.is-link:hover .w-link__go { background: var(--accent); color: var(--on-accent); transform: translate(2px, -2px); }
.w-link__badge {
  position: absolute; top: 14px; left: 16px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  background: rgba(8, 8, 20, .42); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

.w-games { grid-column: span 4; }
.w-games__bg--ink { background-color: #1a1424; background-image: linear-gradient(135deg, #3a2250, #b23a2c); }

/* 工具箱组件：一排小图标 */
.w-tools { grid-column: span 4; }
.w-tools__grid { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; gap: 8px; max-width: 360px; margin: 6px auto 0; }
.w-tool { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); text-shadow: none; }
.w-tool:hover { color: var(--ink); }
.w-tool__icon {
  display: grid; place-items: center; width: 100%; max-width: 44px; aspect-ratio: 1;
  border-radius: 32%;
  background: var(--c, #49b1f5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -6px 12px rgba(0, 0, 0, .14), 0 6px 14px rgba(0, 0, 0, .22);
  color: #fff; transition: transform .3s var(--ease-out);
}
.w-tool:hover .w-tool__icon { transform: translateY(-3px) scale(1.06); }
.w-tool__icon .icon { width: 20px; height: 20px; stroke-width: 2; }
.w-tool__more { display: grid; place-items: center; aspect-ratio: 1; max-width: 44px; width: 100%; justify-self: center; border-radius: 32%; background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }

/* 相册组件：四张图拼成的格子 */
.w-gallery { grid-column: span 4; }
.w-gallery__grid { position: absolute; inset: 0; z-index: -2; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; background: rgba(8, 8, 20, .4); }
.w-gallery__grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.w-gallery:hover .w-gallery__grid img { transform: scale(1.04); }
.w-gallery__empty { position: absolute; inset: 0; z-index: -2; display: grid; place-items: center; color: var(--ink-3); }
.w-gallery__empty .icon { width: 40px; height: 40px; stroke-width: 1.4; }


/* ==========================================================================
   5. Dock（屏幕底部的快捷入口）
   ========================================================================== */
.dock {
  position: fixed; z-index: 50; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: 6px;
  padding: 9px 11px 7px;
  border-radius: 26px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-top), inset 0 0 0 1px var(--glass-line);
}
.app {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  width: 64px; color: var(--ink);
  transition: transform .35s var(--ease-out);
}
.app:hover, .app:focus-visible { transform: translateY(-7px); }
.app-icon {
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 15px;
  background: var(--c, #333);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), inset 0 -8px 14px rgba(0, 0, 0, .16), 0 8px 18px rgba(0, 0, 0, .28);
  color: #fff; transition: box-shadow .35s var(--ease);
}
/* 图标左上角的一道高光 */
.app-icon::before { content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 46%); }
.app-icon .icon { position: relative; width: 25px; height: 25px; stroke-width: 2; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .18)); }
.app:hover .app-icon { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), inset 0 -8px 14px rgba(0, 0, 0, .16), 0 14px 26px rgba(0, 0, 0, .36); }
.app-label { font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, .88); text-shadow: 0 1px 2px rgba(0, 0, 0, .35); white-space: nowrap; }
.app--posts  .app-icon { --c: linear-gradient(145deg, #63a8ff, #2f6ae0); }
.app--games  .app-icon { --c: linear-gradient(145deg, #ff8a5c, #dc3524); }
.app--tools  .app-icon { --c: linear-gradient(145deg, #ffc94d, #ef8c14); }
.app--gallery .app-icon { --c: linear-gradient(145deg, #b992ff, #6f56ee); }
.app--links  .app-icon { --c: linear-gradient(145deg, #ff93b3, #e0447c); }
.app--about  .app-icon { --c: linear-gradient(145deg, #7e88a0, #3f4658); }
.dock-sep { align-self: stretch; width: 1px; margin: 4px 4px; background: rgba(255, 255, 255, .22); }


/* ==========================================================================
   6. 首页的文章区（往下滚动看到）
   ========================================================================== */
.feed {
  position: relative; z-index: 2;
  max-width: 1080px; margin: 0 auto;
  padding: 8px 24px 150px;
}
.feed-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.feed-title { font-size: 28px; font-weight: 750; letter-spacing: -.01em; color: var(--ink); text-shadow: var(--ink-shadow); }
.feed-more {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 550; color: var(--ink); text-shadow: none;
  background: rgba(8, 14, 44, .50); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24);
  transition: background .2s var(--ease), gap .2s var(--ease);
}
.feed-more:hover { background: rgba(8, 14, 44, .72); gap: 9px; }

.feed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.post-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 24px 26px;
  border-radius: var(--r-xl);
  color: var(--ink); text-shadow: var(--ink-shadow);
  background: linear-gradient(160deg, rgba(24, 34, 84, .84), rgba(10, 16, 48, .90));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-top), inset 0 0 0 1px var(--glass-line);
  transition: transform .4s var(--ease-out), background .4s var(--ease), border-color .3s var(--ease);
}
.post-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(122deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 42%);
}
.post-card:hover { transform: translateY(-4px); background: linear-gradient(160deg, rgba(34, 46, 104, .88), rgba(14, 22, 62, .92)); }
.post-card__link { position: relative; display: flex; flex-direction: column; flex: 1; color: inherit; }
/* 封面可能是一个 <picture>（默认封面的 avif/webp 两套）或一个 <img>（文章自己写的 cover），两种都要铺满 */
.post-card__cover { display: block; width: calc(100% + 52px); max-width: none; margin: -24px -26px 18px; aspect-ratio: 16 / 8; object-fit: cover; }
.post-card__cover > img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.post-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); text-shadow: none; }
.post-card__title {
  margin-top: 10px;
  font-size: 21px; font-weight: 700; line-height: 1.35; letter-spacing: -.005em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .2s var(--ease);
}
.post-card:hover .post-card__title { color: #ffe6a3; }
.post-card__excerpt {
  margin-top: 8px; font-size: 14.5px; line-height: 1.7; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 16px; }
.post-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.post-card__go { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); transition: transform .3s var(--ease-out), background .3s var(--ease); }
.post-card__go .icon { width: 15px; height: 15px; stroke-width: 2.4; }
.post-card:hover .post-card__go { background: var(--accent); color: var(--on-accent); transform: translate(2px, -2px); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5;
  color: var(--ink); text-shadow: none;
  background: rgba(8, 14, 44, .46); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .30);
}
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; color: var(--ink); text-shadow: none;
  background: rgba(8, 14, 44, .42); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  transition: background .2s var(--ease);
}
.tag:hover { background: rgba(8, 14, 44, .66); }

.feed-tags { margin-top: 56px; }
.feed-tags h3 { margin-bottom: 14px; font-size: 17px; font-weight: 650; color: var(--ink); text-shadow: var(--ink-shadow); }
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tagcloud .tag { padding: 6px 14px; font-size: 13.5px; }
.tagcloud .tag b { margin-left: 5px; font-weight: 500; color: var(--ink-3); }

.empty {
  padding: 36px 24px; border-radius: var(--r-xl); text-align: center;
  color: var(--ink-2); background: var(--glass);
  box-shadow: var(--glass-shadow), inset 0 0 0 1px var(--glass-line);
}
html:not([data-view="home"]) .empty { color: var(--text-2); background: var(--surface-2); box-shadow: none; }


/* ==========================================================================
   7. 内页通用
   ========================================================================== */
.main { position: relative; z-index: 2; }
.page { max-width: 940px; margin: 0 auto; padding: 106px 20px 72px; }
.page--wide { max-width: 1160px; }
.page-head { margin-bottom: 28px; }
.page-title { font-size: clamp(32px, 5vw, 44px); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.page-sub { margin-top: 8px; font-size: 15px; color: var(--text-3); }

.paper {
  background: var(--surface);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--paper-shadow);
}


/* ==========================================================================
   8. 文章排版
   ========================================================================== */
.post { max-width: 1180px; margin: 0 auto; padding: 104px 20px 64px; }
.post-head { max-width: 760px; margin: 0 auto 26px; }
.post-cats { display: flex; flex-wrap: wrap; gap: 8px; }
html:not([data-view="home"]) .chip { color: var(--accent-text); background: var(--code-inline); box-shadow: none; }
html[data-theme="dark"]:not([data-view="home"]) .chip { color: var(--accent-text); }
.post-title { margin-top: 14px; font-size: clamp(28px, 4.6vw, 44px); font-weight: 800; line-height: 1.2; letter-spacing: -.015em; text-wrap: balance; }
.post-desc { margin-top: 12px; font-size: 17px; line-height: 1.7; color: var(--text-2); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 18px; font-size: 14px; color: var(--text-3); }
.post-meta .sep { opacity: .5; }
.post-meta a { color: var(--text-2); }
.post-meta a:hover { color: var(--accent-text); }
html[data-theme="dark"] .post-meta a:hover { color: var(--accent-text); }

.post-layout { display: grid; grid-template-columns: minmax(0, 760px); justify-content: center; align-items: start; }
.post-body { padding: 40px 54px 46px; font-size: 17px; line-height: 1.85; color: var(--text); overflow-wrap: break-word; }

.post-body > :first-child { margin-top: 0; }
/* 文章顶部的封面横幅 */
.post-body img.post-cover, .post-body picture.post-cover { display: block; width: calc(100% + 108px); max-width: none; margin: 0 -54px 30px; aspect-ratio: 16 / 5.6; border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: none; cursor: default; }
.post-body .post-cover > img { width: 100%; height: 100%; max-width: none; margin: 0; object-fit: cover; border-radius: inherit; box-shadow: none; cursor: default; }
.post-body:has(> .post-cover) { padding-top: 0; }
.post-body > :last-child { margin-bottom: 0; }
.post-body p { margin: 1.05em 0; }
.post-body h2, .post-body h3, .post-body h4 { position: relative; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; text-wrap: balance; }
.post-body h2 { margin: 2.1em 0 .8em; padding-left: 15px; font-size: 27px; }
.post-body h2::before { content: ""; position: absolute; left: 0; top: .24em; bottom: .2em; width: 5px; border-radius: 4px; background: var(--accent-bar); }
.post-body h3 { margin: 1.8em 0 .7em; font-size: 21px; }
.post-body h4 { margin: 1.5em 0 .6em; font-size: 17.5px; }
.post-body a { color: var(--accent-text); font-weight: 550; text-decoration: underline; text-decoration-color: rgba(36, 83, 164, .35); text-underline-offset: 4px; text-decoration-thickness: 1.5px; transition: text-decoration-color .2s var(--ease); }
html[data-theme="dark"] .post-body a { color: var(--accent-text); text-decoration-color: rgba(247, 207, 71, .40); }
.post-body a:hover { text-decoration-color: currentColor; }
.post-body strong { font-weight: 700; }
.post-body ul, .post-body ol { margin: 1em 0; padding-left: 1.6em; }
.post-body li { margin: .3em 0; }
.post-body li::marker { color: var(--accent-text); font-weight: 600; }
html[data-theme="dark"] .post-body li::marker { color: var(--accent-text); }
.post-body blockquote {
  margin: 1.4em 0; padding: 14px 22px;
  border-left: 4px solid var(--accent-bar); border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--surface-2); color: var(--text-2);
}
.post-body blockquote p { margin: .3em 0; }
.post-body hr { margin: 2.4em auto; width: 120px; height: 1px; border: 0; background: var(--line); }
.post-body img { margin: 1.4em auto; border-radius: var(--r-md); box-shadow: 0 10px 30px rgba(10, 12, 30, .14); cursor: zoom-in; }
.post-body figcaption, .post-body .image-caption { margin-top: -0.8em; margin-bottom: 1.4em; text-align: center; font-size: 13.5px; color: var(--text-3); }
.post-body table { display: block; width: max-content; max-width: 100%; margin: 1.4em 0; overflow-x: auto; border-collapse: collapse; border-spacing: 0; font-size: 15px; line-height: 1.6; }
.post-body th, .post-body td { padding: 10px 16px; border: 1px solid var(--line); text-align: left; }
.post-body th { background: var(--surface-2); font-weight: 650; white-space: nowrap; }
.post-body code:not(.highlight code) {
  padding: .16em .46em; border-radius: 6px;
  font-family: var(--font-mono); font-size: .86em;
  color: var(--code-ink); background: var(--code-inline);
}
.post-body pre:not(.highlight) { margin: 1.4em 0; padding: 16px 18px; border-radius: var(--r-md); overflow-x: auto; background: var(--code-bg); color: var(--code-text); font-size: 14px; line-height: 1.7; font-family: var(--font-mono); }
.post-body del { color: var(--text-3); }
.post-body input[type="checkbox"] { margin-right: 6px; accent-color: var(--accent-text); }
.post-body .task-list-item { list-style: none; }
.post-body .task-list-item .task-list-item-checkbox { margin-left: -1.4em; }

/* 侧边目录（只在 1200px 以上的宽屏显示） */
.toc { display: none; position: sticky; top: 88px; max-height: calc(100vh - 120px); overflow-y: auto; padding: 18px 4px 18px 18px; font-size: 14px; scrollbar-width: thin; }
.toc-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; font-weight: 650; color: var(--text-3); }
.toc ol { list-style: none; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; color: var(--text-2); border-left: 2px solid transparent; line-height: 1.5; transition: color .2s var(--ease), border-color .2s var(--ease); }
.toc li.is-h3 a { padding-left: 30px; font-size: 13px; }
.toc li a:hover { color: var(--text); }
.toc li.is-on > a { color: var(--accent-text); border-left-color: var(--accent-bar); font-weight: 600; }
html[data-theme="dark"] .toc li.is-on > a { color: var(--accent-text); }
@media (min-width: 1200px) {
  .post-layout { grid-template-columns: minmax(0, 760px) 240px; gap: 32px; }
  .toc:not([hidden]) { display: block; }
}

.post-foot { max-width: 760px; margin: 24px auto 0; }
.post-license { padding: 16px 22px; border-radius: var(--r-lg); font-size: 13.5px; line-height: 1.7; color: var(--text-3); background: var(--surface-2); }
.post-license a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
html[data-theme="dark"] .post-license a { color: var(--accent-text); }
.post-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.post-action {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  background: var(--surface-2);
  transition: background .2s var(--ease), color .2s var(--ease), transform .25s var(--ease-out);
}
.post-action:hover { color: var(--accent-text); background: var(--surface-3); transform: translateY(-1px); }
.post-action .icon { width: 16px; height: 16px; }
.post-action.is-done { color: var(--accent-text); }
.post-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.post-nav a {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 20px; border-radius: var(--r-lg);
  background: var(--surface-2);
  transition: background .25s var(--ease), transform .35s var(--ease-out);
}
.post-nav a:hover { background: var(--surface-3); transform: translateY(-2px); }
.post-nav a.next { text-align: right; }
.post-nav__label { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-3); }
.post-nav a.next .post-nav__label { justify-content: flex-end; }
.post-nav__title { font-size: 15.5px; font-weight: 650; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 顶部阅读进度条 */
.progress { position: fixed; top: 0; left: 0; z-index: 65; width: 100%; height: 2px; background: transparent; pointer-events: none; }
.progress span { display: block; width: 0; height: 100%; background: var(--accent-text); }


/* ==========================================================================
   9. 代码块与语法高亮
   ========================================================================== */
.code {
  position: relative; margin: 1.5em 0;
  border-radius: var(--r-md); overflow: hidden;
  background: var(--code-bg);
  box-shadow: 0 12px 30px rgba(8, 10, 30, .18), inset 0 0 0 1px var(--code-line);
}
.code-head {
  display: flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--code-line);
  color: var(--code-muted); font-family: var(--font-mono); font-size: 12px;
}
.code-dots { display: flex; gap: 7px; margin-right: 6px; }
.code-dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.code-dots i:nth-child(2) { background: #febc2e; }
.code-dots i:nth-child(3) { background: #28c840; }
.code-lang { text-transform: lowercase; letter-spacing: .02em; }
.code-copy {
  display: inline-flex; align-items: center; gap: 5px; margin-left: auto;
  padding: 4px 10px; border-radius: 8px;
  font-family: var(--font-sans); font-size: 12px; color: var(--code-muted);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.code-copy:hover { color: #fff; background: rgba(255, 255, 255, .10); }
.code-copy.is-done { color: #5dd6a0; }
.code-copy.is-done:hover { color: #5dd6a0; background: none; }
.code-copy .icon { width: 14px; height: 14px; }
.code pre { margin: 0; padding: 16px 18px 18px; overflow-x: auto; font-size: 14px; line-height: 1.75; color: var(--code-text); font-family: var(--font-mono); tab-size: 4; scrollbar-width: thin; }
.code pre code { font: inherit; color: inherit; background: none; padding: 0; }

/* rouge 生成的各个语法单元的配色 */
.highlight .c, .highlight .cd, .highlight .cm, .highlight .c1, .highlight .cs { color: #6b7394; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kc, .highlight .kt { color: #ff8f6b; }
.highlight .o { color: #f0a0ff; }
.highlight .s, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr, .highlight .s1, .highlight .ss { color: #e5c07b; }
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo, .highlight .il { color: #d38aea; }
.highlight .no, .highlight .nt, .highlight .nn { color: #d38aea; }
.highlight .nf, .highlight .nc, .highlight .fm { color: #7fb4ff; }
.highlight .nb, .highlight .bp { color: #56c8d4; }
.highlight .na { color: #d7c8ff; }
.highlight .nd, .highlight .ld { color: #56c8d4; }
.highlight .ni, .highlight .nl, .highlight .ne { color: #7fb4ff; }
.highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi { color: #f0f2fa; }
.highlight .p { color: #a9b1d0; }
.highlight .err { color: #ff6b6b; text-decoration: underline wavy; }
.highlight .ge { font-style: italic; }
.highlight .gs, .highlight .gh { font-weight: 700; }
.highlight .gu { color: #7fb4ff; font-weight: 600; }
.highlight .gp { color: #6b7394; }


/* ==========================================================================
   10. 文章列表 / 标签 / 友链 / 相册
   ========================================================================== */
.card {
  background: var(--surface);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--paper-shadow);
}

/* 文章列表：按年份分组 */
.list-year { margin: 30px 0 8px; font-size: 14px; font-weight: 700; letter-spacing: .08em; color: var(--text-3); }
.list-year:first-child { margin-top: 0; }
.list { padding: 14px 28px 18px; }
.post-row a {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: baseline; gap: 16px;
  padding: 13px 6px; border-bottom: 1px solid var(--line);
  transition: background .2s var(--ease), padding .25s var(--ease);
}
.post-row:last-child a { border-bottom: 0; }
.post-row a:hover { background: var(--surface-2); padding-left: 12px; padding-right: 12px; border-radius: 12px; }
.post-row__date { font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--text-3); }
.post-row__title { font-size: 17px; font-weight: 600; line-height: 1.45; transition: color .2s var(--ease); }
.post-row a:hover .post-row__title { color: var(--accent-text); }
html[data-theme="dark"] .post-row a:hover .post-row__title { color: var(--accent-text); }
.post-row__tags { display: flex; gap: 8px; font-size: 12.5px; color: var(--text-3); }

/* 标签页 / 分类页 */
.terms { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.term {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  font-size: 15px; font-weight: 600; color: var(--text);
  background: var(--surface-2);
  transition: background .2s var(--ease), transform .3s var(--ease-out), color .2s var(--ease);
}
.term:hover { background: var(--surface-3); transform: translateY(-2px); color: var(--accent-text); }
html[data-theme="dark"] .term:hover { color: var(--accent-text); }
.term b { font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.term-sec { margin-top: 30px; scroll-margin-top: 86px; }
.term-sec h2 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
.term-sec h2 span { font-size: 13px; font-weight: 500; color: var(--text-3); }
.mini-list { list-style: none; }
.mini-list a {
  display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; align-items: baseline;
  padding: 11px 6px; border-bottom: 1px solid var(--line);
  transition: background .2s var(--ease);
}
.mini-list li:last-child a { border-bottom: 0; }
.mini-list a:hover { background: var(--surface-2); }
.mini-list time { font-size: 13.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mini-list span { font-size: 15.5px; font-weight: 550; line-height: 1.5; }
.mini-list a:hover span { color: var(--accent-text); }
html[data-theme="dark"] .mini-list a:hover span { color: var(--accent-text); }

/* 友链 */
.friends { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.friend {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  transition: transform .35s var(--ease-out), background .3s var(--ease);
}
.friend:hover { transform: translateY(-3px); }
.friend__avatar {
  display: grid; place-items: center; flex: none;
  width: 50px; height: 50px; border-radius: 50%; object-fit: cover;
  font-size: 19px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #ff8f6b, #6f56ee);
  box-shadow: 0 0 0 2px #fff, 0 4px 12px rgba(0, 0, 0, .12);
}
html[data-theme="dark"] .friend__avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .14), 0 4px 12px rgba(0, 0, 0, .3); }
.friend__text { display: flex; flex-direction: column; min-width: 0; }
.friend__name { font-size: 16px; font-weight: 650; }
.friend__desc { margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--text-3); }
/* 友链卡片写在正文区域里，但不要继承正文链接的红字和下划线 */
.post-body .friend { color: var(--text); font-weight: 400; text-decoration: none; }
.post-body .friend .friend__name { color: var(--text); font-weight: 650; text-decoration: none; }
.post-body .friend:hover .friend__name { color: var(--accent-text); }
html[data-theme="dark"] .post-body .friend:hover .friend__name { color: var(--accent-text); }

/* 作品页 */
.projects-intro { margin: 0 0 20px; color: var(--text-2); }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 22px 0; }
.project-card {
  overflow: hidden; display: flex; flex-direction: column;
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background: var(--surface-2);
  transition: transform .35s var(--ease-out), background .3s var(--ease), box-shadow .35s var(--ease);
}
.project-card:hover { transform: translateY(-3px); background: var(--surface-3); box-shadow: 0 16px 34px rgba(10, 12, 30, .14); }
.project-card__cover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; color: #fff; background: linear-gradient(135deg, #17255f, #4964b7); }
.post-body .project-card__cover, .post-body .project-card__cover:hover { color: #fff; font-weight: 600; text-decoration: none; }
.project-card__cover img { display: block; width: 100%; height: 100%; margin: 0; object-fit: cover; border-radius: 0; box-shadow: none; cursor: pointer; transition: transform .8s var(--ease-out); }
.project-card:hover .project-card__cover img { transform: scale(1.045); }
.project-card__cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(5, 8, 24, .58)); }
.project-card__play {
  position: absolute; z-index: 1; right: 14px; bottom: 14px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 650; color: #fff;
  background: rgba(6, 9, 28, .56); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .30);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background .25s var(--ease), color .25s var(--ease), transform .3s var(--ease-out);
}
.project-card__play .icon { width: 14px; height: 14px; }
.project-card:hover .project-card__play { color: var(--on-accent); background: var(--accent); transform: translate(2px, -2px); }
.project-card__body { display: flex; flex-direction: column; flex: 1; padding: 17px 18px 18px; }
.post-body .project-card__name { margin: 0; padding: 0; font-size: 20px; line-height: 1.3; }
.post-body .project-card__name::before { content: none; }
.project-card__en { margin-top: 3px; font-size: 11.5px; font-weight: 650; letter-spacing: .08em; color: var(--text-3); text-transform: uppercase; }
.project-card__desc { margin: 10px 0 16px; font-size: 14.5px; line-height: 1.7; color: var(--text-2); }
.project-card__actions { margin-top: auto; }
.post-body .project-card__btn, .post-body .project-card__btn:hover {
  margin-top: 0; padding: 8px 14px;
  font-size: 13.5px; color: var(--on-accent-text); text-decoration: none;
}
.project-card__btn .icon { width: 15px; height: 15px; }
.projects-note { margin-top: 22px; font-size: 13.5px; color: var(--text-3); }

/* 相册 */
.gal-sec { margin-top: 36px; }
.gal-sec:first-of-type { margin-top: 0; }
.gal-sec h2 { margin-bottom: 14px; font-size: 20px; font-weight: 700; }
.gal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gal-item {
  position: relative; overflow: hidden; margin: 0;
  aspect-ratio: 4 / 3; border-radius: var(--r-md);
  background: var(--surface-2); box-shadow: 0 8px 22px rgba(10, 12, 30, .14);
  cursor: zoom-in;
}
.gal-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.gal-item:hover img { transform: scale(1.05); }
.gal-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 14px 11px;
  font-size: 13px; font-weight: 550; color: #fff; opacity: 0;
  background: linear-gradient(transparent, rgba(8, 8, 20, .72));
  transition: opacity .3s var(--ease);
}
.gal-item:hover figcaption, .gal-item:focus-visible figcaption { opacity: 1; }

/* 看大图 */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center; padding: 24px;
  background: rgba(6, 8, 20, .80);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease), visibility 0s .3s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.lightbox img { max-width: 100%; max-height: calc(100svh - 110px); border-radius: var(--r-md); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.lightbox__cap { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; font-size: 14px; color: #fff; opacity: .82; }
.lightbox__btn, .lightbox__nav {
  position: absolute; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%; color: #fff;
  background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .26);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.lightbox__btn:hover, .lightbox__nav:hover { background: rgba(255, 255, 255, .22); }
.lightbox__btn { top: 18px; right: 18px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav:hover { transform: translateY(-50%) scale(1.06); }
.lightbox__nav--prev { left: 18px; }
.lightbox__nav--next { right: 18px; }
.lightbox.is-single .lightbox__nav { display: none; }

/* 404。类名用 notfound，不能用 nf：nf 是代码高亮里“函数名”的类名，会撞车 */
.notfound { padding: 48px 28px 56px; text-align: center; }
.notfound__code {
  font-family: var(--font-display); font-size: clamp(84px, 16vw, 150px); font-weight: 200;
  line-height: 1; letter-spacing: -.04em; color: var(--accent-text);
  background: linear-gradient(180deg, var(--accent-text), rgba(36, 83, 164, .30));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
html[data-theme="dark"] .notfound__code { background-image: linear-gradient(180deg, var(--accent-text), rgba(247, 207, 71, .30)); }
.notfound h1 { margin-top: 10px; font-size: 26px; font-weight: 750; }
.notfound p { margin-top: 10px; color: var(--text-2); }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 22px; padding: 11px 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600; color: var(--on-accent-text);
  background: var(--accent-text); box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
  transition: transform .25s var(--ease-out), filter .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn .icon { width: 16px; height: 16px; stroke-width: 2.4; }


/* ==========================================================================
   11. 弹窗：工具箱、小游戏、搜索、设置
   ========================================================================== */
.sheet { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.sheet[hidden] { display: none; }
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 8, 20, .54);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transition: opacity .35s var(--ease);
}
.sheet-window {
  position: relative; display: flex; flex-direction: column;
  width: min(880px, 100%); max-height: min(86svh, 780px);
  overflow: hidden; border-radius: 26px; color: #fff;
  background: linear-gradient(160deg, rgba(40, 42, 66, .90), rgba(18, 19, 34, .94));
  -webkit-backdrop-filter: blur(36px) saturate(160%); backdrop-filter: blur(36px) saturate(160%);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 0 0 1px rgba(255, 255, 255, .12);
  opacity: 0; transform: translateY(16px) scale(.97);
  transition: opacity .3s var(--ease), transform .5s var(--ease-out);
}
.sheet.is-open .sheet-backdrop { opacity: 1; }
.sheet.is-open .sheet-window { opacity: 1; transform: none; }
.sheet-head {
  display: flex; align-items: center; gap: 12px; flex: none;
  padding: 14px 14px 14px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}
.sheet-title { font-size: 17px; font-weight: 700; }
.sheet-head .spacer { flex: 1; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 22px; scrollbar-width: thin; }

/* —— 工具箱 —— */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.tool-entry {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 6px 13px; border-radius: 18px;
  font-size: 13px; font-weight: 550; color: rgba(255, 255, 255, .86);
  transition: background .2s var(--ease), transform .3s var(--ease-out);
}
.tool-entry:hover { background: rgba(255, 255, 255, .08); transform: translateY(-2px); }
.tool-entry__icon {
  display: grid; place-items: center;
  width: 54px; height: 54px; border-radius: 16px;
  background: var(--c, #49b1f5); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), inset 0 -8px 14px rgba(0, 0, 0, .16), 0 8px 18px rgba(0, 0, 0, .28);
}
.tool-entry__icon::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(145deg, rgba(255, 255, 255, .30), rgba(255, 255, 255, 0) 50%); }
.tool-entry__icon { position: relative; overflow: hidden; }
.tool-entry__icon .icon { position: relative; width: 25px; height: 25px; }

.tool-pane { display: flex; flex-direction: column; gap: 12px; max-width: 580px; margin: 0 auto; }
.tool-pane[hidden] { display: none; }
.sheet-back {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 3px;
  font-size: 13.5px; font-weight: 550; color: rgba(255, 255, 255, .66);
  transition: color .2s var(--ease);
}
.sheet-back:hover { color: #fff; }
.sheet-back .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.tool-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tool-row--full { flex-wrap: nowrap; }
.tool-label { flex: none; min-width: 60px; font-size: 14px; color: rgba(255, 255, 255, .66); }
.tool-hint { font-size: 13px; line-height: 1.6; color: rgba(255, 255, 255, .56); }
.tool-input {
  flex: 1; width: 100%; min-width: 0;
  padding: 10px 14px; border-radius: 12px;
  font: inherit; font-size: 14.5px; color: #fff;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
  outline: none; transition: border-color .2s var(--ease), background .2s var(--ease);
}
.tool-input::placeholder { color: rgba(255, 255, 255, .38); }
.tool-input:focus { border-color: var(--accent-soft); background: rgba(255, 255, 255, .13); }
.tool-input[readonly] { color: rgba(255, 255, 255, .78); }
select.tool-input {
  flex: none; width: auto; appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-opacity='.7' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
select.tool-input option { color: #15171f; background: #fff; }
textarea.tool-input { display: block; resize: vertical; min-height: 96px; line-height: 1.65; }
.tool-out {
  flex: 1; margin: 0; padding: 14px 16px; max-height: 280px; overflow: auto;
  border-radius: 12px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-all;
  color: #e8eaf4; background: rgba(0, 0, 0, .36);
}
.tool-out.is-err { color: #ff9a9a; }
.tool-out mark { padding: 0 2px; border-radius: 3px; color: #1a1030; background: #ffd166; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--on-accent);
  background: var(--accent); box-shadow: 0 6px 16px rgba(0, 0, 0, .26);
  transition: transform .2s var(--ease), filter .2s var(--ease);
}
.tool-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.tool-btn:active { transform: scale(.97); }
.tool-btn--ghost { color: rgba(255, 255, 255, .90); background: rgba(255, 255, 255, .10); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.tool-btn--ghost:hover { background: rgba(255, 255, 255, .17); }
.tool-btn .icon { width: 16px; height: 16px; }
.tool-stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; }
.tool-stat__item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10);
}
.tool-stat__item b { font-size: 18px; font-weight: 650; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tool-stat__item span { font-size: 12px; color: rgba(255, 255, 255, .55); }
.tool-stat__item.is-copy { cursor: pointer; transition: background .2s var(--ease); }
.tool-stat__item.is-copy:hover { background: rgba(255, 255, 255, .14); }
.tool-stat__item.is-done b { color: #5dd6a0; }
textarea.tool-input.is-err { color: #ff9a9a; }
.tool-qr-wrap { display: grid; place-items: center; align-content: center; gap: 10px; min-height: 236px; padding: 12px 8px; border-radius: 16px; background: rgba(255, 255, 255, .06); }
.tool-qr-img { width: 220px; height: 220px; padding: 10px; border-radius: 12px; background: #fff; }
.tool-qr-actions { display: flex; justify-content: center; gap: 8px; }
.tool-qr-actions .tool-btn { padding: 7px 12px; border-radius: 10px; font-size: 12.5px; }
.color-swatch { flex: none; width: 42px; height: 42px; border-radius: 12px; background: rgba(255, 255, 255, .10); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.pomo { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 6px; text-align: center; }
.pomo-time { font-family: var(--font-display); font-size: 76px; font-weight: 200; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pomo-time.is-running { color: var(--accent-soft); }

/* 计算器 */
.calc { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; margin: 0 auto; }
.calc-display {
  min-height: 74px; padding: 8px 10px 0;
  font-family: var(--font-display); font-size: 52px; font-weight: 300; line-height: 1.2;
  text-align: right; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  overflow-x: auto; white-space: nowrap;
}
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.calc-btn {
  display: grid; place-items: center; aspect-ratio: 1;
  border-radius: 50%; font-size: 24px; font-weight: 500; color: #fff;
  background: rgba(255, 255, 255, .14);
  transition: background .12s var(--ease), transform .12s var(--ease), color .12s var(--ease);
}
.calc-btn:hover { background: rgba(255, 255, 255, .23); }
.calc-btn:active { transform: scale(.93); }
.calc-btn--fn { color: #1a1c2c; background: #d4d6e2; }
.calc-btn--fn:hover { background: #eaecf5; }
.calc-btn--op { font-size: 28px; color: var(--on-accent); background: var(--accent); }
.calc-btn--op:hover { background: var(--accent); filter: brightness(1.12); }
.calc-btn--op.is-active { color: var(--on-accent); background: #fff; filter: none; }
.calc-btn--zero { grid-column: span 2; aspect-ratio: auto; justify-items: start; padding-left: 28px; border-radius: 999px; }

/* —— 小游戏 —— */
.sheet--games .sheet-window { width: min(980px, 100%); }
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.game-card {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  transition: transform .4s var(--ease-out), background .3s var(--ease);
}
.game-card:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .11); }
.game-card__cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.game-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease-out); }
.game-card:hover .game-card__cover img { transform: scale(1.04); }
.game-card__body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.game-card__name { font-size: 21px; font-weight: 750; letter-spacing: .02em; }
.game-card__en { margin-top: 2px; font-size: 11.5px; letter-spacing: .10em; text-transform: uppercase; color: rgba(255, 255, 255, .52); }
.game-card__desc { margin-top: 10px; font-size: 14px; line-height: 1.7; color: rgba(255, 255, 255, .74); }
.game-card__btn {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  margin-top: auto; padding: 8px 4px 2px;
  font-size: 14.5px; font-weight: 650; color: var(--accent-soft);
  transition: gap .25s var(--ease), color .2s var(--ease);
}
.game-card:hover .game-card__btn { gap: 11px; color: #fff; }
.game-card__btn .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.game-note { margin-top: 18px; font-size: 13px; line-height: 1.6; color: rgba(255, 255, 255, .50); }
.game-note a { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 3px; }

/* —— 搜索 —— */
.sheet--search { place-items: start center; padding-top: max(10vh, 40px); }
.sheet--search .sheet-window { width: min(680px, 100%); max-height: min(76svh, 640px); }
.search-box { display: flex; align-items: center; gap: 12px; flex: none; padding: 0 16px 0 22px; border-bottom: 1px solid rgba(255, 255, 255, .10); }
.search-box > .icon { width: 20px; height: 20px; color: rgba(255, 255, 255, .55); }
.search-input { flex: 1; min-width: 0; height: 64px; border: 0; outline: 0; background: none; font: inherit; font-size: 18px; color: #fff; }
.search-input::placeholder { color: rgba(255, 255, 255, .40); }
.search-kbd { padding: 3px 8px; border-radius: 7px; font-family: var(--font-mono); font-size: 11.5px; color: rgba(255, 255, 255, .60); background: rgba(255, 255, 255, .10); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.search-results { list-style: none; }
.search-item a { display: block; padding: 14px 22px; transition: background .15s var(--ease); }
.search-item a:hover, .search-item.is-on a { background: rgba(255, 255, 255, .09); }
.search-item__title { font-size: 15.5px; font-weight: 600; }
.search-item__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; font-size: 12.5px; color: rgba(255, 255, 255, .52); }
.search-item__excerpt {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 5px; font-size: 13.5px; line-height: 1.6; color: rgba(255, 255, 255, .66);
}
.search-item mark { padding: 0 2px; border-radius: 3px; color: #1a1030; background: #ffd166; }
.search-tip { padding: 36px 22px; text-align: center; font-size: 14px; line-height: 1.8; color: rgba(255, 255, 255, .55); }

/* —— 外观设置（菜单栏右上角弹出的小面板） —— */
.pop {
  position: fixed; z-index: 70; top: 62px; right: max(14px, env(safe-area-inset-right));
  width: min(320px, calc(100vw - 28px)); padding: 16px;
  border-radius: 22px; color: #fff;
  background: linear-gradient(160deg, rgba(40, 42, 66, .94), rgba(18, 19, 34, .97));
  -webkit-backdrop-filter: blur(36px) saturate(160%); backdrop-filter: blur(36px) saturate(160%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 0 0 1px rgba(255, 255, 255, .12);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.97); transform-origin: top right;
  transition: opacity .25s var(--ease), transform .35s var(--ease-out), visibility 0s .35s;
}
.pop.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.pop-row { display: flex; flex-direction: column; gap: 9px; }
.pop-row + .pop-row { margin-top: 15px; padding-top: 15px; border-top: 1px solid rgba(255, 255, 255, .10); }
.pop-label { font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .56); }
.pop-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pop-links a { padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 550; background: rgba(255, 255, 255, .08); transition: background .2s var(--ease); }
.pop-links a:hover { background: rgba(255, 255, 255, .15); }
.pop-links a[aria-current="page"] { color: #1a1c2c; background: #fff; }
.seg { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, .08); }
.seg button { flex: 1; padding: 7px 0; border-radius: 9px; font-size: 13.5px; font-weight: 550; color: rgba(255, 255, 255, .66); transition: color .2s var(--ease), background .25s var(--ease); }
.seg button.is-on { color: #1a1c2c; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .22); }
.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.swatch {
  position: relative; height: 48px; overflow: hidden;
  border-radius: 12px; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .26), 0 4px 10px rgba(0, 0, 0, .25);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease);
}
.swatch:hover { transform: translateY(-2px); }
.swatch.is-on { box-shadow: 0 0 0 2px #fff, inset 0 0 0 1px rgba(255, 255, 255, .3), 0 6px 14px rgba(0, 0, 0, .3); }
.swatch::after {
  content: attr(data-name); position: absolute; left: 0; right: 0; bottom: 0;
  padding-top: 9px; font-size: 10.5px; line-height: 1.4; text-align: center; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
  background: linear-gradient(transparent, rgba(0, 0, 0, .46));
}
.swatch--starry { background: url("../images/wallpapers/starry-night-thumb.webp") center / cover no-repeat; }
.swatch--dusk { background: linear-gradient(180deg, #101a3e, #6e3050 60%, #d8623f); }
.swatch--ocean { background: linear-gradient(180deg, #05283c, #075068 60%, #3cbcb4); }
.swatch--ink { background: linear-gradient(180deg, #13151b, #343845 60%, #ffcf87); }
.swatch--sakura { background: linear-gradient(180deg, #2a1448, #a43c70 60%, #f28e80); }
.swatch--custom { display: grid; place-items: center; background: rgba(255, 255, 255, .10); }
.swatch--custom::after { content: "上传"; }
.swatch--custom .icon { position: relative; z-index: 1; width: 18px; height: 18px; margin-bottom: 8px; }
.swatch--custom input { position: absolute; inset: 0; z-index: 2; opacity: 0; cursor: pointer; }
.switch { display: flex; align-items: center; justify-content: space-between; font-size: 14px; cursor: pointer; }
.switch input {
  position: relative; width: 44px; height: 26px; margin: 0;
  appearance: none; -webkit-appearance: none; border-radius: 999px;
  background: rgba(255, 255, 255, .18); cursor: pointer;
  transition: background .25s var(--ease);
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .30);
  transition: transform .3s var(--ease-out);
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }


/* 回到顶部 */
.to-top {
  position: fixed; z-index: 55; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  color: var(--on-accent-text); background: var(--accent-text);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .28);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s var(--ease), transform .35s var(--ease-out), visibility 0s .35s, filter .2s var(--ease);
}
.to-top.is-show { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.to-top:hover { filter: brightness(1.08); transform: translateY(-2px); }
.to-top .icon { width: 21px; height: 21px; stroke-width: 2.5; }


/* ==========================================================================
   12. 页脚
   ========================================================================== */
.foot { position: relative; z-index: 2; padding: 0 24px 36px; color: var(--ink-2); text-shadow: var(--ink-shadow); }
html[data-view="home"] .foot { padding-bottom: 120px; }
html:not([data-view="home"]) .foot { color: var(--text-3); text-shadow: none; }
.foot-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  padding-top: 22px; border-top: 1px solid var(--ink-line);
  font-size: 13px; line-height: 1.7;
}
html:not([data-view="home"]) .foot-inner { border-top-color: var(--line); }
.foot a { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .28); text-underline-offset: 3px; transition: color .2s var(--ease); }
.foot a:hover { color: var(--ink); }
html:not([data-view="home"]) .foot a { text-decoration-color: var(--line); }
html:not([data-view="home"]) .foot a:hover { color: var(--text); }
.foot-links { display: flex; align-items: center; gap: 16px; }
.foot-links a { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.foot-links .icon { width: 15px; height: 15px; }


/* ==========================================================================
   13. 动画
   ========================================================================== */
@keyframes twinkle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.4); opacity: .3; } }
@keyframes sun-breathe { 0%, 100% { opacity: .93; transform: scale(1); } 50% { opacity: 1; transform: scale(1.035); } }
@keyframes lock-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes hint-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 26px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 入场：html.is-booting 由脚本在页面开头加上，解锁后换成 html.is-ready 开始播放 */
html.is-booting .widget, html.is-booting .dock { opacity: 0; }
html.is-ready .widget { animation: rise .85s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }
html.is-ready .dock { animation: dock-in .8s var(--ease-out) .5s both; }
html.is-ready .feed { animation: rise .9s var(--ease-out) .5s both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
}


/* ==========================================================================
   14. 响应式（窄屏适配）
   ========================================================================== */

/* 笔记本：屏幕偏矮时把组件压矮一点，保证一屏放得下 */
@media (max-height: 830px) and (min-width: 1040px) {
  .widgets { grid-auto-rows: 156px; }
  .w-weather, .w-cal { padding-top: 12px; padding-bottom: 10px; }
  .cal-week { margin-top: 4px; }
  .now-time { font-size: 84px; }
  .now-greet { font-size: 20px; }
  .desk { padding-top: 70px; padding-bottom: 128px; }
}

/* 平板：两列 */
@media (max-width: 1039px) {
  .bar-nav { display: none; }
  .widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(160px, auto); }
  .w-now, .w-posts { grid-column: span 1; grid-row: span 1; min-height: 344px; }
  .now-time { font-size: 76px; }
  .w-weather, .w-cal { grid-column: span 1; }
  .w-games, .w-tools, .w-gallery { grid-column: span 2; }
  .w-tools__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .w-tool__icon { max-width: 42px; }
  .feed-grid { grid-template-columns: minmax(0, 1fr); }

  .dock { position: static; gap: 0; margin: 14px auto 0; padding: 7px 8px 6px; border-radius: 24px; width: max-content; max-width: 100%; transform: none; }
  html.is-ready .dock { animation-name: rise; }
  .desk { padding-bottom: 16px; }
  .feed { padding-top: 28px; }
}

/* 手机 */
@media (max-width: 719px) {
  .bar { height: 52px; }
  .desk { place-items: start center; padding: 66px 14px 122px; }
  .widgets { gap: 12px; grid-auto-rows: minmax(164px, auto); }

  /* 时钟：左边时间，右边日期；下面左边问候，右边一言 */
  .w-now { grid-column: span 2; min-height: 0; padding: 22px 22px 20px; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 18px; }
  .now-time { grid-column: 1; grid-row: 1 / span 2; align-self: center; font-size: 62px; }
  .now-date { grid-column: 2; grid-row: 1; align-self: end; flex-direction: column; gap: 1px; margin-top: 0; font-size: 15px; line-height: 1.4; }
  .now-lunar { font-size: 12.5px; }
  .now-foot { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; margin-top: 18px; }
  .now-greet { font-size: 19px; }
  .now-sub { font-size: 13px; }
  .now-quote { margin-top: 0; padding-top: 0; border-top: 0; }
  .now-quote blockquote { font-size: 15px; }

  .w-posts { grid-column: span 2; min-height: 0; padding-bottom: 12px; }
  .w-postlist a { flex: none; padding: 10px 12px; }
  .w-weather, .w-cal { grid-column: span 1; padding: 16px; }
  .wx-main { gap: 8px; }
  .wx-icon { width: 30px; height: 30px; }
  .wx-icon .icon { width: 30px; height: 30px; }
  .wx-temp { font-size: 34px; }
  .wx-hours li:nth-child(n + 4) { display: none; }
  .cal-days span { height: min(100%, 22px); }

  .w-games { grid-column: span 2; }
  .w-tools, .w-gallery { grid-column: span 1; }
  .w-tools { padding: 16px; }
  .w-tools__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: none; margin-top: 8px; }
  .w-tool { gap: 5px; font-size: 10.5px; }
  .w-tool__icon { max-width: 38px; }
  .w-tool:nth-child(4) { display: none; }
  .w-tool__more { max-width: 38px; }

  .dock { margin-top: 2px; }
  .app { width: 50px; gap: 4px; }
  .app-icon { width: 46px; height: 46px; border-radius: 13px; }
  .app-icon .icon { width: 23px; height: 23px; }
  .app-label { font-size: 10px; }

  .feed { padding: 28px 14px 24px; }
  .feed-title { font-size: 23px; }
  .feed-grid { gap: 12px; }
  .post-card { padding: 20px; border-radius: 24px; }
  .post-card__cover { width: calc(100% + 40px); margin: -20px -20px 16px; }
  .post-card__title { font-size: 18.5px; }
  .post-card__excerpt { font-size: 14px; }
  .feed-tags { margin-top: 40px; }

  .page { padding: 88px 14px 44px; }
  .list { padding: 12px 18px 16px; }
  .post { padding: 86px 14px 40px; }
  .post-body { padding: 24px 20px 28px; border-radius: 22px; font-size: 16.5px; }
  .post-body h2 { font-size: 23px; }
  .post-body h3 { font-size: 19.5px; }
  .post-body img.post-cover, .post-body picture.post-cover { width: calc(100% + 40px); margin: 0 -20px 22px; aspect-ratio: 16 / 8; }
  .wall-picture img { object-position: 88% 50%; }
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-row a { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .post-row__date { font-size: 12.5px; }
  .post-row__tags { display: none; }
  .mini-list a { grid-template-columns: 76px minmax(0, 1fr); gap: 10px; }
  .friends { grid-template-columns: minmax(0, 1fr); }
  .project-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gal-item figcaption { opacity: 1; }

  .sheet { padding: 10px; }
  .sheet-window { max-height: calc(100svh - 20px); border-radius: 22px; }
  .sheet-head { padding: 12px 10px 12px 18px; }
  .sheet-body { padding: 16px; }
  .calc-btn { font-size: 21px; }
  .calc-display { font-size: 44px; }
  .lightbox { padding: 14px; }
  .lightbox__btn { top: 10px; right: 10px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .foot { padding: 0 14px 32px; }
}
