/* ===========================================================================
 * 财务顾问 v2 · 「财税管家工作台」样式（独立样式表）
 * ---------------------------------------------------------------------------
 * 为什么单开一个文件：与 finance.css 同一理由 —— 全站铁律，不动 style.css。
 *   本文件在 index.html 里**必须排在 finance.css 之后**加载（同名选择器后出现者胜出）。
 *
 * 配色：沿用 finance.css 的「墨绿 + 金」身份（这是该模块的板块内辨识度）。
 *   品牌橙（--primary）**没有换**，仍只用在主行动按钮上 —— 用户底线。
 *
 * 🔴 三条硬约束（与 finance.css 同款，别在改版时破坏）：
 *   ① 所有类名一律 `.ft-` 前缀 + 必要时挂 `#sub-finance` ——
 *      裸类名跨组件冲突是本项目踩过的坑（`.vip-avatar` 事件）。
 *   ② `hidden` 会被 display:flex/grid 盖掉 → 凡用 hidden 控制的元素都补
 *      `[hidden]{display:none!important}`。
 *   ③ 金额一律 tabular-nums 等宽数字，否则测算表数字列对不齐，一眼业余。
 * =========================================================================== */

/* 兜底：本文件用 hidden 控制的所有元素都必须真的藏起来 */
#sub-finance .ft-nav[hidden],
#sub-finance .ft-arch[hidden],
#sub-finance .ft-panel[hidden],
#sub-finance .ft-out[hidden],
#sub-finance .ft-f[hidden] { display: none !important; }

