/* ======================================
   富思路 - 个人博客样式
   配色：主色#0A3D91 / 辅助#D4A84B / 过渡#4A9D9D
   背景#FAF9F6 / 正文#1A1A1A / 辅助#6B6B6B
   ====================================== */

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

:root {
  --blue: #0A3D91;
  --blue-light: #1A5BAF;
  --gold: #D4A84B;
  --gold-light: #E8C87A;
  --teal: #4A9D9D;
  --teal-light: #6BB5B5;
  --category-business: #7C5CAA;
  --bg: #FAF9F6;
  --bg-warm: #F7F5F0;
  --text: #1A1A1A;
  --text-light: #6B6B6B;
  --text-faint: #A0A0A0;
  --border: #E8E5DF;
  --border-light: #F0EDE6;
  --card-hover: #F5F3EE;
  --white: #FFFFFF;
  --danger: #C0392B;
  --success: #27AE60;
  --sidebar-width: 240px;
  --font-title: 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', 'STSong', serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --transition: 0.2s ease;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--gold);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

::selection {
  background: rgba(10, 61, 145, 0.12);
  color: var(--text);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg);
  border-right: 1px solid var(--border);
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.sidebar-inner {
  padding: 36px 24px 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Logo */
.logo-area {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gold);
}

.logo-h {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.logo {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--blue);
  line-height: 1.2;
}

.slogan {
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  font-weight: 300;
}

/* Search Box */
.search-box {
  position: relative;
  margin-bottom: 24px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
  opacity: 0.6;
}

.search-box input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 61, 145, 0.08);
}

.search-box input::placeholder {
  color: var(--text-faint);
  opacity: 0.7;
}

/* Navigation */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.nav-item {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text);
  transition: color var(--transition), background-color var(--transition);
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  color: var(--gold);
  background-color: var(--card-hover);
}

.nav-item.active {
  color: var(--blue);
  font-weight: 500;
  background-color: rgba(10, 61, 145, 0.05);
}

/* Sidebar Intro */
.sidebar-intro {
  margin-bottom: 20px;
  flex: 1;
}

/* 导航分类色点 */
.nav-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  flex-shrink: 0;
  vertical-align: middle;
}


.sidebar-intro p {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 8px;
}

/* Sidebar Contact */
.sidebar-contact {
  padding-top: 16px;
  border-top: 1px solid var(--gold);
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  color: var(--text-light);
  transition: color var(--transition);
}

.contact-link:hover {
  color: var(--blue);
}

.contact-link svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* ---------- Main Content ---------- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  padding: 52px 72px;
  max-width: 900px;
}

/* Loading */
.loading {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 100px 0;
}

.loading-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  animation: loadingBounce 1.2s infinite ease-in-out;
}

.loading-dot:nth-child(1) { animation-delay: 0s; }
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingBounce {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.7); }
  40% { opacity: 1; transform: scale(1.1); }
}

/* ========== Article List ========== */
.article-list-header {
  margin-bottom: 36px;
}

.article-list-header h2 {
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

.article-list-header .category-desc {
  font-size: 0.84rem;
  color: var(--text-light);
  margin-top: 8px;
  line-height: 1.6;
}

.article-card {
  padding: 26px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform var(--transition), background-color var(--transition);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  margin: 0 -16px;
}

.article-card:hover {
  transform: translateY(-1px);
  background-color: var(--card-hover);
}

.article-card:last-child {
  border-bottom: none;
}

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

.article-card-cat {
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  background: var(--teal);
  color: var(--white);
  font-weight: 400;
  letter-spacing: 0.03em;
}

.article-card-cat.essay { background: var(--blue); }
.article-card-cat.insight { background: var(--teal); }
.article-card-cat.whisper { background: var(--gold); }
.article-card-cat.business { background: var(--category-business); }

.article-card-date {
  font-size: 0.78rem;
  color: var(--text-faint);
}

.article-card-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.55;
  transition: color var(--transition);
}

.article-card-title a {
  color: inherit;
}

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

.article-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-private {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  color: var(--gold);
  margin-left: 8px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 100px 0;
  color: var(--text-faint);
}

.empty-state h2 {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--text-light);
  margin-bottom: 12px;
  font-weight: 400;
}

.empty-state p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.empty-state .btn {
  margin-top: 20px;
}

/* ========== Article Detail ========== */
.article-detail {
  max-width: 750px;
}

/* 文章卡片容器 —— 百年孤独风格 */
.article-card-wrap {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  padding: 48px 44px 44px;
  margin-bottom: 32px;
}

