/* 三餐四季美食谱 · 管理后台换肤（保留全部类名与结构，仅改视觉） */
* { margin:0; padding:0; box-sizing:border-box; }
:root{
  --paper:#F7F2E9; --surface:#FFFDF8; --brand:#C0452F; --brand-deep:#96331F;
  --brand-grad:linear-gradient(135deg,#C0452F,#D9763F); --gold:#C8A35D; --gold-soft:rgba(200,163,93,.16);
  --ink:#241F1B; --muted:#8C7E72; --line:rgba(36,31,27,.1); --green:#6E8B5A; --red:#B5453F;
  --serif:"Noto Serif SC","Songti SC","STSong",serif;
}
body{ font-family:"PingFang SC","Microsoft YaHei",system-ui,sans-serif; background:var(--paper); color:var(--ink); font-size:14px; }
h1,h2,h3,.page-title{ font-family:var(--serif); letter-spacing:1px; }

/* ---------- 登录 ---------- */
.login-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,#96331F 0%,#C0452F 55%,#D9763F 100%); }
.login-card{ background:var(--surface); width:390px; padding:42px 36px 30px; border-radius:22px;
  box-shadow:0 28px 70px rgba(60,20,10,.35); }
.login-logo{ font-size:46px; text-align:center; }
.login-card h1{ text-align:center; font-size:24px; margin-top:10px; color:var(--brand); }
.login-sub{ text-align:center; color:var(--muted); font-size:12px; letter-spacing:2px; margin:6px 0 24px; }
.login-card label{ display:block; margin:14px 0 6px; color:var(--ink); font-size:13px; }
.login-card input{ width:100%; height:44px; border:1px solid var(--line); border-radius:12px; padding:0 16px; font-size:14px; outline:none; background:#fff; }
.login-card input:focus{ border-color:var(--brand); }
.login-tip{ margin-top:16px; font-size:12px; color:var(--muted); text-align:center; }

/* ---------- 布局 ---------- */
.layout{ display:flex; min-height:100vh; }
.sidebar{ width:216px; background:#2A211A; color:#E9DFD2; display:flex; flex-direction:column; flex-shrink:0; position:sticky; top:0; height:100vh; }
.brand{ display:flex; align-items:center; gap:10px; font-size:18px; font-weight:700; font-family:var(--serif); padding:24px 20px; border-bottom:1px solid rgba(255,255,255,.08); }
.brand-icon{ font-size:24px; }
#nav{ flex:1; padding:14px 12px; display:flex; flex-direction:column; gap:4px; }
#nav a{ display:flex; gap:10px; align-items:center; padding:12px 14px; border-radius:12px; color:#C9BCAD; cursor:pointer; text-decoration:none; transition:.15s; }
#nav a:hover{ background:rgba(255,255,255,.06); color:#fff; }
#nav a.active{ background:var(--brand-grad); color:#fff; }
.sidebar-foot{ padding:14px 18px; border-top:1px solid rgba(255,255,255,.08); font-size:13px; }
.admin-name{ margin-bottom:8px; }
.logout{ color:var(--gold); cursor:pointer; }
.logout:hover{ color:#fff; }

.main{ flex:1; padding:28px 32px; min-width:0; }
.page-title{ font-size:22px; margin-bottom:18px; color:var(--brand); }

/* ---------- 卡片/面板 ---------- */
.stat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:18px; }
.stat-card{ background:var(--surface); border-radius:16px; padding:24px; box-shadow:0 8px 28px rgba(150,51,31,.07); }
.stat-num{ font-size:34px; font-weight:800; color:var(--brand); font-family:var(--serif); }
.stat-label{ color:var(--muted); margin-top:4px; }
.panel{ background:var(--surface); border-radius:16px; padding:22px 24px; margin-bottom:18px; box-shadow:0 8px 28px rgba(150,51,31,.07); }
.panel h3{ font-size:16px; margin-bottom:14px; color:var(--ink); }

.cat-bars{ display:flex; flex-direction:column; gap:10px; }
.cat-bar{ display:flex; align-items:center; gap:10px; }
.cat-bar .name{ width:96px; color:var(--ink); }
.cat-bar .track{ flex:1; height:16px; background:#F1E9DC; border-radius:999rpx; border-radius:999px; overflow:hidden; }
.cat-bar .fill{ height:100%; background:var(--brand-grad); border-radius:999px; }
.cat-bar .val{ width:36px; text-align:right; color:var(--muted); }

/* ---------- 表单/按钮 ---------- */
.input{ width:100%; border:1px solid var(--line); border-radius:10px; padding:10px 14px; font-size:13.5px; outline:none; background:#fff; font-family:inherit; }
.input:focus{ border-color:var(--brand); }
label{ display:block; margin:12px 0 6px; font-size:13px; color:var(--ink); }
.btn-primary{ background:var(--brand-grad); color:#fff; border:none; border-radius:10px; padding:10px 20px; cursor:pointer; font-size:13.5px; transition:.15s; }
.btn-primary:hover{ filter:brightness(1.05); }
.btn-primary.block{ width:100%; margin-top:20px; height:46px; font-size:15px; }
.btn-ghost{ background:#fff; border:1px solid var(--line); border-radius:10px; padding:9px 16px; cursor:pointer; font-size:13px; color:var(--ink); }
.btn-ghost:hover{ border-color:var(--brand); color:var(--brand); }
.btn-ghost.sm{ padding:5px 12px; font-size:12px; }
.btn-danger{ background:#fff; border:1px solid #EBC6C4; color:var(--red); border-radius:9px; padding:7px 13px; cursor:pointer; font-size:12.5px; }
.btn-danger:hover{ background:var(--red); color:#fff; border-color:var(--red); }
.btn-edit{ background:#fff; border:1px solid #CFDFD4; color:var(--green); border-radius:9px; padding:7px 13px; cursor:pointer; font-size:12.5px; margin-right:6px; }
.btn-edit:hover{ background:var(--green); color:#fff; border-color:var(--green); }
.upload-btn{ display:inline-block; background:var(--gold-soft); color:#8a6d35; border:1px dashed var(--gold); border-radius:10px; padding:9px 18px; cursor:pointer; font-size:13px; white-space:nowrap; }
.upload-btn:hover{ background:#F1E4C8; }
.toolbar{ display:flex; gap:10px; align-items:center; margin-bottom:14px; flex-wrap:wrap; }
.toolbar .input{ width:auto; }
.form-inline{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.form-inline .input{ width:auto; }
.muted{ color:var(--muted); font-size:12.5px; }
.row-between{ display:flex; justify-content:space-between; align-items:center; margin:16px 0 8px; }

/* ---------- 表格 ---------- */
.table{ width:100%; border-collapse:collapse; }
.table th{ text-align:left; background:#F6EFE3; padding:11px 13px; font-weight:600; color:#6b5f55; font-size:13px; white-space:nowrap; }
.table td{ padding:11px 13px; border-top:1px solid var(--line); vertical-align:middle; font-size:13.5px; }
.table tr:hover td{ background:#FBF5EA; }
.thumb{ width:58px; height:44px; object-fit:cover; border-radius:8px; background:#F1E9DC; }
.tag-status{ padding:3px 10px; border-radius:999px; font-size:12px; white-space:nowrap; }
.tag-on{ background:#E2ECDF; color:var(--green); }
.tag-off{ background:#EFE7DC; color:#999; }
.pager{ display:flex; gap:14px; align-items:center; justify-content:flex-end; margin-top:14px; }

/* ---------- 编辑器弹层 ---------- */
.mask{ position:fixed; inset:0; background:rgba(36,25,15,.5); z-index:50; display:flex; justify-content:center; align-items:flex-start; padding:26px; overflow:auto; }
.editor{ background:var(--surface); border-radius:18px; width:min(900px,100%); }
.editor-head{ display:flex; justify-content:space-between; align-items:center; padding:20px 26px; border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--surface); border-radius:18px 18px 0 0; z-index:2; }
.editor-head h3{ font-size:18px; color:var(--brand); }
.editor-head button{ margin-left:8px; }
.editor-body{ padding:22px 26px 32px; }
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:0 18px; }
.cover-row{ display:flex; gap:12px; align-items:center; }
.cover-preview{ width:130px; height:92px; border-radius:12px; background:#F1E9DC; display:flex; align-items:center; justify-content:center; color:#B3A89E; font-size:12px; overflow:hidden; flex-shrink:0; }
.cover-preview img{ width:100%; height:100%; object-fit:cover; }
.check-line{ display:flex; align-items:center; gap:6px; margin-top:10px; }
.check-line input{ width:15px; height:15px; }

.ing-list{ display:flex; flex-direction:column; gap:8px; }
.ing-row{ display:flex; gap:8px; }
.ing-row .input{ flex:1; }
.step-item{ border:1px solid var(--line); border-radius:14px; padding:14px; margin-bottom:10px; background:#FDFAF3; }
.step-head{ display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.step-no{ background:var(--brand-grad); color:#fff; width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:13px; flex-shrink:0; }
.step-item textarea{ width:100%; border:1px solid var(--line); border-radius:10px; padding:10px 13px; font-family:inherit; font-size:13.5px; resize:vertical; outline:none; }
.step-foot{ display:flex; gap:10px; align-items:center; margin-top:8px; }
.step-preview{ width:74px; height:56px; border-radius:9px; background:#eee; overflow:hidden; display:flex; align-items:center; justify-content:center; color:#aaa; font-size:11px; }
.step-preview img{ width:100%; height:100%; object-fit:cover; }
.step-foot input{ flex:1; border:1px solid var(--line); border-radius:9px; padding:8px 11px; font-size:12.5px; outline:none; }

/* ---------- toast ---------- */
.toast{ position:fixed; left:50%; top:30px; transform:translateX(-50%) translateY(-20px); background:#2A211A; color:#fff; padding:12px 24px; border-radius:12px; font-size:14px; opacity:0; pointer-events:none; transition:.25s; z-index:99; }
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.toast.err{ background:var(--red); }
.toast.ok{ background:var(--green); }

@media(max-width:900px){ .stat-grid{grid-template-columns:repeat(2,1fr)} .form-grid{grid-template-columns:1fr} .sidebar{width:64px}.sidebar span,.brand span{display:none} }

/* ---------- 动态审核 ---------- */
.nav-badge{ position:absolute; top:6px; right:8px; min-width:18px; height:18px; padding:0 5px;
  background:var(--brand); color:#fff; border-radius:999px; font-size:11px; line-height:18px;
  text-align:center; font-weight:600; box-shadow:0 0 0 2px #2A211A; }
#nav a{ position:relative; }

.post-list{ display:flex; flex-direction:column; gap:14px; }
.post-card{ background:var(--surface); border-radius:16px; padding:18px 20px;
  box-shadow:0 8px 28px rgba(150,51,31,.07); }
.post-header{ display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.post-avatar{ width:48px; height:48px; border-radius:50%; object-fit:cover; background:#F1E9DC;
  flex-shrink:0; border:2px solid var(--gold-soft); }
.post-avatar-fallback{ width:48px; height:48px; border-radius:50%; background:var(--gold-soft);
  display:flex; align-items:center; justify-content:center; font-size:22px; flex-shrink:0; }
.post-meta{ flex:1; min-width:0; }
.post-nickname{ font-weight:600; color:var(--ink); font-size:14.5px; }
.post-time{ color:var(--muted); font-size:12px; margin-top:2px; }
.post-recipe-tag{ display:inline-block; background:var(--gold-soft); color:#8a6d35;
  border-radius:999px; padding:2px 10px; font-size:12px; margin-top:6px; }
.post-content{ margin:6px 0 10px; line-height:1.7; color:var(--ink); white-space:pre-wrap; word-break:break-word; }
.post-images{ display:grid; grid-template-columns:repeat(auto-fill,80px); gap:8px; margin-bottom:10px; }
.post-img{ width:80px; height:80px; object-fit:cover; border-radius:10px; cursor:pointer;
  background:#F1E9DC; transition:.15s; }
.post-img:hover{ transform:scale(1.04); box-shadow:0 4px 12px rgba(0,0,0,.15); }
.post-foot{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.post-likes{ color:var(--muted); font-size:12.5px; }
.post-status{ padding:3px 10px; border-radius:999px; font-size:12px; white-space:nowrap; }
.status-pending{ background:var(--gold-soft); color:#8a6d35; }
.status-approved{ background:#E2ECDF; color:var(--green); }
.status-rejected{ background:#EFE7DC; color:#999; }
.post-reject-reason{ color:var(--red); font-size:12.5px; margin-top:6px; }
.post-actions{ margin-left:auto; display:flex; gap:8px; }
.btn-approve{ background:#fff; border:1px solid #CFDFD4; color:var(--green); border-radius:9px;
  padding:7px 14px; cursor:pointer; font-size:12.5px; }
.btn-approve:hover{ background:var(--green); color:#fff; border-color:var(--green); }
.btn-reject{ background:#fff; border:1px solid #EBC6C4; color:var(--red); border-radius:9px;
  padding:7px 14px; cursor:pointer; font-size:12.5px; }
.btn-reject:hover{ background:var(--red); color:#fff; border-color:var(--red); }
.btn-delete{ background:#fff; border:1px solid var(--line); color:#888; border-radius:9px;
  padding:7px 14px; cursor:pointer; font-size:12.5px; }
.btn-delete:hover{ background:#eee; }

/* 筛选 Tab */
.filter-tabs{ display:flex; gap:6px; background:#F1E9DC; border-radius:12px; padding:4px; }
.filter-tab{ background:transparent; border:none; padding:7px 16px; border-radius:9px;
  cursor:pointer; font-size:13px; color:var(--muted); transition:.15s; }
.filter-tab:hover{ color:var(--ink); }
.filter-tab.active{ background:var(--surface); color:var(--brand); font-weight:600;
  box-shadow:0 2px 6px rgba(0,0,0,.08); }

/* 灯箱 */
.lightbox{ position:fixed; inset:0; background:rgba(20,12,6,.92); z-index:80;
  display:flex; align-items:center; justify-content:center; }
.lightbox-img{ max-width:90%; max-height:88vh; border-radius:8px; box-shadow:0 10px 40px rgba(0,0,0,.5); }
.lightbox-close{ position:absolute; top:20px; right:26px; color:#fff; font-size:30px;
  cursor:pointer; line-height:1; opacity:.8; }
.lightbox-close:hover{ opacity:1; }
.lightbox-nav{ position:absolute; top:50%; transform:translateY(-50%); color:#fff;
  font-size:52px; cursor:pointer; padding:14px 18px; opacity:.6; user-select:none; }
.lightbox-nav:hover{ opacity:1; }
.lightbox-nav.prev{ left:10px; }
.lightbox-nav.next{ right:10px; }

/* 驳回弹窗 */
.reject-modal{ background:var(--surface); border-radius:16px; width:min(460px,92%); padding:22px 24px; }
.reject-modal h3{ font-size:17px; color:var(--brand); margin-bottom:6px; }
.reject-modal textarea{ width:100%; border:1px solid var(--line); border-radius:10px;
  padding:10px 13px; font-family:inherit; font-size:13.5px; resize:vertical; outline:none; }
.reject-modal textarea:focus{ border-color:var(--brand); }

/* ---------- v7：图文内容块编辑器 ---------- */
.block-toolbar{ display:flex; gap:8px; margin:4px 0 10px; flex-wrap:wrap; }
.block-list{ display:flex; flex-direction:column; gap:10px; }
.block-card{ border:1px solid var(--line); border-radius:14px; padding:12px 14px; background:#FDFAF3; }
.block-head{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.block-head button{ margin-left:0; }
.block-type{ background:var(--gold-soft); color:#8a6d35; border-radius:999px; padding:2px 12px; font-size:12px; }
.blk-textarea{ width:100%; border:1px solid var(--line); border-radius:10px; padding:10px 13px;
  font-family:inherit; font-size:13.5px; resize:vertical; outline:none; }
.blk-textarea:focus{ border-color:var(--brand); }
.blk-preview{ width:140px; height:100px; border-radius:10px; background:#F1E9DC; overflow:hidden;
  display:flex; align-items:center; justify-content:center; color:#B3A89E; font-size:12px; margin-bottom:8px; }
.blk-preview img{ width:100%; height:100%; object-fit:cover; }
.block-card .step-foot input{ flex:1; }
.blk-prod{ display:flex; gap:12px; align-items:center; background:var(--surface); border:1px solid var(--gold-soft);
  border-radius:12px; padding:10px 12px; }
.blk-prod-img{ width:72px; height:72px; border-radius:10px; object-fit:cover; background:#F1E9DC; flex-shrink:0; }
.blk-prod-main{ flex:1; min-width:0; }
.blk-prod-name{ font-weight:600; font-size:14px; }
.blk-prod-sub{ color:var(--brand); font-size:13px; margin:2px 0; }
.blk-prod-desc{ color:var(--muted); font-size:12.5px; }
.ellipsis-cell{ max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ---------- v7：商品库 ---------- */
.prod-edit-modal{ width:min(560px,94%); max-height:88vh; overflow:auto; }
.prod-pick-modal{ width:min(640px,94%); max-height:86vh; display:flex; flex-direction:column; }
.prod-pick-list{ overflow:auto; display:flex; flex-direction:column; gap:8px; }
.prod-pick-item{ display:flex; align-items:center; gap:12px; padding:10px 12px; border:1px solid var(--line);
  border-radius:12px; cursor:pointer; background:#FDFAF3; transition:.15s; }
.prod-pick-item:hover{ border-color:var(--gold); background:#FBF3E2; }
.prod-pick-img{ width:56px; height:56px; border-radius:9px; object-fit:cover; background:#F1E9DC; }
.prod-pick-main{ flex:1; min-width:0; }
.prod-pick-name{ font-weight:600; font-size:14px; }
.prod-pick-sub{ color:var(--muted); font-size:12.5px; }

/* ---------- v7：编辑器底部 sticky 保存条 ---------- */
.editor-foot{ position:sticky; bottom:0; display:flex; gap:10px; justify-content:flex-end; align-items:center;
  padding:14px 26px; border-top:1px solid var(--line); background:var(--surface);
  border-radius:0 0 18px 18px; box-shadow:0 -8px 24px rgba(150,51,31,.06); }

/* ---------- v7：表格斑马纹 + 大屏舒适排版 ---------- */
.table tbody tr:nth-child(even) td{ background:#FBF5EA; }
.table tbody tr:nth-child(even):hover td{ background:#F6EBD7; }
@media(min-width:1280px){ .main{ padding:36px 44px; } }

/* 移动端适配 */
@media(max-width:900px){
  .post-images{ grid-template-columns:repeat(auto-fill,64px); }
  .post-img{ width:64px; height:64px; }
  .post-actions{ margin-left:0; width:100%; }
  .filter-tabs{ overflow-x:auto; }
  .filter-tab{ white-space:nowrap; }
  .lightbox-nav{ font-size:38px; padding:8px; }
  .ellipsis-cell{ max-width:120px; }
}

/* ---------- 仪表盘趋势（纯 CSS 条形图，无渐变） ---------- */
.trend-chart{ display:flex; align-items:flex-end; gap:6px; height:220px; padding-top:10px; }
.trend-col{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; min-width:0; }
.trend-bar{ width:70%; max-width:26px; background:var(--brand); border-radius:4px 4px 0 0; min-height:2px; transition:height .2s; }
.trend-col:hover .trend-bar{ background:var(--brand-deep); }
.trend-val{ font-size:10px; color:var(--muted); margin-bottom:4px; white-space:nowrap; }
.trend-x{ font-size:10px; color:var(--muted); margin-top:6px; transform:rotate(-45deg); white-space:nowrap; }
.trend-empty{ color:var(--muted); text-align:center; padding:40px 0; }

/* ---------- 合集：已选食谱 chips ---------- */
.picked-list{ display:flex; flex-direction:column; gap:6px; max-height:220px; overflow:auto;
  border:1px dashed var(--line); border-radius:12px; padding:10px; background:#FDFAF3; }
.picked-item{ display:flex; align-items:center; gap:10px; padding:6px 8px; border-radius:9px; background:#fff; }
.picked-item img{ width:40px; height:32px; object-fit:cover; border-radius:6px; background:#F1E9DC; }
.picked-item .picked-main{ flex:1; min-width:0; }
.picked-item .picked-title{ font-size:13px; }
.picked-item .picked-sub{ font-size:11.5px; color:var(--muted); }
.picked-empty{ color:var(--muted); font-size:12.5px; text-align:center; padding:14px 0; }
.rp-picked{ border-color:var(--green) !important; background:#EDF3EA !important; }
.rp-picked::after{ content:"✓ 已选"; color:var(--green); font-size:12px; margin-left:8px; }