/* ============================================================
   水稻博客 - 全局样式（简洁版）
   ============================================================ */

:root {
  /* 品牌色（温润陶土橙，克制不喧哗） */
  --primary: #c2542e;
  --primary-dark: #a84520;
  --primary-light: #f7ece5;

  /* 中性色（暖白基调） */
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-2: #f3f1ee;
  --border: #eae6e0;
  --text: #26231f;
  --text-2: #6d675f;
  --text-3: #a29b92;

  /* 功能色 */
  --success: #3e7d5a;
  --warning: #b07d2b;
  --danger: #c2542e;
  --info: #3b6ea5;

  /* 阴影（极轻，仅浮层使用） */
  --shadow-sm: 0 1px 2px rgba(30, 26, 22, .04);
  --shadow-md: 0 6px 20px rgba(30, 26, 22, .08);
  --shadow-lg: 0 16px 40px rgba(30, 26, 22, .12);

  /* 圆角 */
  --radius: 10px;
  --radius-sm: 6px;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", Consolas, "Courier New", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 780px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap; line-height: 1.4;
}

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

.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

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

.btn-danger-outline { background: transparent; color: var(--danger); border-color: #e4c3b4; }
.btn-danger-outline:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-sm { padding: 5px 13px; font-size: 13px; }
.btn-xs { padding: 3px 9px; font-size: 12px; }
.btn-block { width: 100%; }

/* ============ 顶部导航 ============ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}

.header-inner {
  display: flex; align-items: center; gap: 28px;
  height: 60px;
}

.logo {
  font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.3px;
}
.logo-dot { color: var(--primary); }
.logo:hover { color: var(--text); }

.main-nav { display: flex; gap: 2px; flex: 1; }
.main-nav a {
  padding: 7px 13px; border-radius: var(--radius-sm); color: var(--text-2);
  font-weight: 500; font-size: 14px;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a.active { color: var(--primary); background: var(--primary-light); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.avatar-sm, .avatar-xs, .avatar-md {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 700; border-radius: 50%; flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 14px; }
.avatar-xs { width: 22px; height: 22px; font-size: 11px; }
.avatar-md { width: 44px; height: 44px; font-size: 18px; }

/* 用户下拉菜单 */
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--text);
  font-size: 14px; font-weight: 500; padding: 6px 10px;
  border-radius: var(--radius-sm); transition: background .15s;
}
.user-btn:hover { background: var(--surface-2); }

.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 150px; padding: 6px; display: none; z-index: 50;
}
.user-dropdown.show { display: block; animation: fadeIn .15s ease; }
.user-dropdown a {
  display: block; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px;
}
.user-dropdown a:hover { background: var(--surface-2); color: var(--text); }

.nav-toggle {
  display: none; background: none; border: none;
  width: 40px; height: 40px; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span {
  display: block; width: 20px; height: 2px; background: var(--text);
  border-radius: 2px; transition: .25s;
}

/* ============ Flash 消息 ============ */
.flash-container {
  position: fixed; top: 74px; left: 50%; transform: translateX(-50%);
  z-index: 200; width: min(480px, 92vw);
}
.flash {
  padding: 12px 40px 12px 16px; border-radius: var(--radius);
  box-shadow: var(--shadow-md); font-size: 14px; position: relative;
  animation: slideDown .3s ease;
}
.flash-success { background: #eef5f0; color: #2e5f44; border: 1px solid #d5e6dc; }
.flash-error { background: #faf0ec; color: #8f3d20; border: 1px solid #efd6c8; }
.flash-info { background: #eef4fa; color: #2c5a83; border: 1px solid #d5e3f0; }
.flash-close {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: 18px; color: inherit; opacity: .6;
}
.flash-close:hover { opacity: 1; }

/* ============ Hero ============ */
.hero {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 56px 0 44px;
  text-align: center;
}
.hero-title {
  font-size: 34px; font-weight: 800; letter-spacing: -0.5px; color: var(--text);
}
.hero-sub { color: var(--text-2); margin: 12px auto 26px; font-size: 15px; }

.hero-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 6px 6px 18px;
  max-width: 500px; margin: 0 auto;
}
.hero-search .search-icon { color: var(--text-3); flex-shrink: 0; }
.hero-search input {
  flex: 1; border: none; outline: none; font-size: 15px; background: transparent; padding: 6px 0;
}

/* ============ 页面布局 ============ */
.page-layout {
  display: grid; grid-template-columns: 1fr 290px;
  gap: 32px; padding-top: 28px; padding-bottom: 56px;
  align-items: start;
}

.content-main { min-width: 0; }

/* 分类标签 */
.category-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px;
}
.tab {
  padding: 6px 15px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text-2); font-size: 13px; font-weight: 500;
  transition: all .15s;
}
.tab:hover { border-color: var(--primary); color: var(--primary); }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.search-hint { color: var(--text-2); font-size: 14px; margin-bottom: 16px; }

/* ============ 文章卡片 ============ */
.post-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}

