:root {
  --bg: #F6F7FA;
  --side: #FBFBFC;
  --panel: #FFFFFF;
  --line: #E7EAF0;
  --line2: #D8DCE6;
  --ink: #171A23;
  --ink2: #3A4050;
  --mut: #6E768A;
  --mut2: #98A0B3;
  --hover: #F1F3F8;
  --sel: #ECEFFF;
  --brand: #3346FF;
  --brand2: #6A5CFF;
  --brand-grad: linear-gradient(135deg, #3346FF 0%, #6A5CFF 100%);
  --brand-bg: #EEF1FF;
  --brand-ink: #2737CC;
  --amber: #D45814;
  --amber-bg: #FFF3EB;
  --amber-line: #FCDCC6;
  --amber-ink: #9A3B08;
  --green: #14804A;
  --green-bg: #ECF8F1;
  --green-line: #CBEAD8;
  --red: #D9383A;
  --red-bg: #FFF0F0;
  --purple: #7C3AED;
  --purple-bg: #F3EEFF;
  --panda: #5567D8;
  --panda-bg: #F0F2FF;
  --fox: #0D9488;
  --fox-bg: #EBFAF8;
  --rabbit: #B47521;
  --rabbit-bg: #FDF7EC;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; color: var(--ink);
  font: 13.5px/1.48 var(--font);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  background: var(--bg);
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
svg.ico { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* 登录锁屏（非飞书浏览器未认证时） */
.auth-gate {
  position: fixed; inset: 0; z-index: 200;
  background: linear-gradient(145deg, #F2F5FF 0%, #F7F8FC 60%, #FFF8F2 100%);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.auth-gate.on { display: flex; }
.auth-card {
  width: 400px; max-width: 100%; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 24px 22px; box-shadow: 0 18px 48px rgba(23,26,35,.1);
}
.auth-pets { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; }
.auth-pets img { width: 52px; height: 52px; border-radius: 14px; border: 2px solid #fff; box-shadow: 0 4px 12px rgba(23,26,35,.12); }
.auth-card h1 { margin: 0; font-size: 19px; text-align: center; }
.auth-card p { margin: 6px 0 16px; font-size: 12.5px; color: var(--mut); text-align: center; line-height: 1.6; }
.auth-input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line2);
  border-radius: 9px; font-size: 14px; outline: none; margin-bottom: 10px;
}
.auth-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(51,70,255,.1); }
.auth-err { color: var(--red); font-size: 12px; min-height: 18px; margin-bottom: 8px; text-align: center; }

/* ---------- 外壳：电脑精准一屏不下拉 ---------- */
.yw-app {
  width: 100%; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg); overflow: hidden; position: relative;
}

/* ---------- 顶部飞书内嵌条 ---------- */
.topbar {
  flex: none; height: 44px; padding: 0 14px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; z-index: 20;
}
.tb-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb-logo {
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--brand-grad); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none;
  box-shadow: 0 2px 6px rgba(51, 70, 255, .28);
}
.tb-title { font-weight: 750; font-size: 14px; white-space: nowrap; }
.tb-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 8px; border-radius: 99px;
  background: var(--hover); color: var(--mut); font-size: 11px; white-space: nowrap;
}
.tb-badge i { width: 6px; height: 6px; border-radius: 50%; background: #1FA862; }
.tb-mid { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.role-wrap {
  display: inline-flex; align-items: center;
  background: var(--hover); padding: 2px; border-radius: 9px; border: 1px solid var(--line);
}
.role-btn {
  height: 26px; padding: 0 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--mut); font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; transition: all .15s;
}
.role-btn.on { background: var(--panel); color: var(--ink); font-weight: 650; box-shadow: 0 1px 3px rgba(23,26,35,.1); }
.tb-act {
  height: 28px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--line2); background: var(--panel); color: var(--ink2);
  font-size: 12px; font-weight: 550; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.tb-act:hover { background: var(--hover); }
.tb-act.accent { background: var(--brand-bg); border-color: #D2D9FF; color: var(--brand-ink); }
.tb-time { font-size: 11.5px; color: var(--mut); white-space: nowrap; padding-left: 2px; }

.mid-nav {
  display: none; flex: none; height: 36px; padding: 0 10px;
  background: var(--side); border-bottom: 1px solid var(--line);
  align-items: center; gap: 3px; overflow-x: auto;
}
.mid-nav button {
  height: 26px; padding: 0 8px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink2); font-size: 12px; font-weight: 550;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.mid-nav button:hover { background: var(--hover); }
.mid-nav button.on { background: var(--sel); color: var(--brand-ink); font-weight: 700; }
.mid-nav .badge-sm {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--amber); color: #fff; font-size: 10px; font-weight: 700; display: inline-grid; place-items: center;
}
.tabbar { display: none; }

/* ---------- 主体 ---------- */
.shell-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.side {
  flex: 0 0 206px; background: var(--side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 9px 8px; gap: 2px; overflow-y: auto;
}
.side-sec {
  padding: 9px 10px 4px; font-size: 11px; font-weight: 650;
  color: var(--mut2); letter-spacing: .03em; display: flex; align-items: center; justify-content: space-between;
}
.snav { display: flex; flex-direction: column; gap: 2px; }
.snav button {
  display: flex; align-items: center; gap: 8px;
  height: 31px; padding: 0 9px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink2); font-size: 12.5px; font-weight: 500; text-align: left; width: 100%;
}
.snav button:hover { background: var(--hover); }
.snav button.on { background: var(--sel); color: var(--brand-ink); font-weight: 650; }
.snav button .ico { color: var(--mut); }
.snav button.on .ico { color: var(--brand); }
.cnt { margin-left: auto; font-size: 11px; color: var(--mut); font-weight: 550; }
.cnt.warn {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--amber); color: #fff; font-size: 10.5px; font-weight: 700; display: inline-grid; place-items: center;
}
.dot-c { width: 8px; height: 8px; border-radius: 3px; flex: none; }

