/**
 * 安全运行时间 - 样式
 * 自适应站点的亮色/暗色主题
 */
.runtime-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
    gap: 12px;
    flex-wrap: wrap;
    opacity: 0.9;
    transition: opacity 0.2s;
}
.runtime-counter:hover {
    opacity: 1;
}

/* 页脚内联模式 */
.runtime-counter--footer {
    display: inline-flex;
    justify-content: flex-start;
    padding: 0;
    gap: 4px;
    flex-wrap: nowrap;
    vertical-align: middle;
    color: inherit;
}

.runtime-counter--footer .runtime-divider {
    display: none;
}

.runtime-counter--footer .runtime-content {
    gap: 3px;
    font-size: inherit;
    line-height: inherit;
}

.runtime-counter--footer .runtime-icon {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

.runtime-counter--footer .runtime-seconds {
    font-size: 0.95em;
    opacity: 0.85;
}

/* 分割线 */
.runtime-divider {
    display: block;
    width: 100%;
    max-width: 400px;
    height: 1px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0.15;
    margin-bottom: 4px;
}

/* 内容区 */
.runtime-content {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: inherit;
}

/* 时钟图标 */
.runtime-icon {
    flex-shrink: 0;
    opacity: 0.7;
}

/* 数字区域 */
.runtime-text {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.runtime-value {
    font-weight: 600;
}

.runtime-seconds {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    opacity: 0.75;
}

/* ===== 右下角悬浮模式 ===== */
.runtime-counter--floating {
    position: fixed;
    right: 0;
    bottom: 100px;
    z-index: 9999;
    flex-direction: row-reverse;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
    background: var(--card-bg, #ffffff);
    color: var(--text-secondary, #6c757d);
    border: 1px solid var(--card-border, #e9ecef);
    border-right: none;
    border-radius: 12px 0 0 12px;
    box-shadow: -2px 4px 16px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.runtime-counter--floating:hover {
    box-shadow: -4px 6px 20px rgba(0, 0, 0, 0.18);
}

/* 展开/收起按钮 */
.runtime-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-right: 1px solid var(--card-border, #e9ecef);
    color: var(--text-secondary, #6c757d);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.runtime-toggle:hover {
    background: var(--body-bg, #f0f2f5);
    color: var(--primary, #1a73e8);
}

.runtime-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

/* 收起状态：隐藏内容，只露出按钮 */
.runtime-counter--collapsed .runtime-content {
    display: none;
}

.runtime-counter--collapsed .runtime-toggle svg {
    transform: rotate(180deg);
}

/* 悬浮模式下的内容区 */
.runtime-counter--floating .runtime-content {
    padding: 10px 14px;
    gap: 8px;
    white-space: nowrap;
}

/* 悬浮模式下不显示分割线 */
.runtime-counter--floating .runtime-divider {
    display: none;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
    .runtime-counter:not(.runtime-counter--floating) {
        padding: 12px 0;
        gap: 8px;
    }
    .runtime-content {
        font-size: 12px;
    }
    .runtime-seconds {
        font-size: 11px;
    }
    .runtime-counter--floating {
        bottom: 80px;
    }
    .runtime-counter--floating .runtime-content {
        padding: 8px 10px;
    }
}
