/* 财务工作台（web/finance_desk.js；fd 线）。
   ★ 所有规则以 `html.sh-on .fd` 开头，只作用在容器 .fd 内。
   设计总纲：字阶 13/16/20、字重 400/600、间距 4 的倍数、圆角 8/12/999、一个强调色（品牌蓝）、语义色只在小面积状态里。 */

/* 容器令牌 + 基础 */
html.sh-on .fd { --fd-ink:#101828;--fd-ink2:#475467;--fd-line:#e4e7ec;--fd-blue:#0265c2;--fd-blue-soft:#e8f1fb;--fd-wash:#f9fafb;--fd-ok:#067647;--fd-ok-bg:#ecfdf3;--fd-warn:#93370d;--fd-warn-bg:#fffaeb;--fd-bad:#b42318;--fd-bad-bg:#fef3f2; padding:16px;max-width:960px;color:var(--fd-ink);font-size:16px;line-height:24px; }
html.sh-on .fd * { box-sizing:border-box; }

/* 结论带 */
html.sh-on .fd .fd-concl { background:var(--fd-blue-soft); border-radius:12px; padding:16px; display:flex; flex-direction:column; gap:8px; }
html.sh-on .fd .fd-concl h2 { margin:0; font-size:20px; line-height:28px; font-weight:600; }

/* 按钮 / 链接 */
html.sh-on .fd .fd-btn { min-height:32px; padding:0 16px; border-radius:8px; border:1px solid var(--fd-line); background:#fff; font-size:16px; white-space:nowrap; cursor:pointer; font:inherit; }
html.sh-on .fd .fd-btn.primary { background:var(--fd-blue); color:#fff; min-height:44px; border-color:var(--fd-blue); align-self:flex-start; }
html.sh-on .fd .fd-btn.primary:hover { filter:brightness(.92); }
html.sh-on .fd .fd-link { background:none; border:none; color:var(--fd-blue); min-height:32px; cursor:pointer; font:inherit; }

/* 今天要办 */
html.sh-on .fd .fd-today { margin-top:24px; }
html.sh-on .fd .fd-today h3 { margin:0 0 12px; font-size:20px; line-height:28px; font-weight:600; }
html.sh-on .fd .fd-list { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
html.sh-on .fd .fd-row { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:56px; padding:12px 16px; border:1px solid var(--fd-line); border-radius:12px; background:#fff; text-align:left; font:inherit; cursor:pointer; }
html.sh-on .fd .fd-row:hover { border-color:var(--fd-ink); }
html.sh-on .fd .fd-row-t { flex:1 1 auto; min-width:0; overflow-wrap:anywhere; }
html.sh-on .fd .fd-go { flex:none; font-size:13px; line-height:20px; font-weight:600; color:var(--fd-blue); white-space:nowrap; }
html.sh-on .fd .fd-row:hover .fd-go, html.sh-on .fd .fd-node:hover b { text-decoration:underline; }
html.sh-on .fd .fd-row:focus-visible, html.sh-on .fd .fd-node:focus-visible, html.sh-on .fd .fd-btn:focus-visible, html.sh-on .fd .fd-link:focus-visible { outline:2px solid var(--fd-blue); outline-offset:2px; }

/* 节点 */
html.sh-on .fd .fd-nodes { margin-top:24px; }
html.sh-on .fd .fd-nodes h3 { margin:0 0 12px; font-size:20px; line-height:28px; font-weight:600; }
html.sh-on .fd .fd-nodes-row { display:flex; flex-wrap:wrap; gap:12px; }
html.sh-on .fd .fd-node { flex:1 1 240px; display:flex; flex-direction:column; align-items:flex-start; gap:8px; padding:16px; border:1px solid var(--fd-line); border-radius:12px; background:#fff; text-align:left; font:inherit; cursor:pointer; }

/* 备注 */
html.sh-on .fd .fd-note { display:flex; flex-direction:column; align-items:flex-start; gap:8px; margin-top:24px; padding:16px; border:1px solid var(--fd-line); border-radius:12px; background:var(--fd-wash); }
html.sh-on .fd .fd-note b { font-size:16px; line-height:24px; font-weight:600; color:var(--fd-ink); }

/* 胶囊 */
html.sh-on .fd .fd-pill { display:inline-block; padding:0 8px; border-radius:999px; font-size:13px; line-height:20px; font-weight:600; white-space:nowrap; }
html.sh-on .fd .fd-pill.late { color:var(--fd-bad); background:var(--fd-bad-bg); }
html.sh-on .fd .fd-pill.todo { color:var(--fd-warn); background:var(--fd-warn-bg); }
html.sh-on .fd .fd-pill.doing { color:var(--fd-warn); background:var(--fd-warn-bg); }
html.sh-on .fd .fd-pill.wait { background:var(--fd-wash); color:var(--fd-ink2); border:1px solid var(--fd-line); }
html.sh-on .fd .fd-pill.wait.ready { background:var(--fd-ok-bg); color:var(--fd-ok); border-color:transparent; }
html.sh-on .fd .fd-pill.done { color:var(--fd-ok); background:var(--fd-ok-bg); }

/* 次要文本 */
html.sh-on .fd .fd-dim { margin:0; font-size:13px; line-height:20px; color:var(--fd-ink2); overflow-wrap:anywhere; }

/* 空态 */
html.sh-on .fd.fd-empty { display:flex; flex-direction:column; align-items:flex-start; gap:12px; padding:24px; margin:16px; border:1px solid var(--fd-line); border-radius:12px; background:#fff; text-align:left; }
html.sh-on .fd.fd-empty b { font-size:20px; line-height:28px; font-weight:600; }
html.sh-on .fd.fd-empty span { font-size:16px; line-height:24px; color:var(--fd-ink2); }

/* 骨架 */
html.sh-on .fd.fd-skel { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
html.sh-on .fd.fd-skel i { display:block; border-radius:12px; background:#eef1f5; margin-bottom:12px; animation:fd-pulse 1.4s ease-in-out infinite; }
html.sh-on .fd.fd-skel .fd-sk-concl { height:120px; grid-column:1/-1; }
html.sh-on .fd.fd-skel .fd-sk-row { height:56px; grid-column:1/-1; }
html.sh-on .fd.fd-skel .fd-sk-node { height:96px; }
@keyframes fd-pulse {
  0%, 100% { opacity:1; }
  50% { opacity:.6; }
}
@media (prefers-reduced-motion: reduce) {
  html.sh-on .fd.fd-skel i { animation:none; }
}

/* 手机 */
@media (max-width:900px) {
  html.sh-on .fd { padding:12px; }
  html.sh-on .fd.fd-empty { margin:12px; }
  html.sh-on .fd .fd-btn, html.sh-on .fd .fd-link, html.sh-on .fd .fd-row, html.sh-on .fd .fd-node { min-height:44px; }
  html.sh-on .fd .fd-nodes-row { flex-direction:column; }
  html.sh-on .fd .fd-node { flex:none; }
  html.sh-on .fd.fd-skel { grid-template-columns:1fr; }
}

/* 外壳 skin.css 给 #extApp 里所有 button 一刀切 height:40px / padding:0 16px / 600 字重（带 ID，权重压过上面的类选择器）：行与节点是「带多行内容的按钮」，需要同样带 ID 的规则盖回来 */
html.sh-on .fd:is(#extApp .fd) .fd-row { height:auto; padding:12px 16px; font-weight:400; line-height:24px; }
html.sh-on .fd:is(#extApp .fd) .fd-node { height:auto; padding:16px; font-weight:400; line-height:24px; }
