/* =========================================================
   苔迹 MossLog — Stylesheet
   深绿玻璃拟态设计系统
   ========================================================= */

:root {
  /* -- 调色板 Palette --------------------------------------- */
  --void: #0b120e;            /* 夜苔 Night Moss   — 最深背景 */
  --deep: #10241a;            /* 林荫 Forest Shade — 面板背景 */
  --mid: #16311f;             /* 中间过渡色 */
  --accent: #5fae7e;          /* 苔痕 Moss Trace   — 主交互色 */
  --accent-strong: #457f5c;   /* 深一层的绿，用于渐变/hover */
  --accent-soft: rgba(95, 174, 126, 0.16);
  --amber: #dba463;           /* 琥珀光 Amber Light — 强调/高亮色 */
  --amber-soft: rgba(219, 164, 99, 0.16);
  --danger: #e08a7d;
  --danger-soft: rgba(224, 138, 125, 0.15);

  --text-primary: #eef3ee;    /* 白霜 Frost White */
  --text-secondary: #a8bdae;  /* 苔灰 Moss Grey */
  --text-muted: #74897c;

  --glass-bg: rgba(180, 205, 190, 0.055);
  --glass-bg-strong: rgba(180, 205, 190, 0.10);
  --glass-border: rgba(200, 220, 205, 0.13);
  --glass-blur: 18px;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-soft: 0 10px 34px rgba(0, 0, 0, 0.38);
  --shadow-pop: 0 14px 40px rgba(0, 0, 0, 0.45);

  --font-display: 'Fraunces', 'Noto Serif SC', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;

  --nav-h: 84px;
}

/* -- Reset -------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  line-height: 1.5;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font-family: inherit; color: inherit; }
input, textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color .2s, background .2s;
  width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, textarea:focus { border-color: var(--accent); background: rgba(255,255,255,0.06); }
textarea { resize: vertical; min-height: 260px; line-height: 1.7; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.word-wrap { word-wrap: break-word; overflow-wrap: break-word; }

/* -- Accessibility floor ------------------------------------ */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -- Background veil (no generic blobs — quiet gradient) ---- */
.bg-veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 12%, rgba(95,174,126,0.10), transparent 42%),
    radial-gradient(circle at 88% 78%, rgba(219,164,99,0.06), transparent 45%),
    linear-gradient(160deg, var(--void), var(--deep) 55%, var(--void));
}

/* -- Particle field (ambient twinkle + click sparkle) --------- */
.particle-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  width: 100%;
  height: 100%;
  display: block;
}

/* -- Ring motif signature ------------------------------------ */
.ring-motif {
  position: absolute;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
  animation: ringSpin 150s linear infinite;
}
@keyframes ringSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* -- Scrollbar ------------------------------------------------ */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(95,174,126,0.28); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(95,174,126,0.45); }

/* -- Loading overlay ------------------------------------------ */
.loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--void);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .35s ease;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -- Glass utility --------------------------------------------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

/* -- Page transition -------------------------------------------- */
.page { animation: fadeInUp .45s ease; padding: 0 24px 64px; max-width: 1200px; margin: 0 auto; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* -- Eyebrow label ------------------------------------------------ */
.eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.76rem;
  color: var(--amber);
  margin-bottom: 10px;
}

/* =========================================================
   Navbar
   ========================================================= */
.navbar { position: sticky; top: 0; z-index: 100; padding: 16px 24px 0; }
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; gap: 20px;
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); }
.logo-mark { font-size: 1.4rem; }
.logo-text { font-size: 1.2rem; font-weight: 600; color: var(--text-primary); display: flex; align-items: baseline; gap: 8px; }
.logo-sub { font-size: 0.68rem; letter-spacing: 0.08em; color: var(--text-muted); font-family: var(--font-body); font-weight: 500; text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; padding-left: 12px; }
.nav-links a {
  padding: 9px 16px; border-radius: var(--radius-pill);
  color: var(--text-secondary); font-size: 0.92rem; font-weight: 500;
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.nav-links a:hover { background: var(--glass-bg-strong); color: var(--text-primary); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  padding: 6px 16px 6px 6px; border-radius: var(--radius-pill);
  color: var(--text-primary); font-size: 0.9rem; font-weight: 500;
}
.avatar-mini {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #0b120e; flex-shrink: 0;
}
.user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 190px;
  background: rgba(16, 36, 26, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border); border-radius: 14px;
  padding: 8px; display: flex; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow-pop);
}
.user-dropdown a, .user-dropdown button {
  padding: 10px 12px; border-radius: 8px; text-align: left;
  background: none; border: none; font-size: 0.9rem; color: var(--text-primary);
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--glass-bg-strong); }

