/* OpsHub UI —— 单页左右分栏：左列表 / 右详情 */
:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #1c2333;
  --ink-2: #5b6478;
  --ink-3: #9aa3b8;
  --line: #e4e8f0;
  --brand: #3565e0;
  --brand-ink: #ffffff;
  --green: #1e9e62;
  --green-bg: #e6f7ef;
  --red: #d64545;
  --red-bg: #fdecec;
  --blue-bg: #e8f0fe;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(28, 35, 51, 0.07), 0 4px 14px rgba(28, 35, 51, 0.05);
  --topbar-h: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}
#app { height: 100vh; display: flex; flex-direction: column; }
.loading { text-align: center; padding: 80px 0; color: var(--ink-3); }

/* ---- 登录 ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 36px 32px; width: 100%; max-width: 380px; text-align: center;
}
.logo-big { font-size: 28px; font-weight: 800; letter-spacing: 0.5px; }
.login-sub { color: var(--ink-2); margin: 6px 0 22px; font-size: 13px; }
.login-card input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 15px; margin-bottom: 14px; outline: none; background: #fafbfd;
}
.login-card input:focus { border-color: var(--brand); background: #fff; }
.login-hint { color: var(--ink-3); font-size: 12px; margin-top: 14px; }

/* ---- 按钮 ---- */
.btn {
  border: 1px solid transparent; border-radius: 8px; padding: 8px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: filter 0.15s, background 0.15s;
  background: #eef1f6; color: var(--ink); white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:hover:not(:disabled) { filter: brightness(0.96); }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.success { background: var(--green); color: #fff; }
.btn.danger { background: var(--red-bg); color: var(--red); border-color: #f3c9c9; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn.block { width: 100%; }

/* ---- 顶栏 ---- */
.topbar {
  height: var(--topbar-h); flex: none; background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; gap: 10px;
}
.brand { font-size: 17px; font-weight: 800; white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.count {
  margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--brand);
  background: var(--blue-bg); border-radius: 999px; padding: 1px 9px; vertical-align: 2px;
}
.toolbar { display: flex; gap: 8px; align-items: center; }
.select {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  background: #fff; font-size: 13px; color: var(--ink); outline: none; max-width: 120px;
}

/* ---- 左右分栏 ---- */
.layout { flex: 1; display: flex; min-height: 0; }
.list-pane {
  width: 340px; flex: none; overflow-y: auto; border-right: 1px solid var(--line);
  background: var(--card); padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.detail-pane { flex: 1; overflow-y: auto; min-width: 0; padding: 20px 28px 40px; }
.empty { text-align: center; color: var(--ink-3); padding: 70px 12px; }

/* ---- 列表项 ---- */
.item {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer;
  transition: border-color 0.12s, background 0.12s; position: relative;
}
.item:hover { background: #f7f9fd; }
.item.active { border-color: var(--brand); background: #f0f5ff; }
.item.active::before {
  content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px; background: var(--brand);
}
.item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.topic { font-weight: 700; font-size: 14px; word-break: break-all; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--ink-3); }
.dot.new { background: var(--brand); }
.dot.done { background: var(--green); }
.dot.cancelled { background: var(--ink-3); }
.excerpt {
  color: var(--ink-2); font-size: 12.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.item-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.time { white-space: nowrap; }

/* ---- 徽章 ---- */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.badge.platform { background: var(--blue-bg); color: var(--brand); }
.badge.status.new { background: var(--blue-bg); color: var(--brand); }
.badge.status.done { background: var(--green-bg); color: var(--green); }
.badge.status.cancelled { background: #eef1f6; color: var(--ink-2); }
.badge.tag { background: #f1ecfb; color: #7a4fd0; font-weight: 500; }

/* ---- 详情头部：标题 + 右上角状态快捷操作 ---- */
.detail-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 20px;
}
.detail-title-wrap { min-width: 0; }
.detail-title { margin: 0; font-size: 19px; word-break: break-all; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.quick-actions { display: flex; gap: 8px; flex: none; align-items: center; }

/* ---- 详情主体：内容占主宽，动作为右侧窄栏 ---- */
.detail-body { display: flex; gap: 16px; align-items: flex-start; }
.detail-body > .content-card { flex: 1; min-width: 0; max-width: none; }
.detail-body > .actions-card { flex: none; width: 264px; position: sticky; top: 0; }

/* ---- 内容 / 动作 两个分区卡片（视觉区分明显） ---- */
.sec {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 20px; margin-bottom: 16px;
}
.sec h3 {
  margin: 0 0 12px; font-size: 14px; font-weight: 800; letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 6px;
}
.content-card { border-left: 4px solid var(--brand); }
.content-card h3 { color: var(--brand); }
.actions-card { border-left: 4px solid var(--amber); background: #fffcf4; }
.actions-card h3 { color: var(--amber); }

/* ---- 动作步骤：编号圆点 + 行卡片 ---- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps li {
  counter-increment: step;
  display: flex; align-items: flex-start; gap: 11px;
  padding: 9px 13px; background: #fff; border: 1px solid #f0e3c6; border-radius: 9px;
  margin-bottom: 7px; font-size: 14.5px;
}
.steps li:last-child { margin-bottom: 0; }
.steps li::before {
  content: counter(step);
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--amber); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}

/* ---- 富文本渲染区 ---- */
.rich { font-size: 15px; overflow-wrap: break-word; }
.rich h1, .rich h2, .rich h3, .rich h4 { margin: 1em 0 0.4em; line-height: 1.35; }
.rich h1 { font-size: 1.45em; } .rich h2 { font-size: 1.28em; } .rich h3 { font-size: 1.12em; }
.rich p { margin: 0.5em 0; }
.rich img, .rich video { max-width: 100%; border-radius: 10px; margin: 8px 0; display: block; }
.rich video { background: #000; }
.rich pre { background: #f2f4f9; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: 13px; }
.rich code { background: #f2f4f9; border-radius: 4px; padding: 1px 5px; font-size: 0.92em; }
.rich pre code { background: none; padding: 0; }
.rich blockquote { margin: 0.6em 0; padding: 6px 14px; border-left: 3px solid var(--brand); background: #f7f9fe; border-radius: 0 8px 8px 0; color: var(--ink-2); }
.rich a { color: var(--brand); }
.rich table { border-collapse: collapse; margin: 10px 0; }
.rich td, .rich th { border: 1px solid var(--line); padding: 6px 12px; }
.rich hr { border: none; border-top: 1px solid var(--line); margin: 1.2em 0; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #222a3d; color: #fff; padding: 10px 20px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--red); }

/* ---- 移动端：上下堆叠 ---- */
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .list-pane { width: 100%; max-height: 42vh; border-right: none; border-bottom: 1px solid var(--line); }
  .detail-pane { padding: 14px 14px 40px; }
  .detail-body { flex-direction: column; }
  .detail-body > .actions-card { width: 100%; position: static; }
  .detail-head { flex-direction: column; }
  .quick-actions { width: 100%; }
  .quick-actions .btn { flex: 1; }
  .brand-sub { display: none; }
}
