/* ==========================================================================
   历史记录页样式
   ========================================================================== */

.page-container {
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}

/* 分段导航：历史记录 / 关于 */
.tab-nav {
    display: flex;
    gap: 4px;
    margin: 0 14px 12px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.tab-nav-btn {
    flex: 1;
    padding: 9px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
        box-shadow var(--dur) var(--ease);
}

.tab-nav-btn:hover {
    color: var(--text);
    background: var(--surface-3);
}

.tab-nav-btn.active {
    background: var(--surface);
    color: var(--brand-strong);
    box-shadow: var(--shadow-sm);
}

.tab-nav-btn:active {
    transform: scale(0.99);
}

/* 列表 */
.history-list {
    flex: 1;
    min-height: 0;
    padding: 2px 14px 150px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.history-list > .empty-state {
    margin-top: 8px;
}

/* 底部批量操作 */
.bottom-actions {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom, 0px));
    z-index: 99;
    display: flex;
    gap: 10px;
    width: calc(100% - 28px);
    max-width: 452px;
    padding: 10px;
    transform: translateX(-50%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-translucent);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    backdrop-filter: blur(16px) saturate(180%);
    box-shadow: var(--shadow-lg);
}

.bottom-actions .btn {
    flex: 1;
    height: 44px;
    font-size: 15px;
}

/* 加载态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   桌面端：居中单栏
   -------------------------------------------------------------------------- */
@media (min-width: 900px) {
    .page-container {
        width: 100%;
        max-width: 860px;
        margin: 0 auto;
        padding: 8px 0 28px;
    }

    .tab-nav {
        margin: 0 20px 14px;
        padding: 5px;
    }

    .tab-nav-btn {
        padding: 10px 14px;
        font-size: 14px;
    }

    .history-list {
        padding: 2px 20px 28px;
        overflow-y: visible;
    }

    .bottom-actions {
        display: none;
    }

    .history-list .empty-state {
        margin-top: 40px;
    }
}

@media (max-width: 380px) {
    .history-item .item-header {
        flex-direction: column;
        gap: 6px;
    }

    .history-item .item-cost {
        align-self: flex-start;
    }
}
