﻿* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #5aad8a;
  --primary-hover: #4a9d7a;
  --text: #2d3436;
  --text-secondary: #636e72;
  --text-muted: #b2bec3;
  --bg: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --border: #e9ecef;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --transition: 0.25s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg-secondary);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* ── Banner ── */
.banner {
  position: relative;
  height: 50vh;
  min-height: 260px;
  background: url("https://images.unsplash.com/photo-1499750310107-5fef28a66643?w=1600&h=600&fit=crop") center / cover no-repeat;
  display: flex;
  flex-direction: column;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.15) 100%);
  z-index: 1;
}

/* ── 导航（悬浮在 Banner 上） ── */
.navbar {
  position: relative;
  z-index: 10;
  padding: 16px 40px 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-logo {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
}

.nav-menu {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  padding: 6px 0;
  position: relative;
  transition: color 0.25s;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Banner 右上操作区 ── */
.banner-actions {
  position: absolute;
  top: 20px;
  right: 40px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner-search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 24px;
  padding: 6px 14px;
  gap: 8px;
  transition: background 0.25s;
}

.banner-search:focus-within {
  background: rgba(255,255,255,0.28);
}

.banner-search .search-icon {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
}

.banner-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.88rem;
  color: #fff;
  width: 140px;
  padding: 4px 0;
}

.banner-search input::placeholder {
  color: rgba(255,255,255,0.55);
}

.banner-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, transform 0.2s;
}

.banner-icon-btn:hover {
  background: rgba(255,255,255,0.32);
  transform: scale(1.08);
}

.banner-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.5);
  cursor: pointer;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.banner-avatar:hover {
  transform: scale(1.1);
}

.banner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── 更换背景按钮 ── */
.change-bg-btn {
  position: absolute;
  bottom: 16px;
  right: 40px;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, transform 0.2s;
}

.change-bg-btn:hover {
  background: rgba(255,255,255,0.35);
  transform: scale(1.1);
}

/* ── 搜索结果面板 ── */
.search-results {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  width: 560px;
  max-width: 90vw;
  max-height: 70vh;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  flex-direction: column;
}

.search-results.open {
  display: flex;
}

.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.search-results-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.search-results-close {
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.search-results-close:hover {
  color: var(--text);
}

.search-results-body {
  padding: 12px 0;
  overflow-y: auto;
  flex: 1;
}

.search-results-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-result-item {
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-result-item:hover {
  background: var(--bg-secondary);
}

.search-result-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.search-result-item .result-tag {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 500;
}

.search-result-item .result-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 10px;
}

.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1999;
}

.search-overlay.open {
  display: block;
}

/* ── 主内容 ── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 40px 60px;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: start;
}

/* ── 文章列表 ── */
.articles-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.view-all {
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-all:hover {
  color: var(--primary);
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
  transition: transform 0.25s, box-shadow 0.25s;
}

.article-card:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

.article-card {
  cursor: pointer;
}

.article-card.hidden {
  display: none;
}

.article-thumbnail img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 8px;
}

.article-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  transition: color 0.25s;
}

.article-card:hover .article-title {
  color: var(--primary);
}

