/* ========== CSS Variables - Colorful Palette ========== */
:root {
  --color-primary: #6366f1;
  --color-primary-light: #a5b4fc;
  --color-primary-dark: #4f46e5;
  --color-primary-bg: rgba(99, 102, 241, 0.08);

  --color-blue: #2563eb;
  --color-blue-light: #93c5fd;
  --color-blue-bg: rgba(37, 99, 235, 0.08);

  --color-teal: #14b8a6;
  --color-teal-light: #5eead4;
  --color-teal-bg: rgba(20, 184, 166, 0.08);

  --color-amber: #f59e0b;
  --color-amber-light: #fcd34d;
  --color-amber-bg: rgba(245, 158, 11, 0.08);

  --color-sky: #0ea5e9;
  --color-sky-light: #7dd3fc;
  --color-sky-bg: rgba(14, 165, 233, 0.08);

  --color-ocean: #0891b2;
  --color-ocean-light: #67e8f9;
  --color-ocean-bg: rgba(8, 145, 178, 0.08);

  --color-indigo: #6366f1;
  --color-indigo-light: #a5b4fc;

  --color-lime: #84cc16;
  --color-lime-light: #bef264;

  --color-orange: #f97316;
  --color-orange-light: #fdba74;

  --color-cyan: #06b6d4;
  --color-cyan-light: #67e8f9;

  --color-green: #22c55e;
  --color-green-light: #86efac;

  --bg-start: #fef9f0;
  --bg-end: #eef2ff;

  --color-bg: #f8f9fc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-shadow: rgba(0, 0, 0, 0.06);
  --color-shadow-lg: rgba(0, 0, 0, 0.1);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: 0.25s ease;
}

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

html {
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--color-text);
  line-height: 1.7;
  background: #e0e7ff;
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== Two-Column Layout ========== */
.content-wrapper {
  display: flex;
  gap: 58px;
  align-items: flex-start;
}

.content-main {
  flex: 0 0 64%;
  min-width: 0;
}

.sidebar {
  flex: 0 0 33%;
  min-width: 0;
  position: sticky;
  top: 80px;
  margin-top: 103px;
  will-change: transform;
  transform: translateZ(0);
}

/* Sidebar Widget */
.sidebar .widget {
  background: none;
  border-radius: 0;
  padding: 18px;
  margin-bottom: 16px;
  border: none;
  box-shadow: none;
}

.sidebar .widget:last-child {
  margin-bottom: 0;
}

.sidebar .widget-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-text);
}

.sidebar .tag-cloud {
  display: flex;
  flex-wrap: wrap; row-gap: 5px;
  gap: 6px;
}

.sidebar .tag-cloud a {
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 12px;
}

.sidebar .widget-list {
  list-style: none;
}

.sidebar .widget-list li {
  padding: 5px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.sidebar .widget-list li:last-child {
  border-bottom: none;
}

.sidebar .widget-list a {
  color: var(--color-text-secondary);
  font-size: 12px;
  transition: var(--transition);
}

.sidebar .widget-list a:hover {
  color: var(--color-primary);
}

a { color: var(--color-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-primary-dark); }

img { max-width: 100%; height: auto; }

/* ========== Header ========== */
.site-header {
  background: #e0e7ff;
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; row-gap: 5px;
  position: relative;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.site-logo {
  font-family: 'Arial Rounded MT Bold', 'Rounded Mplus 1c', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #FF0000;
}

.site-title {
  font-size: 18px;
  font-weight: 700;
  color: #2F4460;
  letter-spacing: -0.3px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  color: #2bc7b5;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  background: rgba(255,255,255,0.08);
}
.site-nav a:hover {
  background: rgba(255,255,255,0.2);
  color: #2bc7b5;
}
.site-nav a.active {
  background: #2bc7b5;
  color: #FF0000;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Search Toggle */
.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #2bc7b5;
  cursor: pointer;
  transition: var(--transition);
}
.search-toggle:hover {
  background: rgba(255,255,255,0.25);
}

/* ========== Search Dropdown ========== */
.search-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 12px;
  width: 320px;
  max-width: 90vw;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s ease;
  z-index: 200;
}
.search-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-dropdown-form {
  display: flex;
  gap: 8px;
}
.search-dropdown-form input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--color-bg);
  transition: var(--transition);
  outline: none;
}
.search-dropdown-form input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.search-dropdown-form button {
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-primary), var(--color-purple));
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
}
.search-dropdown-form button:hover {
  background: linear-gradient(135deg, var(--color-primary-dark), #9333ea);
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.menu-toggle svg { width: 20px; height: 20px; }

/* ========== Section Title ========== */
.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  margin: 32px 0 16px;
  padding-bottom: 12px;
  position: relative;
}
.section-stats {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-left: 4px;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-ocean), var(--color-teal));
}

