* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f7fb; color: #1f2937; }
a { color: #1677ff; text-decoration: none; }
body.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { width: min(560px, calc(100vw - 32px)); background: #fff; border-radius: 20px; padding: 28px; box-shadow: 0 20px 50px rgba(15, 23, 42, .12); }
.auth-card h1, .page-header h2 { margin: 0; }
.auth-card p, .page-header p, .table-row p { color: #6b7280; }
form label { display: block; margin: 12px 0; font-size: 14px; }
input, select, textarea, button { width: 100%; margin-top: 8px; border-radius: 12px; border: 1px solid #dbe3ee; padding: 12px 14px; font-size: 14px; background: #fff; }
textarea { resize: vertical; }
button { border: 0; background: linear-gradient(135deg, #1677ff, #00aaff); color: #fff; font-weight: 700; cursor: pointer; }
button:hover { opacity: .95; }
button.secondary { background: #fff; color: #1677ff; border: 1px solid #d8e9ff; }
.alert { padding: 12px 14px; border-radius: 12px; margin: 12px 0; background: #f8fafc; color: #334155; }
.alert.error { background: #fff1f0; color: #cf1322; }
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid #edf1f7; padding: 20px; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.brand-logo { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #1677ff, #00c2ff); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.brand h1 { font-size: 18px; margin: 0; }
.brand p { margin: 2px 0 0; font-size: 12px; color: #6b7280; }
.sidebar-note { background: #f8fbff; border: 1px solid #e5f0ff; border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.sidebar-note span { display: block; font-weight: 700; color: #0f172a; }
.sidebar-note small { display: block; margin-top: 4px; color: #64748b; line-height: 1.5; }
.sidebar-nav { display: flex; flex-direction: column; gap: 12px; }
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-group-title { font-size: 12px; color: #94a3b8; padding: 0 4px; text-transform: none; }
.sidebar-nav a { display: block; padding: 12px 14px; border-radius: 12px; color: #374151; }
.sidebar-nav a.active, .sidebar-nav a:hover { background: #eff6ff; color: #1677ff; }
.logout-link { margin-top: 6px; }
.content { padding: 24px; }
.content-topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.content-eyebrow { margin: 0 0 4px; font-size: 12px; color: #94a3b8; letter-spacing: .08em; }
.content-topbar h2 { margin: 0; }
.content-meta { color: #64748b; font-size: 13px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card, .panel { background: #fff; border-radius: 18px; padding: 18px; box-shadow: 0 8px 30px rgba(15, 23, 42, .05); }
.stat-card strong { display: block; font-size: 30px; margin-bottom: 6px; }
.panel { margin-bottom: 18px; }
.kv-grid, .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.toggle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 12px 0 8px; }
.table { display: flex; flex-direction: column; gap: 12px; }
.table-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid #edf1f7; }
.table-row:last-child { border-bottom: 0; }
.row-actions { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.form-panel h3 { margin-top: 0; }
.hint { margin: 4px 0 0; font-size: 12px; color: #94a3b8; line-height: 1.6; }
.table-row strong { display: block; margin-bottom: 4px; }
.table-row small { display: block; margin-top: 4px; line-height: 1.5; }
.row-actions a { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border-radius: 10px; background: #eff6ff; color: #1677ff; }
.row-actions a:last-child { background: #fff1f0; color: #cf1322; }
.panel h3 { margin-bottom: 8px; }
.anchor-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.anchor-nav a { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border-radius: 999px; background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }
.page-form { display: flex; flex-direction: column; gap: 0; }
.page-form .panel { margin-bottom: 18px; }
.shortcut-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.template-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.template-bar .secondary { white-space: nowrap; }
.shortcut-grid a { display: flex; align-items: center; justify-content: center; padding: 14px 12px; border-radius: 14px; background: #f8fbff; color: #1677ff; border: 1px solid #e5f0ff; }
.help-notes pre { margin: 10px 0 0; padding: 14px; border-radius: 14px; background: #f8fafc; overflow: auto; font-size: 12px; line-height: 1.6; }
.nested-panel { background: #f8fbff; border: 1px solid #e5f0ff; border-radius: 16px; padding: 16px; }
.nested-panel pre { margin: 10px 0 0; padding: 14px; border-radius: 14px; background: #ffffff; overflow: auto; font-size: 12px; line-height: 1.6; color: #334155; }
.nested-panel small { display: block; margin-top: 8px; color: #64748b; line-height: 1.6; }
.inline-link { display: inline-flex; align-items: center; justify-content: center; margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: #1677ff; color: #fff; }
.nested-panel .inline-link + .inline-link { margin-left: 10px; }
.entry-editor { display: grid; gap: 14px; }
.entry-card { border: 1px solid #e5eef8; border-radius: 16px; padding: 16px; background: #fdfefe; }
.entry-card-head { font-weight: 700; color: #0f172a; margin-bottom: 10px; }
.entry-card-head small { display: block; margin-top: 2px; font-weight: 500; color: #94a3b8; text-transform: uppercase; }
.article-editor textarea { min-height: 140px; }
.article-card textarea { min-height: 180px; }
.article-card select, .article-card input, .entry-card select, .entry-card input { margin-top: 6px; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 16px; padding: 12px; border: 1px solid #e5eef8; border-radius: 14px; background: #f8fbff; }
.editor-toolbar button { width: auto; margin-top: 0; padding: 9px 12px; border-radius: 999px; background: #fff; color: #1677ff; border: 1px solid #d8e9ff; font-weight: 600; }
.rich-page-form { overflow: hidden; }
.rich-tip { margin: 0 0 16px; }
.rich-toolbar { position: sticky; top: 0; z-index: 5; backdrop-filter: blur(10px); }
.rich-card { display: grid; gap: 14px; }
.rich-card textarea { min-height: 110px; }
.rich-editor-shell { border: 1px solid #e5eef8; border-radius: 16px; background: #fff; overflow: hidden; }
.rich-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; background: linear-gradient(180deg, #f8fbff, #ffffff); border-bottom: 1px solid #edf3fb; }
.rich-editor-actions button { width: auto; margin-top: 0; padding: 8px 11px; border-radius: 999px; background: #fff; color: #475467; border: 1px solid #d9e4f2; font-weight: 600; }
.rich-editor-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr); gap: 0; }
.rich-editor-area { min-height: 280px; padding: 16px; outline: none; line-height: 1.75; border-right: 1px solid #edf3fb; }
.rich-editor-area:empty:before { content: '在这里输入图文内容...'; color: #94a3b8; }
.rich-editor-area h2, .rich-editor-area h3, .rich-editor-area p, .rich-editor-area blockquote, .rich-editor-area ul, .rich-editor-area ol { margin: 0 0 12px; }
.rich-editor-area blockquote { margin: 0 0 12px; padding: 12px 14px; border-left: 4px solid #1677ff; background: #f8fbff; color: #334155; }
.rich-editor-area img { max-width: 100%; border-radius: 12px; display: block; }
.rich-editor-area a { color: #1677ff; text-decoration: underline; }
.rich-editor-preview { padding: 16px; background: #fbfdff; }
.rich-editor-preview-title { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; margin-bottom: 10px; }
.rich-editor-preview-body { min-height: 248px; color: #334155; line-height: 1.75; }
.rich-editor-preview-body .rich-placeholder { color: #94a3b8; }
.action-row { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.action-row button { width: auto; min-width: 140px; }
.filter-bar, .batch-toolbar { display: grid; grid-template-columns: 1.5fr 1fr 1fr auto; gap: 12px; align-items: end; margin: 12px 0 16px; }
.filter-bar button, .batch-toolbar button { min-width: 120px; }
.batch-form { margin-top: 8px; }
.user-row { align-items: center; }
.row-check { width: auto; margin: 0; }
.row-check input { width: auto; margin: 0; }
.user-avatar { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; overflow: hidden; background: #eff6ff; color: #1677ff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.user-avatar-placeholder { background: #eef2ff; color: #4f46e5; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-main { flex: 1; min-width: 0; }
.user-header-row { border-bottom: 1px dashed #e2e8f0; padding-top: 0; }
.copy-code { width: auto; min-width: 96px; margin-top: 0; }
.empty-state { padding: 28px 12px; color: #94a3b8; text-align: center; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; margin-top: 16px; }
.pager-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pager-links a { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 10px; background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }
.pager-links a.active { background: #1677ff; color: #fff; border-color: #1677ff; }
@media (max-width: 960px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid #edf1f7; }
  .cards, .kv-grid, .grid-2, .toggle-grid { grid-template-columns: 1fr; }
  .table-row { flex-direction: column; }
  .row-actions { white-space: normal; flex-wrap: wrap; }
  .content-topbar, .page-header { flex-direction: column; align-items: flex-start; }
  .shortcut-grid { grid-template-columns: 1fr; }
  .filter-bar, .batch-toolbar { grid-template-columns: 1fr; }
  .user-row { align-items: flex-start; }
  .rich-editor-body { grid-template-columns: 1fr; }
  .rich-editor-area { border-right: 0; border-bottom: 1px solid #edf3fb; }
}
