
:root {
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --red-400: #f87171;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --purple-50: #faf5ff;
  --purple-100: #f3e8ff;
  --purple-200: #e9d5ff;
  --purple-300: #d8b4fe;
  --purple-400: #c084fc;
  --purple-500: #a855f7;
  --purple-600: #9333ea;
  --purple-700: #7e22ce;
  --purple-800: #6b21a8;
  --radius-sm: 5px;
  --radius: 9px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 22px rgba(0, 0, 0, 0.09);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1240px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  background-color: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


a,
a:link,
a:visited,
a:hover,
a:active,
a:focus {
  text-decoration: none;
  color: inherit;
  background-color: transparent;
  outline: none;
  border: none;
  box-shadow: none;
  font: inherit;
  cursor: auto;
  -webkit-tap-highlight-color: transparent;
}
li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.navbar {
  background: linear-gradient(135deg, #6b21a8 0%, #7e22ce 30%, #581c87 100%);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(107, 33, 168, 0.35);
}
.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 56px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
}
.nav-logo-icon {
  width: 42px;
  height: 42px;
  background: var(--white);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: var(--purple-700);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  letter-spacing: -1px;
}
.nav-logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.nav-categories {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 1;
  justify-content: center;
}
.nav-cat-tag {
  background: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: 0.3px;
}
.nav-cat-tag:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  transform: translateY(-1px);
}
.nav-cat-tag.active {
  background: var(--white);
  color: var(--purple-700);
  border-color: var(--white);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ========== Toast提示 ========== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--purple-700);
  color: #fff;
  padding: 12px 28px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 14px;
  z-index: 9999;
  box-shadow: var(--shadow-xl);
  animation: toastIn 0.35s ease, toastOut 0.35s ease 1.8s forwards;
  pointer-events: none;
}

/* ========== 底部 ========== */
.footer {
  background: var(--gray-800);
  color: var(--gray-300);
  padding: 30px 20px;
  text-align: center;
  font-size: 13px;
  line-height: 2;
  margin-top: 10px;
}
.footer a {
  color: var(--purple-400);
  text-decoration: none;
  transition: var(--transition);
}
.footer a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.footer .footer-divider {
  color: var(--gray-600);
}
.footer .copyright {
  color: var(--gray-500);
  font-size: 12px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-30px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
  .update-grid { grid-template-columns: repeat(3, 1fr); }
  .tag-results { grid-template-columns: repeat(3, 1fr); }
  .comment-grid { grid-template-columns: 1fr; }
  .asymmetric-section { flex-direction: column; }
  .carousel-wrapper { height: 280px; }
  .carousel-slide { padding: 20px 30px; gap: 20px; }
  .carousel-cover { width: 130px; height: 175px; }
  .carousel-info h3 { font-size: 20px; }
  .carousel-info p { font-size: 12px; max-width: 280px; }
  .rank-three-columns { grid-template-columns: repeat(2, 1fr); }
  .nav-categories { gap: 6px; }
  .nav-cat-tag { padding: 6px 14px; font-size: 12px; }
}
@media (max-width: 768px) {
  .navbar-inner { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 14px; }
  .nav-logo { align-self: flex-start; }
  .nav-categories { order: 2; gap: 5px; }
  .nav-cat-tag { padding: 5px 12px; font-size: 11px; }
  .nav-search { order: 3; max-width: 100%; flex: 1 1 100%; min-width: 100%; }
  .update-grid { grid-template-columns: repeat(2, 1fr); }
  .tag-results { grid-template-columns: repeat(2, 1fr); }
  .comment-grid { grid-template-columns: 1fr; }
  .carousel-wrapper { height: 220px; }
  .carousel-slide { padding: 14px 18px; gap: 12px; }
  .carousel-cover { width: 80px; height: 110px; }
  .carousel-info h3 { font-size: 17px; }
  .carousel-info p { font-size: 11px; max-width: 180px; }
  .carousel-arrow { width: 30px; height: 30px; font-size: 14px; }
  .asymmetric-section { flex-direction: column; }
  .rank-three-columns { grid-template-columns: 1fr; gap: 14px; }
  .publish-row { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .update-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tag-results { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tag-btn { padding: 5px 12px; font-size: 11px; }
  .carousel-wrapper { height: 170px; }
  .carousel-cover { width: 60px; height: 80px; border-radius: 6px; }
  .carousel-info h3 { font-size: 14px; }
  .carousel-info p { font-size: 10px; max-width: 130px; margin-bottom: 4px; }
  .carousel-info .carousel-meta { font-size: 10px; gap: 6px; }
  .carousel-slide { padding: 8px 10px; gap: 8px; }
  .carousel-arrow { width: 26px; height: 26px; font-size: 12px; }
  .carousel-arrow.prev { left: 6px; }
  .carousel-arrow.next { right: 6px; }
  .nav-cat-tag { padding: 4px 10px; font-size: 10px; border-radius: 14px; }
}
