/* ============================================================
   GhostShiro — warm dark indie dev journal Ghost theme
   ported 1:1 from the Claude Design source (styles.css + pages.css)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Warm dark — candle-lit mauve */
  --bg-0: #1a1318;
  --bg-1: #221820;
  --bg-2: #2a1f29;
  --bg-3: #342634;
  --line: rgba(220, 200, 220, 0.08);
  --line-strong: rgba(220, 200, 220, 0.16);
  --ink-0: #f0e7eb;
  --ink-1: #d9ccd4;
  --ink-2: #a89aa3;
  --ink-3: #6b606a;
  --ink-4: #463e48;
  --accent: #c98aa6;
  --accent-2: #b8d49a;
  --accent-3: #e6b888;
  --accent-purple: #9d8ec9;

  /* Allow Ghost's font picker (Settings → Design → Customise → Fonts) to override defaults */
  --gh-font-heading: 'Noto Serif SC', 'Songti SC', Georgia, serif;
  --gh-font-body:    'Noto Sans SC', -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;

  --serif: var(--gh-font-heading);
  --sans:  var(--gh-font-body);
  --mono:  'JetBrains Mono', ui-monospace, monospace;

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 18px;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 12px 40px rgba(0,0,0,0.35);

  --texture-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  --texture-opacity: 0.6;
}

[data-theme="light"] {
  --bg-0: #f6f1ec;
  --bg-1: #efe7df;
  --bg-2: #e8ddd2;
  --bg-3: #ddd0c2;
  --line: rgba(50, 30, 40, 0.08);
  --line-strong: rgba(50, 30, 40, 0.18);
  --ink-0: #2a1f29;
  --ink-1: #4a3a48;
  --ink-2: #6b606a;
  --ink-3: #8e8088;
  --ink-4: #b8aab2;
  --accent: #a85a7c;
  --accent-purple: #6e5fa0;
  --shadow-card: 0 1px 0 rgba(255,255,255,0.7) inset, 0 8px 24px rgba(60,30,50,0.08);
}

/* Accent variants — toggleable from package.json site setting */
[data-accent="violet"]  { --accent: #9d8ec9; }
[data-accent="moss"]    { --accent: #b8d49a; }
[data-accent="candle"]  { --accent: #e6b888; }
[data-accent="mist"]    { --accent: #7eb6c9; }

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--ink-0);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(201,138,166,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(157,142,201,0.08), transparent 60%),
    var(--bg-0);
  background-attachment: fixed;
  position: relative;
}

[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(168,90,124,0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(110,95,160,0.06), transparent 60%),
    var(--bg-0);
}

/* Texture overlay */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--texture-opacity, 0.5);
  background-image: var(--texture-image, radial-gradient(rgba(255,255,255,0.025) 1px, transparent 1px));
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; }

::selection { background: var(--accent); color: var(--bg-0); }

/* ============ Layout ============ */
.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
}

/* ============ Top Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  padding: 14px 0;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  background: color-mix(in srgb, var(--bg-0) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.nav-brand { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.nav-brand-text { line-height: 1.1; }
.nav-brand-name { font-family: var(--serif); font-size: 16px; font-weight: 500; color: var(--ink-0); white-space: nowrap; }
.nav-brand-status {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.nav-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #d9b8c8, #9d8ec9 60%, #534467);
  position: relative; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 3px var(--line-strong);
}
.nav-avatar::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 38%, #f5e3d8 0 32%, transparent 33%),
    radial-gradient(circle at 38% 36%, #2a1f29 0 1.5px, transparent 2px),
    radial-gradient(circle at 62% 36%, #2a1f29 0 1.5px, transparent 2px),
    linear-gradient(180deg, #e8d4c8 0 50%, #d9b8c8 50%);
}
.nav-avatar::after {
  content: ''; position: absolute; top: -2px; left: -2px; right: -2px; height: 22px;
  background: linear-gradient(180deg, #f5e8e0 0 60%, transparent);
  border-radius: 50% 50% 40% 40% / 70% 70% 30% 30%;
}
/* When a real avatar image is supplied (Ghost site icon / author profile image), hide the painted face */
.nav-avatar.has-icon,
.hero-avatar.has-icon,
.about-avatar.has-icon,
.thought-avatar.has-icon {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.nav-avatar.has-icon::before, .nav-avatar.has-icon::after,
.hero-avatar.has-icon::before, .hero-avatar.has-icon::after,
.about-avatar.has-icon::before, .about-avatar.has-icon::after,
.thought-avatar.has-icon::before { display: none; }

.nav-links { display: flex; gap: 4px; align-items: center; position: relative; }
/* Sliding indicator: absolute pill behind nav-links that JS moves to active/hovered link */
.nav-indicator {
  position: absolute;
  top: 50%;
  left: 0; width: 0;
  height: 32px;
  background: var(--line-strong);
  border-radius: 999px;
  transform: translateY(-50%);
  transition: left .35s cubic-bezier(.4, .0, .2, 1),
              width .35s cubic-bezier(.4, .0, .2, 1),
              opacity .25s;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
}
.nav-link {
  position: relative;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: color .25s;
  display: inline-flex; align-items: center; gap: 6px;
  z-index: 1;                           /* sits above the sliding indicator */
  white-space: nowrap;                  /* never wrap (each Chinese glyph wrapping = vertical text) */
  flex-shrink: 0;                       /* never let parent flex shrink us into a single column */
}
.nav-link:hover { color: var(--ink-0); }
.nav-link.active { color: var(--ink-0); }
.nav-link .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); opacity: 0;
}
.nav-link.active .dot { opacity: 1; }
.nav-link .icon { font-size: 12px; color: var(--ink-3); }

.nav-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.nav-icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line);
  display: grid; place-items: center; cursor: pointer;
  color: var(--ink-2);
  transition: all .2s;
  flex-shrink: 0;            /* never collapse into vertical stacking */
  text-decoration: none;     /* in case <a> is used instead of <button> */
}
.nav-icon-btn img { display: block; }
.nav-icon-btn:hover { color: var(--ink-0); background: var(--line); border-color: var(--line-strong); }
.nav-kbd {
  font-family: var(--mono); font-size: 10px;
  padding: 2px 5px; border-radius: 4px;
  background: var(--line); color: var(--ink-3);
  margin-left: 4px;
}

/* mobile nav toggle */
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg-1);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px 18px;
    gap: 6px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-link { width: 100%; justify-content: flex-start; padding: 10px 14px; }
  .nav-toggle { display: grid; }
}

/* ============ Card ============ */
.card {
  background: var(--bg-1);
  border-radius: var(--radius-l);
  padding: 28px;
  position: relative;
  transition: transform .3s ease, box-shadow .3s ease, background .3s;
}
.card.bordered { border: 1px solid var(--line); background: transparent; }
.card.floating { box-shadow: var(--shadow-card); border: 1px solid var(--line); }
.card.flat { background: transparent; padding: 18px 0; border-bottom: 1px solid var(--line); border-radius: 0; }

/* ============ Tag ============ */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  background: var(--line);
  color: var(--ink-1);
  font-family: var(--sans);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.tag:hover { background: var(--line-strong); color: var(--ink-0); }
.tag.active { background: var(--accent); color: var(--bg-0); }
.tag.green  { background: rgba(184,212,154,.15); color: var(--accent-2); border: 1px solid rgba(184,212,154,.25); }
.tag.purple { background: rgba(157,142,201,.15); color: var(--accent-purple); border: 1px solid rgba(157,142,201,.25); }
.tag.amber  { background: rgba(230,184,136,.12); color: var(--accent-3); border: 1px solid rgba(230,184,136,.22); }
.tag.rose   { background: rgba(201,138,166,.15); color: var(--accent); border: 1px solid rgba(201,138,166,.25); }

/* ============ Page header ============ */
.page-title {
  font-family: var(--serif);
  font-size: 44px; font-weight: 500;
  margin: 0 0 4px; letter-spacing: 0.01em;
}
.page-sub { color: var(--ink-2); margin: 0 0 36px; font-size: 14px; }

/* ============ Animations ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .6s cubic-bezier(.2,.7,.2,1) both; }

@keyframes pulse { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(14deg); }
  20%, 40% { transform: rotate(-8deg); }
}
@keyframes paletteIn { from { opacity: 0; transform: translateY(-12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ============ Footer ============ */
.foot {
  margin-top: 80px;
  padding: 40px 0 60px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12px;
  border-top: 1px solid var(--line);
}
.foot a { cursor: pointer; }
.foot a:hover { color: var(--ink-1); }
.foot-row { display: flex; justify-content: center; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }
/* Auto dot-separator between adjacent .foot-link items (so filtering 'Sign up'
   from secondary nav doesn't leave dangling separators) */
