/* =========================================
   博客全局样式 - 深色主题
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&family=Noto+Serif+SC:wght@400;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #242424;
  --border: #2e2e2e;
  --border-light: #383838;
  --text-primary: #e8e8e8;
  --text-secondary: #888;
  --text-muted: #555;
  --accent: #c9a96e;
  --accent-hover: #e0bd82;
  --accent-dim: rgba(201, 169, 110, 0.15);
  --danger: #e05555;
  --danger-hover: #e87070;
  --success: #5baa7a;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --max-w: 860px;
  --sidebar-w: 240px;
  --font-sans: "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-serif: "Noto Serif SC", Georgia, serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  --transition: 180ms ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

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

img { max-width: 100%; }

button {
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  outline: none;
}

input, textarea, select {
  font-family: var(--font-sans);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 14px;
  transition: border-color var(--transition);
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- Header ---------- */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.header-inner {
  max-width: calc(var(--max-w) + var(--sidebar-w) + 80px);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.header-logo {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.header-logo span { color: var(--accent); }
.header-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.header-nav a {
  color: var(--text-secondary);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.header-nav a:hover, .header-nav a.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}
.header-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Layout ---------- */
.page-wrapper {
  max-width: calc(var(--max-w) + var(--sidebar-w) + 80px);
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 48px;
  align-items: start;
}

/* ---------- Main Content ---------- */
.main { min-width: 0; }

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: 84px; }
.sidebar-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.sidebar-card h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}
.sidebar-author {
  text-align: center;
}
.sidebar-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #8a6a3a 100%);
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: #fff;
  font-weight: 700;
}
.sidebar-author-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.sidebar-author-bio {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.sidebar-cat-list { list-style: none; }
.sidebar-cat-list li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}
.sidebar-cat-list li:last-child a { border-bottom: none; }
.sidebar-cat-list li a:hover { color: var(--accent); }
.sidebar-cat-count {
  font-size: 12px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: 10px;
}

/* ---------- Tags ---------- */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.tag:hover {
  background: var(--accent);
  color: var(--bg-primary);
}
.tag.active {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ---------- Article List ---------- */
.articles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.articles-header h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
}
.search-box {
  display: flex;
  gap: 8px;
  align-items: center;
}
.search-box input { width: 200px; padding: 7px 12px; }
.search-box button {
  padding: 7px 14px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: var(--radius);
  font-size: 13px;
  transition: all var(--transition);
}
.search-box button:hover { background: var(--border); color: var(--text-primary); }

.article-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  transition: all var(--transition);
  animation: fadeSlideIn 300ms ease-out both;
}
.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
  box-shadow: var(--shadow);
}
.article-card-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}
.article-card-title a { color: var(--text-primary); }
.article-card-title a:hover { color: var(--accent); }
.article-card-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.article-card-meta .sep { color: var(--border-light); }
.article-card-cat {
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}

/* ---------- Empty ---------- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h2 { font-size: 18px; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state p { font-size: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--bg-primary); }
.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-light); color: var(--text-primary); }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

/* ---------- Post Page ---------- */
.post-header { margin-bottom: 36px; }
.post-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.post-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.post-meta .cat-badge {
  color: var(--accent);
  font-weight: 500;
  background: var(--accent-dim);
  padding: 2px 10px;
  border-radius: 20px;
}
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.post-divider {
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}

/* ---------- Markdown Content ---------- */
.md-content {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-primary);
}
.md-content h1, .md-content h2, .md-content h3, .md-content h4 {
  font-family: var(--font-serif);
  margin: 1.8em 0 0.8em;
  line-height: 1.4;
  color: var(--text-primary);
}
.md-content h1 { font-size: 28px; }
.md-content h2 { font-size: 22px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.md-content h3 { font-size: 18px; }
.md-content p { margin-bottom: 1.2em; }
.md-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.md-content strong { font-weight: 700; color: var(--text-primary); }
.md-content em { font-style: italic; }
.md-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5em 0;
  padding: 10px 20px;
  background: var(--bg-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
  font-style: italic;
}
.md-content ul, .md-content ol {
  margin: 1em 0 1.2em;
  padding-left: 24px;
}
.md-content li { margin-bottom: 4px; }
.md-content code {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13.5px;
  color: #e5c07b;
  border: 1px solid var(--border);
}
.md-content pre {
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 1.5em 0;
}
.md-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.6;
}
.md-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 14px;
}
.md-content th, .md-content td {
  border: 1px solid var(--border);
  padding: 8px 14px;
  text-align: left;
}
.md-content th { background: var(--bg-secondary); font-weight: 600; }
.md-content tr:nth-child(even) { background: var(--bg-secondary); }
.md-content img {
  border-radius: var(--radius);
  margin: 1em 0;
}
.md-content hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

