/* =============================================================
   Aurora Theme — style.css
   Redesigned with Apple's official website design language
   - SF Pro / system fonts, tight letter-spacing
   - Monochrome palette, generous whitespace
   - Pill buttons, frosted-glass nav, massive centered heroes
   - Full-bleed feature sections, subtle interactions
   ============================================================= */

/* ---------- Design Tokens ---------- */
:root {
  /* Apple's signature palette */
  --apple-black: #1d1d1f;
  --apple-gray-1: #f5f5f7;
  --apple-gray-2: #e8e8ed;
  --apple-gray-3: #d2d2d7;
  --apple-gray-4: #86868b;
  --apple-gray-5: #6e6e73;
  --apple-blue: #0066cc;
  --apple-blue-hover: #0077ed;
  --apple-green: #0a8a3a;

  /* Typography */
  --font-sans: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Helvetica Neue", "PingFang SC", "Noto Sans SC", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: var(--font-sans);
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Layout */
  --container: 980px;
  --container-wide: 1440px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --radius-pill: 980px;
  --header-h: 48px;
  --nav-font-size: 12px;

  /* Motion */
  --ease: cubic-bezier(0.42, 0, 0.58, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.4s;
}

/* ---------- Light theme (default) ---------- */
:root,
.theme-light {
  --bg: #ffffff;
  --bg-alt: var(--apple-gray-1);
  --bg-elevated: #ffffff;
  --bg-subtle: var(--apple-gray-1);
  --bg-hover: var(--apple-gray-1);
  --surface: #ffffff;
  --surface-alt: var(--apple-gray-1);
  --text: var(--apple-black);
  --text-soft: #424245;
  --text-muted: var(--apple-gray-5);
  --text-faint: var(--apple-gray-4);
  --border: var(--apple-gray-3);
  --border-strong: #c7c7cc;
  --accent: var(--apple-black);
  --accent-hover: #000000;
  --accent-soft: var(--apple-gray-1);
  --accent-fg: #ffffff;
  --link: var(--apple-blue);
  --link-hover: var(--apple-blue-hover);
  --shadow-sm: none;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.1);
  --code-bg: var(--apple-gray-1);
  --code-border: var(--apple-gray-2);
  --hero-bg: var(--bg);
}

/* ---------- Dark theme ---------- */
.theme-dark,
body[data-theme="dark"] {
  --bg: #000000;
  --bg-alt: #0a0a0c;
  --bg-elevated: #1d1d1f;
  --bg-subtle: #1d1d1f;
  --bg-hover: #1d1d1f;
  --surface: #1d1d1f;
  --surface-alt: #161618;
  --text: #f5f5f7;
  --text-soft: #d2d2d7;
  --text-muted: #86868b;
  --text-faint: #6e6e73;
  --border: #2c2c2e;
  --border-strong: #3a3a3c;
  --accent: #f5f5f7;
  --accent-hover: #ffffff;
  --accent-soft: #1d1d1f;
  --accent-fg: #000000;
  --link: #2997ff;
  --link-hover: #47b3ff;
  --shadow-sm: none;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.7);
  --code-bg: #161618;
  --code-border: #2c2c2e;
  --hero-bg: var(--bg);
}

