/* ===========================================
   jwjwu Blog — Apple Glass Morphism
   Palette: Cyan / Blue / Violet / Pink
   =========================================== */

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

/* ----- Tokens ----- */
:root {
  /* Layout */
  --max-width:     1120px;
  --article-width: 920px;
  --sidebar-width: 260px;

  /* Easing */
  --ease:  0.3s cubic-bezier(0.25, 0, 0.25, 1);
  --ease-spring: 0.5s cubic-bezier(0.22, 1.1, 0.36, 1);

  /* ===== Palette ===== */
  --bg:          #E8EAF0;
  --bg-rgb:      232,234,240;
  --surface:     rgba(255,255,255,0.55);
  --surface-solid: #FFFFFF;
  --text:        #1D1D1F;
  --text-soft:   #6E6E73;
  --text-fade:   #A1A1AA;

  /* Accent */
  --cyan:        #5AC8FA;
  --blue:        #007AFF;
  --blue-dark:   #0062CC;
  --pink:        #FF6B8A;
  --red:         #FF3B30;
  --indigo:      #5856D6;
  --violet:      #AF52DE;
  --brand-rgb:   0,122,255;

  /* Tone RGBs — for blobs & gradients */
  --t1: 90,200,250;
  --t2: 175,82,222;
  --t3: 255,107,138;
  --t4: 0,200,220;
  --t5: 100,140,255;
  --t6: 255,180,170;

  /* Borders */
  --hairline:    rgba(0,0,0,0.08);
  --hairline-subtle: rgba(0,0,0,0.05);

  /* Surfaces */
  --code-bg:     rgba(0,0,0,0.05);
  --tag-bg:      rgba(0,122,255,0.08);
  --glass-bg:    rgba(255,255,255,0.18);
  --glass-border: rgba(255,255,255,0.28);
  --glass-bg-hover: rgba(255,255,255,0.25);

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #5AC8FA 0%, #007AFF 50%, #AF52DE 100%);
  --gradient-cool:  linear-gradient(135deg, #5AC8FA 0%, #007AFF 100%);
  --gradient-full:  linear-gradient(135deg, #5AC8FA 0%, #007AFF 50%, #AF52DE 100%);

  /* Body background */
  --body-gradient:
    radial-gradient(ellipse 80% 50% at 75% 25%, rgba(var(--t1),0.18) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 25% 70%, rgba(var(--t2),0.13) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 60% 85%, rgba(var(--t3),0.09) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 30% 15%, rgba(var(--brand-rgb),0.10) 0%, transparent 55%),
    radial-gradient(ellipse 35% 25% at 80% 55%, rgba(var(--t1),0.07) 0%, transparent 55%),
    linear-gradient(175deg, #EFF1F6 0%, #E6E9F0 30%, #EDEEF5 60%, #E4E7EE 100%);

  /* States */
  --danger:       #DC2626;
  --danger-bg:    #FEF2F2;
  --danger-bg-hover: #FEE2E2;
  --success-bg:   #ECFDF5;
  --success-color:#059669;
  --pre-bg:       #1E1E2A;
  --pre-color:    #CDD6F4;
  --code-color:   #D9464E;
  --modal-overlay-bg: rgba(0,0,0,0.4);
  --accent-shadow:       rgba(0,122,255,0.30);
  --accent-shadow-hover:  rgba(0,122,255,0.45);
  --focus-ring:          rgba(0,122,255,0.07);

  /* Sidebar fade */
  --sidebar-fade: linear-gradient(transparent, var(--bg) 100%);
}

html { background: var(--bg); transition: background 0.5s ease; }

/* ===== RICH BACKGROUND + GRAIN ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  font-size: 16px; line-height: 1.7;
  color: var(--text);
  background: var(--body-gradient);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: color 0.4s ease;
}

body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-repeat: repeat;
  opacity: 0.7;
}

/* ===== AMBIENT BLOBS ===== */
.blob-layer { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(140px);
  animation: drift 30s ease-in-out infinite;
}
.blob-1 {
  width: 850px; height: 850px; opacity: 0.70;
  background: radial-gradient(circle, rgba(var(--t1),0.55) 0%, rgba(var(--brand-rgb),0.30) 25%, rgba(var(--t1),0.08) 50%, transparent 65%);
  top: -280px; right: -180px;
}
.blob-2 {
  width: 750px; height: 750px; opacity: 0.65;
  background: radial-gradient(circle, rgba(var(--t2),0.48) 0%, rgba(var(--t2),0.24) 25%, rgba(var(--t2),0.06) 50%, transparent 65%);
  bottom: -220px; left: -160px;
  animation-delay: -11s; animation-duration: 34s;
}
.blob-3 {
  width: 600px; height: 600px; opacity: 0.55;
  background: radial-gradient(circle, rgba(var(--t3),0.38) 0%, rgba(var(--t3),0.20) 25%, transparent 60%);
  top: 45%; left: 50%;
  animation-delay: -20s; animation-duration: 38s;
}
.blob-4 {
  width: 500px; height: 500px; opacity: 0.50;
  background: radial-gradient(circle, rgba(var(--t4),0.40) 0%, rgba(var(--t4),0.18) 25%, transparent 60%);
  top: -120px; left: 10%;
  animation-delay: -5s; animation-duration: 28s;
}
.blob-5 {
  width: 550px; height: 550px; opacity: 0.45;
  background: radial-gradient(circle, rgba(var(--t5),0.35) 0%, rgba(var(--t5),0.16) 25%, transparent 60%);
  bottom: -80px; right: 15%;
  animation-delay: -16s; animation-duration: 36s;
}
.blob-6 {
  width: 420px; height: 420px; opacity: 0.38;
  background: radial-gradient(circle, rgba(var(--t6),0.30) 0%, rgba(var(--t6),0.12) 25%, transparent 60%);
  top: 60%; left: -60px;
  animation-delay: -24s; animation-duration: 40s;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(55px, -40px) scale(1.06); }
  50%  { transform: translate(-35px, 35px) scale(0.93); }
  75%  { transform: translate(-50px, -25px) scale(1.05); }
}

::selection { background: rgba(var(--brand-rgb),0.18); color: var(--text); }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.20); }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  display: flex; align-items: center; justify-content: center;
  padding: 0.5rem 2rem 0.4rem;
  position: relative; z-index: 2;
}
.site-header, .site-footer, .tag, .btn, .pagination-btn,
.editor-field input, .editor-field textarea, .modal-box {
  transition: background 0.5s ease, border-color 0.5s ease, color 0.4s ease, box-shadow 0.5s ease;
}