.foot-links { gap: 0; align-items: baseline; }
.foot-links .foot-link { padding: 0 12px; position: relative; }
.foot-links .foot-link + .foot-link::before {
  content: '·';
  position: absolute;
  left: -3px;
  color: var(--ink-3);
}
.foot-links:empty { display: none; }
.foot-line { margin-top: 6px; }
.foot-line:first-of-type { margin-top: 0; }
.foot-quote { font-family: var(--serif); font-style: italic; color: var(--ink-2); }
.foot-icp { font-size: 11px; opacity: 0.85; }
.foot-icp a { color: inherit; }

/* ============ Reading progress (scroll-based) ============ */
.read-progress {
  position: fixed; top: 0; left: 0;
  height: 2px; background: var(--accent);
  z-index: 100;
  width: 0;
  transition: width .1s linear;
  box-shadow: 0 0 8px var(--accent);
}

/* ============ Page navigation transition ============ */
/* 1) Cross-document View Transitions (Chrome/Edge 126+, Safari 18+).
   Browsers without support just navigate normally. */
@view-transition { navigation: auto; }
::view-transition-old(root) {
  animation: gs-page-out .18s ease both;
}
::view-transition-new(root) {
  animation: gs-page-in .35s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes gs-page-out { to { opacity: 0; } }
@keyframes gs-page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 2) JS-driven top progress bar — visible during the brief window between
   click and the next document being painted. Works on every browser. */
.gs-nav-progress {
  position: fixed; top: 0; left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-purple));
  box-shadow: 0 0 12px var(--accent);
  z-index: 1100;
  pointer-events: none;
  opacity: 0;
}
.gs-nav-progress.is-loading {
  opacity: 1;
  width: 80%;
  transition: width 6s cubic-bezier(.05,.7,.1,1), opacity .12s ease;
}
.gs-nav-progress.is-done {
  opacity: 0;
  width: 100%;
  transition: width .2s ease, opacity .3s ease .15s;
}

/* ============ Common bits ============ */
.eyebrow {
  font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3);
  font-family: var(--sans); font-weight: 500;
}
.divider { height: 1px; background: var(--line); margin: 32px 0; }
.serif { font-family: var(--serif); }
.mono  { font-family: var(--mono); }
.muted  { color: var(--ink-2); }
.subtle { color: var(--ink-3); }

.section-title {
  display: flex; align-items: center; gap: 12px;
  margin: 48px 0 20px;
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.section-title::before, .section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

.entry-no { font-family: var(--mono); color: var(--ink-3); font-size: 12px; }

.year-stamp {
  display: inline-flex; flex-direction: column; align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-family: var(--serif);
  color: var(--ink-2);
  letter-spacing: 0.02em;
}
.year-stamp .y   { font-size: 26px; line-height: 1; }
.year-stamp .lbl { font-size: 9px;  letter-spacing: 0.3em; margin-top: 6px; color: var(--ink-3); }

.date-vert {
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--serif); color: var(--ink-2);
  width: 44px; flex-shrink: 0;
  line-height: 1.2;
}
.date-vert .d { font-size: 28px; color: var(--ink-0); font-weight: 500; }
.date-vert .m { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.date-vert .w { font-size: 10px; color: var(--ink-4); margin-top: 1px; letter-spacing: 0.1em; }

.lift { transition: transform .3s ease, box-shadow .3s ease; }
.lift:hover { transform: translateY(-2px); }

/* ============ Command palette ============ */
.palette-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10, 6, 12, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
  animation: fadeIn .15s ease;
}
.palette-overlay[hidden] { display: none; }
.palette {
  width: min(560px, 92vw);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: paletteIn .2s cubic-bezier(.2,.8,.2,1) both;
}
.palette-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.palette-input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--ink-0); font: inherit; font-size: 14px;
}
.palette-input::placeholder { color: var(--ink-3); }
.palette-results { padding: 6px; max-height: 360px; overflow-y: auto; }
.palette-row {
  position: relative;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px 10px 18px;
  border-radius: 8px;
  cursor: pointer; gap: 10px;
  text-decoration: none; color: inherit;
  transition: background .2s ease, color .2s ease, padding-left .2s ease;
}
/* Accent left bar that slides in from left */
.palette-row::before {
  content: '';
  position: absolute;
  left: 6px; top: 50%;
  width: 3px; height: 0;
  background: var(--accent);
  border-radius: 999px;
  transform: translateY(-50%);
  transition: height .25s cubic-bezier(.2,.7,.2,1), opacity .2s ease;
  opacity: 0;
}
.palette-row.selected {
  background: linear-gradient(90deg,
    rgba(201,138,166,0.14) 0%,
    rgba(157,142,201,0.06) 60%,
    transparent 100%);
  padding-left: 22px;
}
.palette-row.selected::before {
  height: 60%;
  opacity: 1;
}
.palette-row.selected .palette-row-title { color: var(--accent); }
.palette-row.selected .palette-row-kind {
  background: var(--accent);
  color: var(--bg-0);
  border-color: transparent;
}

.palette-row-title {
  flex: 1; min-width: 0;
  font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .2s ease, transform .25s cubic-bezier(.2,.7,.2,1);
}
.palette-row.selected .palette-row-title { transform: translateX(2px); }

.palette-row-kind {
  font-size: 10.5px; color: var(--ink-3); flex-shrink: 0;
  padding: 2px 7px; border-radius: 4px; background: var(--line);
  border: 1px solid transparent;
  transition: background .2s ease, color .2s ease, transform .2s ease, border-color .2s ease;
}
.palette-empty { padding: 30px; text-align: center; color: var(--ink-3); font-size: 12px; }
.palette-foot {
  display: flex; gap: 16px; padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 11px; color: var(--ink-3);
}

/* ============ Music widget — GhostShiro FM radio style ============ */
.music-widget {
  position: fixed; bottom: 24px; left: 24px; z-index: 60;
  width: 296px;
  padding: 10px 12px 10px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(201,138,166,0.08) 0%, transparent 55%),
    radial-gradient(120% 90% at 100% 100%, rgba(157,142,201,0.06) 0%, transparent 55%),
    linear-gradient(165deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow:
    var(--shadow-card),
    inset 0 1px 0 rgba(255,255,255,0.04);
  animation: fadeUp .4s ease;
  /* NOTE: do NOT set overflow:hidden here — the lyric and playlist
     dropdown both float ABOVE the widget via position:absolute. */
  isolation: isolate;
}
.music-widget[hidden] { display: none; }
/* Subtle scanline overlay for retro CRT/radio feel */
.music-widget::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 3px,
    rgba(255,255,255,0.012) 3px,
    rgba(255,255,255,0.012) 4px
  );
  border-radius: inherit;
  z-index: 0;
}
.music-widget > * { position: relative; z-index: 1; }

/* === Top bar: ON AIR + frequency === */
.music-station {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.music-onair {
  display: inline-flex; align-items: center; gap: 5px;
  color: #ff6b6b;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255,107,107,0.4);
}
.music-onair-dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: #ff6b6b;
  box-shadow: 0 0 6px #ff6b6b, 0 0 12px rgba(255,107,107,0.6);
  animation: gs-onair-pulse 1.4s ease-in-out infinite;
}
@keyframes gs-onair-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.1); }
}
.music-freq {
  color: var(--ink-3);
  font-weight: 500;
}

/* === Body: vinyl + meta === */
.music-body {
  display: flex; align-items: center; gap: 12px;
}

/* Vinyl */
.music-cover {
  width: 56px; height: 56px; border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  background:
    radial-gradient(circle at center,
      #1a1318 0 18%,
      #2a1f29 18.5% 22%,
      #1a1318 22.5% 38%,
      #2a1f29 38.5% 42%,
      #1a1318 42.5% 58%,
      #2a1f29 58.5% 62%,
      #1a1318 62.5%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06),
    inset 0 -2px 6px rgba(0,0,0,0.5),
    0 4px 14px rgba(0,0,0,0.45);
}
.music-cover-disc {
  position: absolute; inset: 0;
  border-radius: 50%;
  animation: spin 6s linear infinite;
  animation-play-state: paused;
}
.music-widget.is-playing .music-cover-disc { animation-play-state: running; }
.music-cover-inner {
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%,
      rgba(255,255,255,0.04) 0%,
      transparent 35%);
}
.music-cover-pin {
  position: absolute; top: 50%; left: 50%;
  width: 12px; height: 12px; margin: -6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  box-shadow:
    0 0 0 2px var(--bg-1),
    0 0 8px rgba(201,138,166,0.5);
}
.music-cover-shine {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg,
    rgba(255,255,255,0.18) 0%,
    rgba(255,255,255,0.04) 25%,
    transparent 50%);
  pointer-events: none;
  mix-blend-mode: screen;
}

