/* ==========================================================================
   CoupleBill 指标下钻弹层样式（drill- 前缀 + 规格指定的 .rank-drill-btn）
   移植自 UI 原型稿 drilldown_ui 的 drilldown_proto.css 第 1~12 节（类名词表见原型 README §2），另补方案 B 的 .is-fit；
   R2 返工：<520 横屏不再平移、左侧渐隐盖到标签行、两处文字对比度、删去未使用的首次提示气泡样式。
   依赖 app.css 的变量：--primary --primary-light --bg --text-main --text-sub --border；
   开关复用 payer_and_sharing.css 的 .switch-toggle/.switch-circle，分段复用 app.css 的 .segment-control/.segment-btn。
   ========================================================================== */

/* 1. 仪表盘入口提示（控制器在 onStateUpdated 后给入口加类/属性，不改 index.html） */
.drill-entry { cursor: pointer; border-radius: 10px; }
.drill-entry:active { opacity: 0.7; }
.drill-entry:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.summary-card .drill-entry:focus-visible { outline-color: #fff; }
.drill-hint-chevron::after { content: "›"; margin-left: 3px; opacity: 0.7; font-weight: 700; }
.drill-hint-more::after { content: "📈 按月看实付 / 承担 ›"; display: block; margin-top: 8px; padding: 6px 0 0; border-top: 1px dashed var(--border); font-size: 11px; font-weight: 600; color: var(--primary); text-align: right; }
.drill-hint-share::after { content: "📊 看全部分类占比 / 走势 ›"; display: block; margin-top: 8px; padding: 6px 0 0; border-top: 1px dashed var(--border); font-size: 11px; font-weight: 600; color: var(--primary); text-align: right; }
.category-share-list { margin-top: 6px; }
.category-share-rest, .category-share-total { font-size: 11px; color: var(--text-sub); }
.category-share-total { font-weight: 600; text-align: right; }
.rank-drill-btn { position: relative; isolation: isolate; width: 44px; height: 44px; margin: -14px -10px -14px 2px; padding: 0; border: none; background: transparent; font-size: 12px; line-height: 1; cursor: pointer; vertical-align: middle; }
.rank-drill-btn::before { content: ""; position: absolute; left: 9px; right: 9px; top: 11px; bottom: 11px; border-radius: 11px; background: var(--primary-light); border: 1px solid #FECDD3; z-index: -1; }
.rank-drill-btn:active::before { background: #FFE4E6; }
.rank-drill-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -6px; border-radius: 14px; }

/* 2. 遮罩与弹层（z-index 180 < .modal-overlay 200，编辑弹窗天然在上） */
.drill-overlay { --drill-a: #2563EB; --drill-b: #FF4B72; --drill-main: #FF4B72; --drill-main-strong: #C81E4A; --drill-compare: #64748B; --drill-proj: #7C3AED; --drill-up: #DC2626; --drill-down: #15803D; --drill-grid: #E5E7EB; --drill-axis: #CBD5E1; --drill-label: #6B7280;
  position: fixed; inset: 0; z-index: 180; display: none; background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.drill-overlay.is-open { display: block; animation: drillFade 0.18s ease-out; }
.drill-sheet { position: absolute; left: 0; right: 0; bottom: 0; height: 90vh; height: 90dvh; display: flex; flex-direction: column; background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,0.18); overflow: hidden; animation: drillUp 0.22s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes drillFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drillUp { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
body.drill-lock { overflow: hidden; }
.drill-overlay [hidden] { display: none !important; }

/* 3. 吸顶栏：标题 / 返回+面包屑 / 关闭 / 范围分段 / 聚会局开关 */
.drill-header { flex-shrink: 0; padding: 10px 12px 8px; background: #fff; border-bottom: 1px solid #F1F5F9; }
.drill-nav-row { display: flex; align-items: center; gap: 2px; margin: -4px 0 2px -6px; }
.drill-back { min-height: 44px; padding: 0 10px 0 6px; border: none; background: transparent; color: var(--primary); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.drill-breadcrumb { flex: 1; min-width: 0; font-size: 12px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drill-crumb-sep { margin: 0 4px; opacity: 0.7; }
.drill-crumb-current { color: var(--text-main); font-weight: 700; }
.drill-header-row { display: flex; align-items: flex-start; gap: 8px; }
.drill-title { flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 800; line-height: 1.3; color: var(--text-main); outline: none; }
.drill-title:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.drill-title-meta { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--text-sub); }
.drill-offline-tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700; color: #B45309; background: #FFFBEB; border: 1px solid #FDE68A; white-space: nowrap; }
.drill-updated { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700; color: #15803D; background: #F0FDF4; border: 1px solid #BBF7D0; animation: drillFade 0.2s; }
.drill-close { position: relative; isolation: isolate; flex-shrink: 0; width: 44px; height: 44px; margin: -6px -6px 0 0; border: none; background: transparent; color: #64748B; font-size: 18px; line-height: 1; cursor: pointer; }
.drill-close::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #F1F5F9; z-index: -1; }
.drill-close:active::before { background: #E2E8F0; }
.drill-controls { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.drill-seg .segment-btn { min-height: 44px; font-size: 13px; }
.drill-rollup-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 0 2px; border: none; background: transparent; font-size: 13px; font-weight: 600; color: var(--text-main); cursor: pointer; text-align: left; }
.drill-rollup-toggle .switch-toggle { display: inline-block; pointer-events: none; }
.drill-rollup-toggle .switch-circle { display: block; }
.drill-rollup-note { font-size: 11px; font-weight: 500; color: var(--text-sub); }

/* 4. 内容区与图块卡片 */
.drill-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 10px 12px calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--bg); }
.drill-hero { padding: 4px 4px 10px; }
.drill-hero-val { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; color: var(--text-main); }
.drill-hero-sub { font-size: 12px; color: var(--text-sub); font-weight: 600; }
.drill-block { position: relative; background: #fff; border-radius: 16px; padding: 12px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.drill-block.is-focus { box-shadow: 0 0 0 2px var(--primary), 0 2px 8px rgba(0,0,0,0.03); }
.drill-block-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 24px; margin-bottom: 8px; }
.drill-block-title { margin: 0; font-size: 14px; font-weight: 700; color: var(--text-main); }
.drill-block-sub { font-size: 11px; color: var(--text-sub); font-weight: 600; }
.drill-block-error { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 0; font-size: 12px; color: var(--text-sub); }
.drill-retry-btn { min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--border); background: #fff; color: var(--primary); font-size: 13px; font-weight: 700; cursor: pointer; }

/* 5. 口径说明折叠区 + 存疑账目 */
.drill-scope { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.drill-scope-fixed { padding: 10px 12px 0; font-size: 12px; font-weight: 600; color: #334155; line-height: 1.5; }
.drill-scope-toggle { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 0 12px; border: none; background: transparent; font-size: 13px; font-weight: 700; color: #334155; cursor: pointer; text-align: left; }
.drill-scope-flag { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--drill-up); white-space: nowrap; }
.drill-scope-arrow { color: var(--text-sub); font-size: 12px; }
.drill-scope-body { display: none; padding: 0 12px 12px; }
.drill-scope.is-open .drill-scope-body { display: block; }
.drill-scope-lines { margin: 0 0 8px; padding-left: 16px; font-size: 12px; color: #475569; line-height: 1.6; }
.drill-scope-sub { margin: 10px 0 6px; font-size: 12px; font-weight: 700; color: var(--text-main); }

/* 6. 图表：外层 + 固定 Y 轴 + 横滚容器 + SVG + tooltip + 图例 */
.drill-chart { position: relative; }
.drill-chart-yaxis { position: absolute; left: 0; top: 0; width: 36px; pointer-events: none; }
.drill-chart-yaxis span { position: absolute; right: 4px; transform: translateY(-50%); font-size: 10px; color: var(--drill-label); white-space: nowrap; font-variant-numeric: tabular-nums; }
.drill-chart.has-yaxis .drill-chart-scroll { margin-left: 36px; }
.drill-chart-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.drill-chart-inner { position: relative; }
/* 左缘渐隐：绘图区 18px（前 5px 实白）；底部 30px 标签行加宽到 32px（前 18px 实白），盖掉被截断的半个月份 / 年份 */
.drill-chart.is-scrollable::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 32px; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, #fff 5px, rgba(255,255,255,0) 18px) top left / 100% calc(100% - 30px) no-repeat, linear-gradient(90deg, #fff 18px, rgba(255,255,255,0) 32px) bottom left / 100% 30px no-repeat; }
.drill-chart.has-yaxis.is-scrollable::before { left: 36px; }
.drill-svg { display: block; overflow: visible; font-family: inherit; }
.drill-svg * { pointer-events: none; } .drill-svg .drill-hit { pointer-events: all; }
.drill-svg .drill-grid { stroke: var(--drill-grid); stroke-width: 1; stroke-dasharray: 3 3; }
.drill-svg .drill-axis { stroke: var(--drill-axis); stroke-width: 1; }
.drill-svg .drill-x { font-size: 10px; fill: var(--drill-label); text-anchor: middle; }
.drill-svg .drill-x.is-cur { fill: var(--text-main); font-weight: 700; }
.drill-svg .drill-x-sub { font-size: 9px; fill: var(--drill-label); text-anchor: middle; }
.drill-svg .drill-val { font-size: 10px; font-weight: 700; fill: var(--text-main); text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.drill-svg .drill-val.is-small { font-size: 9px; } .drill-svg .is-selected .drill-val { visibility: hidden; }
.drill-svg .drill-bar { fill: var(--drill-main); }
.drill-svg .drill-bar.is-a, .drill-svg .drill-bar.is-pos { fill: var(--drill-a); }
.drill-svg .drill-bar.is-b, .drill-svg .drill-bar.is-neg { fill: var(--drill-b); }
.drill-svg .is-selected .drill-bar, .drill-svg .drill-bar.is-selected { fill: var(--drill-main-strong); }
.drill-svg .is-selected .drill-bar.is-a, .drill-svg .is-selected .drill-bar.is-pos { fill: #1E40AF; }
.drill-svg .is-selected .drill-bar.is-b, .drill-svg .is-selected .drill-bar.is-neg { fill: var(--drill-main-strong); }
.drill-svg .drill-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke: var(--drill-main); }
.drill-svg .drill-line.is-dashed { stroke: var(--drill-compare); stroke-width: 1.5; stroke-dasharray: 5 4; }
.drill-svg .drill-line.is-dotted { stroke: var(--drill-compare); stroke-width: 1.5; stroke-dasharray: 1.5 4; }
.drill-svg .drill-line.is-proj { stroke: var(--drill-proj); stroke-width: 2; stroke-dasharray: 6 4; }
.drill-svg .drill-area { fill: var(--drill-main); fill-opacity: 0.1; stroke: none; }
.drill-svg .drill-dot { fill: #fff; stroke: var(--drill-main); stroke-width: 1.5; }
.drill-svg .drill-dot.is-last, .drill-svg .is-selected .drill-dot { fill: var(--drill-main); }
.drill-svg .drill-dot.is-proj { fill: var(--drill-proj); stroke: #fff; }
.drill-svg .drill-dot.is-dashed, .drill-svg .drill-dot.is-dotted { fill: var(--drill-compare); stroke: #fff; } /* 虚线/点线的孤立点 */
.drill-svg .drill-today { stroke: #8E8E93; stroke-width: 1; stroke-dasharray: 2 3; }
.drill-svg .drill-today-label { font-size: 10px; font-weight: 700; fill: var(--drill-label); text-anchor: middle; }
.drill-svg .drill-end-label { font-size: 11px; font-weight: 800; text-anchor: end; paint-order: stroke; stroke: #fff; stroke-width: 4px; fill: var(--drill-proj); }
.drill-svg .drill-end-label.is-good { fill: var(--drill-down); }
.drill-svg .drill-end-label.is-bad { fill: var(--drill-up); }
.drill-svg .drill-end-bg { fill: #fff; fill-opacity: 0.82; stroke: none; } /* 末点标注衬底：只铺在文字范围内，兜底遮住穿过的线 */
.drill-svg .drill-hit { fill: transparent; cursor: pointer; }
/* 方案 B（.is-fit，DD-01④ / DD-04）：铺满不横滚；整图命中，横向拖动选点、纵向手势仍滚动弹层 */
.drill-chart.is-fit .drill-chart-scroll { overflow-x: hidden; }
.drill-chart.is-fit .drill-svg { touch-action: pan-y; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.drill-svg .is-selected .drill-hit { fill: rgba(15, 23, 42, 0.04); }
.drill-tooltip { position: absolute; z-index: 5; width: max-content; max-width: calc(100vw - 40px); padding: 5px 8px; border-radius: 6px; background: #1C1C1E; color: #fff; font-size: 11px; font-weight: 600; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.drill-tooltip::after { content: ""; position: absolute; left: var(--arrow-x, 50%); bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: #1C1C1E; }
.drill-tooltip.is-below::after { bottom: auto; top: -5px; border-top: 0; border-bottom: 5px solid #1C1C1E; }
.drill-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 11px; color: #475569; }
.drill-legend-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.drill-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--drill-main); }
.drill-swatch.is-a { background: var(--drill-a); } .drill-swatch.is-b { background: var(--drill-b); }
.drill-legend svg { display: block; }
.drill-chart-note { margin-top: 6px; font-size: 11px; color: var(--text-sub); }
.drill-scroll-hint { display: none; margin-top: 2px; font-size: 10px; color: var(--drill-label); text-align: left; }
.drill-chart.is-scrollable + .drill-scroll-hint, .drill-chart.is-fit + .drill-scroll-hint { display: block; }
.drill-subseg { display: inline-flex; background: #F2F2F7; border-radius: 10px; padding: 2px; }
.drill-subseg .segment-btn { flex: none; min-width: 44px; min-height: 44px; padding: 0 10px; font-size: 12px; }
.drill-month-nav { display: inline-flex; align-items: center; }
.drill-month-btn { width: 44px; height: 44px; border: none; background: transparent; color: var(--primary); font-size: 18px; font-weight: 700; cursor: pointer; }
.drill-month-btn:disabled { color: #C7C7CC; cursor: default; }
.drill-month-label { min-width: 72px; text-align: center; font-size: 12px; font-weight: 700; color: var(--text-main); }

/* 7. DD-01 构成横条 + 环比/同比数字条 */
.drill-hbar-list { display: flex; flex-direction: column; }
.drill-hbar-row { display: block; width: 100%; min-height: 44px; padding: 6px 0; border: none; border-bottom: 1px solid #F2F2F7; background: transparent; text-align: left; cursor: pointer; font-size: 12px; color: var(--text-main); }
.drill-hbar-row:last-child { border-bottom: none; }
.drill-hbar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.drill-hbar-name { font-weight: 700; }
.drill-hbar-amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.drill-hbar-chevron { margin-left: 4px; color: var(--text-sub); font-weight: 700; }
.drill-hbar-track { height: 6px; background: #E5E5EA; border-radius: 3px; overflow: hidden; }
.drill-hbar-fill { height: 100%; background: var(--primary); border-radius: 3px; }
.drill-hbar-row.is-others { cursor: default; color: var(--text-sub); }
.drill-hbar-row.is-others .drill-hbar-fill { background: #8E8E93; }
.drill-delta-row { display: grid; grid-template-columns: 1fr; gap: 6px; }
.drill-delta { padding: 8px 10px; border-radius: 12px; background: var(--bg); min-width: 0; }
.drill-delta-main { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 600; color: #334155; }
.drill-delta-val { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.drill-delta-val.is-up { color: var(--drill-up); } .drill-delta-val.is-down { color: var(--drill-down); } .drill-delta-val.is-flat, .drill-delta-val.is-na { color: var(--text-sub); }
.drill-delta-val.is-up::before { content: "▲ "; font-size: 10px; } .drill-delta-val.is-down::before { content: "▼ "; font-size: 10px; }
.drill-delta-sub { margin-top: 1px; font-size: 11px; color: var(--text-sub); }

/* 8. 账目列表（Top 10 / 查看全部 / 存疑 / 入账明细） */
.drill-tx-list { display: flex; flex-direction: column; gap: 6px; }
.drill-tx-row { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 10px; background: #F9FAFB; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.drill-tx-row:active { background: #F2F2F7; }
.drill-tx-row:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.drill-tx-row.is-static { cursor: default; }
.drill-tx-rank { flex-shrink: 0; width: 18px; font-size: 11px; font-weight: 700; color: var(--text-sub); text-align: center; }
.drill-tx-main { flex: 1; min-width: 0; }
.drill-tx-title { font-size: 14px; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drill-tx-meta { margin-top: 2px; font-size: 11px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drill-tx-right { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.drill-tx-amount { font-size: 15px; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; }
.drill-tx-share { font-size: 10px; font-weight: 600; color: #7C3AED; white-space: nowrap; }
.drill-badge { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 5px; font-size: 10px; font-weight: 700; line-height: 16px; vertical-align: 1px; white-space: nowrap; }
.drill-badge.is-rollup { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
.drill-badge.is-ar { background: #E0F2FE; color: #0369A1; border: 1px solid #BAE6FD; }
.drill-badge.is-disputed { background: #FEE2E2; color: #DC2626; border: 1px solid #FCA5A5; }
.drill-badge.is-early { background: #F0F9FF; color: #0369A1; border: 1px solid #BAE6FD; }
.drill-badge.is-month { background: #F1F5F9; color: #475569; border: 1px solid #E2E8F0; }
.drill-resolve-btn { flex-shrink: 0; min-height: 44px; min-width: 64px; padding: 0 10px; border: 1px solid #A7F3D0; border-radius: 10px; background: #ECFDF5; color: #047857; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.drill-list-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; color: var(--text-sub); font-weight: 600; }
.drill-expand-btn { width: 100%; min-height: 44px; margin-top: 8px; border: none; border-radius: 12px; background: var(--primary-light); color: var(--drill-main-strong); font-size: 13px; font-weight: 700; cursor: pointer; }

/* 9. DD-03 累计占比 */
.drill-share-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #E5E5EA; }
.drill-share-seg.is-a { background: var(--drill-a); } .drill-share-seg.is-b { background: var(--drill-b); }
.drill-share-cap { display: flex; justify-content: space-between; margin: 10px 0 4px; font-size: 12px; font-weight: 700; }
.drill-alltime { margin-top: 10px; border-top: 1px solid #F2F2F7; }
.drill-alltime-row { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 6px; align-items: center; min-height: 40px; border-bottom: 1px solid #F2F2F7; font-size: 12px; }
.drill-alltime-row.is-head { min-height: 28px; font-size: 11px; color: var(--text-sub); font-weight: 600; }
.drill-alltime-name { font-weight: 700; }
.drill-alltime-cell { text-align: right; font-variant-numeric: tabular-nums; }

/* 10. DD-04 指标卡（与预算卡四指标同名同序） */
.drill-kpi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.drill-kpi { padding: 10px; border-radius: 12px; background: #fff; border: 1px solid var(--border); min-width: 0; }
.drill-kpi.is-focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.drill-kpi-label { font-size: 11px; font-weight: 600; color: #64748B; }
.drill-kpi-val { display: block; margin-top: 2px; font-size: 16px; font-weight: 800; color: #0F172A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.drill-kpi-val.is-good { color: #15803D; } .drill-kpi-val.is-bad { color: #DC2626; }
.drill-kpi-note { display: block; font-size: 10px; font-weight: 600; color: #64748B; margin-top: 1px; }

/* 11. 提示 / 空态 / 骨架屏 / 错误态 */
.drill-hint { margin-bottom: 10px; padding: 8px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; background: #F2F2F7; color: #3C3C43; }
.drill-hint.is-warn { background: #FFF9E6; color: #856404; border: 1px solid #FDE68A; }
.drill-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 16px; }
.drill-empty-icon { font-size: 34px; }
.drill-empty-text { font-size: 13px; color: var(--text-sub); line-height: 1.5; }
.drill-empty-btn { min-height: 44px; padding: 0 28px; border: none; border-radius: 12px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 10px rgba(255, 75, 114, 0.25); }
.drill-skel { border-radius: 8px; background: linear-gradient(90deg, #EEF0F3 25%, #F6F7F9 37%, #EEF0F3 63%); background-size: 400% 100%; animation: drillShimmer 1.2s ease infinite; }
.drill-skel.is-line { height: 12px; margin: 6px 0; } .drill-skel.is-title { height: 16px; width: 40%; } .drill-skel.is-chart { height: 140px; margin-top: 10px; }
@keyframes drillShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.drill-error { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 16px; text-align: center; font-size: 13px; color: var(--text-sub); }

/* 12. 响应式：≤360 缩字号/图例单列；≥520 居中卡片；横屏矮屏全高 */
@media (max-width: 360px) {
  .drill-title { font-size: 16px; } .drill-title-meta, .drill-tx-meta, .drill-delta-main { font-size: 11px; }
  .drill-hero-val { font-size: 24px; } .drill-tx-title { font-size: 13px; } .drill-tx-amount, .drill-delta-val { font-size: 14px; }
  .drill-legend { flex-direction: column; }
}
@media (min-width: 520px) {
  .drill-sheet { left: 50%; right: auto; top: 50%; bottom: auto; width: min(520px, calc(100vw - 32px)); height: 85vh; height: 85dvh; max-height: 860px; transform: translate(-50%, -50%); border-radius: 20px; animation: drillFade 0.18s ease-out; }
  .drill-kpi-row { grid-template-columns: repeat(4, 1fr); }
}
@media (max-height: 700px) and (orientation: landscape) {
  .drill-sheet { height: 100vh; height: 100dvh; max-height: none; border-radius: 0; top: 0; }
  .drill-header { padding: 6px 12px 4px; } .drill-title { font-size: 15px; } .drill-title-meta { display: inline; margin-left: 6px; }
  .drill-controls { flex-direction: row; align-items: center; gap: 8px; margin-top: 4px; } .drill-controls .drill-seg { flex: 1; }
}
@media (max-height: 700px) and (orientation: landscape) and (min-width: 520px) { .drill-sheet { transform: translateX(-50%); } } /* 只有居中卡片（left:50%）才平移；<520 仍是 left:0/right:0 铺满 */
