/* 模糊图片变清晰页面样式 */
/* 上传区域（参照智能扩图） */
.upload-area {
    border: 2px dashed #e5e7eb;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    pointer-events: auto;
    z-index: 1;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #6366f1;
    background: #f5f7ff;
}

/* 历史记录卡片样式 */
.history-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.history-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.history-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

/* 加载中遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.loading-spinner {
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 5px solid white;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 

/* =========================
 * 生成历史（右侧栏）布局样式
 * 参照：图像上色/智能扩图的历史栏布局（由CSS控制）
 * ========================= */

/* 历史记录列容器 */
.history-column {
    margin-top: 1rem;
    height: calc(100vh - 96px);
    max-height: calc(100vh - 96px);
    overflow: hidden;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: width 0.25s ease, max-width 0.25s ease, padding 0.25s ease;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 历史记录折叠按钮 */
.history-toggle {
    position: absolute;
    top: 1.25rem;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.history-toggle:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4f46e5;
}

.history-toggle .toggle-icon {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.history-toggle span {
    font-size: 13px;
    font-weight: 700;
}

/* 折叠状态：让右侧列不占空间，按钮悬浮 */
.history-column.collapsed {
    width: 0;
    max-width: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    overflow: visible;
}

.history-column.collapsed .history-content {
    display: none;
}

.history-column.collapsed .history-toggle {
    position: fixed;
    top: 4.5rem; /* 与图像上色保持一致 */
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 104px;
    padding: 10px 8px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    border-color: #e5e7eb;
    gap: 8px;
    z-index: 40;
}

.history-column.collapsed .history-toggle .toggle-icon {
    transform: rotate(180deg);
    font-size: 18px;
}

.history-column.collapsed .history-toggle span {
    writing-mode: horizontal-tb;
    transform: none;
    line-height: 1.2;
    font-size: 13px;
    font-weight: 700;
}

/* 历史记录内容区域 */
.history-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    padding: 1rem;
    overflow: hidden;
}

/* 历史记录头部按钮组下移，避免被折叠按钮覆盖 */
.history-actions {
    margin-top: 2rem;
}

/* 历史列表容器（保证三张一屏显示） */
#history-container {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#history-container .bg-white {
    flex: 0 0 auto;
    max-height: calc((100vh - 320px) / 3);
    overflow: visible;
    display: flex;
    flex-direction: column;
    border: none;
    box-shadow: none;
    background: transparent;
}

#history-container .bg-white .p-4,
#history-container .bg-white .p-3 {
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: visible;
    flex: 1;
}

#history-container .bg-white img {
    max-height: calc((100vh - 280px) / 3);
    object-fit: contain;
    width: 100%;
    flex: 1;
    height: auto;
    min-height: 0;
}

#history-container .bg-white p {
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* 保存时间提示放到底部 */
.history-time-notice {
    margin-top: auto;
    flex-shrink: 0;
}

/* === 历史卡片样式：同步图像上色的“纯图片列表”风格 === */
.history-card {
    border: none;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: transparent;
    transform: none;
    box-shadow: none;
}

.history-card:hover {
    opacity: 0.8;
    box-shadow: none;
}

.history-thumbnail {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}