/* ============================================================
   Apple 风格设计系统：语义令牌 + 组件类
   ============================================================ */

:root {
  --c-page: #f5f5f7;
  --c-card: #ffffff;
  --c-fill: rgba(0, 0, 0, 0.045);
  --c-fill-strong: rgba(0, 0, 0, 0.08);
  --c-label: #1d1d1f;
  --c-label-2: #6e6e73;
  --c-label-3: #86868b;
  --c-line: rgba(0, 0, 0, 0.09);
  --c-accent: #0071e3;
  --c-accent-hover: #0077ed;
  --c-accent-soft: rgba(0, 113, 227, 0.1);
  --c-danger: #ff3b30;
  --c-danger-soft: rgba(255, 59, 48, 0.1);
  --c-success: #34c759;
  --c-success-soft: rgba(52, 199, 89, 0.12);
  --c-warning: #ff9f0a;
  --c-warning-soft: rgba(255, 159, 10, 0.14);
  --c-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.05);
  --c-shadow-lift: 0 2px 8px rgba(0, 0, 0, 0.08), 0 16px 40px rgba(0, 0, 0, 0.1);
  --c-hero-gradient: linear-gradient(120deg, #1d1d1f 20%, #0071e3 55%, #7d3ff2 90%);
  --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.18s;
  --dur-base: 0.28s;
  --dur-slow: 0.6s;
  --r-card: 18px;
  --r-field: 12px;
  color-scheme: light;
}

.dark {
  --c-page: #000000;
  --c-card: #161617;
  --c-fill: rgba(255, 255, 255, 0.08);
  --c-fill-strong: rgba(255, 255, 255, 0.14);
  --c-label: #f5f5f7;
  --c-label-2: #a1a1a6;
  --c-label-3: #6e6e73;
  --c-line: rgba(255, 255, 255, 0.13);
  --c-accent: #0a84ff;
  --c-accent-hover: #409cff;
  --c-accent-soft: rgba(10, 132, 255, 0.16);
  --c-danger: #ff453a;
  --c-danger-soft: rgba(255, 69, 58, 0.16);
  --c-success: #30d158;
  --c-success-soft: rgba(48, 209, 88, 0.16);
  --c-warning: #ff9f0a;
  --c-warning-soft: rgba(255, 159, 10, 0.16);
  --c-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --c-shadow-lift: 0 2px 8px rgba(0, 0, 0, 0.5), 0 16px 40px rgba(0, 0, 0, 0.55);
  --c-hero-gradient: linear-gradient(120deg, #f5f5f7 15%, #409cff 55%, #bf7aff 90%);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
    'PingFang SC', 'Helvetica Neue', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--c-page);
  color: var(--c-label);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--c-accent-soft); }

:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 2px;
}
.input:focus-visible, .btn:focus-visible, .pill:focus-visible,
.theme-toggle:focus-visible, .segmented-btn:focus-visible {
  outline: none;
}
.btn:focus-visible, .theme-toggle:focus-visible, .segmented-btn:focus-visible {
  box-shadow: 0 0 0 4px var(--c-accent-soft);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.text-muted { color: var(--c-label-3); }

/* ---------- 毛玻璃顶栏 ---------- */
.glass {
  background: color-mix(in srgb, var(--c-card) 70%, transparent);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
}

.topbar { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--c-line); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 48px; }

.brand { font-weight: 600; font-size: 15px; letter-spacing: -0.02em; white-space: nowrap; }

