/* ================================================================
   Anonymous Blog — Windows Phone Metro UI（动态磁贴版）
   ================================================================ */
:root {
  --accent: var(--site-accent, #1ba1e2);
  --on-accent: #fff;
  --danger: #e51400;
  --bg: #000;
  --fg: #fff;
  --dim: #9a9a9a;
  --surface: #1a1a1a;
  --surface-2: #262626;
  --line: #333;
  --field: #cfcfcf;
  --field-fg: #000;
  --code-bg: #111;
  --font: 'Segoe UI', 'Segoe WP', Selawik, 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Cascadia Code', Consolas, 'JetBrains Mono', Menlo, monospace;
  /* Windows Phone 8.1 物理缓动：进入 / 滑动用极速爆发 + 长阻尼收尾，飞离用蓄力加速 */
  --metro-ease-out: cubic-bezier(0.1, 0.9, 0.2, 1);
  --metro-ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease: var(--metro-ease-out);
  --gap: 8px;
  --pad: 24px;
  --maxw: 1200px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg: #fff;
    --fg: #000;
    --dim: #666;
    --surface: #f2f2f2;
    --surface-2: #e6e6e6;
    --line: #d4d4d4;
    --field: #fff;
    --code-bg: #f6f6f6;
    color-scheme: light;
  }
}
:root[data-theme='light'] {
  --bg: #fff;
  --fg: #000;
  --dim: #666;
  --surface: #f2f2f2;
  --surface-2: #e6e6e6;
  --line: #d4d4d4;
  --field: #fff;
  --code-bg: #f6f6f6;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border-radius: 0;
}
img {
  max-width: 100%;
}
:focus-visible {
  outline: 2px dashed var(--fg);
  outline-offset: 2px;
}
.ico {
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.22em;
  flex: none;
}
.ico-inline {
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.25em;
  vertical-align: -0.08em;
}
.muted {
  color: var(--dim);
}
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px var(--pad) 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1;
}