.post-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .2s ease;
  display: flex; flex-direction: column;
}
.post-card:hover { border-color: #d8d2c9; }

.post-cover { aspect-ratio: 16/9; overflow: hidden; background: var(--surface-2); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }

.post-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }

.post-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.post-category {
  background: var(--primary-light); color: var(--primary);
  padding: 2px 10px; border-radius: 999px; font-weight: 600; font-size: 12px;
}
.post-category:hover { background: var(--primary); color: #fff; }
.post-date, .post-views { color: var(--text-3); }

.post-title { font-size: 18px; line-height: 1.5; margin-bottom: 10px; font-weight: 700; }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--primary); }

.post-excerpt { color: var(--text-2); font-size: 14px; flex: 1; margin-bottom: 14px; }

.post-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.post-author { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }

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

.widget {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
}
.widget-title {
  font-size: 14px; font-weight: 700; margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 2px solid var(--border);
  display: block;
}

.widget-list { list-style: none; }
.widget-list li { padding: 6px 0; }

.hot-list li { display: flex; align-items: center; gap: 10px; }
.rank {
  width: 22px; height: 22px; border-radius: var(--radius-sm); background: var(--surface-2);
  color: var(--text-2); font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rank-top { background: var(--primary); color: #fff; }
.hot-list a, .cat-list a { color: var(--text-2); font-size: 14px; }
.hot-list a:hover, .cat-list a:hover { color: var(--primary); }

.cat-list li { display: flex; justify-content: space-between; align-items: center; }
.cat-count {
  background: var(--surface-2); color: var(--text-3);
  font-size: 12px; padding: 1px 8px; border-radius: 999px;
}

.comment-text { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.comment-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.comment-meta a { color: var(--text-3); }
.comment-meta a:hover { color: var(--primary); }

/* ============ 文章详情 ============ */
.narrow { padding-top: 36px; padding-bottom: 56px; }

.post-detail {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px 44px;
}

.post-header { margin-bottom: 26px; }
.post-title-lg {
  font-size: 28px; font-weight: 800; line-height: 1.4;
  margin: 12px 0 16px; letter-spacing: -0.3px;
}

.post-author-row { display: flex; align-items: center; gap: 12px; }
.post-author-name { font-weight: 600; font-size: 14px; }
.post-author-role { font-size: 12px; color: var(--text-3); }

.post-hero-img {
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 26px; border: 1px solid var(--border);
}
.post-hero-img img { width: 100%; }

/* 正文排版 */
.post-content { font-size: 15.5px; color: var(--text); line-height: 1.9; }
.post-content h2 {
  font-size: 22px; font-weight: 700; margin: 34px 0 14px;
  padding-left: 12px; border-left: 3px solid var(--primary);
}
.post-content h3 { font-size: 18px; font-weight: 700; margin: 26px 0 12px; }
.post-content p { margin-bottom: 18px; }
.post-content ul, .post-content ol { margin: 0 0 18px 24px; }
.post-content li { margin-bottom: 6px; }
.post-content a { text-decoration: underline; text-underline-offset: 3px; }
.post-content code {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 7px; font-family: var(--font-mono);
  font-size: 13.5px; color: #8a4a2a;
}
.post-content pre {
  background: #2b2a28; color: #e8e6e2; border-radius: var(--radius);
  padding: 18px 20px; overflow-x: auto; margin-bottom: 18px;
}
.post-content pre code { background: none; border: none; color: inherit; padding: 0; font-size: 13.5px; }
.post-content blockquote {
  border-left: 3px solid var(--primary); background: var(--primary-light);
  padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 18px; color: #6d4634;
}
.post-content img { border-radius: var(--radius); margin: 10px 0; }
.post-content table {
  width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 14px;
}
.post-content th, .post-content td {
  border: 1px solid var(--border); padding: 10px 14px; text-align: left;
}
.post-content th { background: var(--surface-2); font-weight: 600; }

.post-tags { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); }
.tag {
  display: inline-block; background: var(--surface-2); color: var(--text-2);
  padding: 4px 13px; border-radius: 999px; font-size: 13px; margin-right: 8px;
}
.tag:hover { background: var(--primary-light); color: var(--primary); }

/* 上下篇 */
.post-pager {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border);
}
.pager-item {
  flex: 1; background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 13px 16px; color: var(--text); transition: background .15s;
}
.pager-item:hover { background: var(--primary-light); color: var(--primary); }
.pager-item.right { text-align: right; }
.pager-item.disabled { opacity: .4; pointer-events: none; }
.pager-label { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.pager-title { font-size: 14px; font-weight: 600; }

/* ============ 评论 ============ */
.comments {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 44px; margin-top: 24px;
}
.comments-title { font-size: 18px; font-weight: 700; margin-bottom: 18px; }
.count-badge {
  background: var(--primary); color: #fff; font-size: 12px;
  padding: 2px 10px; border-radius: 999px; vertical-align: 2px;
}

.comment-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; resize: vertical; min-height: 90px; outline: none;
  transition: border-color .15s;
}
.comment-form textarea:focus { border-color: var(--primary); }
.comment-form-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px;
}
.comment-as { font-size: 13px; color: var(--text-3); }