.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: none; padding: 8px; width: 40px; height: 40px;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: transform .25s, opacity .25s; }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 12px; border: 1px solid transparent;
  font-size: 0.94rem; font-weight: 600; font-family: var(--font-body);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0b1510;
  box-shadow: 0 6px 22px rgba(95,174,126,0.28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(95,174,126,0.38); }
.btn-secondary { background: var(--glass-bg-strong); color: var(--text-primary); border-color: var(--glass-border); }
.btn-secondary:hover { background: rgba(255,255,255,0.13); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(224,138,125,0.32); }
.btn-danger:hover { background: rgba(224,138,125,0.26); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.84rem; border-radius: 9px; }
.btn-xs { padding: 5px 11px; font-size: 0.78rem; border-radius: 8px; }

/* =========================================================
   Hero
   ========================================================= */
.hero { position: relative; overflow: hidden; text-align: center; padding: 72px 20px 48px; }
.ring-motif-hero { width: 560px; height: 560px; top: -160px; left: 50%; margin-left: -280px; }
.hero-title {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 600; line-height: 1.3; color: var(--text-primary);
  margin-bottom: 14px; position: relative;
}
.hero-sub { color: var(--text-secondary); font-size: 1.02rem; position: relative; }

/* =========================================================
   Home layout
   ========================================================= */
.home-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
.home-main { min-width: 0; }
.home-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--nav-h) + 20px); }

.search-bar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; margin-bottom: 16px; }
.search-bar .icon { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input { border: none; background: none; padding: 4px 0; }
.search-bar input:focus { border: none; background: none; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tag-chip {
  display: inline-flex; align-items: center; padding: 6px 15px; border-radius: var(--radius-pill);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  color: var(--text-secondary); font-size: 0.83rem; transition: all .2s;
}
.tag-chip:hover { background: var(--glass-bg-strong); color: var(--text-primary); }
.tag-chip.active { background: var(--accent); color: #0b1510; border-color: transparent; font-weight: 600; }

.post-feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.post-card {
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); }
.post-card-banner { height: 108px; }
.post-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card-title {
  font-size: 1.12rem; font-weight: 600; color: var(--text-primary); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-family: var(--font-display);
}
.post-card-excerpt {
  font-size: 0.86rem; color: var(--text-secondary); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-meta {
  display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-muted);
  margin-top: auto; padding-top: 6px; flex-wrap: wrap;
}
.post-card-meta .dot { opacity: 0.6; }
.meta-right { margin-left: auto; display: flex; gap: 10px; }

.side-card { padding: 20px; }
.side-card h3 { font-size: 0.98rem; margin-bottom: 14px; color: var(--text-primary); }
.mini-stats { display: flex; flex-direction: column; gap: 10px; }
.mini-stat { display: flex; align-items: baseline; gap: 8px; font-size: 0.88rem; color: var(--text-secondary); }
.mini-stat span { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--amber); }
.recent-comments { display: flex; flex-direction: column; gap: 13px; }
.recent-comment-item { display: block; font-size: 0.84rem; color: var(--text-secondary); line-height: 1.5; }
.recent-comment-item strong { color: var(--text-primary); }
.recent-comment-item:hover strong { color: var(--accent); }

.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 50px 20px; color: var(--text-muted);
  font-size: 0.95rem; display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.empty-state-sm { color: var(--text-muted); font-size: 0.88rem; padding: 10px 0 20px; }
.text-muted-sm { color: var(--text-muted); font-size: 0.82rem; }

/* =========================================================
   Post detail
   ========================================================= */
.post-detail-wrap { max-width: 760px; margin: 32px auto 0; display: flex; flex-direction: column; gap: 22px; }
.back-link { color: var(--text-secondary); font-size: 0.9rem; }
.back-link:hover { color: var(--accent); }
.post-detail { padding: 36px 40px 40px; }
.post-detail-banner { height: 140px; border-radius: var(--radius-sm); margin-bottom: 22px; }
.draft-badge {
  display: inline-block; background: var(--amber-soft); color: var(--amber);
  border: 1px solid rgba(219,164,99,0.3); border-radius: var(--radius-pill);
  padding: 5px 14px; font-size: 0.78rem; margin-bottom: 14px;
}
.post-detail-title { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.35; margin-bottom: 16px; word-wrap: break-word; }
.post-detail-meta { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.86rem; margin-bottom: 26px; flex-wrap: wrap; }
.post-detail-content { line-height: 1.9; font-size: 1.04rem; color: var(--text-primary); word-wrap: break-word; }
.post-detail-content p { margin-bottom: 1.2em; }
.post-detail-content h1, .post-detail-content h2, .post-detail-content h3 { margin: 1.5em 0 0.6em; color: var(--accent); }
.post-detail-content strong { color: var(--amber); }
.post-detail-content code {
  background: rgba(255,255,255,0.08); padding: 2px 7px; border-radius: 5px;
  font-family: 'SFMono-Regular', Consolas, monospace; font-size: 0.9em;
}
.post-detail-actions { display: flex; gap: 10px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--glass-border); flex-wrap: wrap; }