/* Accent color overrides (subtle; Apple uses mostly monochrome) */
body[data-accent="amber"] { --link: #a8650b; --link-hover: #c4770f; }
.theme-dark[data-accent="amber"] { --link: #f5b54a; --link-hover: #ffc56b; }
body[data-accent="emerald"] { --link: #0a8a3a; --link-hover: #0ba040; }
.theme-dark[data-accent="emerald"] { --link: #34c759; --link-hover: #4bd676; }
body[data-accent="violet"] { --link: #6c4ab6; --link-hover: #7d5acc; }
.theme-dark[data-accent="violet"] { --link: #b39cff; --link-hover: #c5b1ff; }
body[data-accent="rose"] { --link: #c8366f; --link-hover: #d8447e; }
.theme-dark[data-accent="rose"] { --link: #ff6b9d; --link-hover: #ff85b0; }

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.47;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* Global color transition on theme switch — all elements change together */
* {
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), fill 0.3s var(--ease), stroke 0.3s var(--ease);
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--link); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }

/* ---------- Layout helpers ---------- */
.main-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  flex: 1 0 auto;
  width: 100%;
}

/* ---------- Reading progress ---------- */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--text);
  z-index: 1000;
  transition: width 0.1s linear;
}

/* ============================================================
   HEADER — opaque, evenly-spaced centered 3-column nav
   All header text uses unified font-size (var(--nav-font-size)),
   weight, letter-spacing, and opacity for visual consistency.
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  /* Unified with nav: same font-size, weight, tracking */
  font-size: var(--nav-font-size);
  font-weight: 500;
  letter-spacing: -0.01em;
  justify-self: start;
  /* Prevent title from wrapping to a second line on narrow screens */
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}
.site-brand:hover { color: var(--text); text-decoration: none; }
.brand-logo { border-radius: 6px; flex-shrink: 0; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0;
  flex-shrink: 0;
}
/* Brand title is slightly larger than nav but still nowrap; truncate with ellipsis if too long */
.brand-text {
  display: inline;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-left: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nav centered in the middle column */
.site-nav { justify-self: center; }
.site-nav ul { display: flex; gap: 0; }
.site-nav a {
  display: inline-block;
  padding: 0 0.65rem;
  color: var(--text);
  font-size: var(--nav-font-size);
  font-weight: 400;
  letter-spacing: -0.01em;
  opacity: 0.85;
  transition: opacity 0.2s var(--ease);
  white-space: nowrap;
}
.site-nav a:hover { opacity: 1; text-decoration: none; }
.site-nav a.nav-active { opacity: 1; font-weight: 500; }

/* Actions right-aligned in the third column.
   Unified gap between all action items. */
.header-actions { display: flex; gap: 0.4rem; align-items: center; justify-self: end; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--text);
  opacity: 0.85;
  transition: opacity 0.2s var(--ease);
  flex-shrink: 0;
}
.icon-btn:hover { opacity: 1; background: transparent; }
.icon-btn svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
.theme-dark .theme-toggle .icon-sun,
body[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
.theme-dark .theme-toggle .icon-moon,
body[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
.menu-toggle { display: none; }

/* ---------- Login button ----------
   Same font metrics as nav links for consistency. */
.login-btn {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--bg);
  font-size: var(--nav-font-size);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.login-btn:hover { opacity: 0.85; transform: translateY(-1px); text-decoration: none; color: var(--bg); }

/* ---------- Language switcher — inline 简/EN/ID ----------
   Unified font-size/weight with nav; no extra margin so spacing is even. */
.lang {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: var(--nav-font-size);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  flex-shrink: 0;
}
.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 0.3rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: -0.01em;
  text-decoration: none;
  opacity: 0.7;
}
.lang a + a { border-left: 1px solid var(--border); }
.lang a:hover { color: var(--text); opacity: 1; text-decoration: none; }
.lang a.active { color: var(--text); opacity: 1; font-weight: 600; }

/* Mobile nav */
.mobile-nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1.5rem 1.5rem;
}
.mobile-nav ul { display: flex; flex-direction: column; }
.mobile-nav a {
  display: block;
  padding: 0.85rem 0;
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover { color: var(--link); text-decoration: none; }
.mobile-nav-login { margin-top: 0.5rem; }
.mobile-nav-login .login-link {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--bg);
  font-size: 1rem;
  font-weight: 500;
  border-bottom: none;
}
.mobile-nav-login .login-link:hover { opacity: 0.85; color: var(--bg); text-decoration: none; }

/* Search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: center;
  padding-top: 14vh;
}
.search-overlay[hidden] { display: none; }
.search-box {
  width: 100%;
  max-width: 680px;
  height: fit-content;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: 0 1.5rem;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.search-input-wrap input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 400;
  outline: none;
  letter-spacing: -0.01em;
}
.search-input-wrap kbd {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
}
.search-results { max-height: 50vh; overflow-y: auto; }
.search-results .result-item { display: block; padding: 0.85rem 1.4rem; border-bottom: 1px solid var(--border); color: var(--text-soft); }
.search-results .result-item:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.search-results .result-item strong { display: block; color: var(--text); margin-bottom: 0.15rem; font-weight: 500; }
.search-results .result-empty { padding: 2rem 1.4rem; text-align: center; color: var(--text-muted); }

/* ============================================================
   HERO — Apple-style massive centered headline
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  padding: 4.5rem 1.5rem 3rem;
  text-align: center;
  background: var(--hero-bg);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, var(--bg-alt), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 980px; margin: 0 auto; }
.hero-greeting {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0;
  margin-bottom: 0.75rem;
}
.hero-title {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 0.6rem;
  color: var(--text);
}
.hero-subtitle {
  color: var(--text-muted);
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
  max-width: 640px;
  margin: 0 auto 1.75rem;
}
.hero-actions {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}
.hero-scroll-hint {
  position: relative;
  margin-top: 3rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-faint);
  font-size: 0.8rem;
  animation: bob 2.4s var(--ease) infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(6px); opacity: 1; } }

/* ============================================================
   BUTTONS — Apple pill style
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  transition: all 0.25s var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-fg);
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--link);
  border: 1px solid var(--link);
  padding: calc(0.65rem - 1px) calc(1.4rem - 1px);
}
.btn-ghost:hover {
  background: var(--link);
  color: var(--bg);
  text-decoration: none;
}

/* Apple-style inline link with chevron */
.link-chevron {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--link);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  transition: gap 0.2s var(--ease);
}
.link-chevron:hover { gap: 0.3rem; text-decoration: none; }
.link-chevron svg { width: 0.7em; height: 0.7em; }

/* ============================================================
   SECTION HEADS — Apple centered, tight
   ============================================================ */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  gap: 1rem;
}
.section-head-center { flex-direction: column; align-items: center; text-align: center; }
.section-eyebrow {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: 0.5rem;
}
.section-title {
  font-size: clamp(1.75rem, 4.5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
.section-sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 400;
  margin-top: 0.5rem;
  letter-spacing: -0.01em;
}
.section-more {
  color: var(--link);
  font-weight: 400;
  font-size: 1rem;
  white-space: nowrap;
}

/* ============================================================
   FEATURED — Apple product grid style
   ============================================================ */
.featured-section {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.featured-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface-alt);
  min-height: 360px;
  color: var(--text);
  transition: transform 0.4s var(--ease-out);
}
.featured-card:hover { transform: scale(1.01); text-decoration: none; color: var(--text); }
.featured-cover { position: relative; flex: 1; min-height: 200px; overflow: hidden; }
.featured-cover img { width: 100%; height: 100%; object-fit: cover; }
.featured-info {
  position: relative;
  z-index: 1;
  padding: 1.75rem 1.5rem 2rem;
  text-align: center;
}
.featured-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 400;
}
.featured-title {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}
.featured-excerpt {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  display: none;
  line-height: 1.4;
}
.featured-card-lg .featured-title { font-size: 1.7rem; }
.featured-card-lg .featured-excerpt { display: block; }

