/* 新媒体工作台：明亮后台风。字阶 13/16/20/25/31，间距走 4px 栅格，圆角 8/12 两档 */
:root {
  --bg: #F5F6F8; --panel: #FFFFFF; --soft: #F0F2F6; --line: #E3E6EC; --line2: #D3D8E0;
  --ink: #141821; --ink2: #3D4452; --mute: #6A7280;
  --brand: #2F5BD3; --brand-ink: #1F45AE; --brand-soft: #EAF0FD;
  --ok: #1F7A4A; --ok-soft: #E4F4EA; --warn: #9A5B00; --warn-soft: #FDF2DC; --bad: #C2372B; --bad-soft: #FCE9E7;
  --p-xhs: #FF2442; --p-douyin: #1F1F1F; --p-mp: #07C160; --p-channels: #FA9D3B;
  --r1: 8px; --r2: 12px;
  --sh1: 0 1px 2px rgba(20, 24, 33, .06); --sh2: 0 8px 24px rgba(20, 24, 33, .12);
  --side: 220px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 25px; line-height: 1.25; font-weight: 700; }
h2 { font-size: 20px; line-height: 1.25; font-weight: 700; }
h3 { font-size: 16px; line-height: 1.4; font-weight: 600; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.boot { padding: 96px 16px; text-align: center; color: var(--mute); }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.muted { color: var(--mute); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }

/* ---------- 按钮和表单 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--r1); border: 1px solid var(--line2); background: var(--panel); color: var(--ink); cursor: pointer; white-space: nowrap; font-size: 16px; font-weight: 500; transition: background .15s ease-out, border-color .15s ease-out; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink2); }
.btn.ghost:hover { background: var(--soft); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font-size: inherit; }
.link.danger { color: var(--bad); }
label.f { display: block; margin-bottom: 16px; }
label.f > span { display: block; font-size: 13px; color: var(--mute); margin-bottom: 4px; }
input.in, select.in, textarea.in { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line2); border-radius: var(--r1); background: #fff; font-size: 16px; }
textarea.in { height: auto; min-height: 96px; padding: 8px 12px; line-height: 1.6; resize: vertical; }
input.in:focus, select.in:focus, textarea.in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border: 1px solid var(--line2); border-radius: var(--r1); cursor: pointer; background: #fff; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.seg { display: inline-flex; padding: 3px; background: var(--soft); border-radius: var(--r1); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 6px; cursor: pointer; color: var(--ink2); font-size: 13px; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--sh1); font-weight: 600; }

/* ---------- 标签 ---------- */
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 13px; background: var(--soft); color: var(--ink2); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.brand { background: var(--brand-soft); color: var(--brand-ink); }
.pf { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); white-space: nowrap; }
.pf::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, #999); flex: none; }
.pf-xhs { --c: var(--p-xhs); } .pf-douyin { --c: var(--p-douyin); } .pf-mp { --c: var(--p-mp); } .pf-channels { --c: var(--p-channels); }
.pf.done { color: var(--ok); }
.pf.done::after { content: "✓"; font-size: 13px; }