/* ---------------- 顶栏（内页） ---------------- */
.bar {
  display: flex;
  align-items: center;
  gap: 16px 28px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.brand-back {
  width: 34px;
  height: 34px;
  padding: 5px;
  border: 2px solid var(--fg);
  border-radius: 50%;
}
.brand:hover .brand-back {
  background: var(--fg);
  color: var(--bg);
}
.pivot {
  display: flex;
  gap: 22px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.pivot a {
  font-size: 26px;
  font-weight: 300;
  text-decoration: none;
  color: var(--dim);
  white-space: nowrap;
  transition: color 0.15s;
}
.pivot a:hover,
.pivot a[aria-current] {
  color: var(--fg);
}
.chrome {
  display: flex;
  gap: 6px;
}
.chrome-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 36px;
  height: 34px;
  padding: 0 10px;
  background: transparent;
  border: 2px solid var(--fg);
  font-size: 13px;
  font-weight: 600;
}
.chrome-btn:active {
  background: var(--fg);
  color: var(--bg);
}
.chrome-btn.swatch {
  background: var(--accent);
  border-color: var(--accent);
  width: 34px;
  min-width: 34px;
}
.accents {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  animation: drop 0.25s var(--ease);
}
.accent-dot {
  aspect-ratio: 1;
  border: 0;
  background: var(--c);
}

/* ---------------- 开始屏幕 ----------------
   性能约定：所有动画只改 transform / opacity（GPU 合成层），不改 top/left/width/height。
   分层：.tile（网格位置：FLIP / 拖拽）> .tile-body（景深：浮起 / 下沉 / 呼吸）
        > .tile-tilt（3D 按压倾斜）> .tile-stage（内容：相册层 + 文字层，Peek 时整体上下滑动）
   ---------------------------------------------------------------- */
:root {
  --metro: var(--metro-ease-out);
}
.start-wall {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.start-wall img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.start-wall::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), var(--bg) 85%);
}
:root[data-theme='light'] .start-wall img {
  opacity: 0.4;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) .start-wall img {
    opacity: 0.4;
  }
}
.start-head {
  margin-bottom: 18px;
}
.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand-sm {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.start-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.start-tools .accents {
  flex-basis: 100%;
}
.start-title {
  font-size: clamp(48px, 8vw, 92px);
  font-weight: 200;
  line-height: 1.05;
  margin: 12px 0 4px -3px;
  letter-spacing: -0.01em;
}
.subtitle {
  margin: 0;
  color: var(--dim);
  font-size: 18px;
  font-weight: 300;
}

.start {
  --cols: 4;
  --unit: calc((min(100vw, var(--maxw)) - 2 * var(--pad) - (var(--cols) - 1) * var(--gap)) / var(--cols));
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: var(--unit);
  grid-auto-flow: dense;
  gap: var(--gap);
}
@media (min-width: 640px) {
  .start {
    --cols: 8;
  }
}
@media (min-width: 1040px) {
  .start {
    --cols: 12;
  }
}

/* 网格层：FLIP 与拖拽只作用在这一层 */
.tile {
  --tile: var(--accent);
  position: relative;
  z-index: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tile-s { grid-column: span 1; grid-row: span 1; }
.tile-m { grid-column: span 2; grid-row: span 2; }
.tile-w { grid-column: span 4; grid-row: span 2; }
.tile-l { grid-column: span 4; grid-row: span 4; }
.tile.flipping,
.tile.dragging,
.tile.dropping {
  will-change: transform;
}
.tile.dragging {
  z-index: 30;
  cursor: grabbing;
}

/* 景深层：编辑模式的浮起 / 下沉 */
.tile-body {
  position: absolute;
  inset: 0;
  transform: translate3d(0, 0, 0);
  transition:
    transform 0.4s var(--metro),
    opacity 0.4s var(--metro);
  animation: turnstile 0.6s var(--metro) backwards;
  transform-origin: 50% 50%;
}
.tile:nth-child(2) .tile-body { animation-delay: 0.03s; }
.tile:nth-child(3) .tile-body { animation-delay: 0.06s; }
.tile:nth-child(4) .tile-body { animation-delay: 0.09s; }
.tile:nth-child(5) .tile-body { animation-delay: 0.12s; }
.tile:nth-child(6) .tile-body { animation-delay: 0.15s; }
.tile:nth-child(7) .tile-body { animation-delay: 0.18s; }
.tile:nth-child(n + 8) .tile-body { animation-delay: 0.21s; }
/* 阴影单独放一层，只切换 opacity，避免每帧重绘 box-shadow */
.tile-body::before {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.6),
    0 6px 14px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.4s var(--metro);
  pointer-events: none;
}

/* 倾斜层：磁贴表面 */
.tile-tilt {
  position: absolute;
  inset: 0;
  background: var(--tile);
  color: var(--on-accent);
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  transition: transform 0.45s var(--metro);
  backface-visibility: hidden;
}
.tile.pressing .tile-tilt {
  transition: transform 0.12s var(--metro-ease-out);
  will-change: transform;
}
.tile.glass .tile-tilt {
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
:root[data-theme='light'] .tile.glass .tile-tilt {
  background: rgba(0, 0, 0, 0.3);
}
.tile-link {
  position: absolute;
  inset: 0;
  display: block;
  color: inherit;
  text-decoration: none;
  -webkit-user-drag: none;
}

/* 内容层 */
.tile-stage {
  position: absolute;
  inset: 0;
}
.album,
.faces {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  overflow: hidden;
}
.album {
  background: #000;
}
.album-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition:
    opacity 1.2s var(--metro-ease-out),
    transform 0.9s var(--metro);
  backface-visibility: hidden;
}
.album-item.is-on {
  opacity: 1;
}
.album-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
}
/* Ken Burns：只有当前图片在缓慢推拉，参数由脚本随机生成 */
.album-item.is-on img.kb {
  animation: kenburns var(--kb-d, 14s) ease-in-out infinite alternate;
  will-change: transform;
}
.tile.paused .album-item img,
.tile.paused .face {
  animation-play-state: paused;
}
/* 轮换模式：图片左右滑动切换 */
.live-cycle .album-item {
  opacity: 1;
  transform: translate3d(100%, 0, 0);
}
.live-cycle .album-item.is-on {
  transform: translate3d(0, 0, 0);
}
.live-cycle .album-item.is-out {
  transform: translate3d(-100%, 0, 0);
}