/* Meta block */
.music-meta { flex: 1; min-width: 0; }
.music-title {
  font-size: 12.5px; font-weight: 500;
  color: var(--ink-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.music-artist {
  font-size: 10.5px; color: var(--ink-3); margin-top: 2px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Progress bar */
.music-bar {
  height: 3px; background: var(--line);
  margin: 8px 0 6px;
  border-radius: 3px; overflow: hidden;
  cursor: pointer;
  position: relative;
}
.music-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-purple));
  transition: width .6s linear;
  box-shadow: 0 0 8px rgba(201,138,166,0.5);
}

/* Equalizer (under progress bar) */
.music-eq {
  display: flex; align-items: flex-end;
  gap: 2px; height: 9px;
  opacity: 0.35;
  transition: opacity .25s;
}
.music-widget.is-playing .music-eq { opacity: 0.95; }
.music-eq i {
  display: block;
  width: 2px;
  background: linear-gradient(to top, var(--accent), var(--accent-purple));
  border-radius: 1px;
  height: 30%;
  transform-origin: bottom;
}
.music-widget.is-playing .music-eq i {
  animation: gs-eq 0.9s ease-in-out infinite;
}
.music-eq i:nth-child(1) { animation-delay: 0.00s; }
.music-eq i:nth-child(2) { animation-delay: 0.18s; }
.music-eq i:nth-child(3) { animation-delay: 0.36s; }
.music-eq i:nth-child(4) { animation-delay: 0.10s; }
.music-eq i:nth-child(5) { animation-delay: 0.28s; }
@keyframes gs-eq {
  0%, 100% { height: 25%; }
  20%      { height: 90%; }
  50%      { height: 45%; }
  80%      { height: 70%; }
}

/* === Footer controls === */
.music-controls {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.music-controls button {
  background: transparent; border: 0; color: var(--ink-2); cursor: pointer;
  font-size: 13px; padding: 0; width: 20px;
  transition: color .18s, transform .18s;
}
.music-controls button:hover { color: var(--accent); transform: translateY(-1px); }
.music-controls button:disabled { color: var(--ink-4); cursor: not-allowed; }
.music-prev, .music-next { font-size: 12px !important; }
#music-play {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-0);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
  box-shadow: 0 0 0 2px rgba(201,138,166,0.18), 0 2px 8px rgba(201,138,166,0.35);
}
#music-play:hover { color: var(--bg-0); transform: scale(1.06); }
.music-time {
  font-family: var(--mono); font-size: 9.5px;
  color: var(--ink-3); flex: 1;
  letter-spacing: 0.05em;
  text-align: right;
}
.music-x { color: var(--ink-3) !important; font-size: 11px !important; }

/* Floating lyric line above the widget */
.music-lyric {
  position: absolute;
  bottom: calc(100% + 8px); left: 0;
  width: 100%;
  text-align: center;
  font-family: var(--serif);
  font-size: 12.5px;
  color: var(--ink-1);
  line-height: 1.5;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(26,19,24,0.9), rgba(26,19,24,0.7));
  border: 1px solid var(--line);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  pointer-events: none;
  animation: gs-lyric-in .3s ease both;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes gs-lyric-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Playlist dropdown panel — pops UP above the widget */