.header-auth {
  position: absolute; top: 0.7rem; right: 2rem;
  font-size: 0.76rem; font-weight: 400; letter-spacing: 0.03em;
}
.header-auth a { color: var(--text-fade); text-decoration: none; transition: color var(--ease); }
.header-auth a:hover { color: var(--blue); }

.auth-badge {
  font-size: 0.7rem; color: var(--blue);
  background: rgba(var(--brand-rgb),0.08); padding: 0.1rem 0.5rem;
  border-radius: 2px; font-weight: 450;
}

.site-logo {
  display: block; width: 56px; height: 56px; cursor: pointer;
  transition: transform var(--ease-spring);
}
.site-logo:hover  { transform: scale(1.04); }
.site-logo:active { transform: scale(0.97); }
.site-logo img { width: 100%; height: 100%; object-fit: contain; }
.site-subtitle { display: none; }

/* ============================================
   LAYOUT
   ============================================ */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; position: relative; z-index: 1; }

/* ---- Loading skeleton ---- */
.loading-skeleton { padding: 2rem 0; }
.skeleton-card {
  height: 120px; margin-bottom: 1.2rem; border-radius: 12px;
  background: var(--glass-bg);
  animation: sk-pulse 1.5s ease-in-out infinite;
}
.skeleton-card:nth-child(2) { animation-delay: 0.15s; }
.skeleton-card:nth-child(3) { animation-delay: 0.3s; }
@keyframes sk-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.list-layout {
  display: flex; gap: 2.5rem; padding: 2rem 0 3rem; align-items: flex-start;
}
.list-sidebar {
  width: var(--sidebar-width); flex-shrink: 0;
  position: sticky; top: 2rem;
  overflow: visible;
}
.tag-scroll {
  overflow-y: auto;
  max-height: calc(100vh - 7rem);
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}
.tag-scroll::-webkit-scrollbar { width: 4px; }
.tag-scroll::-webkit-scrollbar-track { background: transparent; }
.tag-scroll::-webkit-scrollbar-thumb {
  background: var(--hairline);
  border-radius: 2px;
}
.tag-scroll::-webkit-scrollbar-thumb:hover { background: var(--border); }
.list-main { flex: 1; min-width: 0; }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar-title {
  font-size: 0.68rem; font-weight: 500; color: var(--text-fade);
  letter-spacing: 0.08em; text-transform: uppercase;
  flex-basis: 100%; margin-bottom: 0.35rem;
}

.list-sidebar .new-post-btn {
  display: block; text-align: center; margin-bottom: 1.5rem;
}

.tag-filter { display: flex; flex-wrap: wrap; gap: 0.2rem; align-items: flex-start; }

.tag {
  display: inline-block; padding: 0.12rem 0.5rem;
  font-size: 0.68rem; font-weight: 420; line-height: 1.5;
  color: var(--text-soft);
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(10px) saturate(1.6);
  -webkit-backdrop-filter: blur(10px) saturate(1.6);
  border: 0.5px solid rgba(255,255,255,0.25);
  border-radius: 4px; cursor: pointer; white-space: nowrap;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
}
.tag:hover {
  color: var(--blue);
  background: rgba(255,255,255,0.25);
  border-color: rgba(var(--brand-rgb),0.22);
}
.tag.active {
  color: #fff;
  background: var(--gradient-brand);
  border-color: transparent;
  font-weight: 480;
}

/* Sidebar bottom fade — sticky gradient overlay */
.sidebar-fade {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1rem;
  margin-top: -1rem;
  background: var(--sidebar-fade);
  pointer-events: none;
  flex-shrink: 0;
}

/* ============================================
   SEARCH
   ============================================ */
/* Container — sized by the trigger; field overlays via absolute */
.search-box {
  position: relative;
  margin-bottom: 1rem;
  height: 28px;
  display: flex;
  align-items: center;
}

/* Collapsed trigger — always in normal flow, fades out when expanded */
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-fade);
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: opacity var(--ease), color var(--ease);
  white-space: nowrap;
  line-height: 1;
}
.search-trigger:hover { color: var(--blue); }
.search-trigger svg {
  width: 17px; height: 17px;
  flex-shrink: 0;
}
.search-box.expanded .search-trigger {
  opacity: 0;
  pointer-events: none;
}

/* Expanded field — absolutely positioned over the trigger */
.search-field {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 0.45rem;
  opacity: 0;
  pointer-events: none;
  border: 1px solid transparent;
  border-radius: 20px;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  transition: opacity var(--ease), border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
.search-box.expanded .search-field {
  opacity: 1;
  pointer-events: auto;
  border-color: var(--glass-border);
}
.search-box.expanded .search-field:focus-within {
  border-color: rgba(var(--brand-rgb),0.32);
  box-shadow: 0 0 0 3px var(--focus-ring);
  background: rgba(255,255,255,0.32);
}

/* Icon inside expanded field */
.search-field .search-icon {
  flex-shrink: 0;
  width: 16px; height: 16px;
  color: var(--text-fade);
  margin-right: 0.35rem;
}

/* The actual input */
.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 0.25rem 0;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
}
.search-input:focus {
  outline: none;
  box-shadow: none;
}
.search-input::placeholder { color: var(--text-fade); font-size: 0.8rem; }

/* Clear button — only shown when there is text */
.search-clear {
  display: none;
  flex-shrink: 0;
  width: 20px; height: 20px;
  border: none;
  background: none;
  color: var(--text-fade);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin-left: 0.25rem;
  transition: color var(--ease);
}
.search-clear:hover { color: var(--text); }
.search-box.has-text .search-clear { display: block; }

/* ============================================
   POST GRID (Masonry)
   ============================================ */
.post-list {
  list-style: none; columns: 3; column-gap: 1.25rem;
  padding: 0;
}

/* ============================================
   POST CARD
   ============================================ */