/* 文字层 */
.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 14px 34px;
  opacity: 0;
  transition:
    opacity 0.5s var(--metro-ease-out),
    transform 0.7s var(--metro);
  backface-visibility: hidden;
}
.face.is-on {
  opacity: 1;
}
.live-cycle .face {
  transform: translate3d(0, 45%, 0);
}
.live-cycle .face.is-on {
  transform: translate3d(0, 0, 0);
}
.live-cycle .face.is-out {
  transform: translate3d(0, -45%, 0);
}
.live-flip .face {
  transform: perspective(700px) rotateX(90deg);
  transition:
    opacity 0.25s var(--metro-ease-out),
    transform 0.55s var(--metro);
}
.live-flip .face.is-on {
  transform: perspective(700px) rotateX(0deg);
  transition-delay: 0.22s;
}
.live-flip .face.is-out {
  transform: perspective(700px) rotateX(-90deg);
  transition-delay: 0s;
}
/* 图片之上的文字：底部渐变保证可读 */
.has-album:not(.live-peek) .faces {
  background: linear-gradient(transparent 35%, rgba(0, 0, 0, 0.62));
}

/* Peek：相册层与文字层上下排列，整体滑动 */
.live-peek .tile-stage {
  height: 200%;
  transform: translate3d(0, 0, 0);
  transition: transform 0.85s var(--metro);
}
.live-peek .album,
.live-peek .faces {
  height: 50%;
}
.live-peek .faces {
  top: 50%;
}
.live-peek.peeked .tile-stage {
  transform: translate3d(0, -50%, 0);
}