.nav { display: flex; gap: 24px; font-size: 13px; flex: 1; }
.nav a { color: var(--c-label-2); transition: color var(--dur-fast); }
.nav a:hover { color: var(--c-label); }
.nav a.active { color: var(--c-label); font-weight: 600; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer; border-radius: 999px;
  background: var(--c-fill); color: var(--c-label-2);
  width: 32px; height: 32px; padding: 0; flex: none;
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.theme-toggle:hover { background: var(--c-fill-strong); color: var(--c-label); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { width: 16px; height: 16px; }

.main { padding: 32px 20px 64px; min-height: calc(100vh - 130px); }

.footer { border-top: 1px solid var(--c-line); padding: 24px 0; text-align: center; color: var(--c-label-3); font-size: 12px; }
.footer a { color: inherit; }
.footer a:hover { color: var(--c-label); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
}
/* 内容区直接相邻的卡片之间留出间距（避免叠放挤在一起） */
.admin-content > .card + .card,
.main > .card + .card { margin-top: 20px; }
.card-shadow { box-shadow: var(--c-shadow); }
.card-hover {
  display: flex; flex-direction: column;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-spring), border-color var(--dur-base);
}
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--c-shadow-lift); border-color: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .card-hover:hover { transform: none; }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font-family: inherit;
  border-radius: 999px; padding: 9px 20px; font-size: 14px; font-weight: 500;
  transition: all 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--c-accent); color: #fff; }
.btn-primary:hover { background: var(--c-accent-hover); }
.btn-secondary { background: var(--c-fill); color: var(--c-label); }
.btn-secondary:hover { background: var(--c-fill-strong); }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-block { width: 100%; }
.btn-pill { padding: 5px 14px; font-size: 12px; }

.btn-accent-soft { background: var(--c-accent-soft); color: var(--c-accent); }
.btn-accent-soft:hover { background: var(--c-accent); color: #fff; }

.btn-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--c-accent); font-size: 15px; font-weight: 500;
  transition: color var(--dur-fast);
}
.btn-link::after { content: '›'; font-size: 1.15em; line-height: 1; transition: transform var(--dur-fast) var(--ease-spring); }
.btn-link:hover { color: var(--c-accent-hover); }
.btn-link:hover::after { transform: translateX(3px); }

.pill-btn {
  display: inline-flex; align-items: center; border: 0; cursor: pointer;
  font-family: inherit; border-radius: 999px; padding: 4px 12px;
  font-size: 12px; font-weight: 500;
  background: var(--c-fill); color: var(--c-label-2);
  transition: all 0.2s; text-decoration: none;
}
.pill-btn:hover { background: var(--c-fill-strong); color: var(--c-label); }
.pill-btn.pill-danger { background: var(--c-danger-soft); color: var(--c-danger); }
.pill-btn.pill-danger:hover { background: var(--c-danger); color: #fff; }

.linklike {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--c-label-2); font: inherit; font-size: 13px;
  transition: color 0.2s;
}
.linklike:hover { color: var(--c-accent); }

/* ---------- 表单 ---------- */
.input {
  width: 100%; border: 0; outline: none; font-family: inherit;
  border-radius: 12px; background: var(--c-fill);
  padding: 10px 14px; font-size: 15px; color: var(--c-label);
  transition: all 0.2s;
}
.input::placeholder { color: var(--c-label-3); }
.input:focus { background: var(--c-card); box-shadow: 0 0 0 4px var(--c-accent-soft); }
.textarea { resize: vertical; min-height: 64px; }
.select { appearance: none; cursor: pointer; }
.input-narrow { width: 90px; flex: none; }
.input-inline { flex: 1; }

.field { display: block; margin-bottom: 16px; }
.field-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--c-label-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hint { font-size: 13px; color: var(--c-label-3); margin: 8px 0 16px; }
.form-section {
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--c-label-3); margin: 24px 0 12px;
}
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.form-card { padding: 28px; }
.space-form { display: block; }

/* ---------- 站点 Logo 设置 ---------- */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-logo { width: 22px; height: 22px; object-fit: contain; flex: none; }
.logo-setting { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.logo-preview {
  width: 48px; height: 48px; object-fit: contain;
  border-radius: 10px; border: 1px solid var(--c-line); background: var(--c-fill); padding: 4px; flex: none;
}
.logo-preview-empty { display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: var(--c-label-3); }
.logo-remove { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-label-2); }
.logo-input { flex: 1; min-width: 220px; }