.post-card {
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(2.0);
  -webkit-backdrop-filter: blur(28px) saturate(2.0);
  border: 0.5px solid var(--glass-border);
  border-radius: 16px; padding: 1.35rem;
  break-inside: avoid; margin-bottom: 1.25rem;
  box-shadow:
    0 4px 24px rgba(0,0,0,0.03),
    0 1px 4px rgba(0,0,0,0.02),
    inset 0 0.5px 0 rgba(255,255,255,0.55);
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease), background 0.5s ease;
}
.post-card:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255,255,255,0.40);
  box-shadow:
    0 8px 40px rgba(0,0,0,0.06),
    0 2px 8px rgba(0,0,0,0.03),
    inset 0 0.5px 0 rgba(255,255,255,0.70);
  transform: translateY(-2px);
}

.post-date {
  font-size: 0.76rem; font-weight: 450; color: var(--blue);
  letter-spacing: 0.05em; margin-bottom: 0.35rem; opacity: 0.78;
}
.post-title {
  font-size: 1.3rem; font-weight: 520; line-height: 1.4;
  letter-spacing: -0.015em; margin-bottom: 0.4rem;
}
.post-title a {
  color: var(--text); text-decoration: none;
}
.post-title a:hover {
  background-image: var(--gradient-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.post-summary {
  font-size: 0.93rem; color: var(--text-soft); line-height: 1.75;
  margin-bottom: 0.8rem;
}
.post-meta-row { margin-bottom: 0.35rem; }
.post-views { font-size: 0.73rem; color: var(--text-fade); font-weight: 400; }

.post-cover {
  width: 100%; max-height: 340px; object-fit: cover;
  margin: 0.25rem 0 0.7rem 0; border-radius: 8px; border: 0.5px solid var(--glass-border);
}

.post-tags { display: flex; gap: 0.3rem; flex-wrap: wrap; }

.post-actions { margin-top: 0.35rem; display: flex; gap: 0.8rem; }
.post-actions .action-link {
  font-size: 0.73rem; color: var(--text-fade); text-decoration: none; cursor: pointer;
  transition: color var(--ease);
}
.post-actions .action-link:hover { color: var(--blue); }
.post-actions .action-link.danger:hover { color: var(--danger); }

.user-post-badge {
  display: inline-block; font-size: 0.66rem; padding: 0.06rem 0.4rem;
  background: var(--success-bg); color: var(--success-color); border-radius: 2px;
  margin-left: 0.5rem; vertical-align: middle; font-weight: 450;
}

/* ============================================
   ARTICLE VIEW
   ============================================ */
.container.article {
  max-width: var(--article-width);
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(2.0);
  -webkit-backdrop-filter: blur(28px) saturate(2.0);
  border: 0.5px solid var(--glass-border);
  border-radius: 20px;
  padding: 2.5rem 2.8rem 2.8rem;
  box-shadow:
    0 4px 24px rgba(0,0,0,0.03),
    0 1px 4px rgba(0,0,0,0.02),
    inset 0 0.5px 0 rgba(255,255,255,0.55);
  transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

.article { padding: 2rem 0 4rem; position: relative; }

.article h1 {
  font-size: 2rem; font-weight: 520; letter-spacing: -0.025em;
  line-height: 1.35; margin-bottom: 0.6rem;
}
.article h2 {
  font-size: 1.3rem; font-weight: 500; margin: 2.5rem 0 0.8rem;
  padding-left: 0.9rem; border-left: 3px solid;
  border-image: var(--gradient-brand) 1;
  line-height: 1.4; letter-spacing: -0.012em;
}
.article h3 { font-size: 1.08rem; font-weight: 520; margin: 1.8rem 0 0.5rem; color: var(--violet); }
.article p { margin: 0.8rem 0; line-height: 1.85; font-size: 1.02rem; }
.article p:first-of-type { font-size: 1.12rem; color: var(--text-soft); line-height: 1.9; }

.article a {
  color: var(--blue); text-decoration: none;
  border-bottom: 1px solid rgba(var(--brand-rgb),0.25);
  transition: border-color var(--ease), color var(--ease); padding-bottom: 1px;
}
.article a:hover { border-bottom-color: var(--blue); color: var(--blue-dark); }

.article blockquote {
  margin: 1.4rem 0; padding: 0.7rem 1.2rem 0.7rem 1.8rem;
  border-left: 3px solid var(--violet);
  background: rgba(255,255,255,0.10);
  border-radius: 0 8px 8px 0;
  color: var(--text-soft); font-size: 0.97rem;
}
.article blockquote::before { display: none; }
.article blockquote p { margin: 0.3rem 0; }

.article ul, .article ol { margin: 0.8rem 0; padding-left: 1.5rem; }
.article li { margin: 0.35rem 0; line-height: 1.75; }
.article li::marker { color: var(--blue); }

.article code {
  font-family: "Fira Code", "Cascadia Code", Consolas, monospace;
  font-size: 0.85em; padding: 0.12em 0.35em;
  background: var(--code-bg); border-radius: 3px; color: var(--code-color);
}
.article pre {
  margin: 1.2rem 0; padding: 1.1rem 1.3rem;
  background: var(--pre-bg); color: var(--pre-color);
  border-radius: 10px; overflow-x: auto;
  font-size: 0.88rem; line-height: 1.7;
  border: 0.5px solid rgba(255,255,255,0.10);
}
.article pre code { padding: 0; background: none; color: inherit; }

.article table {
  width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: 0.93rem;
}
.article th, .article td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--hairline); text-align: left; }
.article thead th { font-weight: 520; color: var(--blue); border-bottom: 2px solid var(--blue); }
.article tbody tr:nth-child(even) { background: rgba(0,0,0,0.02); }
.article tbody tr:hover { background: rgba(0,0,0,0.04); }

.article img { max-width: 100%; border-radius: 8px; margin: 0.5rem 0; }
.article hr {
  margin: 2.5rem 0; border: none; height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline) 20%, var(--hairline) 80%, transparent);
}
.article-content { overflow-x: auto; }

.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-bottom: 1rem; color: var(--text-fade); text-decoration: none;
  font-size: 0.84rem; font-weight: 400; letter-spacing: 0.04em;
  transition: color var(--ease);
}
.back-link:hover { color: var(--blue); }

