/* 午夜施工 2026-10-15：新增样式集中于此（独立文件，便于回滚与送审） */

/* ============ D2: 菜单栏时钟 ============ */
.mb-clock {
  background: none; border: 0; padding: 3px 8px; margin: 0;
  font: inherit; color: inherit; cursor: pointer; border-radius: 7px;
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  transition: background 0.2s ease;
}
.mb-clock:hover { background: rgba(120, 90, 60, 0.12); }
[data-theme="dark"] .mb-clock:hover { background: rgba(255, 255, 255, 0.10); }
.mb-clockpop {
  position: fixed; top: 50px; right: 14px; z-index: 700;
  min-width: 210px; padding: 16px 18px 14px; border-radius: 18px;
  text-align: center;
  transform-origin: top right;
  transform: scale(0.92) translateY(-6px); opacity: 0;
  transition: transform 0.28s var(--ease-spring), opacity 0.2s ease;
  pointer-events: none;
}
.mb-clockpop.show { transform: none; opacity: 1; pointer-events: auto; }
.mb-clockpop .cp-date { font-size: 26px; font-weight: 600; color: var(--label); letter-spacing: 0.02em; }
.mb-clockpop .cp-week { margin-top: 6px; font-size: 13.5px; color: var(--label-2); letter-spacing: 0.24em; text-indent: 0.24em; }
.mb-clockpop .cp-time {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(120, 90, 60, 0.14);
  font-family: var(--font-mono); font-size: 13px; color: var(--label-2);
  font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) {
  .mb-clockpop { transition: opacity 0.15s ease; transform: none; }
}

/* ============ D4: 桌面右键菜单 ============ */
.ctx-menu {
  position: fixed; z-index: 900; min-width: 220px;
  padding: 6px; border-radius: 14px;
  transform-origin: top left;
  transform: scale(0.94); opacity: 0;
  transition: transform 0.18s var(--ease-spring), opacity 0.15s ease;
  pointer-events: none;
}
.ctx-menu.show { transform: none; opacity: 1; pointer-events: auto; }
.ctx-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; padding: 7px 12px; border: 0; background: none;
  font: inherit; font-size: 13.5px; color: var(--label); text-align: left;
  border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.ctx-item:hover, .ctx-item.hl { background: rgba(120, 90, 60, 0.14); }
[data-theme="dark"] .ctx-item:hover, [data-theme="dark"] .ctx-item.hl { background: rgba(255,255,255,0.10); }
.ctx-item .ctx-arrow { color: var(--label-3); font-size: 12px; }
.ctx-sep { height: 1px; margin: 5px 10px; background: rgba(120, 90, 60, 0.16); }
[data-theme="dark"] .ctx-sep { background: rgba(255,255,255,0.12); }
.ctx-sub {
  position: fixed; z-index: 901; min-width: 160px;
  padding: 6px; border-radius: 14px;
  transform: scale(0.94); opacity: 0;
  transition: transform 0.16s var(--ease-spring), opacity 0.14s ease;
  pointer-events: none;
}
.ctx-sub.show { transform: none; opacity: 1; pointer-events: auto; }
.ctx-item .ctx-check { width: 16px; color: var(--label-2); font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .ctx-menu, .ctx-sub { transition: opacity 0.12s ease; transform: none; }
}

/* ============ D7: 菜单栏问候语 ============ */
.mb-greet {
  font-size: 12.5px; color: var(--label-2); letter-spacing: 0.06em;
  transition: opacity 0.6s ease;
}
.mb-greet.swap { opacity: 0; }

/* ============ D8: 窗口打开/关闭动画 ============ */
.app-window { animation: win-in 0.22s ease-out; }
@keyframes win-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: none; }
}
.app-window.win-closing {
  opacity: 0 !important;
  transform: scale(0.96) translateY(8px) !important;
  transition: opacity 0.18s ease, transform 0.18s ease !important;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .app-window { animation: none; }
  .app-window.win-closing { transition: none !important; }
}

/* ============ D9: 桌面环境尘埃 ============ */
.dust-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

/* ============ A1: 阅读进度条 ============ */
.rd-progress {
  position: absolute; top: 44px; left: 12px; right: 12px; height: 3px; z-index: 6;
  border-radius: 2px; overflow: hidden; pointer-events: none;
  background: rgba(120, 90, 60, 0.10);
}
[data-theme="dark"] .rd-progress { background: rgba(255,255,255,0.08); }
.rd-progress i {
  display: block; height: 100%; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, #D8B183, #B98D5E);
}