/* =========================================================
   Comments
   ========================================================= */
.comments-section { padding: 30px 40px 36px; }
.comments-section h3 { margin-bottom: 20px; font-size: 1.1rem; }
.comment-list { display: flex; flex-direction: column; gap: 18px; margin-bottom: 22px; }
.comment-item { display: flex; gap: 12px; align-items: flex-start; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 7px; font-size: 0.82rem; margin-bottom: 5px; }
.comment-meta strong { color: var(--text-primary); }
.comment-meta .dot { color: var(--text-muted); opacity: 0.7; }
.comment-meta span:not(strong) { color: var(--text-muted); }
.comment-text { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.65; word-wrap: break-word; }
.comment-delete {
  background: none; border: none; color: var(--text-muted); font-size: 0.85rem;
  padding: 4px 8px; border-radius: 6px; flex-shrink: 0;
}
.comment-delete:hover { color: var(--danger); background: var(--danger-soft); }
.comment-form { display: flex; flex-direction: column; gap: 12px; }
.comment-form textarea { min-height: 90px; }
.comment-form button { align-self: flex-end; }
.login-prompt { color: var(--text-muted); font-size: 0.9rem; text-align: center; padding: 14px 0; }
.login-prompt a { color: var(--accent); font-weight: 600; }

/* =========================================================
   Auth pages
   ========================================================= */
.auth-wrap { display: flex; justify-content: center; padding-top: 48px; }
.auth-card { position: relative; overflow: hidden; width: 100%; max-width: 420px; padding: 40px 36px; display: flex; flex-direction: column; }
.auth-card .ring-motif { width: 420px; height: 420px; top: 50%; left: 50%; margin-top: -210px; margin-left: -210px; }
.auth-card h2 { font-size: 1.7rem; margin-bottom: 8px; position: relative; }
.auth-sub { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 26px; position: relative; }
.auth-card label { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 7px; display: block; margin-top: 16px; position: relative; }
.auth-card label:first-of-type { margin-top: 0; }
.auth-card input { position: relative; }
.auth-card .btn { margin-top: 26px; position: relative; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 0.88rem; color: var(--text-muted); position: relative; }
.auth-switch a { color: var(--accent); font-weight: 600; }
.demo-hint {
  margin-top: 22px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid rgba(95,174,126,0.25);
  display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem;
  color: var(--text-secondary); position: relative;
}
.demo-hint strong { color: var(--accent); font-size: 0.82rem; }

/* =========================================================
   Editor
   ========================================================= */
.editor-wrap { max-width: 760px; margin: 32px auto 0; }
.editor-wrap h2 { margin-bottom: 22px; }
.editor-card { padding: 32px 36px 36px; display: flex; flex-direction: column; }
.editor-card label { font-size: 0.86rem; color: var(--text-secondary); margin: 18px 0 8px; display: block; }
.editor-card label:first-of-type { margin-top: 0; }
.editor-card .hint { color: var(--text-muted); font-size: 0.78rem; font-weight: 400; }
.editor-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; }

/* =========================================================
   My posts
   ========================================================= */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin: 32px 0 24px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { margin-top: 4px; }
