:root {
  --bg: #070b14;
  --bg-2: #0d1322;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(13, 19, 34, 0.88);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8ecf4;
  --text-soft: #bcc4d4;
  --text-muted: #8b95ab;
  --accent-1: #7c3aed;
  --accent-2: #06b6d4;
  --accent-3: #f472b6;
  --grad: linear-gradient(120deg, #7c3aed, #06b6d4 55%, #f472b6);
  --shadow-border: 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-card: 0 18px 48px rgba(0, 0, 0, 0.28);
  --comment-visitor-bubble: #171b26;
  --comment-visitor-bubble-hover: #1e2431;
  --comment-author-bubble: #4967d8;
  --comment-author-bubble-hover: #5575e3;
  --radius: 16px;
  --radius-small: 8px;
  --nav-h: 64px;
  --content: 1100px;
  --article: 760px;
  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: Consolas, "SFMono-Regular", "JetBrains Mono", monospace;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-2: #ffffff;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-hover: rgba(255, 255, 255, 0.98);
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.17);
  --text: #1e2436;
  --text-soft: #3f485c;
  --text-muted: #657086;
  --shadow-border: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 18px 42px rgba(30, 36, 54, 0.11);
  --comment-visitor-bubble: #ffffff;
  --comment-visitor-bubble-hover: #f8faff;
  --comment-author-bubble: #4967d8;
  --comment-author-bubble-hover: #3f5fce;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(ellipse at 50% -25%, var(--bg-2), var(--bg) 62%);
  transition-property: color, background-color;
  transition-duration: 300ms;
  transition-timing-function: ease;
}

body.nav-open {
  overflow: hidden;
}

img,
svg,
canvas,
video {
  display: block;
  max-width: 100%;
}

img {
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}

html[data-theme="light"] img {
  outline-color: rgba(0, 0, 0, 0.1);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
  border: 0;
  cursor: pointer;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
}

h1,
h2,
h3 {
  line-height: 1.3;
  letter-spacing: 0;
  text-wrap: balance;
}

p,
li,
figcaption,
blockquote {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

::selection {
  color: #fff;
  background: rgba(124, 58, 237, 0.55);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  border: 2px solid var(--bg);
  border-radius: 8px;
  background: linear-gradient(var(--accent-1), var(--accent-2));
}

.container {
  width: min(100%, var(--content));
  margin-inline: auto;
  padding-inline: 24px;
}

.sr-only,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 16px;
  clip: auto;
  border-radius: var(--radius-small);
  color: #fff;
  background: var(--accent-1);
}

.grad-text {
  color: var(--text);
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#bg-canvas {
  position: fixed;
  z-index: -2;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0.8;
}

.aurora {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.46;
}

.aurora span {
  position: absolute;
  width: 72vw;
  height: 18vw;
  min-height: 160px;
  border-radius: 50%;
  filter: blur(95px);
  transform: rotate(-18deg);
  opacity: 0.45;
}

.aurora span:nth-child(1) {
  top: 2vh;
  left: -28vw;
  background: rgba(124, 58, 237, 0.48);
  animation: aurora-one 26s ease-in-out infinite alternate;
}

.aurora span:nth-child(2) {
  top: 44vh;
  right: -30vw;
  background: rgba(6, 182, 212, 0.42);
  animation: aurora-two 32s ease-in-out infinite alternate;
}

.aurora span:nth-child(3) {
  bottom: 2vh;
  left: 18vw;
  background: rgba(244, 114, 182, 0.34);
  animation: aurora-three 38s ease-in-out infinite alternate;
}

html[data-theme="light"] .aurora {
  opacity: 0.22;
}

@keyframes aurora-one {
  to { transform: translate(20vw, 8vh) rotate(-10deg); }
}

@keyframes aurora-two {
  to { transform: translate(-18vw, -10vh) rotate(-25deg); }
}

@keyframes aurora-three {
  to { transform: translate(10vw, -8vh) rotate(-8deg); }
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.62);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
}

html[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.72);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: 18px;
}

.brand {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 1.18rem;
  font-weight: 750;
  white-space: nowrap;
}

.brand img {
  flex: 0 1 auto;
  width: auto;
  max-width: 132px;
  height: 34px;
  object-fit: contain;
  outline: 0;
}

.brand-mark {
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  transform: rotate(45deg);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 3px 10px;
  border-radius: 999px;
  background: var(--grad);
  box-shadow: 0 0 18px rgba(124, 58, 237, 0.5);
}

.brand-mark::after {
  transform: rotate(90deg);
}

.brand-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-left: auto;
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text-muted);
  font-size: 0.92rem;
  transition-property: color, background-color;
  transition-duration: 180ms;
  transition-timing-function: ease-out;
}

.site-nav a::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 5px;
  left: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease-out;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

.site-nav a:hover::after,
.site-nav a.active::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}

.icon-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-border);
  transition-property: color, background-color, box-shadow, scale;
  transition-duration: 180ms;
  transition-timing-function: ease-out;
}

.icon-button:hover {
  color: var(--accent-2);
  background: var(--surface-hover);
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.48);
}

