/* 任务通报模板管理 · 桌面端（后台只在电脑上用，按 1280 宽设计） */
:root {
  --bg: #f4f5f7;
  --panel: #fff;
  --ink: #1f2329;
  --ink2: #4e5969;
  --ink3: #86909c;
  --line: #e5e6eb;
  --brand: #2b5cff;
  --brand-soft: #eef3ff;
  --red: #c00000;
  --ok: #00a870;
  --warn: #d25f00;
  --r: 10px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}
.hidden { display: none !important; }
.muted { color: var(--ink3); font-size: 12px; }
.grow { flex: 1; }
.err { color: #d93026; font-size: 13px; min-height: 18px; }

/* ---------- 登录 ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px; box-shadow: 0 12px 40px rgba(20, 30, 60, .08);
}
.login-card h1 { font-size: 19px; margin: 0 0 6px; }
.login-card p { margin: 0 0 18px; }
.login-card label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--ink2); }
.login-card input { margin-top: 6px; }
.block { width: 100%; }

/* ---------- 顶栏 ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }
.top {
  height: 60px; flex: none; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--red); color: #fff; font-weight: 700; font-size: 17px;
}
.brand b { display: block; font-size: 15px; }
.brand em { display: block; font-style: normal; font-size: 12px; color: var(--ink3); margin-top: 1px; }
.who { display: flex; align-items: center; gap: 10px; color: var(--ink2); font-size: 13px; }

/* ---------- 主体 ---------- */
.main { flex: 1; display: flex; min-height: 0; }
.side {
  width: 264px; flex: none; background: var(--panel); border-right: 1px solid var(--line);
  padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; overflow: auto;
}
.side-title { font-size: 12px; color: var(--ink3); margin-top: 6px; display: flex; justify-content: space-between; }
.tpl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tpl-item {
  padding: 10px 10px; border-radius: 9px; cursor: pointer; border: 1px solid transparent;
}
.tpl-item:hover { background: #f7f8fa; }
.tpl-item.on { background: var(--brand-soft); border-color: #c9d8ff; }
.tpl-item b { display: block; font-size: 13px; font-weight: 600; }
.tpl-item span { display: block; font-size: 11px; color: var(--ink3); margin-top: 2px; }
.tpl-item .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; background: var(--ink3); }
.tpl-item .dot.pub { background: var(--ok); }
.side-tip { margin-top: auto; font-size: 11px; color: var(--ink3); line-height: 1.6; padding-top: 12px; }

.work { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bar {
  flex: none; height: 58px; display: flex; align-items: center; gap: 10px;
  padding: 0 18px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.bar .name { width: 240px; font-weight: 600; }
.meta { font-size: 12px; color: var(--ink3); }
.meta .badge { display: inline-block; padding: 1px 7px; border-radius: 20px; background: #f2f3f5; margin-right: 6px; }
.meta .badge.pub { background: #e8f8f1; color: #00845a; }

.split {
  flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(520px, 1.05fr) minmax(420px, .95fr);
  gap: 14px; padding: 14px 18px 24px;
}
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.editor { overflow: auto; padding: 14px 16px 24px; }
.preview { padding: 12px 14px 18px; align-self: start; position: sticky; top: 14px; max-height: calc(100vh - 96px); overflow: auto; }

/* ---------- 表单 ---------- */
input, select, button { font: inherit; color: inherit; }
input, select {
  height: 32px; padding: 0 9px; border: 1px solid #dcdfe6; border-radius: 8px;
  background: #fff; outline: none; min-width: 0;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 92, 255, .1); }
input[type="color"] { padding: 3px; width: 100%; cursor: pointer; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); padding: 0; }
label { font-size: 12px; color: var(--ink2); display: block; }
label input, label select { display: block; width: 100%; margin-top: 5px; }
label.chk { display: flex; align-items: center; gap: 7px; padding-top: 22px; }
.btn {
  height: 32px; padding: 0 14px; border: 1px solid #dcdfe6; background: #fff;
  border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #b8bfcc; background: #fafbfc; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #234fd8; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink2); }
.btn.ghost:hover { background: #f2f3f5; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表 tabs ---------- */
.tabs { display: flex; gap: 6px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.tab {
  height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #fafbfc; cursor: pointer; font-size: 13px;
}
.tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tab.add { color: var(--ink3); border-style: dashed; }

.sec { border-top: 1px solid var(--line); padding: 14px 0 4px; }
.sec:first-of-type { border-top: 0; }
.sec-h { font-size: 13px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.sec-h .btn { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 12px; }
.hint { font-size: 11px; color: var(--ink3); margin-top: 8px; line-height: 1.7; word-break: break-all; }
.danger { display: flex; align-items: center; gap: 12px; padding-top: 14px; }

/* ---------- 列编辑 ---------- */
.cols { display: flex; flex-direction: column; gap: 6px; }
.col-row {
  display: grid; grid-template-columns: 100px minmax(80px, 1fr) 58px 64px 54px 24px 24px 24px;
  gap: 6px; align-items: center; background: #fafbfc; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px;
}
.col-row select, .col-row input { height: 28px; font-size: 12px; }
.col-row .tone { display: flex; align-items: center; justify-content: center; gap: 3px; font-size: 10px; color: var(--ink3); white-space: nowrap; }
.col-row .ic {
  width: 24px; height: 24px; border: 1px solid var(--line); background: #fff; border-radius: 6px;
  cursor: pointer; line-height: 1; color: var(--ink2); padding: 0;
}
.col-row .ic:hover { background: #f2f3f5; }
.col-row .ic:disabled { opacity: .35; cursor: default; }

/* ---------- 预览 ---------- */
.pv-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.pv-bar select { flex: 1; min-width: 0; }
.pv-meta { font-size: 11px; color: var(--ink3); min-height: 18px; margin-bottom: 6px; }
.pv-meta b { color: var(--ink2); font-weight: 600; }
.pv-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.pv-tabs button {
  height: 26px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; font-size: 12px; cursor: pointer;
}
.pv-tabs button.on { background: #f2f3f5; font-weight: 600; }
.pv-box {
  border: 1px solid var(--line); border-radius: 10px; background:
    linear-gradient(45deg, #fafafa 25%, transparent 25%) 0 0/16px 16px,
    linear-gradient(-45deg, #fafafa 25%, transparent 25%) 0 8px/16px 16px,
    #fff;
  min-height: 260px; display: grid; place-items: center; padding: 10px; overflow: auto;
}
.pv-box img { max-width: 100%; height: auto; box-shadow: 0 6px 24px rgba(20, 30, 60, .1); background: #fff; }
.pv-empty { color: var(--ink3); font-size: 13px; padding: 40px 10px; text-align: center; }
.pv-busy { color: var(--ink3); font-size: 12px; padding: 30px; }

/* ---------- 弹层 ---------- */
.modal { position: fixed; inset: 0; background: rgba(15, 20, 32, .35); display: grid; place-items: center; z-index: 20; }
.modal-card {
  background: #fff; border-radius: 14px; padding: 18px 20px; width: 520px; max-height: 78vh;
  overflow: auto; box-shadow: 0 20px 60px rgba(10, 20, 40, .2);
}
.modal-card.small { width: 360px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; font-weight: 600; margin-bottom: 12px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.modal-card label { margin-bottom: 10px; }
.ver-list { display: flex; flex-direction: column; gap: 6px; }
.ver-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 12px;
}
.ver-row b { font-size: 13px; }
.ver-row .grow { text-align: right; color: var(--ink3); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: rgba(28, 34, 48, .94); color: #fff; padding: 9px 16px; border-radius: 9px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .18s ease;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: #c0392b; }

@media (max-width: 1180px) {
  .split { grid-template-columns: 1fr; }
  .preview { position: static; max-height: none; }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
}