.article-excerpt {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.article-tag {
  padding: 3px 10px;
  background: rgba(90, 173, 138, 0.1);
  color: var(--primary);
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 500;
}

.article-date {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.article-views {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── 侧边栏 ── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.widget {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.about-content {
  text-align: center;
}

.about-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.about-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.stat-num {
  color: #4caf50;
  font-size: 1.1rem;
  font-weight: 700;
}

.about-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
}

.about-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.social-link {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: background 0.25s, color 0.25s, transform 0.2s;
}

.social-link:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-3px);
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-item {
  padding: 5px 14px;
  background: rgba(90, 173, 138, 0.1);
  color: var(--primary);
  border-radius: 18px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.2s;
}

.tag-item:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.widget-search-box {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 24px;
  padding: 6px 14px;
  gap: 8px;
}

.widget-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.88rem;
  color: var(--text);
  padding: 4px 0;
}

.widget-search-box input::placeholder {
  color: var(--text-muted);
}

.search-submit {
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  font-size: 0.9rem;
  transition: color 0.25s;
}

.search-submit:hover {
  color: var(--primary);
}

/* ── 暗色模式 ── */
body.dark {
  --bg: #000000;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --text: #e4e4e4;
  --text-secondary: #b2bec3;
  --text-muted: #636e72;
  --border: #2d3436;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

body.dark .search-results,
body.dark .widget,
body.dark .articles-section {
  background: var(--bg-card);
}

body.dark .article-card {
  background: var(--bg-secondary);
}

body.dark .widget-search-box,
body.dark .banner-search {
  background: rgba(255,255,255,0.1);
}

/* ── 文章详情弹窗 ── */
.article-detail-cover {
  width: calc(100% + 56px);
  margin: -24px -28px 16px;
  height: 200px;
  background: var(--bg-secondary) center / cover no-repeat;
  border-radius: var(--radius) var(--radius) 0 0;
  flex-shrink: 0;
}

.article-detail-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.article-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.article-detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2999;
}

.article-detail-overlay.open {
  display: block;
}

.article-detail {
  display: none;
  position: fixed;
  top: 5vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  width: 800px;
  max-width: 92vw;
  max-height: 90vh;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  flex-direction: column;
}

.article-detail.open {
  display: flex;
}

.article-detail-header {
  position: relative;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.article-detail-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
  padding-right: 36px;
  line-height: 1.4;
}

.article-detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.article-detail-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.article-detail-close:hover {
  background: #e74c3c;
  color: #fff;
  transform: scale(1.1);
}

.article-detail-body {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
  line-height: 1.8;
  font-size: 0.95rem;
  color: var(--text);
}

.article-detail-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text);
}

.article-detail-body h3:first-child {
  margin-top: 0;
}

.article-detail-body p {
  margin-bottom: 12px;
}

.article-detail-body ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 12px;
}

.article-detail-body li {
  margin-bottom: 6px;
  line-height: 1.7;
}

.article-detail-body strong {
  font-weight: 600;
}

.article-detail-body .MathJax {
  font-size: 1.05em;
}

.article-detail-body mjx-container[display="true"] {
  margin: 16px 0 !important;
  text-align: center !important;
}

body.dark .article-detail {
  background: var(--bg-card);
}

body.dark .article-detail-body {
  color: var(--text);
}

/* ── 响应式 ── */
@media (max-width: 1024px) {
  .content-wrapper {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .banner {
    height: 34vh;
    min-height: 220px;
  }
  .navbar {
    padding: 12px 20px 0;
  }
  .banner-actions {
    right: 16px;
    top: 14px;
    gap: 8px;
  }
  .banner-search input {
    width: 100px;
  }
  .change-bg-btn {
    right: 16px;
    bottom: 12px;
  }
  .nav-menu {
    display: none;
  }
  .main-content {
    padding: 24px 16px 40px;
  }
  .content-wrapper {
    grid-template-columns: 1fr;
  }
  .sidebar {
    grid-template-columns: 1fr;
  }
  .article-card {
    grid-template-columns: 1fr;
  }
  .article-thumbnail img {
    height: 180px;
  }
  .search-results {
    width: 90vw;
  }
}

@media (max-width: 480px) {
  .banner {
    min-height: 200px;
  }
  .banner-search input {
    width: 80px;
    font-size: 0.82rem;
  }
  .articles-section {
    padding: 18px;
  }
}

/* ===== 页面头栏（发文页等） ===== */
.page-header {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-header .navbar {
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
}

.page-header .nav-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 40px;
}

.page-header .nav-logo {
  font-size: 1.6rem;
  color: var(--primary);
}

.page-header .nav-menu {
  display: flex;
  gap: 28px;
  flex: 1;
}

.page-header .nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 0;
  position: relative;
}

.page-header .nav-link:hover,
.page-header .nav-link.active {
  color: var(--primary);
}

.page-header .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.page-header .nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* ===== 发文页 ===== */
.publish-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 40px 60px;
}

.publish-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.publish-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.publish-heading {
  font-size: 1.5rem;
  font-weight: 700;
}

