/* 咸鱼电竞设计系统 · 07-v7
   职责：全站预览 v7（业主 2026-10-08「直接部署到系统源码」）带进生产的增量：
   编号区块标题、焦点卡身份胶囊、首页三列 / 两列、流水列表、分成条、排行、七日柱状图，
   以及后续逐页迁移的页面构图。类名一律 xy- 前缀，不和遗留同名类互相污染。 */
@layer xy.pages {
  /* ── 编号区块标题：粉色斜体编号 + 宋体标题 + 英文斜体副标 ── */
  .section-head.xy-sec { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 14px; padding: 0; border: 0; min-height: 30px; }
  .section-head.xy-sec h2 { margin: 0; font-family: var(--font-serif); font-size: 17px; font-weight: 700; letter-spacing: .08em; line-height: 1.3; color: var(--text-1); }
  .xy-sec-idx { font-family: var(--font-accent); font-style: italic; font-size: 17px; line-height: 1; color: var(--accent); }
  .xy-sec-en { font-family: var(--font-accent); font-style: italic; font-size: 13px; color: var(--text-4); }
  .xy-sec-spacer { flex: 1 1 auto; }
  .xy-sec-hint { font-size: 12.5px; color: var(--text-4); }
  .section-head.xy-sec .ghost.mini { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-3); font-size: 12.5px; box-shadow: none; }
  .section-head.xy-sec .ghost.mini:hover { background: var(--bg-hover); color: var(--text-1); }
  .section-head.xy-sec .ghost.mini svg { width: 15px; height: 15px; }
  .dashboard-page .dashboard-overview .section-head.xy-sec { margin: 0 0 6px; }
  .dashboard-page .dashboard-overview .section-head.xy-sec h2 { font-size: 17px; }

  /* ── 焦点卡身份胶囊（取代首页独立身份栏） ── */
  .xy-focus-id {
    display: inline-flex; align-items: center; align-self: flex-start; gap: 10px; margin-bottom: 18px; padding: 5px 12px 5px 6px;
    border-radius: var(--r-pill); background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1px rgba(140, 61, 99, .12);
    font-size: 12.5px; color: var(--focus-ink);
  }
  .xy-focus-who { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: var(--r-pill); background: var(--focus-ink); color: #fff3f8; font-weight: 600; letter-spacing: .04em; white-space: nowrap; }
  .xy-focus-uid { color: var(--focus-ink-2); font-weight: 500; letter-spacing: .02em; white-space: nowrap; }
  .dashboard-focus .dashboard-focus-title { margin-top: 10px; }

  /* ── 首页下半区：三列 / 两列，卡片等高 ── */
  .dashboard-page .xy-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); align-items: stretch; }
  .dashboard-page .xy-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); align-items: stretch; }
  .dashboard-page .xy-trio > .card, .dashboard-page .xy-duo > .card { display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 22px var(--card-pad); }
  .dashboard-page .xy-trio > .card > :last-child { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; }
  .dashboard-page .xy-trio > .card > .xy-ledger:last-child { justify-content: flex-start; }

  /* ── 头像：首字 ── */
  .xy-ava {
    position: relative; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
    display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--sakura-100);
    background: radial-gradient(120% 120% at 30% 20%, #3a2a36, var(--ink-750));
    box-shadow: inset 0 0 0 1px var(--hairline-strong);
  }
  .xy-ava > svg { width: 15px; height: 15px; color: var(--text-3); }

  /* ── 流水列表 ── */
  .xy-ledger { list-style: none; margin: 0; padding: 0; }
  .xy-ledger li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: 13px 0; }
  .xy-ledger li + li { border-top: 1px solid var(--hairline); }
  .xy-ledger-main { min-width: 0; }
  .xy-ledger-who { font-size: 13.5px; font-weight: 600; color: var(--text-1); overflow-wrap: anywhere; }
  .xy-ledger-how { font-size: 12px; color: var(--text-4); }
  .xy-ledger-amt { text-align: right; font-family: var(--font-num); font-size: 15px; font-weight: 600; color: var(--text-1); white-space: nowrap; }
  .xy-ledger-amt .plus { color: var(--st-ok); margin-right: 1px; }
  .xy-ledger-amt .minus { color: var(--text-3); margin-right: 1px; }
  .xy-ledger-amt small { display: block; font-family: var(--font-ui); font-size: 11.5px; font-weight: 400; color: var(--text-4); }

  /* ── 分成条 ── */
  .xy-split { display: grid; gap: var(--s-4); }
  .xy-split-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); font-size: 13px; }
  .xy-split-label { color: var(--text-3); }
  .xy-split-track { height: 8px; border-radius: 4px; background: var(--ink-750); overflow: hidden; }
  .xy-split-fill { display: block; height: 100%; border-radius: 4px; transform-origin: left; animation: xy-grow var(--t-slow) var(--ease-out) both .12s; }
  .xy-split-val { text-align: right; font-weight: 600; white-space: nowrap; color: var(--text-1); }
  @keyframes xy-grow { from { transform: scaleX(0); } }

  /* ── 排行 ── */
  .xy-rank { list-style: none; margin: 0; padding: 0; }
  .xy-rank li { display: grid; grid-template-columns: 18px 36px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: 12px 0; }
  .xy-rank li + li { border-top: 1px solid var(--hairline); }
  .xy-rank-n { font-family: var(--font-accent); font-style: italic; font-size: 17px; color: var(--text-4); }
  .xy-rank li:first-child .xy-rank-n { color: var(--accent); }
  .xy-rank-main { min-width: 0; }
  .xy-rank-who { font-size: 13.5px; font-weight: 600; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .xy-rank-track { margin-top: 6px; height: 6px; border-radius: 3px; background: var(--ink-750); overflow: hidden; }
  .xy-rank-track span { display: block; height: 100%; border-radius: 3px; background: #d46c9e; transform-origin: left; animation: xy-grow var(--t-slow) var(--ease-out) both .15s; }
  .xy-rank-amt { text-align: right; font-family: var(--font-num); font-size: 15px; font-weight: 600; color: var(--text-1); white-space: nowrap; }
  .xy-rank-amt small { display: block; font-family: var(--font-ui); font-size: 11.5px; font-weight: 400; color: var(--text-4); }

  /* ── 七日柱状图 ── */
  .xy-chart { position: relative; }
  .xy-chart svg { display: block; width: 100%; height: 180px; overflow: visible; }
  .xy-chart-grid line { stroke: var(--hairline); stroke-width: 1; }
  .xy-chart-axis text { fill: var(--text-4); font-size: 11px; font-family: var(--font-num); }
  .xy-chart-hit { fill: transparent; }
  .xy-chart-bar { fill: var(--ink-600); transition: fill var(--t-fast); transform-box: fill-box; transform-origin: 50% 100%; animation: xy-bar-in 520ms var(--ease-out) both; animation-delay: calc(var(--i) * 40ms + 200ms); }
  .xy-chart-bar.today { fill: var(--sakura-300); }
  .xy-chart-col:hover .xy-chart-bar:not(.today) { fill: var(--ink-500); }
  .xy-chart-val { fill: var(--text-2); font-size: 11.5px; font-family: var(--font-num); font-weight: 600; text-anchor: middle; }
  @keyframes xy-bar-in { from { transform: scaleY(0); } }

  /* ── 通用列表行：每单一张独立圆角卡（标题 / 人员 / 金额 / 状态+时间） ── */
  .xy-rows { display: grid; gap: 10px; }
  .xy-row {
    position: relative; display: grid; align-items: center; width: 100%;
    grid-template-columns: minmax(0, 2.2fr) minmax(96px, 1fr) 108px 108px;
    gap: var(--s-5); min-height: 72px; padding: 14px 20px; border: 0; border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 236, 245, .03), transparent 70%), var(--bg-surface);
    box-shadow: inset 0 1px 0 rgba(255, 240, 247, .05), 0 0 0 1px rgba(255, 228, 240, .05), 0 10px 24px -18px rgba(0, 0, 0, .8);
    color: var(--text-1); text-align: left; font: inherit; cursor: pointer;
    transition: background var(--t-fast), box-shadow var(--t-base), transform var(--t-base) var(--ease-out);
    animation: xy-rise var(--t-slow) var(--ease-out) both;
  }
  .xy-row:hover { background: linear-gradient(180deg, rgba(255, 236, 245, .045), transparent 70%), var(--bg-raised); transform: translateY(-1px); }
  .xy-row:focus-visible { outline: 2px solid var(--focus-ring, var(--accent)); outline-offset: 2px; }
  .xy-row-main { display: grid; gap: 4px; min-width: 0; }
  .xy-row-main strong { font-size: 14px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
  .xy-row-main small { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--text-4); }
  .xy-row-people { display: grid; gap: 2px; min-width: 0; font-size: 13px; color: var(--text-2); }
  .xy-row-people > span { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .xy-row-people em { flex: 0 0 auto; font-style: normal; font-size: 11.5px; color: var(--text-4); }
  .xy-row-amount { text-align: right; font-family: var(--font-num); font-size: 16px; font-weight: 600; white-space: nowrap; }
  .xy-row-tail { display: grid; justify-items: end; gap: 3px; white-space: nowrap; }
  .xy-row-tail small { font-size: 11.5px; color: var(--text-4); }
  .xy-recent { padding: 22px var(--card-pad); }

  /* ── 陪玩首页：工作台四宫格 ── */
  .dashboard-page[data-dashboard-role="player"] .player-workspace-card { display: flex; flex-direction: column; margin: 0; padding: 22px var(--card-pad); border: 0; border-radius: var(--card-radius); background: var(--card-bg); box-shadow: var(--shadow-card); }
  .dashboard-page[data-dashboard-role="player"] .player-workspace-links { flex: 1 1 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(88px, 1fr); gap: 10px; margin: 0; padding: 0; border: 0; background: none; }
  .dashboard-page[data-dashboard-role="player"] .player-workspace-link {
    grid-column: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    min-height: 88px; padding: 14px 8px; border: 0; border-radius: var(--r-md);
    background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--hairline); color: var(--text-2); font-size: 13px; text-align: center;
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-base) var(--ease-out);
  }
  .dashboard-page[data-dashboard-role="player"] .player-workspace-link:hover { background: var(--bg-hover); color: var(--text-1); transform: translateY(-1px); }
  .dashboard-page[data-dashboard-role="player"] .player-workspace-link > svg:first-child { width: 22px; height: 22px; color: var(--accent); }
  .dashboard-page[data-dashboard-role="player"] .player-workspace-link > svg:last-child { display: none; }
  .dashboard-page[data-dashboard-role="player"] .player-workspace-link strong { font-weight: 600; }

  /* ── 老板首页：焦点卡里的大额可用余额 ── */
  .dashboard-page[data-dashboard-role="customer"] .dashboard-focus-title { max-width: 68%; }
  .xy-balance { font-family: var(--font-num); font-weight: 300; letter-spacing: -.04em; line-height: .88; }
  .xy-balance .cur { margin-right: 2px; font-size: 28px; font-weight: 400; letter-spacing: 0; }
  /* 新类同时挂在 .dashboard-focus-count 上：大字规则原本由那个类提供，
     这里补一份，将来即使旧类改名老板首页也不塌。 */
  .dashboard-page[data-dashboard-role="customer"] .dashboard-focus-title .xy-balance { font-size: 76px; }

  /* ── 紧凑行：行内不放金额列（金额已在主行小字里） ── */
  .xy-row.is-compact { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) 120px; }

  /* ── 内页页首：宋体大标题 + 英文斜体 + 右侧关键读数（v7 全站预览的 .lead） ── */
  .xy-lead { display: flex; align-items: flex-end; gap: var(--s-8); flex-wrap: wrap; padding: 2px 4px 0; }
  .xy-lead-copy { flex: 1 1 320px; min-width: 0; }
  .xy-lead-en { display: block; font-family: var(--font-accent); font-style: italic; font-size: 15px; color: var(--accent); letter-spacing: .02em; }
  .xy-lead-title { margin-top: 4px; font-family: var(--font-serif); font-size: 30px; font-weight: 700; letter-spacing: .12em; line-height: 1.25; color: var(--text-1); }
  .xy-lead-stats { display: flex; max-width: 100%; overflow-x: auto; margin: 0; border-radius: var(--r-lg); background: var(--bg-surface); box-shadow: 0 0 0 1px rgba(255, 228, 240, .05), 0 10px 24px -20px rgba(0, 0, 0, .8); }
  .xy-lead-stat { padding: 14px 22px; min-width: 0; }
  .xy-lead-stat + .xy-lead-stat { border-left: 1px solid var(--hairline); }
  .xy-lead-stat dt { font-size: 12px; color: var(--text-4); white-space: nowrap; }
  .xy-lead-stat dd { margin: 4px 0 0; font-family: var(--font-num); font-size: 20px; font-weight: 500; white-space: nowrap; letter-spacing: -.01em; color: var(--text-1); }
  .xy-lead-stat.is-hot dd { color: var(--accent); }
  .xy-lead-stat.is-warn dd { color: var(--st-warn); }
  .xy-lead-actions { order: 3; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  .xy-lead-actions > .payroll-page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
  /* 派单页沿用自己的统计条，只把标题换成 v7 宋体 */
  .dispatch-page-title.xy-lead-copy { flex: 0 1 auto; }

  /* ── 页面主列：编号区块竖排的统一步长（各页复用的卡间距离） ── */
  .xy-stack { display: grid; gap: var(--s-6); }
  .xy-stack > .card { margin: 0; }

  /* ── 道具清单（我的道具） ── */
  .xy-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
  .xy-perks li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: 14px 16px; border-radius: var(--r-md); background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--hairline); }
  .xy-perks-main { display: grid; gap: 5px; min-width: 0; }
  .xy-perks-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text-1); }
  .xy-perks-name svg { flex: 0 0 auto; width: 17px; height: 17px; color: var(--accent); }
  .xy-perks-meta { font-size: 12px; color: var(--text-4); }

  /* ── 明细字段对（详情抽屉 / 资料卡共用）：标签在上、值在下 ── */
  .xy-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 18px; margin: 0; }
  .xy-facts > div { display: grid; gap: 3px; min-width: 0; }
  .xy-facts dt { font-size: 12px; color: var(--text-4); }
  .xy-facts dd { margin: 0; font-size: 14px; font-weight: 500; color: var(--text-1); overflow-wrap: anywhere; }

  /* ── 内页两列：不挂在首页容器下，任何页面（含老板端子页）都能直接用 ── */
  .xy-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); align-items: stretch; }
  .xy-duo > .card { display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 22px var(--card-pad); }

  /* ── 工具条里的主按钮（新增类操作挪到搜索/排序同一行） ── */
  .customer-toolbar:has(> .xy-toolbar-cta) { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
  .recharge-toolbar:has(> .xy-toolbar-cta) { grid-template-columns: minmax(0, 1fr) auto; }
  .xy-toolbar-cta { white-space: nowrap; }
}