/* ---------- Flash 提示 ---------- */
.flash {
  border-radius: 12px; padding: 12px 16px; font-size: 14px; font-weight: 500;
  margin-bottom: 20px;
}
.flash-success { background: var(--c-success-soft); color: var(--c-success); }
.flash-error { background: var(--c-danger-soft); color: var(--c-danger); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 2px 10px; font-size: 12px; font-weight: 500;
}
.badge-blue { background: var(--c-accent-soft); color: var(--c-accent); }
.badge-green { background: var(--c-success-soft); color: var(--c-success); }
.badge-zinc { background: var(--c-fill); color: var(--c-label-2); }
.badge-amber { background: var(--c-warning-soft); color: var(--c-warning); }
.badge-red { background: var(--c-danger-soft); color: var(--c-danger); }

/* ---------- 页面骨架 ---------- */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 20px; }
.page-sub { margin: 4px 0 0; font-size: 13px; color: var(--c-label-3); }

.search-form { display: flex; width: 320px; max-width: 100%; }
.search-field { position: relative; flex: 1; }
.search-field svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--c-label-3); pointer-events: none;
}
.search-field .input { padding-left: 36px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .input { width: auto; min-width: 180px; }
.filter-bar .select { width: auto; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.pill {
  border-radius: 999px; padding: 5px 14px; font-size: 13px;
  background: var(--c-fill); color: var(--c-label-2);
  transition: all 0.2s;
}
.pill:hover { background: var(--c-fill-strong); color: var(--c-label); }
.pill-active { background: var(--c-label); color: var(--c-page); }
.pill-active:hover { background: var(--c-label); color: var(--c-page); }

.empty {
  border: 1px dashed var(--c-line); border-radius: var(--r-card);
  padding: 56px 20px; text-align: center; color: var(--c-label-2); font-size: 15px;
}
.empty-icon { color: var(--c-label-3); opacity: 0.7; margin-bottom: 10px; }
.empty-icon svg { width: 32px; height: 32px; }

.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 24px; font-size: 13px; color: var(--c-label-3);
}
.page-btns { display: flex; gap: 8px; }

/* ---------- 首页 ---------- */
.hero { text-align: center; padding: 72px 0 56px; }
.hero-title {
  font-size: clamp(40px, 7vw, 64px); font-weight: 700; line-height: 1.08;
  letter-spacing: -0.035em; margin: 0;
}
.hero-title-gradient {
  background: var(--c-hero-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-desc {
  color: var(--c-label-2); font-size: clamp(17px, 2.4vw, 21px); line-height: 1.5;
  max-width: 560px; margin: 20px auto 0;
}
.hero-actions { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 28px; flex-wrap: wrap; }

.section { margin-bottom: 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; margin: 0; }
.more-link { font-size: 14px; font-weight: 500; color: var(--c-accent); display: inline-flex; align-items: center; gap: 4px; transition: color var(--dur-fast); }
.more-link::after { content: '›'; font-size: 1.15em; line-height: 1; transition: transform var(--dur-fast) var(--ease-spring); }
.more-link:hover { color: var(--c-accent-hover); }
.more-link:hover::after { transform: translateX(3px); }

/* 入场动效（纯 CSS，无 JS 依赖） */
.reveal { animation: reveal-up var(--dur-slow) var(--ease-out) both; }
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card-title { font-size: 17px; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em; margin: 0; transition: color 0.2s; }
.card-hover:hover .card-title { color: var(--c-accent); }
.card-desc {
  margin: 8px 0 0; font-size: 14px; color: var(--c-label-2); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; font-size: 12px; color: var(--c-label-3); }
.meta-right { margin-left: auto; }
.meta-tag { color: var(--c-label-3); }

.article-card-body { display: flex; flex-direction: column; flex: 1; gap: 4px; padding: 16px; }
.article-cover { height: 160px; width: 100%; object-fit: cover; border-radius: var(--r-card) var(--r-card) 0 0; }
.article-card { overflow: hidden; }

.file-mini-list { list-style: none; margin: 0; padding: 0; }
.file-mini-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--c-line);
}
.file-mini-item:last-child { border-bottom: 0; }
.file-mini-name { font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-mini-meta { font-size: 12px; color: var(--c-label-3); }

/* ---------- 表格 ---------- */
.table-card { overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 500;
  color: var(--c-label-3); border-bottom: 1px solid var(--c-line);
  background: var(--c-fill);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--c-line); }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: var(--c-fill); }
