/* * 全景消耗统计视图样式表 (views-consumption.css). * 包含: * 1. 消费概览顶栏与 3+3 统一指标矩阵 (.cons-overview-head, .cons-unified-matrix, .cons-split-3, .cons-col) * 2. 4 段比例条与圆点色块 (.dot-swatch, .cons-seg-bar) * 3. 热门模型与数据来源列表项样式 (.cons-row-*, .cons-share-pill, .cons-item-*) * 4. 历史趋势纯 SVG 平滑曲线图与峰值胶囊 (.trend-*) * 5. 12 个月垂直堆叠柱状图与月度图例 (.monthly-*, .month-*) */ /* --- 1. 消费概览顶栏与 3+3 组合指标矩阵 (Consumption Overview Matrix) --- */ .cons-overview-head { flex-wrap: wrap; gap: 6px; } .cons-overview-head .segmented { gap: 1px; } .cons-overview-head .seg-btn { padding: 2px 6px; } .cons-custom-range-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 2px 0 0; background: transparent; border: none; border-radius: 0; } .cons-badge { font-size: var(--fs-md); font-weight: 500; padding: 0; background: transparent; border: none; color: var(--text-secondary); } .cons-box { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface-panel); border: 1px solid var(--border-hairline); border-radius: var(--radius-xs); } .cons-unified-matrix { gap: 0; padding: 0; border: none; border-top: 1px solid var(--border-hairline); border-bottom: 1px solid var(--border-hairline); border-radius: 0; overflow: hidden; } .cons-split-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } .cons-matrix-bottom { border-top: 1px solid var(--border-hairline); } .cons-matrix-bottom .cons-col { gap: 4px; } @media (max-width: 350px) { .cons-matrix-bottom.cons-split-3 { grid-template-columns: 1fr; } .cons-matrix-bottom .cons-col { padding-left: 0; padding-right: 0; } .cons-matrix-bottom .cons-col.is-bordered-col { border-left: none; border-top: 1px solid var(--border-hairline); } } .cons-col { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; min-width: 0; } .cons-col:first-child { padding-left: 0; } .cons-col:last-child { padding-right: 0; } .cons-col.is-bordered-col { border-left: 1px solid var(--border-hairline); } .cons-baseline { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; } .cons-hero-num { font-size: var(--fs-hero); font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; } .cons-hero-cost { font-size: var(--fs-hero); font-weight: 700; color: var(--accent-primary); letter-spacing: -0.02em; } .cons-hero-cache { font-size: var(--fs-hero); font-weight: 700; color: var(--ctx-cached); letter-spacing: -0.02em; } .cons-sub-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; } .cons-sub-head > span { white-space: nowrap; flex-shrink: 0; } .cons-sub-label { font-size: var(--fs-base-sm); font-weight: 600; color: var(--text-primary); white-space: nowrap; flex-shrink: 0; } .cons-mid-num { font-size: var(--fs-lg); font-weight: 700; line-height: 1.25; color: var(--text-primary); letter-spacing: -0.015em; white-space: nowrap; } /* --- 2. 4 段比例条与圆点色块 (Four-Segment Bar & Dot Swatches) --- */ .dot-swatch { width: 6px; height: 6px; border-radius: var(--radius-pill); display: inline-block; flex-shrink: 0; } :root, :host { --cons-other-seg: color-mix(in srgb, var(--text-secondary) 46%, var(--surface-panel)); } .dot-swatch.seg-input { background: var(--ctx-input); } .dot-swatch.seg-cached { background: var(--ctx-cached); } .dot-swatch.seg-output { background: var(--ctx-output); } .dot-swatch.seg-thinking { background: var(--ctx-thinking); } .dot-swatch.cons-model-dot { background: var(--dot-color, var(--accent-primary)); } .progress-seg.cons-model-seg, .month-seg.cons-model-seg { background-color: var(--seg-color, var(--accent-primary)); } /* --- 3. 热门模型与数据来源行头部对齐 (Popular Models & Sources Row Header) --- */ .cons-row-title { display: inline-flex; align-items: center; gap: 6px; min-width: 0; min-height: calc(20px * var(--ui-font-scale, 1)); line-height: 1.3; font-size: var(--fs-base); font-weight: 600; color: var(--text-primary); } .cons-row-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cons-row-metrics { display: inline-flex; align-items: center; gap: 8px; min-height: calc(20px * var(--ui-font-scale, 1)); } .cons-share-pill { display: inline-flex; align-items: center; justify-content: center; min-height: calc(20px * var(--ui-font-scale, 1)); line-height: 1.2; padding: 1px 6px; font-size: var(--fs-base); font-weight: 600; color: var(--metric-ok); background: color-mix(in srgb, var(--metric-ok) 11%, transparent); border: none; border-radius: var(--radius-xs); box-sizing: border-box; } .cons-row-tok { display: inline-flex; align-items: center; min-height: calc(20px * var(--ui-font-scale, 1)); line-height: 1.25; font-size: var(--fs-base); font-weight: 500; color: var(--text-secondary); } .cons-row-cost { display: inline-flex; align-items: center; min-height: calc(20px * var(--ui-font-scale, 1)); line-height: 1.25; font-size: var(--fs-base); font-weight: 700; color: var(--text-primary); } .cons-seg-bar { height: 5px; } /* --- 4. 历史趋势交互式 SVG 平滑曲线图 (Interactive Historical Trend SVG Chart) --- */ .trend-chart-wrap { position: relative; width: 100%; display: flex; flex-direction: column; gap: 2px; } .trend-plot-stage { position: relative; width: 100%; padding-top: 6px; cursor: crosshair; } .trend-svg { width: 100%; height: 184px; display: block; overflow: visible; } .trend-grid line { stroke: var(--border-hairline); stroke-width: 1; stroke-dasharray: 2 3; } .trend-line { stroke: var(--ctx-cached); stroke-width: 2; stroke-linecap: round; } .trend-node-dot { fill: var(--surface-panel); stroke: var(--ctx-cached); stroke-width: 1.4; } .trend-peak-dot { fill: var(--ctx-cached); stroke: var(--surface-panel); stroke-width: 1.5; } .trend-hover-line { stroke: var(--accent-primary); stroke-width: 1; stroke-dasharray: 2 2; opacity: 0.75; pointer-events: none; } .trend-hover-dot { fill: var(--accent-primary); stroke: var(--surface-panel); stroke-width: 1.8; pointer-events: none; } .trend-peak-pill { position: absolute; top: 2px; left: var(--peak-x, 50%); transform: translateX(-50%); font-size: var(--fs-xs); font-weight: 600; padding: 1px 6px; color: var(--text-primary); background: color-mix(in srgb, var(--ctx-cached) 16%, var(--surface-panel)); border: 1px solid color-mix(in srgb, var(--ctx-cached) 30%, var(--border-hairline)); border-radius: var(--radius-xs); pointer-events: none; white-space: nowrap; z-index: 2; } .trend-tooltip { position: absolute; top: 2px; left: var(--tip-x, 50%); transform: translateX(var(--tip-shift, -50%)); width: max-content; min-width: 224px; max-width: min(316px, calc(100% - 8px)); padding: 9px 11px; background: var(--surface-panel); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-popover); pointer-events: none; z-index: 25; display: flex; flex-direction: column; gap: 6px; } .trend-tip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-xs); line-height: 1.25; color: var(--text-secondary); } .trend-tip-time { font-weight: 500; color: var(--text-secondary); white-space: nowrap; flex-shrink: 0; } .trend-tip-calls { font-size: var(--fs-xs); font-weight: 500; color: var(--text-muted); white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; } .trend-tip-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: -2px; } .trend-tip-tokens { font-size: var(--fs-lg); font-weight: 700; line-height: 1.18; letter-spacing: -0.02em; color: var(--accent-primary); white-space: nowrap; flex-shrink: 0; } .trend-tip-cost { font-size: var(--fs-md); font-weight: 600; line-height: 1.2; padding: 0; border-radius: 0; color: var(--text-primary); background: transparent; white-space: nowrap; flex-shrink: 0; } .trend-tip-cost:empty { display: none; } .trend-tip-sub { padding: 2px 0; border: none; border-radius: 0; background: transparent; font-size: var(--fs-xs); line-height: 1.3; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .trend-tip-sub[hidden] { display: none !important; } .trend-tip-sub.is-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 2px 0; white-space: normal; overflow: visible; } .trend-tip-stat { display: flex; flex-direction: column; gap: 1px; min-width: 0; } .trend-tip-stat-label { font-size: var(--fs-2xs); font-weight: 500; line-height: 1.2; color: var(--text-muted); white-space: nowrap; } .trend-tip-stat-val { font-size: var(--fs-sm); font-weight: 600; line-height: 1.25; color: var(--text-primary); white-space: nowrap; } .trend-tooltip.is-line-low { top: auto; bottom: 20px; } .trend-tooltip.is-hm-top { top: auto; bottom: calc(100% + 6px); } .trend-tooltip.is-hm-bottom { top: calc(100% + 6px); bottom: auto; } .trend-x-axis { position: relative; width: 100%; min-height: calc(18px * var(--ui-font-scale, 1)); user-select: none; } .trend-x-tick { position: absolute; top: 0; left: var(--tick-x, 0%); transform: translateX(-50%); font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; line-height: 1.35; cursor: pointer; transition: color var(--dur-instant) var(--ease-fast); } .trend-x-tick.is-start { transform: translateX(0); } .trend-x-tick.is-end { transform: translateX(-100%); } .trend-x-tick:hover, .trend-x-tick.is-hovered { color: var(--accent-primary); font-weight: 600; } /* --- 4b. 类 GitHub 每日小格子热力图 (> 90 天自动启用,一格一天) --- */ .trend-heatmap-stage { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; width: 100%; user-select: none; } .trend-heatmap-body { --hm-weeks: 26; --hm-gap: 2px; --hm-cell: 12px; display: flex; align-items: flex-start; gap: 4px; width: 100%; container-type: inline-size; } @supports (width: 1cqi) { .trend-heatmap-body { --hm-cell: clamp( 11px, calc((100cqi - 18px - (var(--hm-weeks) - 1) * var(--hm-gap)) / var(--hm-weeks)), 20px ); } } .trend-hm-weekdays { display: grid; grid-template-rows: calc(15px * var(--ui-font-scale, 1)) repeat(7, var(--hm-cell)); row-gap: var(--hm-gap); width: calc(15px * var(--ui-font-scale, 1)); flex-shrink: 0; } .trend-hm-month-spacer { height: calc(15px * var(--ui-font-scale, 1)); } .trend-hm-wday { display: flex; align-items: center; justify-content: flex-start; font-size: var(--fs-2xs); line-height: 1; color: var(--text-muted); } .trend-hm-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; } .trend-hm-track { display: inline-flex; flex-direction: column; gap: var(--hm-gap); min-width: max-content; } .trend-hm-months { position: relative; height: calc(15px * var(--ui-font-scale, 1)); width: 100%; } .trend-hm-month { position: absolute; top: 0; left: calc(var(--hm-col, 0) * (var(--hm-cell) + var(--hm-gap))); font-size: var(--fs-2xs); line-height: 1.25; color: var(--text-muted); white-space: nowrap; pointer-events: none; } .trend-hm-grid { display: grid; grid-template-rows: repeat(7, var(--hm-cell)); grid-auto-flow: column; grid-auto-columns: var(--hm-cell); gap: var(--hm-gap); cursor: pointer; } .trend-hm-cell { width: var(--hm-cell); height: var(--hm-cell); border-radius: 2px; box-sizing: border-box; cursor: pointer; transition: transform var(--dur-instant) var(--ease-fast); } .trend-hm-cell.is-pad { visibility: hidden; pointer-events: none; } .trend-hm-cell.lv-0, .trend-hm-swatch.lv-0 { background: color-mix(in srgb, var(--text-primary) 6.5%, var(--surface-panel)); border: 1px solid color-mix(in srgb, var(--border-hairline) 55%, transparent); } .trend-hm-cell.lv-1, .trend-hm-swatch.lv-1 { background: color-mix(in srgb, var(--ctx-cached) 24%, var(--surface-panel)); } .trend-hm-cell.lv-2, .trend-hm-swatch.lv-2 { background: color-mix(in srgb, var(--ctx-cached) 46%, var(--surface-panel)); } .trend-hm-cell.lv-3, .trend-hm-swatch.lv-3 { background: color-mix(in srgb, var(--ctx-cached) 70%, var(--surface-panel)); } .trend-hm-cell.lv-4, .trend-hm-swatch.lv-4 { background: color-mix(in srgb, var(--ctx-cached) 94%, var(--surface-panel)); } .trend-hm-cell.is-hovered { outline: 1.5px solid var(--text-primary); outline-offset: 0.5px; z-index: 2; } .trend-hm-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); color: var(--text-muted); min-height: 16px; } .trend-hm-summary { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .trend-hm-legend { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; font-size: var(--fs-2xs); color: var(--text-muted); } .trend-hm-swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; box-sizing: border-box; } /* --- 5. 模型与数据来源明细行容器 (Popular Models & Sources Item Rows) --- */ .cons-item-list { display: flex; flex-direction: column; gap: var(--space-4); } .cons-item-row { display: flex; flex-direction: column; gap: 6px; } .cons-item-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: var(--fs-md); color: var(--text-secondary); } .cons-item-foot > .legend-left:last-child { margin-left: auto; } .cons-view-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; } .cons-item-foot strong { color: var(--text-primary); font-weight: 600; } .cons-source-row { gap: 5px; width: 100%; container-type: inline-size; } .cons-source-bar-hit { padding: 5px 0; margin: -5px 0; cursor: pointer; } .cons-source-bar-hit:hover .cons-source-model-bar, .cons-source-bar-hit.is-hovered .cons-source-model-bar { box-shadow: 0 0 0 1px var(--border-strong); } .cons-source-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 8px; min-width: 0; min-height: 16px; overflow: hidden; } .cons-source-top-models { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; flex: 1 1 auto; min-width: 0; overflow: hidden; cursor: pointer; } .cons-source-top-models[hidden] { display: none; } .cons-source-top-item { display: inline-flex; align-items: center; gap: 4px; flex: 0 1 auto; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; line-height: 1.25; } .cons-source-top-item:first-child { flex-shrink: 0.5; } .cons-source-top-dot { width: 6px; height: 6px; flex-shrink: 0; } .cons-source-top-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--text-secondary); transition: color 120ms ease; } .cons-source-top-models:hover .cons-source-top-name, .cons-source-top-models.is-hovered .cons-source-top-name { color: var(--text-primary); } .cons-source-top-pct { flex-shrink: 0; white-space: nowrap; color: var(--text-primary); font-weight: 600; } .cons-source-foot > .cons-calls-stat { flex: 0 0 auto; white-space: nowrap; margin-left: auto; } @container (max-width: 340px) { .cons-source-top-item:nth-child(n + 3) { display: none; } } @container (max-width: 210px) { .cons-source-top-item:nth-child(n + 2) { display: none; } } .month-col.is-interactive { cursor: pointer; } .month-col.is-interactive:hover .month-stack, .month-col.is-hovered .month-stack { box-shadow: 0 0 0 1px var(--text-primary); } .month-col.is-interactive:hover .month-label, .month-col.is-hovered .month-label { color: var(--text-primary); font-weight: 600; } /* --- 共享模型构成悬浮详情卡 (Client Sources & Monthly Breakdown Popover) --- */ .cons-breakdown-popover { position: absolute; left: var(--pop-x, 8px); top: var(--pop-y, 8px); width: max-content; min-width: 224px; max-width: min(316px, calc(100% - 16px)); padding: 9px 11px; background: var(--surface-panel); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-popover); pointer-events: none; z-index: 30; display: flex; flex-direction: column; gap: 6px; } .cons-pop-models { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid color-mix(in srgb, var(--border-hairline) 75%, transparent); padding-top: 6px; margin-top: 1px; } .cons-pop-models[hidden] { display: none !important; } .trend-tip-sub:not([hidden]) + .cons-pop-models { border-top: none; padding-top: 2px; margin-top: 0; } .cons-pop-model-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--fs-xs); line-height: 1.3; } .cons-pop-model-left { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-primary); } .cons-pop-model-name { max-width: 156px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cons-pop-model-row.is-other .cons-pop-model-name { color: var(--text-secondary); } .cons-pop-model-right { display: inline-flex; align-items: baseline; gap: 8px; flex-shrink: 0; } .cons-pop-model-tok { font-size: var(--fs-xs); color: var(--text-muted); } .cons-pop-model-pct { min-width: 38px; text-align: right; font-size: var(--fs-xs); font-weight: 500; color: var(--text-secondary); } /* --- 6. 12 个月垂直堆叠柱状图 (12-Month Stacked Bar Chart) --- */ .monthly-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; align-items: end; padding-top: var(--space-2); } .month-col { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; } .month-cost { font-size: var(--fs-2xs); color: var(--text-secondary); min-height: 14px; white-space: nowrap; } .month-bar-well { width: 100%; height: 82px; display: flex; align-items: flex-end; justify-content: center; } .month-stack { width: 72%; max-width: 20px; height: var(--bar-h, 0%); display: flex; flex-direction: column; border-radius: 2px 2px 0 0; overflow: hidden; transition: height var(--dur-normal) var(--ease-fast); } .month-seg { width: 100%; height: var(--seg-h, 0%); } .month-seg.seg-input { background: var(--ctx-input); } .month-seg.seg-cached { background: var(--ctx-cached); } .month-seg.seg-output { background: var(--ctx-output); } .month-seg.seg-thinking { background: var(--ctx-thinking); } .month-zero-dot { width: 3px; height: 3px; border-radius: var(--radius-pill); background: var(--border-strong); margin-bottom: 4px; } .month-label { font-size: var(--fs-xs); color: var(--text-secondary); padding: 1px 3px; border-radius: var(--radius-xs); white-space: nowrap; } .month-label.is-current { color: var(--ctx-cached); background: color-mix(in srgb, var(--ctx-cached) 14%, transparent); font-weight: 600; } .month-tok { font-size: var(--fs-2xs); color: var(--text-muted); min-height: 12px; white-space: nowrap; } .monthly-legend { display: flex; align-items: center; justify-content: center; gap: var(--space-4); padding-top: var(--space-2); font-size: var(--fs-md); color: var(--text-secondary); }