.article-detail .back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 28px;
  cursor: pointer;
  transition: color var(--transition);
  padding: 4px 0;
}

.article-detail .back-link:hover {
  color: var(--blue);
}

/* 文章顶部 header —— 居中布局 */
.article-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid #E8E2D9;
}

.article-title {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--blue);
  line-height: 1.45;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

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

.article-cat a {
  font-size: 0.72rem;
  padding: 3px 12px;
  border-radius: var(--radius-sm);
  background: var(--teal);
  color: var(--white) !important;
  letter-spacing: 0.03em;
  transition: opacity var(--transition);
}

.article-cat.essay a { background: var(--blue); }
.article-cat.insight a { background: var(--teal); }
.article-cat.whisper a { background: var(--gold); }
.article-cat.business a { background: var(--category-business); }

.article-cat a:hover {
  opacity: 0.85;
}

.article-date {
  font-size: 0.82rem;
  color: #8A8A8A;
}

/* Article Body */
.article-body {
  font-size: 0.95rem;
  line-height: 2;
  color: #333;
  word-break: break-word;
}

.article-body p {
  margin-bottom: 1.5em;
  text-indent: 2em;
}

.article-body img {
  display: block;
  margin: 28px auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* 引用块 —— 金色左边框 */
.article-body blockquote {
  margin: 28px 0;
  padding: 20px 24px;
  border-left: 4px solid var(--gold);
  background: #F8F9FA;
  border-radius: 0 8px 8px 0;
  color: #555;
  font-style: italic;
  line-height: 1.9;
  text-indent: 0;
}

.article-body blockquote p {
  text-indent: 0;
  margin-bottom: 0;
}

.article-body h2,
.article-body h3 {
  font-family: var(--font-title);
  margin: 1.8em 0 0.8em;
  line-height: 1.4;
}

/* h2 带底边线 */
.article-body h2 {
  font-size: 1.2rem;
  color: var(--blue);
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 2px solid #E8E2D9;
}

.article-body h3 { font-size: 1.05rem; color: var(--text); font-weight: 600; }

.article-body code {
  background: var(--card-hover);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.88em;
  color: var(--blue);
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.article-body pre {
  background: #2D2D2D;
  color: #E0E0E0;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 18px 0;
  font-size: 0.84rem;
  line-height: 1.65;
}

.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.article-body ul,
.article-body ol {
  padding-left: 1.8em;
  margin-bottom: 1.2em;
  text-indent: 0;
}

.article-body li {
  margin-bottom: 0.6em;
  line-height: 1.9;
}

.article-body hr {
  border: none;
  border-top: 1px solid #E8E2D9;
  margin: 36px 0;
}

.article-body figure {
  max-width: 100%;
  margin: 24px auto;
  text-align: center;
}

.article-body figure img {
  margin: 0 auto 8px;
  box-shadow: var(--shadow-sm);
}

.article-body figcaption {
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* 文章结尾署名框 */
.article-sign-box {
  background: #F0F4F8;
  border: 1px solid rgba(212,168,75,0.4);
  border-radius: 10px;
  padding: 20px 24px;
  margin-top: 44px;
  font-size: 0.82rem;
  color: #888;
  text-align: center;
  line-height: 1.8;
}

/* Article Footer */
.article-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #E8E2D9;
}

/* ========== Comments ========== */
.comments-section {
  margin-top: 40px;
}

.comments-title {
  font-family: var(--font-title);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.comment-form {
  margin-bottom: 36px;
  background: var(--bg-warm);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.comment-form h4 {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 14px;
}

.comment-form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.comment-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.comment-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 61, 145, 0.08);
}

.comment-input::placeholder {
  color: var(--text-faint);
  opacity: 0.6;
}

.comment-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.comment-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 61, 145, 0.08);
}

.comment-textarea::placeholder {
  color: var(--text-faint);
  opacity: 0.6;
}

.comment-submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* Buttons */
.btn {
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.84rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--blue-light);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: var(--text-faint);
}

.comment-success {
  text-align: center;
  color: var(--success);
  font-size: 0.84rem;
  padding: 14px 18px;
  background: rgba(39, 174, 96, 0.06);
  border: 1px solid rgba(39, 174, 96, 0.15);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.comment-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border-light);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-item-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.comment-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.comment-item-time {
  font-size: 0.72rem;
  color: var(--text-faint);
}

.comment-item-content {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.65;
}

.no-comments {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.84rem;
  padding: 32px 0;
}

/* ========== About Page ========== */
.about-page {
  max-width: 640px;
}