.my-posts-list { display: flex; flex-direction: column; gap: 14px; }
.my-post-row { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; gap: 16px; flex-wrap: wrap; }
.my-post-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.my-post-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: var(--text-primary); }
.my-post-title:hover { color: var(--accent); }
.my-post-meta { font-size: 0.8rem; color: var(--text-muted); }
.my-post-actions { display: flex; gap: 8px; flex-shrink: 0; }
.status-badge { display: inline-block; padding: 3px 11px; border-radius: var(--radius-pill); font-size: 0.72rem; font-weight: 600; width: fit-content; }
.status-published { background: var(--accent-soft); color: var(--accent); }
.status-draft { background: var(--amber-soft); color: var(--amber); }

/* =========================================================
   Admin
   ========================================================= */
.admin-tabs { display: flex; gap: 6px; margin: 22px 0; flex-wrap: wrap; }
.admin-tab {
  padding: 10px 20px; border-radius: var(--radius-pill); background: var(--glass-bg);
  border: 1px solid var(--glass-border); color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
}
.admin-tab:hover { background: var(--glass-bg-strong); }
.admin-tab.active { background: var(--accent); color: #0b1510; border-color: transparent; font-weight: 600; }
.admin-content { padding: 26px; overflow-x: auto; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }
.stat-card {
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 22px; text-align: center;
}
.stat-num { font-family: var(--font-display); font-size: 2.1rem; font-weight: 600; color: var(--amber); }
.stat-label { font-size: 0.84rem; color: var(--text-secondary); margin-top: 6px; }

.admin-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.admin-table th {
  text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); padding: 0 14px 12px; border-bottom: 1px solid var(--glass-border); font-weight: 600;
}
.admin-table td { padding: 14px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.88rem; color: var(--text-secondary); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td:first-child { color: var(--text-primary); }
.admin-table a { color: var(--accent); }
.admin-table a:hover { text-decoration: underline; }

.role-badge, .role-admin, .role-user {
  display: inline-block; padding: 3px 11px; border-radius: var(--radius-pill); font-size: 0.74rem; font-weight: 600;
}
.role-admin { background: var(--amber-soft); color: var(--amber); }
.role-user { background: var(--glass-bg-strong); color: var(--text-secondary); }

/* =========================================================
   404
   ========================================================= */
.notfound { text-align: center; padding: 70px 30px; max-width: 460px; margin: 60px auto 0; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.notfound h2 { font-size: 1.5rem; }
.notfound p { color: var(--text-secondary); }

/* =========================================================
   Footer
   ========================================================= */
.site-footer { text-align: center; padding: 30px 20px 48px; color: var(--text-muted); font-size: 0.82rem; }

/* =========================================================
   Toast
   ========================================================= */
.toast-container { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 9998; display: flex; flex-direction: column-reverse; gap: 10px; align-items: center; }
.toast {
  background: rgba(16, 36, 26, 0.95); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius-pill);
  padding: 12px 24px; font-size: 0.88rem; color: var(--text-primary);
  box-shadow: var(--shadow-pop); opacity: 0; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: rgba(95,174,126,0.4); }
.toast-error { border-color: rgba(224,138,125,0.4); color: #f3c9c2; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
  .home-layout { grid-template-columns: 1fr; }
  .home-side { position: static; }
  .post-detail { padding: 28px 24px 30px; }
  .comments-section { padding: 24px; }
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute; top: calc(100% + 10px); left: 24px; right: 24px;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: rgba(16, 36, 26, 0.97); backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); border-radius: var(--radius-md);
    padding: 10px; max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height .3s ease, opacity .3s ease; pointer-events: none;
  }
  .nav-links.open { max-height: 320px; opacity: 1; pointer-events: auto; box-shadow: var(--shadow-pop); }
  .nav-links a { padding: 12px 16px; }
  .hamburger { display: flex; }
  .nav-actions .btn-sm { padding: 8px 14px; font-size: 0.82rem; }
  .user-name { display: none; }
  .user-chip { padding: 6px; }
  .hero { padding: 56px 16px 36px; }
  .post-detail, .comments-section { padding: 22px 18px; }
  .auth-card { padding: 32px 24px; }
  .editor-card { padding: 26px 20px 28px; }
}

@media (max-width: 520px) {
  .page { padding: 0 14px 48px; }
  .post-feed { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: stretch; }
  .my-post-row { flex-direction: column; align-items: stretch; }
  .my-post-actions { justify-content: flex-end; }
}
