/* ============================================================
   管理后台样式 —— 与前台同源的设计令牌（anheyu / AnZhiYu）
   左右分栏：深色导航侧栏 + 内容区，浅色/深色两套主题
   ============================================================ */

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

:root {
    --bg: #f7f9fe;
    --surface: #ffffff;
    --surface-alt: #f1f3f8;
    --text: #363636;
    --text-secondary: rgba(60,60,67,.8);
    --text-muted: #8c8c8c;
    --accent: #163bf2;
    --accent-dark: #1230cc;
    --accent-light: rgba(22,59,242,.08);
    --primary: #163bf2;
    --primary-foreground: #ffffff;
    --border: #e3e8f7;
    --shadow-sm: 0 2px 8px -2px rgba(0,0,0,.05);
    --shadow: 0 8px 16px -4px rgba(44,45,48,.05);
    --shadow-lg: 0 12px 24px -8px rgba(0,0,0,.08);
    --shadow-primary: 0 8px 12px -3px rgba(22,59,242,.14);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --transition: .25s ease-in-out;
    --sidebar-w: 240px;

    --green: #57bd6a;
    --orange: #ff953e;
    --pink: #ff7c7c;
    --purple: #7a60d2;
    --red: #ff3842;
    --blue: #3e86f6;
    --logo-grad: linear-gradient(215deg, #4584ff 0%, #cf0db9 100%);

    /* 侧栏固定用深色，与前台主色同色系 */
    --side-bg: #1b2ba7;
    --side-bg-2: #0f1a72;
    --side-text: rgba(255,255,255,.82);
    --side-muted: rgba(255,255,255,.55);
    --side-hover: rgba(255,255,255,.12);
    --side-active: rgba(255,255,255,.94);
}

html.dark {
    --bg: #1c1e22;
    --surface: #26282d;
    --surface-alt: #2f3238;
    --text: #e4e6eb;
    --text-secondary: rgba(228,230,235,.8);
    --text-muted: #9aa0aa;
    --border: #363a41;
    --accent-light: rgba(22,59,242,.18);
    --shadow-sm: 0 2px 8px -2px rgba(0,0,0,.4);
    --shadow: 0 8px 16px -4px rgba(0,0,0,.45);
    --shadow-lg: 0 12px 24px -8px rgba(0,0,0,.55);
    --side-bg: #14161c;
    --side-bg-2: #0c0e12;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== 骨架 ===== */
.admin-app { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
    color: var(--side-text);
    padding: 18px 14px 14px;
    overflow-y: auto;
    z-index: 30;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-icon {
    width: 38px; height: 38px; flex: 0 0 38px;
    border-radius: 11px;
    background: var(--logo-grad);
    display: grid; place-items: center;
    color: #fff; font-weight: 800; font-size: 17px;
    box-shadow: 0 6px 14px -6px rgba(0,0,0,.5);
}
.brand-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.brand-title { font-size: 15px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 11.5px; color: var(--side-muted); letter-spacing: .04em; }

.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-label { font-size: 11px; color: var(--side-muted); letter-spacing: .1em; padding: 12px 12px 6px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 14px;
    color: var(--side-text);
    transition: background var(--transition), color var(--transition), transform var(--transition);
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; }
.nav-item:hover { background: var(--side-hover); color: #fff; }
.nav-item.active { background: var(--side-active); color: var(--primary); font-weight: 600; box-shadow: 0 6px 14px -8px rgba(0,0,0,.6); }
.nav-item .nav-badge { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.18); color: #fff; border-radius: 999px; padding: 1px 7px; }
.nav-item.active .nav-badge { background: var(--accent-light); color: var(--primary); }
button.nav-item { width: 100%; background: none; border: 0; font: inherit; color: var(--side-text); text-align: left; cursor: pointer; }

.sidebar-foot { border-top: 1px solid rgba(255,255,255,.14); padding-top: 10px; margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }

.admin-main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.admin-topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    height: 60px; padding: 0 24px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.crumb { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.crumb b { color: var(--text); font-size: 16px; font-weight: 700; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-toggle { display: none; }

.admin-body { padding: 22px 24px 60px; max-width: 1180px; width: 100%; }

/* ===== 卡片 ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
    overflow: hidden;
}
.card-head {
    display: flex; align-items: center; gap: 10px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 15px; font-weight: 700; }
.card-head .sub { font-size: 12.5px; color: var(--text-muted); font-weight: 400; }
.card-head .spacer { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.section-note { font-size: 12.5px; color: var(--text-muted); margin: -6px 0 14px; }

/* ===== 统计 ===== */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px 16px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 10px; }
.stat-ico svg { width: 16px; height: 16px; }
.stat-ico.blue { background: rgba(62,134,246,.12); color: var(--blue); }
.stat-ico.green { background: rgba(87,189,106,.14); color: var(--green); }
.stat-ico.orange { background: rgba(255,149,62,.14); color: var(--orange); }
.stat-ico.pink { background: rgba(255,124,124,.15); color: var(--pink); }
.stat-ico.purple { background: rgba(122,96,210,.14); color: var(--purple); }
.stat-ico.primary { background: var(--accent-light); color: var(--primary); }
.stat-value { font-size: 22px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.quick-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: inherit; font-size: 13.5px; font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--primary); color: var(--primary); background: var(--accent-light); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-primary); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: var(--surface-alt); border-color: transparent; }
.btn-danger:hover { border-color: var(--red); color: var(--red); background: rgba(255,56,66,.08); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 42px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; padding: 0; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
    text-align: left; font-weight: 600; font-size: 12.5px; color: var(--text-muted);
    padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-alt);
    white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background var(--transition); }
table.data tbody tr:hover { background: var(--accent-light); }
.cell-title { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.cell-title a { font-weight: 600; }
.cell-title a:hover { color: var(--primary); }
.thumb {
    width: 46px; height: 30px; flex: 0 0 46px; border-radius: 6px; overflow: hidden;
    background: var(--logo-grad); border: 1px solid var(--border);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.cell-muted { color: var(--text-muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-act { display: flex; gap: 6px; }
/* 删除动作改成 POST 表单，用 contents 让按钮仍像直接排在 flex 容器里 */
.inline-form { display: contents; }
.cell-num { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.empty-row { padding: 40px 14px; text-align: center; color: var(--text-muted); font-size: 13.5px; }

/* ===== 徽标 ===== */
.badge { display: inline-flex; align-items: center; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--surface-alt); color: var(--text-secondary); white-space: nowrap; }
.badge.blue { background: rgba(62,134,246,.12); color: var(--blue); }
.badge.green { background: rgba(87,189,106,.14); color: #2e8b40; }
.badge.orange { background: rgba(255,149,62,.15); color: #d1761f; }
.badge.teal { background: rgba(57,178,171,.14); color: #23897f; }
html.dark .badge.green { color: #7fd68d; }
html.dark .badge.orange { color: #ffb672; }
html.dark .badge.teal { color: #6fd7cd; }

/* ===== 表单 ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px 16px; }
.form-grid.one { grid-template-columns: 1fr; }
.span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.field-tip { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.field-row { display: flex; gap: 8px; align-items: stretch; }

.form-input, textarea.form-input, select.form-input {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit; font-size: 13.5px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
textarea.form-input { resize: vertical; min-height: 90px; line-height: 1.7; }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-light); }
select.form-input { appearance: none; cursor: pointer; padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c8c8c' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; }
.form-input::placeholder { color: var(--text-muted); }
.hint { font-size: 12px; color: var(--text-muted); }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 9px; user-select: none; cursor: pointer; font-size: 13px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
    width: 42px; height: 23px; border-radius: 999px; background: var(--surface-alt);
    border: 1px solid var(--border); position: relative; transition: background var(--transition), border-color var(--transition);
}
.switch-track::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform var(--transition);
}
.switch input:checked + .switch-track { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(19px); }

/* 图标多选 */
.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-chip { position: relative; }
.icon-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.icon-chip label {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    width: 62px; padding: 8px 4px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); cursor: pointer; font-size: 11px; color: var(--text-muted);
    transition: all var(--transition);
}
.icon-chip .chip-tile { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; overflow: hidden; }
.icon-chip .chip-tile svg { width: 18px; height: 18px; }
.icon-chip input:checked + label { border-color: var(--primary); color: var(--primary); background: var(--accent-light); box-shadow: var(--shadow-primary); }

/* 图片字段 */
.img-field { display: flex; gap: 12px; align-items: flex-start; }
.img-preview {
    width: 104px; height: 66px; flex: 0 0 104px; border-radius: 10px; overflow: hidden;
    border: 1px dashed var(--border); background: var(--surface-alt);
    display: grid; place-items: center; color: var(--text-muted); font-size: 11px; text-align: center;
}
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-preview.round { border-radius: 50%; width: 66px; height: 66px; flex-basis: 66px; }
.img-actions { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

/* ===== 可重复行 ===== */
.rowlist { display: flex; flex-direction: column; gap: 10px; }
.rowlist .row {
    border: 1px solid var(--border); border-radius: 10px; padding: 12px;
    background: var(--surface-alt);
    display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
}
.rowlist .row .row-cell { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1 1 150px; }
.rowlist .row .row-cell > span { font-size: 11.5px; color: var(--text-muted); }
.row-del { flex: 0 0 auto; }
.row-group { flex: 1 1 100%; display: flex; flex-direction: column; gap: 8px; }
.row-group > .g-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); }
.rowlist > .row { background: var(--surface); }
.rowlist .rowlist > .row { background: var(--surface-alt); }
/* 分组行：外层 .row 只装一个跨列的 .row-group，组头本身再排成网格 */
.row-inner {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end;
    padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-alt);
}
.rowlist-wrap { display: flex; flex-direction: column; gap: 8px; }
.list-add .btn, .g-add .btn { border-style: dashed; color: var(--text-secondary); }
.list-add .btn:hover, .g-add .btn:hover { color: var(--primary); border-color: var(--primary); }
.sub-label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.sub-label:first-child { margin-top: 0; }

/* 颜色选择小块 */
.swatch-row { display: flex; gap: 6px; }
.swatch-row label { width: 26px; height: 26px; border-radius: 7px; border: 2px solid transparent; cursor: pointer; }
.swatch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.swatch-row input:checked + span, .swatch-row label.on { border-color: var(--text); }

/* ===== 提示 ===== */
.alert {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px;
    font-size: 13.5px; border: 1px solid transparent;
    animation: fade-in .35s ease-out;
}
.alert.success { background: rgba(87,189,106,.12); border-color: rgba(87,189,106,.35); color: #2e8b40; }
.alert.error { background: rgba(255,56,66,.1); border-color: rgba(255,56,66,.3); color: var(--red); }
.alert.info { background: var(--accent-light); border-color: rgba(22,59,242,.25); color: var(--primary); }
html.dark .alert.success { color: #8ee09b; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ===== 筛选条 ===== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filter-bar .form-input { width: auto; min-width: 140px; }
.filter-bar .grow { flex: 1; min-width: 180px; }

/* ===== 分页 ===== */
.pager { display: flex; gap: 6px; justify-content: center; padding: 16px 0 4px; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 32px; height: 32px; padding: 0 9px; border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); font-size: 13px; background: var(--surface);
    transition: all var(--transition);
}
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager .on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== 侧栏遮罩 / 折叠 ===== */
.side-mask { display: none; }
@media (max-width: 992px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform var(--transition); box-shadow: 12px 0 32px -18px rgba(0,0,0,.5); }
    .admin-app.nav-open .admin-sidebar { transform: none; }
    .admin-app.nav-open .side-mask { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 25; animation: fade-in .2s ease-out; }
    .admin-main { margin-left: 0; }
    .topbar-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        width: 34px; height: 34px; border-radius: var(--radius-sm);
        border: 1px solid var(--border); background: var(--surface); cursor: pointer;
    }
    .topbar-toggle svg { width: 17px; height: 17px; }
    .admin-body { padding: 16px 14px 48px; }
    .admin-topbar { padding: 0 14px; }
}
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .rowlist .row .row-cell { flex-basis: 100%; }
    .row-inner { grid-template-columns: 1fr; }
    .row-del { align-self: flex-start; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .crumb .crumb-root { display: none; }
    .topbar-actions .btn span { display: none; }
}

/* ===== 登录页（独立整页，左右分栏品牌页） ===== */
.login-app { display: flex; min-height: 100vh; }
.login-brand {
    flex: 1.1; position: relative; overflow: hidden;
    background: linear-gradient(140deg, #163bf2 0%, #4584ff 45%, #cf0db9 100%);
    color: #fff; display: flex; flex-direction: column; justify-content: center;
    padding: 48px 56px;
}
.login-brand::before, .login-brand::after {
    content: ''; position: absolute; border-radius: 50%;
    background: rgba(255,255,255,.13); filter: blur(2px);
}
.login-brand::before { width: 360px; height: 360px; right: -110px; top: -90px; }
.login-brand::after { width: 230px; height: 230px; left: -70px; bottom: -60px; }
.brand-mark { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; position: relative; z-index: 1; }
.brand-mark .m-ico { width: 44px; height: 44px; border-radius: 13px; background: rgba(255,255,255,.22); display: grid; place-items: center; font-weight: 800; font-size: 20px; backdrop-filter: blur(6px); }
.brand-mark .m-name { font-size: 17px; font-weight: 700; }
.brand-mark .m-sub { font-size: 12.5px; opacity: .78; }
.login-headline { position: relative; z-index: 1; max-width: 460px; }
.login-headline h1 { font-size: 34px; line-height: 1.35; font-weight: 800; letter-spacing: -.01em; }
.login-headline p { margin-top: 14px; font-size: 14.5px; opacity: .85; line-height: 1.9; }
.login-points { position: relative; z-index: 1; margin-top: 30px; display: flex; flex-direction: column; gap: 12px; }
.login-point { display: flex; align-items: center; gap: 10px; font-size: 13.5px; opacity: .92; }
.login-point svg { width: 17px; height: 17px; flex: 0 0 17px; }
.login-shape { position: absolute; z-index: 0; opacity: .16; }
.login-shape.s1 { width: 180px; right: 8%; bottom: 12%; border: 2px solid #fff; border-radius: 28px; height: 120px; transform: rotate(-18deg); }
.login-shape.s2 { width: 96px; right: 24%; bottom: 30%; border: 2px solid #fff; border-radius: 50%; height: 96px; }

.login-panel { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.login-card { width: 100%; max-width: 372px; }
.login-card .l-title { font-size: 24px; font-weight: 800; }
.login-card .l-sub { font-size: 13.5px; color: var(--text-muted); margin: 6px 0 26px; }
.login-card .field { margin-bottom: 16px; }
.login-card .form-input { min-height: 44px; }
.login-foot { margin-top: 22px; display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--text-muted); }
.login-foot a { color: var(--primary); }
@media (max-width: 880px) {
    .login-app { flex-direction: column; }
    .login-brand { flex: none; padding: 34px 26px; }
    .login-headline h1 { font-size: 25px; }
    .login-points, .login-shape { display: none; }
}

/* ===== 文章编辑器 ===== */
.editor-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.editor-tools .grow { margin-left: auto; }
textarea.editor-area { min-height: 420px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.8; }
.editor-preview {
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px;
    background: var(--surface); min-height: 200px;
}
.editor-preview h1 { font-size: 1.6rem; margin: .8em 0 .5em; }
.editor-preview h2 { font-size: 1.35rem; margin: .8em 0 .5em; }
.editor-preview h3 { font-size: 1.15rem; margin: .8em 0 .5em; }
.editor-preview p { margin: .7em 0; }
.editor-preview ul, .editor-preview ol { padding-left: 1.4em; margin: .7em 0; }
.editor-preview blockquote { border-left: 3px solid var(--primary); background: var(--surface-alt); padding: 8px 14px; margin: .8em 0; border-radius: 0 8px 8px 0; }
.editor-preview code { background: var(--surface-alt); padding: 2px 6px; border-radius: 5px; font-size: .88em; }
.editor-preview pre { background: var(--surface-alt); padding: 14px; border-radius: 10px; overflow: auto; }
.editor-preview pre code { background: none; padding: 0; }
.editor-preview img { border-radius: 10px; margin: .8em 0; }
.editor-preview a { color: var(--primary); text-decoration: underline; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.form-actions .note { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* ===== 拖拽上传高亮 ===== */
.dropzone { border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--text-muted); text-align: center; cursor: pointer; transition: all var(--transition); }
.dropzone:hover, .dropzone.on { border-color: var(--primary); color: var(--primary); background: var(--accent-light); }

/* 行内图片单元（即刻配图，字段名由 renumber 按行号重写） */
.img-cell { display: flex; gap: 8px; align-items: flex-start; }
.img-cell .img-preview.small { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 8px; }
.img-cell .img-actions { gap: 6px; }
.img-cell .field-row { gap: 6px; }
.row-cell:has(.img-cell) { flex: 1 1 280px; }
.rowlist .row textarea.form-input { resize: vertical; min-height: 40px; font-family: inherit; }

/* 后台留言列表 */
.msg-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt); }
.msg-row + .msg-row { margin-top: 10px; }
.msg-row-body { flex: 1; min-width: 0; }
.msg-row-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; font-size: 13px; }
.msg-row-text { margin-top: 6px; font-size: 13.5px; line-height: 1.6; color: var(--text); word-break: break-word; }
.msg-row .btn-danger { flex: 0 0 auto; }