.table tbody tr:last-child td { border-bottom: 0; }
.th-right, .td-right { text-align: right; }
.td-empty { text-align: center; color: var(--c-label-3); padding: 40px 16px !important; }
.td-nowrap { white-space: nowrap; }
.row-link { font-weight: 500; transition: color 0.2s; }
.row-link:hover { color: var(--c-accent); }
.file-name { margin: 0; font-weight: 500; }
.file-desc { margin: 2px 0 0; font-size: 12px; color: var(--c-label-3); }
.action-pills { display: inline-flex; gap: 6px; justify-content: flex-end; }
.inline-form { display: inline; }

/* ---------- 文章详情 ---------- */
.article-detail { max-width: 760px; margin: 0 auto; }
.article-header { margin-bottom: 36px; }
.article-title { font-size: clamp(30px, 5vw, 40px); font-weight: 700; line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 16px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 14px; color: var(--c-label-3); }
.article-cover-large { width: 100%; border-radius: var(--r-card); margin-top: 24px; object-fit: cover; }
.article-footer { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--c-line); }
.back-link { font-size: 14px; color: var(--c-label-3); transition: color var(--dur-fast); }
.back-link:hover { color: var(--c-accent); }
.article-back { display: inline-block; margin-bottom: 20px; }

/* ---------- Markdown 渲染区 ---------- */
.markdown-body { color: var(--c-label); font-size: 17px; line-height: 1.8; overflow-wrap: break-word; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  margin: 28px 0 14px; font-weight: 700; line-height: 1.35; letter-spacing: -0.02em;
}
.markdown-body h1 { font-size: 26px; }
.markdown-body h2 { font-size: 22px; }
.markdown-body h3 { font-size: 18px; }
.markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 16px; }
.markdown-body p { margin: 0 0 14px; }
.markdown-body a { color: var(--c-accent); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body img { max-width: 100%; border-radius: 12px; }
.markdown-body blockquote {
  margin: 16px 0; padding: 10px 16px; border-left: 3px solid var(--c-line);
  background: var(--c-fill); border-radius: 0 10px 10px 0; color: var(--c-label-2);
}
.markdown-body blockquote p { margin: 0; }
.markdown-body ul, .markdown-body ol { margin: 0 0 14px; padding-left: 24px; }
.markdown-body li { margin: 4px 0; }
.markdown-body hr { border: 0; border-top: 1px solid var(--c-line); margin: 28px 0; }
.markdown-body code {
  font-family: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em; background: var(--c-fill); border-radius: 6px; padding: 2px 6px;
}
.markdown-body pre {
  background: var(--c-fill); border-radius: 12px; padding: 16px;
  overflow-x: auto; margin: 0 0 16px; line-height: 1.6;
}
.markdown-body pre code { background: none; padding: 0; font-size: 13px; }
.markdown-body table { border-collapse: collapse; width: 100%; margin: 0 0 16px; font-size: 14px; }
.markdown-body th, .markdown-body td { border: 1px solid var(--c-line); padding: 8px 12px; text-align: left; }
.markdown-body th { background: var(--c-fill); font-weight: 600; }
.markdown-body del { color: var(--c-label-3); }

/* ---------- 登录 / 安装 ---------- */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 32px 20px;
}
.auth-card { width: 100%; max-width: 420px; padding: 32px; border-radius: 24px; }
.auth-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
.auth-sub { color: var(--c-label-2); font-size: 14px; margin: 0 0 24px; }
.auth-foot { text-align: center; margin: 20px 0 0; font-size: 13px; }
.install-wrap { width: 100%; max-width: 520px; }
.install-wrap .auth-card { max-width: none; }