/* ============ A3: 文章列表柔和卡片 ============ */
.notes-list { gap: 10px; }
.notes-list a {
  background: #FDFBF7;
  border: 1px solid rgba(90,70,50,0.10);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(90,70,50,.06), 0 8px 20px rgba(90,70,50,.08);
  padding: 14px 16px;
  transition: background 0.2s ease, transform 0.2s var(--ease-ios), box-shadow 0.25s ease, border-color 0.2s ease;
}
.notes-list a:hover {
  background: #FFFEFA;
  border-color: rgba(90,70,50,0.16);
  box-shadow: 0 2px 4px rgba(90,70,50,.08), 0 14px 32px rgba(90,70,50,.13);
  transform: translateX(4px);
}
.notes-list a:active { transform: translateX(2px) scale(0.995); }
[data-theme="dark"] .notes-list a { background: #2e2a25; border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .notes-list a:hover { background: #34302a; border-color: rgba(255,255,255,0.12); }

/* ============ A4: 字数与阅读时长 ============ */
.article-sub { display: flex; align-items: baseline; gap: 10px; }
.article-meta { font-size: 12.5px; color: var(--label-3); letter-spacing: 0.04em; }

/* ============ A5: 下一篇导航卡片 ============ */
.next-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 44px; padding: 16px 18px;
  background: #FDFBF7; border: 1px solid rgba(90,70,50,0.10); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(90,70,50,.06), 0 8px 20px rgba(90,70,50,.08);
  text-decoration: none; color: var(--label);
  transition: transform 0.2s var(--ease-ios), box-shadow 0.25s ease, border-color 0.2s ease;
}
.next-card:hover {
  transform: translateY(-2px); border-color: rgba(90,70,50,0.16);
  box-shadow: 0 2px 4px rgba(90,70,50,.08), 0 14px 32px rgba(90,70,50,.13);
}
.next-label { font-size: 12.5px; color: var(--label-3); letter-spacing: 0.22em; flex-shrink: 0; }
.next-title { font-size: 16px; font-weight: 500; }
[data-theme="dark"] .next-card { background: #2e2a25; border-color: rgba(255,255,255,0.08); }

/* ============ A6: 复制链接 + toast ============ */
.win-copy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent;
  color: var(--label-2); cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.win-copy:hover { background: rgba(120,90,60,0.10); color: var(--label); }
.win-copy:active { transform: scale(0.92); }
.toast {
  position: fixed; bottom: 96px; left: 50%; z-index: 9999;
  transform: translateX(-50%) translateY(10px);
  background: rgba(45,38,30,0.88); color: #FFFDF8;
  font-size: 13px; letter-spacing: 0.04em;
  padding: 9px 18px; border-radius: 20px; pointer-events: none;
  opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(60,45,30,0.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ A7: 代码块复制按钮 ============ */
.article-body pre { position: relative; }
.code-copy {
  position: absolute; top: 8px; right: 8px;
  font-size: 12px; letter-spacing: 0.06em; padding: 4px 12px;
  border-radius: 8px; border: 1px solid rgba(90,70,50,0.14);
  background: rgba(255,253,248,0.85); color: var(--label-2); cursor: pointer;
  opacity: 0; transition: opacity 0.2s ease, background 0.2s ease;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.article-body pre:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.code-copy:hover { background: #fff; color: var(--label); }
[data-theme="dark"] .code-copy { background: rgba(40,36,32,0.85); border-color: rgba(255,255,255,0.12); }
@media (hover: none) { .code-copy { opacity: 0.75; } }

/* ============ A8: 标题锚点 ============ */
.article-body h2, .article-body h3 { scroll-margin-top: 20px; }
.h-anchor {
  margin-left: 10px; font-size: 0.75em; font-weight: 400;
  color: var(--label-3); text-decoration: none;
  opacity: 0; transition: opacity 0.2s ease, color 0.2s ease;
}
.article-body h2:hover .h-anchor, .article-body h3:hover .h-anchor,
.h-anchor:focus-visible { opacity: 1; }
.h-anchor:hover { color: #B98D5E; }

/* ============ A9: 图片 Lightbox ============ */
.article-body img { cursor: zoom-in; }
.lb-backdrop {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  background: rgba(22,17,12,0.86);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.3s ease; cursor: zoom-out;
}
.lb-backdrop.show { opacity: 1; }
.lb-backdrop img {
  max-width: 90vw; max-height: 86vh; border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
  transform: scale(0.95); transition: transform 0.32s var(--ease-ios);
  cursor: default;
}
.lb-backdrop.show img { transform: scale(1); }
.lb-close {
  position: absolute; top: 22px; right: 26px;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,0.14); color: #fff; font-size: 20px; line-height: 1;
  cursor: pointer; transition: background 0.2s ease, transform 0.15s ease;
}
.lb-close:hover { background: rgba(255,255,255,0.24); }
.lb-close:active { transform: scale(0.92); }
@media (prefers-reduced-motion: reduce) {
  .lb-backdrop, .lb-backdrop img { transition: none; }
}

/* ============ A10: 打印样式 ============ */
@media print {
  .menubar, .dock, #hero3d, #macboot, .ios-tabbar, .dust-canvas,
  .wordmark-wrap, .toast, .lb-backdrop,
  .win-titlebar, .rd-progress, .code-copy, .h-anchor,
  .next-card, .back-link, .wm-search-backdrop { display: none !important; }
  body, .macos, .desktop { background: #fff !important; }
  .desktop { position: static !important; }
  .app-window {
    position: static !important; inset: auto !important;
    width: 100% !important; max-width: 720px !important; max-height: none !important;
    margin: 0 auto !important; transform: none !important; opacity: 1 !important;
    box-shadow: none !important; border: 0 !important; border-radius: 0 !important;
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    background: #fff !important;
    animation: none !important;
  }
  .app-window[data-win="photos"], .app-window[data-win="about"] { display: none !important; }
  .win-body { overflow: visible !important; max-height: none !important; padding: 0 !important; }
  .article-body { color: #222 !important; }
  .article-body a { color: #222 !important; text-decoration: none !important; }
}

/* ============ P1: 404 页面 ============ */
.nf-wrap {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.nf-win { pointer-events: auto; width: 380px; position: relative; }
.nf-body { text-align: center; padding: 44px 32px 40px !important; }
.nf-code {
  font-family: var(--serif); font-size: 76px; font-weight: 600;
  letter-spacing: 0.02em; line-height: 1; color: var(--label);
  margin-bottom: 14px;
}
.nf-text { color: var(--label-2); font-size: 15px; letter-spacing: 0.06em; margin-bottom: 26px; }
.nf-home {
  display: inline-block; padding: 10px 26px; border-radius: 20px;
  background: #B98D5E; color: #FFFDF8; text-decoration: none;
  font-size: 14px; letter-spacing: 0.08em;
  transition: transform 0.2s var(--ease-ios), background 0.2s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 14px rgba(150,110,70,0.25);
}
.nf-home:hover { background: #A87F52; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(150,110,70,0.3); }
.nf-home:active { transform: translateY(0) scale(0.98); }
.nf-win .tl[disabled] { opacity: 0.5; cursor: default; }
.nf-win .tl[disabled]:hover { filter: none; transform: none; }

/* ============ P2: RSS 入口 ============ */
.mb-rss {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  color: var(--label-2); text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.mb-rss:hover { background: rgba(120,90,60,0.10); color: var(--label); transform: translateY(-1px); }
.mb-rss:active { transform: scale(0.92); }

/* ============ P3: 选区与滚动条 ============ */
::selection { background: rgba(185,141,94,0.30); color: inherit; }
[data-theme="dark"] ::selection { background: rgba(185,141,94,0.38); }

* { scrollbar-width: thin; scrollbar-color: rgba(120,95,65,0.32) transparent; }
[data-theme="dark"] * { scrollbar-color: rgba(200,170,130,0.30) transparent; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(120,95,65,0.30);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(120,95,65,0.48);
  border: 3px solid transparent;
  background-clip: padding-box;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(200,170,130,0.28); border: 3px solid transparent; background-clip: padding-box; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(200,170,130,0.42); border: 3px solid transparent; background-clip: padding-box; }

/* ============ P4: 深浅模式平滑过渡 ============ */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color 0.4s ease, border-color 0.4s ease,
    color 0.4s ease, fill 0.4s ease, stroke 0.4s ease,
    box-shadow 0.4s ease, outline-color 0.4s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  .theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
    transition: none !important;
  }
}

/* ============ P8: 图片懒加载淡入 ============ */
img[loading="lazy"] { opacity: 0; transition: opacity 0.6s ease; }
img[loading="lazy"].img-loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  img[loading="lazy"] { opacity: 1; transition: none; }
}

/* ============ P9: 菜单栏 Like Memo 下拉（关于本机入口） ============ */
.mb-menu-wrap { position: relative; display: inline-flex; }
.mb-appname {
  background: none; border: 0; padding: 4px 8px; margin: 0;
  font: inherit; color: inherit; cursor: pointer; border-radius: 6px;
  transition: background 0.2s ease;
}
.mb-appname:hover { background: rgba(120,90,60,0.10); }
.mb-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 9000;
  min-width: 150px; padding: 6px; border-radius: 12px;
  opacity: 0; transform: translateY(-4px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s var(--ease-ios);
  pointer-events: none;
}
.mb-dropdown.show { opacity: 1; transform: none; pointer-events: auto; }
.mb-drop-item {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; color: var(--label); cursor: pointer;
  transition: background 0.15s ease;
}
.mb-drop-item:hover { background: rgba(120,90,60,0.12); }
@media (prefers-reduced-motion: reduce) {
  .mb-dropdown { transition: none; }
}