/* ============================================================
   POSTS section & layout
   ============================================================ */
.posts-section { max-width: var(--container-wide); margin: 0 auto; padding: 3rem 1rem; }
.content-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}
.content-layout.sidebar-left { grid-template-columns: 280px 1fr; }
.content-layout.sidebar-left .content-main { order: 2; }
.content-layout.sidebar-left .sidebar { order: 1; }
.content-main { min-width: 0; }

/* ---------- Posts grid / cards (Apple tile style) ---------- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.posts-list { grid-template-columns: 1fr; }
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s var(--ease-out), border-color 0.25s var(--ease);
}
.post-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.post-card-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-subtle);
}
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-out); }
.post-card:hover .post-card-cover img { transform: scale(1.04); }
.post-card-cat {
  position: absolute;
  top: 0.85rem; left: 0.85rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  color: var(--apple-black);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  letter-spacing: -0.01em;
}
.theme-dark .post-card-cat,
body[data-theme="dark"] .post-card-cat {
  background: rgba(0, 0, 0, 0.6);
  color: #f5f5f7;
}
.post-card-body { padding: 1.4rem 1.5rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.post-card-meta { display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); font-size: 0.82rem; margin-bottom: 0.5rem; font-weight: 400; }
.post-card-meta .dot { opacity: 0.5; }
.post-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--text); text-decoration: none; }
.post-card-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
  flex: 1;
}
.post-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--link);
  font-size: 0.92rem;
  font-weight: 400;
}
.read-more:hover { gap: 0.3rem; text-decoration: none; }
.read-more svg { width: 0.8em; height: 0.8em; transition: transform 0.2s var(--ease); }
.post-card-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.post-card-tags a { color: var(--text-muted); font-size: 0.78rem; }
.post-card-tags a:hover { color: var(--link); text-decoration: none; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.page-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  color: var(--link);
  font-size: 0.9rem;
  font-weight: 400;
}
.page-link:hover { background: var(--bg-hover); text-decoration: none; }
.page-numbers { display: flex; gap: 0.2rem; }
.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px; height: 32px;
  padding: 0 0.5rem;
  border-radius: 50%;
  color: var(--link);
  font-size: 0.9rem;
  font-weight: 400;
}
.page-num:hover { background: var(--bg-hover); text-decoration: none; }
.page-num.current { background: var(--accent); color: var(--accent-fg); font-weight: 500; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: calc(var(--header-h) + 1.5rem); }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.35rem; }
.widget-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  color: var(--text);
  padding-left: 0;
}
.widget-title::before { display: none; }
.widget-author { text-align: left; padding: 1.5rem 1.35rem; }
.widget-author-head { display: flex; align-items: center; gap: 0.85rem; }
.widget-author-avatar { border-radius: 50%; border: 1px solid var(--border); }
.widget-author-name { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.widget-author-bio { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.2rem; }
.widget-recent li { border-bottom: 1px solid var(--border); }
.widget-recent li:last-child { border-bottom: none; }
.widget-recent a { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0; color: var(--text-soft); font-size: 0.88rem; }
.widget-recent a:hover { color: var(--link); text-decoration: none; }
.recent-title { flex: 1; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.recent-date { color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; }
.widget-categories li { border-bottom: 1px solid var(--border); }
.widget-categories li:last-child { border-bottom: none; }
.widget-categories a { display: flex; justify-content: space-between; padding: 0.55rem 0; color: var(--text-soft); font-size: 0.9rem; }
.widget-categories a:hover { color: var(--link); text-decoration: none; }
.widget-categories em { font-style: normal; color: var(--text-muted); font-size: 0.8rem; }
.widget-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag-item {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-soft);
  font-size: 0.82rem;
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}
.tag-item:hover { background: var(--text); color: var(--bg); border-color: var(--text); text-decoration: none; }

/* ============================================================
   POST SINGLE
   ============================================================ */