/* ---------- iOS 分段控件 ---------- */
.segmented {
  display: inline-flex; gap: 2px; background: var(--c-fill);
  border-radius: 12px; padding: 3px; margin-bottom: 16px;
}
.segmented-btn {
  border: 0; cursor: pointer; font-family: inherit;
  border-radius: 9px; padding: 6px 16px; font-size: 13px; font-weight: 500;
  background: transparent; color: var(--c-label-2); transition: all 0.2s;
}
.segmented-btn.active { background: var(--c-card); color: var(--c-label); box-shadow: var(--c-shadow); }

/* ---------- 后台布局 ---------- */
.admin-body { overflow-x: hidden; }
.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 224px; flex: none;
  background: color-mix(in srgb, var(--c-card) 72%, transparent);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-right: 1px solid var(--c-line);
  display: flex; flex-direction: column; padding: 20px 12px;
  position: sticky; top: 0; height: 100vh;
  transition: transform 0.25s var(--ease-spring);
  z-index: 60;
}
.sidebar .brand { padding: 0 12px 20px; font-size: 16px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a {
  border-radius: 10px; padding: 8px 12px; font-size: 14px;
  color: var(--c-label-2); transition: all 0.15s;
}
.side-nav a:hover { background: var(--c-fill); color: var(--c-label); }
.side-nav a.active { background: var(--c-accent-soft); color: var(--c-accent); font-weight: 600; }

.side-footer { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--c-line); padding-top: 16px; }
.side-user { margin: 0; font-size: 12px; color: var(--c-label-3); padding: 0 4px; }
.logout-form { margin: 0; }
.side-footer .theme-toggle { align-self: flex-start; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  position: sticky; top: 0; z-index: 40; height: 48px;
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  border-bottom: 1px solid var(--c-line);
}
.admin-title { font-size: 13px; font-weight: 600; }
.icon-btn {
  display: none; align-items: center; justify-content: center;
  border: 0; cursor: pointer; font-family: inherit;
  background: var(--c-fill); color: var(--c-label-2);
  border-radius: 8px; width: 32px; height: 32px; font-size: 14px;
}
.icon-btn svg { width: 16px; height: 16px; }
.admin-content { padding: 28px 28px 64px; max-width: 1200px; width: 100%; margin: 0 auto; }

.sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(4px);
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px; }
.stat-label { margin: 0; font-size: 13px; font-weight: 500; color: var(--c-label-3); }
.stat-value { margin: 6px 0 2px; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.stat-sub { margin: 0; font-size: 12px; color: var(--c-label-3); }

.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.panel { padding: 4px 0; margin-bottom: 16px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--c-line);
}
.panel-title { font-size: 15px; font-weight: 600; margin: 0; }
.panel-empty { padding: 24px 16px; margin: 0; color: var(--c-label-3); font-size: 14px; }
.panel-value { margin: 0; font-size: 15px; font-weight: 500; }
.row-list { list-style: none; margin: 0; padding: 0; }
.row-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--c-line); font-size: 14px;
}
.row-list li:last-child { border-bottom: 0; }
.row-list .row-link, .row-list .row-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 编辑器 ---------- */
.editor { border: 1px solid var(--c-line); border-radius: 12px; overflow: hidden; background: var(--c-card); }
.editor-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px; border-bottom: 1px solid var(--c-line); background: var(--c-fill);
}
.editor-toolbar-right { margin-left: auto; display: flex; gap: 6px; }
.editor-tab {
  border: 0; cursor: pointer; font-family: inherit;
  background: transparent; color: var(--c-label-2);
  border-radius: 8px; padding: 5px 12px; font-size: 13px; font-weight: 500;
}
.editor-tab.active { background: var(--c-card); color: var(--c-label); box-shadow: var(--c-shadow); }
.editor-input {
  width: 100%; border: 0; outline: none; resize: vertical;
  padding: 14px; font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: 13.5px; line-height: 1.7; background: var(--c-card); color: var(--c-label);
  min-height: 360px;
}
.editor-preview { padding: 16px; min-height: 360px; max-height: 600px; overflow-y: auto; background: var(--c-card); }