.music-list-btn { font-size: 12px !important; }
.music-list {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0; right: 0;
  max-height: 280px;
  background: linear-gradient(165deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-card), 0 8px 24px rgba(0,0,0,0.35);
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 5;
  animation: gs-lyric-in .2s ease both;
}
.music-list[hidden] { display: none; }
/* When playlist open, hide the lyric line so they don't overlap */
.music-widget.list-open .music-lyric { display: none !important; }
.music-list-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  background: var(--bg-1);
  flex-shrink: 0;
}
.music-list-body {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}
.music-list-body::-webkit-scrollbar { width: 6px; }
.music-list-body::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.music-list-body::-webkit-scrollbar-track { background: transparent; }
.music-list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  overflow: hidden;
}
.music-list-row:hover { background: rgba(201,138,166,0.08); color: var(--ink-1); }
.music-list-row.active { color: var(--accent); background: rgba(201,138,166,0.06); }
.music-list-row-num {
  width: 22px; flex-shrink: 0;
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-4);
  text-align: right;
}
.music-list-row.active .music-list-row-num { color: var(--accent); }
.music-list-row-name {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (max-width: 700px) {
  .music-widget { left: 12px; bottom: 12px; width: calc(100vw - 24px); max-width: 320px; }
}

/* ============ Home hero ============ */
.hero { padding: 72px 0 48px; text-align: center; }
.hero-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #d9b8c8, #9d8ec9 60%, #534467);
  position: relative; overflow: hidden;
  box-shadow: 0 0 0 4px var(--bg-0), 0 0 0 5px var(--line-strong), 0 20px 60px rgba(157,142,201,0.2);
}
.hero-avatar::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 38%, #f5e3d8 0 32%, transparent 33%),
    radial-gradient(circle at 38% 36%, #2a1f29 0 3px, transparent 4px),
    radial-gradient(circle at 62% 36%, #2a1f29 0 3px, transparent 4px),
    radial-gradient(circle at 50% 50%, #e9aabb 0 2px, transparent 3px),
    linear-gradient(180deg, #e8d4c8 0 50%, #d9b8c8 50%);
}
.hero-avatar::after {
  content: ''; position: absolute; top: -4px; left: -4px; right: -4px; height: 50px;
  background: linear-gradient(180deg, #f5e8e0 0 60%, transparent);
  border-radius: 50% 50% 40% 40% / 70% 70% 30% 30%;
}
.hero-greet {
  font-family: var(--serif);
  font-size: 44px; font-weight: 400;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}
.hero-greet .name { color: var(--accent); font-style: italic; }
.hero-greet .wave { display: inline-block; animation: wave 2.5s infinite; transform-origin: 70% 70%; }
.hero-role {
  font-family: var(--serif);
  font-size: 28px; color: var(--ink-1); margin: 0 0 18px;
  font-weight: 300;
}
.hero-role .tag-inline {
  font-family: var(--mono); font-size: 18px;
  color: var(--accent);
  background: var(--bg-2);
  padding: 2px 10px; border-radius: 6px;
  border: 1px solid var(--line-strong);
}
.hero-bio {
  color: var(--ink-2);
  font-size: 13px; letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}
.hero-quote {
  margin: 60px auto 0; max-width: 540px;
  font-family: var(--serif); font-style: italic;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.7;
}
.hero-quote .qmark { color: var(--accent); font-size: 24px; }
.hero-quote-meta { margin-top: 12px; font-size: 12px; color: var(--ink-3); font-family: var(--sans); font-style: normal; }

/* ============ Social row (circular brand icons above stats card) ============ */
.social-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 36px 0 24px;
  flex-wrap: wrap;
}
.social-row:empty { display: none; }
.social-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-1);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  text-decoration: none;
  transition: all .25s ease;
  flex-shrink: 0;
}
.social-icon:hover {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(201,138,166,0.30);
}
.social-icon svg { display: block; }

/* ============ Stats card ============ */
.stats-card {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0;
  margin-top: 64px;            /* pushed down for more breathing room from hero */
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat { text-align: center; padding: 22px 12px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-num { font-family: var(--serif); font-size: 32px; line-height: 1; color: var(--ink-0); font-weight: 500; }
.stat-num .accent { color: var(--accent); }
.stat-lbl { font-size: 11px; color: var(--ink-3); margin-top: 8px; letter-spacing: 0.1em; }

@media (max-width: 600px) {
  .stats-card { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
}

/* ============ Recent feed (smooth pseudo-element hover) ============ */
.feed-row {
  position: relative;
  display: flex; align-items: center; gap: 20px;
  padding: 18px 0;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-bottom-color .35s ease;
}
/* Soft gradient highlight that fades in WITHOUT changing row geometry */
.feed-row::before {
  content: '';
  position: absolute;
  inset: 4px -20px;
  border-radius: 10px;
  background: linear-gradient(90deg,
                rgba(201,138,166,0.10) 0%,
                rgba(157,142,201,0.05) 55%,
                transparent 100%);
  opacity: 0;
  transition: opacity .4s ease;
  z-index: 0;
}
/* Accent left bar that grows from center on hover */
.feed-row::after {
  content: '';
  position: absolute;
  left: -10px; top: 50%;
  width: 3px; height: 0;
  background: var(--accent);
  border-radius: 999px;
  transform: translateY(-50%);
  opacity: 0;
  transition: height .4s cubic-bezier(.2,.7,.2,1), opacity .3s ease;
  z-index: 1;
}
.feed-row > * { position: relative; z-index: 1; }
.feed-row:hover { border-bottom-color: transparent; }
.feed-row:hover::before { opacity: 1; }
.feed-row:hover::after  { height: 65%; opacity: 1; }

.feed-date {
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-3);
  width: 56px; flex-shrink: 0;
  transition: color .35s ease, transform .35s ease;
}
.feed-title {
  flex: 1; font-size: 14px;
  color: var(--ink-1);
  transition: color .35s ease, transform .35s cubic-bezier(.2,.7,.2,1);
}
.feed-kind {
  font-size: 11px; color: var(--ink-3); flex-shrink: 0;
  transition: color .35s ease, opacity .35s ease;
}
.feed-row:hover .feed-date  { color: var(--ink-1); transform: translateX(4px); }
.feed-row:hover .feed-title { color: var(--accent); transform: translateX(6px); }
.feed-row:hover .feed-kind  { color: var(--accent); }

/* ============ Journal entry detail ============ */
.journal-detail {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 56px 64px 48px;
  position: relative;
  margin-top: 32px;
  box-shadow: var(--shadow-card);
}
.journal-mood { position: absolute; top: -14px; left: 32px; }
.journal-no {
  position: absolute; top: 56px; right: 64px;
  font-family: var(--serif); font-size: 32px;
  color: var(--ink-3); font-weight: 300;
}
.journal-title {
  font-family: var(--serif); font-size: 36px; font-weight: 500;
  margin: 0 0 8px;
}
.journal-meta {
  font-size: 12px; color: var(--ink-3);
  font-family: var(--mono);
  margin-bottom: 24px;
}
.journal-body, .post-content {
  font-family: var(--serif);
  font-size: 16px; line-height: 2;
  color: var(--ink-1);
}
.journal-body p:first-child::first-letter,
.post-content > p:first-child::first-letter {
  float: left;
  font-size: 56px; line-height: 0.9;
  margin: 6px 12px 0 0;
  color: var(--accent);
  font-weight: 500;
}
.journal-body p, .post-content p { margin: 0 0 1em; }
.post-content h1, .post-content h2, .post-content h3, .post-content h4 {
  font-family: var(--serif); margin: 1.6em 0 .6em; font-weight: 500; color: var(--ink-0);
}
.post-content h2 { font-size: 28px; }
.post-content h3 { font-size: 22px; }
.post-content h4 { font-size: 18px; }
.post-content blockquote {
  margin: 1.4em 0; padding: 4px 18px;
  border-left: 3px solid var(--accent);
  color: var(--ink-2); font-style: italic; background: var(--bg-2);
  border-radius: 0 8px 8px 0;
}
.post-content code {
  font-family: var(--mono); font-size: .9em;
  background: var(--bg-2); padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--line);
}
.post-content pre {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 18px; overflow-x: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
}
.post-content pre code { background: transparent; border: 0; padding: 0; }
.post-content img {
  max-width: 100%; height: auto; border-radius: 10px; margin: 1em auto; display: block;
  box-shadow: var(--shadow-card);
}
.post-content a { color: var(--accent); border-bottom: 1px dashed var(--accent); }
.post-content a:hover { background: rgba(201,138,166,0.1); }
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content hr { border: 0; height: 1px; background: var(--line); margin: 2em 0; }

@media (max-width: 720px) {
  .journal-detail { padding: 40px 24px 32px; }
  .journal-no { right: 24px; top: 40px; font-size: 24px; }
  .journal-title { font-size: 28px; }
}

/* ============ Journal list ============ */
.journal-list-row {
  display: flex; gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.journal-list-row:hover .journal-list-title { color: var(--accent); }
.journal-list-content { flex: 1; min-width: 0; }
.journal-list-title {
  font-family: var(--serif); font-size: 22px; font-weight: 500;
  margin: 0 0 6px; transition: color .2s; color: var(--ink-0);
}
.journal-list-meta {
  font-size: 11px; color: var(--ink-3); margin-bottom: 10px;
  font-family: var(--mono);
}
.journal-list-excerpt {
  font-size: 13px; color: var(--ink-2);
  line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.journal-list-no { color: var(--ink-3); font-family: var(--mono); font-size: 13px; flex-shrink: 0; }

/* ============ Article preview row (uniform width, no image) ============ */
.article-row {
  position: relative;
  display: block;
  width: 100%;
  padding: 22px 16px 22px 18px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background .25s ease, transform .25s ease;
  border-radius: 6px;
}
/* Accent left bar that grows on hover (no width changes) */
.article-row::before {
  content: '';
  position: absolute;
  left: 4px; top: 50%;
  width: 3px; height: 0;
  background: var(--accent);
  border-radius: 999px;
  transform: translateY(-50%);
  transition: height .25s ease;
  opacity: 0;
}
.article-row:hover {
  background: rgba(201,138,166,0.05);
}
.article-row:hover::before {
  height: 60%;
  opacity: 1;
}
.article-row:hover .article-title { color: var(--accent); }
.article-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--ink-3);
  margin-bottom: 8px;
  font-family: var(--mono);
  flex-wrap: wrap;
}
.article-meta .pinned { color: var(--accent-3); }
.article-title {
  font-family: var(--serif); font-size: 22px; font-weight: 500;
  margin: 0 0 8px;
  transition: color .2s; color: var(--ink-0);
  /* Clamp to 1 line */
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.article-excerpt {
  font-size: 13.5px; color: var(--ink-2);
  line-height: 1.7;
  margin: 0 0 12px;
  /* Clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.article-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11px; color: var(--ink-3);
  margin-top: 4px;
}

/* ============ Pinned articles section ============ */
.article-pinned {
  margin-bottom: 28px;
  padding: 18px 18px 6px;
  background: linear-gradient(135deg, rgba(201,138,166,0.06), rgba(157,142,201,0.04));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  position: relative;
}
.article-pinned-head {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; letter-spacing: 0.18em;
  color: var(--accent); font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.article-row-pinned {
  border-bottom: 1px dashed var(--line) !important;
}
.article-row-pinned:last-child { border-bottom: 0 !important; }
.article-row-pinned .pinned-badge {
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* ============ Sort tabs ============ */
.article-tabs {
  display: flex; gap: 4px;
  margin: 0 0 8px;
  padding: 4px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: fit-content;
}
.article-tab {
  padding: 7px 18px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-family: var(--sans);
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: 0.04em;
}
.article-tab:hover { color: var(--ink-0); }
.article-tab.active {
  background: var(--accent);
  color: var(--bg-0);
}

/* ============ Articles layout ============ */
.with-side {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 48px;
  align-items: flex-start;
}
@media (max-width: 860px) { .with-side { grid-template-columns: 1fr; } }
.side {
  position: sticky; top: 90px;
  display: flex; flex-direction: column; gap: 22px;
}
@media (max-width: 860px) { .side { position: static; } }
.side-block { padding: 16px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-m); }
.side-block h4 {
  margin: 0 0 12px; font-size: 11px; letter-spacing: 0.1em;
  color: var(--ink-3); font-weight: 600; text-transform: uppercase;
}
.side-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.side-cats { display: flex; flex-direction: column; gap: 0; }
.side-cat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; cursor: pointer; font-size: 13px;
  color: var(--ink-1); text-decoration: none;
}
.side-cat-row:hover { color: var(--accent); }
.side-cat-row .ct { color: var(--ink-3); font-family: var(--mono); font-size: 11px; }
.side-cat-row.active { color: var(--accent); }
.side-search-wrap {
  position: relative;
  display: flex; align-items: center;
}
.side-search-icon {
  position: absolute;
  left: 10px;
  color: var(--ink-3);
  pointer-events: none;
  transition: color .2s;
}
.side-search-wrap:focus-within .side-search-icon { color: var(--accent); }
.side-search-input {
  width: 100%;
  background: var(--bg-2);
  padding: 8px 10px 8px 32px;            /* leave room for icon */
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--ink-0);
  font: inherit; font-size: 13px;
  outline: 0;
  transition: border-color .2s;
}
.side-search-input:focus { border-color: var(--accent); }

/* ============ Timeline ============ */
.timeline-year-row {
  display: flex; gap: 32px;
  align-items: flex-start;
  margin-bottom: 8px;
}
@media (max-width: 720px) { .timeline-year-row { flex-direction: column; gap: 16px; } }
.timeline-year-stamp {
  flex-shrink: 0;
  font-family: var(--serif);
  font-size: 80px; line-height: 1;
  color: var(--ink-4);
  font-weight: 400;
  font-feature-settings: "lnum";
  width: 220px;
  position: sticky; top: 90px;
  user-select: none;
}
@media (max-width: 720px) { .timeline-year-stamp { position: static; font-size: 60px; width: auto; } }
.timeline-year-stamp .y { color: var(--ink-2); }
.timeline-content { flex: 1; min-width: 0; padding-top: 8px; }
.timeline-month {
  font-size: 11px; color: var(--ink-3); letter-spacing: 0.2em;
  margin: 24px 0 12px;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 12px;
}
.timeline-month::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.timeline-item {
  display: flex; gap: 24px; align-items: center;
  padding: 12px 0;
  cursor: pointer;
  transition: padding-left .2s;
  text-decoration: none;
  color: inherit;
}
.timeline-item:hover { padding-left: 8px; }
.timeline-item:hover .ti-title { color: var(--accent); }
.ti-day { width: 40px; font-family: var(--mono); font-size: 13px; color: var(--ink-3); flex-shrink: 0; }
.ti-title { flex: 1; font-size: 14px; color: var(--ink-1); transition: color .2s; }
.ti-kind { font-size: 11px; color: var(--ink-3); flex-shrink: 0; }
.ti-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}
.ti-dot.green  { background: var(--accent-2); }
.ti-dot.amber  { background: var(--accent-3); }
.ti-dot.purple { background: var(--accent-purple); }
.ti-dot.rose   { background: var(--accent); }

/* Timeline action buttons (上一年 / 回到顶部) */
.tl-actions {
  display: flex; justify-content: center; gap: 14px;
  margin: 56px 0 0;
  flex-wrap: wrap;
}
.tl-action-btn {
  padding: 10px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-1);
  color: var(--ink-1);
  font-size: 13px;
  font-family: var(--sans);
  cursor: pointer;
  transition: all .2s;
  display: inline-flex; align-items: center; gap: 6px;
  letter-spacing: .04em;
}
.tl-action-btn:hover { background: var(--accent); color: var(--bg-0); border-color: var(--accent); transform: translateY(-1px); }
.tl-action-btn:disabled { opacity: .4; cursor: not-allowed; }
.tl-action-btn:disabled:hover { background: var(--bg-1); color: var(--ink-1); border-color: var(--line-strong); transform: none; }

/* Year scrubber */
.year-scrubber {
  position: sticky; top: 70px; z-index: 5;
  display: flex; gap: 8px; padding: 14px 0;
  background: linear-gradient(180deg, var(--bg-0) 0 80%, transparent);
  margin-bottom: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.year-pill {
  padding: 6px 14px; border-radius: 999px;
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all .2s;
}
.year-pill:hover { color: var(--ink-0); border-color: var(--line-strong); }
.year-pill.active { color: var(--bg-0); background: var(--accent); border-color: var(--accent); }

/* ============ Thoughts (refined editorial cards) ============ */
.thoughts-shell {
  max-width: 760px;
  margin: 0 auto;
}
.thought-card {
  position: relative;
  padding: 12px 22px 10px;        /* tighter still */
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(201,138,166,0.04) 0%, transparent 35%),
    var(--bg-1);
  margin-bottom: 10px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset, 0 2px 10px rgba(0,0,0,0.14);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  overflow: hidden;
}
/* Decorative left accent stripe */
.thought-card::before {
  content: '';
  position: absolute;
  left: 0; top: 14px; bottom: 12px;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  border-radius: 0 3px 3px 0;
  opacity: 0.55;
  transition: opacity .25s ease, top .3s ease, bottom .3s ease;
}
/* Big "思" character watermark in bottom-right */
.thought-card::after {
  content: '思';
  position: absolute;
  bottom: -16px; right: 12px;
  font-family: var(--serif);
  font-size: 76px; line-height: 1;
  color: var(--accent);
  opacity: 0.06;
  pointer-events: none;
  font-weight: 600;
  transition: opacity .35s ease, transform .35s ease, color .25s ease;
  user-select: none;
}
.thought-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 22px rgba(0,0,0,0.24);
}
.thought-card:hover::before {
  opacity: 1;
  top: 8px; bottom: 6px;
}
.thought-card:hover::after {
  opacity: 0.14;
  transform: scale(1.08) rotate(-4deg);
  transform-origin: bottom right;
}

