/* ============================================
   潇湘叙事驿 · 山间书房设计系统
   ============================================ */

/* --- 引入字体 --- */
@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* --- 设计令牌 --- */
:root {
  --c-bg: #f7f5f0;
  --c-bg-warm: #faf8f3;
  --c-surface: rgba(255, 255, 255, 0.72);
  --c-surface-solid: #ffffff;
  --c-text: #2c2c2c;
  --c-text-muted: #7a7a7a;
  --c-text-light: #a0a0a0;
  --c-sage: #7d9e7e;
  --c-sage-light: #a8c5a0;
  --c-sage-pale: #e8f0e4;
  --c-rose: #d4a0a0;
  --c-rose-pale: #f5e6e6;
  --c-gold: #c9a96e;
  --c-gold-pale: #f5edd6;
  --c-forest: #2d4a3e;
  --c-forest-light: #3d6454;
  --c-border: rgba(0, 0, 0, 0.06);
  --c-shadow: rgba(45, 74, 62, 0.08);
  --c-shadow-hover: rgba(45, 74, 62, 0.16);
  --c-glass: rgba(255, 255, 255, 0.55);
  --c-glass-border: rgba(255, 255, 255, 0.35);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --shadow-sm: 0 2px 8px var(--c-shadow);
  --shadow-md: 0 6px 24px var(--c-shadow);
  --shadow-lg: 0 16px 48px var(--c-shadow);
  --shadow-float: 0 20px 60px rgba(45, 74, 62, 0.12);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-display: 'Noto Serif SC', 'Songti SC', serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', sans-serif;
  --font-calligraphy: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', cursive;
  --nav-h: 64px;
}

/* --- 全局重置 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* mesh gradient 背景 — 多层光斑 + 缓慢漂浮 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 50% 40% at 12% 15%, rgba(168, 197, 160, 0.4) 0%, transparent 55%),
    radial-gradient(ellipse 45% 55% at 82% 20%, rgba(196, 168, 210, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 40% 50% at 70% 75%, rgba(212, 160, 160, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse 55% 40% at 25% 80%, rgba(180, 210, 160, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse 35% 35% at 50% 50%, rgba(201, 169, 110, 0.2) 0%, transparent 45%),
    radial-gradient(ellipse 30% 45% at 90% 60%, rgba(160, 200, 212, 0.25) 0%, transparent 50%),
    linear-gradient(165deg, #f5f2eb 0%, #eee8df 40%, #f0ebe3 70%, #f7f4ef 100%);
}

/* 漂浮光斑动画 */
body::after {
  content: '';
  position: fixed;
  width: 140vmax;
  height: 140vmax;
  top: -20vmax;
  left: -20vmax;
  z-index: -1;
  background:
    radial-gradient(circle at 30% 40%, rgba(125, 158, 126, 0.12) 0%, transparent 30%),
    radial-gradient(circle at 70% 30%, rgba(196, 168, 210, 0.1) 0%, transparent 25%),
    radial-gradient(circle at 50% 70%, rgba(212, 160, 160, 0.08) 0%, transparent 28%),
    radial-gradient(circle at 20% 75%, rgba(180, 210, 160, 0.1) 0%, transparent 22%),
    radial-gradient(circle at 80% 65%, rgba(201, 169, 110, 0.08) 0%, transparent 25%);
  animation: drift 25s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  33%  { transform: translate(3vmax, -2vmax) rotate(2deg); }
  66%  { transform: translate(-2vmax, 3vmax) rotate(-1deg); }
  100% { transform: translate(1vmax, -1vmax) rotate(1deg); }
}

a { color: var(--c-forest); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--c-sage); }