.post-single { max-width: 820px; margin: 0 auto; padding: 0 1.5rem; }
.post-cover { margin: 0 0 2rem; border-radius: var(--radius-lg); overflow: hidden; max-height: 480px; }
.post-cover img { width: 100%; object-fit: cover; }
.post-header { text-align: center; margin-bottom: 2.5rem; }

/* Post language switcher — links to translated versions */
.post-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1;
}
.post-lang-label {
  color: var(--text-muted);
  margin-right: 0.5rem;
  font-weight: 400;
}
.post-lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 0.25rem 0.5rem;
  color: var(--text-muted);
  font-weight: 400;
  text-decoration: none;
  opacity: 0.7;
  border-radius: 6px;
}
.post-lang-switch a + a { border-left: 1px solid var(--border); }
.post-lang-switch a:hover { color: var(--text); opacity: 1; background: var(--bg-subtle); text-decoration: none; }
.post-lang-switch a.active { color: var(--text); opacity: 1; font-weight: 600; }
.post-cats { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; justify-content: center; }
.post-cat {
  background: var(--bg-subtle);
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
}
.post-cat:hover { background: var(--text); color: var(--bg); text-decoration: none; }
.post-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.post-excerpt {
  color: var(--text-muted);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
  max-width: 600px;
  margin: 0 auto;
}
.post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.post-author { display: flex; align-items: center; gap: 0.65rem; }
.post-author img { border-radius: 50%; }
.post-author-name { font-weight: 500; color: var(--text); font-size: 0.95rem; }
.post-time { color: var(--text-muted); font-size: 0.85rem; }
.post-stat { color: var(--text-muted); font-size: 0.85rem; }

