/* dev@home — base / structural stylesheet + theme token contract.
   This file holds ALL layout & component rules and the DEFAULT palette
   (theme F · Retro Terminal). Alternate themes live in themes/<CODE>.css and
   only override the :root tokens below via a `:root[data-theme="X"]` block.
   Every theme MUST define the token contract in this :root; anything a theme
   omits falls back to the F values here. Admin pages load only this file and
   therefore always render as F (they carry no data-theme attribute). */
:root {
  /* ===== Core palette (F · Retro Terminal — also the universal fallback) ===== */
  --bg: #0a0e0a;
  --panel: #0d140d;
  --panel-2: #0f1a0f;
  --text: #c8f5d3;
  --muted: #5a7d63;
  --accent: #4ade80;
  --accent-2: #fbbf24;
  --line: #1c2a1c;
  --glow: 0 0 8px rgba(74, 222, 128, 0.45);

  /* ===== RGB channels — for rgba() surfaces that must follow the theme ===== */
  --accent-rgb: 74, 222, 128;
  --accent-2-rgb: 251, 191, 36;
  --bg-rgb: 10, 14, 10;
  --panel-rgb: 13, 20, 13;
  --overlay-rgb: 6, 19, 9;   /* floating chrome (back-btn, moment links, lightbox) */
  --scrim-rgb: 3, 8, 4;      /* fullscreen lightbox dim                            */
  --shadow-rgb: 0, 0, 0;     /* drop shadows                                       */

  /* ===== Fonts (3-font contract) ===== */
  --font-display: "Space Grotesk", system-ui, sans-serif;                 /* headings / hero */
  --font-body: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace; /* body / UI      */
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace; /* code / chrome  */

  /* ===== Decorative toggles (F opts into the terminal flourishes) ===== */
  --cmd-prefix: "$ ";        /* section-header prefix; "" for non-terminal themes */
  --brand-suffix: "~";       /* nav brand suffix;      "" for non-terminal themes */
  --cmd-color: var(--accent);/* section-header text colour                        */

  /* ===== Globe canvas palette (read by globe.js via getComputedStyle) ===== */
  --globe-ocean1: #0e2a1a;
  --globe-ocean2: #061309;
  --globe-land: #123a24;
  --globe-land-line: #1f5c3a;
  --globe-border: #2a6b45;
  --globe-region: rgba(30, 60, 40, 0.55);
  --globe-region-line: #2a6b45;

  /* ===== Legacy aliases (keep admin.css & existing rules working) ===== */
  --green: var(--accent);
  --amber: var(--accent-2);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1.65;
  overflow-x: hidden;
}

/* --- CRT overlays: scanlines + vignette + flicker (PRD §3.3) ---
   These terminal flourishes belong to theme F only. They are hidden by default
   and re-enabled under [data-theme="F"] so alternate themes stay clean. */
.crt-scanlines,
.crt-vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}
[data-theme="F"] .crt-scanlines,
[data-theme="F"] .crt-vignette { display: block; }
.crt-scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.16) 3px,
    rgba(0, 0, 0, 0.16) 3px
  );
  mix-blend-mode: multiply;
  animation: flick 7s infinite;
}
.crt-vignette {
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%);
}
@keyframes flick {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: 0.92; }
  98% { opacity: 0.98; }
  99% { opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) {
  .crt-scanlines { animation: none; }
  .moment.moment-flash { animation: none; }
  .lightbox-track, .lightbox-viewport { transition: none !important; }
  .globe-moment-links { animation: none; }
}

a { color: var(--green); text-decoration: none; }
a:hover { text-shadow: var(--glow); }

/* --- Layout --- */
.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }

section { padding: 56px 0; border-bottom: 1px solid var(--line); }

/* Command-line section headers: $ command */
.cmd {
  font-family: var(--font-mono);
  color: var(--cmd-color);
  font-size: clamp(15px, 2vw, 19px);
  margin: 0 0 22px;
  text-shadow: var(--glow);
}
.cmd::before { content: var(--cmd-prefix, ""); color: var(--amber); }

h1, h2, h3 { font-family: var(--font-display); color: var(--text); }