.pet-mini {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 8px; border: 0; background: transparent; width: 100%; text-align: left;
}
.pet-mini:hover { background: var(--hover); }
.pet-av { width: 26px; height: 26px; border-radius: 8px; object-fit: cover; flex: none; border: 1px solid rgba(0,0,0,.06); }
.pet-av.lg { width: 34px; height: 34px; border-radius: 10px; }
.pet-av.xl { width: 44px; height: 44px; border-radius: 12px; }
.pet-av.sm { width: 20px; height: 20px; border-radius: 6px; }
.human-av {
  width: 22px; height: 22px; border-radius: 6px;
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: none;
}
.human-av.dy { background: var(--brand-grad); color: #fff; }
.human-av.tg { background: #1E293B; color: #fff; }
.human-av.lg { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }

.pet-mini-info { min-width: 0; flex: 1; }
.pet-mini-nm { font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.pet-mini-st { font-size: 10.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #1FA862; flex: none; animation: pulse 1.8s ease-in-out infinite; }
.live-dot.busy { background: var(--brand); }
@keyframes pulse { 50% { opacity: .3; } }

.side-foot { margin-top: auto; padding: 7px 9px 2px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--mut2); line-height: 1.45; }

/* ---------- 主视口 ---------- */
.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 10px 14px; }
.view { display: none; flex: 1; min-height: 0; flex-direction: column; gap: 9px; }
.view.on { display: flex; }

.btn {
  height: 29px; padding: 0 11px; border-radius: 8px;
  border: 1px solid var(--line2); background: var(--panel); color: var(--ink2);
  font-size: 12px; font-weight: 550; display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.pri:hover { background: #2636D9; }
.btn.danger { color: var(--red); border-color: #F7CACA; background: var(--red-bg); }
.btn.sm { height: 25px; padding: 0 8px; font-size: 11.5px; border-radius: 6px; }
.btn.xs { height: 22px; padding: 0 7px; font-size: 11px; border-radius: 6px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--mut); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }

.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--hover); border: 1px solid var(--line); }
.seg button { height: 23px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: var(--mut); font-size: 11.5px; font-weight: 550; white-space: nowrap; }
.seg button.on { background: var(--panel); color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.tag { display: inline-flex; align-items: center; gap: 3px; height: 19px; padding: 0 6px; border-radius: 5px; font-size: 10.5px; font-weight: 550; background: var(--hover); color: var(--ink2); white-space: nowrap; }
.tag.brand { background: var(--brand-bg); color: var(--brand-ink); }
.tag.amber { background: var(--amber-bg); color: var(--amber-ink); }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.purple { background: var(--purple-bg); color: var(--purple); }
.tag.fox { background: var(--fox-bg); color: var(--fox); }
.tag.panda { background: var(--panda-bg); color: var(--panda); }
.tag.rabbit { background: var(--rabbit-bg); color: var(--rabbit); }

.vh { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.vh-l { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; }
.vh h1 { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; }
.vh-sub { font-size: 11.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vh-r { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }

/* 里程碑横条 */
.ms-strip {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 6px 11px; border-radius: 9px;
  background: linear-gradient(90deg, #F1F3FF 0%, #F7F5FF 65%, #FFFFFF 100%);
  border: 1px solid #DFE3FF; font-size: 11.5px;
}
.ms-top-row { display: contents; }
.ms-pill { order: 1; padding: 2px 7px; border-radius: 6px; background: var(--brand-grad); color: #fff; font-size: 10.5px; font-weight: 700; white-space: nowrap; flex: none; }
.ms-nodes { order: 2; display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; flex: 1; }
.ms-node { display: inline-flex; align-items: center; gap: 4px; color: var(--ink2); white-space: nowrap; font-size: 11.5px; }
.ms-node.now { color: var(--brand-ink); font-weight: 700; }
.ms-node .d { width: 6px; height: 6px; border-radius: 50%; background: var(--mut2); flex: none; }
.ms-node.done .d { background: var(--green); }
.ms-node.now .d { background: var(--brand); box-shadow: 0 0 0 3px rgba(51,70,255,.18); }
.ms-sep { color: var(--mut2); font-size: 10px; }
.ms-cd { order: 3; margin-left: auto; font-weight: 700; color: var(--brand-ink); white-space: nowrap; font-size: 11.5px; flex: none; cursor: pointer; }
.ms-cd:hover { text-decoration: underline; }

/* 一句话记事 */
.quick-box { flex: none; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 5px 8px 5px 11px; box-shadow: 0 1px 2px rgba(23,26,35,.03); }
.quick-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(51,70,255,.09); }
.quick-row { display: flex; align-items: center; gap: 8px; }
.quick-in-wrap { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.quick-in-wrap input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 13px; height: 28px; }
.quick-in-wrap input::placeholder { color: var(--mut2); }
.quick-btns { display: flex; align-items: center; gap: 6px; flex: none; }
.quick-parsed { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--mut); }
.quick-ex { border: 0; background: var(--hover); color: var(--ink2); padding: 1px 7px; border-radius: 5px; font-size: 11px; }
.quick-ex:hover { background: var(--sel); color: var(--brand-ink); }

/* ---------- 今天作战台 ---------- */
.today-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 11px; }
.col-scroll { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; padding-right: 2px; }
.col-scroll::-webkit-scrollbar, .qd-body::-webkit-scrollbar, .side::-webkit-scrollbar, .gantt-body::-webkit-scrollbar { width: 5px; height: 5px; }
.col-scroll::-webkit-scrollbar-thumb, .qd-body::-webkit-scrollbar-thumb, .side::-webkit-scrollbar-thumb, .gantt-body::-webkit-scrollbar-thumb { background: #D7DCE6; border-radius: 99px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; flex: none; }
.card-h { display: flex; align-items: center; gap: 6px; padding: 7px 11px 6px; border-bottom: 1px solid var(--line); background: #FCFDFE; }
.card-h h2 { margin: 0; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.card-h .sub { font-size: 11px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-h .r { margin-left: auto; display: flex; align-items: center; gap: 5px; flex: none; }
.pill-num { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; font-size: 10.5px; font-weight: 700; display: inline-grid; place-items: center; background: var(--hover); color: var(--mut); flex: none; }
.pill-num.warn { background: var(--amber); color: #fff; }
.pill-num.brand { background: var(--brand-bg); color: var(--brand-ink); }

.dec-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 9px; padding: 7px 11px; border-top: 1px solid var(--line); align-items: center; cursor: pointer; }
.dec-item:first-child { border-top: 0; }
.dec-item:hover { background: #FAFBFD; }
.dec-t { font-size: 12.5px; font-weight: 650; line-height: 1.32; }
.dec-d { font-size: 11px; color: var(--mut); margin-top: 2px; line-height: 1.38; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.dec-btns { display: flex; gap: 4px; align-items: center; flex: none; }

.trow { display: grid; grid-template-columns: 17px minmax(0, 1fr) auto; gap: 9px; padding: 7px 11px; border-top: 1px solid var(--line); align-items: center; cursor: pointer; }
.trow:first-child { border-top: 0; }
.trow:hover { background: #FAFBFD; }
.chk { width: 16px; height: 16px; border-radius: 5px; border: 1.6px solid #BFC6D4; background: #fff; padding: 0; display: grid; place-items: center; flex: none; font-size: 11px; }
.chk.p0 { border-color: var(--amber); }
.chk.on { background: var(--green); border-color: var(--green); color: #fff; }
.trow-main { min-width: 0; }
.trow-tt { font-size: 12.5px; font-weight: 550; line-height: 1.32; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow.done .trow-tt { color: var(--mut2); text-decoration: line-through; font-weight: 400; }
.trow-meta { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 11px; color: var(--mut); flex-wrap: wrap; }
.trow-meta .late { color: var(--red); font-weight: 650; }
.trow-meta .tm { color: var(--ink2); font-weight: 600; }
.mini-prog { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--brand-ink); font-weight: 600; }
.mini-bar { width: 32px; height: 4px; border-radius: 2px; background: #E3E7F2; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--brand); }
.trow-r { display: flex; align-items: center; gap: 5px; flex: none; }

.pet-live-card { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 7px; padding: 6px 9px; border-top: 1px solid var(--line); align-items: start; }
.pet-live-card:first-child { border-top: 0; }
.pet-live-top { display: flex; align-items: center; gap: 5px; min-width: 0; }
.pet-live-top b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-live-task { font-size: 11px; color: var(--ink2); margin-top: 2px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.pet-live-step { font-size: 10.5px; color: var(--brand-ink); margin-top: 2px; display: flex; align-items: center; gap: 4px; min-width: 0; }
.pet-live-step span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-live-foot { margin-top: 4px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.stage-mini { padding: 8px 10px; background: linear-gradient(180deg, #F8F9FF 0%, #FFFFFF 100%); border: 1px solid #DCE2FF; border-radius: var(--radius); flex: none; }
.stage-bar { height: 5px; border-radius: 3px; background: #E4E8F5; overflow: hidden; margin: 5px 0; }
.stage-bar i { display: block; height: 100%; background: var(--brand-grad); border-radius: 3px; }
.stage-mini-next { margin-top: 5px; padding-top: 5px; border-top: 1px dashed #DDE3F6; font-size: 10.5px; color: var(--ink2); line-height: 1.45; }

/* ---------- 阶段目标与甘特图 ---------- */
.stage-cards { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.scard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; transition: all .14s; display: flex; flex-direction: column; gap: 3px; }
.scard:hover { border-color: #C5CEEE; background: #FCFDFE; }
.scard.on { border-color: var(--brand); background: linear-gradient(180deg, #F3F5FF 0%, #FFFFFF 100%); box-shadow: 0 0 0 1.5px var(--brand); }
.scard-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.scard-no { font-size: 10.5px; font-weight: 750; color: var(--brand-ink); }
.scard-tm { font-size: 10px; color: var(--mut); white-space: nowrap; }
.scard-goal { font-size: 11px; color: var(--ink2); line-height: 1.35; }
.scard-foot { margin-top: auto; padding-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 10.5px; }

.stage-detail-bar { flex: none; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; padding: 7px 12px; border-radius: 10px; background: var(--panel); border: 1px solid #DCE2FF; font-size: 11.5px; align-items: center; }
.sd-col b { color: var(--brand-ink); font-size: 11px; display: block; margin-bottom: 1px; }
.sd-col span { color: var(--ink2); line-height: 1.4; }

.gantt-wrap { flex: 1; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.gantt-head { flex: none; display: grid; grid-template-columns: 248px minmax(0, 1fr); border-bottom: 1px solid var(--line); background: #FCFDFE; }
.gantt-head-l { padding: 6px 10px; font-size: 11px; font-weight: 700; color: var(--mut); border-right: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.gantt-months { display: grid; grid-template-columns: 10fr 31fr 31fr 28fr 31fr 30fr; position: relative; }
.gantt-months div { padding: 6px 5px; font-size: 11px; font-weight: 650; color: var(--ink2); border-left: 1px solid var(--line); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-months div:first-child { border-left: 0; }
.gantt-body { flex: 1; min-height: 0; overflow-y: auto; position: relative; }
.gantt-row { display: grid; grid-template-columns: 248px minmax(0, 1fr); border-top: 1px solid #F0F2F7; min-height: 26px; align-items: center; cursor: pointer; transition: background .1s; }
.gantt-row:first-child { border-top: 0; }
.gantt-row:hover { background: #F9FAFE; }
.gantt-row.group-row { background: #F7F8FC; min-height: 22px; cursor: default; border-top: 1px solid var(--line); }
.gantt-lbl { padding: 2px 9px; border-right: 1px solid var(--line); display: flex; align-items: center; gap: 6px; min-width: 0; height: 100%; }
.gantt-code { font-size: 10px; font-weight: 750; padding: 1px 5px; border-radius: 4px; background: var(--hover); color: var(--ink2); flex: none; }
.gantt-code.s1 { background: var(--amber-bg); color: var(--amber-ink); }
.gantt-code.s2 { background: var(--green-bg); color: var(--green); }
.gantt-code.s3 { background: var(--brand-bg); color: var(--brand-ink); }
.gantt-code.s4 { background: var(--purple-bg); color: var(--purple); }
.gantt-name { font-size: 11px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.gantt-track { position: relative; height: 100%; min-height: 26px; background-image: linear-gradient(to right, #F2F4F8 1px, transparent 1px); background-size: 16.66% 100%; }
.gantt-row.group-row .gantt-track { min-height: 22px; background-image: none; }
.g-vline { position: absolute; top: 0; bottom: 0; width: 0; z-index: 4; pointer-events: none; }
.g-vline.today { border-left: 1.5px solid var(--red); }
.g-vline.d0125 { border-left: 1.5px dashed var(--amber); }
.g-vline.d0215 { border-left: 1.5px dashed var(--brand); }
.g-vtag { position: absolute; top: 2px; font-size: 9.5px; font-weight: 700; padding: 0 4px; border-radius: 4px; white-space: nowrap; }
.g-vline.today .g-vtag { background: var(--red); color: #fff; left: 2px; }
.g-vline.d0125 .g-vtag { background: var(--amber); color: #fff; right: 2px; }
.g-vline.d0215 .g-vtag { background: var(--brand); color: #fff; left: 2px; }
.gbar { position: absolute; top: 4px; height: 17px; border-radius: 5px; z-index: 3; }
.gbar.s1 { background: #FFE6D4; border: 1px solid #F3B389; }
.gbar.s2 { background: var(--green-bg); border: 1px solid #96D8B4; }
.gbar.s3 { background: var(--brand-bg); border: 1px solid #B7C4FF; }
.gbar.s4 { background: var(--purple-bg); border: 1px solid #CFB8FF; }
.gbar.wait { background: repeating-linear-gradient(45deg, #F6F7FB, #F6F7FB 5px, #E9EDF7 5px, #E9EDF7 10px); border: 1px dashed #A3B0CC; z-index: 2; }
.gbar-txt { position: absolute; top: 4px; height: 17px; line-height: 17px; font-size: 10px; font-weight: 650; color: var(--ink2); white-space: nowrap; z-index: 5; pointer-events: none; }
.gantt-foot { flex: none; padding: 5px 11px; border-top: 1px solid var(--line); background: #FCFDFE; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--mut); }
.g-leg { display: inline-flex; align-items: center; gap: 5px; }
.g-leg i { width: 12px; height: 8px; border-radius: 3px; display: inline-block; }
.mobile-gantt { display: none; flex-direction: column; gap: 8px; }

/* ---------- 日程视图 ---------- */
.cal-wrap { flex: 1; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.week-head { flex: none; display: grid; grid-template-columns: 48px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: #FCFDFE; }
.week-head > div { padding: 6px 3px; text-align: center; font-size: 11px; color: var(--mut); border-left: 1px solid var(--line); white-space: nowrap; }
.week-head > div:first-child { border-left: 0; }
.week-head .dn { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12.5px; font-weight: 700; color: var(--ink); margin-left: 2px; }
.week-head .today .dn { background: var(--brand); color: #fff; }
.week-allday { flex: none; display: grid; grid-template-columns: 48px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: #FAFBFE; }
.week-allday > div { min-height: 28px; padding: 3px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.week-allday > div:first-child { border-left: 0; font-size: 10px; color: var(--mut2); align-items: center; justify-content: center; }
.ad-chip { font-size: 10px; padding: 2px 4px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; cursor: pointer; }
.ad-chip.ms { background: var(--amber-bg); color: var(--amber-ink); border: 1px solid var(--amber-line); }
.ad-chip.brand { background: var(--brand-bg); color: var(--brand-ink); }
.ad-chip.green { background: var(--green-bg); color: var(--green); }
.week-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 48px repeat(7, minmax(0, 1fr)); position: relative; }
.week-hrs { display: grid; grid-template-rows: repeat(10, 1fr); }
.week-hrs div { font-size: 10px; color: var(--mut2); text-align: right; padding: 2px 6px 0 0; }
.week-col { position: relative; border-left: 1px solid var(--line); display: grid; grid-template-rows: repeat(10, 1fr); }
.week-col.today { background: #F9FAFF; }
.week-cell { border-top: 1px solid #F0F2F7; }
.week-cell:first-child { border-top: 0; }
.wev { position: absolute; left: 2px; right: 2px; border-radius: 6px; padding: 3px 5px; font-size: 10.5px; line-height: 1.28; overflow: hidden; cursor: pointer; border: 1px solid transparent; z-index: 2; }
.wev b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wev span { display: block; font-size: 9.5px; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wev.dy { background: var(--brand-bg); color: var(--brand-ink); border-color: #D2DAFF; }
.wev.tg { background: var(--amber-bg); color: var(--amber-ink); border-color: var(--amber-line); }
.wev.ai { background: var(--fox-bg); color: var(--fox); border: 1px dashed #8CE0D6; }
.wev.fin { background: var(--rabbit-bg); color: var(--rabbit); border: 1px dashed #E8C997; }
.now-line { position: absolute; left: 0; right: 0; border-top: 2px solid var(--red); z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

.month-split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 244px; gap: 10px; }
.month-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.month-dow { flex: none; display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); background: #FCFDFE; }
.month-dow div { text-align: center; padding: 5px 0; font-size: 11px; color: var(--mut); font-weight: 600; }
.month-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(0, 1fr)); }
.mcell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 5px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; cursor: pointer; }
.mcell:nth-child(7n) { border-right: 0; }
.mcell.out { background: #FAFBFD; color: var(--mut2); }
.mcell.sel { background: #F2F4FF; box-shadow: inset 0 0 0 1.5px var(--brand); }
.mcell-top { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 650; }
.mcell-top .td-n { background: var(--brand); color: #fff; width: 19px; height: 19px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10.5px; }
.m-chip { font-size: 10px; padding: 1px 4px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--hover); color: var(--ink2); }
.m-chip.p0 { background: var(--amber-bg); color: var(--amber-ink); }
.m-chip.brand { background: var(--brand-bg); color: var(--brand-ink); }
.m-chip.ai { background: var(--fox-bg); color: var(--fox); }
.mobile-agenda { display: none; flex-direction: column; gap: 9px; }

/* ---------- 四象限 ---------- */
.quad-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; }
.qd { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.qd.q1 { background: linear-gradient(180deg, #FFF7F1 0%, #FFFFFF 60px); border-color: #F6DFCE; }
.qd.q2 { background: linear-gradient(180deg, #F1FAF5 0%, #FFFFFF 60px); border-color: #D2ECDC; }
.qd.q3 { background: linear-gradient(180deg, #F1F4FF 0%, #FFFFFF 60px); border-color: #D7DFFE; }
.qd.q4 { background: linear-gradient(180deg, #F7F8FA 0%, #FFFFFF 60px); }
.qd-h { flex: none; display: flex; align-items: center; gap: 6px; padding: 7px 10px 5px; }
.qd-mk { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.q1 .qd-mk { background: var(--amber); } .q2 .qd-mk { background: var(--green); }
.q3 .qd-mk { background: var(--brand); } .q4 .qd-mk { background: #98A0B3; }
.qd-h b { font-size: 12.5px; white-space: nowrap; }
.qd-h .hint-t { font-size: 11px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qd-h .n { margin-left: auto; font-size: 11px; color: var(--mut); font-weight: 650; }
.qd-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 5px; }
.qcard { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.94); border: 1px solid var(--line); cursor: pointer; }
.qcard:hover { border-color: var(--line2); box-shadow: 0 2px 5px rgba(23,26,35,.04); }
.qcard.done .qcard-t { text-decoration: line-through; color: var(--mut2); }
.qcard-t { font-size: 12px; font-weight: 550; line-height: 1.35; }
.qcard-m { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 3px; font-size: 10.5px; color: var(--mut); }
.list-table-wrap { flex: 1; min-height: 0; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- AI 团队 ---------- */
.team-layout { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.pet-cards { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 11px; display: flex; flex-direction: column; gap: 6px; }
.pcard.panda { border-top: 3px solid var(--panda); }
.pcard.fox { border-top: 3px solid var(--fox); }
.pcard.rabbit { border-top: 3px solid var(--rabbit); background: linear-gradient(180deg, #FFFCF7 0%, #FFFFFF 55px); }
.pcard-top { display: flex; align-items: center; gap: 9px; }
.pcard-nm { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pcard-role { font-size: 11px; color: var(--mut); margin-top: 1px; }
.pcard-duty { font-size: 11.5px; color: var(--ink2); line-height: 1.45; }
.pcard-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.pcard-foot { margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.team-bottom { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 10px; }
.member-row { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 10px; border-radius: 9px; background: #fff; border: 1px solid var(--line); }

/* ---------- 财务简报 ---------- */
.fin-banner { flex: none; display: flex; align-items: center; gap: 10px; padding: 7px 11px; border-radius: 10px; background: var(--rabbit-bg); border: 1px solid #F0D9B5; color: #7A4C10; font-size: 11.5px; line-height: 1.45; }
.fin-kpis { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 11px; }
.kpi-k { font-size: 11px; color: var(--mut); }
.kpi-v { font-size: 19px; font-weight: 750; margin-top: 2px; line-height: 1.2; }
.kpi-s { font-size: 10.5px; color: var(--mut); margin-top: 2px; }
.fin-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 10px; }
.fin-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 7px 11px; border-top: 1px solid var(--line); font-size: 12px; }
.fin-row:first-child { border-top: 0; }
.fin-amt { font-weight: 700; text-align: right; white-space: nowrap; }

/* ---------- 抽屉与弹窗 ---------- */
.scrim { position: fixed; inset: 0; background: rgba(15, 20, 35, .3); display: none; z-index: 40; }
.scrim.on { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 96vw;
  background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -14px 0 36px rgba(15, 20, 35, .14); z-index: 50; display: none; flex-direction: column;
}
.drawer.on { display: flex; }
.dr-h { flex: none; padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.dr-b { flex: 1; min-height: 0; overflow-y: auto; padding: 13px 15px; display: flex; flex-direction: column; gap: 12px; }
.dr-f { flex: none; padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 7px; background: #FCFDFE; }

.modal-wrap { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 20, 35, .42); }
.modal-wrap.on { display: flex; }
.modal { width: 700px; max-width: 100%; max-height: 92vh; background: var(--panel); border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(15, 20, 35, .24); display: flex; flex-direction: column; overflow: hidden; }
.modal.sm { width: 450px; }
.modal-h { flex: none; padding: 11px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.modal-h h3 { margin: 0; font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.modal-b { flex: 1; min-height: 0; overflow-y: auto; padding: 13px 15px; }
.modal-f { flex: none; padding: 9px 15px; border-top: 1px solid var(--line); background: #FCFDFE; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.split-2 { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 13px; }
.ta { width: 100%; border: 1px solid var(--line2); border-radius: 9px; padding: 8px 10px; font-size: 12.5px; line-height: 1.5; resize: vertical; outline: none; background: #fff; }
.ta:focus { border-color: var(--brand); }
.inp { width: 100%; height: 32px; border: 1px solid var(--line2); border-radius: 8px; padding: 0 9px; font-size: 12.5px; outline: none; background: #fff; }
.inp:focus { border-color: var(--brand); }
.step-row { display: grid; grid-template-columns: 19px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.step-n { width: 18px; height: 18px; border-radius: 50%; background: var(--brand-bg); color: var(--brand-ink); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }

.lark-card { border: 1px solid #DCE2EE; border-radius: 11px; overflow: hidden; background: #fff; box-shadow: 0 4px 16px rgba(23,26,35,.08); }
.lark-card-head { padding: 9px 13px; background: linear-gradient(90deg, #E85D24 0%, #F27D3B 100%); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: space-between; }
.lark-card-body { padding: 11px 13px; font-size: 12.5px; line-height: 1.6; color: var(--ink2); }
.lark-at { display: inline-block; padding: 0 5px; border-radius: 4px; background: #E8F1FF; color: #1456F0; font-weight: 650; }
.lark-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 11px; }
.lark-btn { height: 32px; border-radius: 7px; border: 1px solid #D0D7E5; background: #fff; color: #1F2329; font-size: 12px; font-weight: 600; }
.lark-btn.pri { background: #3370FF; border-color: #3370FF; color: #fff; }
.lark-btn.full { grid-column: 1 / -1; }

.toast {
  position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 14px);
  z-index: 120; background: #171A23; color: #fff; padding: 8px 14px; border-radius: 10px;
  font-size: 12px; opacity: 0; pointer-events: none; transition: all .2s; max-width: 90vw;
  box-shadow: 0 8px 24px rgba(0,0,0,.22); text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 999px) and (min-width: 700px) {
  .side { display: none; }
  .mid-nav { display: flex; }
  .tb-badge, .tb-time { display: none; }
  .vh-sub { display: none; }
  .today-grid { grid-template-columns: minmax(0, 1fr) 232px; gap: 10px; }
  .dec-item { grid-template-columns: 26px minmax(0, 1fr); row-gap: 4px; padding: 6px 10px; }
  .dec-btns { grid-column: 2; }
  .stage-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .scard { padding: 6px 7px; }
  .stage-detail-bar { grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px 9px; }
  .gantt-head, .gantt-row { grid-template-columns: 192px minmax(0, 1fr); }
  .month-split { grid-template-columns: minmax(0, 1fr) 205px; }
  .team-bottom { grid-template-columns: 242px minmax(0, 1fr); }
  .fin-grid { grid-template-columns: minmax(0, 1fr) 236px; }
  .fin-kpis { gap: 7px; }
  .kpi { padding: 7px 9px; }
  .kpi-v { font-size: 16.5px; }
  .ms-nodes .ms-hide-md { display: none; }
}

@media (max-width: 699px) {
  .yw-app { height: auto; min-height: 100dvh; overflow: visible; }
  .topbar { height: auto; padding: 8px 12px; flex-wrap: wrap; row-gap: 7px; }
  .tb-badge, .tb-time, .tb-act span.lbl { display: none; }
  .tb-mid { width: 100%; margin-left: 0; justify-content: space-between; }
  .role-wrap { flex: 1; display: grid; grid-template-columns: repeat(2, 1fr); }
  .role-btn { justify-content: center; padding: 0 5px; font-size: 11.5px; }
  .side, .mid-nav { display: none; }
  .shell-body { overflow: visible; }
  .main { overflow: visible; padding: 10px 12px 24px; }
  .view { min-height: auto; }
  .vh-l { flex-basis: 100%; }
  .vh-r { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .ms-strip { flex-direction: column; align-items: stretch; gap: 5px; padding: 8px 10px; }
  .ms-top-row { display: flex; align-items: center; justify-content: space-between; }
  .ms-nodes { overflow-x: auto; padding-bottom: 1px; }
  .quick-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .quick-btns { justify-content: flex-end; }
  .today-grid { grid-template-columns: 1fr; }
  .col-scroll { overflow: visible; padding-right: 0; }
  .card-h .sub { display: none; }
  .dec-item { grid-template-columns: 28px minmax(0, 1fr); align-items: start; padding: 9px 11px; }
  .dec-d { -webkit-line-clamp: 3; }
  .dec-btns { grid-column: 2; padding-top: 5px; }
  .stage-cards { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .stage-detail-bar { grid-template-columns: 1fr; gap: 6px; }
  .gantt-wrap { display: none; }
  .mobile-gantt { display: flex; }
  .cal-wrap, .month-split { display: none !important; }
  .mobile-agenda { display: flex; }
  .quad-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .qd-body { overflow: visible; max-height: none; }
  .pet-cards { grid-template-columns: 1fr; }
  .team-bottom { grid-template-columns: 1fr; }
  .fin-kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .fin-grid { grid-template-columns: 1fr; }
  .split-2 { grid-template-columns: 1fr; }
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-width: 100%; height: 84dvh; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; }
  .modal-wrap { align-items: flex-end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 88dvh; width: 100%; }

  .tabbar {
    display: flex; position: sticky; top: 0; z-index: 35;
    background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line);
    padding: 5px 4px; backdrop-filter: blur(10px); overflow-x: auto;
  }
  .tabbar button {
    flex: 1; min-width: 58px; border: 0; background: transparent;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 3px 2px; font-size: 10px; color: var(--mut); position: relative; white-space: nowrap;
  }
  .tabbar button.on { color: var(--brand); font-weight: 700; }
  .tabbar button .ico { width: 18px; height: 18px; }
  .tabbar button .t-dot {
    position: absolute; top: 0; left: calc(50% + 7px);
    min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px;
    background: var(--amber); color: #fff; font-size: 9px; font-weight: 700; display: grid; place-items: center;
  }
}
