/* 登录弹窗样式，复用资料弹窗风格 */
#loginDialog {
  display: none;
  position: fixed;
  left: 0; top: 0; width: 100vw; height: 100vh;
  z-index: 2000;
  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  transition: background 0.25s;
}
#loginDialog[style*="display: flex"] #loginFormDialog {
  animation: profileDialogIn 0.32s cubic-bezier(.4,1.6,.4,1) both;
}
#loginFormDialog {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(23,105,170,0.16);
  padding: 38px 28px 28px 28px;
  min-width: 320px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  align-items: center;
}
#loginFormDialog .login-title {
  font-size: 22px;
  font-weight: 700;
  color: #1769aa;
  letter-spacing: 1px;
  margin-bottom: 2px;
  text-align: center;
}
#loginFormDialog input {
  border-radius: 9px;
  border: 1.2px solid #d0d8e6;
  font-size: 16px;
  padding: 11px 14px;
  box-shadow: 0 1.5px 6px rgba(23,105,170,0.06);
  margin-bottom: 2px;
  transition: border 0.16s, box-shadow 0.16s;
}
#loginFormDialog input:focus {
  border: 1.2px solid #1769aa;
  box-shadow: 0 0 0 2px #e3f0fa;
  outline: none;
}
#loginFormDialog button[type="submit"] {
  background: linear-gradient(90deg,#1976d2 0%,#43a1ff 100%);
  color: #fff;
  border: none;
  border-radius: 22px;
  font-size: 17px;
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  font-weight: 600;
  box-shadow: 0 6px 24px 0 rgba(33,150,243,0.18), 0 1.5px 4px 0 rgba(0,0,0,0.08);
  letter-spacing: 1.2px;
  height: 46px;
  margin-top: 6px;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.13s, filter 0.13s;
  outline: none;
  filter: brightness(0.98);
}
#loginFormDialog button[type="submit"]:hover {
  background: linear-gradient(90deg,#43a1ff 0%,#1976d2 100%);
  box-shadow: 0 12px 32px rgba(33,150,243,0.22);
  transform: translateY(-2px) scale(1.04);
  filter: brightness(1.04);
}
#loginFormDialog button[type="submit"]:active {
  background: #1976d2;
  box-shadow: 0 2px 8px rgba(33,150,243,0.10);
  transform: scale(0.97);
  filter: brightness(0.96);
}
#loginFormDialog .login-social {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 8px;
  margin-bottom: 2px;
}
#loginFormDialog .login-social-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #f5f6fa;
  border: none;
  box-shadow: 0 1.5px 6px rgba(23,105,170,0.06);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: #1769aa;
  transition: background 0.16s, box-shadow 0.16s;
}
#loginFormDialog .login-social-btn:hover {
  background: #e3f0fa;
  color: #2186d4;
}
#loginFormDialog .login-tip {
  font-size: 13px;
  color: #8ca0b3;
  text-align: center;
  margin-top: 2px;
}
#loginFormDialog .login-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(23,105,170,0.10);
  margin-bottom: 6px;
}
#loginFormDialog #loginMsg {
  min-height: 20px;
  font-size: 14px;
  color: #e53935;
  text-align: center;
  margin-bottom: 2px;
}
#loginFormDialog button[type="button"] {
  font-size: 22px;
  color: #8ca0b3;
  background: none;
  border: none;
  cursor: pointer;
  position: absolute;
  right: 16px;
  top: 12px;
  transition: color 0.16s;
}
#loginFormDialog button[type="button"]:hover {
  color: #1769aa;
}
/* 首页加载层美化，防止黑色背景 */
#pageLoading {
  position: fixed;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(255,255,255,0.92);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: background 0.3s;
}
#pageLoadingBlur {
  position: absolute;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(6px);
  z-index: 1;
}
.pageLoadingContent {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.spinner {
  width: 38px; height: 38px;
  border: 4px solid #e3eaf5;
  border-top: 4px solid #5fa8e6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px auto;
}
.pageLoadingText {
  color: #fff;
  font-size: 17px;
  text-align: center;
  font-weight: 500;
  letter-spacing: 1px;
}
/* 移动端首页搜索框动画包裹显示控制 */
.mobile-search-anim-wrap {
  display: none;
}
@media (max-width: 699px) {
  .mobile-search-anim-wrap {
    display: block;
    margin: 12px 0 8px 0;
    padding: 0 8px;
  }
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 首页顶部栏样式（自 blog-index.html 内联样式迁移） */
/* 顶部栏优化：吸顶时更有层次感，分隔线始终可见 */
/* 顶部栏动画优化：吸顶时平滑缩放、渐变、阴影过渡 */
.topbar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 0 0 0;
  background: linear-gradient(90deg,#f7faff 60%,#e3f0ff 100%);
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.03);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 58px;
  border-bottom: 1.5px solid #e3eaf5;
  transition: background 0.38s cubic-bezier(.4,0,.2,1), box-shadow 0.38s cubic-bezier(.4,0,.2,1), border-bottom 0.38s cubic-bezier(.4,0,.2,1), transform 0.38s cubic-bezier(.4,0,.2,1);
  backdrop-filter: blur(0.5px);
  will-change: background, box-shadow, border-bottom, transform;
}

body.scrolled .topbar {
  background: #f4f8fd;
  box-shadow: 0 8px 24px 0 rgba(33,150,243,0.15);
  border-bottom: 2px solid #b6c7e3;
  transform: scale(1,0.97) translateY(-2px);
}

body.scrolled .topbar {
  background: #f4f8fd;
  box-shadow: 0 6px 18px 0 rgba(33,150,243,0.13);
  border-bottom: 2px solid #b6c7e3;
}

/* 内容区自动适配顶部栏高度，避免 style="margin-top" */
.container {
  margin-top: 58px !important;
  /* 保证内容区与顶部栏紧密衔接 */
}
@media (max-width: 699px) {
  .container {
    margin-top: 58px !important;
  }
}
.topbar-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  height: 58px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-logo {
  font-size: 22px;
  font-weight: bold;
  color: #2196f3;
  letter-spacing: 1px;
  margin-right: 8px;
  user-select: none;
}
.topbar-search {
  flex: 1;
  max-width: 340px;
  margin: 0 18px 0 0;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px 0 rgba(33,150,243,0.04);
  border: 1px solid #e3eaf5;
  transition: box-shadow .2s;
}
.topbar-search:focus-within {
  box-shadow: 0 2px 8px 0 rgba(33,150,243,0.10);
  border-color: #90caf9;
}
.topbar-search input {
  border: none;
  outline: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 15px;
  flex: 1;
  border-radius: 8px 0 0 8px;
}
.topbar-search button {
  border: none;
  background: none;
  font-size: 18px;
  color: #2196f3;
  padding: 0 12px 0 6px;
  cursor: pointer;
  border-radius: 0 8px 8px 0;
  transition: background .15s;
}
.topbar-search button:hover {
  background: #f0f7ff;
}
.user-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f7faff;
  border-radius: 20px;
  padding: 4px 14px 4px 8px;
  box-shadow: 0 1px 4px 0 rgba(33,150,243,0.04);
  border: 1px solid #e3eaf5;
  min-width: 160px;
}
.user-panel img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #e3eaf5;
  background: #f5f7fa;
}
.user-panel-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-right: 8px;
}
.user-panel-info span:first-child {
  font-weight: 600;
  font-size: 15px;
  color: #222;
}
.user-panel-info span:last-child {
  font-size: 13px;
  color: #2196f3;
  font-weight: 500;
}
.user-panel button {
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 6px;
  background: #e3f0ff;
  color: #1976d2;
  border: none;
  margin-left: 2px;
  transition: background .15s;
  cursor: pointer;
}
.user-panel button:hover {
  background: #bbdefb;
}

