/* 客户管理员的「团队」页（team.js）。沿用 app.css 的变量和按钮；一页一件事，窄屏单列。 */
.tm { max-width: 960px; margin: 0 auto; padding: 24px 20px 40px; }
.tm.tm-narrow { max-width: 680px; }
.tm h1 { margin: 6px 0 14px; }
.tm-h2-gap { margin-top: 26px; margin-bottom: 10px; }
.tm h3 { font-size: 1rem; margin: 18px 0 6px; }

/* 页头：成员 / 反馈 两个标签 + 右边「怎么用」 */
.tm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; }
.tm-tabs { display: flex; gap: 4px; }
.tm-tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; min-height: 44px; display: inline-flex; align-items: center; }
.tm-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--mark); }
.tm-how { color: var(--focus); white-space: nowrap; flex: none; }
.tm-label { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 0.9rem; }
.tm-hisfb { margin: 4px 0 16px; }
.tm-hisfb a { color: var(--focus); font-weight: 500; }
.tm-danger { margin-top: 28px; }

.tm-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.button.primary.tm-add { min-height: 48px; padding: 10px 18px; font-size: 1.05rem; background: var(--mark); border-color: var(--mark); color: #1b1200; white-space: nowrap; }
.button.primary.tm-add:hover { background: #f2b23a; border-color: #f2b23a; }
.tm-empty { background: var(--card); border: 1px dashed var(--rule); border-radius: var(--radius-m); padding: 20px; color: var(--muted); }
.tm-homehint { margin: -16px 0 22px; }
.tm-homehint a { color: var(--focus); font-weight: 500; }

/* 成员列表：一行一人，整行可点 */
.tm-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-m); overflow: hidden; }
.tm-list li + li { border-top: 1px solid var(--rule); }
.tm-row { display: grid; grid-template-columns: minmax(8em, 1.2fr) 2fr minmax(9em, 1.1fr) 7em 7em 1em; gap: 12px; align-items: center;
  padding: 12px 16px; text-decoration: none; color: inherit; min-height: 56px; }
.tm-row:hover { background: var(--paper); }
.tm-row.tm-ro:hover { background: none; }
.tm-ro .tm-nfb { color: var(--focus); }
.tm-others .tm-list { margin-top: 10px; }
.tm-name { font-weight: 600; }
.tm-scope-s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-go { color: var(--muted); font-size: 1.4rem; text-align: right; }
.tm-state { font-size: 0.875rem; font-weight: 500; }
.tm-state.st-active { color: var(--ok); }
.tm-state.st-sent { color: var(--mark-ink); }
.tm-state.st-no_invite, .tm-state.st-disabled { color: var(--danger); }
p.tm-state { margin: -8px 0 14px; }

/* 卡片、向导 */
.tm-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 18px 20px; margin-bottom: 16px; }
.tm-card h2 { margin-bottom: 6px; }
.tm-card > p { margin-bottom: 8px; }
.tm-card input[type=text], .tm-days, .tm-filters select { width: 100%; max-width: 420px; padding: 10px 12px; border: 1px solid var(--rule);
  border-radius: var(--radius-s); background: var(--card); min-height: 44px; }
.tm-stepno { font-size: 0.875rem; }
.tm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.tm-actions .primary, .tm-actions .button { min-height: 46px; padding: 10px 18px; }
.tm-actions .tm-days { width: auto; }
.tm-scope { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.tm-radio, .tm-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius-s); cursor: pointer; min-height: 44px; }
.tm-radio input, .tm-check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.tm-radio span, .tm-check span { display: flex; flex-direction: column; }
.tm-check span { display: inline; }
.tm-hint { font-weight: 400; }
.tm-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.tm-back { display: inline-flex; min-height: 40px; align-items: center; color: var(--focus); text-decoration: none; font-weight: 500; }
.err { color: var(--danger); }

/* 一次性链接 */
.tm-linkcard { border-color: var(--mark); background: var(--mark-soft); }
.tm-linkrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.tm-linkrow .tm-link { flex: 1 1 280px; max-width: none; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.tm-steps { margin: 0; padding-left: 1.3em; }
.tm-steps li { margin: 4px 0; }

/* 危险操作 */
.danger-btn { color: var(--danger); border-color: var(--danger); }
.danger-btn:hover { background: #fbeceb; border-color: var(--danger); }
.tm-danger { border-color: #efc9c6; }
.tm-head { min-width: 0; }
.tm-tabs { min-width: 0; }
.tm-danger p { margin-bottom: 10px; }
.tm-confirm p { margin-bottom: 6px; }

/* 反馈页 */
.tm-toolbar { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-start; justify-content: space-between; margin: 16px 0 6px;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 14px 16px; }
.tm-filters { display: flex; gap: 10px; flex-wrap: wrap; flex: 1 1 320px; }
.tm-filters select { flex: 1 1 180px; width: auto; }
.tm-dl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tm-dl p { flex-basis: 100%; }
.tm-fblist, .tm-approvals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tm-fb { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.tm-fb-line { font-size: 1.05rem; }
.tm-fb-note { white-space: pre-wrap; }
.chip.static { cursor: default; background: var(--mark-soft); border-color: var(--mark); color: var(--mark-ink); display: inline-flex; align-items: center; min-height: 28px; border-radius: 999px; }
.tm-fb-st { font-size: 0.875rem; font-weight: 500; }
.tm-fb-st.fs-open { color: var(--mark-ink); }
.tm-fb-st.fs-fixed { color: var(--ok); }
.tm-fb-st.fs-wontfix { color: var(--muted); }
.tm-fblist + button { margin-top: 12px; }
.tm-approvals li { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 10px 14px; }
.tm-approvals li.final { border-color: var(--ok); background: var(--ok-soft); }
.tm-final { display: inline-block; margin-left: 8px; font-size: 0.8rem; font-weight: 600; color: var(--ok); }

/* 页头的「团队」按钮 */
.team-btn { min-height: 36px; padding: 5px 12px; font-weight: 600; }

@media (max-width: 760px) {
  .tm { padding: 14px 12px 32px; }
  .tm-intro { flex-direction: column; align-items: stretch; }
  .tm-add { justify-content: center; }
  /* 成员列表：手机上每人一张两行的卡片（名字 + 状态 / 范围 + 最近登录），整行可点 */
  .tm-row { grid-template-columns: 1fr auto; grid-template-areas: "name go" "state go" "scope go" "seen go"; gap: 2px 8px; padding: 12px 14px; }
  .tm-name { grid-area: name; }
  .tm-state { grid-area: state; }
  .tm-scope-s { grid-area: scope; white-space: normal; }
  .tm-seen { grid-area: seen; }
  .tm-nfb { display: none; }
  .tm-ro .tm-nfb { display: inline; grid-area: seen; }
  .tm-go { grid-area: go; align-self: center; }
  .tm-card { padding: 14px; }
  .tm-actions > * { flex: 1 1 100%; justify-content: center; }
  .tm-actions .tm-days { width: 100%; }
  .tm-checks { grid-template-columns: 1fr; }
  .tm-dl .button { flex: 1 1 100%; justify-content: center; min-height: 46px; }
  .tm-tabs a { padding: 10px 8px; }
  .tm-how { min-width: 44px; justify-content: center; font-weight: 700; }
  .team-btn { padding: 4px 8px; font-size: 0.85rem; min-height: 34px; }
}
