/* =========================================================================
   TRENDIUMO LAB — Glass / Neon design system
   ========================================================================= */

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

:root {
  --font-jp: "Noto Sans JP", system-ui, sans-serif;
  --font-display: "Space Grotesk", "Noto Sans JP", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --accent: oklch(0.74 0.18 48);
  --accent-strong: oklch(0.68 0.19 42);
  --accent-soft: oklch(0.74 0.18 48 / 0.14);
  --accent-glow: oklch(0.74 0.2 48 / 0.55);

  --cool: oklch(0.7 0.13 250);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --maxw: 1300px;
  --header-h: 68px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(0.16 0.014 264);
  --bg-2: oklch(0.19 0.016 264);
  --ink: oklch(0.96 0.005 264);
  --ink-soft: oklch(0.78 0.012 264);
  --ink-mute: oklch(0.6 0.014 264);
  --line: oklch(1 0 0 / 0.1);
  --line-strong: oklch(1 0 0 / 0.18);

  --glass: oklch(0.26 0.016 264 / 0.55);
  --glass-2: oklch(0.3 0.018 264 / 0.5);
  --glass-hi: oklch(1 0 0 / 0.06);
  --glass-border: oklch(1 0 0 / 0.12);
  --glass-shadow: 0 20px 50px -20px oklch(0 0 0 / 0.7);

  --orb-1: oklch(0.74 0.2 48 / 0.5);
  --orb-2: oklch(0.65 0.16 255 / 0.42);
  --orb-3: oklch(0.7 0.16 320 / 0.3);

  --code-bg: oklch(0.22 0.016 264 / 0.7);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: oklch(0.975 0.004 250);
  --bg-2: oklch(0.95 0.006 250);
  --ink: oklch(0.24 0.012 264);
  --ink-soft: oklch(0.4 0.012 264);
  --ink-mute: oklch(0.54 0.012 264);
  --line: oklch(0.24 0.02 264 / 0.1);
  --line-strong: oklch(0.24 0.02 264 / 0.16);

  --glass: oklch(1 0 0 / 0.62);
  --glass-2: oklch(1 0 0 / 0.55);
  --glass-hi: oklch(1 0 0 / 0.7);
  --glass-border: oklch(1 0 0 / 0.7);
  --glass-shadow: 0 18px 44px -22px oklch(0.5 0.05 264 / 0.4);

  --orb-1: oklch(0.8 0.16 48 / 0.4);
  --orb-2: oklch(0.78 0.12 255 / 0.34);
  --orb-3: oklch(0.82 0.12 320 / 0.26);

  --code-bg: oklch(0.96 0.006 264 / 0.85);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-jp);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.01em;
  min-height: 100vh;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(46rem 40rem at 82% -8%, var(--orb-1), transparent 60%),
    radial-gradient(40rem 38rem at 8% 4%, var(--orb-2), transparent 58%),
    radial-gradient(34rem 30rem at 60% 108%, var(--orb-3), transparent 60%);
  filter: saturate(1.05);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 0%, transparent 75%);
  opacity: 0.5;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent-soft); color: var(--ink); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-mute); background-clip: padding-box; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.glass {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi);
}

.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 500;
  color: var(--ink-soft);
  background: var(--glass-hi);
  border: 1px solid var(--line);
  padding: 4px 11px; border-radius: 99px;
  transition: all 0.2s var(--ease);
}
.tag:hover { color: var(--accent); border-color: var(--accent); }
.tag .dot { width: 6px; height: 6px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  border-radius: 99px; padding: 10px 18px;
  border: 1px solid var(--glass-border);
  background: var(--glass-hi);
  color: var(--ink);
  transition: all 0.22s var(--ease);
}
.btn:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.btn-accent {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: oklch(0.16 0.02 60);
  border-color: transparent;
  box-shadow: 0 6px 22px -6px var(--accent-glow), inset 0 1px 0 oklch(1 0 0 / 0.4);
}
.btn-accent:hover { box-shadow: 0 10px 30px -6px var(--accent-glow), inset 0 1px 0 oklch(1 0 0 / 0.4); transform: translateY(-2px); }
.btn-ghost { background: transparent; border-color: var(--line); }

