/* MobileWork 多人多智能体协同 · 按期原型 · 基础与外壳 */
:root {
  --pri: #1a90ff; --pri-d: #0f7ae5; --pri-50: #eef6ff; --pri-100: #d9ecff;
  --bg: #f2f5fa; --side: #f6f8fc; --card: #fff; --line: #e5eaf1; --line2: #eef1f6;
  --txt: #1f2329; --sub: #4e5969; --muted: #8a919f;
  --ok: #12a150; --ok-50: #e8f7ee; --warn: #f08c00; --warn-50: #fff5e6; --bad: #e5484d; --bad-50: #fdeeee;
  --new: #ff6a00; --new-50: #fff3ea; --tbc: #8b5cf6; --tbc-50: #f3efff; --edge: #7c8798;
  --r: 10px; --r-s: 6px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13px/1.6 var(--font); color: var(--txt); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--pri); text-decoration: none; cursor: pointer; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
ul { margin: 0; padding-left: 18px; }
.hide { display: none !important; }

/* ---------- 原型控制条（不属于产品） ---------- */
.pbar { position: fixed; top: 0; left: 0; right: 0; height: auto; min-height: 46px; z-index: 50; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
  padding: 6px 12px; background: #101828; color: #cbd5e1; font-size: 12px; }
.pbar .brand { color: #fff; font-weight: 600; white-space: nowrap; }
.pbar .brand small { color: #94a3b8; font-weight: 400; margin-left: 6px; }
.pbar .seg { display: flex; background: #1e293b; border-radius: 8px; padding: 3px; }
.pbar .seg button { border: 0; background: none; color: #cbd5e1; padding: 4px 10px; border-radius: 6px; white-space: nowrap; }
.pbar .seg button.on { background: var(--pri); color: #fff; }
.pbar .seg button small { opacity: .75; margin-left: 4px; }
.pbar .tog { display: flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; user-select: none; }
.pbar .tog i { width: 30px; height: 16px; border-radius: 9px; background: #334155; position: relative; transition: .2s; }
.pbar .tog i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: .2s; }
.pbar .tog.on i { background: var(--new); }
.pbar .tog.on i::after { left: 16px; }
.pbar .links { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 100%; }
.pbar .links a { color: #cbd5e1; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.pbar .links a:hover, .pbar .links a.on { background: #1e293b; color: #fff; }
.pbar .links a .n { background: var(--tbc); color: #fff; border-radius: 8px; padding: 0 5px; margin-left: 3px; font-size: 11px; }
.legend { position: fixed; top: var(--pbar-h, 46px); left: 0; right: 0; z-index: 49; background: #fff7ef; border-bottom: 1px solid #ffd8b8; color: #8a4b12;
  font-size: 12px; padding: 5px 14px; display: none; gap: 18px; align-items: center; height: 28px; }
body.ann .legend { display: flex; }
.legend b { display: inline-block; width: 22px; height: 12px; vertical-align: -1px; margin-right: 4px; border-radius: 3px; }
.legend .l-new { border: 1.5px dashed var(--new); background: var(--new-50); }
.legend .l-edge { border: 1.5px dashed var(--edge); background: #f3f4f6; }
.legend .l-old { border: 1px solid var(--line); background: #fff; }
.legend .l-tbc { background: var(--tbc); }
.legend .l-cur { background: var(--ok); border-radius: 8px; }

/* ---------- 应用外壳（复刻 MobileWork） ---------- */
.app { position: fixed; top: var(--pbar-h, 46px); left: 0; right: 0; bottom: 0; display: flex; }
body.ann .app { top: calc(var(--pbar-h, 46px) + 28px); }
.side { width: 236px; flex: none; background: var(--side); border-right: 1px solid var(--line2); display: flex; flex-direction: column; padding: 10px 10px 8px; overflow: hidden; }
.side .logo { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; }
.side .logo .mk { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.15; color: #20304a; font-weight: 600; }
.side .logo .mk i { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, #1a90ff, #22c3c3); display: inline-block; position: relative; }
.side .logo .mk i::after { content: "M"; position: absolute; inset: 0; color: #fff; font-style: normal; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.side .logo .mk small { display: block; color: #6b7280; font-weight: 400; font-size: 10px; }
.side .logo .disc { font-size: 11px; color: #4e5969; background: #eceff4; border-radius: 6px; padding: 2px 6px; }
.side .newtask { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; border: 1px solid var(--pri); color: var(--pri);
  background: var(--pri-50); border-radius: 8px; margin-bottom: 8px; font-weight: 500; }
.side .newtask:hover { background: var(--pri-100); }
.nav a { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; color: var(--txt); position: relative; }
.nav a:hover { background: #eaeef5; }
.nav a.on { background: #e3edfb; color: var(--pri-d); }
.nav a .ic { width: 16px; text-align: center; color: #5b6574; font-size: 13px; }
.nav a.on .ic { color: var(--pri); }
.nav a .sub { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.nav a .cnt { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; line-height: 16px; border-radius: 8px; padding: 0 6px; }
.nav .grp { margin: 2px 0 2px 18px; border-left: 1px solid var(--line); padding-left: 6px; }
.nav .grp a { padding: 5px 8px; font-size: 12.5px; }
.side .sec { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; padding: 10px 6px 4px; border-top: 1px solid var(--line2); margin-top: 6px; }
.side .scroll { flex: 1; overflow: auto; margin: 0 -4px; padding: 6px 4px 0; }
.tlist a { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; color: var(--txt); font-size: 12.5px; position: relative; }
.tlist a:hover { background: #eaeef5; }
.tlist a.on { background: #e3edfb; }
.tlist a .nm { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tlist a.has-st { flex-wrap: wrap; align-items: flex-start; row-gap: 2px; }
.tlist a.has-st .nm { flex: 1 0 100%; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; }
.tlist a.has-st .stline { display: flex; flex-wrap: wrap; gap: 4px; }
.tlist a .tm { color: var(--muted); font-size: 11px; white-space: nowrap; }
.side .user { display: flex; align-items: center; gap: 8px; padding: 8px 4px 0; border-top: 1px solid var(--line2); }
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 12px; flex: none; background: var(--pri); font-style: normal; }
.av.s { width: 20px; height: 20px; font-size: 10px; }
.av.ag { border-radius: 7px; background: linear-gradient(135deg, #6366f1, #22a3ff); }
.av.tm { border-radius: 7px; background: linear-gradient(135deg, #f59e0b, #ef4444); }
.main { flex: 1; min-width: 0; padding: 8px 8px 8px 0; display: flex; }
.page { flex: 1; min-width: 0; background: var(--card); border-radius: 12px; overflow: auto; position: relative; }
.pad { padding: 22px 28px 40px; }

/* ---------- 通用组件 ---------- */
.btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--txt); white-space: nowrap; position: relative; }
.btn:hover { border-color: #c9d3e0; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.pri:hover { background: var(--pri-d); }
.btn.dan { color: var(--bad); border-color: #f3b8ba; }
.btn.warn { background: #f5a623; border-color: #f5a623; color: #fff; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn[disabled], .btn.dis, [data-dis] { opacity: .45; cursor: not-allowed; }
.tag { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; background: #f1f3f6; color: var(--sub); white-space: nowrap; }
.tag.b { background: var(--pri-50); color: var(--pri-d); }
.tag.g { background: var(--ok-50); color: var(--ok); }
.tag.o { background: var(--warn-50); color: #c26a00; }
.tag.r { background: var(--bad-50); color: var(--bad); }
.tag.p { background: var(--tbc-50); color: var(--tbc); }
.tag.dark { background: #1f2937; color: #fff; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot.g { background: var(--ok); } .dot.o { background: var(--warn); } .dot.r { background: var(--bad); } .dot.b { background: var(--pri); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; position: relative; }
.card + .card { margin-top: 12px; }
.muted { color: var(--muted); } .sub { color: var(--sub); }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.sp { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ptitle { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.ptitle h2 { font-size: 18px; }
.ptitle .desc { color: var(--muted); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 12px; color: var(--sub); border-bottom: 2px solid transparent; margin-bottom: -1px; position: relative; white-space: nowrap; }
.tabs a.on { color: var(--pri); border-color: var(--pri); font-weight: 500; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pills a, .pills span { padding: 5px 14px; border: 1px solid var(--line); border-radius: 16px; color: var(--sub); background: #fff; position: relative; }
.pills .on { border-color: var(--pri); color: var(--pri); background: var(--pri-50); }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fafbfd; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line2); vertical-align: top; }
table.t tr:hover td { background: #fafcff; }
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 6px 10px; }
.kv > :nth-child(odd) { color: var(--muted); }
.note { background: #f7f9fc; border: 1px dashed #d4dbe6; border-radius: 8px; padding: 10px 12px; color: var(--sub); font-size: 12.5px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.hl { animation: hl 1.6s ease; }
@keyframes hl { 0% { box-shadow: 0 0 0 3px rgba(26,144,255,.5); } 100% { box-shadow: 0 0 0 0 rgba(26,144,255,0); } }
.toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); background: #1f2937; color: #fff; padding: 9px 16px; border-radius: 8px; z-index: 80; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.18); max-width: 560px; }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }

/* ---------- 标注：新增 / 本期新增 / 待确认 ---------- */
[data-req], [data-tbc] { position: relative; }
body.ann [data-req].ann-new { outline: 1.5px dashed var(--new); outline-offset: 2px; background-color: rgba(255,106,0,.035); border-radius: 6px; }
body.ann [data-req].ann-edge { outline: 1.5px dashed var(--edge); outline-offset: 2px; border-radius: 6px; }
.ann-tag { display: none; position: absolute; top: -9px; right: -6px; z-index: 5; height: 17px; line-height: 17px; padding: 0 5px; border-radius: 4px; border: 0;
  background: var(--new); color: #fff; font-size: 10.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.15); letter-spacing: 0; }
.ann-tag.edge { background: var(--edge); }
body.ann .ann-tag { display: inline-block; }
.ann-tag:hover { filter: brightness(1.1); }
.new-chip { position: absolute; top: -8px; left: -6px; z-index: 4; height: 16px; line-height: 16px; padding: 0 5px; border-radius: 8px; background: var(--ok); color: #fff;
  font-size: 10px; font-weight: 600; white-space: nowrap; pointer-events: none; }
body.nonew .new-chip { display: none; }
.tbc-tag { position: absolute; bottom: -8px; right: -6px; z-index: 5; height: 16px; line-height: 16px; padding: 0 5px; border-radius: 4px; border: 0; background: var(--tbc);
  color: #fff; font-size: 10px; white-space: nowrap; }

/* 标注抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(15,23,42,.25); z-index: 60; display: none; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 470px; max-width: 92vw; background: #fff; z-index: 61; box-shadow: -8px 0 30px rgba(0,0,0,.12);
  transform: translateX(105%); transition: transform .22s ease; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-mask.open { display: block; }
.drawer .dh { padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.drawer .dh .x { float: right; border: 0; background: none; font-size: 20px; color: var(--muted); line-height: 1; }
.drawer .db { padding: 6px 18px 30px; overflow: auto; flex: 1; }
.drawer .rq + .rq { border-top: 6px solid #f2f5fa; margin: 10px -18px 0; padding: 4px 18px 0; }
.drawer h4 { font-size: 12px; color: var(--muted); margin: 14px 0 6px; font-weight: 500; }
.drawer .judge { padding-left: 20px; }
.drawer .judge li { margin: 3px 0; list-style: none; position: relative; }
.drawer .judge li::before { content: "☐"; position: absolute; left: -18px; color: var(--ok); }
.drawer .bd-do { background: var(--ok-50); border-radius: 6px; padding: 8px 10px; }
.drawer .bd-no { background: var(--bad-50); border-radius: 6px; padding: 8px 10px 8px 26px; margin-top: 6px; }
.drawer .bd-no li { color: #8b2c2f; }
.acc-fold { border-top: 1px solid var(--line2); padding: 4px 0; }
.acc-fold summary { cursor: pointer; }
.acc-fold div { padding: 2px 0 6px 16px; color: var(--sub); }
/* 改动点关闭时：纯 MobileWork 外观，不显示本期新增和待确认角标 */
body:not(.ann) .new-chip, body:not(.ann) .tbc-tag { display: none; }
body.trace .ann-tag { font-weight: 500; font-size: 10px; }
/* 写给评审的设计说明（dnote）和页面里的「待确认」标签：改动点关闭时隐藏，原型辅助页除外 */
body:not(.ann):not(.aux) .dnote { display: none !important; }
body:not(.ann):not(.aux) .page .tag.p[data-ann] { display: none; }
.dnote { border-color: #ffc89a !important; }
