/* 会员档案：栏目切换条 + 概览或某一栏列表 */
/* 切换条摆在最上面，四列对齐：手机上七个栏目加概览正好两行，不用在一屏里找胶囊 */
.profile-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0;
  padding: 10px; border: 1px solid var(--app-line); border-radius: 14px; background: var(--app-white); }
.profile-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 50px; padding: 4px 2px; border: 1px solid var(--app-line); border-radius: 10px;
  background: #f8faf8; color: var(--app-text-secondary); font: inherit; font-size: 13px; cursor: pointer; }
.profile-tab b { color: var(--app-text); font-size: 15px; font-variant-numeric: tabular-nums; }
.profile-tab.is-on { border-color: var(--app-primary); background: var(--app-primary-soft); color: var(--app-primary-dark); }
.profile-tab.is-on b { color: var(--app-primary-dark); }
.profile-tabs + .panel { margin-top: 14px; }
.profile-visit { min-width: 0; }
.profile-visit + .profile-visit { border-top: 1px solid var(--app-line); margin-top: 16px; padding-top: 16px; }
.profile-visit__head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; }
.profile-visit__chief { color: var(--app-primary-dark); }
.profile-visit__head .btn { margin-left: auto; white-space: nowrap; }
.profile-list tbody tr { position: relative; }
.profile-open { display: flex; align-items: baseline; gap: 8px; width: 100%; min-width: 0; padding: 0; border: 0; background: none;
  color: var(--app-text); text-align: left; font: inherit; cursor: pointer; }
.profile-open-cell { font-weight: 600; }
.profile-open__arrow { margin-left: auto; padding-left: 6px; color: var(--app-muted); font-size: 22px; line-height: 1; }
.profile-open::after { content: ''; position: absolute; inset: 0; }
.profile-document { min-width: 0; overflow-wrap: anywhere; }
.profile-document-short { display: none; }
.profile-date, .profile-money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.profile-eyes, .profile-followup, .profile-sale-state, .profile-rental-state, .profile-dated {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.profile-eyes > span, .profile-debt { white-space: nowrap; font-variant-numeric: tabular-nums; }
.profile-debt { color: var(--app-danger-text); font-weight: 600; }
.profile-date-label { display: none; }
.profile-follow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--app-state-warning-bg); color: var(--app-state-warning); font-size: 14px; }
.profile-follow--muted { background: var(--app-state-neutral-bg); color: var(--app-state-neutral); }
.profile-mates { color: var(--app-primary-dark); }
/* 手机不写格子标题：日期、来源、球镜、结果这些值本身就说明自己是什么 */
@media (max-width: 899px) {
  .app-table.profile-list tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start; gap: 6px 14px; padding: 14px 0; }
  .app-table.profile-list td { font-size: 14px; overflow-wrap: anywhere; }
  .profile-list td::before { display: none; }
  .app-table.profile-list td.profile-main { grid-column: 1; grid-row: 1; font-weight: 600; }
  .app-table.profile-list td.profile-secondary { grid-column: 1; grid-row: 2; color: var(--app-muted); }
  .app-table.profile-list td.profile-detail { grid-column: 2; grid-row: 2; text-align: right; color: var(--app-muted); }
  .app-table.profile-list td.profile-state { grid-column: 2; grid-row: 1; text-align: right; }
  .profile-list .profile-eyes, .profile-list .profile-sale-state { justify-content: flex-end; }
  .app-table.profile-list--sales td.profile-detail { grid-row: 1; color: var(--app-text); font-weight: 600; }
  .app-table.profile-list--sales td.profile-state { grid-row: 2; color: var(--app-muted); }
  .app-table.profile-list--optometry td.profile-detail { grid-column: 1 / -1; grid-row: 3; text-align: left; }
  .profile-list--optometry .profile-eyes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
  .profile-document:has(.profile-document-short) .profile-document-full { display: none; }
  .profile-document-short { display: inline; white-space: nowrap; }
  .app-table.profile-list--storage td.profile-main, .app-table.profile-list--rentals td.profile-main { grid-column: 1 / -1; }
  .app-table.profile-list--storage td.profile-state, .app-table.profile-list--rentals td.profile-state {
    grid-column: 1 / -1; grid-row: 2; text-align: left; color: var(--app-muted); }
  .app-table.profile-list--storage td.profile-secondary, .app-table.profile-list--rentals td.profile-secondary,
  .app-table.profile-list--storage td.profile-detail, .app-table.profile-list--rentals td.profile-detail { grid-row: 3; }
  .profile-date-label { display: inline; color: var(--app-muted); }
  .profile-detail .profile-dated { justify-content: flex-end; }
  /* 基本资料改成"标题在左、值在右"的一行一条，不再竖着排成两屏 */
  .profile-page .member-facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .profile-page .member-facts > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: baseline;
    gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f1f3; }
  .profile-page .member-facts > div:last-child { border-bottom: 0; }
  .profile-page .member-facts dt { font-size: 15px; }
  .profile-page .member-facts dd { margin: 0; min-width: 0; text-align: left; font-size: 16px; overflow-wrap: anywhere; }
}
@media (min-width: 900px) {
  .profile-list td { padding-top: 9px; padding-bottom: 9px; }
  .profile-list .profile-open-cell { width: 34%; }
}

/* 档案正文用清楚的字号，导航不再用历史数量争夺注意力。 */
.profile-page .profile-tab { font-size: 15px; min-height: 48px; }
.profile-identity { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; font-size: 16px; overflow-wrap: anywhere; }
.profile-page .member-detail-actions .btn { min-height: 48px; font-size: 16px; white-space: nowrap; }
.profile-page .profile-sale-title { display: grid; gap: 6px; }
.profile-sale-title .profile-document { font-size: 15px; font-weight: 400; color: var(--app-text-secondary); }
.profile-overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; padding: 20px; }
.profile-summary { min-width: 0; padding: 18px; border: 1px solid var(--app-line); border-radius: 12px; background: var(--app-white); color: var(--app-text); font: inherit; font-size: 16px; text-align: left; cursor: pointer; line-height: 1.6; overflow-wrap: anywhere; }
.profile-summary:hover { background: var(--app-primary-soft); }
.profile-summary.is-alert { color: var(--app-danger-text); border-color: currentColor; }
.profile-page .member-facts dd { font-size: 16px; line-height: 1.6; }
.profile-page .member-facts dt { font-size: 15px; }
.profile-page .panel__head h2 { font-size: 18px; }
.profile-page .member-detail-title > p { font-size: 16px; line-height: 1.6; }
.profile-page .training-history > .panel { border: 0; box-shadow: none; }
.profile-page .training-facts dd { font-size: 16px; }
@media (max-width: 899px) {
  .profile-page .member-detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 10px; }
  .profile-page .member-detail-actions .btn { min-width: 0; width: 100%; padding-inline: 10px; }
  .profile-page .app-table.profile-list td { font-size: 16px; }
  .profile-page .app-table.profile-list td.profile-main { font-size: 16px; }
  .profile-overview-grid { padding: 14px; gap: 10px; }
}
.profile-credit .panel__body { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.profile-credit h2 { margin: 0 0 4px; color: var(--app-text-secondary); font-size: 16px; }
.profile-credit strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.member-credit-entry { display: grid; gap: 8px; padding-block: 12px; border-bottom: 1px solid var(--app-line); }
.member-credit-entry > div { display: flex; gap: 8px 12px; justify-content: space-between; flex-wrap: wrap; }
.member-credit-entry p { margin: 0; overflow-wrap: anywhere; }