.article-meta-bar {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 0.8rem; padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--hairline);
}
.view-count { font-size: 0.84rem; color: var(--text-fade); font-weight: 400; }

.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-fade); grid-column: 1 / -1; }
/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 2rem 0 1rem;
  margin-top: 1.5rem;
  position: relative;
}
.pagination::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 120px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline) 30%, var(--hairline) 70%, transparent);
}

.pagination-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--hairline); border-radius: 50%;
  background: var(--surface-solid); color: var(--text-soft);
  font-size: 0.84rem; font-weight: 450; font-family: inherit;
  cursor: pointer; user-select: none;
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.pagination-btn:hover:not(.active):not(:disabled) {
  border-color: var(--blue); color: var(--blue);
  background: rgba(var(--brand-rgb),0.06);
  transform: translateY(-1px);
}
.pagination-btn.active {
  background: var(--gradient-brand); color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px var(--accent-shadow);
  font-weight: 500; cursor: default;
}
.pagination-btn:disabled {
  opacity: 0.2; cursor: default; pointer-events: none;
}

.pagination-ellipsis {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  font-size: 0.82rem; color: var(--text-fade); letter-spacing: 0.1em;
  user-select: none;
}

.pagination-info {
  font-size: 0.74rem; color: var(--text-fade);
  margin-left: 0.6rem;
  font-weight: 400;
}

.end-message { text-align: center; padding: 2rem 0 1rem; color: var(--text-fade); font-size: 0.78rem; letter-spacing: 0.1em; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  text-align: center; padding: 0.6rem 2rem;
  font-size: 0.8rem; color: var(--text-soft);
  font-weight: 420; letter-spacing: 0.03em;
  position: relative; z-index: 1;
}
.beian-row {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; flex-wrap: wrap; margin: 0;
}
.beian-row a {
  font-size: 0.8rem; color: var(--text-muted, var(--text-fade));
  text-decoration: none; transition: color var(--ease);
}
.beian-row a:hover { color: var(--blue); }
.gongan-beian { display: inline-flex; align-items: center; gap: 0.25rem; }
.gongan-beian img { width: 14px; height: 14px; flex-shrink: 0; }

/* ============================================
   BUTTONS
   ============================================ */
.new-post-btn {
  display: inline-block; padding: 0.4rem 1rem;
  color: var(--blue); text-decoration: none;
  font-size: 0.8rem; font-weight: 450;
  border: 1px solid var(--blue); border-radius: 0;
  letter-spacing: 0.03em;
  transition: background var(--ease), color var(--ease);
}
.new-post-btn:hover { background: var(--blue); color: #fff; }

.btn {
  padding: 0.5rem 1.2rem; border: none;
  font-size: 0.88rem; font-weight: 450; cursor: pointer;
  font-family: inherit; letter-spacing: 0.02em; border-radius: 0;
  transition: background var(--ease), opacity var(--ease);
}
.btn-primary { background: var(--gradient-brand); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: rgba(0,0,0,0.04); color: var(--text); }
.btn-secondary:hover { background: rgba(0,0,0,0.08); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg-hover); }

/* ============================================
   EDITOR
   ============================================ */
.editor { padding: 1.5rem 0 3rem; max-width: 960px; margin: 0 auto; }
.editor h2 { font-size: 1.3rem; font-weight: 500; margin-bottom: 1.5rem; }
.editor-field { margin-bottom: 1.2rem; }
.editor-field label { display: block; font-size: 0.84rem; font-weight: 500; color: var(--text-soft); margin-bottom: 0.3rem; }
.editor-field input,
.editor-field textarea {
  width: 100%; padding: 0.7rem 0.8rem;
  border: 1px solid var(--hairline); border-radius: 0;
  font-size: 0.95rem; font-family: inherit;
  color: var(--text); background: var(--surface-solid);
  transition: border-color var(--ease);
}
.editor-field input[type="text"],
.editor-field input[type="datetime-local"] { height: 46px; }
.editor-field input:focus,
.editor-field textarea:focus { outline: none; border-color: var(--blue); }
.editor-field textarea {
  min-height: 420px; resize: vertical;
  font-family: "Fira Code", "Cascadia Code", Consolas, monospace;
  font-size: 0.88rem; line-height: 1.7;
}
.editor-field .hint { font-size: 0.74rem; color: var(--text-fade); margin-top: 0.2rem; }
.editor-field input::placeholder,
.editor-field textarea::placeholder { color: var(--text-fade); font-size: 0.88rem; }
.editor-row { display: flex; gap: 1.2rem; }
.editor-row .editor-field { flex: 1; }
.editor-actions { display: flex; gap: 0.6rem; margin-top: 1.5rem; }

.preview-tabs { display: flex; gap: 0; margin-bottom: 0; border-bottom: 1px solid var(--hairline); }
.preview-tab {
  padding: 0.45rem 1rem; font-size: 0.82rem; cursor: pointer;
  color: var(--text-soft); border: none; border-bottom: 2px solid transparent;
  background: transparent; font-family: inherit; border-radius: 0;
  transition: color var(--ease), border-color var(--ease);
}
.preview-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.preview-pane {
  display: none; border: 1px solid var(--hairline); border-top: none;
  padding: 1.2rem 1.5rem; min-height: 280px; max-height: 700px;
  overflow-y: auto; background: var(--surface-solid); border-radius: 0;
}
.preview-pane.write-pane { max-height: none; overflow-y: visible; padding: 0; }
.preview-pane.write-pane textarea {
  display: block; width: 100%; min-height: 420px;
  padding: 1rem 1.2rem; border: none; margin: 0;
  font-family: "Fira Code", "Cascadia Code", Consolas, monospace;
  font-size: 0.95rem; line-height: 1.7;
  color: var(--text); background: var(--surface-solid);
  resize: vertical; outline: none; border-radius: 0;
}
.preview-pane.active { display: block; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0; background: var(--modal-overlay-bg);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-box {
  background: var(--surface-solid); border: 1px solid var(--hairline);
  border-radius: 12px; padding: 2rem 1.8rem 1.5rem; width: 90%; max-width: 380px;
}
.modal-box h3 { font-size: 1.05rem; font-weight: 500; margin-bottom: 0.3rem; }
.modal-box .modal-hint { font-size: 0.8rem; color: var(--text-fade); margin-bottom: 1rem; }
.modal-box input {
  width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--hairline);
  border-radius: 0; font-size: 0.95rem; font-family: inherit;
  color: var(--text); background: var(--bg);
}
.modal-box input:focus { outline: none; border-color: var(--blue); }
.modal-actions { display: flex; gap: 0.5rem; margin-top: 1rem; justify-content: flex-end; }
.modal-error { font-size: 0.8rem; color: var(--danger); margin-top: 0.5rem; }