.post-body-wrap { display: grid; grid-template-columns: 1fr; gap: 0; align-items: start; }
.post-toc { display: none; }

/* Content typography — Apple Newsroom / docs style */
.post-content, .page-content {
  font-size: 1.07rem;
  line-height: 1.6;
  color: var(--text-soft);
  letter-spacing: -0.003em;
  overflow-x: auto;
  text-align: inherit; /* respect editor alignment (center/left/right) */
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}
/* Ensure child elements inherit text-align from editor (Halo uses inline styles or align attrs) */
.post-content p, .post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content div, .post-content blockquote,
.page-content p, .page-content h1, .page-content h2, .page-content h3,
.page-content h4, .page-content div, .page-content blockquote {
  text-align: inherit;
}
/* Halo editor may use .align-center / .align-right / style="text-align:center" — make sure they work */
.post-content [style*="text-align:center"],
.post-content [style*="text-align: center"],
.post-content .align-center,
.page-content [style*="text-align:center"],
.page-content [style*="text-align: center"],
.page-content .align-center { text-align: center !important; }
.post-content [style*="text-align:right"],
.post-content [style*="text-align: right"],
.post-content .align-right,
.page-content [style*="text-align:right"],
.page-content [style*="text-align: right"],
.page-content .align-right { text-align: right !important; }
.post-content img, .page-content img { display: block; margin-left: auto; margin-right: auto; }
.post-content > *:first-child { margin-top: 0; }
.post-content h1, .post-content h2, .post-content h3, .post-content h4,
.page-content h1, .page-content h2, .page-content h3, .page-content h4 {
  color: var(--text);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 2.25rem 0 1rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.post-content h1, .page-content h1 { font-size: 1.95rem; }
.post-content h2, .page-content h2 { font-size: 1.6rem; padding-bottom: 0; border-bottom: none; }
.post-content h3, .page-content h3 { font-size: 1.3rem; }
.post-content h4, .page-content h4 { font-size: 1.1rem; }
.post-content p, .page-content p { margin: 1.15rem 0; }
.post-content a, .page-content a { color: var(--link); text-decoration: none; }
.post-content a:hover, .page-content a:hover { text-decoration: underline; }
.post-content ul, .post-content ol, .page-content ul, .page-content ol { margin: 1.15rem 0; padding-left: 1.6rem; }
.post-content li, .page-content li { margin: 0.4rem 0; }
.post-content ul li::marker, .page-content ul li::marker { color: var(--text-muted); }
.post-content blockquote, .page-content blockquote {
  margin: 1.75rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
  border-left: 3px solid var(--text);
  color: var(--text-muted);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.5;
}
.post-content blockquote p, .page-content blockquote p { margin: 0.5rem 0; }
.post-content img, .page-content img { border-radius: var(--radius); margin: 1.75rem auto; }
.post-content hr, .page-content hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.post-content table, .page-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; }
.post-content th, .post-content td, .page-content th, .page-content td { border: 1px solid var(--border); padding: 0.6rem 0.9rem; text-align: left; }
.post-content th, .page-content th { background: var(--bg-subtle); font-weight: 600; }

/* Inline code */
.post-content code, .page-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 5px;
  color: var(--text);
}
.post-content pre, .page-content pre {
  position: relative;
  margin: 1.5rem 0;
  padding: 1.2rem 1.4rem;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}
.post-content pre code, .page-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

/* Post tags / copyright / share / navigator */
.post-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 2.5rem 0 0; justify-content: center; }
.post-copyright {
  margin: 2rem 0;
  padding: 1.2rem 1.4rem;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text-muted);
  border: none;
}
.post-copyright p { margin: 0.3rem 0; }
.post-copyright a { color: var(--link); }
.post-share { display: flex; align-items: center; gap: 0.75rem; color: var(--text-muted); font-size: 0.9rem; margin: 1.5rem 0; justify-content: center; }
.share-btn { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg-subtle); color: var(--text-soft); border: 1px solid var(--border); }
.share-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); text-decoration: none; }
.post-navigator {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2.5rem 0;
}
.post-navigator a {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.2rem 1.4rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: all 0.25s var(--ease);
}
.post-navigator a:hover { border-color: var(--border-strong); transform: translateY(-2px); text-decoration: none; }
.post-navigator .nav-next { text-align: right; align-items: flex-end; }
.nav-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 400; }
.nav-title { font-weight: 500; font-size: 0.98rem; color: var(--text); letter-spacing: -0.01em; }

