/* 字数消耗详情样式 */

/* 资源详情按钮 */
.resource-detail-btn {
    width: 100%;
    padding: 8px 12px;
    margin-top: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.resource-detail-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.resource-detail-btn i {
    font-size: 12px;
}

/* 统计卡片网格 */
.usage-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.usage-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.usage-stat-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.usage-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.usage-stat-card .stat-content {
    flex: 1;
    min-width: 0;
}

.usage-stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.usage-stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

/* 筛选器 */
.usage-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.filter-select {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: var(--primary-color);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 消耗记录列表 */
.usage-history-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

.usage-history-list::-webkit-scrollbar {
    width: 8px;
}

.usage-history-list::-webkit-scrollbar-track {
    background: transparent;
}

.usage-history-list::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.usage-history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.4);
}

/* 消耗记录项 */
.usage-record-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.usage-record-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.usage-record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.usage-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.usage-time i {
    color: var(--primary-color);
}

.usage-words {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.usage-words.consumed {
    color: #ef4444;
}

.usage-words i {
    font-size: 0.85rem;
}

.usage-record-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.usage-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.usage-info-item i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
    font-size: 0.85rem;
}

.usage-info-item .info-label {
    color: var(--text-secondary);
}

.usage-info-item .info-value {
    color: var(--text-primary);
    font-weight: 600;
}

.usage-info-item .info-value.remaining {
    color: var(--primary-color);
}

/* 加载状态 */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.loading-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.loading-state p {
    margin: 0;
    font-size: 1rem;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .usage-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .usage-filters {
        flex-direction: column;
    }

    .usage-record-body {
        grid-template-columns: 1fr;
    }

    .usage-stat-card .stat-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .usage-stats-grid {
        grid-template-columns: 1fr;
    }

    .usage-record-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .usage-words {
        align-self: flex-end;
    }
}