/* --- Top nav (sticky, frosted) --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(var(--bg-rgb), 0.72);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav .container { display: flex; align-items: center; gap: 18px; height: 52px; flex-wrap: wrap; }
.nav .brand { color: var(--green); font-weight: 600; }
.nav .brand::after { content: var(--brand-suffix, ""); color: var(--muted); margin-left: 4px; }
.nav a.link { color: var(--muted); font-size: 13px; }
.nav a.link:hover { color: var(--green); }
.nav .spacer { flex: 1; }

/* --- Site search (nav) --- */
.search-box { position: relative; }
.search-box #site-search {
  width: 150px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 4px;
  transition: width 0.15s ease, border-color 0.15s ease;
}
.search-box #site-search::placeholder { color: var(--muted); }
.search-box #site-search:focus { outline: none; width: 220px; border-color: var(--green); box-shadow: var(--glow); }
.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(360px, 78vw);
  max-height: 60vh;
  overflow-y: auto;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(var(--shadow-rgb), 0.5);
  z-index: 200;
  padding: 4px;
}
.search-results .sr-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 4px;
  color: var(--text);
  font-size: 13px;
}
.search-results .sr-item:hover,
.search-results .sr-item.active { background: rgba(var(--accent-rgb), 0.1); }
.search-results .sr-badge {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--amber);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
}
.search-results .sr-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .sr-title mark { background: transparent; color: var(--green); font-weight: 600; }
.search-results .sr-date { flex-shrink: 0; color: var(--muted); font-size: 11px; }
.search-results .sr-empty { padding: 10px; color: var(--muted); font-size: 12px; font-style: italic; }

/* --- Hero --- */
.hero { padding: 84px 0 64px; }
.hero .name { font-size: clamp(30px, 7vw, 60px); margin: 8px 0; line-height: 1.05; color: var(--green); text-shadow: var(--glow); }
.hero .role { color: var(--amber); font-size: clamp(16px, 3vw, 22px); margin: 0 0 16px; }
.hero .tagline { color: var(--text); max-width: 640px; }
.cursor { display: inline-block; width: 9px; height: 1.1em; background: var(--green); margin-left: 2px; vertical-align: text-bottom; animation: blink 1.1s steps(1) infinite; box-shadow: var(--glow); }
@keyframes blink { 50% { opacity: 0; } }
.hero .actions { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  border: 1px solid var(--green);
  color: var(--green);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { background: rgba(var(--accent-rgb), 0.12); box-shadow: var(--glow); }
.btn.amber { border-color: var(--amber); color: var(--amber); }

/* --- Tags / chips --- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 3px;
}
.tag.green { color: var(--green); border-color: rgba(var(--accent-rgb), 0.4); }

/* --- Experience log timeline --- */
.log-entry {
  border-left: 2px solid var(--line);
  padding: 0 0 22px 18px;
  position: relative;
}
.log-entry::before {
  content: "";
  position: absolute;
  left: -6px; top: 4px;
  width: 9px; height: 9px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: var(--glow);
}
.log-entry .period { color: var(--amber); font-size: 13px; }
.log-entry .company { color: var(--green); font-weight: 600; }
.log-entry .role { color: var(--muted); font-size: 13px; }

/* --- Thought cards --- */
.thought {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  padding: 16px 18px;
  margin-bottom: 14px;
  border-radius: 0 4px 4px 0;
}
.thought .meta { color: var(--muted); font-size: 12px; margin-top: 8px; }
/* Long thoughts collapse in-place (JS adds .collapsed when body overflows). */
.thought-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.thought-body.collapsed {
  max-height: 168px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 108px, transparent 100%);
  mask-image: linear-gradient(180deg, #000 108px, transparent 100%);
}
.thought-toggle {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--amber);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.thought-toggle:hover { text-decoration: underline; }
/* Floating 收起 button: appears while any thought is expanded, so a long one
   can be collapsed without scrolling to its bottom. */
.thought-collapse-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--amber);
  background: rgba(var(--overlay-rgb), 0.9);
  border: 1px solid var(--amber);
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(var(--accent-2-rgb), 0.4);
  -webkit-tap-highlight-color: transparent;
}
.thought-collapse-float:hover { background: rgba(var(--accent-2-rgb), 0.18); }
.thought-collapse-float:active { transform: scale(0.96); }