.thought-card .thought-title {
  font-family: var(--serif);
  font-size: 16px; font-weight: 500;
  margin: 0;
  color: var(--ink-0);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .25s ease;
  position: relative;
  z-index: 1;
}
/* Subtle leading mark before the title text */
.thought-card .thought-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 13px;
  background: var(--accent);
  border-radius: 2px;
  vertical-align: -2px;
  margin-right: 7px;
  opacity: 0.5;
  transition: opacity .25s ease;
}
.thought-card:hover .thought-title { color: var(--accent); }
.thought-card:hover .thought-title::before { opacity: 1; }

/* Compact head + foot */
.thought-card .thought-head {
  padding-bottom: 7px;
  margin-bottom: 9px;
  border-bottom: 1px dashed var(--line);
}
.thought-card .thought-head .thought-avatar { width: 28px; height: 28px; }
.thought-card .thought-head .thought-name { font-size: 12.5px; color: var(--ink-0); font-weight: 500; }
.thought-card .thought-head .thought-type { font-size: 11px; }
.thought-card .thought-head .thought-date { font-size: 11px; }

.thought-card .thought-foot {
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
}
.thought-card .thought-expand {
  position: relative;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(201,138,166,0.08);
  border: 1px solid transparent;
  font-size: 11.5px;
}
.thought-card .thought-expand:hover {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
}
.thought-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.thought-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #d9b8c8, #9d8ec9);
  flex-shrink: 0;
  position: relative; overflow: hidden;
}
.thought-avatar::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 38%, #f5e3d8 0 32%, transparent 33%),
    radial-gradient(circle at 38% 36%, #2a1f29 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 62% 36%, #2a1f29 0 1.2px, transparent 1.8px),
    linear-gradient(180deg, #e8d4c8 0 50%, #d9b8c8 50%);
}
.thought-meta {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1; min-width: 0;
  line-height: 1.2;
}
.thought-name { font-size: 13px; font-weight: 500; color: var(--ink-0); }
.thought-type { font-size: 11px; color: var(--ink-3); }
.thought-date {
  font-size: 11px; color: var(--ink-3);
  font-family: var(--mono);
  flex-shrink: 0;
}
.thought-text {
  font-size: 14px; line-height: 1.85;
  color: var(--ink-1);
  margin: 0;
  font-family: var(--serif);
}
.thought-image {
  margin-top: 14px;
  max-width: 100%;
  border-radius: 8px;
  max-height: 280px;
  object-fit: cover;
  display: block;
}
.thought-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--ink-3);
}
.thought-meta-item {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-3);
}
.thought-meta-item svg { opacity: .7; }
.thought-expand {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent);
  font-size: 12.5px; font-weight: 500;
  transition: gap .2s;
}
.thought-expand:hover { gap: 8px; color: var(--ink-0); }

/* ============ Friends ============ */
.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.friend-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 50px 16px 18px;     /* extra right padding for arrow */
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(201,138,166,0.04) 0%, transparent 50%),
    var(--bg-1);
  text-decoration: none;
  color: inherit;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset, 0 2px 10px rgba(0,0,0,0.12);
}

/* Left accent stripe — always visible (subtle), brighter on hover */
.friend-card::before {
  content: '';
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  opacity: 0.45;
  transition: opacity .3s ease, top .3s ease, bottom .3s ease;
  background: var(--accent);
}
.friend-card.rose::before   { background: var(--accent); }
.friend-card.purple::before { background: var(--accent-purple); }
.friend-card.green::before  { background: var(--accent-2); }
.friend-card.amber::before  { background: var(--accent-3); }

.friend-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 26px rgba(0,0,0,0.28);
}
.friend-card:hover::before { opacity: 1; top: 8px; bottom: 8px; }

/* Auto-injected circular initial icon */
.friend-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--bg-0);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  box-shadow: 0 4px 12px rgba(201,138,166,0.25);
  transition: transform .3s ease, box-shadow .3s ease;
}
.friend-card.rose   .friend-icon { background: linear-gradient(135deg, var(--accent), #b8d49a); }
.friend-card.purple .friend-icon { background: linear-gradient(135deg, var(--accent-purple), var(--accent)); }
.friend-card.green  .friend-icon { background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 4px 12px rgba(184,212,154,0.25); }
.friend-card.amber  .friend-icon { background: linear-gradient(135deg, var(--accent-3), var(--accent)); box-shadow: 0 4px 12px rgba(230,184,136,0.25); }
.friend-card:hover .friend-icon {
  transform: scale(1.08) rotate(-4deg);
}

.friend-card > .friend-name,
.friend-card > .friend-desc {
  /* When name/desc are direct children (no wrapping div), let them fill the space */
  flex: 1; min-width: 0;
}
/* Wrap name + desc into a column block visually */
.friend-card .friend-name,
.friend-card .friend-desc {
  margin: 0;
  display: block;
}
.friend-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-0);
  line-height: 1.35;
  transition: color .25s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.friend-card:hover .friend-name { color: var(--accent); }
.friend-desc {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 4px !important;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.friend-arrow {
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--ink-3);
  transition: all .25s ease;
}
.friend-card:hover .friend-arrow {
  color: var(--accent);
  transform: translateY(-50%) translate(3px, -3px);
}

/* ============ Friends contact / friend-link request form ============ */
.friends-cta {
  margin-top: 56px;
  padding: 28px 32px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  text-align: center;
  background: linear-gradient(135deg, rgba(201,138,166,0.04), rgba(157,142,201,0.03));
}
.friends-cta h3 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0 0 8px;
  font-weight: 500;
  color: var(--ink-0);
}
.friends-cta > p {
  color: var(--ink-2);
  font-size: 13px;
  margin: 0 0 18px;
}

