body, html {
    height: 100%;
    overflow: auto; /* 允许页面滚动 */
}

.main-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 100%;
    background-color: #f8f9fa;
    padding: 20px;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.content-area {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Content card to align with template style */
.inline-osmd-container {
  max-width: 720px;
  max-height: 60vh;
  overflow: auto;
  margin: 0 auto;
}
.content-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

body.dark-theme .content-card {
    background: var(--surface-color);
    border-color: var(--border-color);
    box-shadow: none;
}

/* Additional styles from before */
#historyList .list-group-item {
    cursor: pointer;
}

.sidebar .list-group-item .flex-grow-1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Drag and Drop Upload Area */
.upload-area {
    border: 2px dashed #0b0c0d;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.upload-area:hover {
    background-color: #f8f9fa;
    border-color: #0b0c0d;
}

.upload-area.drag-over {
    background-color: #e9ecef;
    border-color: #0b0c0d;
}

.upload-area-icon {
    font-size: 3rem;
    color: #0b0c0d;
}

.upload-area p {
    margin-top: 15px;
    color: #6c757d;
}

/* Hide default file input */
#file-input-beautified {
    display: none;
}

.history-item-icon {
    margin-right: 10px;
    color: #6c757d; /* Secondary text color */
}

.sidebar .list-group-item.active {
    background-color: #dbeafe; /* A light blue for active state */
    border-color: #a6c9f7;
}

.sidebar .list-group-item.active .history-item-icon,
.sidebar .list-group-item.active .text-dark {
    color: #0b0c0d !important; /* Darker blue for text/icon in active state */
}

/* Enhanced upload area styling */
.upload-area {
    transition: all 0.3s ease;
}

.upload-area:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

/* Staged file list items */
.staged-list .file-item {
    border: 1px dashed #e9ecef;
    border-radius: 12px;
    padding: 12px 16px;
    background: #fff;
}

body.dark-theme .staged-list .file-item {
    background: var(--surface-color);
    border-color: var(--border-color);
}

.staged-list .file-name { font-weight: 600; }
.staged-list .file-meta { color: #6c757d; }

/* Cropper modal wrapper */
.cropper-wrapper {
    width: 100%;
    height: 75vh;        /* 更大的可视区域 */
    max-height: 85vh;    /* 允许尽可能占满视口 */
    min-height: 420px;   /* 提升最小高度，减少左上角局部感 */
    overflow: hidden;
    position: relative;  /* 让内部容器以此为定位参考 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    background: #00000008;
}

body.dark-theme .cropper-wrapper {
    border-color: var(--border-color);
    background: rgba(255,255,255,0.03);
}

/* 裁剪图像充满容器并居中显示 */
.cropper-image {
    display: block;
    max-width: 100%;
    height: auto; /* 保持原始比例，防止拉伸 */
}

/* Jcrop wrapper to center and size the cropping area */
.jcrop-wrapper {
    width: 100%;
    height: 75vh;
    max-height: 85vh;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    background: #00000008;
}

body.dark-theme .jcrop-wrapper {
    border-color: var(--border-color);
    background: rgba(255,255,255,0.03);
}

/* 移除对裁剪容器的强制宽高，让 Cropper 自行计算，避免点击区域错位 */

/* 内联裁剪时，上传区域去除额外内边距以腾出空间 */
.upload-area.inline-crop {
    padding: 0;
    border-style: solid;
}

/* 让内联裁剪整体充满上传区域并居中 */
#inlineCropArea {
    width: 100%;
}

/* Processing status styling */
#processing-status {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Balance display styling */
#balance {
    font-weight: bold;
    color: #0b0c0d;
}

/* Responsive design improvements */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
    }
    
    .content-area {
        height: calc(100vh - 200px);
    }
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* File size display */
.file-size {
    font-size: 0.875rem;
    color: #6c757d;
}



.form-check-input:checked {
    background-color: #000;
    border-color: #000;
}