/* ========== Post List ========== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: none;
  border-radius: 0;
  padding: 12px 0;
  box-shadow: none;
  border: none;
  overflow: hidden;
}

.post-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  position: relative;
  transition: var(--transition);
}
.post-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: var(--transition);
}
.post-item:nth-child(6n+1)::before { background: linear-gradient(180deg, var(--color-primary), var(--color-primary-light)); }
.post-item:nth-child(6n+2)::before { background: linear-gradient(180deg, var(--color-blue), var(--color-blue-light)); }
.post-item:nth-child(6n+3)::before { background: linear-gradient(180deg, var(--color-teal), var(--color-teal-light)); }
.post-item:nth-child(6n+4)::before { background: linear-gradient(180deg, var(--color-amber), var(--color-amber-light)); }
.post-item:nth-child(6n+5)::before { background: linear-gradient(180deg, var(--color-sky), var(--color-sky-light)); }
.post-item:nth-child(6n+6)::before { background: linear-gradient(180deg, var(--color-ocean), var(--color-ocean-light)); }
.post-item:hover::before { opacity: 1; }
.post-item:hover {
  background: linear-gradient(90deg, rgba(99,102,241,0.04) 0%, transparent 20%);
  padding-left: 22px;
}

.post-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.post-item:nth-child(6n+1) .post-num { background: linear-gradient(135deg, #6366f1, #818cf8); }
.post-item:nth-child(6n+2) .post-num { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.post-item:nth-child(6n+3) .post-num { background: linear-gradient(135deg, #14b8a6, #2dd4bf); }
.post-item:nth-child(6n+4) .post-num { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.post-item:nth-child(6n+5) .post-num { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.post-item:nth-child(6n+6) .post-num { background: linear-gradient(135deg, #0891b2, #22d3ee); }

.post-title {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}
.post-title:hover { color: var(--color-primary); }

.post-meta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 2px;
}
.post-views {
  color: var(--color-sky);
  font-weight: 500;
}

/* ========== Card Row ========== */
.card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px 0 40px;
}

.card-half {
  background: none;
  border-radius: 0;
  padding: 20px;
  border: none;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

/* Decorative corner */
.card-half::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.1;
}
.card-tags::before { background: var(--color-primary); }
.card-comments::before { background: var(--color-green); }

.card-half .widget-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--color-text);
  position: relative;
}

/* Tag Cloud */
.tag-cloud { display: flex; flex-wrap: wrap; row-gap: 5px; gap: 8px; }
.tag-cloud a {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}
.tag-cloud a:nth-child(6n+1) { background: var(--color-blue-bg); color: var(--color-blue); border: 1px solid var(--color-blue-light); }
.tag-cloud a:nth-child(6n+2) { background: var(--color-primary-bg); color: var(--color-primary); border: 1px solid var(--color-primary-light); }
.tag-cloud a:nth-child(6n+3) { background: var(--color-teal-bg); color: var(--color-teal); border: 1px solid var(--color-teal-light); }
.tag-cloud a:nth-child(6n+4) { background: var(--color-amber-bg); color: var(--color-amber); border: 1px solid var(--color-amber-light); }
.tag-cloud a:nth-child(6n+5) { background: var(--color-sky-bg); color: var(--color-sky); border: 1px solid var(--color-sky-light); }
.tag-cloud a:nth-child(6n+6) { background: var(--color-ocean-bg); color: var(--color-ocean); border: 1px solid var(--color-ocean-light); }
.tag-cloud a:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* Comment Widget */
.widget-list { list-style: none; }
.widget-list li { padding: 6px 0; border-bottom: 1px solid var(--color-border-light); }
.widget-list li:last-child { border-bottom: none; }
.widget-list a {
  color: var(--color-text-secondary);
  font-size: 13px;
  transition: var(--transition);
}
.widget-list a:hover { color: var(--color-primary); }

