:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1f2329;
  --ink-2: #646a73;
  --line: #e5e6eb;
  --brand: #2b5cff;
  --brand-weak: #eef3ff;
  --ok: #00b578;
  --ok-weak: #e6f7f0;
  --warn: #ff8800;
  --warn-weak: #fff4e5;
  --danger: #fa5151;
  --danger-weak: #ffeeee;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; }

.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 0 20px; height: 56px; }
.logo { font-size: 16px; font-weight: 700; white-space: nowrap; }
.brand-tag { font-size: 12px; font-weight: 400; color: var(--ink-2); margin-left: 8px; }
.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.tab { border: none; background: none; padding: 8px 12px; font-size: 14px; color: var(--ink-2); cursor: pointer; border-radius: 8px; white-space: nowrap; }
.tab:hover { background: var(--bg); }
.tab.active { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.mode-badge { font-size: 12px; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.mode-badge.demo { background: var(--warn-weak); color: var(--warn); }
.mode-badge.live { background: var(--ok-weak); color: var(--ok); }

.container { max-width: 1280px; margin: 20px auto; padding: 0 20px 40px; }
.panel { display: none; }
.panel.active { display: block; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); margin-bottom: 16px; }
.card h3 { font-size: 14px; margin-bottom: 12px; }
.spacer { flex: 1; }
.hint { color: var(--ink-2); font-size: 13px; }

.compose-grid { display: grid; grid-template-columns: 420px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .compose-grid { grid-template-columns: 1fr; } }

.dropzone { border: 1.5px dashed #c9cdd4; border-radius: var(--radius); padding: 24px; text-align: center; color: var(--ink-2); cursor: pointer; transition: all .15s; margin-top: 10px; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-weak); }
.dropzone .hint { font-size: 12px; margin-top: 6px; color: #8f959e; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .rm { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; cursor: pointer; line-height: 1; }
.thumb.kb-ref { border-color: var(--brand); }
.thumb .kb-tag { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(43,92,255,.85); color: #fff; font-size: 10px; text-align: center; padding: 1px 0; }
.kb-pick-bar { display: flex; align-items: center; justify-content: space-between; }

.form-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.form-row.column { flex-direction: column; align-items: stretch; }
.form-row label { width: 64px; flex-shrink: 0; color: var(--ink-2); font-size: 13px; }
.form-row.column label { width: auto; }
select, textarea, input[type="text"], input[type="password"], input[type="date"], input[type="number"] {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; font-family: inherit; width: 100%; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
select:focus, textarea:focus, input:focus { outline: 2px solid var(--brand-weak); border-color: var(--brand); }

.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 16px; font-size: 14px; cursor: pointer; color: var(--ink); }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { opacity: .88; }
.btn.block { width: 100%; padding: 11px; font-weight: 600; }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.placeholder { color: #8f959e; font-size: 13px; padding: 20px 0; text-align: center; }

.candidate { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.candidate .angle { display: inline-block; font-size: 12px; color: var(--brand); background: var(--brand-weak); padding: 2px 10px; border-radius: 20px; margin-bottom: 8px; }
.candidate textarea { min-height: 84px; border: none; background: var(--bg); border-radius: 8px; padding: 10px; }
.candidate .self-comment { margin-top: 6px; border: 1px dashed #c9cdd4; background: #fff; font-size: 13px; padding: 6px 10px; }
.post-time { margin-top: 6px; font-size: 13px; color: var(--ink-2); background: #eef6ff; border: 1px solid #d4e8ff; border-radius: 8px; padding: 6px 10px; line-height: 1.5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-time .pt-label { color: var(--brand); font-weight: 600; flex: none; }
.post-time input[type="datetime-local"] { border: 1px solid #b7d7ff; border-radius: 6px; padding: 3px 6px; font-size: 13px; background: #fff; color: var(--ink); }
.post-time .pt-why { flex: 1; min-width: 120px; }
.pub-time-wrap { display: inline-flex; align-items: center; }
.pub-time-wrap .pub-time-input { border: 1px solid #b7d7ff; border-radius: 6px; padding: 5px 8px; font-size: 13px; background: #fff; color: var(--ink); }
.candidate .ops { display: flex; gap: 8px; margin-top: 8px; }
.sub-self { font-size: 13px; color: var(--ink-2); background: #fff8e6; border-radius: 8px; padding: 8px 12px; }

/* ===== 日历 ===== */
.cal-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; }
.cal-toolbar strong { min-width: 110px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-cell { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-height: 120px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cal-cell[data-day] { cursor: pointer; }
.cal-cell[data-day]:hover { border-color: var(--brand); }
.day-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: var(--card); }
.day-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; font-size: 13px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); margin-bottom: 6px; }
.day-head-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
.day-head-ops { display: flex; align-items: flex-start; gap: 6px; flex: none; }
.day-head .status { font-size: 12px; }
.day-topic { font-size: 13px; color: var(--ink); margin: 0 0 8px; line-height: 1.5; word-break: break-word; }
.day-body .sub-text { font-size: 13px; line-height: 1.7; white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: 10px; margin: 6px 0; }
.day-sec { margin-bottom: 14px; }
.day-sec-title { font-size: 13px; font-weight: 600; padding: 7px 10px; border-radius: 6px; margin-bottom: 8px; }
.day-sec-title.pub { background: #e8f7f0; color: var(--ok); }
.day-sec-title.plan { background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.day-sec-title.ev { background: var(--warn-weak); color: var(--warn); }

/* ===== 每月大事件 ===== */
.cal-event { border-radius: 6px; padding: 3px 6px; font-size: 12px; cursor: pointer; line-height: 1.4; margin-bottom: 2px; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event:hover { border-color: var(--brand); }
.cal-event.hot { background: var(--warn-weak); color: var(--warn); border-color: #f4d9b8; }
.cal-event.biz { background: var(--brand-weak); color: var(--brand); border-color: #ccdaff; }
.day-event { display: flex; align-items: center; gap: 10px; border: 1px solid #f4d9b8; border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; background: #fffdf8; }
.day-event.biz { border-color: #ccdaff; background: #fbfcff; }
.day-event .ev-kind { flex: none; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 2px 6px; background: var(--warn); color: #fff; }
.day-event.biz .ev-kind { background: var(--brand); }
.day-event .ev-main { flex: 1; min-width: 0; }
.day-event .ev-title { font-size: 14px; font-weight: 600; line-height: 1.5; }
.day-pub { display: flex; gap: 12px; border: 1px solid #bfe6d4; border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; background: #fbfffd; }
.day-pub-time { font-weight: 700; color: var(--ok); font-size: 14px; flex: none; padding-top: 2px; font-variant-numeric: tabular-nums; }
.day-pub-main { flex: 1; min-width: 0; }
.day-pub-main .sub-text { font-size: 13px; line-height: 1.7; white-space: pre-wrap; background: #fff; border-radius: 8px; padding: 10px; margin-top: 6px; border: 1px solid #e3f2ea; }
.chip-edit { border: 1px solid transparent; background: transparent; color: var(--ink-2); border-radius: 4px; font-size: 12px; line-height: 16px; padding: 0 3px; cursor: pointer; margin-left: 4px; flex: none; opacity: 0.6; }
.chip-edit:hover { opacity: 1; background: var(--line); }
.compose-ctx { display: flex; align-items: center; gap: 8px; background: #eef6ff; border: 1px solid #d4e8ff; color: var(--ink-2); font-size: 13px; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.compose-ctx b { color: var(--brand); }
.compose-ctx .ctx-clear { border: none; background: none; color: #8f959e; cursor: pointer; font-size: 16px; line-height: 1; margin-left: auto; padding: 0 2px; }
.compose-ctx .ctx-clear:hover { color: var(--danger); }
.cal-cell.out { opacity: .38; }
.cal-cell.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand-weak); }
.cal-dow { text-align: center; color: var(--ink-2); font-size: 12px; padding: 4px 0; }
.cal-day { font-size: 12px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; }
.cal-add { border: none; background: none; color: #b0b6bf; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.cal-add:hover { color: var(--brand); }
.plan-chip { border-radius: 6px; padding: 4px 6px; font-size: 12px; cursor: pointer; border: 1px solid var(--line); background: var(--bg); line-height: 1.4; transition: border-color .15s, background .15s; }
.plan-chip:hover { border-color: var(--brand); background: var(--card); }
.plan-chip .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
.dot.todo { background: #b0b6bf; } .dot.draft { background: var(--warn); } .dot.generated { background: #8f6fff; }
.dot.pending { background: var(--warn); } .dot.approved { background: var(--ok); } .dot.published { background: var(--brand); }
.plan-chip .pmeta { color: var(--ink-2); font-size: 11px; }

/* ===== 抽屉 ===== */
.drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: -460px; width: 440px; max-width: 92vw; height: 100vh; background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,.12); z-index: 41; transition: right .22s; overflow-y: auto; padding: 18px; }
.drawer.open { right: 0; }
.drawer h3 { font-size: 15px; margin-bottom: 4px; }
.drawer .drawer-close { position: absolute; top: 2px; right: 4px; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border: none; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink-2); }
.drawer .drawer-close:hover { color: var(--ink-1); }
.drawer .sec { margin-top: 16px; }
.drawer .sec > label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }

/* ===== 素材库 ===== */
.kb-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.kb-side h3 { margin-bottom: 8px; }
.kb-side #kbFolderList { max-height: calc(100vh - 280px); overflow-y: auto; }
.kb-side #kbFolderList::-webkit-scrollbar { width: 5px; }
.kb-side #kbFolderList::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.kb-folder { padding: 7px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 6px; font-size: 13px; color: var(--ink-2); }
.kb-folder .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-folder:hover { background: var(--bg); }
.kb-folder.active { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.kb-folder .cnt { font-size: 12px; color: #8f959e; }
.kb-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 18px; }
/* 右侧小分类标签行（学科学段/季节/生活哲思） */
.kb-facets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.kb-facets:empty { display: none; }
.facet-chip { padding: 4px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 12.5px; color: var(--ink-2); cursor: pointer; user-select: none; white-space: nowrap; }
.facet-chip:hover { border-color: var(--brand); color: var(--brand); }
.facet-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.facet-chip i { font-style: normal; font-size: 11px; opacity: .6; margin-left: 3px; }
.facet-chip.active i { opacity: .85; }
/* 卡片上的小分类角标 */
.facet-tag { display: inline-block; background: var(--brand-weak); color: var(--brand); font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 6px; margin-right: 6px; }
/* 多图素材：卡片数量角标 */
.img-count { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 8px; z-index: 2; }
/* 素材详情弹窗：完整文案 + 图集左右滑 */
.kb-view-text { max-height: 26vh; overflow-y: auto; font-size: 14px; line-height: 1.8; white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.kb-carousel { position: relative; display: flex; align-items: center; justify-content: center; background: #000; border-radius: 10px; overflow: hidden; }
.kb-carousel img { max-width: 100%; max-height: 56vh; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.car-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(255,255,255,.25); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; z-index: 2; backdrop-filter: blur(2px); }
.car-btn:hover { background: rgba(255,255,255,.45); }
.car-btn.prev { left: 10px; } .car-btn.next { right: 10px; }
.car-idx { position: absolute; bottom: 10px; right: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; border-radius: 10px; padding: 2px 10px; }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kb-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative; }
.kb-item img { width: 100%; height: 110px; object-fit: cover; display: block; }
.kb-item .kb-text-body { height: 110px; padding: 10px; font-size: 12px; color: var(--ink-2); overflow: hidden; background: var(--bg); line-height: 1.5; }
.kb-item .kb-info { padding: 8px 10px; }
.kb-item .kb-desc { font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-item .kb-meta { font-size: 11px; color: #8f959e; margin-top: 4px; }
.kb-item .kb-del { position: absolute; top: 6px; right: 6px; border: none; background: rgba(0,0,0,.5); color: #fff; border-radius: 50%; width: 20px; height: 20px; font-size: 12px; cursor: pointer; display: none; }
.kb-item:hover .kb-del { display: block; }
.kb-item.selectable { cursor: pointer; }
.kb-item.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-weak); }
.kb-item .kb-check { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 1.5px solid #c9cdd4; display: none; align-items: center; justify-content: center; font-size: 12px; color: var(--brand); z-index: 3; }
.kb-item.selectable .kb-check { display: flex; }
.kb-item.selected .kb-check { background: var(--brand); color: #fff; border-color: var(--brand); }
.kb-item.selectable .inbox-tag { top: 30px; }

/* ===== 人设 ===== */
.persona-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.persona-card .p-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.persona-card .p-title strong { font-size: 15px; }
.persona-card .p-account { font-size: 12px; color: var(--ink-2); }
.persona-card p { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; line-height: 1.6; }
.persona-card .p-ex { background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--ink-2); line-height: 1.6; margin-top: 8px; }
.persona-card .ops { display: flex; gap: 8px; margin-top: 10px; }

/* ===== 审核 / 发布 ===== */
.reviewer-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reviewer-bar input { width: 160px; }
.sub-card { display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
@media (max-width: 700px) { .sub-card { grid-template-columns: 1fr; } }
.sub-imgs { display: flex; flex-wrap: wrap; gap: 6px; align-content: start; }
.sub-imgs img { width: 62px; height: 62px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.sub-main { display: flex; flex-direction: column; gap: 8px; }
.sub-meta { font-size: 12px; color: var(--ink-2); display: flex; gap: 10px; flex-wrap: wrap; }
.sub-text { background: var(--bg); border-radius: 8px; padding: 12px; line-height: 1.7; white-space: pre-wrap; }
.sub-text.editable { border: 1px solid var(--brand-weak); min-height: 70px; outline: none; }
.sub-text.editable:focus { border-color: var(--brand); }
.sub-comment { font-size: 13px; background: var(--danger-weak); color: var(--danger); padding: 8px 10px; border-radius: 8px; }
.sub-ops { display: flex; gap: 8px; flex-wrap: wrap; }

.status { font-size: 12px; padding: 2px 10px; border-radius: 20px; display: inline-block; }
.status.pending { background: var(--warn-weak); color: var(--warn); }
.status.approved { background: var(--ok-weak); color: var(--ok); }
.status.rejected { background: var(--danger-weak); color: var(--danger); }
.status.published { background: #eef0f3; color: var(--ink-2); }

/* ===== 数据面板 ===== */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat-card .num { font-size: 28px; font-weight: 700; }
.stat-card .lbl { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: 1fr; } }
.donut-flex { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.legend { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.bar-row .bar-name { width: 90px; flex-shrink: 0; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar-track { flex: 1; background: var(--bg); border-radius: 4px; height: 14px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: var(--brand); border-radius: 4px; }
.bar-row .bar-val { width: 34px; text-align: right; color: var(--ink-2); }
.scrm-placeholder { background: repeating-linear-gradient(45deg, #fff, #fff 12px, #fafbfc 12px, #fafbfc 24px); }

/* ===== 弹层 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-mask.open { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 20px; width: 480px; max-width: 92vw; max-height: 85vh; overflow-y: auto; }
.modal h3 { margin-bottom: 14px; }
.modal .ops { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--ink); color: #fff; padding: 10px 22px; border-radius: 8px; font-size: 14px; opacity: 0; transition: all .25s; z-index: 100; pointer-events: none; max-width: 80vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }
.empty { text-align: center; color: #8f959e; padding: 40px 0; }

/* 审核台编辑条：自评论 + 发布时间一起改 */
.edit-bar input[type="text"] { flex: 1; min-width: 200px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; background: var(--card); }
.edit-bar input[type="datetime-local"] { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; background: var(--card); }

/* 历史重复提醒（和老板发过的旧帖太像时提示） */
.dup-warn { margin-top: 6px; font-size: 13px; color: #8a5a00; background: #fff7e6; border: 1px solid #ffd591; border-radius: 8px; padding: 6px 10px; line-height: 1.5; }

/* 红线扫描提醒（分数/承诺/政策/价格等敏感表述，生成与审核时兜底自查） */
.risk-warn { margin-top: 6px; font-size: 13px; color: #9a3400; background: #fff3e0; border: 1px solid #ffab6b; border-radius: 8px; padding: 6px 10px; line-height: 1.6; }
.risk-warn b { color: #c05600; }

/* ===== 移动端适配 / PWA 安全区 ===== */
body { padding-top: env(safe-area-inset-top); }

@media (max-width: 760px) {
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 6px 12px 0; gap: 6px; }
  .logo { font-size: 15px; flex: none; padding-bottom: 6px; }
  .tabs { order: 3; width: 100%; gap: 4px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .tab { padding: 6px 10px; font-size: 13px; }
  .mode-badge { margin-left: auto; font-size: 11px; padding: 2px 8px; }
  .container { margin: 12px auto; padding: 0 12px 24px; }

  /* 素材库：侧栏变横向 chips */
  .kb-layout { grid-template-columns: 1fr; }
  .kb-side { margin-bottom: 12px; padding: 12px; }
  .kb-side h3 { font-size: 13px; margin-bottom: 8px; }
  .kb-side #kbFolderList { max-height: none; display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .kb-folder { flex: none; background: var(--bg); padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
  .kb-folder.active { background: var(--brand); color: #fff; }
  .kb-folder .cnt { color: inherit; opacity: .75; }
  .kb-toolbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .kb-toolbar input { min-width: 100%; order: -1; }
  .kb-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .kb-item img, .kb-item .kb-text-body { height: 96px; }

  /* 日历：工具栏换行，格子更紧凑 */
  .cal-toolbar { flex-wrap: wrap; padding: 10px 12px; }
  .cal-toolbar strong { min-width: auto; flex: 1; text-align: left; }
  .cal-toolbar .spacer { display: none; }
  .cal-grid { gap: 4px; }
  .cal-cell { min-height: 88px; padding: 5px; }
  .cal-event { font-size: 10px; padding: 2px 4px; }
  .cal-day { font-size: 11px; }

  /* 抽屉：小屏全屏 */
  .drawer { width: 100vw; right: -100vw; padding: 16px; padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

  /* 弹层 */
  .modal { padding: 16px; max-height: 92vh; }
}

/* ================================================================
 * 图片编辑器（v6）：马赛克 / 红框 / 艺术字 / 表情
 * ================================================================ */
.thumb .edit { position: absolute; bottom: 2px; right: 2px; width: 22px; height: 20px; border-radius: 6px; border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; cursor: pointer; line-height: 1; padding: 0; }
.thumb .edit:hover { background: rgba(0,0,0,.8); }
.privacy-hint { color: #fa5151; font-size: 12px; }
.ed-tools { display: flex; gap: 8px; margin: 10px 0 8px; flex-wrap: wrap; }
.ed-tool { padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font-size: 13px; cursor: pointer; }
.ed-tool.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.ed-opts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; min-height: 32px; }
.ed-opts input[type="text"] { border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 13px; }
.ed-opts input[type="range"] { width: 100px; }
.ed-opts select { border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; font-size: 13px; }
.ed-color { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.ed-color.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(43,92,255,.35); }
.ed-emoji { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font-size: 17px; cursor: pointer; padding: 0; }
.ed-emoji.active { border-color: var(--brand); background: rgba(43,92,255,.12); }
.ed-wrap { display: flex; justify-content: center; background: #f0f1f5; border-radius: 10px; padding: 8px; margin-bottom: 10px; max-height: 58vh; overflow: auto; }
.ed-wrap canvas { max-width: 100%; max-height: 54vh; border-radius: 6px; touch-action: none; cursor: crosshair; box-shadow: 0 2px 8px rgba(0,0,0,.08); }

/* 日历格子折叠与当日计划列表 */
.plan-more { font-size: 11px; color: var(--brand); padding: 2px 6px; cursor: pointer; border-radius: 6px; background: rgba(43,92,255,.08); }
.plan-more:hover { background: rgba(43,92,255,.16); }
.day-plan-list { max-height: 55vh; overflow-y: auto; margin: 10px 0; }

/* ================================================================
 * 收集箱（钉钉收集素材待确认区）
 * ================================================================ */
.kb-folder.inbox { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; color: #b26a00; }
.kb-folder.inbox .cnt { background: #fff3e0; color: #b26a00; }
.inbox-tag { position: absolute; top: 6px; left: 6px; z-index: 2; font-size: 10px; padding: 1px 6px; border-radius: 6px; background: #fff3e0; color: #b26a00; border: 1px solid #ffd591; }
/* 已写过文案的素材角标（写文案选择器 / 计划抽屉） */
.used-tag { position: absolute; top: 6px; right: 6px; z-index: 2; font-size: 10px; padding: 1px 6px; border-radius: 6px; background: #f2f3f5; color: #8a919f; border: 1px solid #dfe2e8; white-space: nowrap; }
.inbox-item .kb-info .inbox-in { margin-top: 6px; }