@layer xy.responsive {
  @media (max-width: 1180px) {
    .dashboard-page .xy-trio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-page .xy-trio > :last-child { grid-column: 1 / -1; }
  }
  @media (max-width: 980px) {
    .dashboard-page .xy-trio, .dashboard-page .xy-duo { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .dashboard-page .xy-trio > :last-child { grid-column: auto; }
    .dashboard-page .xy-trio > .card, .dashboard-page .xy-duo > .card { padding: 18px 16px; }
    .xy-duo { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .xy-duo > .card { padding: 18px 16px; }
    .xy-focus-id { align-self: center; margin-bottom: 14px; font-size: 12px; }
    .xy-lead { gap: 16px; padding: 0 2px; }
    .xy-lead-copy { flex-basis: 100%; }
    .xy-lead-en { font-size: 13px; }
    .xy-lead-title { font-size: 22px; }
    .xy-lead-stats { width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
    /* 四个以上读数：2×2 / 3+2，最后一行撑满，不留空格子 */
    .xy-lead-stats[data-count="4"] { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .xy-lead-stats[data-count="5"] { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .xy-lead-stats[data-count="5"] > :nth-child(-n+3) { grid-column: span 2; }
    .xy-lead-stats[data-count="5"] > :nth-child(n+4) { grid-column: span 3; }
    .xy-lead-stats:is([data-count="4"], [data-count="5"]) > .xy-lead-stat { border-left: 0; border-top: 1px solid var(--hairline); }
    .xy-lead-stats[data-count="4"] > :nth-child(-n+2), .xy-lead-stats[data-count="5"] > :nth-child(-n+3) { border-top: 0; }
    .xy-lead-stats[data-count="4"] > :nth-child(2n), .xy-lead-stats[data-count="5"] > :is(:nth-child(2), :nth-child(3), :nth-child(5)) { border-left: 1px solid var(--hairline); }
    .xy-lead-stat { min-width: 0; }
    .xy-lead-stat dt { white-space: normal; }
    .xy-lead-stat { padding: 12px 16px; }
    .xy-lead-stat dd { font-size: 17px; }
    .xy-lead-actions { width: 100%; }
    .xy-lead-actions > :is(button, .payroll-page-actions) { flex: 1 1 auto; justify-content: center; }
    .xy-perks li { padding: 12px 14px; }
    :is(.customer-toolbar, .recharge-toolbar):has(> .xy-toolbar-cta) { grid-template-columns: minmax(0, 1fr); }
    .xy-toolbar-cta { width: 100%; justify-content: center; }
    .section-head.xy-sec { margin-bottom: 10px; }
    .section-head.xy-sec h2, .xy-sec-idx { font-size: 15px; }
    .xy-sec-en { font-size: 12px; }
    .xy-chart svg { height: 120px; }
    .xy-ledger li { padding: 12px 0; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; }
    .xy-ava { width: 32px; height: 32px; font-size: 12px; }
    .xy-rank li { grid-template-columns: 16px 32px minmax(0, 1fr) auto; gap: 10px; }
    .xy-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main amount" "people tail"; gap: 8px 12px; min-height: 0; padding: 14px 16px; }
    .xy-row:hover { transform: none; }
    .xy-row-main { grid-area: main; } .xy-row-amount { grid-area: amount; align-self: start; font-size: 15px; }
    .xy-row-people { grid-area: people; font-size: 12.5px; } .xy-row-tail { grid-area: tail; grid-auto-flow: column; align-items: center; gap: 8px; }
    .xy-row.is-compact { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "tail"; gap: 6px; }
    .xy-row.is-compact .xy-row-main { grid-area: main; }
    .xy-row.is-compact .xy-row-people { display: none; }
    .xy-row.is-compact .xy-row-tail { grid-area: tail; justify-items: start; grid-auto-flow: row; gap: 2px; }
    .dashboard-page[data-dashboard-role="customer"] .dashboard-focus-title .xy-balance { font-size: 34px; }
    .xy-balance .cur { font-size: 22px; }
    .xy-recent { padding: 16px 14px; }
    .dashboard-page[data-dashboard-role="player"] .player-workspace-card { padding: 16px 14px; }
    .dashboard-page[data-dashboard-role="player"] .player-workspace-links { grid-auto-rows: minmax(64px, 1fr); }
    .dashboard-page[data-dashboard-role="player"] .player-workspace-link { min-height: 64px; padding: 10px 8px; gap: 6px; }
    .dashboard-page[data-dashboard-role="player"] .player-workspace-link:not(:first-child) > svg:last-child { display: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    .xy-split-fill, .xy-rank-track span, .xy-chart-bar, .xy-row { animation: none; }
  }
}
