:root {
    color-scheme: light;
    --bg: #f6f8fb; --card: #ffffff; --text: #1f2937; --muted: #6b7280;
    --line: #e5e7eb; --primary: #2563eb; --primary-dark: #1d4ed8;
    --ok: #16a34a; --warn: #d97706; --danger: #dc2626;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif; }
.container { max-width: 1280px; margin: 0 auto; padding: 20px; }
.header { margin-bottom: 12px; }
h1 { margin: 0 0 6px 0; font-size: 28px; }
.subtitle { margin: 0; color: var(--muted); font-size: 14px; }
.input-section { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.input-title { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
#tokenInput { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 13px; font-family: Consolas, "Courier New", monospace; line-height: 1.4; }
.input-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
button { border: 0; background: var(--primary); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 14px; cursor: pointer; }
button:hover { background: var(--primary-dark); }
button.secondary { background: #475569; }
button.secondary:hover { background: #334155; }
button:disabled { opacity: 0.7; cursor: not-allowed; }
.input-tip { font-size: 12px; color: var(--muted); }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.summary-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.summary-card .label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.summary-card .value { font-size: 20px; font-weight: 700; }
.summary-card .value.compact { font-size: 16px; line-height: 1.5; word-break: break-word; }
.table-section { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1140px; }
thead { background: #f9fafb; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
tbody tr:hover { background: #f9fbff; }
.name-main { font-weight: 700; }
.name-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.tag { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 12px; line-height: 18px; }
.tag.ok { color: #166534; background: #dcfce7; }
.tag.no { color: #854d0e; background: #fef3c7; }
.tag.error { color: #991b1b; background: #fee2e2; }
.tag.warn { color: #92400e; background: #fef3c7; }
.progress { display: flex; align-items: center; gap: 8px; }
.progress-track { width: 110px; height: 8px; border-radius: 99px; background: #e5e7eb; overflow: hidden; }
.progress-bar { height: 100%; }
.progress-bar.ok { background: var(--ok); }
.progress-bar.warn { background: var(--warn); }
.progress-bar.danger { background: var(--danger); }
.muted { color: var(--muted); }
.detail-section { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-top: 16px; overflow: hidden; }
.detail-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; user-select: none; border-bottom: 1px solid transparent; }
.detail-header:hover { background: #f9fafb; }
.detail-header.open { border-bottom-color: var(--line); }
.detail-arrow { font-size: 12px; transition: transform 0.2s; color: var(--muted); }
.detail-arrow.open { transform: rotate(90deg); }
.detail-title { font-weight: 700; font-size: 15px; }
.detail-count { color: var(--muted); font-size: 13px; }
.detail-rate { margin-left: auto; color: #166534; background: #dcfce7; border-radius: 999px; padding: 2px 10px; font-size: 12px; line-height: 20px; }
.small-btn { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.detail-body { padding: 0; }
.detail-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.filter-input { height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; font-size: 13px; width: 200px; }
.detail-pager { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.detail-pager select { height: 28px; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; padding: 0 4px; }
.detail-table-wrap { overflow-x: auto; }
.detail-table { width: 100%; border-collapse: collapse; min-width: 1020px; }
.detail-table thead { background: #f9fafb; }
.detail-table th, .detail-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; white-space: nowrap; }
.detail-table tbody tr:hover { background: #f9fbff; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--primary); }
.sort-icon { font-size: 10px; color: #ccc; margin-left: 2px; }
.sort-icon.asc, .sort-icon.desc { color: var(--primary); }
.model-tag { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 12px; line-height: 18px; color: #fff; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.token-name-tag { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 12px; line-height: 18px; color: #374151; background: #e5e7eb; }
.time-tag { display: inline-flex; align-items: center; gap: 4px; }
.time-tag .tag { font-size: 12px; padding: 2px 6px; }
.tag.stream { color: #1e40af; background: #dbeafe; }
.tag.nostream { color: #6b21a8; background: #f3e8ff; }
.tag.cache { color: #0e7490; background: #cffafe; }
.tag.cache-creation { color: #7c2d12; background: #ffedd5; }
.tag.warn-tag { color: #92400e; background: #fef3c7; }
.footer { margin-top: 12px; color: var(--muted); font-size: 13px; }
.error-text { color: var(--danger); }