/* ========== Pagination ========== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 28px 0;
}
.pagination a,
.pagination .current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}
.pagination a {
  color: var(--color-text-secondary);
  background: none;
  border: 1px solid var(--color-border);
}
.pagination a:hover {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.pagination .current {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* ===== 密码保护表单美化 ===== */
form.protected {
  max-width: 420px;
  margin: 60px auto;
  text-align: center;
}
form.protected p.word {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-bottom: 18px;
}
form.protected p:last-child {
  display: flex;
  gap: 0;
  align-items: stretch;
  justify-content: center;
}
form.protected input.text {
  flex: 1;
  max-width: 240px;
  padding: 11px 16px;
  border: 2px solid var(--color-border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--color-surface);
  font-size: 14px;
  color: var(--color-text);
  outline: none;
  transition: var(--transition);
}
form.protected input.text:focus {
  border-color: var(--color-primary);
  box-shadow: -3px 0 0 3px rgba(99, 102, 241, 0.12), 0 3px 0 3px rgba(99, 102, 241, 0.12), -3px 3px 0 3px rgba(99, 102, 241, 0.12);
}
form.protected input.submit {
  padding: 11px 22px;
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
form.protected input.submit:hover {
  background: linear-gradient(135deg, var(--color-primary-dark), #7c3aed);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

/* ========== Article Page ========== */
.article-header { margin-bottom: 20px; }
.article-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
}
.article-meta {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 8px;
}

.article-content {
  font-size: 16px;
  line-height: 1.85;
  color: var(--color-text);
  word-break: break-word;
}
.article-content h1, .article-content h2, .article-content h3,
.article-content h4, .article-content h5, .article-content h6 {
  margin: 24px 0 12px;
  font-weight: 700;
}
.article-content h2 {
  font-size: 22px;
  padding-left: 14px;
  border-left: 4px solid var(--color-primary);
  background: linear-gradient(90deg, var(--color-primary-bg), transparent);
}
.article-content h3 {
  font-size: 18px;
  padding-left: 14px;
  border-left: 4px solid var(--color-teal);
  background: linear-gradient(90deg, var(--color-teal-bg), transparent);
}
.article-content p { margin-bottom: 16px; }
.article-content img { border-radius: var(--radius-md); }
.article-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  margin: 16px 0;
}
.article-content code { font-family: "JetBrains Mono", "Fira Code", monospace; font-size: 0.9em; }
.article-content :not(pre) > code {
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--color-blue);
}
.article-content blockquote {
  border-left: 4px solid var(--color-amber);
  background: var(--color-amber-bg);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #92400e;
}
.article-content a { color: var(--color-primary); border-bottom: 1px dashed var(--color-primary-light); }
.article-content a:hover { border-bottom-style: solid; }
.article-content ul, .article-content ol { padding-left: 24px; margin: 12px 0; }
.article-content li { margin-bottom: 6px; }
.article-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), var(--color-primary-light), var(--color-border), transparent);
  margin: 28px 0;
}

/* ========== Comments ========== */
.comments-area {
  margin-top: 32px;
  padding-top: 20px;
}

.comments-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* Respond / Comment Form */
.respond { margin-bottom: 28px; }

.comment-form {
  background: none;
  border-radius: 0;
  padding: 20px;
  border: 1px solid var(--color-border);
  box-shadow: none;
}

.comment-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.comment-form-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-size: 14px;
  transition: var(--transition);
}

.comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-size: 14px;
  min-height: 120px;
  resize: vertical;
  transition: var(--transition);
}

.comment-form-row input:focus,
.comment-form textarea:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 246, 0.12);
}


/* 评论区昵称输入框 */
.comment-form input[name="author"] {
  width: 100%;
  padding: 8px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-size: 14px;
  transition: var(--transition);
}
.comment-form input[name="author"]:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,246,0.12);
  outline: none;
}

.comment-form-submit {
  display: flex;
  justify-content: flex-end;
}
.comment-form button {
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.comment-form button:hover {
  background: linear-gradient(135deg, var(--color-primary-dark), #7c3aed);
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
  transform: translateY(-1px);
}

.cancel-comment-reply { margin-bottom: 8px; font-size: 13px; }
.cancel-comment-reply a { color: var(--color-blue); }

/* Comment List */
.comment-list { list-style: none; }

.comment-body {
  position: relative;
  padding: 16px 16px 16px 60px;
  border-bottom: 1px solid var(--color-border-light);
  transition: var(--transition);
}
.comment-body:hover { background: rgba(99,102,241,0.02); }

.comment-avatar {
  position: absolute;
  left: 12px;
  top: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
}
/* Emoji Avatar */
.avatar-emoji {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-emoji-text {
  font-size: 20px;
  line-height: 1;
}
.avatar-emoji-0 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.avatar-emoji-1 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.avatar-emoji-2 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.avatar-emoji-3 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.avatar-emoji-4 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.avatar-emoji-5 { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }
.avatar-emoji-6 { background: linear-gradient(135deg, #fccb90 0%, #d57eeb 100%); }
.avatar-emoji-7 { background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); }
.avatar-emoji-8 { background: linear-gradient(135deg, #f9d423 0%, #ff4e50 100%); }
.avatar-emoji-9 { background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%); }
.avatar-emoji-a { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.avatar-emoji-b { background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%); }
.avatar-emoji-c { background: linear-gradient(135deg, #fddb92 0%, #d1fdff 100%); }
.avatar-emoji-d { background: linear-gradient(135deg, #cfd9df 0%, #e2ebf0 100%); }
.avatar-emoji-e { background: linear-gradient(135deg, #c1dfc4 0%, #deecdd 100%); }
.avatar-emoji-f { background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%); }

.comment-author {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
}
.comment-author a { color: var(--color-primary); }

.comment-time { font-size: 12px; color: var(--color-text-muted); margin-left: 8px; }
.comment-content { font-size: 14px; color: var(--color-text-secondary); margin-top: 6px; line-height: 1.7; }
.comment-content p { margin-bottom: 6px; }
.comment-reply { font-size: 13px; margin-top: 4px; }
.comment-reply a { color: var(--color-text-muted); }
.comment-reply a:hover { color: var(--color-primary); }

/* Comment children */
.comment-children { list-style: none; margin-left: 36px; border-left: 2px solid var(--color-border-light); }

/* ========== Links Page ========== */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Each link card has unique gradient bg */
.link-card-purple { background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%); border: 1px solid #ddd6fe; }
.link-card-blue   { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); border: 1px solid #bfdbfe; }
.link-card-teal   { background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%); border: 1px solid #99f6e4; }
.link-card-amber  { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); border: 1px solid #fde68a; }
.link-card-sky    { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border: 1px solid #bae6fd; }
.link-card-ocean  { background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%); border: 1px solid #a5f3fc; }
.link-card-indigo { background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%); border: 1px solid #c7d2fe; }
.link-card-lime   { background: linear-gradient(135deg, #f7fee7 0%, #ecfccb 100%); border: 1px solid #d9f99d; }
.link-card-orange { background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); border: 1px solid #fed7aa; }
.link-card-cyan   { background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%); border: 1px solid #a5f3fc; }

.link-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.link-card img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.link-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.link-avatar-purple { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.link-avatar-blue  { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.link-avatar-teal  { background: linear-gradient(135deg, #14b8a6, #2dd4bf); }
.link-avatar-amber { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.link-avatar-sky   { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.link-avatar-ocean { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.link-avatar-indigo { background: linear-gradient(135deg, #6366f1, #818cf8); }
.link-avatar-lime   { background: linear-gradient(135deg, #84cc16, #a3e635); }
.link-avatar-orange { background: linear-gradient(135deg, #f97316, #fb923c); }
.link-avatar-cyan   { background: linear-gradient(135deg, #06b6d4, #22d3ee); }

.link-info { flex: 1; min-width: 0; }
.link-name { font-size: 13px; font-weight: 600; color: var(--color-text); }
.link-desc { font-size: 11px; color: var(--color-text-muted); margin-top: 1px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ========== Page Content ========== */
.page-content {
  background: none;
  border-radius: 0;
  padding: 28px;
  box-shadow: none;
  border: none;
}

/* ========== Footer ========== */
.site-footer {
  margin-top: 48px;
  padding: 28px 0 20px;
  background: linear-gradient(180deg, rgba(99,102,241,0.04) 0%, rgba(99,102,241,0.08) 100%);
  border-top: 3px solid;
  border-image: linear-gradient(90deg, var(--color-primary), var(--color-ocean), var(--color-teal), var(--color-amber)) 1;
}

.site-footer .container {
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
}
.footer-links a {
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}
.footer-links a:hover { color: var(--color-primary); }

.footer-copyright {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.footer-total-views {
  color: var(--color-sky);
  font-weight: 500;
}

.footer-stats {
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* ========== Back to Top ========== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: linear-gradient(135deg, var(--color-primary-dark), #7c3aed);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}

/* ========== Error / Empty States ========== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--color-text-muted);
}
.empty-state p {
  font-size: 18px;
}

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

/* ========== Responsive ========== */
@media (max-width: 768px) {
  /* 窄屏：标题+按钮不折行 */
  .site-header .container { flex-wrap: nowrap; }
  .site-brand { flex: 1; min-width: 0; overflow: hidden; }
  .site-title {
    max-width: 7em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
  }
  .header-actions { flex-shrink: 0; }
  .search-toggle,
  .menu-toggle {
    width: 32px;
    height: 32px;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 126px;
    background: rgba(232,240,254,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    margin-top: 10px;
    z-index: 50;
    overflow: hidden;
  }
  .site-nav::before {
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    color: #374151;
    padding: 9px 14px;
    border-radius: 0;
    font-size: 14px;
    border-bottom: 1px solid #c8d0d8;
    position: relative;
    transition: all 0.2s ease;
    background: transparent;
  }
  .site-nav a::before {
    display: none;
  }
  .site-nav a:last-child { border-bottom: none; }
  .site-nav a[href*="about"] { position: static !important; margin-left: 0 !important; }
  .site-nav a[href*="about"] .search-toggle { display: none; }
  .site-nav a:hover {
    background: rgba(43,199,181,0.12);
    color: #2bc7b5;
    padding-left: 14px;
  }
  .site-nav a.active {
    background: #2bc7b5;
    color: #FF0000;
    font-weight: 600;
    padding-left: 14px;
  }
  .menu-toggle { display: flex; }

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

  .comment-form-row { flex-direction: column; gap: 8px; }

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

  .links-grid { grid-template-columns: 1fr 1fr; }

  .article-title { font-size: 22px; }

  .search-dropdown {
    width: calc(100vw - 40px);
    right: 0;
  }

  .content-wrapper {
    flex-direction: column;
    gap: 0;
  }

  .content-main,
  .sidebar {
    flex: 1 1 auto;
    width: 100%;
  }

  .sidebar {
    position: static;
    margin-top: 0;
  }

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

@media (max-width: 480px) {
  .links-grid { grid-template-columns: 1fr 1fr; }
  .post-item { flex-wrap: wrap; row-gap: 5px; }
  .post-meta { width: 100%; padding-left: 40px; }
}

/* ========== Animations ========== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

.fade-in { animation: fadeInUp 0.5s ease both; }