/* highlight.js theme (dark) */
.hljs { background: transparent !important; }
.hljs-keyword { color: #c678dd; }
.hljs-string { color: #98c379; }
.hljs-number { color: #d19a66; }
.hljs-comment { color: #5c6370; font-style: italic; }
.hljs-function { color: #61afef; }
.hljs-title { color: #61afef; }
.hljs-built_in { color: #e6c07b; }
.hljs-type { color: #e6c07b; }
.hljs-attr { color: #d19a66; }
.hljs-variable { color: #e06c75; }
.hljs-literal { color: #56b6c2; }
.hljs-meta { color: #61afef; }

/* ---------- Comments ---------- */
.comments-section { margin-top: 48px; }
.comments-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.comments-title .count {
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 400;
}
.comment-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}
.comment-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.comment-form-row.full { grid-template-columns: 1fr; }
.comment-form textarea {
  resize: vertical;
  min-height: 90px;
}
.comment-list { }
.comment-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  animation: fadeSlideIn 300ms ease-out both;
}
.comment-item:last-child { border-bottom: none; }
.comment-item.nested { margin-left: 32px; padding-left: 16px; border-left: 2px solid var(--border); border-bottom: none; margin-top: 8px; }
.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.comment-author {
  display: flex; align-items: center; gap: 8px;
}
.comment-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.comment-avatar.admin { background: var(--accent); color: var(--bg-primary); }
.comment-nickname {
  font-weight: 600;
  font-size: 14px;
}
.comment-nickname.admin-tag::after {
  content: '博主';
  margin-left: 6px;
  font-size: 11px;
  background: var(--accent);
  color: var(--bg-primary);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 500;
}
.comment-time { font-size: 12px; color: var(--text-muted); }
.comment-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  padding-left: 40px;
}
.comment-actions {
  padding-left: 40px;
  margin-top: 8px;
  display: flex; gap: 8px;
}
.comment-actions .btn-ghost { font-size: 12px; padding: 3px 8px; }

/* ---------- Admin ---------- */
.admin-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
}

.post-editor-wrap {
  max-width: 1045px; /* 缩小5% */
  margin: 0 auto;
  padding: 40px 24px;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.admin-header h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
}
.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.admin-tab {
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  background: none;
  border-top: none; border-left: none; border-right: none;
}
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-panel { }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.admin-table th, .admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.admin-table th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-tertiary); }
.admin-table td.title-cell { max-width: 280px; }
.admin-table td.title-cell .title-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-primary);
}
.admin-table .actions { display: flex; gap: 6px; }

/* ---------- Editor ---------- */
.editor-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.editor-toolbar {
  display: flex;
  gap: 2px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
  flex-wrap: wrap;
  align-items: center;
}
.editor-toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.toolbar-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-sans);
  font-weight: 700;
  transition: all var(--transition);
}
.toolbar-btn:hover { background: var(--border); color: var(--text-primary); }
.toolbar-btn svg { width: 16px; height: 16px; pointer-events: none; }
.editor-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 400px;
}
.editor-body.single { grid-template-columns: 1fr; }
.editor-body.single .editor-preview { display: none; }
.editor-pane {
  display: flex;
  flex-direction: column;
}
.editor-pane-header {
  padding: 6px 12px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.editor-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  padding: 16px;
  resize: none;
  outline: none;
  min-height: 400px;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}
.editor-preview {
  border-left: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
  background: var(--bg-primary);
  max-height: calc(100vh - 300px);
}

/* ---------- Form / Modal ---------- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 200ms ease;
}
.modal-lg { max-width: 760px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h2 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ---------- Auth Pages ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}
.auth-logo p { font-size: 13px; color: var(--text-muted); }
.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  background: none;
  border-top: none; border-left: none; border-right: none;
}
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-error {
  background: rgba(224, 85, 85, 0.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 16px;
}

/* ---------- Toast / Notification ---------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toastIn 200ms ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 300px;
}
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.info { border-color: var(--accent); color: var(--accent); }

/* ---------- Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

/* ---------- Utilities ---------- */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ---------- Animations ---------- */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ---------- 密码重置页面 ---------- */
.info-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
}