.publish-actions {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 8px 22px;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-preview {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.btn-preview:hover {
  background: var(--border);
  color: var(--text);
}

/* ===== 封面上传 ===== */
.cover-upload {
  position: relative;
  width: 100%;
  height: 160px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.25s, background 0.25s;
}

.cover-upload:hover {
  border-color: var(--primary);
  background: rgba(90, 173, 138, 0.03);
}

.cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cover-placeholder i {
  font-size: 2rem;
}

.cover-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.cover-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  z-index: 2;
  transition: background 0.2s;
}

.cover-remove:hover {
  background: rgba(0,0,0,0.7);
}

/* ===== 标题/副标题输入 ===== */
.publish-title-input {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--border);
  padding: 12px 4px 10px;
  font-size: 1.6rem;
  font-weight: 700;
  outline: none;
  background: transparent;
  color: var(--text);
  transition: border-color 0.25s;
}

.publish-title-input:focus {
  border-color: var(--primary);
}

.publish-title-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.publish-subtitle-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 8px 4px;
  font-size: 1rem;
  outline: none;
  background: transparent;
  color: var(--text-secondary);
  transition: border-color 0.25s;
}

.publish-subtitle-input:focus {
  border-color: var(--primary);
}

.publish-subtitle-input::placeholder {
  color: var(--text-muted);
}

/* ── 编辑器底部（封面+分类/标签左右布局）── */
.publish-cover-meta {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.publish-cover-meta .cover-upload {
  width: 240px;
  height: 160px;
  flex-shrink: 0;
}

.publish-meta-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* ===== 分类与标签 ===== */
.publish-meta-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.meta-group {
  flex: 1;
  min-width: 200px;
}

.meta-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.meta-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.25s;
}

.meta-select:focus {
  border-color: var(--primary);
}

.tag-editor {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  transition: border-color 0.25s;
}

.tag-editor:focus-within {
  border-color: var(--primary);
}

.tag-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 0.9rem;
  padding: 4px 0;
  background: transparent;
  color: var(--text);
}

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

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.editor-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(90, 173, 138, 0.12);
  color: var(--primary);
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 500;
}

.editor-tag .tag-remove {
  font-size: 0.65rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.editor-tag .tag-remove:hover {
  opacity: 1;
}

/* ===== 编辑器 ===== */
.editor-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-height: 480px;
}

.editor-pane {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.pane-title {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pane-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.editor-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  padding: 16px;
  font-size: 0.95rem;
  line-height: 1.7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: var(--text);
  background: transparent;
  min-height: 440px;
}

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

.preview-content {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  min-height: 440px;
}

/* ===== 发布按钮 ===== */
#publishBtn {
  padding: 8px 28px;
}

/* ===== 编辑器移动端适配 ===== */
@media (max-width: 900px) {
  .editor-wrapper {
    grid-template-columns: 1fr;
  }
  .editor-preview-pane {
    display: none;
  }
  .editor-wrapper.show-preview .editor-input-pane {
    display: none;
  }
  .editor-wrapper.show-preview .editor-preview-pane {
    display: flex;
  }
}

@media (max-width: 768px) {
  .publish-main {
    padding: 20px 16px 40px;
  }
  .page-header .navbar {
    padding: 0 16px;
  }
  .page-header .nav-menu {
    gap: 16px;
  }
  .publish-title-input {
    font-size: 1.25rem;
  }
  .publish-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .publish-cover-meta {
    flex-direction: column;
  }
  .publish-cover-meta .cover-upload {
    width: 100%;
  }
  .publish-meta-row {
    flex-direction: column;
  }
  .meta-group {
    min-width: unset;
  }
}

/* ===== 个人中心 ===== */
.profile-main {
  max-width: 600px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.profile-heading {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 40px;
}

.profile-avatar-section {
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
}

.profile-avatar-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid var(--border);
  transition: border-color 0.25s;
}

.profile-avatar-wrap:hover {
  border-color: var(--primary);
}

.profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-wrap input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  border-radius: 50%;
  font-size: 0;
}

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  z-index: 1;
}

.profile-avatar-wrap:hover .profile-avatar-overlay {
  opacity: 1;
}

.profile-avatar-overlay i {
  font-size: 1.3rem;
}

.profile-field {
  margin-bottom: 24px;
}

.profile-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.profile-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.25s;
  box-sizing: border-box;
}

.profile-input:focus {
  border-color: var(--primary);
}

.profile-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  background: var(--bg-card);
  color: var(--text);
  resize: vertical;
  transition: border-color 0.25s;
  font-family: inherit;
  box-sizing: border-box;
}

.profile-textarea:focus {
  border-color: var(--primary);
}