/* ---------- 外壳 ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 16px; padding: 16px 12px; background: var(--panel); border-right: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; padding: 4px 8px; font-weight: 700; font-size: 16px; }
.logo img { width: 28px; height: 28px; }
.brand-pick { display: grid; gap: 4px; }
.brand-pick button { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r1); background: #fff; cursor: pointer; text-align: left; font-size: 13px; color: var(--ink2); }
.brand-pick button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r1); color: var(--ink2); }
.nav a:hover { background: var(--soft); }
.nav a.on { background: var(--soft); color: var(--ink); font-weight: 600; }
.nav a.on .ic { color: var(--brand); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 2px; }
.side-foot .who { padding: 4px 12px 8px; font-size: 13px; color: var(--mute); }
.side-foot button { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border: 0; background: none; border-radius: var(--r1); cursor: pointer; color: var(--ink2); font-size: 13px; }
.side-foot button:hover { background: var(--soft); }
.topbar, .tabbar { display: none; }
.main { padding: 32px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { color: var(--mute); margin-top: 4px; }

/* ---------- 卡片、统计 ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--sh1); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-body { padding: 16px 20px; }
.section { margin-bottom: 24px; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); padding: 16px; box-shadow: var(--sh1); }
.tile b { display: block; font-size: 31px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { font-size: 13px; color: var(--mute); }
.tile.alert b { color: var(--bad); }
.cols2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }

/* ---------- 列表 ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.vrow { display: grid; grid-template-columns: 96px 76px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 20px; }
.vrow .when { font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.vrow .when.late { color: var(--bad); font-weight: 600; }
.vrow .t { min-width: 0; }
.vrow .t a { color: var(--ink); font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vrow .t .sub { font-size: 13px; color: var(--mute); }
.day-group h3 { padding: 12px 20px 4px; font-size: 13px; color: var(--mute); font-weight: 600; }
.empty { padding: 32px 20px; text-align: center; color: var(--mute); }
.empty .ic { width: 28px; height: 28px; color: var(--line2); display: block; margin: 0 auto 8px; }
.empty .btn { margin-top: 12px; }

.prow { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 20px; color: inherit; }
.prow:hover { background: #FAFBFC; }
.thumb { width: 56px; height: 56px; border-radius: var(--r1); background: var(--soft); object-fit: cover; display: grid; place-items: center; color: var(--line2); overflow: hidden; }
.prow .t { min-width: 0; }
.prow .t b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.prow .right { text-align: right; font-size: 13px; color: var(--mute); white-space: nowrap; }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-size: 13px; color: var(--mute); font-weight: 500; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.up { color: var(--ok); } .down { color: var(--bad); }

/* ---------- 排期周视图 ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); min-height: 280px; display: flex; flex-direction: column; }
.day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.day-h { padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.day-h b { font-size: 16px; }
.day-h span { font-size: 13px; color: var(--mute); }
.day-items { padding: 8px; display: grid; gap: 6px; align-content: start; flex: 1; }
.chip { display: block; padding: 6px 8px; border-radius: var(--r1); background: var(--soft); color: var(--ink); font-size: 13px; line-height: 1.45; border-left: 3px solid var(--c, #999); }
.chip:hover { background: #E6E9EF; }
.chip.done { opacity: .6; }
.chip .tm { color: var(--mute); font-variant-numeric: tabular-nums; }
.chip .tt { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-add { margin: 0 8px 8px; height: 32px; border: 1px dashed var(--line2); border-radius: var(--r1); background: none; color: var(--mute); cursor: pointer; font-size: 13px; }
.day-add:hover { color: var(--brand); border-color: var(--brand); }

/* ---------- 内容详情 ---------- */
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.title-in { width: 100%; border: 0; background: transparent; font-size: 25px; font-weight: 700; padding: 4px 0; border-bottom: 1px solid transparent; border-radius: 0; }
.title-in:focus { outline: none; border-bottom-color: var(--brand); }
.vtabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.vtabs button { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border: 0; background: none; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; color: var(--ink2); }
.vtabs button.on { border-bottom-color: var(--brand); color: var(--ink); font-weight: 600; }
.vtabs .add { color: var(--mute); font-size: 13px; }
.count { float: right; font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.done-box { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; background: var(--ok-soft); color: var(--ok); border-radius: var(--r1); margin-bottom: 16px; font-size: 15px; }
.done-box a { word-break: break-all; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.mcell { position: relative; aspect-ratio: 1; border-radius: var(--r1); overflow: hidden; background: var(--soft); }
.mcell img, .mcell video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mcell .idx { position: absolute; left: 6px; top: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: rgba(20, 24, 33, .7); color: #fff; font-size: 13px; line-height: 20px; text-align: center; }
.mcell .vid { position: absolute; right: 6px; bottom: 6px; padding: 0 6px; border-radius: 4px; background: rgba(20, 24, 33, .7); color: #fff; font-size: 13px; }
.mcell .ops { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgba(20, 24, 33, .55)); opacity: 0; transition: opacity .15s ease-out; }
.mcell:hover .ops, .mcell:focus-within .ops { opacity: 1; }
.mcell .ops button { width: 28px; height: 28px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .92); cursor: pointer; display: grid; place-items: center; }
.mcell .ops button .ic { width: 16px; height: 16px; }
.uploading { margin-top: 8px; font-size: 13px; color: var(--mute); }
.bar { height: 4px; background: var(--soft); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s ease-out; }
.logs { font-size: 13px; color: var(--mute); display: grid; gap: 4px; }
/* 浮在右下角，不挡内容：栏本身透明且不吃点击，只有按钮和提示能点 */
.savebar { position: sticky; bottom: 16px; z-index: 4; display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; pointer-events: none; }
.savebar > * { pointer-events: auto; }
.savebar .btn { box-shadow: var(--sh2); }
.savebar .hint { color: var(--warn); font-size: 13px; background: var(--warn-soft); padding: 6px 12px; border-radius: var(--r1); }

/* ---------- 素材库 ---------- */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.lib-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.lib-item .mcell { border-radius: 0; }
.lib-item .cap { padding: 8px 12px; font-size: 13px; }
.lib-item .cap b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-item .cap .row { justify-content: space-between; gap: 4px; flex-wrap: nowrap; }
.lib-item .cap .use { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 60vh; overflow: auto; }
.pick-grid button { padding: 0; border: 2px solid transparent; border-radius: var(--r1); cursor: pointer; background: none; }
.pick-grid button:hover { border-color: var(--brand); }

/* ---------- 账号数据 ---------- */
.acct { margin-bottom: 16px; }
.acct .card-head h3 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- 弹层 ---------- */
.mask { position: fixed; inset: 0; z-index: 50; background: rgba(20, 24, 33, .45); display: grid; place-items: center; padding: 16px; animation: fade .15s ease-out backwards; }
.dlg { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border-radius: var(--r2); box-shadow: var(--sh2); }
.dlg.wide { width: min(820px, 100%); }
.dlg-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.dlg-b { padding: 20px; }
.dlg-f { display: flex; justify-content: flex-end; gap: 12px; padding: 12px 20px 20px; }
.err { color: var(--bad); font-size: 13px; min-height: 20px; }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r1); font-size: 15px; box-shadow: var(--sh2); animation: fade .15s ease-out backwards; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); }