/* --- 动画 --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.reveal { animation: fadeInUp 0.65s var(--ease-out) both; }
.reveal-d1 { animation-delay: 0.08s; }
.reveal-d2 { animation-delay: 0.16s; }
.reveal-d3 { animation-delay: 0.24s; }
.reveal-d4 { animation-delay: 0.32s; }
.reveal-d5 { animation-delay: 0.40s; }
.reveal-d6 { animation-delay: 0.48s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-d1, .reveal-d2, .reveal-d3, .reveal-d4, .reveal-d5, .reveal-d6 {
    animation: none !important;
    opacity: 1;
  }
}

/* --- 导航栏 --- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 60px);
  background: rgba(247, 245, 240, 0.82);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid var(--c-border);
  transition: box-shadow 0.3s;
}
.navbar.scrolled { box-shadow: var(--shadow-md); }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-forest);
  letter-spacing: 0.02em;
}
.nav-brand i { font-size: 1.4rem; color: var(--c-sage); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-avatar-wrap {
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--c-sage-pale);
  transition: border-color 0.3s, transform 0.3s var(--ease-bounce);
  cursor: pointer;
}
.nav-avatar-wrap:hover { border-color: var(--c-sage); transform: scale(1.08); }
.nav-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }

.nav-username {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--c-text);
}

.nav-dropdown .dropdown-toggle {
  background: var(--c-sage-pale) !important;
  color: var(--c-forest) !important;
  border: none !important;
  border-radius: var(--r-xl) !important;
  padding: 6px 18px !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  transition: all 0.3s var(--ease-out) !important;
}
.nav-dropdown .dropdown-toggle:hover {
  background: var(--c-sage) !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(125, 158, 126, 0.3);
}
.nav-dropdown .dropdown-menu {
  border: none !important;
  border-radius: var(--r-md) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 8px !important;
  margin-top: 8px !important;
  background: rgba(255,255,255,0.95) !important;
  backdrop-filter: blur(16px) !important;
  animation: scaleIn 0.25s var(--ease-out) !important;
  transform-origin: top right !important;
}
.nav-dropdown .dropdown-item {
  border-radius: var(--r-sm) !important;
  padding: 8px 16px !important;
  font-size: 0.85rem !important;
  transition: all 0.2s !important;
}
.nav-dropdown .dropdown-item:hover {
  background: var(--c-sage-pale) !important;
  color: var(--c-forest) !important;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-auth a {
  padding: 7px 22px;
  border-radius: var(--r-xl);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s var(--ease-out);
}
.nav-auth .btn-register {
  color: var(--c-forest);
  border: 1.5px solid var(--c-sage-light);
}
.nav-auth .btn-register:hover {
  background: var(--c-sage-pale);
  border-color: var(--c-sage);
}
.nav-auth .btn-login {
  background: var(--c-forest);
  color: #fff;
}
.nav-auth .btn-login:hover {
  background: var(--c-forest-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(45, 74, 62, 0.3);
}

.nav-spacer { height: var(--nav-h); }

/* --- 内容区 --- */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 60px);
}

/* --- 卡片系统 --- */
.card-glass {
  background: var(--c-glass);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.card-glass:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-float);
}

.card-solid {
  background: var(--c-surface-solid);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.card-solid:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* --- 文章卡片 --- */
.article-card {
  background: var(--c-surface-solid);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  margin-bottom: 16px;
  transition: all 0.35s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.article-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--c-sage), var(--c-sage-light));
  border-radius: 0 4px 4px 0;
  opacity: 0;
  transition: opacity 0.3s;
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-sage-pale);
}
.article-card:hover::before { opacity: 1; }

.article-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.5;
}
.article-title a { color: var(--c-text); }
.article-title a:hover { color: var(--c-sage); }

.article-desc {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.78rem;
  color: var(--c-text-light);
  flex-wrap: wrap;
}
.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.article-meta i { font-size: 0.85rem; }
.article-meta a { color: var(--c-text-muted); }
.article-meta a:hover { color: var(--c-sage); }
.article-meta .meta-up i { color: var(--c-sage); }
.article-meta .meta-down i { color: var(--c-rose); }
.article-meta .meta-comment i { color: var(--c-gold); }

/* --- 侧边栏 --- */
.sidebar {
  position: sticky;
  width: 280px;
  min-width: 280px;
  top: calc(var(--nav-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 100;
  animation: slideInRight 0.6s var(--ease-out) 0.3s both;
  align-self: flex-start;
}

.sidebar-card {
  background: var(--c-glass);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.35s var(--ease-out);
}
.sidebar-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.sidebar-card h6 {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--c-forest);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--c-border);
}

.sidebar-tag {
  display: inline-block;
  padding: 4px 14px;
  margin: 3px;
  border-radius: var(--r-xl);
  font-size: 0.78rem;
  background: var(--c-sage-pale);
  color: var(--c-forest);
  transition: all 0.25s var(--ease-out);
}
.sidebar-tag:hover {
  background: var(--c-sage);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(125, 158, 126, 0.3);
}

