* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f5f9;
  --card: #ffffff;
  --ink: #1b2437;
  --muted: #69708a;
  --line: #e6e8f0;
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --sidebar: #191f33;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 24, 45, .07);
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
.boot { padding: 60px; text-align: center; color: var(--muted); }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e2749 0%, #3b3f8f 55%, #4f46e5 100%);
  padding: 24px;
}
.login-card {
  background: #fff; border-radius: 16px; padding: 36px 32px; width: 400px; max-width: 100%;
  box-shadow: 0 20px 60px rgba(10, 14, 40, .35);
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--bg); border-radius: 8px; padding: 4px; }
.login-tabs button {
  flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 6px; color: var(--muted);
}
.login-tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.demo-hint {
  margin-top: 18px; background: var(--accent-soft); border-radius: 8px; padding: 12px 14px;
  font-size: 12px; color: #4b4f77; line-height: 1.8;
}
.demo-hint b { color: var(--accent); }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; background: var(--sidebar); color: #c6cbe0; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { padding: 20px 20px 14px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .5px; }
.sidebar .logo small { display: block; font-weight: 400; font-size: 11px; color: #8b92b3; margin-top: 2px; }
.sidebar nav { flex: 1; padding: 6px 10px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: #b5bbd6; margin-bottom: 2px; font-size: 13.5px;
}
.sidebar nav a.on { background: rgba(99, 102, 241, .22); color: #fff; font-weight: 600; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); }
.sidebar .whoami { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12.5px; }
.sidebar .whoami .nm { color: #fff; font-weight: 600; }
.sidebar .whoami .rl { color: #8b92b3; }
.sidebar .whoami button {
  margin-top: 8px; background: transparent; border: 1px solid rgba(255,255,255,.25); color: #c6cbe0;
  border-radius: 6px; padding: 4px 12px; font-size: 12px;
}
.main { flex: 1; padding: 26px 32px 60px; max-width: 1160px; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* ---------- 组件 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card h3 { font-size: 15px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.c2, .grid.c4 { grid-template-columns: 1fr; } .main { padding: 18px; } }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .v { font-size: 26px; font-weight: 700; }
.stat .k { color: var(--muted); font-size: 12.5px; }
.stat.hot .v { color: var(--warn); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  padding: 7px 14px; border-radius: 8px; color: var(--ink); font-size: 13px;
}
.btn:hover { border-color: #c9cde0; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #4338ca; }
.btn.danger { color: var(--danger); border-color: #f3c6c6; }
.btn.ok { color: var(--ok); border-color: #bfe3c8; }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

label.f { display: block; margin-bottom: 12px; }
label.f span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=datetime-local], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit;
  background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; min-height: 72px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form label.f { margin-bottom: 0; flex: 1; min-width: 140px; }

table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr.click { cursor: pointer; }
table.tbl tr.click:hover td { background: #fafbff; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.s-draft { background: #eef0f4; color: #5b6478; }
.s-in_review { background: #fef3c7; color: #92400e; }
.s-rejected { background: #fee2e2; color: #b91c1c; }
.s-approved { background: #dbeafe; color: #1d4ed8; }
.s-published { background: #dcfce7; color: #15803d; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 5px; font-size: 12px; background: var(--accent-soft); color: var(--accent); margin-right: 4px; }
.chip.p-xhs { background: #ffe9ec; color: #d43354; }
.chip.p-wechat { background: #e3f6e9; color: #178a3d; }
.chip.p-moments { background: #e8f1ff; color: #2563eb; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--danger); }
.dot.warn { background: var(--warn); }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button {
  border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 5px 14px; font-size: 13px; color: var(--muted);
}
.tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.todo-item { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.todo-item:last-child { border-bottom: 0; }
.todo-item:hover { background: #fafbff; }
.todo-item .tag { font-size: 12px; padding: 2px 8px; border-radius: 5px; flex-shrink: 0; }
.t-review { background: #fef3c7; color: #92400e; }
.t-rejected { background: #fee2e2; color: #b91c1c; }
.t-overdue { background: #ffedd5; color: #c2410c; font-weight: 600; }
.t-today { background: #dbeafe; color: #1d4ed8; }

.timeline { list-style: none; }
.timeline li { padding: 6px 0 6px 18px; border-left: 2px solid var(--line); position: relative; font-size: 12.5px; }
.timeline li::before { content: ''; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline li .tm { color: var(--muted); }
.timeline li .note { color: var(--danger); }

.hit-block { color: var(--danger); font-weight: 600; }
.hit-warn { color: var(--warn); font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 13px; }

/* ---------- 弹层 & 提示 ---------- */
#modal-root .overlay {
  position: fixed; inset: 0; background: rgba(15, 18, 40, .45); display: flex;
  align-items: flex-start; justify-content: center; z-index: 100; padding: 60px 16px; overflow: auto;
}
#modal-root .modal { background: #fff; border-radius: 14px; padding: 24px; width: 560px; max-width: 100%; box-shadow: 0 24px 70px rgba(10,14,40,.35); }
#modal-root .modal h3 { margin-bottom: 16px; font-size: 16px; }
#modal-root .modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

#toast-root { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1b2437; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px;
  box-shadow: 0 8px 24px rgba(10,14,40,.3); animation: slidein .18s ease;
}
.toast.err { background: #b91c1c; }
@keyframes slidein { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

.content-body-view { white-space: pre-wrap; background: #fafbff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-size: 13.5px; }

/* ---------- AI 助手浮窗 ---------- */
#asst-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  width: 60px; height: 60px; border-radius: 50%; border: 0; padding: 0;
  background: linear-gradient(145deg, #5b56e8, #7d78f5);
  box-shadow: 0 6px 20px rgba(79, 70, 229, .38);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease, box-shadow .18s ease;
}
#asst-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 10px 26px rgba(79, 70, 229, .5); }
#asst-fab svg { width: 38px; height: 38px; }
#asst-fab .fab-tip {
  position: absolute; right: 70px; white-space: nowrap; background: #1b2437; color: #fff;
  font-size: 12.5px; padding: 6px 12px; border-radius: 8px; opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
}
#asst-fab:hover .fab-tip { opacity: 1; }
@keyframes asst-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
#asst-fab .mascot { animation: asst-bob 3s ease-in-out infinite; transform-origin: center; }
@media (prefers-reduced-motion: reduce) { #asst-fab .mascot { animation: none; } }

#asst-panel {
  position: fixed; right: 24px; bottom: 96px; z-index: 91;
  width: 380px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 140px);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 18, 40, .28);
  display: flex; flex-direction: column; overflow: hidden;
}
#asst-panel .ap-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: linear-gradient(135deg, #4f46e5, #6d67f0); color: #fff;
}
#asst-panel .ap-head svg { width: 30px; height: 30px; flex-shrink: 0; }
#asst-panel .ap-head .t { font-weight: 600; font-size: 14px; }
#asst-panel .ap-head .s { font-size: 11.5px; opacity: .85; }
#asst-panel .ap-head button { margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 20px; line-height: 1; cursor: pointer; opacity: .85; }
#asst-body { flex: 1; overflow-y: auto; padding: 14px; background: var(--bg); }
.ap-msg { margin-bottom: 12px; display: flex; gap: 8px; }
.ap-msg .bubble {
  max-width: 84%; padding: 9px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}
.ap-msg.bot .bubble { background: var(--card); border: 1px solid var(--line); }
.ap-msg.me { justify-content: flex-end; }
.ap-msg.me .bubble { background: var(--accent); color: #fff; }
.ap-msg .src { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.ap-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ap-quick button {
  border: 1px solid var(--line); background: var(--card); border-radius: 14px;
  padding: 4px 11px; font-size: 12px; color: var(--muted); cursor: pointer;
}
.ap-quick button:hover { border-color: var(--accent); color: var(--accent); }
#asst-foot { padding: 10px; border-top: 1px solid var(--line); background: var(--card); }
#asst-foot .row { display: flex; gap: 8px; }
#asst-foot input { flex: 1; font-size: 13px; }
#asst-foot .hint { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.ap-typing span {
  display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%;
  background: var(--muted); animation: apblink 1.2s infinite;
}
.ap-typing span:nth-child(2) { animation-delay: .2s; }
.ap-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes apblink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.muted { color: var(--muted); font-size: 12.5px; }
.mb0 { margin-bottom: 0; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.svg-chart { width: 100%; height: auto; }