/* ---------- 发布：二维码 + 复制 ---------- */
.pub { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
.qr { text-align: center; }
.qr img { width: 200px; height: 200px; display: block; margin: 0 auto 8px; border: 1px solid var(--line); border-radius: var(--r1); padding: 8px; background: #fff; }
.qr p { font-size: 13px; color: var(--mute); }
.copy-block { border: 1px solid var(--line); border-radius: var(--r1); margin-bottom: 12px; }
.copy-block .h { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--mute); }
.copy-block .b { padding: 12px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; font-size: 15px; }
.copy-block .b.empty-b { color: var(--mute); }

/* ---------- 手机发布页 ---------- */
.go { max-width: 640px; margin: 0 auto; padding: 16px 16px 120px; }
.go-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.go-head h1 { font-size: 20px; }
.go .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.go .mcell .dl { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border-radius: 6px; background: rgba(255, 255, 255, .92); display: grid; place-items: center; color: var(--ink); }
.go-tip { font-size: 13px; color: var(--mute); margin: 8px 0 16px; }
.go-foot { position: fixed; left: 0; right: 0; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); z-index: 5; }
.go-foot .in-row { display: flex; gap: 8px; max-width: 608px; margin: 0 auto; }
.go-foot .in-row input { flex: 1; min-width: 0; }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); padding: 32px 24px; }
.login .logo { justify-content: center; margin-bottom: 24px; font-size: 20px; }
.login .btn { width: 100%; }

/* ---------- 窄屏：顶栏 + 底部标签栏 ---------- */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols2, .post-grid { grid-template-columns: minmax(0, 1fr); }
  .week { grid-template-columns: minmax(0, 1fr); }
  .day { min-height: 0; }
  .day-items:empty { display: none; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .side { display: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 10; align-items: center; gap: 8px; padding: 8px 16px; background: rgba(245, 246, 248, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .topbar .logo { padding: 0; }
  .topbar .logo span { display: none; }
  .topbar .seg { flex: 1; flex-wrap: nowrap; overflow-x: auto; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; font-size: 13px; color: var(--mute); }
  .tabbar a.on { color: var(--brand); }
  .tabbar .ic { width: 20px; height: 20px; }
  .main { padding: 16px 16px 96px; }
  .page-head { margin-bottom: 16px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tiles > :last-child:nth-child(odd) { grid-column: span 2; }
  .savebar { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .tile b { font-size: 25px; }
  .card-head, .card-body { padding: 12px 16px; }
  .vrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t a" "m a"; gap: 4px 12px; padding: 12px 16px; }
  .vrow .t { grid-area: t; }
  .vrow .meta-line { grid-area: m; display: flex; gap: 12px; align-items: center; }
  .vrow .act { grid-area: a; }
  .vrow > .when, .vrow > .pf { display: none; }
  .prow { grid-template-columns: 48px minmax(0, 1fr); padding: 12px 16px; gap: 12px; }
  .prow .thumb { width: 48px; height: 48px; }
  .prow .right { display: none; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pub { grid-template-columns: minmax(0, 1fr); }
  .pub .qr { display: none; }
  .lib { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mcell .ops { opacity: 1; }
  .title-in { font-size: 20px; }
  .dlg-f { flex-wrap: wrap; }
  .toast { bottom: 88px; }
}
@media (min-width: 761px) { .vrow .meta-line { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
