/* 历史记录页面专用样式 */
.history-page {
    max-width: 1200px;
    margin: 2rem auto;
    margin-top: calc(70px + 2rem); /* 为fixed header留出空间 */
    min-height: calc(100vh - 70px);
    padding: 0 2rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* 搜索框样式 */
.search-container {
    margin-bottom: 2rem;
}

.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1rem;
    pointer-events: none;
}

.clear-search {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    transition: all 0.2s ease;
}

.clear-search:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.history-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.history-grid {
    display: grid;
    gap: 1.5rem;
}

.history-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.item-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.item-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-completed {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
}

.status-processing {
    background: rgba(237, 137, 54, 0.1);
    color: var(--warning-color);
}

.status-failed {
    background: rgba(245, 101, 101, 0.1);
    color: var(--error-color);
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-download {
    background: var(--success-color);
    color: white;
}

.btn-view {
    background: var(--primary-color);
    color: white;
}

.btn-delete {
    background: var(--error-color);
    color: white;
}

.action-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.loading-spinner {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* 错误状态 */
.error-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.error-icon {
    font-size: 4rem;
    color: var(--error-color);
    margin-bottom: 1rem;
}

.retry-btn {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* 重新生成按钮 */
.btn-retry {
    background: var(--warning-color);
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .history-page {
        margin-top: calc(60px + 1rem);
        padding: 0 1rem;
    }
    
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .history-title {
        font-size: 1.5rem;
    }
    
    .search-container {
        margin-bottom: 1.5rem;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .search-input {
        font-size: 0.9rem;
        padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    }
    
    .search-icon {
        left: 0.75rem;
        font-size: 0.9rem;
    }
    
    .clear-search {
        right: 0.75rem;
    }
    
    .history-item {
        padding: 1rem;
    }
    
    .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .item-actions {
        flex-wrap: wrap;
        width: 100%;
        justify-content: flex-start;
    }
    
    .action-btn {
        flex: none;
        min-width: 40px;
        width: auto;
        justify-content: center;
        align-items: center;
        display: flex;
        gap: 0;
        font-size: 0;
        padding: 0.6rem;
    }
    
    .action-btn i {
        font-size: 1rem;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .history-page {
        padding: 0 0.75rem;
    }
    
    .action-btn {
        padding: 0.5rem;
        min-width: 36px;
        font-size: 0;
        justify-content: center;
        align-items: center;
    }
    
    .action-btn i {
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