.sidebar-date {
  display: block;
  padding: 6px 0;
  font-size: 0.82rem;
  color: var(--c-text-muted);
  border-bottom: 1px dashed var(--c-border);
  transition: color 0.2s;
}
.sidebar-date:last-child { border-bottom: none; }
.sidebar-date:hover { color: var(--c-sage); }

/* author card */
.author-card {
  text-align: center;
}
.author-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--c-sage-pale);
  margin-bottom: 12px;
  transition: transform 0.4s var(--ease-bounce);
}
.author-avatar:hover { transform: scale(1.08); }
.author-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--c-forest);
  margin-bottom: 4px;
}
.author-info {
  font-size: 0.78rem;
  color: var(--c-text-muted);
  line-height: 1.8;
}

/* --- 文章详情 --- */
.detail-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

.detail-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--c-forest);
  margin-bottom: 20px;
  line-height: 1.4;
  animation: fadeInUp 0.6s var(--ease-out) both;
}

.detail-content {
  background: var(--c-surface-solid);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 40px);
  line-height: 1.9;
  font-size: 1rem;
  color: var(--c-text);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s var(--ease-out) 0.1s both;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  margin-bottom: 24px;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  font-size: 0.85rem;
  color: var(--c-text-muted);
  flex-wrap: wrap;
  animation: fadeInUp 0.6s var(--ease-out) 0.2s both;
}
.detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: var(--r-xl);
  transition: all 0.25s var(--ease-out);
}
.detail-meta span:hover {
  background: var(--c-sage-pale);
  color: var(--c-forest);
}
.detail-meta .up-active { background: var(--c-sage-pale); color: var(--c-sage); }
.detail-meta .down-active { background: var(--c-rose-pale); color: var(--c-rose); }

/* --- 评论区 --- */
.comments-section {
  animation: fadeInUp 0.6s var(--ease-out) 0.3s both;
}

.comments-header {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-forest);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments-list {
  background: var(--c-surface-solid);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 8px 0;
  max-height: 360px;
  overflow-y: auto;
  margin-bottom: 16px;
}
.comments-list::-webkit-scrollbar { width: 4px; }
.comments-list::-webkit-scrollbar-thumb { background: var(--c-sage-light); border-radius: 4px; }

.comment-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.88rem;
  line-height: 1.6;
  transition: background 0.2s;
}
.comment-item:last-child { border-bottom: none; }
.comment-item:hover { background: var(--c-sage-pale); }

.comment-parent {
  font-size: 0.78rem;
  color: var(--c-text-light);
  margin-right: 4px;
}

.comment-author {
  font-weight: 600;
  color: var(--c-sage);
  margin-right: 4px;
}

.comment-reply {
  font-size: 0.78rem;
  color: var(--c-forest);
  cursor: pointer;
  padding: 2px 10px;
  border-radius: var(--r-xl);
  transition: all 0.2s;
  margin-left: 8px;
}
.comment-reply:hover {
  background: var(--c-sage-pale);
  color: var(--c-sage);
}

.comment-form {
  background: var(--c-surface-solid);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
  animation: fadeInUp 0.5s var(--ease-out) 0.4s both;
}
.comment-form label {
  font-weight: 500;
  color: var(--c-forest);
  margin-bottom: 8px;
  display: block;
  font-size: 0.9rem;
}
.comment-form textarea {
  width: 100%;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: var(--c-bg-warm);
}
.comment-form textarea:focus {
  outline: none;
  border-color: var(--c-sage);
  box-shadow: 0 0 0 3px rgba(125, 158, 126, 0.15);
}

/* --- 按钮系统 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 22px;
  border-radius: var(--r-xl);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  text-decoration: none;
}

.btn-primary {
  background: var(--c-forest);
  color: #fff;
}
.btn-primary:hover {
  background: var(--c-forest-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 74, 62, 0.3);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--c-forest);
  border: 1.5px solid var(--c-sage-light);
}
.btn-outline:hover {
  background: var(--c-sage-pale);
  border-color: var(--c-sage);
}

.btn-sage {
  background: var(--c-sage);
  color: #fff;
}
.btn-sage:hover {
  background: var(--c-forest-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(125, 158, 126, 0.35);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--c-text-muted);
  padding: 6px 14px;
}
.btn-ghost:hover {
  background: var(--c-sage-pale);
  color: var(--c-forest);
}

.btn-danger {
  background: var(--c-rose-pale);
  color: #c0392b;
  border: 1px solid rgba(192, 57, 43, 0.15);
}
.btn-danger:hover {
  background: #c0392b;
  color: #fff;
  transform: translateY(-1px);
}

.btn-sm { padding: 5px 14px; font-size: 0.78rem; }

/* --- 表单系统 --- */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-weight: 500;
  color: var(--c-forest);
  margin-bottom: 6px;
  font-size: 0.88rem;
}
.form-input {
  width: 100%;
  padding: 10px 16px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--c-bg-warm);
  transition: border-color 0.3s, box-shadow 0.3s;
  color: var(--c-text);
}
.form-input:focus {
  outline: none;
  border-color: var(--c-sage);
  box-shadow: 0 0 0 3px rgba(125, 158, 126, 0.15);
}
.form-input::placeholder { color: var(--c-text-light); }

