/* 星经理 · 沙盘推演（讲师投屏版）—— 深藏青 × 暖金，与测评系统同源 */
:root {
  --bg: #14161C; --bg2: #1C1F27; --panel: #22262F; --panel2: #2A2F3A;
  --ink: #F2EFE8; --sub: #B8B4AA; --mut: #7E7B73;
  --line: rgba(255,255,255,0.10); --line2: rgba(255,255,255,0.22);
  --gold: #C9A961; --gold-dim: #8B7A5A; --dark: #1F1410;
  --blue: #4F6FB5; --orange: #F39A1E; --purple: #6B4FA0; --green: #7DBB3C;
  --red: #E05252; --heart: #E2312D; --cube: #29A9E0;
  --ok: #4FBF7F; --warn: #E0A33A;
  --topbar-h: 58px; --drawer-w: 360px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5; overflow: hidden; -webkit-text-size-adjust: 100%;
}
button, input, select { font-family: inherit; }
button { cursor: pointer; }
#app { height: 100%; display: flex; flex-direction: column; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 18px; padding: 0 16px;
  background: var(--bg2); border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; line-height: 1.15; min-width: 110px; }
.brand .star { font-size: 18px; font-weight: 600; color: var(--gold); letter-spacing: 3px; }
.brand .sub { font-size: 10px; color: var(--mut); letter-spacing: 1px; }
.timeline { display: flex; align-items: center; gap: 4px; }
.timeline .ph { display: flex; align-items: center; gap: 2px; padding: 3px 4px; border-radius: 8px; border: 1px solid transparent; }
.timeline .ph.cur { border-color: var(--gold-dim); background: rgba(201,169,97,.08); }
.timeline .ph.past { opacity: .55; }
.timeline .ph .k { font-size: 12px; font-weight: 600; color: var(--sub); padding: 0 6px; }
.timeline .ph.cur .k { color: var(--gold); }
.timeline .m { width: 22px; height: 22px; border-radius: 50%; font-size: 11px; display: flex; align-items: center; justify-content: center; color: var(--mut); border: 1px solid var(--line); }
.timeline .m.done { background: var(--gold-dim); color: var(--dark); border-color: var(--gold-dim); }
.timeline .m.cur { background: var(--gold); color: var(--dark); border-color: var(--gold); font-weight: 700; }
.stats { display: flex; gap: 16px; margin-left: auto; }
.stat { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.stat .l { font-size: 10px; color: var(--mut); letter-spacing: 1px; }
.stat .v { font-size: 18px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .v.gold { color: var(--gold); }
.stat .v.red { color: var(--red); }
.stat .v small { font-size: 11px; color: var(--sub); font-weight: 400; margin-left: 3px; }
.actions { display: flex; gap: 8px; }

.btn {
  padding: 8px 14px; font-size: 13px; font-weight: 500; border-radius: 8px;
  background: var(--panel2); color: var(--ink); border: 1px solid var(--line2); transition: background .15s, transform .1s;
}
.btn:hover { background: #343947; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: var(--dark); border-color: var(--gold); font-weight: 600; }
.btn-gold:hover { background: #D9BC76; }
.btn-red { background: var(--red); color: #fff; border-color: var(--red); }
.btn-red:hover { background: #F06565; }
.btn-ghost { background: transparent; color: var(--sub); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.menu { position: relative; }
.menu .dd { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; min-width: 190px; padding: 6px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.menu .dd button { display: block; width: 100%; text-align: left; padding: 8px 12px; background: none; border: 0; color: var(--ink); font-size: 13px; border-radius: 6px; }
.menu .dd button:hover { background: var(--panel2); }
.menu .dd .sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ---------- 主区 ---------- */
.main { flex: 1; display: flex; min-height: 0; }
.stage { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 10px; position: relative; }
.drawer { width: var(--drawer-w); flex: none; background: var(--bg2); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.drawer.hidden { display: none; }
.drawer-tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.drawer-tabs button { flex: 1; padding: 10px 0; background: none; border: 0; color: var(--mut); font-size: 13px; border-bottom: 2px solid transparent; }
.drawer-tabs button.on { color: var(--gold); border-bottom-color: var(--gold); }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 14px; font-size: 13px; }
.drawer-body h4 { font-size: 12px; color: var(--mut); letter-spacing: 1px; margin: 14px 0 6px; font-weight: 500; }
.drawer-body h4:first-child { margin-top: 0; }
.kv { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.kv b { font-variant-numeric: tabular-nums; }
.kv.total { border-bottom: 0; border-top: 1px solid var(--line2); margin-top: 2px; padding-top: 6px; font-size: 15px; }
.kv .gold { color: var(--gold); }
.kv .red { color: var(--red); }
.kv .dim { color: var(--mut); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
table.tbl th, table.tbl td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.tbl th { color: var(--mut); font-weight: 500; font-size: 11px; }
table.tbl th:first-child, table.tbl td:first-child { text-align: left; }
table.tbl tr.q td { background: rgba(201,169,97,.08); color: var(--gold); font-weight: 600; }
.tbl-wrap { overflow-x: auto; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.bar .n { width: 64px; color: var(--sub); }
.bar .t { flex: 1; height: 10px; background: var(--panel); border-radius: 5px; overflow: hidden; }
.bar .f { height: 100%; border-radius: 5px; }
.bar .v { width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.log-line { padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 12px; color: var(--sub); }
.log-line .t { color: var(--gold-dim); margin-right: 6px; font-size: 11px; }
.rule-sec { margin-bottom: 14px; }
.rule-sec p { font-size: 12px; color: var(--sub); margin: 2px 0; }
.empty { color: var(--mut); text-align: center; padding: 20px 0; }
.chip { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 10px; background: var(--panel2); color: var(--sub); margin: 2px 4px 2px 0; }
.chip.gold { background: rgba(201,169,97,.18); color: var(--gold); }
.chip.red { background: rgba(224,82,82,.18); color: #F08A8A; }
.chip.green { background: rgba(79,191,127,.18); color: var(--ok); }

/* ---------- 盘面 ---------- */
.board { position: relative; aspect-ratio: 2000 / 1008; max-width: 100%; max-height: 100%; user-select: none; }
.board-bg { display: block; width: 100%; height: 100%; border-radius: 10px; box-shadow: 0 16px 50px rgba(0,0,0,.55); }
.overlay { position: absolute; inset: 0; }
.hot { position: absolute; }
.hot.clickable { cursor: pointer; }

/* 员工卡位 */
.slot { border-radius: 6px; transition: box-shadow .15s; }
.slot.empty:hover { box-shadow: 0 0 0 3px rgba(201,169,97,.7); background: rgba(201,169,97,.08); }
.slot.empty .plus { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(0,0,0,.25); font-size: 2.2em; }
.slot .card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.slot.filled:hover .card-img { box-shadow: 0 0 0 3px var(--gold), 0 4px 14px rgba(0,0,0,.35); }
.slot .mk { position: absolute; width: 11%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.slot .mk.cur { border: 3px solid var(--gold); box-shadow: 0 0 0 2px rgba(0,0,0,.35), 0 0 10px rgba(201,169,97,.8); background: rgba(201,169,97,.25); }
.slot .mk.grid { width: 5%; background: var(--gold); border: 1px solid #5c4a1c; }
.slot .badge { position: absolute; font-size: .62em; line-height: 1; padding: .25em .5em; border-radius: 1em; font-weight: 700; white-space: nowrap; pointer-events: none; }
.slot .badge.will { right: 3%; bottom: 4%; background: rgba(107,79,160,.92); color: #fff; }
.slot .badge.will.down { background: rgba(224,82,82,.92); }
.slot .badge.will.up { background: rgba(79,191,127,.92); color: #0b2b18; }
.slot .badge.tag { left: 3%; top: 3%; background: rgba(0,0,0,.65); color: var(--gold); }
.slot .badge.zero { left: 50%; top: 50%; transform: translate(-50%,-50%); background: rgba(224,82,82,.95); color: #fff; font-size: .9em; }
.slot.motivated .card-img { outline: 3px solid rgba(107,79,160,.9); outline-offset: -1px; }
.slot.coached .card-img { outline: 3px solid rgba(125,187,60,.9); outline-offset: -1px; }
.slot.motivated.coached .card-img { outline: 3px solid var(--gold); }

/* 个人绩效圆圈 */
.perf { border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85em; color: #fff; background: rgba(0,0,0,.0); pointer-events: none; transition: background .2s; }
.perf.on { background: var(--gold); color: var(--dark); box-shadow: 0 0 0 2px #1a1a1a; }
.perf.zero { background: var(--red); color: #fff; }

/* 管理卡位 */
.zslot { border-radius: 5px; }
.zslot.empty:hover { box-shadow: 0 0 0 3px rgba(201,169,97,.7); background: rgba(255,255,255,.35); }
.zslot .card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; border-radius: 5px; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.zslot.filled:hover .card-img { box-shadow: 0 0 0 3px var(--gold); }
.zslot .tokens { position: absolute; right: -6%; top: -8%; display: flex; gap: 2px; pointer-events: none; }
.zslot .target { position: absolute; left: 4%; bottom: 3%; font-size: .6em; font-weight: 700; background: rgba(0,0,0,.72); color: #fff; padding: .2em .5em; border-radius: 1em; pointer-events: none; }
.zslot .num { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); font-size: 1.1em; color: rgba(0,0,0,.18); font-weight: 700; pointer-events: none; }

/* 精力红心 / 资源方块 小图标 */
.tk { display: inline-flex; align-items: center; justify-content: center; width: 1.35em; height: 1.35em; font-size: .75em; font-weight: 700; color: #fff; border-radius: .3em; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.tk.h { background: var(--heart); border-radius: .3em .3em .7em .7em; }
.tk.c { background: var(--cube); }
.tk-inline { display: inline-flex; gap: 3px; vertical-align: middle; }

/* 左列信息框 */
.infobox { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-radius: 6px; line-height: 1.15; }
.infobox .big { font-size: 1.9em; font-weight: 700; color: var(--dark); font-variant-numeric: tabular-nums; }
.infobox .big.red { color: var(--red); }
.infobox .sm { font-size: .7em; color: #555; }
.infobox .sm b { color: #222; }
.infobox.clickable:hover { box-shadow: 0 0 0 3px rgba(201,169,97,.7); background: rgba(201,169,97,.10); }
.infobox .prog { width: 84%; height: .45em; background: rgba(0,0,0,.12); border-radius: 1em; overflow: hidden; margin-top: .35em; }
.infobox .prog i { display: block; height: 100%; background: var(--gold); border-radius: 1em; }
.infobox .prog i.over { background: var(--ok); }
.recruit { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: .5em; border-radius: 50%; color: #fff; font-weight: 700; font-size: .95em; }
.recruit:hover { box-shadow: 0 0 0 4px rgba(201,169,97,.8); background: rgba(201,169,97,.15); }
.recruit .lb { background: rgba(0,0,0,.78); border-radius: 1em; padding: .1em .7em; line-height: 1.2; text-align: center; }
.recruit .hint { display: block; font-size: .55em; font-weight: 400; color: var(--gold); }
.pending { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.pending .p { font-size: .62em; background: rgba(0,0,0,.72); color: #fff; padding: .15em .6em; border-radius: 1em; white-space: nowrap; }

/* 经理卡：资源值 / 精力值 */
.mgr { display: flex; align-items: center; justify-content: center; gap: .3em; border-radius: 6px; }
.mgr .n { font-size: 1.7em; font-weight: 700; color: #222; font-variant-numeric: tabular-nums; }
.mgr .n.red { color: var(--red); }
.mgr .l { font-size: .62em; color: #666; }
.mgr-work { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 6px; gap: .15em; }
.mgr-work .row { display: flex; align-items: center; gap: .35em; }
.mgr-work .stp { width: 1.6em; height: 1.6em; border-radius: 50%; border: 0; background: var(--dark); color: var(--gold); font-size: .95em; font-weight: 700; line-height: 1; }
.mgr-work .stp:hover { background: #3a2a1e; }
.mgr-work .n { font-size: 1.5em; font-weight: 700; color: var(--heart); font-variant-numeric: tabular-nums; min-width: 1.2em; text-align: center; }
.mgr-work .l { font-size: .6em; color: #666; white-space: nowrap; }
.mgr-work .l b { color: #222; }

/* 盘面右下角的季度信息 / 事件提示 */
.evtip { border-radius: 8px; background: rgba(224,82,82,.92); color: #fff; font-size: .75em; font-weight: 600; display: flex; align-items: center; justify-content: center; text-align: center; padding: .3em .6em; cursor: pointer; }
.evtip.ok { background: rgba(79,191,127,.92); color: #0b2b18; }
.evtip.warn { background: rgba(224,163,58,.95); color: #2b1d05; }

/* ---------- 弹层 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.62); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(2px); }
.modal-mask[hidden] { display: none; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; width: min(760px, 92vw); max-height: 88vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.6); padding: 22px 26px; animation: pop .18s ease-out; }
.modal.wide { width: min(1000px, 94vw); }
.modal.narrow { width: min(480px, 92vw); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 20px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.modal h3 .zone-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.modal .hint { font-size: 13px; color: var(--sub); margin-bottom: 14px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal .foot .left { margin-right: auto; }
.modal .row { display: flex; gap: 14px; align-items: flex-start; }
.modal .field { margin: 10px 0; }
.modal .field label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 4px; }
.modal .field input { width: 100%; padding: 10px 12px; font-size: 18px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); color: var(--ink); font-variant-numeric: tabular-nums; }
.modal .field input:focus { outline: none; border-color: var(--gold); }
.modal .note { font-size: 12px; color: var(--mut); }

/* 选卡 / 选人 网格 */
.grid { display: grid; gap: 12px; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.pick { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; transition: border-color .15s, transform .1s; position: relative; }
.pick:hover { border-color: var(--gold); transform: translateY(-2px); }
.pick.off { opacity: .38; cursor: not-allowed; }
.pick.off:hover { border-color: var(--line); transform: none; }
.pick img { width: 100%; display: block; border-radius: 8px; }
.pick .nm { font-size: 14px; font-weight: 600; margin-top: 6px; display: flex; justify-content: space-between; align-items: center; }
.pick .ef { font-size: 12px; color: var(--sub); }
.pick .why { font-size: 11px; color: var(--red); margin-top: 3px; }
.pick .cost { display: inline-flex; gap: 4px; }
.pick .st { font-size: 11px; color: var(--mut); margin-top: 3px; }
.pick .st b { color: var(--gold); }
.pick .slotno { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.7); color: var(--gold); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.group-title { font-size: 12px; color: var(--mut); letter-spacing: 1px; margin: 12px 0 6px; }

/* 员工详情 */
.emp-detail { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
.emp-detail img { width: 100%; border-radius: 12px; }
.ctl { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ctl .l { color: var(--sub); font-size: 13px; }
.ctl .v { font-size: 20px; font-weight: 600; min-width: 90px; text-align: center; }
.ctl .v small { font-size: 12px; color: var(--mut); font-weight: 400; }
.ctl .bt { display: flex; gap: 6px; }

/* 骰子 */
.dice-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 10px 0 4px; }
.dice { width: 110px; height: 110px; border-radius: 22px; background: #fff; color: #1a1a1a; font-size: 64px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -6px 0 rgba(0,0,0,.12), 0 12px 30px rgba(0,0,0,.5); }
.dice.rolling { animation: shake .12s infinite; }
@keyframes shake { 0% { transform: rotate(-8deg) translateX(-3px); } 50% { transform: rotate(8deg) translateX(3px); } 100% { transform: rotate(-8deg) translateX(-3px); } }
.dice-result { font-size: 18px; font-weight: 600; min-height: 28px; text-align: center; }
.dice-result .sub { font-size: 13px; color: var(--sub); font-weight: 400; display: block; margin-top: 3px; }

/* 结算逐步展示 */
.steps { list-style: none; }
.steps li { padding: 12px 14px; border-radius: 10px; background: var(--bg); margin-bottom: 8px; display: none; border-left: 4px solid var(--gold-dim); animation: pop .2s ease-out; }
.steps li.show { display: block; }
.steps li.red { border-left-color: var(--red); }
.steps li.green { border-left-color: var(--ok); }
.steps li.purple { border-left-color: var(--purple); }
.steps li.blue { border-left-color: var(--blue); }
.steps li .st-t { font-size: 12px; color: var(--mut); letter-spacing: 1px; margin-bottom: 3px; }
.steps li .st-b { font-size: 15px; }
.steps li .st-b b { color: var(--gold); font-size: 17px; }
.steps li .st-b .red { color: var(--red); }
.steps li .st-b .ok { color: var(--ok); }
.bigno { font-size: 44px; font-weight: 700; color: var(--gold); text-align: center; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bigno small { font-size: 16px; color: var(--sub); font-weight: 400; }
.choice2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.choice2 button { padding: 18px 12px; font-size: 16px; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; top: 12%; left: 50%; transform: translateX(-50%); background: var(--dark); color: var(--gold);
  padding: 12px 24px; border-radius: 10px; border: 1px solid var(--gold); font-size: 15px; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 200; max-width: 80vw; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
.toast.err { border-color: var(--red); color: #F08A8A; }

/* ---------- 小屏兜底 ---------- */
@media (max-width: 1400px) { :root { --drawer-w: 310px; } }
@media (max-width: 1100px) { :root { --drawer-w: 280px; } .stat .v { font-size: 15px; } .timeline .k { font-size: 11px; } }