.iconbtn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--glass-hi);
  color: var(--ink-soft);
  transition: all 0.2s var(--ease);
}
.iconbtn:hover { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.iconbtn svg { width: 19px; height: 19px; }

/* ---- HEADER ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.site-header .wrap { display: flex; align-items: center; gap: 22px; width: 100%; }

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand .mark {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.15), 0 6px 18px -6px var(--accent-glow);
  position: relative;
}
.brand .mark svg { width: 20px; height: 20px; color: oklch(0.16 0.02 60); }
.brand .name { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -0.01em; }
.brand .name b { color: var(--accent); font-weight: 700; }

.search {
  flex: 1 1 0; min-width: 0; max-width: 440px;
  display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 15px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--glass-hi); color: var(--ink-mute);
  transition: all 0.2s var(--ease);
}
.search:hover, .search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg { width: 17px; height: 17px; flex-shrink: 0; }
.search input { flex: 1; background: none; border: none; outline: none; color: var(--ink); font-family: var(--font-jp); font-size: 14px; }
.search input::placeholder { color: var(--ink-mute); }
.search kbd { font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; color: var(--ink-mute); }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  font-family: var(--font-display);
  font-weight: 500; font-size: 14px;
  color: var(--ink-soft);
  padding: 8px 13px; border-radius: 10px;
  transition: all 0.18s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--glass-hi); }
.nav a.active { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.avatar {
  width: 40px; height: 40px; border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, var(--cool), var(--accent));
  flex-shrink: 0;
}

/* ---- FOOTER ---- */
.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--line);
  padding: 48px 0 60px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.site-footer .col h4 { font-family: var(--font-display); font-size: 13px; letter-spacing: 0.04em; margin: 0 0 14px; color: var(--ink); }
.site-footer .col a { display: block; color: var(--ink-mute); font-size: 13px; padding: 5px 0; transition: color 0.18s var(--ease); }
.site-footer .col a:hover { color: var(--accent); }
.site-footer .legal { width: 100%; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--ink-mute); font-size: 12px; font-family: var(--font-mono); }

.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 1080px) {
  .nav { display: none; }
}
@media (max-width: 760px) {
  .search { display: none; }
}

/* =========================================================================
   FEED PAGE
   ========================================================================= */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 36px; padding-top: 40px; align-items: start; }

.hero {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 38px 40px;
  margin-bottom: 38px;
  overflow: hidden;
  --mx: 80%;
  --my: 0%;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.9;
  background: radial-gradient(28rem 22rem at var(--mx) var(--my), var(--accent-soft), transparent 60%);
  transition: opacity 0.4s var(--ease);
}
.hero .eyebrow { margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.hero .eyebrow .live { width: 7px; height: 7px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700; font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.18; letter-spacing: -0.02em;
  margin: 0 0 14px; max-width: 18ch;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--ink-soft); max-width: 52ch; margin: 0 0 24px; font-size: 15px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .glyph {
  position: absolute; right: -40px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 230px; font-weight: 600;
  color: var(--accent); opacity: 0.1; line-height: 1; user-select: none;
}

.section-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.tabs { display: flex; gap: 6px; background: var(--glass-hi); border: 1px solid var(--line); padding: 5px; border-radius: 14px; }
.tabs button {
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  color: var(--ink-mute); background: none; border: none;
  padding: 8px 16px; border-radius: 9px; transition: all 0.2s var(--ease);
}
.tabs button.active { color: oklch(0.16 0.02 60); background: linear-gradient(180deg, var(--accent), var(--accent-strong)); box-shadow: 0 4px 14px -5px var(--accent-glow); }
.tabs button:not(.active):hover { color: var(--ink); }
.section-bar .pickrow { display: flex; align-items: center; gap: 10px; color: var(--ink-mute); font-size: 13px; }

.feature-card {
  display: grid; grid-template-columns: 220px 1fr; gap: 28px;
  border-radius: var(--radius-lg); padding: 26px; margin-bottom: 30px;
  position: relative; overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--glass-shadow), 0 0 0 1px var(--accent-soft); }
.emoji-tile {
  border-radius: var(--radius); display: grid; place-items: center;
  font-size: 76px; aspect-ratio: 1; position: relative; overflow: hidden;
  background:
    radial-gradient(120% 120% at 30% 20%, var(--accent-soft), transparent 60%),
    var(--glass-2);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.emoji-tile.lg { font-size: 92px; }
.emoji-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 40%, var(--glass-hi)); }
.feature-card .body { display: flex; flex-direction: column; }
.feature-card .kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.feature-card h2 { font-family: var(--font-display); font-weight: 700; font-size: 27px; line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 12px; }
.feature-card a:hover h2 { color: var(--accent); }
.feature-card .excerpt { color: var(--ink-soft); font-size: 14.5px; margin: 0 0 auto; }
.feature-card .meta { display: flex; align-items: center; gap: 16px; margin-top: 20px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
  position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-4px); }