/* ============================================
   FLOATING BUTTONS
   ============================================ */
.back-to-list-btn, .back-to-top-btn {
  position: fixed;
  width: 44px; height: 44px;
  background: var(--gradient-brand);
  color: #fff;
  border: none; cursor: pointer;
  font-size: 0.85rem; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  box-shadow: 0 3px 14px var(--accent-shadow);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity var(--ease), transform var(--ease), box-shadow var(--ease);
  z-index: 200;
}
.back-to-list-btn { left: 1.5rem; bottom: 1rem; }
.back-to-top-btn  { right: 1.5rem; bottom: 1rem; }
.back-to-list-btn.visible, .back-to-top-btn.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-list-btn:hover, .back-to-top-btn:hover {
  box-shadow: 0 5px 22px var(--accent-shadow-hover);
  transform: translateY(-1px);
}

/* 留言功能
.msg-widget-btn {
  position: fixed;
  width: 44px; height: 44px;
  background: var(--gradient-brand);
  color: #fff;
  border: none; cursor: pointer;
  font-size: 0.85rem; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  box-shadow: 0 3px 14px rgba(59,130,246,0.30);
  opacity: 1; transform: translateY(0); pointer-events: auto;
  transition: opacity var(--ease), transform var(--ease), box-shadow var(--ease);
  z-index: 200;
  left: 1.5rem; bottom: 1rem;
}
.msg-widget-btn:hover {
  box-shadow: 0 5px 22px rgba(59,130,246,0.45);
  transform: translateY(-1px);
}

.msg-widget-btn .msg-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; border-radius: 50%;
  background: var(--blue); color: #fff;
  font-size: 0.62rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(59,130,246,0.5);
}
*/

/* 留言面板样式
/* ============================================
   MESSAGE PANEL
   ============================================ */
.msg-panel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  z-index: 300; display: flex;
  align-items: flex-end; justify-content: flex-start; padding: 1rem;
}
.msg-panel {
  width: 100%; max-width: 400px; max-height: 70vh;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 0; display: flex; flex-direction: column; overflow: hidden;
}
.msg-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.2rem; border-bottom: 1px solid var(--hairline);
}
.msg-panel-header h3 { font-size: 0.92rem; font-weight: 500; margin: 0; }
.msg-panel-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-fade); }
.msg-panel-close:hover { color: var(--text); }
.msg-panel-body { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; }