.profile-count {
  display: block;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.profile-actions {
  margin-top: 36px;
}

/* ===== 分类管理 ===== */
.profile-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.category-tree ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cat-tree-root {
  padding: 0;
}

.cat-tree-item {
  margin: 4px 0;
}

.cat-tree-children {
  padding-left: 28px !important;
  border-left: 1px solid var(--border);
  margin-left: 12px !important;
}

.cat-tree-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: background 0.2s;
}

.cat-tree-row:hover {
  background: var(--bg-secondary);
}

.cat-tree-name {
  font-size: 0.92rem;
  color: var(--text);
}

.cat-tree-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s;
}

.cat-tree-row:hover .cat-tree-actions {
  opacity: 1;
}

.cat-tree-actions button {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  transition: background 0.2s;
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.cat-tree-actions button:hover {
  background: var(--border);
  color: var(--text);
}

.cat-tree-actions .cat-delete-btn:hover {
  background: #e74c3c;
  color: #fff;
}

.cat-tree-actions .cat-add-child-btn:hover {
  background: var(--primary);
  color: #fff;
}

.category-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* 分类弹窗 */
.category-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-modal {
  background: var(--bg-card);
  border-radius: 12px;
  width: 460px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
}

.category-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.category-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.category-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 4px;
  line-height: 1;
}

.category-modal-body {
  padding: 20px 24px;
}

.category-modal-footer {
  padding: 0 24px 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ===== 文章详情页 ===== */
.article-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.article-page-container {
  max-width: 740px;
  margin: 0 auto;
}

.article-page-cover {
  width: 100%;
  height: 300px;
  border-radius: var(--radius);
  background: var(--bg-secondary) center / cover no-repeat;
  margin-bottom: 32px;
}

.article-page-body {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.article-page-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.article-page-title {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.article-page-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.article-page-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.article-page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* 分类下拉 */
.article-page-categories {
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
}

.article-page-categories .article-tag {
  cursor: pointer;
  user-select: none;
}

.category-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  z-index: 50;
  overflow: hidden;
}

.category-dropdown.open {
  display: block;
}

.category-dropdown-header {
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.category-dropdown-list {
  max-height: 300px;
  overflow-y: auto;
}

.category-dropdown-item {
  display: block;
  padding: 8px 14px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}

.category-dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

.category-dropdown-empty {
  padding: 14px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-page-content {
  line-height: 1.9;
  font-size: 1rem;
}

.article-page-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 36px 0 14px;
}

.article-page-content p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.article-page-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ===== 标签页 ===== */
.tags-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.tags-page-container {
  max-width: 740px;
  margin: 0 auto;
}

.tags-page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.tags-page-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 36px;
}

.tags-cloud-large {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.tag-item-large {
  padding: 8px 20px;
  font-size: 0.92rem;
}

.tags-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== 文章页响应式 ===== */
@media (max-width: 768px) {
  .article-page {
    padding: 24px 16px 60px;
  }
  .article-page-body {
    padding: 24px 20px;
  }
  .article-page-title {
    font-size: 1.4rem;
  }
  .article-page-cover {
    height: 200px;
  }
  .tags-page {
    padding: 32px 16px 60px;
  }
  .tags-page-title {
    font-size: 1.5rem;
  }
}

/* ===== 分类下拉菜单 ===== */
.dropdown-parent {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 8px 0;
  margin-top: 8px;
  z-index: 1000;
}

.dropdown-parent:hover .dropdown-menu,
.dropdown-menu.open {
  display: block;
}

.dropdown-header {
  padding: 6px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown-menu li a,
.dropdown-menu li.divider {
  display: block;
  padding: 8px 16px;
  font-size: 0.88rem;
  color: var(--text);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.dropdown-menu li a:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

.dropdown-menu li.divider {
  padding: 0;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.dropdown-loading {
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== 站点顶栏（无Banner） ===== */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-header .navbar {
  padding: 0 40px;
  background: transparent;
}

.site-header .nav-logo {
  color: var(--text);
  font-size: 1.5rem;
}

.site-header .nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.site-header .nav-link:hover,
.site-header .nav-link.active {
  color: var(--primary);
}

.site-header .nav-link.active::after {
  background: var(--primary);
}

@media (max-width: 768px) {
  .dropdown-menu {
    position: fixed;
    top: auto;
    left: 16px;
    right: 16px;
    min-width: auto;
  }
}