.contact-form {
  display: flex; flex-direction: column;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
}
.contact-field {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink-0);
  font-family: var(--sans);
  font-size: 13.5px;
  outline: 0;
  transition: border-color .2s;
}
.contact-field::placeholder { color: var(--ink-3); white-space: pre-line; }
.contact-field:focus { border-color: var(--accent); }
.contact-textarea {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  min-height: 110px;
}
.contact-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.contact-hint {
  flex: 1; min-width: 200px;
  text-align: left;
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--sans);
  transition: color .25s;
}


/* ============ About ============ */
.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: flex-start;
}
@media (max-width: 720px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }
.about-avatar {
  width: 220px; height: 220px; border-radius: 50%;
  background: linear-gradient(135deg, #d9b8c8, #9d8ec9 60%, #534467);
  position: relative; overflow: hidden;
  box-shadow: 0 0 0 6px var(--bg-1), 0 0 0 7px var(--line-strong), 0 30px 80px rgba(157,142,201,0.25);
}
.about-avatar::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 38%, #f5e3d8 0 32%, transparent 33%),
    radial-gradient(circle at 38% 36%, #2a1f29 0 7px, transparent 8px),
    radial-gradient(circle at 62% 36%, #2a1f29 0 7px, transparent 8px),
    radial-gradient(circle at 50% 50%, #e9aabb 0 4px, transparent 5px),
    radial-gradient(ellipse at 38% 50%, #e9aabb 0 6px, transparent 8px),
    radial-gradient(ellipse at 62% 50%, #e9aabb 0 6px, transparent 8px),
    linear-gradient(180deg, #e8d4c8 0 50%, #d9b8c8 50%);
}
.about-avatar::after {
  content: ''; position: absolute; top: -8px; left: -8px; right: -8px; height: 130px;
  background: linear-gradient(180deg, #f5e8e0 0 60%, transparent);
  border-radius: 50% 50% 40% 40% / 70% 70% 30% 30%;
}
.about-body h2 { font-family: var(--serif); font-size: 36px; margin: 0 0 8px; font-weight: 500; }
.about-body h3 { font-family: var(--serif); font-size: 18px; margin: 32px 0 12px; font-weight: 500; color: var(--ink-1); }
.about-body p { font-size: 14px; line-height: 1.85; color: var(--ink-1); margin: 0 0 14px; }
.about-body .now { color: var(--ink-2); font-size: 13px; }
.about-meta-row {
  display: flex; gap: 24px; padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 20px 0;
  flex-wrap: wrap;
}
.about-meta { font-size: 12px; }
.about-meta .lbl { color: var(--ink-3); display: block; margin-bottom: 4px; }
.about-meta .val { color: var(--ink-1); font-family: var(--mono); }

/* Timeline diary stamp */
.diary-stamp {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 86px; height: 80px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-family: var(--serif);
  margin: 32px 0 16px auto;
}
.diary-stamp .yr  { font-size: 28px; line-height: 1; color: var(--ink-1); letter-spacing: 0.04em; }
.diary-stamp .lbl { font-size: 9px;  letter-spacing: 0.4em; color: var(--ink-3); margin-top: 8px; }

/* Read-more fade */
.read-more {
  position: relative;
  margin-top: 40px;
  text-align: center;
}
.read-more::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: var(--line);
}
.read-more a {
  position: relative;
  display: inline-block;
  padding: 6px 16px;
  background: var(--bg-1);
  color: var(--accent);
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  cursor: pointer;
}
.read-more a:hover { background: var(--accent); color: var(--bg-0); }

/* ============================================================
   Hide Ghost Portal's default floating subscribe / account
   button (the round icon Ghost injects bottom-right). The theme
   already provides its own login/account button in the top nav,
   so the Portal trigger would be redundant.
   The Portal popup itself (when something is clicked) is kept.
   ============================================================ */
iframe[title="portal-trigger"],
iframe[title="portal-trigger-button"],
.gh-portal-triggerbtn-wrapper,
[data-members-form],
[data-members-trigger-button],
.gh-cta-box,
.gh-cta-form,
.cta-box,
[class*="post-cta"],
[class*="subscribe-cta"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Selected reading content */
.reading-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 36px 44px;
  margin-bottom: 24px;
}

/* "更早的手记" link block */
.older-block {
  text-align: center; padding: 24px 0; margin-top: 12px;
  font-size: 13px; color: var(--ink-3);
  border-top: 1px dashed var(--line);
}

/* ============================================================
   Default post (article) detail — article body centered with
   TOC sidebar floating to the RIGHT of the article (not at
   the viewport edge). Whole unit is centered as a group.
   ============================================================ */
.article-page-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}
.article-page {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}
.article-page-head {
  margin: 0 auto 36px;
  text-align: center;
}
.article-page-title {
  font-family: var(--serif);
  font-size: 30px; line-height: 1.3; font-weight: 500;
  margin: 0 0 14px;
  letter-spacing: 0.01em;
  color: var(--ink-0);
}
.article-page-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  justify-content: center;            /* meta centered */
  font-size: 12.5px; font-family: var(--mono);
  color: var(--ink-3);
  line-height: 1.4;
}
.article-page-meta > * {
  display: inline-flex; align-items: center;
}
.article-page-tags-top {
  display: flex; justify-content: center;   /* tags centered */
  align-items: center;
  gap: 8px; flex-wrap: wrap;
  margin: 22px 0 0;                          /* extra space from meta */
}
.article-page-tags-top .tag {
  line-height: 1;                            /* uniform vertical alignment */
  padding: 5px 11px;
}
.article-page-meta a { color: var(--ink-2); }
.article-page-meta a:hover { color: var(--accent); }
.article-page-meta .dot { color: var(--ink-4); }
.article-page-cover {
  margin: 28px 0 0;
}
.article-page-cover img {
  width: 100%; max-height: 480px; object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.article-page-cover figcaption {
  margin-top: 10px; font-size: 12px; color: var(--ink-3);
  font-style: italic; text-align: center;
}

/* Article body — no longer in a grid; centered single column */
.article-page > .post-content {
  font-family: var(--serif);
  font-size: 16px; line-height: 1.95;
  color: var(--ink-1);
}
.article-page > .post-content > p:first-child::first-letter {
  float: left;
  font-size: 56px; line-height: 0.9;
  margin: 6px 12px 0 0;
  color: var(--accent);
  font-weight: 500;
}
.article-page > .post-content img {
  display: block;
  max-width: 100%; height: auto;
  margin: 1.4em auto;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}
.article-page > .post-content figure {
  margin: 1.4em auto;
  text-align: center;
}
.article-page > .post-content figcaption {
  margin-top: 8px; font-size: 12px; color: var(--ink-3);
  font-style: italic; text-align: center;
}

/* TOC + actions sidebar — sits to the right of the article inside
   the same wrapper, sticky to viewport top. */
.article-page-side {
  flex: 0 0 220px;
  position: sticky;
  top: 100px;
  align-self: flex-start;
  display: flex; flex-direction: column; gap: 16px;
  max-height: calc(100vh - 140px);
}
@media (max-width: 980px) {
  /* On narrow screens collapse to single column — hide TOC */
  .article-page-side { display: none; }
  .article-page-wrapper { padding: 0 20px; }
}

/* TOC */
.article-toc {
  padding: 18px 20px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}
.article-toc h4 {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  font-weight: 600;
  text-transform: uppercase;
}
.toc-heading-icon {
  color: var(--accent);
  flex-shrink: 0;
}
.article-toc ul {
  list-style: none;
  padding: 0; margin: 0;
  max-height: 60vh;
  overflow-y: auto;
}
.article-toc li { margin: 0; }
.article-toc li a {
  display: block;
  padding: 6px 0 6px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-3);
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: color .2s, border-color .2s;
  cursor: pointer;
}
.article-toc li a:hover { color: var(--ink-1); }
.article-toc li a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}
.article-toc li.toc-h1 a,
.article-toc li.toc-h2 a { font-weight: 500; }
.article-toc li.toc-h3 a { padding-left: 24px; font-size: 12px; }
.article-toc li.toc-h4 a { padding-left: 36px; font-size: 11.5px; color: var(--ink-4); }
.article-toc li.toc-empty {
  font-size: 12px; color: var(--ink-3); padding: 6px 0;
  font-style: italic;
}

/* Action buttons (TTS / share / comment / top) — 4 evenly spaced */
.article-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  justify-items: center;
}
.article-action {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 4px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  cursor: pointer;
  transition: all .2s;
  font: inherit; text-decoration: none;
}
.article-action:hover { color: var(--accent); border-color: var(--line-strong); }
.article-action.is-active { color: var(--accent); background: rgba(201,138,166,0.1); border-color: var(--accent); }
.article-action.is-active svg { fill: var(--accent); }
.article-action .action-count {
  position: absolute;
  bottom: -4px; right: -4px;
  background: var(--accent);
  color: var(--bg-0);
  font-size: 10px; line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  font-family: var(--mono);
}
.article-action[data-label]::before {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--bg-3);
  color: var(--ink-0);
  font-size: 10.5px; padding: 4px 8px; border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  border: 1px solid var(--line-strong);
}
.article-action:hover[data-label]::before { opacity: 1; }

@media (max-width: 1080px) {
  .article-page-body {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .article-page-side {
    position: static;
    flex-direction: row; flex-wrap: wrap;
  }
  .article-toc { flex: 1 1 240px; }
  .article-actions { flex: 0 1 auto; }
}
@media (max-width: 720px) {
  .article-page { padding: 0 20px; }
  .article-page-title { font-size: 30px; }
  .article-page-side { flex-direction: column; }
}

/* Related articles */
.article-related {
  max-width: 960px;
  margin: 64px auto 0;
}
.article-related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.article-related-card {
  display: block;
  padding: 16px 18px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  text-decoration: none; color: inherit;
  transition: all .2s;
}
.article-related-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.article-related-card .meta {
  font-size: 11px; color: var(--ink-3); font-family: var(--mono);
  margin-bottom: 6px;
}
.article-related-card h3 {
  font-family: var(--serif); font-size: 16px; font-weight: 500;
  margin: 0 0 6px; color: var(--ink-0);
}
.article-related-card p {
  font-size: 12px; color: var(--ink-2); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ============================================================
   Thought post detail — centered "tweet detail" card, matched
   to the article body width for visual consistency.
   ============================================================ */
.thought-detail {
  max-width: 760px;          /* match article body width */
  margin: 0 auto;
  padding: 0 24px;
}
.thought-detail-card {
  padding: 28px 30px;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
}
.thought-detail-head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px dashed var(--line);
}
.thought-detail-meta { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; line-height: 1.2; }
.thought-detail-meta .thought-name { font-size: 14px; font-weight: 500; color: var(--ink-0); }
.thought-detail-meta time { font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); }
.thought-detail-title {
  font-family: var(--serif); font-size: 22px; font-weight: 500;
  margin: 0 0 12px; color: var(--ink-0);
}
.thought-detail-body {
  font-family: var(--serif);
  font-size: 17px; line-height: 1.9;
  color: var(--ink-1);
}
.thought-detail-body p { margin: 0 0 .9em; }
.thought-detail-body p:last-child { margin-bottom: 0; }
.thought-detail-image {
  margin-top: 18px;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 10px;
}
.thought-detail-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-3);
}
.thought-detail-stat {
  margin-left: auto;
  font-family: var(--mono); font-size: 11.5px;
  color: var(--ink-3);
}
.thought-detail-others {
  display: flex; flex-direction: column; gap: 0;
}
.thought-detail-other {
  display: flex; gap: 16px; padding: 14px 0;
  border-bottom: 1px dashed var(--line);
  text-decoration: none; color: inherit;
  transition: color .2s;
}
.thought-detail-other:hover .text { color: var(--accent); }
.thought-detail-other .meta {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  flex-shrink: 0; width: 90px;
}
.thought-detail-other .text {
  flex: 1; font-size: 13px; color: var(--ink-1);
  line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .2s;
}