.msg-form { margin-bottom: 1rem; }
.msg-form input, .msg-form textarea {
  width: 100%; padding: 0.5rem 0.65rem;
  border: 1px solid var(--hairline); border-radius: 0;
  font-size: 0.88rem; font-family: inherit;
  color: var(--text); background: var(--bg);
  margin-bottom: 0.5rem; transition: border-color var(--ease);
}
.msg-form input:focus, .msg-form textarea:focus { outline: none; border-color: var(--blue); }
.msg-form textarea { min-height: 80px; resize: vertical; }
.msg-form .btn { width: 100%; }
.msg-form-hint { font-size: 0.72rem; color: var(--text-fade); text-align: center; margin-top: 0.25rem; }
.msg-list { border-top: 1px solid var(--hairline); padding-top: 0.75rem; }
.msg-list-title { font-size: 0.78rem; font-weight: 500; color: var(--text-soft); margin-bottom: 0.5rem; }
.msg-item { padding: 0.55rem 0; border-bottom: 1px solid var(--hairline-subtle); }
.msg-item:last-child { border-bottom: none; }
.msg-item-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.15rem; }
.msg-item-name { font-size: 0.8rem; font-weight: 500; }
.msg-item-date { font-size: 0.7rem; color: var(--text-fade); }
.msg-item-text { font-size: 0.85rem; color: var(--text-soft); line-height: 1.5; word-break: break-word; }
.msg-item-delete { font-size: 0.68rem; color: var(--text-fade); cursor: pointer; border: none; background: none; }
.msg-item-delete:hover { color: #DC2626; }
.msg-empty { text-align: center; color: var(--text-fade); font-size: 0.82rem; padding: 1.5rem 0; }
.msg-count { font-size: 0.74rem; color: var(--text-fade); text-align: center; margin-top: 0.5rem; }
*/

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 1280px) {
  :root { --max-width: 1160px; --article-width: 960px; --sidebar-width: 280px; }
  .article h1 { font-size: 2.2rem; }
  .post-title { font-size: 1.35rem; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .list-layout { gap: 1.5rem; }
  .list-sidebar { width: 145px; }
  .post-list { columns: 2; column-gap: 1rem; }
  .tag { font-size: 0.64rem; padding: 0.1rem 0.4rem; }
}

@media (max-width: 600px) {
  .site-header { padding: 0.4rem 1rem 0.35rem; }
  .site-header::after { left: 1rem; right: 1rem; }
  .site-logo { width: 70px; height: 28px; }
  .header-auth { top: 0.5rem; right: 1rem; }
  .container { padding: 0 1rem; }

  .list-layout { flex-direction: column; gap: 0.6rem; padding: 0.8rem 0 2rem; }
  .list-sidebar {
    width: 100%; position: static;
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 0.4rem; padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--hairline);
  }
  .sidebar-title { display: none; }
  .sidebar-fade { display: none; }

  /* Row 1: search + new-post button */
  .search-box {
    margin-bottom: 0; height: auto; min-height: 30px;
    flex: 1; min-width: 0;
  }
  .search-box .search-trigger { height: 30px; }
  .search-box.expanded .search-field {
    position: relative; inset: auto;
    height: 30px; border-radius: 20px;
    background: rgba(255,255,255,0.22);
    opacity: 1; pointer-events: auto;
    width: 100%;
  }
  .search-box.expanded .search-trigger { display: none; }
  .search-box.expanded .search-field .search-icon { display: flex; }
  .list-sidebar .new-post-btn {
    margin-bottom: 0; margin-left: 0; flex-shrink: 0;
    height: 30px; display: flex; align-items: center;
  }

  /* Row 2: tags — single scrollable row */
  .tag-filter {
    flex-basis: 100%;
    flex-direction: row; gap: 0.25rem; flex-wrap: nowrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
  }
  .tag-filter::-webkit-scrollbar { display: none; }
  .tag { flex-shrink: 0; font-size: 0.65rem; padding: 0.1rem 0.4rem; }
  .search-clear { margin-right: 0; }

  .post-list { columns: 1; column-gap: 0; }
  .post-card { padding: 1rem; margin-bottom: 1rem; }
  .post-title { font-size: 1.12rem; }
  .post-summary { font-size: 0.86rem; }
  .post-cover { max-height: 200px; }

  .article h1 { font-size: 1.45rem; }
  .article h2 { font-size: 1.15rem; }
  .article pre { padding: 0.7rem; font-size: 0.8rem; }

  .editor-row { flex-direction: column; gap: 0; }
  .editor { padding: 1rem 0 2rem; }
  .pagination { gap: 0.35rem; padding: 1.25rem 0 0.75rem; }
  .pagination-btn { width: 34px; height: 34px; font-size: 0.8rem; }
  .pagination-ellipsis { width: 34px; height: 34px; font-size: 0.8rem; }
  .end-message { padding: 1.5rem 0 0.5rem; }

  /* 留言面板
  .msg-panel-overlay { align-items: flex-end; justify-content: flex-start; padding: 0.5rem; }
  .msg-panel { max-width: 100%; max-height: 60vh; }
  */

  .back-to-list-btn, .back-to-top-btn {
    width: 40px; height: 40px;
  }
  .back-to-list-btn { left: 1rem; bottom: 1rem; }
  .back-to-top-btn  { right: 1rem; bottom: 1rem; }
  /* .msg-widget-btn   { left: 1rem; bottom: 1rem; } */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ============================================
   THEME SWITCHER
   ============================================ */
.theme-switcher {
  position: absolute; top: 0.55rem; left: 2rem; z-index: 10;
}

/* Trigger button — shows current theme color */
.theme-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.75);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.2);
  cursor: pointer; padding: 0;
  transition: border-color 0.35s ease, transform 0.25s cubic-bezier(0.22,1.1,0.36,1), box-shadow 0.35s ease;
  position: relative; z-index: 2;
}
.theme-btn:hover {
  border-color: rgba(255,255,255,0.95);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.3);
  transform: scale(1.12);
}
.theme-btn:active { transform: scale(0.88); transition: transform 0.1s ease; }
.theme-btn.t-cyan  { background: linear-gradient(135deg, #5AC8FA, #007AFF); }
.theme-btn.t-dark  { background: linear-gradient(135deg, #2a2a40, #1a1a2e); }
.theme-btn.t-warm  { background: linear-gradient(135deg, #f0a030, #e07020); }
.theme-btn.t-forest{ background: linear-gradient(135deg, #30b090, #2e8b57); }
.theme-btn.t-lav   { background: linear-gradient(135deg, #a0a8e8, #7c3aed); }
.theme-btn.t-min   { background: linear-gradient(135deg, #b0b0b0, #707070); }

/* Expandable panel */
.theme-panel {
  position: absolute; top: 0; left: 0;
  display: flex; gap: 0.35rem;
  padding: 0.25rem 0.4rem 0.25rem 2.2rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  opacity: 0; pointer-events: none;
  transform: scale(0.5); transform-origin: 15px center;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.22,1.1,0.36,1);
  white-space: nowrap;
  z-index: 1;
}
.theme-panel.open {
  opacity: 1; pointer-events: auto;
  transform: scale(1);
}

/* Dots inside panel */
.theme-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid transparent;
  cursor: pointer; flex-shrink: 0;
  transition: border-color 0.35s ease, transform 0.25s cubic-bezier(0.22,1.1,0.36,1), box-shadow 0.35s ease;
}
.theme-dot:hover { transform: scale(1.2); }
.theme-dot:active { transform: scale(0.85); transition: transform 0.1s ease; }
.theme-dot.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--surface);
}
.theme-dot.t-cyan  { background: linear-gradient(135deg, #5AC8FA, #007AFF); }
.theme-dot.t-dark  { background: linear-gradient(135deg, #2a2a40, #1a1a2e); }
.theme-dot.t-warm  { background: linear-gradient(135deg, #f0a030, #e07020); }
.theme-dot.t-forest{ background: linear-gradient(135deg, #30b090, #2e8b57); }
.theme-dot.t-lav   { background: linear-gradient(135deg, #a0a8e8, #7c3aed); }
.theme-dot.t-min   { background: linear-gradient(135deg, #b0b0b0, #707070); }

/* Mobile performance: disable GPU-heavy effects */
@media (max-width: 768px) {
  .blob { display: none; }
  .post-card { backdrop-filter: none; }
  body::before { background-attachment: scroll; }
}

@media (max-width: 600px) {
  .theme-switcher { top: 0.4rem; left: 1rem; }
  .theme-btn { width: 26px; height: 26px; }
  .theme-dot { width: 15px; height: 15px; }
  .theme-panel { padding: 0.2rem 0.35rem 0.2rem 1.9rem; gap: 0.3rem; }
}

/* ============================================
   THEME: Dark Mode
   ============================================ */
[data-theme="dark"] {
  --bg: #1a1a2e; --bg-rgb: 26,26,46;
  --surface: rgba(30,30,55,0.80); --surface-solid: #1e1e32;
  --text: #e2e2ed; --text-soft: #a0a0b8; --text-fade: #6a6a82;

  --cyan: #4db8e8; --blue: #5b9fff; --blue-dark: #4588dd;
  --pink: #ff7798; --red: #ff5544; --indigo: #8888ee; --violet: #c088ee;
  --brand-rgb: 91,159,255;

  --t1: 77,184,232; --t2: 192,136,238; --t3: 255,119,152;
  --t4: 60,200,210; --t5: 120,160,255; --t6: 255,170,160;

  --hairline: rgba(255,255,255,0.08); --hairline-subtle: rgba(255,255,255,0.04);
  --code-bg: rgba(255,255,255,0.08); --tag-bg: rgba(91,159,255,0.12);
  --glass-bg: rgba(30,30,55,0.55); --glass-border: rgba(255,255,255,0.10);
  --glass-bg-hover: rgba(40,40,65,0.70);

  --gradient-brand: linear-gradient(135deg, #4db8e8 0%, #5b9fff 50%, #c088ee 100%);
  --gradient-cool: linear-gradient(135deg, #4db8e8 0%, #5b9fff 100%);
  --gradient-full: linear-gradient(135deg, #4db8e8 0%, #5b9fff 50%, #c088ee 100%);

  --body-gradient:
    radial-gradient(ellipse 80% 50% at 75% 25%, rgba(var(--t1),0.10) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 25% 70%, rgba(var(--t2),0.08) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 60% 85%, rgba(var(--t3),0.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 30% 15%, rgba(var(--brand-rgb),0.06) 0%, transparent 55%),
    radial-gradient(ellipse 35% 25% at 80% 55%, rgba(var(--t1),0.04) 0%, transparent 55%),
    linear-gradient(175deg, #1a1a2e 0%, #1e1e35 30%, #1c1c30 60%, #1a1a2e 100%);

  --danger: #ff6655; --danger-bg: #2a1515; --danger-bg-hover: #3a1f1f;
  --success-bg: #0a2820; --success-color: #4adea0;
  --pre-bg: #0d0d1a; --pre-color: #b8c8e8; --code-color: #ff7790;
  --modal-overlay-bg: rgba(0,0,0,0.65);
  --accent-shadow: rgba(91,159,255,0.25); --accent-shadow-hover: rgba(91,159,255,0.40);
  --focus-ring: rgba(91,159,255,0.10);
  --sidebar-fade: linear-gradient(transparent, #1a1a2e 100%);
}

/* ============================================
   THEME: Warm Amber
   ============================================ */
[data-theme="warm"] {
  --bg: #faf6ee; --bg-rgb: 250,246,238;
  --surface: rgba(255,252,248,0.60); --surface-solid: #fffdf8;
  --text: #2d2416; --text-soft: #6b5d4a; --text-fade: #a69880;

  --cyan: #e8a830; --blue: #e07820; --blue-dark: #c06018;
  --pink: #e87858; --red: #d94430; --indigo: #d09030; --violet: #b08050;
  --brand-rgb: 224,120,32;

  --t1: 232,168,48; --t2: 176,128,80; --t3: 232,120,88;
  --t4: 210,150,50; --t5: 220,140,60; --t6: 240,180,130;

  --hairline: rgba(0,0,0,0.07); --hairline-subtle: rgba(0,0,0,0.04);
  --code-bg: rgba(180,120,50,0.08); --tag-bg: rgba(224,120,32,0.10);
  --glass-bg: rgba(255,252,248,0.35); --glass-border: rgba(200,160,100,0.22);
  --glass-bg-hover: rgba(255,252,248,0.50);

  --gradient-brand: linear-gradient(135deg, #e8a830 0%, #e07820 50%, #b08050 100%);
  --gradient-cool: linear-gradient(135deg, #e8a830 0%, #e07820 100%);
  --gradient-full: linear-gradient(135deg, #e8a830 0%, #e07820 50%, #b08050 100%);

  --body-gradient:
    radial-gradient(ellipse 80% 50% at 75% 25%, rgba(var(--t1),0.15) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 25% 70%, rgba(var(--t2),0.10) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 60% 85%, rgba(var(--t3),0.08) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 30% 15%, rgba(var(--t5),0.09) 0%, transparent 55%),
    radial-gradient(ellipse 35% 25% at 80% 55%, rgba(var(--t1),0.06) 0%, transparent 55%),
    linear-gradient(175deg, #faf6ee 0%, #f5efe0 30%, #f8f2e8 60%, #f3ece0 100%);

  --danger: #c94030; --danger-bg: #fdf0ed; --danger-bg-hover: #fce4df;
  --success-bg: #e8f5ed; --success-color: #2d7a4a;
  --pre-bg: #2d2416; --pre-color: #f0e8d8; --code-color: #c94830;
  --modal-overlay-bg: rgba(0,0,0,0.35);
  --accent-shadow: rgba(224,120,32,0.28); --accent-shadow-hover: rgba(224,120,32,0.42);
  --focus-ring: rgba(224,120,32,0.08);
  --sidebar-fade: linear-gradient(transparent, #faf6ee 100%);
}

/* ============================================
   THEME: Forest Green
   ============================================ */
[data-theme="forest"] {
  --bg: #eef5ef; --bg-rgb: 238,245,239;
  --surface: rgba(248,255,250,0.58); --surface-solid: #f8fffa;
  --text: #1d2d20; --text-soft: #4a6048; --text-fade: #809880;

  --cyan: #30b090; --blue: #2e8b57; --blue-dark: #1e6b3e;
  --pink: #60a870; --red: #d94440; --indigo: #408860; --violet: #608848;
  --brand-rgb: 46,139,87;

  --t1: 48,176,144; --t2: 96,136,72; --t3: 96,168,112;
  --t4: 40,160,130; --t5: 70,150,100; --t6: 160,190,140;

  --hairline: rgba(0,0,0,0.07); --hairline-subtle: rgba(0,0,0,0.04);
  --code-bg: rgba(40,130,80,0.08); --tag-bg: rgba(46,139,87,0.10);
  --glass-bg: rgba(248,255,250,0.30); --glass-border: rgba(120,180,130,0.20);
  --glass-bg-hover: rgba(248,255,250,0.48);

  --gradient-brand: linear-gradient(135deg, #30b090 0%, #2e8b57 50%, #608848 100%);
  --gradient-cool: linear-gradient(135deg, #30b090 0%, #2e8b57 100%);
  --gradient-full: linear-gradient(135deg, #30b090 0%, #2e8b57 50%, #608848 100%);

  --body-gradient:
    radial-gradient(ellipse 80% 50% at 75% 25%, rgba(var(--t4),0.13) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 25% 70%, rgba(var(--t2),0.09) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 60% 85%, rgba(var(--t3),0.07) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 30% 15%, rgba(var(--t5),0.08) 0%, transparent 55%),
    radial-gradient(ellipse 35% 25% at 80% 55%, rgba(var(--t1),0.05) 0%, transparent 55%),
    linear-gradient(175deg, #eef5ef 0%, #e8f2ea 30%, #edf5ef 60%, #e5f0e8 100%);

  --danger: #c04038; --danger-bg: #fdf0ed; --danger-bg-hover: #fce4df;
  --success-bg: #d8f0e0; --success-color: #1e6b3e;
  --pre-bg: #1d2d20; --pre-color: #c8e0d0; --code-color: #c04840;
  --modal-overlay-bg: rgba(0,0,0,0.35);
  --accent-shadow: rgba(46,139,87,0.28); --accent-shadow-hover: rgba(46,139,87,0.42);
  --focus-ring: rgba(46,139,87,0.08);
  --sidebar-fade: linear-gradient(transparent, #eef5ef 100%);
}

/* ============================================
   THEME: Lavender
   ============================================ */
[data-theme="lavender"] {
  --bg: #f5f1f9; --bg-rgb: 245,241,249;
  --surface: rgba(253,251,255,0.58); --surface-solid: #fdfbff;
  --text: #261d33; --text-soft: #5a4d6e; --text-fade: #9080a8;

  --cyan: #a0a8e8; --blue: #7c3aed; --blue-dark: #5b21b6;
  --pink: #e878a0; --red: #e04450; --indigo: #8b5cf6; --violet: #a855f7;
  --brand-rgb: 124,58,237;

  --t1: 160,168,232; --t2: 168,85,247; --t3: 232,120,160;
  --t4: 180,150,230; --t5: 140,100,240; --t6: 220,170,200;

  --hairline: rgba(0,0,0,0.07); --hairline-subtle: rgba(0,0,0,0.04);
  --code-bg: rgba(120,60,220,0.06); --tag-bg: rgba(124,58,237,0.09);
  --glass-bg: rgba(253,251,255,0.32); --glass-border: rgba(180,160,210,0.22);
  --glass-bg-hover: rgba(253,251,255,0.48);

  --gradient-brand: linear-gradient(135deg, #a0a8e8 0%, #7c3aed 50%, #a855f7 100%);
  --gradient-cool: linear-gradient(135deg, #a0a8e8 0%, #7c3aed 100%);
  --gradient-full: linear-gradient(135deg, #a0a8e8 0%, #7c3aed 50%, #a855f7 100%);

  --body-gradient:
    radial-gradient(ellipse 80% 50% at 75% 25%, rgba(var(--t1),0.14) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 25% 70%, rgba(var(--t2),0.10) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 60% 85%, rgba(var(--t3),0.08) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 30% 15%, rgba(var(--t5),0.09) 0%, transparent 55%),
    radial-gradient(ellipse 35% 25% at 80% 55%, rgba(var(--t4),0.06) 0%, transparent 55%),
    linear-gradient(175deg, #f5f1f9 0%, #efe8f5 30%, #f3eff8 60%, #ede5f3 100%);

  --danger: #d04448; --danger-bg: #fdf0f0; --danger-bg-hover: #fce4e4;
  --success-bg: #e8f0eb; --success-color: #3d7058;
  --pre-bg: #261d33; --pre-color: #d8d0e8; --code-color: #d04858;
  --modal-overlay-bg: rgba(0,0,0,0.35);
  --accent-shadow: rgba(124,58,237,0.28); --accent-shadow-hover: rgba(124,58,237,0.42);
  --focus-ring: rgba(124,58,237,0.08);
  --sidebar-fade: linear-gradient(transparent, #f5f1f9 100%);
}

/* ============================================
   THEME: Minimal Grayscale
   ============================================ */
[data-theme="minimal"] {
  --bg: #f5f5f5; --bg-rgb: 245,245,245;
  --surface: rgba(250,250,250,0.62); --surface-solid: #fafafa;
  --text: #2a2a2a; --text-soft: #5a5a5a; --text-fade: #909090;

  --cyan: #909090; --blue: #555555; --blue-dark: #3a3a3a;
  --pink: #b0b0b0; --red: #c04040; --indigo: #707070; --violet: #808080;
  --brand-rgb: 85,85,85;

  --t1: 144,144,144; --t2: 128,128,128; --t3: 176,176,176;
  --t4: 130,130,130; --t5: 110,110,110; --t6: 190,190,190;

  --hairline: rgba(0,0,0,0.07); --hairline-subtle: rgba(0,0,0,0.04);
  --code-bg: rgba(0,0,0,0.04); --tag-bg: rgba(85,85,85,0.08);
  --glass-bg: rgba(250,250,250,0.30); --glass-border: rgba(180,180,180,0.20);
  --glass-bg-hover: rgba(250,250,250,0.48);

  --gradient-brand: linear-gradient(135deg, #909090 0%, #555555 50%, #808080 100%);
  --gradient-cool: linear-gradient(135deg, #909090 0%, #555555 100%);
  --gradient-full: linear-gradient(135deg, #909090 0%, #555555 50%, #808080 100%);

  --body-gradient:
    radial-gradient(ellipse 80% 50% at 75% 25%, rgba(var(--t1),0.07) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 25% 70%, rgba(var(--t2),0.05) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 60% 85%, rgba(var(--t3),0.04) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 30% 15%, rgba(var(--t5),0.04) 0%, transparent 55%),
    radial-gradient(ellipse 35% 25% at 80% 55%, rgba(var(--t4),0.03) 0%, transparent 55%),
    linear-gradient(175deg, #f5f5f5 0%, #f0f0f0 30%, #f3f3f3 60%, #eeeeee 100%);

  --danger: #b84040; --danger-bg: #faf0f0; --danger-bg-hover: #f5e0e0;
  --success-bg: #e8f0e8; --success-color: #4a7050;
  --pre-bg: #2a2a2a; --pre-color: #d0d0d0; --code-color: #b04040;
  --modal-overlay-bg: rgba(0,0,0,0.35);
  --accent-shadow: rgba(85,85,85,0.25); --accent-shadow-hover: rgba(85,85,85,0.38);
  --focus-ring: rgba(85,85,85,0.07);
  --sidebar-fade: linear-gradient(transparent, #f5f5f5 100%);
}