.form-input[readonly] {
  background: var(--c-sage-pale);
  color: var(--c-text-muted);
  cursor: not-allowed;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px dashed var(--c-sage-light);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.85rem;
  color: var(--c-text-muted);
}
.form-file-label:hover {
  border-color: var(--c-sage);
  background: var(--c-sage-pale);
  color: var(--c-forest);
}

.form-error {
  color: #c0392b;
  font-size: 0.78rem;
  margin-top: 4px;
  animation: fadeIn 0.3s;
}

/* checkbox / radio 美化 */
.form-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 12px 4px 0;
  padding: 6px 14px;
  border-radius: var(--r-xl);
  border: 1.5px solid var(--c-border);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  font-size: 0.85rem;
}
.form-check:hover {
  border-color: var(--c-sage);
  background: var(--c-sage-pale);
}
.form-check input:checked + span {
  color: var(--c-forest);
  font-weight: 500;
}
.form-check:has(input:checked) {
  border-color: var(--c-sage);
  background: var(--c-sage-pale);
}

/* --- 管理面板 --- */
.admin-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 8px 0;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--r-xl);
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.3s var(--ease-out);
  border: 1.5px solid transparent;
}

.admin-tab:nth-child(1) { background: var(--c-sage-pale); color: var(--c-forest); }
.admin-tab:nth-child(2) { background: var(--c-gold-pale); color: #8a6d2b; }
.admin-tab:nth-child(3) { background: #e0f0f8; color: #2c6e8a; }
.admin-tab:nth-child(4) { background: var(--c-rose-pale); color: #8a3a3a; }
.admin-tab:nth-child(5) { background: #ede0f5; color: #5a2d7a; }
.admin-tab:nth-child(6) { background: #fce8d5; color: #8a5a2d; }

.admin-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.admin-section {
  background: var(--c-surface-solid);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 32px);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.admin-section h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-forest);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-border);
}

/* --- 表格美化 --- */
.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}
.table-modern thead th {
  background: var(--c-sage-pale);
  color: var(--c-forest);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 2px solid var(--c-sage-light);
  text-align: left;
  white-space: nowrap;
}
.table-modern thead th:first-child { border-radius: var(--r-md) 0 0 0; }
.table-modern thead th:last-child { border-radius: 0 var(--r-md) 0 0; }

.table-modern tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
.table-modern tbody tr {
  transition: background 0.2s;
}
.table-modern tbody tr:hover {
  background: var(--c-sage-pale);
}
.table-modern tbody tr:last-child td { border-bottom: none; }

.table-content-cell {
  max-width: 400px;
  max-height: 80px;
  overflow: auto;
  font-size: 0.82rem;
  color: var(--c-text-muted);
  line-height: 1.5;
}
.table-content-cell::-webkit-scrollbar { width: 3px; }
.table-content-cell::-webkit-scrollbar-thumb { background: var(--c-sage-light); border-radius: 3px; }

.table-actions {
  display: flex;
  gap: 6px;
}
.table-actions a {
  padding: 4px 12px;
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  transition: all 0.2s;
}
.table-actions .action-edit {
  background: var(--c-sage-pale);
  color: var(--c-forest);
}
.table-actions .action-edit:hover {
  background: var(--c-sage);
  color: #fff;
}
.table-actions .action-delete {
  background: var(--c-rose-pale);
  color: #c0392b;
}
.table-actions .action-delete:hover {
  background: #c0392b;
  color: #fff;
}

/* --- 独立页面（登录/注册等） --- */
.standalone-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--c-glass);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.5s var(--ease-out) both;
}