.info-box h3 {
  margin-bottom: 12px;
  color: var(--accent);
}

.info-box ul, .info-box ol {
  margin: 12px 0 12px 20px;
}

.info-box li {
  margin-bottom: 6px;
}

.code-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
  overflow-x: auto;
}

.code-block h4 {
  margin-bottom: 12px;
  color: var(--accent);
}

.code-block pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
}

.code-block code {
  color: var(--text-primary);
}

.auth-success {
  background: rgba(91, 170, 122, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.form-help {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .page-wrapper {
    grid-template-columns: 1fr;
    padding: 20px 16px 60px;
    gap: 24px;
  }
  .sidebar { position: static; display: none; }
  .form-row { grid-template-columns: 1fr; }
  .comment-form-row { grid-template-columns: 1fr; }
  .editor-body { grid-template-columns: 1fr; }
  .editor-preview { display: none; }
  .header-nav { display: none; }
  .post-title { font-size: 24px; }
  .admin-table { font-size: 13px; }
  .admin-table td.title-cell { max-width: 160px; }
  
  .code-block {
    font-size: 12px;
    padding: 12px;
  }
}

/* =========================================
   认证页面样式
   ========================================= */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

.auth-form {
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

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

.form-help {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-actions {
  margin-top: 32px;
}

.btn-block {
  width: 100%;
}

.auth-links {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.auth-links a {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

.auth-links a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.auth-links a:last-child {
  margin-bottom: 0;
}

.message {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-top: 16px;
  font-size: 14px;
  display: none;
}

.message-info {
  background: rgba(201, 169, 110, 0.1);
  border: 1px solid var(--accent);
  color: var(--accent);
}

.message-success {
  background: rgba(91, 170, 122, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.message-error {
  background: rgba(224, 85, 85, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* 响应式设计 */
@media (max-width: 480px) {
  .auth-card {
    padding: 30px 24px;
  }
  
  .auth-header h1 {
    font-size: 24px;
  }
  
  .auth-subtitle {
    font-size: 14px;
  }
}

/* =========================================
   运行时间显示样式
   ========================================= */

.uptime-container {
  text-align: center;
  padding: 20px 0;
  margin-top: 40px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.uptime-privacy-row {
  margin-bottom: 10px;
}

.uptime-privacy-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.uptime-privacy-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* =========================================
   缩放相关样式
   ========================================= */

/* 缩放级别指示器 */
.zoom-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.zoom-info:hover {
  opacity: 1;
}

/* 缩放级别特定的样式 */
body.zoom-small .post-content {
  font-size: 14.5px !important;
}

body.zoom-large .post-content {
  font-size: 15.5px !important;
  line-height: 1.8 !important;
}

body.zoom-very-large .post-content {
  font-size: 16px !important;
  line-height: 2 !important;
}

/* 缩放时的图片优化 */
body.zoom-small img,
body.zoom-large img,
body.zoom-very-large img {
  max-width: 100% !important;
  height: auto !important;
}

/* 缩放时的代码块优化 */
body.zoom-small .code-block,
body.zoom-large .code-block,
body.zoom-very-large .code-block {
  font-size: 13px !important;
  padding: 15px !important;
  overflow-x: auto !important;
}

/* 缩放时的表格优化 */
body.zoom-small table,
body.zoom-large table,
body.zoom-very-large table {
  display: block !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
}

/* 缩放时的侧边栏优化 */
body.zoom-small .sidebar,
body.zoom-large .sidebar,
body.zoom-very-large .sidebar {
  position: static !important;
}

@media (max-width: 768px) {
  .zoom-info {
    font-size: 11px;
  }
}

.blog-info {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.uptime-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.uptime-label {
  color: var(--text-secondary);
}

.uptime-text {
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 2px 6px;
  background: var(--accent-dim);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.uptime-pulse {
  animation: uptime-pulse 1s ease-in-out;
}

@keyframes uptime-pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.uptime-suffix {
  color: var(--text-muted);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .uptime-container {
    padding: 16px 0;
    margin-top: 30px;
    font-size: 13px;
  }
  
  .blog-info {
    font-size: 12px;
    margin-bottom: 6px;
  }
  
  .uptime-text {
    font-size: 14px;
  }
  
  .uptime-row {
    flex-direction: column;
    gap: 2px;
  }
}