/* --- Project grid --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover { border-color: rgba(var(--accent-rgb), 0.5); box-shadow: var(--glow); }
.card .name { color: var(--green); font-weight: 600; font-size: 16px; }
.card .desc { color: var(--text); font-size: 13px; margin: 8px 0; }
.card .meta { color: var(--muted); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
.card .meta .star::before { content: "★ "; color: var(--amber); }

/* --- Notes / blog list --- */
.note-row {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.note-row .date { color: var(--muted); font-size: 12px; min-width: 92px; }
.note-row .title { color: var(--green); flex: 1 1 auto; min-width: 0; }
/* Tags sit in their own column; many tags clip to one line instead of
   shoving the title around. On narrow screens they wrap under the title. */
.note-row .tags-inline {
  flex: 0 1 auto;
  max-width: 42%;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.note-row .tag-chip { margin-left: 6px; }

/* --- Footprint globe --- */
#footprint { text-align: center; }
.globe-breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 12px; text-align: left; }
.globe-breadcrumb a { color: var(--green); cursor: pointer; }
.globe-breadcrumb .sep { color: var(--line); margin: 0 6px; }
#globe-canvas { display: block; margin: 0 auto; cursor: grab; touch-action: none; }
#globe-canvas:active { cursor: grabbing; }
/* Stage wraps the canvas so the back button can float in its top-left corner. */
.globe-stage { position: relative; display: inline-block; }
.globe-controls {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  display: flex; align-items: center; gap: 8px;
}
.globe-back-btn {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--amber); background: rgba(var(--overlay-rgb), 0.82);
  border: 1px solid var(--amber); border-radius: 6px;
  padding: 6px 12px; cursor: pointer;
  box-shadow: 0 0 12px rgba(var(--accent-2-rgb), 0.35);
  -webkit-tap-highlight-color: transparent;
}
.globe-back-btn:hover { background: rgba(var(--accent-2-rgb), 0.18); }
.globe-back-btn:active { transform: scale(0.96); }
.globe-drill-hint {
  display: inline-flex; align-items: center;
  min-height: 29px; padding: 4px 9px;
  color: var(--muted); background: rgba(var(--overlay-rgb), 0.7);
  border: 1px solid var(--line); border-radius: 6px;
  font-family: var(--font-mono); font-size: 12px;
  white-space: nowrap; pointer-events: none;
}
.globe-load-status {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 4;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 7px 10px;
  color: var(--text);
  background: rgba(var(--overlay-rgb), 0.9);
  border: 1px solid var(--amber);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.globe-load-status.is-error { color: var(--amber); }
.globe-hint { color: var(--muted); font-size: 12px; margin-top: 10px; }
.globe-stats { color: var(--amber); font-size: 13px; margin-top: 8px; }
.globe-notes {
  margin: 14px auto 0;
  width: 100%;
  max-width: 440px;
  text-align: left;
  background: rgba(var(--overlay-rgb), 0.55);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  animation: gml-in 0.22s ease-out;
}
.globe-notes .gn-head {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--line);
}
.globe-notes .gn-item {
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: 13px;
}
.globe-notes .gn-item:last-child { border-bottom: 0; }
.globe-notes .gn-city { color: var(--amber); }
.globe-notes .gn-text { color: var(--text); white-space: pre-wrap; }
/* Linked-瞬间 panel shown when a clicked city/province links to moments. Framed
   as a compact card so multiple rows read cleanly on a phone. Each row is a link
   the user taps to jump into the feed (no auto-jump). */
.globe-moment-links {
  margin: 14px auto 0; width: 100%; max-width: 440px; text-align: left;
  background: rgba(var(--overlay-rgb), 0.55);
  border: 1px solid var(--line); border-left: 3px solid var(--amber);
  border-radius: 0 8px 8px 0; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 7px;
  animation: gml-in 0.22s ease-out;
}
@keyframes gml-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.globe-moment-links .gml-head {
  font-family: var(--font-mono); font-size: 12px;
  padding-bottom: 7px; margin-bottom: 1px; border-bottom: 1px dashed var(--line);
}
.globe-moment-links .gml-count { color: var(--muted); }
.globe-moment-links .gml-item {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.4;
  color: var(--text); background: rgba(var(--panel-rgb), 0.7);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 9px 11px; cursor: pointer; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.globe-moment-links .gml-arrow { color: var(--amber); flex: none; }
.globe-moment-links .gml-cap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.globe-moment-links .gml-item:hover { border-color: var(--amber); background: rgba(var(--accent-2-rgb), 0.1); color: var(--amber); }
.globe-moment-links .gml-item:active { transform: scale(0.99); }
/* Brief highlight when the globe jumps you to a moment, so it's easy to spot. */
@keyframes moment-flash {
  0%   { box-shadow: 0 0 0 0 rgba(var(--accent-2-rgb), 0.0); border-left-color: var(--green); }
  20%  { box-shadow: 0 0 22px 2px rgba(var(--accent-2-rgb), 0.55); border-left-color: var(--amber); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-2-rgb), 0.0); border-left-color: var(--green); }
}
.moment.moment-flash { animation: moment-flash 1.8s ease-out; }

/* --- Article body (rendered markdown) --- */
.article { max-width: 760px; }
.article h1, .article h2, .article h3 { color: var(--green); margin-top: 1.6em; }
.article pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  overflow-x: auto;
}
.article code { color: var(--amber); font-family: var(--font-mono); }
.article blockquote {
  border-left: 3px solid var(--amber);
  margin: 1em 0;
  padding-left: 14px;
  color: var(--muted);
}
.article img { max-width: 100%; border-radius: 6px; }
.article a { text-decoration: underline; }