.about-page h2 {
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
}

.about-content {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 24px;
}

.about-content p {
  margin-bottom: 1.2em;
}

.about-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 36px 0;
}

.about-contact-block {
  margin-top: 28px;
}

.about-contact-block h3 {
  font-family: var(--font-title);
  font-size: 1.08rem;
  color: var(--text);
  margin-bottom: 12px;
  font-weight: 600;
}

.about-contact-block p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.65;
}

.about-contact-block a {
  color: var(--blue);
  font-weight: 500;
}

.about-contact-block a:hover {
  color: var(--gold);
}

/* ========== Admin Panel ========== */
.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.admin-overlay.visible {
  display: flex;
}

.admin-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  animation: panelSlideIn 0.25s ease;
  position: relative;
}

@keyframes panelSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.admin-header h2 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.admin-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background-color var(--transition);
}

.admin-close:hover {
  color: var(--text);
  background: var(--card-hover);
}

.admin-login {
  padding: 48px 32px;
  text-align: center;
}

.admin-login-hint {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.admin-login input {
  width: 100%;
  max-width: 300px;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  margin-bottom: 16px;
  text-align: center;
  letter-spacing: 0.15em;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.admin-login input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 61, 145, 0.08);
}

.admin-setup-hint {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 14px;
  line-height: 1.6;
}

/* Admin Main Area */
.admin-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.admin-tabs {
  display: flex;
  gap: 0;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.admin-tab {
  padding: 12px 18px;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: var(--text-faint);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  font-weight: 400;
}

.admin-tab:hover {
  color: var(--text);
}

.admin-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 500;
}

.admin-tab-content {
  padding: 20px 28px;
  overflow-y: auto;
  flex: 1;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.admin-article-count {
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* Article List in Admin */
.admin-articles-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-article-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-warm);
  border-radius: var(--radius-md);
  transition: background var(--transition);
}

.admin-article-item:hover {
  background: var(--border-light);
}

.admin-article-info {
  flex: 1;
  min-width: 0;
}

.admin-article-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.admin-article-meta {
  font-size: 0.72rem;
  color: var(--text-faint);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-article-cat {
  padding: 1px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  background: var(--teal);
  color: var(--white);
}

.admin-article-private-badge {
  color: var(--gold);
  font-size: 0.72rem;
}

.admin-article-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 12px;
}

.admin-btn-sm {
  padding: 4px 12px;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-light);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition);
}

.admin-btn:hover {
  background: var(--card-hover);
}

.admin-btn-sm.danger {
  color: var(--danger);
  border-color: rgba(192, 57, 43, 0.25);
}

.admin-btn-sm.danger:hover {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

/* Comment List */
.admin-comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-comment-item {
  padding: 14px 16px;
  background: var(--bg-warm);
  border-radius: var(--radius-md);
}

.admin-comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.72rem;
  color: var(--text-faint);
  flex-wrap: wrap;
  gap: 6px;
}

.admin-comment-article {
  font-weight: 500;
  color: var(--blue);
}

.admin-comment-body {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 10px;
}

.admin-comment-actions {
  display: flex;
  gap: 8px;
}

.admin-btn-sm.approve {
  color: var(--success);
  border-color: rgba(39, 174, 96, 0.25);
}

.admin-btn-sm.approve:hover {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
}

.admin-btn-sm.reject {
  color: var(--danger);
  border-color: rgba(192, 57, 43, 0.25);
}

.admin-btn-sm.reject:hover {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

.admin-empty {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
  padding: 40px 0;
}

/* Admin Footer */
.admin-footer {
  padding: 14px 28px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.admin-logout-btn {
  display: block;
  width: 100%;
}

/* ========== Article Editor ========== */
.admin-editor {
  display: none;
  background: var(--white);
  flex-direction: column;
}

.admin-editor.active {
  display: flex;
  flex: 1;
  min-height: 0;
}

.admin-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 2;
}

.admin-editor-header h3 {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.admin-editor-close {
  font-size: 1.3rem;
}

.admin-editor-body {
  padding: 24px 28px;
  padding-bottom: 32px;
  overflow-y: auto;
  flex: 1;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.admin-form-group {
  margin-bottom: 18px;
}

.admin-form-group label {
  display: block;
  font-size: 0.76rem;
  color: var(--text-light);
  margin-bottom: 7px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.admin-form-row {
  display: flex;
  gap: 14px;
}

.admin-form-row .admin-form-group {
  flex: 1;
}

.admin-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.admin-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 61, 145, 0.08);
}

.admin-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.admin-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 61, 145, 0.08);
}