/* ============================================================
   Paywall — shown when post is members/paid only and visitor
   does not have access. Replaces Ghost's plain default CTA
   with a blurred preview + themed call-to-action card.
   ============================================================ */
.article-paywall {
  position: relative;
  margin: 0 0 48px;
}
.article-paywall-preview {
  font-family: var(--serif);
  font-size: 16px; line-height: 1.95;
  color: var(--ink-1);
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
  max-height: 280px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
          mask-image: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
}
.article-paywall-preview > p:first-child::first-letter {
  float: left;
  font-size: 56px; line-height: 0.9;
  margin: 6px 12px 0 0;
  color: var(--accent);
  font-weight: 500;
}
.article-paywall-card {
  position: relative;
  margin: -120px auto 0;
  max-width: 480px;
  padding: 32px 28px 28px;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.25), var(--shadow-card);
  text-align: center;
  z-index: 2;
}
.article-paywall-card .paywall-icon {
  display: inline-flex; justify-content: center; align-items: center;
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  color: var(--bg-0);
  border-radius: 50%;
  margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(201,138,166,0.35);
}
/* Members-only variant uses moss green to differentiate from paid (rose) */
.article-paywall-card .paywall-icon-members {
  background: linear-gradient(135deg, var(--accent-2), #8eb37f);
  box-shadow: 0 4px 16px rgba(184,212,154,0.35);
}
.article-paywall-card h3 {
  font-family: var(--serif);
  font-size: 22px; font-weight: 500;
  margin: 0 0 10px;
  color: var(--ink-0);
}
.article-paywall-card p {
  font-size: 13.5px; color: var(--ink-2);
  line-height: 1.7; margin: 0 0 22px;
}
.paywall-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.paywall-meta {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px; color: var(--ink-3);
  font-family: var(--mono);
}

@media (max-width: 600px) {
  .article-paywall-card { padding: 24px 20px; margin-top: -100px; }
  .article-paywall-card h3 { font-size: 18px; }
}

/* ============================================================
   Custom themed comment section (replaces Ghost native widget).
   Built around the Members Comments API.
   ============================================================ */
.gs-comments {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.gs-comments-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 18px;
  flex-wrap: wrap; gap: 8px;
}
.gs-comments-head h2 {
  font-family: var(--serif);
  font-size: 20px; font-weight: 500;
  color: var(--ink-0);
  margin: 0;
}
.gs-comments-count {
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-3);
}

/* Reusable button styles */
.gs-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  border: 1px solid transparent;
  letter-spacing: .04em;
  background: transparent;
  color: inherit;
  font-family: inherit;
}
.gs-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.gs-btn-primary {
  background: var(--accent); color: var(--bg-0);
  border-color: var(--accent);
}
.gs-btn-primary:hover { background: var(--ink-0); color: var(--bg-0); border-color: var(--ink-0); }
.gs-btn-primary:disabled:hover { background: var(--accent); color: var(--bg-0); border-color: var(--accent); }
.gs-btn-ghost {
  background: transparent; color: var(--ink-1);
  border-color: var(--line-strong);
}
.gs-btn-ghost:hover { color: var(--accent); border-color: var(--accent); }

/* Avatars */
.gs-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  flex-shrink: 0; object-fit: cover;
  background: var(--bg-2);
}
.gs-avatar-fallback {
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  color: var(--bg-0);
  font-family: var(--serif); font-size: 14px; font-weight: 500;
}

/* Compose / login zone */
.gs-comments-compose {
  margin-bottom: 22px;
}
.gs-comments-compose-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  font-size: 13px; color: var(--ink-3);
}
.gs-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: gs-spin .8s linear infinite;
}
@keyframes gs-spin { to { transform: rotate(360deg); } }

.gs-compose-prompt {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(201,138,166,0.10), rgba(157,142,201,0.06));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  flex-wrap: wrap;
}
.gs-prompt-text { flex: 1; min-width: 180px; }
.gs-prompt-text strong { display: block; font-size: 14px; color: var(--ink-0); font-weight: 500; margin-bottom: 4px; font-family: var(--serif); }
.gs-prompt-text p { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.gs-prompt-actions { display: flex; gap: 8px; flex-shrink: 0; }

.gs-compose-row {
  display: flex; gap: 12px;
  padding: 18px 22px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}
.gs-compose-body { flex: 1; min-width: 0; }
.gs-compose-name { font-size: 13px; color: var(--ink-1); font-weight: 500; margin-bottom: 8px; }
.gs-compose-body textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink-0);
  font-family: var(--serif);
  font-size: 14px; line-height: 1.6;
  resize: vertical;
  outline: 0;
  transition: border-color .2s;
}
.gs-compose-body textarea:focus { border-color: var(--accent); }
.gs-compose-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  flex-wrap: wrap; gap: 10px;
}
.gs-compose-hint { font-size: 11px; color: var(--ink-3); }