.comment-login-tip {
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; color: var(--text-2); font-size: 14px;
  display: flex; justify-content: center; align-items: center; gap: 14px;
}

.comment-list { margin-top: 22px; }
.comment-item {
  display: flex; gap: 12px; padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.comment-author { font-weight: 600; font-size: 14px; }
.comment-time { font-size: 12px; color: var(--text-3); }
.comment-content { font-size: 14.5px; color: var(--text); }
.no-comments { color: var(--text-3); font-size: 14px; text-align: center; padding: 20px 0; }

/* ============ 分页 ============ */
.pagination { margin-top: 32px; }
.pagination-inner { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.page-btn {
  padding: 7px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-2); font-size: 13.5px;
  transition: all .15s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn.disabled { opacity: .45; pointer-events: none; }

/* ============ 空状态 ============ */
.empty-state { text-align: center; padding: 64px 20px; }
.empty-icon { font-size: 40px; margin-bottom: 14px; }
.empty-state p { color: var(--text-2); margin-bottom: 16px; }

/* ============ 页脚 ============ */
.site-main { flex: 1; width: 100%; }
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: auto; }
.footer-inner {
  display: flex; justify-content: space-between; gap: 40px;
  padding-top: 36px; padding-bottom: 28px; flex-wrap: wrap;
}
.footer-logo { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.footer-desc { font-size: 13px; color: var(--text-3); max-width: 320px; line-height: 1.8; }
.footer-links { display: flex; gap: 56px; }
.footer-links h4 { color: var(--text); font-size: 13px; margin-bottom: 12px; font-weight: 600; }
.footer-links a {
  display: block; color: var(--text-3); font-size: 13px; padding: 4px 0;
}
.footer-links a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 24px; font-size: 13px; color: var(--text-3); text-align: center;
}

/* ============ 认证页 ============ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.auth-wrap { width: 100%; max-width: 390px; }
.auth-logo { font-size: 24px; font-weight: 800; color: var(--text); display: block; text-align: center; margin-bottom: 22px; }
.auth-logo:hover { color: var(--text); }

.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 30px;
}
.auth-card h1 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.auth-sub { color: var(--text-2); font-size: 14px; margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-2); }
.auth-switch a { font-weight: 600; }
.auth-tip {
  margin-top: 12px; text-align: center; font-size: 12.5px; color: var(--text-3);
  background: var(--surface-2); padding: 8px; border-radius: var(--radius-sm);
}

.auth-page .flash { margin-bottom: 16px; }

/* ============ 表单 ============ */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 13.5px; font-weight: 600;
  margin-bottom: 7px; color: var(--text);
}
.req { color: var(--danger); }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea,
.inline-search input,
.post-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 13px; outline: none; transition: border-color .15s;
  background: var(--surface);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