.admin-content-editor {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.84rem;
  line-height: 1.65;
  max-height: 320px;
  overflow-y: auto;
}

.admin-form-bottom {
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
  color: var(--text);
  cursor: pointer;
}

.admin-checkbox-label input[type="checkbox"] {
  accent-color: var(--blue);
  width: 16px;
  height: 16px;
}

.admin-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.admin-form-hint {
  font-size: 0.74rem;
  color: var(--text-faint);
  margin-bottom: 10px;
  line-height: 1.5;
}

.admin-save-status {
  font-size: 0.8rem;
  margin-left: 12px;
}

/* ========== Editor Toolbar ========== */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.editor-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-family: var(--font-body);
  color: var(--text-light);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.editor-toolbar-btn:hover {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--white);
}

.editor-toolbar-hint {
  font-size: 0.7rem;
  color: var(--text-faint);
  margin-left: auto;
  opacity: 0.6;
}

/* ========== Image Modal ========== */
.editor-image-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.editor-image-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.12);
}

.editor-image-modal-box {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 92%;
  max-width: 440px;
  box-shadow: var(--shadow-md);
  z-index: 21;
}

.editor-image-modal-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 18px;
}

.editor-image-modal-alt {
  margin-top: 14px;
}

.editor-image-modal-alt label {
  display: block;
  font-size: 0.76rem;
  color: var(--text-light);
  margin-bottom: 6px;
  font-weight: 500;
}

.editor-image-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Upload progress */
.editor-upload-progress {
  padding: 4px 0;
  font-size: 0.72rem;
  color: var(--blue);
}

/* ========== Admin Entry (bottom corner) ========== */
.admin-entry {
  position: fixed;
  bottom: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.7rem;
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  opacity: 0.35;
}

.admin-entry:hover {
  opacity: 1;
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: var(--shadow-sm);
}

/* ========== Admin Category Management ========== */
.admin-categories-list {
  max-height: 400px;
  overflow-y: auto;
}

.admin-category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.admin-category-item:last-child {
  border-bottom: none;
}

.admin-category-item:hover {
  background: var(--card-hover);
}

.admin-category-info {
  flex: 1;
  min-width: 0;
}

.admin-category-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.admin-category-key {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-faint);
  background: var(--card-hover);
  padding: 1px 8px;
  border-radius: var(--radius-sm);
  margin-left: 8px;
  font-family: 'Consolas', 'Monaco', monospace;
}

.admin-category-desc {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 3px;
}

.admin-category-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 12px;
}

.admin-category-editor {
  background: var(--bg-warm);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 18px;
}

.admin-category-editor h4 {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 14px;
}

/* ========== Admin About Editor ========== */
.admin-about-editor {
  /* reuses admin-textarea etc. */
}

/* ========== Mobile Toggle ========== */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 150;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  cursor: pointer;
  width: 38px;
  height: 38px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  box-shadow: var(--shadow-sm);
}

.mobile-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s ease;
}

.sidebar-overlay {
  display: none;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .mobile-toggle {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    box-shadow: var(--shadow-md);
    background: var(--white);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 99;
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 60px 20px 48px;
    max-width: 100%;
  }

  .article-detail-title {
    font-size: 1.4rem;
  }

  .article-card-wrap {
    padding: 32px 24px 32px;
  }

  .article-card-title {
    font-size: 1.05rem;
  }

  .admin-panel {
    width: 96%;
    max-height: 92vh;
  }

  .admin-editor-body {
    padding: 18px 16px;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 56px 14px 36px;
  }

  .article-detail-title {
    font-size: 1.25rem;
  }

  .article-title {
    font-size: 1.4rem;
  }

  .article-card-wrap {
    padding: 24px 16px 24px;
    border-radius: 8px;
  }

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

  .admin-tabs {
    padding: 0 14px;
  }

  .admin-tab {
    padding: 10px 10px;
    font-size: 0.78rem;
  }

  .admin-tab-content {
    padding: 16px 14px;
  }
}

/* Utility: hide loading */
.loading.hidden {
  display: none;
}

/* Print styles */
@media print {
  .sidebar, .mobile-toggle, .admin-entry, .comment-form, .btn {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
}

/* ==================== 标签云 ==================== */
.tag-cloud {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.tag-cloud-title {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag-cloud-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-item {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid;
}

.tag-item:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}

.tag-cloud-empty {
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ==================== 文章内标签 ==================== */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.article-tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid;
}

.article-tag:hover {
  opacity: 0.82;
}