.icon-button:active,
.btn:active,
.btn-ghost:active,
.submit-comment:active {
  scale: 0.96;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .theme-icon {
  display: grid;
  place-items: center;
  transition-property: opacity, scale, filter;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.theme-toggle .icon-sun {
  position: absolute;
  opacity: 0;
  scale: 0.25;
  filter: blur(4px);
}

html[data-theme="light"] .theme-toggle .icon-moon {
  opacity: 0;
  scale: 0.25;
  filter: blur(4px);
}

html[data-theme="light"] .theme-toggle .icon-sun {
  opacity: 1;
  scale: 1;
  filter: blur(0);
}

.menu-toggle {
  display: none;
}

.menu-toggle span {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition-property: top, opacity, transform;
  transition-duration: 220ms;
  transition-timing-function: ease-out;
}

.menu-toggle span:nth-child(1) { top: 14px; }
.menu-toggle span:nth-child(2) { top: 20px; }
.menu-toggle span:nth-child(3) { top: 26px; }
body.nav-open .menu-toggle span:nth-child(1) { top: 20px; transform: rotate(45deg); }
body.nav-open .menu-toggle span:nth-child(2) { opacity: 0; transform: scaleX(0.25); }
body.nav-open .menu-toggle span:nth-child(3) { top: 20px; transform: rotate(-45deg); }

.search-panel {
  position: absolute;
  z-index: 98;
  top: 100%;
  left: 0;
  width: 100%;
  padding-block: 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-strong);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(-10px);
  transition-property: opacity, transform;
  transition-duration: 180ms;
  transition-timing-function: ease-out;
}

.search-panel.is-open {
  opacity: 1;
  transform: translateY(0);
}

.search-form {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.search-form svg {
  width: 20px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.search-form input {
  width: 100%;
  height: 46px;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  outline: 0;
  background: transparent;
}

.search-form input:focus {
  border-bottom-color: var(--accent-2);
}

.search-form button {
  min-width: 72px;
  min-height: 44px;
  padding-inline: 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--grad);
  transition: scale 150ms ease-out;
}

.reveal {
  opacity: 1;
  transform: none;
}

html.js .reveal {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(18px);
  transition-property: opacity, filter, transform;
  transition-duration: 520ms;
  transition-delay: var(--d, 0s);
  transition-timing-function: ease-out;
}

html.js .reveal.visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.btn,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 700;
  transition-property: color, background-color, background-position, box-shadow, transform, scale;
  transition-duration: 180ms;
  transition-timing-function: ease-out;
}

.btn {
  color: #fff;
  background: var(--grad);
  background-size: 180% 100%;
  box-shadow: 0 7px 22px rgba(124, 58, 237, 0.28);
}

.btn:hover {
  background-position: 100% 50%;
  box-shadow: 0 9px 28px rgba(6, 182, 212, 0.28);
  transform: translateY(-2px);
}

.btn-ghost {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-border);
}

.btn-ghost:hover {
  color: var(--accent-2);
  background: var(--surface-hover);
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.5);
  transform: translateY(-2px);
}

.section-kicker,
.page-kicker {
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
}

.stats {
  display: grid;
  max-width: 650px;
  margin: 0 auto;
  padding: 26px 32px;
  grid-template-columns: repeat(3, 1fr);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat + .stat::before {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 0;
  width: 1px;
  background: var(--border);
}

.stat .num {
  color: var(--text);
  background: var(--grad);
  font-family: var(--font-mono);
  font-size: 2.35rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat .label {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.posts-section {
  padding: 74px 0 82px;
}

.section-heading {
  display: flex;
  margin-bottom: 24px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-title {
  margin-top: 5px;
  font-size: 1.7rem;
  font-weight: 780;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.post-card {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition-property: transform, background-color, box-shadow;
  transition-duration: 260ms;
  transition-timing-function: ease-out;
}

.post-card:hover {
  background: var(--surface-hover);
  box-shadow: var(--shadow-border), var(--shadow-card), 0 0 28px rgba(124, 58, 237, 0.18);
  transform: translateY(-6px);
}

.post-cover {
  position: relative;
  display: flex;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

.post-cover::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px);
  pointer-events: none;
}

.post-cover::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, 0.16) 49%, transparent 62%);
  pointer-events: none;
  transform: translateX(-110%);
  transition: transform 620ms ease-out;
}

.post-card:hover .post-cover::after {
  transform: translateX(110%);
}

.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 520ms ease-out;
}

.post-card:hover .post-cover img {
  transform: scale(1.045);
}