.gs-comments-disabled {
  padding: 16px 20px;
  background: var(--bg-1);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-m);
  font-size: 12.5px; color: var(--ink-2);
  line-height: 1.7;
}

/* Comment list */
.gs-comments-list {
  list-style: none;
  padding: 0; margin: 0;
}
.gs-comment {
  display: flex; gap: 12px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--line);
}
.gs-comment:last-child { border-bottom: 0; }
.gs-comment-body { flex: 1; min-width: 0; }
.gs-comment-body header {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.gs-comment-name { font-size: 13.5px; font-weight: 500; color: var(--ink-0); }
.gs-comment-date { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.gs-comment-content {
  font-family: var(--serif);
  font-size: 14.5px; line-height: 1.75;
  color: var(--ink-1);
  word-wrap: break-word;
  word-break: break-word;
}
.gs-comment-content p { margin: 0 0 .6em; }
.gs-comment-content p:last-child { margin: 0; }
.gs-comment-content a { color: var(--accent); border-bottom: 1px dashed var(--accent); }
.gs-comment-content code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg-2);
  padding: 1px 5px;
  border-radius: 4px;
}
.gs-comment-body footer {
  display: flex; gap: 14px;
  margin-top: 10px;
  font-size: 12px; color: var(--ink-3);
}
.gs-comment-action {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 0;
  padding: 0; cursor: pointer;
  color: var(--ink-3);
  font: inherit;
  transition: color .2s;
}
.gs-comment-action:hover { color: var(--accent); }
.gs-comment-like.is-liked { color: var(--accent); }
.gs-comment-like.is-liked svg { fill: var(--accent); }

/* Avatars — small variant for replies */
.gs-avatar-sm { width: 28px; height: 28px; }
.gs-avatar-sm.gs-avatar-fallback { font-size: 11px; }

/* Replies (nested) */
.gs-comments-replies {
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--line);
}
.gs-comments-replies .gs-comment {
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.gs-comments-replies .gs-comment:last-child { border-bottom: 0; padding-bottom: 0; }

/* Inline reply form */
.gs-reply-form {
  margin-top: 10px;
}
.gs-reply-row {
  display: flex; gap: 10px;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.gs-reply-body { flex: 1; min-width: 0; }
.gs-reply-body textarea {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink-0);
  font-family: var(--serif);
  font-size: 13px; line-height: 1.6;
  resize: vertical;
  outline: 0;
}
.gs-reply-body textarea:focus { border-color: var(--accent); }
.gs-reply-actions {
  display: flex; gap: 8px; align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.gs-reply-actions .gs-btn { padding: 5px 12px; font-size: 11.5px; }
.gs-reply-hint { flex: 1; font-size: 11px; }

.gs-comments-empty {
  padding: 28px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  font-style: italic;
  font-family: var(--serif);
}

@media (max-width: 720px) {
  .gs-compose-row, .gs-compose-prompt { padding: 14px 16px; }
  .gs-comments-replies { padding-left: 12px; }
}

/* ============ Lazy-reveal pagination (load-more) ============ */
.gs-hidden { display: none !important; }
.gs-fade-in {
  animation: gs-list-fade .35s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes gs-list-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gs-load-more-wrap {
  margin: 32px 0 8px;
  text-align: center;
}
.gs-load-more {
  padding: 9px 24px;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-1);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  transition: all .25s ease;
  letter-spacing: 0.04em;
}
.gs-load-more:hover {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(201,138,166,0.25);
}

/* ============ Pagination ============ */
.pagination {
  display: flex; justify-content: space-between; align-items: center;
  margin: 48px 0 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}
.pagination a {
  padding: 6px 14px; border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer; transition: all .2s;
}
.pagination a:hover { background: var(--accent); color: var(--bg-0); border-color: var(--accent); }
.pagination .pg-info { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

/* ============ Tag/Author archive ============ */
.archive-head {
  text-align: center;
  padding: 56px 0 32px;
}
.archive-eyebrow { color: var(--ink-3); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 8px; }
.archive-title { font-family: var(--serif); font-size: 48px; margin: 0 0 8px; }
.archive-desc { color: var(--ink-2); margin: 0; }

/* ============================================================
   Koenig editor card classes (Ghost requirement)
   These let images, galleries, and embeds break out of the
   main reading column when the writer chooses "wide" or "full".
   ============================================================ */
.post-content :is(.kg-width-wide, .kg-image-card.kg-width-wide) {
  position: relative;
  width: calc(100% + 120px);
  max-width: calc(100vw - 64px);
  margin-left: -60px;
  margin-right: -60px;
}
.post-content :is(.kg-width-full, .kg-image-card.kg-width-full) {
  position: relative;
  width: calc(100vw - 32px);
  max-width: calc(100vw - 32px);
  margin-left: calc(50% - 50vw + 16px);
  margin-right: calc(50% - 50vw + 16px);
}
.post-content .kg-image-card img,
.post-content .kg-gallery-card img,
.post-content .kg-bookmark-card img {
  width: 100%; height: auto; border-radius: 10px;
}
.post-content .kg-image-card figcaption,
.post-content .kg-embed-card figcaption,
.post-content .kg-gallery-card figcaption {
  text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 8px;
}

/* Bookmark card */
.post-content .kg-bookmark-card {
  margin: 1.6em 0;
  display: block;
}
.post-content .kg-bookmark-container {
  display: flex; align-items: stretch;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  min-height: 110px;
}
.post-content .kg-bookmark-content { flex: 1; padding: 16px 18px; }
.post-content .kg-bookmark-title { color: var(--ink-0); font-weight: 500; margin-bottom: 4px; }
.post-content .kg-bookmark-description { color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.post-content .kg-bookmark-metadata {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--ink-3); margin-top: 12px;
}
.post-content .kg-bookmark-icon { width: 16px; height: 16px; }
.post-content .kg-bookmark-thumbnail { flex: 0 0 35%; max-width: 240px; min-height: 110px; }
.post-content .kg-bookmark-thumbnail img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 0;
}
@media (max-width: 600px) {
  .post-content .kg-bookmark-container { flex-direction: column; }
  .post-content .kg-bookmark-thumbnail { flex: 0 0 auto; max-width: 100%; min-height: 160px; }
}

/* Gallery */
.post-content .kg-gallery-card { margin: 1.6em 0; }
.post-content .kg-gallery-container { display: flex; flex-direction: column; gap: 8px; }
.post-content .kg-gallery-row { display: flex; gap: 8px; flex-wrap: nowrap; }
.post-content .kg-gallery-image { flex: 1 0 0%; min-width: 0; }
.post-content .kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }

/* Embed and video */
.post-content .kg-embed-card { margin: 1.6em 0; }
.post-content .kg-embed-card iframe { max-width: 100%; border-radius: 10px; }
.post-content .kg-video-card video { width: 100%; border-radius: 10px; }
.post-content .kg-audio-card { margin: 1.4em 0; }

/* Callout */
.post-content .kg-callout-card {
  display: flex; gap: 14px;
  padding: 16px 18px;
  border-radius: 10px;
  margin: 1.4em 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.post-content .kg-callout-emoji { font-size: 22px; line-height: 1; flex-shrink: 0; }

/* Toggle */
.post-content .kg-toggle-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 1.4em 0;
  background: var(--bg-2);
}
.post-content .kg-toggle-heading-text { font-weight: 500; color: var(--ink-0); }
.post-content .kg-toggle-content { color: var(--ink-1); margin-top: 8px; font-size: 14px; line-height: 1.7; }

/* Buttons */
.post-content .kg-button-card { text-align: center; margin: 1.6em 0; }
.post-content .kg-button-card a {
  display: inline-block; padding: 10px 24px;
  background: var(--accent); color: var(--bg-0);
  border-radius: 999px; text-decoration: none;
  border: 0;
  font-weight: 500;
}
.post-content .kg-button-card a:hover { background: var(--ink-0); }

/* File card */
.post-content .kg-file-card { margin: 1.4em 0; }
.post-content .kg-file-card-container {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-2);
  text-decoration: none;
}

/* Product card */
.post-content .kg-product-card { margin: 1.6em 0; }

/* Header card */
.post-content .kg-header-card {
  padding: 48px 24px; text-align: center;
  border-radius: 12px; margin: 1.6em 0;
  background: var(--bg-2);
}

/* Card spacing tweaks for wide & full inside narrow column */
@media (max-width: 720px) {
  .post-content :is(.kg-width-wide, .kg-width-full) {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* ============ Error page ============ */
.error-shell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; text-align: center; padding: 40px 24px;
}
.error-num {
  font-family: var(--serif); font-size: 120px; color: var(--accent);
  font-weight: 300; line-height: 1; margin: 0 0 8px;
}
.error-msg { font-family: var(--serif); font-size: 22px; margin: 0 0 24px; }