.inline-search input:focus, .post-form textarea:focus {
  border-color: var(--primary);
}
.form-group textarea { resize: vertical; }
.form-tip { font-size: 12px; color: var(--text-3); margin-top: 6px; }

.auth-form .btn-block { margin-top: 6px; padding: 11px; font-size: 15px; }

/* ============ 404 ============ */
.not-found {
  min-height: 80vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 40px;
}
.nf-code {
  font-size: 88px; font-weight: 800; color: var(--primary);
  letter-spacing: 4px; line-height: 1;
}
.not-found h1 { font-size: 22px; margin: 18px 0 8px; }
.not-found p { color: var(--text-2); margin-bottom: 22px; }

/* ============ 页面横幅（分类页） ============ */
.page-banner {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 36px 0;
}
.page-banner h1 { font-size: 26px; font-weight: 800; }
.page-banner p { color: var(--text-2); margin-top: 4px; }

/* ============================================================
   后台样式（简洁浅色）
   ============================================================ */
.admin-body { background: var(--bg); }

.admin-layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.admin-sidebar {
  width: 220px; background: var(--surface); color: var(--text-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0;
  height: 100vh; flex-shrink: 0;
}
.admin-brand {
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.admin-brand .logo { color: var(--text); font-size: 19px; }
.admin-brand .logo:hover { color: var(--text); }
.admin-badge {
  font-size: 11px; color: var(--text-3); letter-spacing: 2px; text-transform: uppercase;
}

.admin-nav { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-2);
  font-size: 14px; font-weight: 500; transition: background .15s, color .15s;
}
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.admin-sidebar-footer { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.admin-sidebar-footer .btn { color: var(--text-2); border-color: var(--border); }
.admin-sidebar-footer .btn:hover { color: var(--text); background: var(--surface-2); }
.admin-sidebar-footer .btn-danger { background: transparent; color: var(--danger); border-color: #e4c3b4; }
.admin-sidebar-footer .btn-danger:hover { background: var(--danger); color: #fff; }

/* 主区域 */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.admin-topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  height: 56px; display: flex; align-items: center; padding: 0 28px;
  position: sticky; top: 0; z-index: 90; gap: 16px;
}
.admin-topbar-title { font-weight: 700; font-size: 16px; flex: 1; }
.admin-user { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.admin-toggle { display: none; background: none; border: none; font-size: 20px; color: var(--text); }

.admin-content { padding: 26px 28px; flex: 1; }

/* 统计卡片 */
.stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  display: flex; align-items: center; gap: 14px;
}
.stat-icon {
  width: 46px; height: 46px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-2); font-size: 22px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-num { font-size: 24px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-2); }

/* 卡片 */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.card-head h3 { font-size: 15px; font-weight: 700; }
.link-more { font-size: 13px; color: var(--primary); font-weight: 500; }
.card-title-sm { font-size: 14px; font-weight: 700; margin-bottom: 14px; }

.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 10px 12px; color: var(--text-3);
  font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fbfaf8; }
.td-title { font-weight: 600; max-width: 260px; }
.td-title a { color: var(--text); }
.td-title a:hover { color: var(--primary); }
.td-muted { color: var(--text-3); font-size: 13px; }
.td-right { text-align: right; }
.td-actions { white-space: nowrap; }
.td-actions form, .inline-form { display: inline-flex; }

/* 徽章 */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge-green { background: #eef5f0; color: #2e5f44; }
.badge-gray { background: var(--surface-2); color: var(--text-2); }
.badge-orange { background: #faf4e8; color: #8a6a24; }

/* 工具栏 */
.admin-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.admin-toolbar h2 { font-size: 19px; font-weight: 700; }
.toolbar-tip { font-size: 13px; color: var(--text-3); width: 100%; }
.toolbar-right { display: flex; gap: 10px; align-items: center; }
.inline-search { display: flex; gap: 8px; }
.inline-search input { width: 200px; padding: 7px 12px; }

.tabs-mini { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--radius-sm); }
.tab-mini {
  padding: 6px 15px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500;
  color: var(--text-2); transition: all .15s;
}
.tab-mini:hover { color: var(--text); }
.tab-mini.active { background: var(--surface); color: var(--primary); font-weight: 600; }

.empty-tip { color: var(--text-3); text-align: center; padding: 28px 0; font-size: 14px; }

/* 待审核列表 */
.pending-list { list-style: none; }
.pending-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.pending-list li:last-child { border-bottom: none; }
.pending-text { font-size: 14px; margin-bottom: 4px; }
.pending-meta { font-size: 12.5px; color: var(--text-3); }

/* 文章编辑 */
.post-form {
  display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start;
}
.post-form .card { padding: 22px; }
.post-form textarea#content { font-family: var(--font-mono); font-size: 14px; line-height: 1.8; min-height: 420px; }

.editor-toolbar {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px;
}
.editor-toolbar button {
  width: 38px; height: 34px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text-2); transition: all .15s;
}
.editor-toolbar button:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.post-form-side { display: flex; flex-direction: column; gap: 16px; }
.post-form-side .btn-block { margin-top: 6px; }

.cover-upload img {
  width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border);
  margin-bottom: 12px;
}