/* Comments */
.comment-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.comment-title { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 1.5rem; text-align: center; }

/* Page single */
.page-single { max-width: 740px; margin: 0 auto; padding: 0 1.5rem; }
.page-header { text-align: center; margin-bottom: 3rem; padding-bottom: 1.5rem; }
.page-title { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 600; letter-spacing: -0.025em; }
.page-meta { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.5rem; }

/* ============================================================
   ARCHIVE
   ============================================================ */
.archive-section { max-width: 740px; margin: 0 auto; padding: 2rem 1.5rem; }
.archive-timeline { position: relative; padding-left: 1.5rem; }
.archive-timeline::before { content: ""; position: absolute; left: 4px; top: 0.5rem; bottom: 0.5rem; width: 2px; background: var(--border); }
.archive-year { margin-bottom: 2.5rem; position: relative; }
.archive-date { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 1rem; }
.archive-date span { font-size: 1.6rem; font-weight: 600; color: var(--text); letter-spacing: -0.02em; }
.archive-date em { font-style: normal; color: var(--text-muted); font-size: 1rem; }
.archive-year::before {
  content: "";
  position: absolute;
  left: -1.5rem; top: 0.7rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text);
}
.archive-list li { border-bottom: 1px solid var(--border); }
.archive-list li:last-child { border-bottom: none; }
.archive-list a { display: flex; align-items: center; gap: 1rem; padding: 0.85rem 0; color: var(--text-soft); }
.archive-list a:hover { color: var(--link); text-decoration: none; }
.archive-post-day { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted); font-weight: 500; min-width: 2rem; }
.archive-post-title { flex: 1; font-weight: 400; letter-spacing: -0.01em; }
.archive-year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; max-width: 700px; margin: 0 auto; }
.archive-year-card { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 1.5rem; background: var(--bg-subtle); border-radius: var(--radius); transition: all 0.25s var(--ease); }
.archive-year-card:hover { background: var(--text); color: var(--bg); transform: translateY(-3px); text-decoration: none; }
.archive-year-num { font-size: 1.7rem; font-weight: 600; color: var(--text); letter-spacing: -0.02em; }
.archive-year-card:hover .archive-year-num { color: var(--bg); }
.archive-year-count { color: var(--text-muted); font-size: 0.85rem; }
.archive-year-card:hover .archive-year-count { color: var(--bg); opacity: 0.7; }

/* ============================================================
   TAXONOMY / CATEGORY / TAG PAGES
   ============================================================ */
.taxonomy-section, .page-section { max-width: var(--container-wide); margin: 0 auto; padding: 2rem 1rem 2rem; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; max-width: 800px; margin: 0 auto; }
.category-card { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 1.75rem 1rem; background: var(--bg-subtle); border-radius: var(--radius); text-align: center; transition: all 0.25s var(--ease); color: var(--text); }
.category-card:hover { background: var(--text); color: var(--bg); transform: translateY(-3px); text-decoration: none; }
.category-icon { width: 48px; height: 48px; border-radius: 12px; background: transparent; color: inherit; display: flex; align-items: center; justify-content: center; }
.category-card:hover .category-icon { color: var(--bg); }
.category-name { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; }
.category-count { color: var(--text-muted); font-size: 0.85rem; }
.category-card:hover .category-count { color: var(--bg); opacity: 0.7; }
.tags-cloud { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; max-width: 700px; margin: 0 auto; }
.tag-cloud-item { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.9rem; border-radius: var(--radius-pill); background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text-soft); transition: all 0.2s var(--ease); }
.tag-cloud-item:hover { background: var(--text); color: var(--bg); border-color: var(--text); text-decoration: none; }
.tag-cloud-item em { font-style: normal; font-size: 0.75em; opacity: 0.7; }

/* ============================================================
   AUTHOR
   ============================================================ */