.card:hover::before { opacity: 1; }
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft);
  opacity: 0; transition: opacity 0.28s var(--ease); pointer-events: none;
}
.card .top { display: flex; gap: 15px; align-items: flex-start; }
.card .emoji-sm {
  width: 64px; height: 64px; flex-shrink: 0; border-radius: 14px;
  display: grid; place-items: center; font-size: 32px;
  background: radial-gradient(120% 120% at 30% 20%, var(--accent-soft), transparent 65%), var(--glass-2);
  border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi);
}
.card h3 { font-family: var(--font-jp); font-weight: 700; font-size: 16.5px; line-height: 1.5; margin: 0; letter-spacing: 0; }
.card:hover h3 { color: var(--accent); }
.card .tags { display: flex; flex-wrap: wrap; gap: 7px; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }

.author { display: flex; align-items: center; gap: 9px; }
.author .pic { width: 28px; height: 28px; border-radius: 99px; flex-shrink: 0; border: 1px solid var(--line); }
.author .nm { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.author .dt { font-size: 12px; color: var(--ink-mute); font-family: var(--font-mono); }
.likes { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 13px; color: var(--ink-mute); font-weight: 500; }
.likes svg { width: 16px; height: 16px; }
.likes:hover { color: var(--accent); }

.side { display: flex; flex-direction: column; gap: 24px; position: sticky; top: calc(var(--header-h) + 28px); }
.panel { border-radius: var(--radius); padding: 22px; }
.panel h4 { font-family: var(--font-display); font-weight: 600; font-size: 14px; margin: 0 0 18px; display: flex; align-items: center; gap: 8px; letter-spacing: 0.01em; }
.panel h4 .bar { width: 3px; height: 15px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

.topiclist { display: flex; flex-direction: column; }
.topiclist a { display: flex; align-items: center; gap: 13px; padding: 11px 8px; border-radius: 11px; transition: background 0.18s var(--ease); }
.topiclist a:hover { background: var(--glass-hi); }
.topiclist .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; background: var(--glass-2); border: 1px solid var(--line); flex-shrink: 0; }
.topiclist .tx { flex: 1; min-width: 0; }
.topiclist .tx .t { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.topiclist .tx .c { font-size: 11.5px; color: var(--ink-mute); font-family: var(--font-mono); }
.topiclist .rank { font-family: var(--font-mono); font-size: 13px; color: var(--accent); font-weight: 600; width: 22px; }

.statwrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { border-radius: 13px; padding: 16px; border: 1px solid var(--line); background: var(--glass-hi); }
.stat .v { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--accent); }
.stat .l { font-size: 11.5px; color: var(--ink-mute); font-family: var(--font-mono); margin-top: 2px; }

.show-more { text-align: center; margin-top: 28px; }

.search-empty { margin: 18px 0 8px; padding: 22px 24px; border-radius: var(--radius); color: var(--ink-mute); }
.search-empty p { margin: 0; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.1em; }

.act .btn-circle[data-action='save'].on,
.act .btn-circle[data-action='like'].on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.tag-cloud .tag-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--glass);
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft);
  transition: all 0.2s var(--ease);
}
.tag-cloud .tag-chip:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.tag-cloud .tag-chip .count { font-size: 11px; color: var(--ink-mute); }

.saved-empty { text-align: center; padding: 40px 24px; color: var(--ink-mute); font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.1em; }
.saved-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.card.is-liked .likes,
.card.is-saved::after { color: var(--accent); }
.card.is-saved { box-shadow: inset 0 0 0 1px var(--accent-soft); }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; flex-direction: row; flex-wrap: wrap; }
  .side .panel { flex: 1; min-width: 280px; }
}
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .feature-card { grid-template-columns: 1fr; }
  .feature-card .emoji-tile { max-width: 130px; }
  .hero .glyph { display: none; }
}

/* =========================================================================
   ARTICLE PAGE
   ========================================================================= */