.face-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.face-title {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-w .face-title,
.tile-l .face-title {
  font-size: 22px;
  font-weight: 300;
}
.face-text {
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.92;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.face-text-lg {
  font-size: 18px;
  font-weight: 300;
  -webkit-line-clamp: 6;
}
.face-meta {
  font-size: 12px;
  opacity: 0.8;
}
.face-num {
  font-size: 54px;
  font-weight: 200;
  line-height: 1;
}
.tile-w .face-num,
.tile-l .face-num {
  font-size: 72px;
}
.face-big {
  font-size: 28px;
  font-weight: 300;
}
.face-caption {
  font-size: 16px;
}
.face-icon {
  align-items: center;
  justify-content: center;
  padding-bottom: 24px;
}
.tile-ico {
  width: 46%;
  height: 46%;
  max-width: 64px;
  max-height: 64px;
  stroke-width: 1.3;
}
.face-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}
.face-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.tile-label {
  position: absolute;
  left: 12px;
  bottom: 8px;
  right: 12px;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.tile-small-ico {
  display: none;
}
/* 小磁贴：有图片显示图片，否则只显示图标 */
.tile-s .faces,
.tile-s .tile-label {
  display: none;
}
.tile-s.live-peek .tile-stage {
  height: 100%;
  transform: none;
}
.tile-s.live-peek .album {
  height: 100%;
}
.tile-s:not(.has-album) .tile-small-ico {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.tile-s .tile-small-ico .ico {
  width: 42%;
  height: 42%;
  stroke-width: 1.4;
}

/* ---------------- 编辑模式（Windows 10 Mobile 悬浮编辑） ---------------- */
.editing .tile {
  touch-action: none;
  cursor: grab;
}
.editing .tile-link {
  pointer-events: none;
}
.editing .tile-body {
  transform: scale3d(0.92, 0.92, 1);
  opacity: 0.55;
}
.editing .tile.focused {
  z-index: 10;
}
.editing .tile.focused .tile-body {
  transform: scale3d(1.06, 1.06, 1);
  opacity: 1;
  animation: hover-float 2.4s ease-in-out 0.4s infinite alternate;
}
.editing .tile.focused .tile-body::before,
.tile.dragging .tile-body::before {
  opacity: 1;
}
.tile.dragging .tile-body {
  transform: scale3d(1.1, 1.1, 1) !important;
  opacity: 1 !important;
  animation: none !important;
}
.tile.removing .tile-body {
  transform: scale3d(0.2, 0.2, 1) !important;
  opacity: 0 !important;
  animation: none !important;
  transition:
    transform 0.24s var(--metro-ease-in),
    opacity 0.24s var(--metro-ease-in);
}
.tile.resized .tile-stage,
.tile.resized .tile-label {
  animation: content-in 0.45s var(--metro);
}
.tile.entering .tile-body {
  animation: pin-in 0.45s var(--metro);
}

/* 四角圆形操作按钮 */
.tile-ctl {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.ctl {
  position: absolute;
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  pointer-events: auto;
  transform: scale3d(0, 0, 1);
  transition: transform 0.32s var(--metro);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}
.ctl .ico {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.tile-ctl.show .ctl {
  transform: scale3d(1, 1, 1);
}
.tile-ctl.show .ctl-tr { transition-delay: 0.04s; }
.tile-ctl.show .ctl-bl { transition-delay: 0.08s; }
.tile-ctl.show .ctl-br { transition-delay: 0.12s; }
.ctl:active {
  transform: scale3d(0.88, 0.88, 1);
}
.ctl-tl { top: -14px; left: -14px; }
.ctl-tr { top: -14px; right: -14px; background: var(--danger); color: #fff; }
.ctl-bl { bottom: -14px; left: -14px; }
.ctl-br { bottom: -14px; right: -14px; }

.edit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
  background: rgba(20, 20, 20, 0.86);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #fff;
  display: flex;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  animation: bar-up 0.35s var(--metro);
}
.edit-bar .btn {
  border-color: #fff;
}
.edit-hint {
  flex-basis: 100%;
  font-size: 12px;
  opacity: 0.75;
}
.unpinned {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.unpinned button {
  border: 2px dashed #fff;
  background: transparent;
  color: #fff;
  padding: 4px 10px;
  font-size: 13px;
}
.edit-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.editing .home-recent,
.editing .site-foot {
  opacity: 0.25;
  transition: opacity 0.3s;
}
.editing .app {
  padding-bottom: 140px;
}

/* 底部面板：图片 / 颜色 */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s;
}
.sheet-backdrop.show {
  opacity: 1;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  max-height: 82vh;
  overflow: auto;
  padding: 18px var(--pad) calc(20px + env(safe-area-inset-bottom));
  background: var(--surface);
  transform: translate3d(0, 100%, 0);
  transition: transform 0.4s var(--metro);
}
.sheet.show {
  transform: translate3d(0, 0, 0);
}
.sheet h3 {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 300;
}
.sheet .hint {
  margin: 0 0 14px;
}
.sheet-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0;
}
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, 44px);
  gap: 8px;
}
.swatch {
  width: 44px;
  height: 44px;
  border: 0;
  background: var(--c);
  position: relative;
}
.swatch.on {
  outline: 3px solid var(--fg);
  outline-offset: 2px;
}
.swatch.glass-swatch {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  font-size: 11px;
  color: var(--fg);
}
.swatch.default-swatch {
  background: var(--site-accent);
  color: #fff;
  font-size: 11px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.gal {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: #000;
  overflow: hidden;
}
.gal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s var(--metro);
}
.gal.on img {
  transform: scale3d(0.86, 0.86, 1);
}
.gal.on::after {
  content: attr(data-n);
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.file-pick {
  position: relative;
  overflow: hidden;
}
.file-pick input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

@keyframes kenburns {
  from {
    transform: scale3d(1.02, 1.02, 1) translate3d(0, 0, 0);
  }
  to {
    transform: scale3d(var(--kb-s, 1.14), var(--kb-s, 1.14), 1) translate3d(var(--kb-x, 2%), var(--kb-y, -2%), 0);
  }
}
@keyframes hover-float {
  from {
    transform: translate3d(0, 0, 0) scale3d(1.06, 1.06, 1);
  }
  to {
    transform: translate3d(0, -5px, 0) scale3d(1.075, 1.075, 1);
  }
}
@keyframes content-in {
  from {
    opacity: 0;
  }
}
@keyframes pin-in {
  from {
    opacity: 0;
    transform: scale3d(0.4, 0.4, 1);
  }
}
@keyframes bar-up {
  from {
    transform: translate3d(0, 100%, 0);
  }
}

/* ---------------- 首页最新文章 / 列表 ---------------- */
.home-recent {
  margin-top: 40px;
}
.section {
  font-size: 30px;
  font-weight: 300;
  margin: 28px 0 14px;
}
.section .count {
  color: var(--accent);
}
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.post-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.post-thumb {
  width: 96px;
  height: 96px;
  background: var(--accent);
  display: grid;
  place-items: center;
  overflow: hidden;
  text-decoration: none;
}
.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-letter {
  font-size: 44px;
  font-weight: 200;
  color: #fff;
}
.post-item-title {
  display: block;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.3;
  text-decoration: none;
}
.post-item-title:hover {
  color: var(--accent);
}
.post-item-meta {
  font-size: 13px;
  color: var(--dim);
  margin: 4px 0;
}
.post-item-meta a {
  color: var(--accent);
  text-decoration: none;
}
.post-item-summary {
  margin: 0;
  color: var(--dim);
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-more {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.page-head {
  margin: 12px 0 24px;
}
.kicker {
  display: inline-block;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
.page-title {
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 200;
  line-height: 1.1;
  margin: 4px 0 8px -2px;
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
}
.pager-n {
  color: var(--dim);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 18px;
  border: 2px solid var(--fg);
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.btn:active {
  background: var(--fg);
  color: var(--bg);
}
.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------------- 归档 / 分类 / 搜索 ---------------- */
.year {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 0 24px;
  margin-bottom: 24px;
}
.year-n {
  font-size: 56px;
  font-weight: 200;
  margin: 0;
  line-height: 1;
  color: var(--accent);
  grid-row: span 99;
}
.month-n {
  font-size: 20px;
  font-weight: 400;
  margin: 4px 0 8px;
}
.month-n .count {
  color: var(--dim);
  font-size: 14px;
}
.timeline {
  list-style: none;
  margin: 0 0 16px;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--line);
}
.timeline li {
  display: flex;
  gap: 14px;
  padding: 4px 0;
}
.timeline time {
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.timeline a {
  text-decoration: none;
}
.timeline a:hover {
  color: var(--accent);
}
.cat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--gap);
}
.cat-tile {
  position: relative;
  aspect-ratio: 1;
  padding: 12px 14px;
  color: #fff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--accent);
}
.cat-1 { background: #0050ef; }
.cat-2 { background: #008a00; }
.cat-3 { background: #6a00ff; }
.cat-4 { background: #d80073; }
.cat-5 { background: #fa6800; }
.cat-6 { background: #00aba9; }
.cat-7 { background: #647687; }
.cat-ico {
  position: absolute;
  top: 12px;
  left: 14px;
  width: 30px;
  height: 30px;
}
.cat-count {
  font-size: 46px;
  font-weight: 200;
  line-height: 1;
}
.cat-name {
  font-size: 16px;
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 2px solid var(--line);
  text-decoration: none;
  font-size: 14px;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.chip span {
  color: var(--dim);
  font-size: 12px;
}
.chip.w-2 { font-size: 16px; }
.chip.w-3 { font-size: 19px; }
.chip.w-4 { font-size: 22px; border-color: var(--accent); }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  padding: 0 0 0 12px;
  border: 2px solid var(--fg);
  margin-bottom: 18px;
}
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 20px;
  padding: 10px 0;
  outline: none;
}
.search-box .btn {
  border: 0;
  min-height: 48px;
}
.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 820px;
}
.search-results li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.sr-title {
  font-size: 22px;
  text-decoration: none;
}
.sr-title:hover {
  color: var(--accent);
}
.sr-snippet {
  margin: 6px 0;
  color: var(--dim);
}
.sr-snippet mark,
mark {
  background: var(--accent);
  color: var(--on-accent);
  padding: 0 2px;
}
.sr-date {
  font-size: 13px;
  color: var(--dim);
}
.notice {
  border-left: 4px solid var(--accent);
  padding: 8px 14px;
  background: var(--surface);
}
.error-page {
  padding: 40px 0;
}
.error-face {
  font-size: 120px;
  font-weight: 200;
  margin: 0;
  line-height: 1;
}

/* ---------------- 文章 ---------------- */
.post {
  max-width: 800px;
}
.post-head {
  margin: 16px 0 24px;
}
.post-title {
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 300;
  line-height: 1.15;
  margin: 6px 0 12px -2px;
}
.post-meta {
  color: var(--dim);
  font-size: 14px;
}
.post-meta a {
  color: var(--accent);
  text-decoration: none;
}
.post-cover {
  margin: 0 0 28px;
}
.post-cover img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: cover;
}
.prose {
  font-size: 17px;
  line-height: 1.8;
  overflow-wrap: break-word;
}
.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-weight: 300;
  line-height: 1.3;
  margin: 1.8em 0 0.6em;
}
.prose h1 { font-size: 36px; }
.prose h2 { font-size: 30px; color: var(--accent); }
.prose h3 { font-size: 24px; font-weight: 400; }
.prose h4 { font-size: 19px; font-weight: 600; }
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose img {
  display: block;
  margin: 1.2em auto;
}
.prose blockquote {
  margin: 1.4em 0;
  padding: 4px 18px;
  border-left: 6px solid var(--accent);
  background: var(--surface);
  color: var(--dim);
}
.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  padding: 2px 6px;
}
.prose pre.code {
  position: relative;
  margin: 1.4em 0;
  padding: 16px 18px;
  background: var(--code-bg);
  border-left: 6px solid var(--accent);
  overflow-x: auto;
  line-height: 1.55;
}
.prose pre.code code {
  background: none;
  padding: 0;
  font-size: 14px;
}
.prose pre.code[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0;
  right: 0;
  padding: 2px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent);
  color: var(--on-accent);
}
.copy-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  padding: 2px 8px;
  opacity: 0;
  transition: opacity 0.15s;
}
.prose pre.code:hover .copy-btn,
.copy-btn:focus {
  opacity: 1;
}
.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.4em 0;
  display: block;
  overflow-x: auto;
}
.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 8px 12px;
}
.prose th {
  background: var(--surface);
  font-weight: 600;
}
.ta-center { text-align: center; }
.ta-right { text-align: right; }
.prose hr {
  border: 0;
  border-top: 2px solid var(--line);
  margin: 2em 0;
}
.math-block {
  overflow-x: auto;
  margin: 1.2em 0;
  font-size: 1.15em;
}
math {
  font-size: 1.08em;
}

/* highlight.js：Metro 配色 */
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-type { color: #1ba1e2; }
.hljs-string, .hljs-attr-value, .hljs-template-tag, .hljs-regexp { color: #8cbf26; }
.hljs-number, .hljs-literal, .hljs-symbol { color: #f09609; }
.hljs-comment, .hljs-quote { color: #808080; font-style: italic; }
.hljs-title, .hljs-section, .hljs-function .hljs-title { color: #e671b8; }
.hljs-attr, .hljs-attribute, .hljs-property, .hljs-variable, .hljs-params { color: #a05000; }
:root:not([data-theme='light']) .hljs-attr,
:root:not([data-theme='light']) .hljs-attribute,
:root:not([data-theme='light']) .hljs-property,
:root:not([data-theme='light']) .hljs-variable,
:root:not([data-theme='light']) .hljs-params { color: #f0a30a; }
.hljs-meta, .hljs-tag, .hljs-name { color: #00aba9; }
.hljs-deletion { color: #e51400; }
.hljs-addition { color: #339933; }

/* 加密文章 */
.locked {
  padding: 32px;
  background: var(--surface);
  border-left: 6px solid var(--accent);
  max-width: 640px;
}
.locked-ico {
  width: 48px;
  height: 48px;
  color: var(--accent);
}
.unlock {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.unlock input {
  flex: 1;
  min-width: 0;
}

.post-foot {
  margin-top: 40px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.adjacent {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-top: 24px;
}
.adj {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--surface);
  text-decoration: none;
  min-height: 96px;
}
.adj:hover {
  background: var(--accent);
  color: var(--on-accent);
}
.adj span {
  font-size: 13px;
  opacity: 0.8;
}
.adj strong {
  font-weight: 400;
  font-size: 18px;
}
.adj.next {
  text-align: right;
  align-items: flex-end;
}

/* ---------------- 评论 ---------------- */
.comments {
  max-width: 800px;
  margin-top: 48px;
  border-top: 1px solid var(--line);
}
.comment {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
}
.c-children {
  margin-top: 4px;
  padding-left: 4px;
  border-left: 2px solid var(--line);
}
.c-children .comment {
  padding-left: 12px;
}
.avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  font-weight: 300;
  background: var(--accent);
}
.av-0 { background: #1ba1e2; }
.av-1 { background: #0050ef; }
.av-2 { background: #008a00; }
.av-3 { background: #6a00ff; }
.av-4 { background: #d80073; }
.av-5 { background: #fa6800; }
.av-6 { background: #00aba9; }
.av-7 { background: #647687; }
.av-8 { background: #a20025; }
.av-9 { background: #825a2c; }
.c-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.c-author {
  font-weight: 600;
  text-decoration: none;
}
a.c-author:hover {
  color: var(--accent);
}
.badge {
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  padding: 1px 6px;
}
.c-to {
  color: var(--accent);
  font-size: 13px;
}
.c-head time {
  color: var(--dim);
  font-size: 12px;
}
.c-content {
  overflow-wrap: anywhere;
}
.c-content p {
  margin: 6px 0;
}
.c-content pre {
  background: var(--code-bg);
  padding: 10px;
  overflow-x: auto;
}
.c-content blockquote {
  margin: 6px 0;
  padding-left: 12px;
  border-left: 4px solid var(--line);
  color: var(--dim);
}
.c-reply,
.link-btn {
  border: 0;
  background: none;
  color: var(--accent);
  padding: 0;
  font-size: 13px;
  font-weight: 600;
}
.c-form {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface);
}
.c-form-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 300;
}
.c-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.label {
  font-size: 13px;
  color: var(--dim);
}
input:not([type='checkbox']),
textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 2px solid transparent;
  border-radius: 0;
  background: var(--field);
  color: var(--field-fg);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
input:focus,
textarea:focus {
  background: #fff;
  border-color: var(--accent);
}
textarea {
  resize: vertical;
}
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  margin: 4px 0 12px;
}
.check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.check i {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--fg);
}
.check input:checked + i {
  background: var(--accent);
  border-color: var(--accent);
}
.check input:checked + i::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.check input:focus-visible + i {
  outline: 2px dashed var(--fg);
  outline-offset: 2px;
}
.cf-turnstile {
  margin: 8px 0 12px;
  min-height: 65px;
}
.c-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.msg {
  font-size: 14px;
}
.msg.ok {
  color: #60a917;
}
.msg.err {
  color: #ff6a5c;
}
.hint {
  font-size: 13px;
  color: var(--dim);
}
.c-replying {
  margin: 0 0 10px;
  color: var(--dim);
}

/* ---------------- 页脚 / 通知 ---------------- */
.site-foot {
  margin-top: 56px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
}
.foot-links a {
  text-decoration: none;
}
.foot-links a:hover {
  color: var(--accent);
}
.onion-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a97ec9;
}
.onion-addr {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
  user-select: all;
}
.toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  animation: drop 0.3s var(--ease);
}

/* ---------------- 动画 ---------------- */
@keyframes turnstile {
  from { opacity: 0; transform: perspective(1000px) rotateY(-80deg); }
}
@keyframes drop {
  from { opacity: 0; transform: translateY(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 720px) {
  :root {
    --pad: 16px;
  }
  .c-fields {
    grid-template-columns: 1fr;
  }
  .year {
    grid-template-columns: 1fr;
  }
  .year-n {
    font-size: 44px;
    margin-bottom: 8px;
  }
  .post-item {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
  }
  .post-thumb {
    width: 64px;
    height: 64px;
  }
  .thumb-letter {
    font-size: 30px;
  }
  .post-item-title {
    font-size: 19px;
  }
  .adjacent {
    grid-template-columns: 1fr;
  }
  .pivot a {
    font-size: 22px;
  }
  /* 窄屏：返回键与主题按钮占第一行，Pivot 独占第二行，四个标签全部可见、不会被按钮盖住 */
  .bar .pivot {
    order: 3;
    flex-basis: 100%;
  }
  .bar .chrome {
    margin-left: auto;
  }
  .face-num {
    font-size: 40px;
  }
  .tile-w .face-num,
  .tile-l .face-num {
    font-size: 56px;
  }
}
.has-album .face-icon {
  display: none;
}
.editing .tile:focus-visible {
  outline: none;
}
.editing .tile:focus-visible .tile-tilt {
  box-shadow: inset 0 0 0 3px var(--fg);
}
@media (max-width: 640px) {
  .ctl {
    width: 32px;
    height: 32px;
  }
  .ctl-tl { top: -8px; left: -6px; }
  .ctl-tr { top: -8px; right: -6px; }
  .ctl-bl { bottom: -8px; left: -6px; }
  .ctl-br { bottom: -8px; right: -6px; }
}

/* ================================================================
   Metro 页面过渡（Windows Phone 8.1）——时序与逻辑见 vt.js
   - Turnstile：所有磁贴绕网格最左侧同一根轴翻转（transform-origin 由 JS 按 offsetLeft 逐个设置）
   - Pivot：顶部导航切换时三层视差横向滑入
   - 只动 transform / opacity；进行中的元素提升为独立合成层
   ================================================================ */
.start {
  perspective: 1200px;
}
/* 飞向镜头的磁贴会投影到窗口之外：裁掉横向溢出，避免动画中途闪出横向滚动条（clip 不会生成滚动容器） */
body {
  overflow-x: clip;
}
.start.leaving,
.start.landing {
  transform-style: preserve-3d; /* 仅在翻转期间开启，平时不影响拖拽时的层叠顺序 */
  pointer-events: none;
}
.start.leaving .tile,
.start.landing .tile,
.start.leaving .tile-body,
html.ts-in .app,
html.pv #main > section > * {
  will-change: transform, opacity;
  backface-visibility: hidden;
}
/* 盖回之前先隐藏（等 start.js 恢复好自定义布局后再开始） */
html.ts-land #start .tile,
html.ts-land .start-head,
html.ts-land .home-recent {
  opacity: 0;
}
html.ts-land .tile-body,
.start.no-intro .tile-body {
  animation: none;
}

/* Turnstile Forward In：子页面以左侧为轴翻入 */
html.ts-in .app {
  transform-origin: 0% 50vh; /* 左侧为轴；纵向取首屏中线，长页面也不会出现梯形透视 */
  animation:
    ts-in 350ms var(--metro-ease-out) both,
    ts-fade-in 350ms linear both;
}
@keyframes ts-in {
  from { transform: perspective(1200px) rotateY(65deg) translateZ(-50px); }
  to { transform: perspective(1200px) rotateY(0deg) translateZ(0); }
}
@keyframes ts-fade-in {
  from { opacity: 0; }
  40% { opacity: 1; }
  to { opacity: 1; }
}

/* Pivot：kicker 无延迟 80px → 大标题 25ms 140px → 正文 50ms 220px，错位追赶 */
html.pv-r { --pv: 1; }
html.pv-l { --pv: -1; }
html.pv .page-head .kicker {
  --pv-x: 80px;
  animation: pv-in 420ms var(--metro-ease-out) both;
}
html.pv .page-head .page-title,
html.pv .page-head .subtitle {
  --pv-x: 140px;
  animation: pv-in 420ms var(--metro-ease-out) 25ms both;
}
html.pv #main > section > :not(.page-head) {
  --pv-x: 220px;
  animation: pv-in 420ms var(--metro-ease-out) 50ms both;
}
html.pv .page-head .kicker,
html.pv .page-head .page-title,
html.pv .page-head .subtitle {
  will-change: transform, opacity;
  backface-visibility: hidden;
}
@keyframes pv-in {
  from {
    transform: translate3d(calc(var(--pv, 1) * var(--pv-x, 180px)), 0, 0);
    opacity: 0;
  }
  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
