/* 关键安全注释：毛玻璃圆角动画与深色模式适配，提升视觉体验与安全性 */
:root {
  --primary-color: #1a73e8;
  --secondary-color: #4285f4;
  --text-color: #202124;
  --bg-color: #ffffff;
  --border-color: #dadce0;
  --hover-color: #f8f9fa;
  --shadow: 0 2px 4px rgba(0,0,0,.1);
}
[data-theme="dark"] {
  --primary-color: #8ab4f8;
  --secondary-color: #669df6;
  --text-color: #e8eaed;
  --bg-color: #202124;
  --border-color: #3c4043;
  --hover-color: #303134;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-color);
  background: var(--bg-color);
  line-height: 1.6;
  padding: 0 0 48px 0;
  border-radius: 0 0 32px 32px;
  background: linear-gradient(120deg, #f8fafc 0%, #e3e9f7 100%);
  min-height: 100vh;
  transition: background 0.5s;
}
.main-header {
  background: rgba(255,255,255,0.35);
  box-shadow: 0 8px 32px 0 rgba(31,38,135,0.18);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-radius: 0 0 24px 24px;
  animation: glassFadeIn 0.8s cubic-bezier(.4,0,.2,1);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 1rem;
  gap: 2rem;
  margin-bottom: 2rem;
}
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 4px;
  z-index: 1000;
  animation: slideIn 0.3s ease;
}
.toast.error {
  background: #f44336;
  color: white;
}
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }
  .search-bar {
    width: 100%;
  }
  .nav-menu {
    width: 100%;
    display: none;
  }
  .post-card {
    margin: 10px 0;
  }
  .comment-form {
    flex-direction: column;
  }
  .menu-toggle {
    display: block;
  }
}
.glass {
  background: rgba(255,255,255,0.35);
  box-shadow: 0 8px 32px 0 rgba(31,38,135,0.18);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.18);
  transition: box-shadow 0.3s, background 0.3s;
}
.post-card, .comment-card, .user-card {
  background: rgba(255,255,255,0.45);
  box-shadow: 0 4px 24px 0 rgba(31,38,135,0.12);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.16);
  transition: box-shadow 0.3s, background 0.3s;
  animation: glassCardIn 0.7s cubic-bezier(.4,0,.2,1);
  margin-bottom: 2rem;
}
@keyframes glassCardIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
button, .btn {
  border-radius: 16px;
  background: rgba(255,255,255,0.25);
  box-shadow: 0 2px 8px rgba(31,38,135,0.10);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--primary-color);
  font-weight: 500;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  animation: glassBtnIn 0.5s cubic-bezier(.4,0,.2,1);
  margin: 0.25rem;
}
button:hover, .btn:hover {
  background: rgba(255,255,255,0.45);
  color: #005bb5;
  box-shadow: 0 4px 16px rgba(31,38,135,0.18);
}
@keyframes glassBtnIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
#login-modal {
  background: rgba(255,255,255,0.38);
  box-shadow: 0 8px 32px 0 rgba(31,38,135,0.18);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-radius: 32px;
  border: 1px solid rgba(255,255,255,0.18);
  animation: glassFadeIn 0.8s cubic-bezier(.4,0,.2,1);
  margin-bottom: 2rem;
}
[data-theme="dark"] .glass,
[data-theme="dark"] .main-header,
[data-theme="dark"] .post-card,
[data-theme="dark"] .comment-card,
[data-theme="dark"] .user-card,
[data-theme="dark"] #login-modal {
  background: rgba(32,34,36,0.55);
  box-shadow: 0 8px 32px 0 rgba(31,38,135,0.28);
  border: 1px solid rgba(60,64,67,0.18);
}
@keyframes glassFadeIn {
  from { opacity: 0; transform: translateY(-32px); }
  to { opacity: 1; transform: translateY(0); }
}

/* GitHub第三方登录按钮美化 */
button {
  border-radius: 8px;
  font-size: 1rem;
  box-shadow: var(--shadow);
  padding: 0.5rem 1.5rem;
  margin: 0.25rem;
  background: #24292f;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
button.github-login {
  background: #24292f;
  color: #fff;
}
button.github-login:hover {
  background: #444c56;
}