/* --- Moments (瞬间) photo / short-video feed --- */
.moments { max-width: 720px; }
.moment {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  padding: 16px 18px;
  margin-bottom: 16px;
  border-radius: 0 4px 4px 0;
}
.moment-meta { display: flex; gap: 12px; align-items: baseline; font-size: 12px; margin-bottom: 8px; }
.moment-place { color: var(--green); }
.moment-date { color: var(--muted); }
.moment-caption { color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.moment-media { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.moment-media[data-count="1"] { grid-template-columns: 1fr; }
.moment-media[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
.moment-item { width: 100%; border-radius: 6px; border: 1px solid var(--line); display: block; background: var(--bg); }
/* Thumbnails in multi-media grids crop to squares; a lone image shows in full. */
.moment-media:not([data-count="1"]) .moment-item { aspect-ratio: 1 / 1; object-fit: cover; }
.moment-media[data-count="1"] .moment-item { max-height: 480px; object-fit: contain; }
img.moment-item { cursor: zoom-in; transition: border-color 0.15s; }
img.moment-item:hover { border-color: rgba(var(--accent-rgb), 0.5); }
/* Embedded players (Bilibili / YouTube) always take a full-width row: a 16:9
   frame with a small "open on site" fallback link BELOW it, so nothing ever
   overlaps the video controls. */
.moment-embed { grid-column: 1 / -1; padding: 0; border: 0; background: transparent; }
/* Neutralize the square-thumbnail grid rule (higher specificity) for embeds. */
.moment-media:not([data-count="1"]) .moment-item.moment-embed { aspect-ratio: auto; object-fit: fill; }
.moment-embed-frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; border: 1px solid var(--line); border-radius: 6px; }
.moment-embed-frame iframe { width: 100%; height: 100%; display: block; border: 0; }
.moment-embed-open {
  display: inline-block; margin-top: 6px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1;
  color: var(--muted); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.moment-embed-open:hover { color: var(--amber); }

/* --- Lightbox (full-size image viewer) --- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--scrim-rgb), 0.92);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.lightbox[hidden] { display: none; }
body.lightbox-open { overflow: hidden; }
/* Carousel model: a full-width viewport clips a horizontal track of equal-width
   slides. moments.js translates the track (in px) and toggles the transition so
   it can follow the finger 1:1 while dragging and glide on release. */
.lightbox-viewport { width: 100vw; height: 100%; overflow: hidden; will-change: transform; }
.lightbox-track { display: flex; height: 100%; will-change: transform; }
.lightbox-slide {
  flex: 0 0 100vw; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-img {
  max-width: 92vw; max-height: 86vh; object-fit: contain;
  border-radius: 4px; box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.25);
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
}
/* Transient "reached the end" toast shown at the first/last image. */
.lightbox-hint {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 3; pointer-events: none;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--amber); background: rgba(var(--overlay-rgb), 0.9);
  border: 1px solid var(--amber); border-radius: 6px; padding: 6px 14px;
  opacity: 0; transition: opacity 0.2s ease;
}
.lightbox-hint.lb-hint-show { opacity: 1; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--amber); background: rgba(var(--overlay-rgb), 0.82);
  border: 1px solid var(--amber); border-radius: 6px;
  padding: 6px 12px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lightbox-close:hover { background: rgba(var(--accent-2-rgb), 0.18); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  font-family: var(--font-mono); font-size: 28px; line-height: 1;
  color: var(--green); background: rgba(var(--overlay-rgb), 0.7);
  border: 1px solid var(--line); border-radius: 8px;
  width: 44px; height: 56px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lightbox-nav:hover { border-color: var(--green); box-shadow: var(--glow); }
.lightbox-nav.is-end { opacity: 0.3; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-nav[hidden] { display: none; }

/* --- Footer --- */
footer { padding: 32px 0; color: var(--muted); font-size: 12px; text-align: center; border-bottom: none; }
footer .cmd { justify-content: center; }
footer .beian { margin-top: 8px; font-size: 11px; opacity: 0.7; }
footer .beian a { color: inherit; text-decoration: none; }
footer .beian a:hover { text-decoration: underline; }

/* --- Responsive (PRD §3.4: <=600px) --- */
@media (max-width: 600px) {
  section { padding: 40px 0; }
  .nav .container { height: auto; padding: 8px 16px; }
  .grid { grid-template-columns: 1fr; }
  .note-row { flex-wrap: wrap; }
  /* On phones let all tags show, wrapping full-width under the title. */
  .note-row .tags-inline {
    flex-basis: 100%;
    max-width: 100%;
    white-space: normal;
    text-align: left;
    margin-top: 4px;
  }
  .note-row .tag-chip { margin: 0 8px 0 0; }
  .moments { max-width: 100%; }
  .moment-media, .moment-media[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
  .lightbox-nav { width: 38px; height: 48px; font-size: 22px; }
  .search-box { order: 10; flex-basis: 100%; }
  .search-box #site-search, .search-box #site-search:focus { width: 100%; }
  .search-results { width: 100%; }
}

.empty { color: var(--muted); font-style: italic; }