/* 加载层淡出动画（自 blog-index.html 内联样式迁移） */
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
#pageLoading.fade-out {
  animation: fadeOut 0.55s cubic-bezier(.4,0,.2,1) forwards;
  pointer-events: none;
}
body {
    margin: 0;
    background: #f4f6fa;
    font-family: 'Segoe UI', sans-serif;
}
.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 10px 10px 10px;
    gap: 24px;
}
.main {
    flex: 1 1 0%;
    min-width: 0;
}
.sidebar {
    width: 260px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 20px 18px;
    height: fit-content;
}
.sidebar h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #333;
}
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.category-list li {
    padding: 8px 0;
    color: #666;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: color 0.2s, transform 0.18s cubic-bezier(.4,0,.2,1);
    user-select: none;
}
.category-list li.selected {
    animation: shakeX 0.38s cubic-bezier(.36,.07,.19,.97);
    color: #1769aa;
    font-weight: 600;
}

@keyframes shakeX {
  0% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
  100% { transform: translateX(0); }
}
.category-list li:last-child {
    border-bottom: none;
}
.category-list li:hover {
    color: #2196f3;
}
.swiper-container {
    width: 100%;
    height: 220px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.swiper-slide {
    transition: transform 0.7s cubic-bezier(.22,1.5,.36,1), box-shadow 0.4s;
}
.swiper-slide-active {
    animation: jelly-swing 0.7s cubic-bezier(.22,1.5,.36,1);
    z-index: 2;
}

@keyframes jelly-swing {
  0% { transform: scale(1,1); }
  20% { transform: scale(1.08,0.92); }
  40% { transform: scale(0.96,1.04); }
  60% { transform: scale(1.03,0.97); }
  80% { transform: scale(0.98,1.02); }
  100% { transform: scale(1,1); }
}
.sort-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    margin-top: 18px;
}
.sort-bar label {
    color: #888;
    font-size: 15px;
}
.sort-bar select {
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 15px;
}
.post-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 18px;
}
.post-item {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    padding: 18px 20px 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}
.post-title {
    font-size: 20px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
}
.post-content {
    color: #555;
    font-size: 15px;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13px;
    color: #888;
}
.post-meta .user {
    font-weight: 500;
    color: #2196f3;
}
.post-meta .icon {
    margin-right: 3px;
}
.load-more {
    text-align: center;
    color: #2196f3;
    padding: 18px 0 8px 0;
    font-size: 15px;
    cursor: pointer;
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    bottom: auto !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
    z-index: 1 !important;
}
.forum-capsule {
    display: inline-flex;
    align-items: center;
    background: #f0f7ff;
    color: #1769aa;
    border-radius: 999px;
    font-size: 13px;
    padding: 2px 10px 2px 6px;
    margin-left: 0;
    margin-right: 0;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(23,105,170,0.04);
    border: 1px solid #e3eaf5;
    line-height: 1.6;
}
.group-capsule {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 13px;
    padding: 2px 10px 2px 6px;
    margin-right: 1px !important; /* 原8px，缩小间距 */
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(23,105,170,0.04);
    border: none;
    line-height: 1.6;
}
@media (max-width: 900px) {
    .container { flex-direction: column; }
    .sidebar { width: 80vw; max-width: 320px; margin-bottom: 0; position: fixed; left: -90vw; top: 0; height: 100vh; z-index: 1001; background: #fff; box-shadow: 2px 0 8px rgba(0,0,0,0.08); transition: left 0.3s; border-radius: 0 12px 12px 0;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
    }
    .sidebar.active { left: 0; }
    .sidebar .close-btn { display: block; position: absolute; right: 18px; top: 18px; font-size: 28px; color: #888; background: none; border: none; cursor: pointer; z-index: 1002; }
    .sidebar h3 { padding-right: 36px; }
    .category-list {
        flex: 1 1 auto;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar-mask { display: none; position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.25); z-index: 1000; }
    .sidebar-mask.active { display: block; }
    .show-sidebar-btn { display: block; position: fixed; left: 12px; top: 12px; z-index: 1100; background: #2196f3; color: #fff; border: none; border-radius: 50%; width: 44px; height: 44px; font-size: 26px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
    .main, .load-more, .sort-bar, .swiper-container, .post-list { z-index: 1; }
    .forum-capsule {
        font-size: 14px;
        padding: 3px 12px 3px 7px;
        margin-left: 4px;
    }
    .group-capsule {
        margin-right: 1px !important;
        padding-right: 7px;
    }
    .forum-capsule {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 7px;
    }
}
@media (min-width: 901px) {
    .show-sidebar-btn, .sidebar .close-btn, .sidebar-mask { display: none !important; }
}
@media (max-width: 600px) {
    html {
        font-size: 15px;
    }
    body {
        padding: 0;
        background: #f4f6fa;
    }
    .container {
        max-width: 100vw;
        margin: 0;
        padding: 0 2vw 10vw 2vw;
        border-radius: 0;
        box-shadow: none;
    }
    .sidebar {
        width: 90vw !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        left: -100vw;
        border-radius: 0 12px 12px 0;
        padding: 16px 8px;
    }
    .sidebar.active { left: 0; }
    .sidebar h3 { font-size: 17px; }
    .category-list li { font-size: 16px; padding: 10px 0; }
    .main { padding: 0; }
    .swiper-container { height: 140px; border-radius: 8px; }
    .sort-bar { gap: 8px; font-size: 14px; }
    .sort-bar label { font-size: 14px; }
    .sort-bar select { font-size: 14px; padding: 4px 8px; }
    .post-list { gap: 10px; }
    .post-item { padding: 12px 8px 10px 8px; border-radius: 7px; }
    .post-title { font-size: 17px; }
    .post-content { font-size: 13px; }
    .post-meta { gap: 8px; font-size: 12px; flex-wrap: wrap; }
    .forum-capsule, .group-capsule { font-size: 12px; padding: 2px 7px; }
    .load-more { font-size: 13px; padding: 12px 0 6px 0; }
}

/* snackbar样式，复用login页面风格 */
.md3-snackbar {
  visibility: hidden;
  min-width: 180px;
  max-width: 80vw;
  background: #222;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 12px 18px;
  position: fixed;
  left: 50%;
  top: 38px;
  bottom: auto;
  z-index: 3002;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 1px;
  transform: translateX(-50%) scale(0.98);
  opacity: 0;
  transition: opacity 0.22s, transform 0.22s;
  box-shadow: 0 4px 18px rgba(23,105,170,0.13);
}
.md3-snackbar-show {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
.md3-snackbar-success {
  background: #2196f3;
  color: #fff;
}
.md3-snackbar-error {
  background: #e53935;
  color: #fff;
}