/* 评论管理列表 */
.comment-admin-list { list-style: none; }
.comment-admin-item {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 15px 0; border-bottom: 1px solid var(--border); align-items: flex-start;
}
.comment-admin-item:last-child { border-bottom: none; }
.comment-admin-main { flex: 1; min-width: 0; }
.comment-admin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.comment-admin-content { font-size: 14.5px; margin-bottom: 6px; }
.comment-admin-actions { display: flex; flex-direction: column; gap: 8px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(30, 26, 22, .45);
  display: flex; align-items: center; justify-content: center; z-index: 300;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--surface); border-radius: var(--radius); padding: 26px;
  width: min(440px, 92vw); box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease;
}
.modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* 个人资料 */
.profile-wrap {
  max-width: 620px; display: flex; flex-direction: column; gap: 16px;
}
.stack-form .btn { margin-top: 4px; }

/* ============ 动画 ============ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .post-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .post-form { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 12px 24px 20px; gap: 4px; z-index: 99;
  }
  .main-nav.open { display: flex; }
  .header-actions { margin-left: auto; }
  .header-actions .btn { display: none; }

  .hero { padding: 40px 0 32px; }
  .hero-title { font-size: 26px; }
  .post-grid { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: 1fr; }
  .post-detail { padding: 24px 20px; }
  .post-title-lg { font-size: 22px; }
  .comments { padding: 22px 20px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-num { font-size: 20px; }

  .admin-sidebar {
    position: fixed; left: -230px; z-index: 150; transition: left .25s ease;
  }
  .admin-sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
  .admin-toggle { display: block; }
  .admin-content { padding: 16px; }
  .admin-topbar { padding: 0 16px; }
  .footer-inner { flex-direction: column; gap: 24px; }
  .footer-links { gap: 40px; }
  .comment-admin-item { flex-direction: column; }
}