.author-section { max-width: var(--container-wide); margin: 0 auto; padding: 2rem 1rem 2rem; }
.author-hero { text-align: center; margin-bottom: 3rem; padding: 2rem 0; }
.author-avatar-lg { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 1rem; }
.author-name-lg { font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; }
.author-bio-lg { color: var(--text-muted); max-width: 500px; margin: 0.5rem auto 0; font-size: 1.1rem; }

/* ============================================================
   LINKS
   ============================================================ */
.link-group-title { font-size: 1.3rem; font-weight: 600; margin: 2rem 0 1rem; letter-spacing: -0.02em; }
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.link-card { display: flex; align-items: center; gap: 1rem; padding: 1.1rem; background: var(--bg-subtle); border-radius: var(--radius); transition: all 0.25s var(--ease); color: var(--text); }
.link-card:hover { background: var(--text); color: var(--bg); transform: translateY(-3px); text-decoration: none; }
.link-card img { border-radius: 50%; flex-shrink: 0; }
.link-name { font-weight: 600; color: inherit; letter-spacing: -0.01em; }
.link-desc { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.15rem; }
.link-card:hover .link-desc { color: var(--bg); opacity: 0.7; }

/* ============================================================
   FOOTER — Apple style multi-column
   ============================================================ */
.site-footer {
  margin-top: auto;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer-inner { max-width: var(--container-wide); margin: 0 auto; padding: 2.5rem 1.5rem 1.25rem; }
.footer-top { display: grid; grid-template-columns: 1.5fr 2fr; gap: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.footer-logo { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--text); }
.footer-desc { color: var(--text-muted); font-size: 0.82rem; max-width: 320px; line-height: 1.45; }
.footer-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.footer-col h4 { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text); letter-spacing: -0.01em; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--text-muted); font-size: 0.8rem; }
.footer-col a:hover { color: var(--text); text-decoration: underline; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; padding-top: 1.25rem; }
.footer-copyright, .footer-beian { color: var(--text-muted); font-size: 0.78rem; }
.footer-beian { display: flex; gap: 0.75rem; }
.footer-beian a { color: var(--text-muted); }
.footer-beian a:hover { color: var(--text); text-decoration: underline; }
.footer-powered { color: var(--text-muted); font-size: 0.78rem; }
.footer-powered a { color: var(--text-muted); }

/* ---------- Footer legal links ---------- */
.footer-legal { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; }
.footer-legal a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.footer-legal a:hover { color: var(--text); text-decoration: underline; }
.footer-legal-sep { color: var(--text-faint); }

/* ---------- Legal modals (disclaimer & privacy) ---------- */
.legal-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}
.legal-modal-content {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.legal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.legal-modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.legal-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s;
  background: none;
  border: none;
  line-height: 1;
}
.legal-modal-close:hover { background: var(--bg-subtle); color: var(--text); }
.legal-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-soft);
}
.legal-modal-body p { margin-bottom: 0.75rem; }
.legal-modal-body p strong { color: var(--text); font-weight: 600; }
.legal-modal-body p:last-child { margin-bottom: 0; }
.footer-powered a:hover { color: var(--text); text-decoration: underline; }

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed;
  right: 1.5rem; bottom: 1.5rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s var(--ease-out);
  z-index: 90;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-3px); }

/* ============================================================
   ERROR PAGE
   ============================================================ */
.error-section { display: flex; align-items: center; justify-content: center; min-height: 50vh; text-align: center; position: relative; overflow: hidden; padding: 3rem 1.5rem; }
.error-inner { position: relative; z-index: 1; }
.error-code {
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}
.error-title { font-size: 1.7rem; font-weight: 600; margin: 0.5rem 0 0.75rem; letter-spacing: -0.02em; }
.error-desc { color: var(--text-muted); margin-bottom: 2rem; font-size: 1.05rem; }
.error-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.error-deco { display: none; }