.article-layout { display: grid; grid-template-columns: 56px minmax(0,1fr) 280px; gap: 40px; padding-top: 40px; align-items: start; }

.actions-rail { position: sticky; top: calc(var(--header-h) + 40px); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.act { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.act .btn-circle {
  width: 48px; height: 48px; border-radius: 99px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(16px);
  color: var(--ink-soft); transition: all 0.22s var(--ease);
}
.act .btn-circle:hover { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); transform: translateY(-2px); }
.act .btn-circle.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.act .btn-circle svg { width: 21px; height: 21px; }
.act .n { font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); font-weight: 500; }

.article { min-width: 0; }
.article-head { border-radius: var(--radius-lg); padding: 40px; margin-bottom: 34px; position: relative; overflow: hidden; }
.article-head .emoji-hero {
  width: 96px; height: 96px; border-radius: 22px; display: grid; place-items: center; font-size: 52px;
  background: radial-gradient(120% 120% at 30% 20%, var(--accent-soft), transparent 65%), var(--glass-2);
  border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi), 0 8px 28px -12px var(--accent-glow);
  margin-bottom: 26px;
}
.article-head .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.article-head h1 {
  font-family: var(--font-jp); font-weight: 900; font-size: clamp(26px, 3vw, 38px);
  line-height: 1.45; letter-spacing: -0.01em; margin: 0 0 26px;
}
.article-head .byline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.article-head .byline .pic { width: 46px; height: 46px; border-radius: 99px; border: 1px solid var(--line-strong); }
.article-head .byline .who .n { font-weight: 700; font-size: 15px; }
.article-head .byline .who .m { font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); }
.article-head .byline .fbtn { margin-left: auto; }

.prose { font-size: 16.5px; line-height: 1.95; color: var(--ink-soft); }
.prose > * + * { margin-top: 1.3em; }
.prose h2 {
  font-family: var(--font-display); font-weight: 700; font-size: 25px; color: var(--ink);
  letter-spacing: -0.01em; margin-top: 2.2em; padding-top: 0.4em;
  display: flex; align-items: center; gap: 12px; scroll-margin-top: 100px;
}
.prose h2 .hash { font-family: var(--font-mono); color: var(--accent); font-size: 19px; opacity: 0.8; }
.prose h3 { font-family: var(--font-jp); font-weight: 700; font-size: 19px; color: var(--ink); margin-top: 1.8em; }
.prose h4 { font-family: var(--font-jp); font-weight: 700; font-size: 16px; color: var(--ink); margin-top: 1.5em; }
.prose p { margin: 0; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a.link { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.prose a.link:hover { border-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 1.1em 0; }
.prose li { margin: 0.5em 0; }
.prose li::marker { color: var(--accent); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose blockquote { border-left: 3px solid var(--accent); padding: 4px 16px; margin: 1.3em 0; color: var(--ink-mute); font-style: italic; }

.table-wrap { margin: 1.6em 0; overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--glass-hi); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table-wrap thead th { font-family: var(--font-display); font-weight: 600; font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-mute); text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--glass-2); }
.table-wrap tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: top; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover td { background: var(--glass-hi); }
.table-wrap td code { background: transparent; border: 0; padding: 0; color: var(--accent); font-size: 0.9em; }

.prose code { font-family: var(--font-mono); font-size: 0.86em; background: var(--code-bg); border: 1px solid var(--line); padding: 2px 7px; border-radius: 7px; color: var(--accent); }

.codeblock { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--code-bg); backdrop-filter: blur(12px); margin: 1.6em 0; }
.codeblock .bar { display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--glass-hi); }
.codeblock .bar .dots { display: flex; gap: 6px; }
.codeblock .bar .dots i { width: 11px; height: 11px; border-radius: 99px; display: block; }
.codeblock .bar .dots i:nth-child(1){ background: oklch(0.7 0.17 25); }
.codeblock .bar .dots i:nth-child(2){ background: oklch(0.8 0.13 90); }
.codeblock .bar .dots i:nth-child(3){ background: oklch(0.75 0.15 145); }
.codeblock .bar .fn { font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); margin-left: 6px; }
.codeblock .bar .lang { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.1em; }
.codeblock pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.75; color: var(--ink); }
.codeblock .k { color: oklch(0.78 0.13 320); }
.codeblock .s { color: oklch(0.78 0.13 145); }
.codeblock .c { color: var(--ink-mute); font-style: italic; }
.codeblock .f { color: var(--accent); }
.codeblock .n { color: oklch(0.78 0.12 230); }

