/* usage-badge.css
 *
 * R2 工具页"今日已用 X 次 · 累计 X"角标。
 *
 * 两端适配：
 *   - PC ≥ 768px：内联在 h1 右侧，正常字号
 *   - 移动 < 768px：自动换行成独立一行，更紧凑
 */

.usage-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 14px;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.08);
    color: #047857;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    vertical-align: middle;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.usage-badge.is-shown {
    opacity: 1;
    transform: translateY(0);
}

.usage-badge strong {
    color: #047857;
    font-weight: 700;
    margin: 0 1px;
}

.usage-badge-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.usage-badge-item-muted {
    color: #64748b;
    border-left: 1px solid rgba(100, 116, 139, 0.25);
    padding-left: 10px;
}

.usage-badge-item-muted strong {
    color: #475569;
}

.usage-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
    animation: usage-badge-pulse 2s ease-in-out infinite;
}

@keyframes usage-badge-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15); }
    50%      { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.05); }
}

/* ---------------- 移动端：自动换行成独立一行 ---------------- */
@media (max-width: 767px) {
    .usage-badge {
        display: flex;
        margin: 8px 0 0;
        font-size: 12px;
        padding: 3px 9px;
        max-width: max-content;
    }
}

/* ---------------- 暗色模式 ---------------- */
body.dark-mode .usage-badge,
html.dark-mode .usage-badge {
    background: rgba(52, 211, 153, 0.12);
    color: #6ee7b7;
}

body.dark-mode .usage-badge strong,
html.dark-mode .usage-badge strong {
    color: #a7f3d0;
}

body.dark-mode .usage-badge-item-muted,
html.dark-mode .usage-badge-item-muted {
    color: #94a3b8;
    border-left-color: rgba(148, 163, 184, 0.3);
}

body.dark-mode .usage-badge-item-muted strong,
html.dark-mode .usage-badge-item-muted strong {
    color: #cbd5e1;
}

body.dark-mode .usage-badge-dot,
html.dark-mode .usage-badge-dot {
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2);
}