/* ============================================================
   SCROLL REVEAL (Apple-style fade-up on scroll)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar .widget { flex: 1 1 280px; }
  .post-toc { display: none !important; }
}
@media (max-width: 834px) {
  .site-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .brand-text { display: inline; }
  .login-btn { display: none; }
  .featured-grid { grid-template-columns: 1fr; }
  .featured-card-lg .featured-title { font-size: 1.45rem; }
  .featured-card-lg .featured-excerpt { display: none; }
  .posts-grid { grid-template-columns: 1fr; }
  .post-navigator { grid-template-columns: 1fr; }
  .post-navigator .nav-next { text-align: left; align-items: flex-start; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .hero { padding: 3.5rem 1.5rem 2.5rem; }
  .main-container { padding: 0 1rem 3rem; }
  .sidebar { flex-direction: column; }
  /* Mobile header: switch to 2-column grid (brand | actions) since nav is hidden.
     Brand takes available space, actions stay right-aligned. Tighter padding. */
  .header-inner {
    grid-template-columns: 1fr auto;
    padding: 0 1rem;
    gap: 0.5rem;
  }
  .site-brand { gap: 0.4rem; }
  .brand-text { font-size: 0.95rem; }
  .header-actions { gap: 0.3rem; }
}
@media (max-width: 480px) {
  .footer-links { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }
  .post-cover { border-radius: var(--radius); }
  /* On very small phones, shrink the brand title font to ensure it fits
     alongside the icon + action buttons without wrapping. */
  .brand-text { font-size: 0.88rem; }
  .brand-mark { width: 24px; height: 24px; font-size: 0.85rem; }
  .brand-logo { width: 24px; height: 24px; }
  .header-inner { padding: 0 0.75rem; }
  .header-actions { gap: 0.2rem; }
  .icon-btn { width: 30px; height: 30px; }
  .lang a { min-width: 20px; padding: 0 0.2rem; }
}


/* ============================================================
   TRANSLATE LOADING INDICATOR
   ============================================================ */
.translate-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.translate-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: translate-spin 0.8s linear infinite;
}
@keyframes translate-spin {
  to { transform: rotate(360deg); }
}
.translate-loading[hidden] { display: none; }

/* ============================================================
   SCROLLBAR & SELECTION
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::selection { background: var(--text); color: var(--bg); }

/* ============================================================
   CODE COPY BUTTON & TOAST
   ============================================================ */
.code-copy-btn {
  position: absolute;
  top: 0.6rem; right: 0.6rem;
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  opacity: 0;
  transition: all 0.2s var(--ease);
}
.post-content pre:hover .code-copy-btn,
.page-content pre:hover .code-copy-btn { opacity: 1; }
.code-copy-btn:hover { color: var(--text); border-color: var(--border-strong); }
.code-copy-btn.copied { color: var(--apple-green); border-color: var(--apple-green); }
.code-copy-btn.copied::after { content: "已复制"; position: absolute; right: 100%; margin-right: 0.5rem; font-size: 0.75rem; white-space: nowrap; color: var(--apple-green); }

.aurora-toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--text);
  color: var(--bg);
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all 0.3s var(--ease-out);
  z-index: 300;
  pointer-events: none;
}
.aurora-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   WIDE TOC layout for post on large screens
   ============================================================ */
@media (min-width: 1280px) {
  .post-single { max-width: 1000px; }
  /* Only use 2-column grid when TOC is actually visible (has content) */
  .post-body-wrap:has(.post-toc:not([style*="display: none"]):not([hidden])) { grid-template-columns: 200px 1fr; gap: 3rem; }
  /* When no TOC, keep single column full width */
  .post-body-wrap.no-toc { grid-template-columns: 1fr !important; }
  .post-toc { display: block; position: sticky; top: calc(var(--header-h) + 1.5rem); max-height: calc(100vh - var(--header-h) - 3rem); overflow-y: auto; }
  .toc-inner { font-size: 0.82rem; }
  .toc-title { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text-muted); letter-spacing: -0.01em; }
  .toc-body ol, .toc-body ul { padding-left: 0.85rem; }
  .toc-body > ol, .toc-body > ul { padding-left: 0; }
  .toc-body li { margin: 0.35rem 0; }
  .toc-body a { color: var(--text-muted); display: block; padding: 0.2rem 0; line-height: 1.4; }
  .toc-body a:hover { color: var(--link); text-decoration: none; }
  .toc-body a.toc-active { color: var(--text); font-weight: 500; }
}