.callout { display: flex; gap: 14px; border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--accent-soft); background: var(--accent-soft); margin: 1.6em 0; }
.callout .ic { font-size: 20px; flex-shrink: 0; }
.callout .tx { font-size: 14.5px; color: var(--ink); margin: 0; }
.callout .tx b { color: var(--accent); }

.article-figure { margin: 1.8em 0; }
.article-figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: var(--glass-hi); }
.article-figure figcaption { margin-top: 10px; font-size: 13px; color: var(--ink-mute); font-family: var(--font-mono); text-align: center; }

.author-card { border-radius: var(--radius-lg); padding: 28px; margin-top: 48px; display: flex; gap: 20px; align-items: center; }
.author-card .pic { width: 72px; height: 72px; border-radius: 99px; border: 1px solid var(--line-strong); flex-shrink: 0; }
.author-card .info { flex: 1; min-width: 0; }
.author-card .info .n { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.author-card .info .b { color: var(--ink-mute); font-size: 13.5px; margin-top: 4px; }

.toc-side { position: sticky; top: calc(var(--header-h) + 40px); display: flex; flex-direction: column; gap: 24px; }
.toc { border-radius: var(--radius); padding: 22px; }
.toc h4 { font-family: var(--font-display); font-weight: 600; font-size: 13px; margin: 0 0 16px; letter-spacing: 0.04em; color: var(--ink-mute); text-transform: uppercase; }
.toc a { display: block; font-size: 13.5px; color: var(--ink-mute); padding: 7px 0 7px 14px; border-left: 2px solid var(--line); transition: all 0.18s var(--ease); }
.toc a:hover, .toc a.active { color: var(--accent); border-color: var(--accent); }

.related { border-radius: var(--radius); padding: 22px; }
.related h4 { font-family: var(--font-display); font-weight: 600; font-size: 14px; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.related h4 .bar { width: 3px; height: 15px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.related a { display: flex; gap: 12px; padding: 10px 0; align-items: flex-start; }
.related a + a { border-top: 1px solid var(--line); }
.related .e { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; background: var(--glass-2); border: 1px solid var(--line); flex-shrink: 0; }
.related .t { font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--ink-soft); }
.related a:hover .t { color: var(--accent); }
.affiliate { margin: 28px 0 6px; padding: 24px 26px; }
.affiliate h4 { font-family: var(--font-display); font-weight: 600; font-size: 14px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.affiliate h4 .bar { width: 3px; height: 15px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.affiliate .aff-lead { font-size: 13px; color: var(--ink-mute); margin: 0 0 18px; line-height: 1.7; }
.affiliate .aff-group + .aff-group { margin-top: 22px; }
.affiliate .aff-grouptitle { font-size: 11px; font-weight: 700; color: var(--ink-mute); margin: 0 0 2px; letter-spacing: .06em; text-transform: none; }
.affiliate .aff-list { list-style: none; margin: 0; padding: 0; }
.affiliate .aff-list li { padding: 14px 0; }
.affiliate .aff-list li + li { border-top: 1px solid var(--line); }
.affiliate .aff-link { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-weight: 600; font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); text-decoration: none; }
.affiliate .aff-link:hover { color: var(--accent); }
.affiliate .aff-link:hover .aff-arrow { transform: translateX(3px); }
.affiliate .aff-arrow { color: var(--accent); opacity: .7; flex-shrink: 0; font-weight: 400; transition: transform .16s ease; }
.affiliate .aff-why { display: block; font-size: 12px; color: var(--ink-mute); line-height: 1.65; margin-top: 6px; }
.affiliate .aff-disclosure { font-size: 11px; color: var(--ink-mute); margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); line-height: 1.6; }

.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); box-shadow: 0 0 12px var(--accent-glow); z-index: 60; transition: width 0.1s linear; }

@media (max-width: 1080px) {
  .article-layout { grid-template-columns: 56px minmax(0,1fr); }
  .toc-side { display: none; }
}
@media (max-width: 720px) {
  .article-layout { grid-template-columns: 1fr; }
  .actions-rail { flex-direction: row; position: static; justify-content: center; }
  .article-head { padding: 26px; }
}