.auth-card .auth-header {
  text-align: center;
  margin-bottom: 32px;
}
.auth-card .auth-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--c-forest);
  margin-bottom: 6px;
}
.auth-card .auth-header p {
  font-size: 0.85rem;
  color: var(--c-text-muted);
}

.auth-card .auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--c-text-muted);
}
.auth-card .auth-footer a {
  color: var(--c-sage);
  font-weight: 500;
}
.auth-card .auth-footer a:hover { color: var(--c-forest); }

.auth-back {
  position: fixed;
  top: 20px; left: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--c-text-muted);
  transition: color 0.2s;
  z-index: 10;
}
.auth-back:hover { color: var(--c-forest); }

/* avatar preview */
.avatar-preview {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--c-sage-pale);
  cursor: pointer;
  transition: all 0.4s var(--ease-bounce);
}
.avatar-preview:hover {
  transform: scale(1.06);
  border-color: var(--c-sage);
  box-shadow: 0 8px 30px rgba(125, 158, 126, 0.25);
}

/* --- 备案信息 --- */
.footer-beian {
  text-align: center;
  padding: 32px 20px;
  margin-top: 48px;
  font-size: 0.78rem;
  color: var(--c-text-light);
}
.footer-beian a {
  display: inline-block;
  padding: 6px 18px;
  border-radius: var(--r-xl);
  color: var(--c-text-muted);
  background: var(--c-sage-pale);
  transition: all 0.3s var(--ease-out);
  margin: 4px 0;
}
.footer-beian a:hover {
  background: var(--c-sage);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(125, 158, 126, 0.3);
}

/* --- 介绍浮窗 --- */
.intro-panel {
  position: fixed;
  width: 340px;
  right: clamp(20px, 4vw, 60px);
  top: calc(var(--nav-h) + 30px);
  z-index: 90;
  background: var(--c-glass);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  box-shadow: var(--shadow-float);
  color: var(--c-text);
  text-align: justify;
  line-height: 1.5;
  font-size: 0.82rem;
  font-family: var(--font-calligraphy);
  animation: slideInRight 0.7s var(--ease-out) 0.2s both;
  transition: box-shadow 0.4s, transform 0.4s var(--ease-out);
}
.intro-panel:hover {
  box-shadow: 0 24px 70px rgba(45, 74, 62, 0.18);
  transform: translateY(-4px);
}

.intro-panel .intro-title {
  font-family: var(--font-calligraphy);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--c-forest);
  text-align: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-border);
  letter-spacing: 0.15em;
}

.intro-panel .intro-text {
  margin-bottom: 10px;
  text-indent: 2em;
  color: var(--c-text-muted);
}

.intro-panel .intro-sign {
  text-align: right;
  margin-top: 16px;
  font-family: var(--font-calligraphy);
  font-size: 1rem;
  color: var(--c-sage);
  letter-spacing: 0.1em;
}

/* --- 返回链接 --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--c-text-muted);
  margin-bottom: 20px;
  padding: 6px 14px;
  border-radius: var(--r-xl);
  transition: all 0.25s;
}
.back-link:hover {
  background: var(--c-sage-pale);
  color: var(--c-forest);
}

/* --- 404 页面 --- */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}
.error-code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 700;
  color: var(--c-sage);
  line-height: 1;
  margin-bottom: 16px;
  animation: fadeInUp 0.6s var(--ease-out) both;
}
.error-msg {
  font-size: 1.1rem;
  color: var(--c-text-muted);
  margin-bottom: 8px;
  animation: fadeInUp 0.6s var(--ease-out) 0.1s both;
}
.error-hint {
  font-size: 0.9rem;
  color: var(--c-text-light);
  animation: fadeInUp 0.6s var(--ease-out) 0.2s both;
}

/* --- 通用间距 --- */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.text-center { text-align: center; }

/* --- 响应式 --- */
@media (max-width: 1024px) {
  .sidebar { display: none; }
  .intro-panel { display: none; }
}
@media (max-width: 768px) {
  .article-card { padding: 18px 20px; }
  .admin-tabs { gap: 6px; }
  .admin-tab { padding: 8px 16px; font-size: 0.8rem; }
  .nav-username { display: none; }
  .table-modern { font-size: 0.78rem; }
  .table-modern thead th, .table-modern tbody td { padding: 8px 10px; }
}

/* scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-sage-light); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-sage); }

/* selection */
::selection {
  background: var(--c-sage-pale);
  color: var(--c-forest);
}