.cover-1 { background: linear-gradient(135deg, #1e1b4b, #7c3aed 55%, #06b6d4); }
.cover-2 { background: linear-gradient(135deg, #0c4a6e, #0891b2 50%, #22d3ee); }
.cover-3 { background: linear-gradient(135deg, #500724, #db2777 52%, #f472b6); }
.cover-4 { background: linear-gradient(135deg, #111827, #374151 42%, #7c3aed); }
.cover-5 { background: linear-gradient(135deg, #042f2e, #0f766e 50%, #06b6d4); }
.cover-6 { background: linear-gradient(135deg, #3f1d0b, #ea580c 48%, #f472b6); }

.cover-label {
  position: absolute;
  z-index: 3;
  max-width: calc(100% - 30px);
  overflow: hidden;
  color: rgba(255, 255, 255, 0.94);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  text-overflow: ellipsis;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.42);
  white-space: nowrap;
}

.post-cover img + .cover-label {
  display: none;
}

.post-sticky-badge {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 12px;
  display: inline-flex;
  height: 28px;
  padding-inline: 9px 10px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(rgba(7, 11, 20, 0.72), rgba(7, 11, 20, 0.72)) padding-box, var(--grad) border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  backdrop-filter: blur(10px) saturate(1.15);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  pointer-events: none;
}

.post-sticky-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #22d3ee);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.58);
}

.post-body {
  display: flex;
  min-width: 0;
  padding: 19px 20px 20px;
  flex: 1;
  flex-direction: column;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.post-meta span + span::before {
  content: "·";
  margin-right: 10px;
}

.post-body h2,
.post-body h3 {
  margin-top: 9px;
  font-size: 1.08rem;
  font-weight: 730;
}

.post-body h2 a,
.post-body h3 a {
  transition: color 180ms ease-out;
}

.post-body h2 a:hover,
.post-body h3 a:hover {
  color: var(--accent-2);
}

.post-excerpt {
  display: -webkit-box;
  margin-top: 9px;
  overflow: hidden;
  flex: 1;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.post-foot {
  display: flex;
  min-height: 40px;
  margin-top: 13px;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.post-tags {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow: hidden;
}

.post-tags a,
.article-tags a {
  display: inline-flex;
  min-height: 30px;
  padding: 3px 10px;
  align-items: center;
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 1px var(--border);
  font-size: 0.72rem;
  white-space: nowrap;
  transition-property: color, box-shadow, background-color;
  transition-duration: 180ms;
}

.post-tags a:hover,
.article-tags a:hover {
  color: var(--accent-2);
  background: var(--surface-hover);
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.5);
}

.read-more {
  flex: 0 0 auto;
}

.pager {
  display: flex;
  margin-top: 44px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pager > span,
.pager > a {
  display: inline-grid;
  min-width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  color: var(--text-muted);
  background: var(--surface);
  box-shadow: var(--shadow-border);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  transition-property: color, background-color, box-shadow, transform;
  transition-duration: 180ms;
}

.pager > span > a,
.pager > span > span {
  display: inline-grid;
  width: 100%;
  height: 100%;
  padding-inline: 11px;
  place-items: center;
  color: inherit;
  white-space: nowrap;
}

.pager > a {
  padding-inline: 11px;
  white-space: nowrap;
}

.pager > span:not(.current):has(> a):hover,
.pager > a:hover {
  color: var(--text);
  background: var(--surface-hover);
  box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.45);
  transform: translateY(-2px);
}

.pager .current {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 5px 16px rgba(124, 58, 237, 0.25);
}

@media (max-width: 560px) {
  .pager {
    margin-top: 36px;
    gap: 6px;
  }

  .pager > span,
  .pager > a {
    min-width: 34px;
    height: 36px;
    border-radius: 8px;
  }

  .pager > span > a,
  .pager > span > span,
  .pager > a {
    padding-inline: 8px;
  }
}

.page-list,
.page-archives,
.page-tags,
.page-categories,
.page-links,
.page-memos {
  min-height: calc(100vh - var(--nav-h) - 120px);
  padding-top: 36px;
  padding-bottom: 82px;
}

.page-head {
  max-width: 760px;
  margin: 0 auto 40px;
  padding: 30px 0 12px;
  text-align: center;
}

.page-head h1 {
  margin-top: 7px;
  font-size: 3rem;
  font-weight: 820;
}

.page-head > p:last-child {
  margin-top: 10px;
  color: var(--text-muted);
}

.list-grid {
  margin-top: 12px;
}

.page-archives .stats {
  max-width: 820px;
  margin-bottom: 56px;
  grid-template-columns: repeat(4, 1fr);
}

.timeline {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding-left: 44px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 12px;
  left: 7px;
  width: 2px;
  border-radius: 2px;
  background: var(--grad);
  opacity: 0.62;
}

.t-year {
  position: relative;
  margin: 34px 0 14px;
  color: var(--text);
  background: var(--grad);
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.t-year:first-child {
  margin-top: 0;
}

.t-year::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -44px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 18px rgba(124, 58, 237, 0.5);
  transform: translateY(-50%);
}

.t-item {
  position: relative;
  display: grid;
  min-height: 48px;
  padding: 9px 12px;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 14px;
  border-radius: 10px;
  transition-property: color, background-color, transform;
  transition-duration: 180ms;
  transition-timing-function: ease-out;
}

.t-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -41px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-2);
  transform: translateY(-50%);
  transition-property: background-color, box-shadow;
  transition-duration: 180ms;
}

.t-item:hover {
  color: var(--accent-2);
  background: var(--surface);
  transform: translateX(5px);
}

.t-item:hover::before {
  background: var(--accent-3);
  box-shadow: 0 0 0 5px rgba(244, 114, 182, 0.13);
}

.t-date,
.t-category {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.t-category {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-cloud {
  display: flex;
  max-width: 920px;
  min-height: 240px;
  margin: 0 auto;
  padding: 32px 0;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  justify-content: center;
  gap: 14px 18px;
}

.tag-item {
  display: inline-flex;
  min-height: 44px;
  padding: 6px 15px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-muted);
  background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--grad) border-box;
  transition-property: color, background-image, box-shadow, transform;
  transition-duration: 220ms;
  transition-timing-function: ease-out;
}

.tag-item:hover {
  color: #fff;
  background: var(--grad) border-box;
  box-shadow: 0 7px 22px rgba(124, 58, 237, 0.28);
  transform: translateY(-3px);
}

.tag-item .cnt {
  margin-left: 5px;
  font-family: var(--font-mono);
  font-size: 0.68em;
  opacity: 0.75;
}

.tg-1 { font-size: 0.88rem; }
.tg-2 { font-size: 1rem; }
.tg-3 { font-size: 1.16rem; }
.tg-4 { font-size: 1.34rem; }
.tg-5 { font-size: 1.58rem; font-weight: 740; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.category-card {
  display: grid;
  min-height: 108px;
  padding: 22px 24px;
  grid-template-columns: 50px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-border);
  transition-property: background-color, box-shadow, transform;
  transition-duration: 220ms;
  transition-timing-function: ease-out;
}

.category-card:hover {
  background: var(--surface-hover);
  box-shadow: var(--shadow-border), 0 12px 30px rgba(0, 0, 0, 0.18), 0 0 24px rgba(6, 182, 212, 0.13);
  transform: translateY(-4px);
}

.category-index {
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 1.35rem;
}

.category-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.category-info strong {
  overflow: hidden;
  font-size: 1.08rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-info small {
  color: var(--text-muted);
}

.category-arrow {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--surface);
  transition-property: color, background-color, transform;
  transition-duration: 180ms;
}

.category-card:hover .category-arrow {
  color: #fff;
  background: var(--accent-2);
  transform: translateX(3px);
}

.page-intro {
  max-width: var(--article);
  margin: -14px auto 38px;
}

.link-grid {
  display: grid;
  max-width: 920px;
  margin-inline: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.link-card {
  display: grid;
  min-width: 0;
  min-height: 94px;
  padding: 17px 18px;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-border);
  transition-property: background-color, box-shadow, transform;
  transition-duration: 220ms;
  transition-timing-function: ease-out;
}

.link-card:hover {
  background: var(--surface-hover);
  box-shadow: var(--shadow-border), 0 12px 30px rgba(0, 0, 0, 0.18), 0 0 22px rgba(6, 182, 212, 0.16);
  transform: translateY(-5px);
}

.link-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  overflow: hidden;
  flex: 0 0 54px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 750;
  transition: transform 420ms ease-out;
}

.link-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-card:hover .link-avatar {
  transform: rotate(8deg) scale(1.04);
}

.av-1 { background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); }
.av-2 { background: linear-gradient(135deg, #0891b2, #34d399); }
.av-3 { background: linear-gradient(135deg, var(--accent-3), var(--accent-1)); }
.av-4 { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.av-5 { background: linear-gradient(135deg, #f59e0b, var(--accent-3)); }
.av-6 { background: linear-gradient(135deg, #10b981, var(--accent-2)); }

.link-info {
  min-width: 0;
}

.link-info .name,
.link-info .desc {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-info .desc {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.apply-card {
  max-width: 820px;
  margin: 56px auto 0;
  padding: 30px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-border);
}

.apply-card h2 {
  margin-top: 5px;
  font-size: 1.5rem;
}

.apply-card > p:not(.section-kicker) {
  margin-top: 10px;
  color: var(--text-muted);
}

.site-info {
  display: grid;
  margin-top: 22px;
  padding: 18px 20px;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px 16px;
  border-radius: 10px;
  background: var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--border);
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.site-info span {
  color: var(--accent-2);
}

.site-info strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 500;
}

.memos-layout {
  max-width: 820px;
  margin-inline: auto;
}

.memos-toolbar {
  display: flex;
  min-height: 48px;
  margin-bottom: 28px;
  padding: 0 2px 13px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.memos-toolbar-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-soft);
  font-weight: 700;
}

.memos-live-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 5px rgba(6, 182, 212, 0.1), 0 0 14px rgba(6, 182, 212, 0.7);
}

.memos-feed {
  position: relative;
  transition: opacity 180ms ease-out;
}

.memos-feed::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 91px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent-1), var(--accent-2) 55%, rgba(244, 114, 182, 0.18));
}

.memos-feed.is-loading:not(:has(.memo-skeleton)) {
  opacity: 0.5;
}

.memo-item {
  position: relative;
  display: grid;
  padding-bottom: 28px;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 44px;
}

.memo-item:last-child {
  padding-bottom: 0;
}

.memo-item::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 19px;
  left: 87px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12);
}

.memo-date {
  display: flex;
  padding-top: 12px;
  flex-direction: column;
  align-items: flex-end;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.83rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.memo-date small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.memo-date:hover {
  color: var(--accent-2);
}

.memo-card {
  min-width: 0;
  padding: 21px 22px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: background-color 200ms ease-out, box-shadow 200ms ease-out, transform 200ms ease-out;
}

.memo-card:hover {
  background: var(--surface-hover);
  box-shadow: var(--shadow-border), 0 14px 34px rgba(0, 0, 0, 0.16), 0 0 22px rgba(6, 182, 212, 0.1);
  transform: translateY(-2px);
}

.memo-content {
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.memo-content > * + * {
  margin-top: 0.82em;
}

.memo-content a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-color: rgba(6, 182, 212, 0.35);
  text-underline-offset: 3px;
}

.memo-content ul,
.memo-content ol {
  padding-left: 1.35em;
}

.memo-content blockquote {
  padding-left: 14px;
  border-left: 2px solid var(--accent-2);
  color: var(--text-muted);
}

.memo-content code {
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--text);
  background: var(--bg-2);
  font-size: 0.88em;
}

.memo-content pre {
  padding: 13px 15px;
  overflow-x: auto;
  border-radius: 6px;
  background: var(--bg-2);
}

.memo-content pre code {
  padding: 0;
  background: transparent;
}

.memo-media {
  display: grid;
  margin-top: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.memo-media[data-count="1"] {
  grid-template-columns: minmax(0, 1fr);
}

.memo-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg-2);
}

.memo-media[data-count="1"] .memo-photo {
  max-width: 520px;
  aspect-ratio: 16 / 10;
}

.memo-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease-out, filter 200ms ease-out;
}

.memo-photo:hover img {
  filter: brightness(1.06);
  transform: scale(1.025);
}

.memo-media video {
  width: 100%;
  max-height: 520px;
  border-radius: 6px;
  background: #000;
  grid-column: 1 / -1;
}

.memo-media audio {
  width: 100%;
  grid-column: 1 / -1;
}

.memo-attachment {
  display: inline-flex;
  min-height: 44px;
  padding: 8px 14px;
  align-items: center;
  border-radius: 6px;
  color: var(--accent-2);
  background: var(--bg-2);
  grid-column: 1 / -1;
}

.memo-foot {
  display: flex;
  margin-top: 17px;
  padding-top: 14px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  border-top: 1px solid var(--border);
}

.memo-tags {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.memo-tag,
.memo-location {
  display: inline-flex;
  min-height: 28px;
  padding: 3px 9px;
  align-items: center;
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px var(--border);
  font-size: 0.7rem;
  line-height: 1.4;
}

.memo-tag {
  color: var(--accent-2);
}

.memo-location {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 180ms ease-out, box-shadow 180ms ease-out;
}

.memo-location:hover {
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.45);
}

.memos-pager {
  display: flex;
  margin-top: 38px;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.memos-pager[hidden] {
  display: none;
}

.memos-pager .btn-ghost {
  min-width: 96px;
  min-height: 42px;
  padding: 8px 18px;
  border-radius: 8px;
}

.memos-pager .btn-ghost:disabled {
  color: var(--text-muted);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--border);
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.memos-pager > span {
  min-width: 68px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-align: center;
}

.memos-message {
  display: flex;
  min-height: 260px;
  padding: 40px 20px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.memos-message h2 {
  font-size: 1.2rem;
}

.memos-message p {
  max-width: 460px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.memos-message .btn-ghost {
  margin-top: 20px;
  border-radius: 8px;
}

.memo-skeleton::before {
  background: var(--border-strong);
  box-shadow: none;
}

.memo-skeleton .memo-date span,
.memo-skeleton .memo-date small,
.skeleton-line {
  display: block;
  height: 11px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--border) 20%, var(--surface-hover) 48%, var(--border) 76%);
  background-size: 240% 100%;
  animation: memo-shimmer 1.5s linear infinite;
}

.memo-skeleton .memo-date span {
  width: 48px;
}

.memo-skeleton .memo-date small {
  width: 34px;
  margin-top: 8px;
}

.memo-skeleton .memo-card {
  min-height: 132px;
}

.skeleton-line {
  width: 100%;
  margin-top: 15px;
}

.skeleton-line:first-child {
  margin-top: 0;
}

.skeleton-line-short { width: 36%; }
.skeleton-line-medium { width: 68%; }

@keyframes memo-shimmer {
  to { background-position: -240% 0; }
}

.memo-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 56px 72px;
  border: 0;
  color: #fff;
  background: rgba(3, 6, 12, 0.92);
}

.memo-lightbox[open] {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 20px;
}

.memo-lightbox::backdrop {
  background: rgba(3, 6, 12, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.memo-lightbox figure {
  display: flex;
  min-width: 0;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.memo-lightbox img {
  width: auto;
  height: auto;
  max-height: calc(100vh - 110px);
  object-fit: contain;
  outline: 0;
}

.memo-lightbox figcaption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  transform: translateX(-50%);
}

.memo-lightbox-close,
.memo-lightbox-nav {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-family: var(--font-sans);
  font-size: 2rem;
  line-height: 1;
  transition: background-color 180ms ease-out, transform 180ms ease-out;
}

.memo-lightbox-close:hover,
.memo-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.05);
}

.memo-lightbox-close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 18px;
  font-size: 1.55rem;
}

.memo-lightbox-prev { grid-column: 1; }
.memo-lightbox figure { grid-column: 2; }
.memo-lightbox-next { grid-column: 3; }

.article-shell {
  width: min(100%, calc(var(--article) + 48px));
  min-height: calc(100vh - var(--nav-h) - 120px);
  padding-top: 68px;
  padding-bottom: 90px;
}

.article-shell.page-article {
  padding-top: 36px;
}

.article-head {
  margin-bottom: 42px;
  text-align: center;
}

.article-category,
.article-category a {
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.article-head h1 {
  margin-top: 0;
  font-size: 3.35rem;
  font-weight: 820;
}

.article-meta {
  display: flex;
  margin-top: 18px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.article-meta span + time::before,
.article-meta time + span::before,
.article-meta span + span::before {
  content: "·";
  margin-right: 12px;
}

.article-summary {
  position: relative;
  margin-bottom: 38px;
  padding: 20px 24px 21px 28px;
  overflow: hidden;
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  color: var(--text-soft);
  background: linear-gradient(100deg, rgba(6, 182, 212, 0.1), rgba(124, 58, 237, 0.06) 58%, transparent);
  box-shadow: inset 3px 0 0 var(--accent-2);
}

.article-summary span {
  display: block;
  margin-bottom: 7px;
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.article-summary p {
  font-size: 0.96rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
  text-wrap: pretty;
  word-break: break-word;
}

.article-content {
  color: var(--text-soft);
  font-size: 1.03rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-content > * + * {
  margin-top: 1.3em;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  color: var(--text);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.article-content h2 {
  margin-top: 2.15em;
  font-size: 1.65rem;
}

.article-content h3 {
  margin-top: 1.8em;
  font-size: 1.32rem;
}

.article-content h4 {
  margin-top: 1.6em;
  font-size: 1.1rem;
}

.article-content a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-color: rgba(6, 182, 212, 0.36);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: text-decoration-color 180ms ease-out;
}

.article-content a:hover {
  text-decoration-color: currentColor;
}

.article-content ul,
.article-content ol {
  padding-left: 1.45em;
}

.article-content li + li {
  margin-top: 0.45em;
}

.article-content blockquote {
  padding: 16px 20px;
  border-left: 3px solid var(--accent-2);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  color: var(--text-muted);
  background: var(--surface);
}

.article-content code:not(pre code) {
  padding: 0.15em 0.4em;
  border-radius: 5px;
  color: #f0abfc;
  background: rgba(124, 58, 237, 0.14);
  font-size: 0.9em;
}

html[data-theme="light"] .article-content code:not(pre code) {
  color: #7e22ce;
}

.article-content pre {
  position: relative;
  max-width: 100%;
  margin-block: 1.75em;
  padding: 54px 20px 22px;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 12px;
  color: #dbeafe;
  background:
    radial-gradient(circle at 22px 19px, #ff5f57 0 5px, transparent 5.5px),
    radial-gradient(circle at 42px 19px, #febc2e 0 5px, transparent 5.5px),
    radial-gradient(circle at 62px 19px, #28c840 0 5px, transparent 5.5px),
    linear-gradient(to bottom, transparent 37px, rgba(255, 255, 255, 0.08) 37px 38px, transparent 38px),
    linear-gradient(to bottom, #171c28 0 38px, #0b1020 38px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 36px rgba(0, 0, 0, 0.24);
  font-size: 0.88rem;
  line-height: 1.7;
  tab-size: 2;
}

.article-content pre code {
  display: block;
  min-width: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
  line-height: inherit;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.code-language {
  position: absolute;
  top: 0;
  left: 78px;
  display: flex;
  height: 38px;
  max-width: calc(100% - 174px);
  overflow: hidden;
  align-items: center;
  color: #8f9bb3;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-copy {
  position: absolute;
  z-index: 2;
  top: 4px;
  right: 8px;
  min-width: 58px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  color: #aeb8cc;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  line-height: 30px;
  transition-property: color, background-color, box-shadow, transform;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}

.code-copy::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  min-width: 58px;
  height: 40px;
  transform: translate(-50%, -50%);
}

.code-copy:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.code-copy:active {
  transform: scale(0.96);
}

.code-copy.is-success {
  color: #86efac;
}

.code-copy.is-error {
  color: #fda4af;
}

.article-content pre::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.article-content pre::-webkit-scrollbar-track,
.article-content pre::-webkit-scrollbar-corner {
  background: #0b1020;
}

.article-content pre::-webkit-scrollbar-thumb {
  border: 2px solid #0b1020;
  border-radius: 8px;
  background: #384154;
}

html[data-theme="light"] .article-content pre {
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12), 0 16px 32px rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .code-language {
  color: #a6afc0;
}

html[data-theme="light"] .code-copy {
  color: #c4ccda;
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .code-copy:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

@media (max-width: 560px) {
  .article-content pre {
    padding: 50px 16px 18px;
    border-radius: 10px;
    font-size: 0.82rem;
  }
}

.article-content img {
  height: auto;
  margin-inline: auto;
  border-radius: 8px;
}

.article-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.article-content th,
.article-content td {
  min-width: 120px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.article-content th {
  color: var(--text);
  background: var(--surface);
}

.article-content hr {
  height: 1px;
  margin-block: 2.4em;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.article-footer {
  display: flex;
  margin-top: 48px;
  padding-top: 20px;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  border-top: 1px solid var(--border);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.article-tags em {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.post-near {
  display: grid;
  margin-top: 56px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.post-near > div {
  display: flex;
  min-width: 0;
  min-height: 92px;
  padding: 16px 18px;
  flex-direction: column;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-border);
}

.post-near > div:last-child {
  text-align: right;
}

.post-near span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.post-near a {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  font-weight: 650;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  transition: color 180ms ease-out;
}

.post-near a:hover {
  color: var(--accent-2);
}

.comments {
  margin-top: 74px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.comments-heading h2 {
  margin-top: 4px;
  font-size: 1.55rem;
}

.comment-list,
.comment-children {
  list-style: none;
}

.comment-list {
  margin-top: 28px;
}

.comment-item {
  margin-top: 16px;
}

.comment-list > .comment-item + .comment-item {
  margin-top: 42px;
  padding-top: 42px;
  border-top: 1px solid var(--border);
}

.comment-entry {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.comment-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.comment-avatar {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  overflow: hidden;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--grad);
  font-size: 0.88rem;
  font-weight: 700;
}

.comment-avatar img {
  position: absolute;
  inset: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.comment-avatar-reply {
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: 50%;
}

.comment-avatar-reply:empty {
  display: none;
}

.comment-avatar-reply a {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.comment-avatar:has(.comment-avatar-reply a) {
  cursor: pointer;
  transition-property: scale, box-shadow;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}

.comment-avatar:has(.comment-avatar-reply a:hover),
.comment-avatar:has(.comment-avatar-reply a:focus-visible) {
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.28);
}

.comment-avatar:has(.comment-avatar-reply a:active) {
  scale: 0.96;
}

.comment-main {
  --comment-content-inset: 17px;
  position: relative;
  isolation: isolate;
  min-width: 0;
  margin: 10px 0 0 7px;
  padding: 15px 17px;
  width: fit-content;
  max-width: calc(100% - 7px);
  align-self: flex-start;
  border-radius: 12px;
  background-color: var(--comment-visitor-bubble);
  box-shadow: var(--shadow-border);
  transition-property: background-color, box-shadow;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}

.comment-main::before {
  content: "";
  position: absolute;
  top: -10px;
  left: calc(var(--comment-content-inset) - 7px);
  width: 14px;
  height: 11px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background-color: inherit;
  pointer-events: none;
}

.comment-main:hover {
  background-color: var(--comment-visitor-bubble-hover);
}

.comment-item.comment-by-author > .comment-entry > .comment-row {
  flex-direction: row-reverse;
}

.comment-item.comment-by-author > .comment-entry > .comment-row .comment-head {
  align-items: flex-end;
  text-align: right;
}

.comment-item.comment-by-author > .comment-entry > .comment-main {
  margin-right: 7px;
  margin-left: 0;
  align-self: flex-end;
  color: #fff;
  background-color: var(--comment-author-bubble);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 8px 24px rgba(0, 0, 0, 0.12);
}

.comment-item.comment-by-author > .comment-entry > .comment-main::before {
  right: calc(var(--comment-content-inset) - 7px);
  left: auto;
}

.comment-item.comment-by-author > .comment-entry > .comment-main:hover {
  background-color: var(--comment-author-bubble-hover);
}

.comment-item.comment-by-author > .comment-entry > .comment-main .comment-content,
.comment-item.comment-by-author > .comment-entry > .comment-main .comment-content a {
  color: #fff;
}

.comment-head {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: flex-start;
  flex-direction: column;
  gap: 1px;
}

.comment-head strong,
.comment-head strong a {
  color: var(--text);
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 0.92rem;
  -webkit-text-fill-color: transparent;
}

.comment-head time {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.comment-content {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.comment-reply-to {
  margin-right: 6px;
  color: var(--accent-2);
  font-weight: 650;
  white-space: nowrap;
}

.comment-reply-to + p {
  display: inline;
}

.comment-item.comment-by-author > .comment-entry > .comment-main .comment-reply-to {
  color: rgba(255, 255, 255, 0.78);
}

.comment-content a {
  color: var(--accent-2);
}

.comment-content img {
  height: auto;
  border-radius: 8px;
}

.cancel-comment-reply a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.cancel-comment-reply a:hover {
  color: var(--accent-2);
}

.comment-children {
  margin-left: 62px;
}

.comment-entry > .respond {
  order: 1;
  margin-left: 62px;
}

.comment-item.comment-by-author > .comment-entry > .respond {
  margin-right: 62px;
  margin-left: 0;
}

.respond {
  margin-top: 36px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-border);
}

.respond h3 {
  font-size: 1.28rem;
}

.cancel-comment-reply:empty {
  display: none;
}

.comment-form {
  margin-top: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.comment-form label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.comment-form label > span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: 0;
  background: var(--bg-2);
  transition-property: border-color, box-shadow;
  transition-duration: 180ms;
}

.comment-form input {
  height: 44px;
  padding-inline: 12px;
}

.comment-form textarea {
  min-height: 140px;
  padding: 12px;
  resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
}

.textarea-label {
  margin-top: 13px;
}

.submit-comment {
  margin-top: 16px;
  border: 0;
}

.logged-in,
.comments-closed {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.logged-in a {
  color: var(--accent-2);
}

.empty-state {
  display: flex;
  min-height: 320px;
  padding: 48px 24px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-mark {
  color: var(--accent-2);
  font-size: 2rem;
}

.empty-state h1,
.empty-state h2 {
  margin-top: 10px;
}

.empty-state p {
  max-width: 480px;
  margin-top: 8px;
  color: var(--text-muted);
}

.empty-state .btn,
.empty-state .btn-ghost {
  margin-top: 24px;
}

.error-page {
  min-height: calc(100vh - var(--nav-h) - 104px);
}

.error-code {
  color: var(--text);
  background: var(--grad);
  font-family: var(--font-mono);
  font-size: 8rem;
  line-height: 1;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sns-bar {
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.sns-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.sns-link {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--surface);
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.sns-link:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-3px);
}

.sns-link:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.sns-link svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.site-footer {
  padding: 27px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(7, 11, 20, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 0.82rem;
  text-align: center;
}

html[data-theme="light"] .site-footer {
  background: rgba(255, 255, 255, 0.58);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px 12px;
}

.footer-extra {
  width: 100%;
}

.site-footer a:hover {
  color: var(--text);
}

.back-top {
  position: fixed;
  z-index: 90;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  visibility: hidden;
  border-radius: 50%;
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: var(--shadow-border), var(--shadow-card);
  opacity: 0;
  transform: translateY(12px);
  transition-property: opacity, transform, visibility, background-color, scale;
  transition-duration: 180ms;
  transition-timing-function: ease-out;
}

.back-top.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.back-top:hover {
  color: var(--accent-2);
  background: var(--surface-hover);
  transform: translateY(-3px);
}

.back-top:active {
  scale: 0.96;
}

.back-top svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 920px) {
  .page-head h1 {
    font-size: 2.65rem;
  }

  .article-head h1 {
    font-size: 2.8rem;
  }

  .menu-toggle {
    display: grid;
  }

  .site-nav {
    position: fixed;
    z-index: 99;
    top: var(--nav-h);
    right: 0;
    left: 0;
    display: flex;
    max-height: calc(100vh - var(--nav-h));
    padding: 12px 24px 20px;
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    visibility: hidden;
    border-bottom: 1px solid var(--border);
    background: var(--surface-strong);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition-property: opacity, transform, visibility;
    transition-duration: 220ms;
    transition-timing-function: ease-out;
  }

  body.nav-open .site-nav {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .site-nav a {
    min-height: 48px;
    padding-inline: 8px;
    border-bottom: 1px solid var(--border);
  }

  .site-nav a:last-child {
    border-bottom: 0;
  }

  .site-nav a::after {
    right: auto;
    bottom: 7px;
    left: 8px;
    width: 34px;
  }

  .post-grid,
  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .container {
    padding-inline: 16px;
  }

  .brand {
    max-width: calc(100vw - 168px);
  }

  .comment-list > .comment-item + .comment-item {
    margin-top: 30px;
    padding-top: 30px;
  }

  .brand img {
    max-width: 72px;
  }

  .nav-actions {
    gap: 6px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .stat .num {
    font-size: 1.8rem;
  }

  .page-head h1,
  .article-head h1 {
    font-size: 2.2rem;
  }

  .error-code {
    font-size: 5rem;
  }

  .stats {
    padding: 21px 12px;
  }

  .page-archives .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 0;
  }

  .page-archives .stat:nth-child(3)::before {
    display: none;
  }

  .section-heading {
    align-items: center;
  }

  .post-grid,
  .link-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .posts-section {
    padding-top: 60px;
  }

  .page-list,
  .page-archives,
  .page-tags,
  .page-categories,
  .page-links,
  .page-memos {
    padding-top: 20px;
    padding-bottom: 66px;
  }

  .memos-toolbar {
    margin-bottom: 22px;
  }

  .memos-feed::before {
    left: 7px;
  }

  .memo-item {
    padding-bottom: 24px;
    padding-left: 28px;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .memo-item::before {
    top: 8px;
    left: 3px;
  }

  .memo-date {
    padding-top: 0;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
  }

  .memo-date small {
    margin-top: 0;
  }

  .memo-card {
    padding: 18px;
  }

  .memo-skeleton .memo-date {
    min-height: 18px;
  }

  .memo-skeleton .memo-date span,
  .memo-skeleton .memo-date small {
    margin-top: 0;
  }

  .memo-lightbox {
    padding: 52px 8px 46px;
  }

  .memo-lightbox[open] {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 4px;
  }

  .memo-lightbox-nav {
    width: 40px;
    height: 40px;
  }

  .page-head {
    margin-bottom: 28px;
  }

  .timeline {
    padding-left: 34px;
  }

  .timeline::before {
    left: 5px;
  }

  .t-year::before {
    left: -37px;
  }

  .t-item {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 9px;
  }

  .t-item::before {
    left: -34px;
  }

  .t-category {
    display: none;
  }

  .tg-4 { font-size: 1.18rem; }
  .tg-5 { font-size: 1.34rem; }

  .article-shell {
    padding-top: 48px;
    padding-bottom: 72px;
  }

  .article-shell.page-article {
    padding-top: 20px;
  }

  .article-head {
    margin-bottom: 32px;
  }

  .article-summary {
    margin-bottom: 30px;
    padding: 17px 18px 18px 22px;
  }

  .article-content {
    font-size: 1rem;
  }

  .article-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .post-near {
    grid-template-columns: 1fr;
  }

  .post-near > div:last-child {
    text-align: left;
  }

  .comment-avatar {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .comment-avatar img {
    width: 40px;
    height: 40px;
  }

  .comment-children,
  .comment-entry > .respond {
    margin-left: 24px;
  }

  .comment-item.comment-by-author > .comment-entry > .respond {
    margin-right: 24px;
    margin-left: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .respond {
    padding: 19px;
  }

  .apply-card {
    padding: 23px 20px;
  }

  .site-info {
    grid-template-columns: 1fr;
  }

  .site-info strong + span {
    margin-top: 5px;
  }

  .back-top {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 420px) {
  .brand-name {
    max-width: 105px;
  }

  .post-tags a:nth-child(n + 2) {
    display: none;
  }

  .comment-row {
    gap: 9px;
  }

  .comment-main {
    --comment-content-inset: 13px;
    padding: 13px;
  }

  .memos-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .memo-card {
    padding: 16px;
  }

  .memos-pager {
    gap: 8px;
  }

  .memos-pager .btn-ghost {
    min-width: 80px;
    padding-inline: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html.js .reveal {
    opacity: 1;
    filter: none;
    transform: none;
  }
}