/* ---------- 上传 ---------- */
.upload-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.upload-zone {
  border: 2px dashed var(--c-line); border-radius: 14px;
  padding: 32px 20px; text-align: center; transition: all 0.2s;
}
.upload-zone.dragover { border-color: var(--c-accent); background: var(--c-accent-soft); }
.upload-zone-text { margin: 0; font-size: 14px; color: var(--c-label-2); }
.upload-pick { color: var(--c-accent); cursor: pointer; }
.upload-zone-hint { margin: 8px 0 0; font-size: 12px; color: var(--c-label-3); }
.upload-fields { grid-template-columns: repeat(3, 1fr); }
.upload-progress { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.progress-track { flex: 1; height: 6px; border-radius: 999px; background: var(--c-fill); overflow: hidden; }
.progress-bar { height: 100%; width: 0; border-radius: 999px; background: var(--c-accent); transition: width 0.15s; }
.upload-progress-text { font-size: 12px; color: var(--c-label-3); min-width: 36px; }

/* ---------- 文件夹 & 面包屑 ---------- */
.breadcrumb { display: flex; align-items: center; gap: 6px; margin-bottom: 20px; font-size: 14px; flex-wrap: wrap; }
.breadcrumb-item { color: var(--c-label-2); transition: color 0.2s; }
.breadcrumb-item:hover { color: var(--c-accent); }
.breadcrumb-sep { color: var(--c-label-3); }

.page-head-actions { display: flex; gap: 8px; }

.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 20px; }
.folder-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  position: relative; transition: background 0.15s, border-color 0.15s;
}
.folder-card:hover { background: var(--c-fill); border-color: transparent; }
.folder-icon { width: 28px; height: 28px; color: var(--c-accent); flex: none; }
.folder-name { font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-actions { display: none; gap: 4px; }
.folder-card:hover .folder-actions { display: flex; }

#batch-move-bar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--c-card); border: 1px solid var(--c-line); border-radius: 999px;
  padding: 8px 20px; box-shadow: var(--c-shadow-lift); z-index: 80;
  display: flex; align-items: center; gap: 12px; font-size: 14px;
}

/* ---------- 对话框 ---------- */
.dialog {
  border: 1px solid var(--c-line); border-radius: 20px;
  background: var(--c-card); color: var(--c-label);
  padding: 0; width: 100%; max-width: 480px;
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(4px); }
.dialog-body { padding: 24px; display: flex; flex-direction: column; gap: 4px; }
.dialog-body .panel-title { margin-bottom: 12px; }

/* ---------- 设置页 ---------- */
.category-add { display: flex; gap: 8px; margin-bottom: 16px; }
.category-add .input { flex: 1; }
.category-list { list-style: none; margin: 0; padding: 0; }
.category-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--c-line);
}
.category-item:last-child { border-bottom: 0; }
.category-edit { display: flex; gap: 8px; flex: 1; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .admin-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .upload-fields { grid-template-columns: 1fr; }
  .hero-title { font-size: 30px; }
  .page-title { font-size: 22px; }
  .article-title { font-size: 26px; }
  .admin-content { padding: 20px 16px 48px; }

  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); box-shadow: var(--c-shadow);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .icon-btn { display: inline-flex; align-items: center; justify-content: center; }
}