/* ===================== ① 模块导航（工作台的"门面"） ===================== */
.ft-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
@media (min-width: 560px) { .ft-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.ft-navc {
  position: relative;                 /* 约束内部伪元素，绝不撑宽 document */
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 12px 12px;
  text-align: left;
  background: #fff;
  border: 1px solid #e3ece8;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .16s ease, border-color .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.ft-navc:active { transform: scale(.985); }
.ft-navc.on {
  border-color: #2d8f72;
  background: linear-gradient(135deg, #f4fbf8 0%, #ffffff 100%);
  box-shadow: 0 4px 14px rgba(16, 73, 58, .12);
}
.ft-navc-i { font-size: 19px; line-height: 1; }
.ft-navc-n { font-size: 13.5px; font-weight: 800; color: var(--text, #1f2937); letter-spacing: .2px; }
.ft-navc-d {
  font-size: 11px; color: var(--text2, #6b7280); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ft-navc.on .ft-navc-n { color: #10493a; }

/* ===================== ② 档案条（"我记得你" —— 人性化的落点） ===================== */
.ft-arch {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 10px 12px; margin: 0 0 12px;
  background: linear-gradient(135deg, #f4fbf8 0%, #fdfefd 100%);
  border: 1px solid #d5e9e1; border-left: 3px solid #2d8f72;
  border-radius: 12px;
  font-size: 12px; color: var(--text2, #6b7280);
}
.ft-arch-t { font-weight: 800; color: #17614e; font-size: 12px; }
.ft-arch-c { flex: 1 1 auto; min-width: 0; }
.ft-arch-s { font-variant-numeric: tabular-nums; color: #17614e; font-weight: 700; }
.ft-arch-s b { font-size: 15px; color: #10493a; }
.ft-arch-since { font-style: normal; font-size: 11px; color: #93aaa2; margin-left: 4px; }
.ft-up { color: #c2410c; font-style: normal; font-weight: 800; }
.ft-dn { color: #15803d; font-style: normal; font-weight: 800; }
.ft-eq { color: #93aaa2; font-style: normal; }

/* ===================== ③ 模块面板 ===================== */
.ft-panel {
  background: #fff;
  border: 1px solid #e3ece8;
  border-radius: 16px;
  padding: 14px 14px 16px;
  margin: 0 0 16px;
}
.ft-panel-hd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 12px; }
.ft-panel-ico { font-size: 18px; }
.ft-panel-t { font-size: 15px; font-weight: 800; color: var(--text, #1f2937); }
.ft-panel-s { font-size: 11.5px; color: var(--text2, #6b7280); }

.ft-fields { display: flex; flex-direction: column; gap: 14px; }
.ft-f-q { font-size: 13.5px; font-weight: 700; color: var(--text, #1f2937); line-height: 1.5; }
.ft-f-h { font-size: 11.5px; color: #8aa39b; line-height: 1.5; margin-top: 3px; }
.ft-opts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.ft-o {
  padding: 7px 11px;
  font-size: 12.5px; color: var(--text, #374151);
  background: #f7faf9;
  border: 1px solid #e3ece8;
  border-radius: 10px;
  cursor: pointer;
  transition: all .14s ease;
  -webkit-tap-highlight-color: transparent;
}
.ft-o:active { transform: scale(.97); }
.ft-o.on {
  background: linear-gradient(135deg, #2d8f72 0%, #10493a 100%);
  border-color: #10493a; color: #fff; font-weight: 700;
  box-shadow: 0 3px 10px rgba(16, 73, 58, .22);
}
.ft-in {
  width: 100%; margin-top: 8px; padding: 10px 12px;
  font-size: 14px; font-variant-numeric: tabular-nums;
  color: var(--text, #1f2937);
  background: #fbfdfc; border: 1px solid #e3ece8; border-radius: 10px;
  outline: none;
}
.ft-in:focus { border-color: #2d8f72; background: #fff; box-shadow: 0 0 0 3px rgba(45, 143, 114, .12); }

.ft-run { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.ft-go {
  flex: 0 0 auto;
  padding: 11px 22px;
  font-size: 14px; font-weight: 800; color: #fff;
  background: var(--primary, #f95901);      /* 主行动按钮 = 品牌橙（底线：不许换） */
  border: 0; border-radius: 12px;
  box-shadow: 0 5px 14px rgba(249, 89, 1, .26);
  cursor: pointer;
}
.ft-go:disabled { opacity: .62; box-shadow: none; cursor: default; }
.ft-go:active:not(:disabled) { transform: scale(.98); }
.ft-run-hint { font-size: 11px; color: #93aaa2; line-height: 1.4; }

/* ===================== ④ 等待与进度（只渐进，不报假数） ===================== */
.ft-wait { padding: 18px 4px 8px; }
.ft-bar { height: 6px; border-radius: 999px; background: #eaefed; overflow: hidden; }
.ft-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #2d8f72, #7bc4ab);
  border-radius: 999px; transition: width .3s ease;
}
.ft-wait-s { margin-top: 9px; font-size: 12px; color: var(--text2, #6b7280); }

/* ===================== ⑤ 结果卡 ===================== */
.ft-card {
  background: #fff; border: 1px solid #e3ece8; border-radius: 14px;
  overflow: hidden;
}
.ft-card-bd { padding: 14px 14px 4px; font-size: 13.5px; line-height: 1.78; color: var(--text, #374151); }
.ft-card-bd .ft-h {
  margin: 16px 0 8px; font-size: 14px; font-weight: 800; color: #10493a;
  padding-left: 9px; border-left: 3px solid #2d8f72; line-height: 1.4;
}
.ft-card-bd .ft-h:first-child { margin-top: 2px; }
.ft-card-bd p { margin: 7px 0; }
.ft-card-bd ul, .ft-card-bd ol { margin: 7px 0; padding-left: 20px; }
.ft-card-bd li { margin: 4px 0; }
.ft-card-bd code {
  padding: 1px 5px; font-size: 12.5px; background: #f1f6f4; border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
.ft-card-bd b { color: #10493a; }

/* 风险分级（🔴/🟡/🟢 开头的行） */
.ft-risk-hi { background: #fef2f2; border-left: 3px solid #dc2626; padding: 7px 10px; border-radius: 6px; }
.ft-risk-mid { background: #fffbeb; border-left: 3px solid #d97706; padding: 7px 10px; border-radius: 6px; }
.ft-risk-ok { background: #f0fdf4; border-left: 3px solid #16a34a; padding: 7px 10px; border-radius: 6px; }

/* 表格（测算对比必须有，手机端可横向滚动） */
.ft-tw { overflow-x: auto; margin: 10px 0; -webkit-overflow-scrolling: touch; }
.ft-tb {
  width: 100%; border-collapse: collapse;
  font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ft-tb th, .ft-tb td { padding: 7px 9px; border-bottom: 1px solid #eef3f1; text-align: left; }
.ft-tb th { background: #f4fbf8; color: #10493a; font-weight: 800; }
.ft-tb tr:last-child td { border-bottom: 0; }
.ft-tb td:first-child { font-weight: 700; color: var(--text, #374151); white-space: normal; }

.ft-caret {
  display: inline-block; width: 7px; height: 14px; margin-left: 2px;
  background: #2d8f72; border-radius: 2px;
  animation: ft-blink .9s steps(2, start) infinite; vertical-align: -2px;
}
@keyframes ft-blink { to { visibility: hidden; } }

.ft-card-ft {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid #eef3f1; background: #fbfdfc;
}
.ft-copy {
  padding: 7px 13px; font-size: 12.5px; font-weight: 700; color: #17614e;
  background: #e6f5ef; border: 1px solid #cfe6dd; border-radius: 9px; cursor: pointer;
}
.ft-copy:active { transform: scale(.97); }
.ft-card-tip { font-size: 10.5px; color: #93aaa2; line-height: 1.4; }

.ft-err {
  padding: 12px 14px; font-size: 13px; line-height: 1.6;
  color: #9a3412; background: #fff7ed;
  border: 1px solid #fed7aa; border-left: 3px solid #ea580c; border-radius: 10px;
}
