/* @media(min-width:1200px){
.combined-section>form,.combined-section>div {
    flex: 1;
    align-self: flex-start;
}

.combined-section>form {
    margin-right: 10px;
}

.combined-section {
    display: flex;
    gap: 15px;
}
} */
@media(min-width:1200px){
.multi-upload-container {
    margin: 0 auto;
}
}
.multi-upload-container {
    background: #fff;
    border-radius: var(--apmarker-normal-border-radius);
    padding: var(--apmarker-common-padding);
    box-shadow: var(--apmarker-box-shadow);
}
.multi-upload-container:hover {
    box-shadow: var(--apmarker-box-hover-shadow);
}
#drop-zone,
#student-drop-zone {
    outline: 2px dashed var(--apmarker-main-color);
    padding: 30px 15px;
    border-radius: var(--apmarker-normal-border-radius);
    margin: 15px 0;
    background: repeating-linear-gradient(45deg, #e5e5e5, #e5e5e5 10px, #13113312 10px, #13113312 20px);
    cursor: pointer;
}
p.drop-zone-text-big {
    font-size: 18px;
    margin-top: 10px;
    letter-spacing: 2px;
    color: var(--apmarker-light-red-color);
}
@media(min-width:1200px){
#drop-zone,
#student-drop-zone {
    padding: 90px 15px;
}
span.drop-zone-text {
    font-size: 20px;
    letter-spacing: 3px;
}
p.drop-zone-text-big {
    font-size: 20px;
    margin-top: 10px;
    letter-spacing: 2px;
    color: var(--apmarker-light-red-color);
}
}
#drop-zone:hover,
#student-drop-zone:hover {
    outline: 2px dashed var(--apmarker-main-color);
}
.drop-zone-input {
    display: none;
}
.drop-zone-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.drop-zone-icon {
    width: 25px;
    height: 25px;
    margin-right: 5px;
}
/* 新增預覽區域和用戶配對區域的佈局 */
.preview-section {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}
.preview-area {
    flex: 2;
    border: 1px solid var(--apmarker-main-color);
    border-radius: var(--apmarker-normal-border-radius);
    padding: 10px;
    min-height: 150px;
}
.preview-area:hover {
    outline: 2px solid var(--apmarker-main-color);
}
.user-assignment {
    flex: 1;
    padding: 15px;
    background: #f5f5f5;
    border-radius: var(--apmarker-normal-border-radius);
}
.user-assignment h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}
.user-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
}
.class-students {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
}
.user-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    transition: .1s;
    width: 33.3333333%;
    display: inline-block;
}
.user-item label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: capitalize;
}
/* 可排序的預覽項目 */
.sortable {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    align-content: flex-start;
    max-height: 800px;
    overflow: auto;
}
.preview-item {
    flex: 1 0 140px;
    max-width: 140px;
    position: relative;
    cursor: move;
    transition: transform 0.2s;
}
@media (max-width: 400px) {
    .preview-item {
        flex: 1 0 120px;
        max-width: 120px;
    }
}
.preview-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}
.preview-item img {
    max-width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1/1;
    object-fit: cover;
}
.assignment-controls button {
    margin-bottom: 5px;
}
/* 勾選框樣式 */
.preview-item .image-checkbox {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 10;
    width: 25px;
    height: 25px;
}

/*放大查看*/
.preview-item .enlarge-image,
.preview-item .checkfile {
    position: absolute;
    top: 120px;
    right: 22.5px;
    z-index: 10;
    background: var(--apmarker-main-color);
    color: #fff;
    font-size: 12px;
    line-height: 12px;
    padding: 8px 14px;
    border-radius: var(--apmarker-normal-border-radius);
    transition: .3s;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 2px;
}
.preview-item .checkfile {
    padding: 7px 12px;
}
.preview-item .enlarge-image:hover,
.preview-item .checkfile:hover {
    background: var(--apmarker-secondary-color);
    transform: scale(1.15);
}

span.enlarge-image span.apmarker-icon.expand-m,
span.checkfile span.apmarker-icon.file-m {
    width: 12px;
    height: 12px;
}

/* 分配結果顯示 */
#assignment-result {
    margin-top: 10px;
    padding: 10px;
    background: var(--apmarker-light-grey-color);
    border-radius: var(--apmarker-normal-border-radius);
}

#assignment-result .apmarker-icon {
    margin-left: 5px;
}

.file-info,.assigned-student {
    color: #fff;
    text-align: center;
}
.file-info {
    background: var(--apmarker-main-color);
}

.file-name {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    height: 22px;
    display: block;
    padding: 0 20px;
    width: 100%;
    color:#000;
    background: #fff;
}
.assigned-student {
    background: var(--apmarker-deep-green-color);
}
/* 響應式調整 */
@media (max-width: 768px) {
    .preview-section {
        flex-direction: column;
    }
}
/* 臨時消息樣式 */
.temp-message {
    padding: 10px;
    margin-top: 10px;
    border-radius: var(--apmarker-normal-border-radius);
    display: none;
}
.temp-message.success {
    background: #dff0d8;
    color:var(--apmarker-deep-green-color);
}
.temp-message.error {
    background: #f2dede;
    color: var(--apmarker-dark-red-color);
}
/* 上傳狀態指示 */
.file-status.uploading {
    color: var(--apmarker-main-color);
}
/* 上傳狀態指示器 */
.upload-status {
    padding: 15px;
    background: #f5f5f5;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}
.upload-status .spinner {
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top: 3px solid var(--apmarker-main-color);
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* 批量進度條樣式 */
.batch-progress {
    margin-top: 10px;
}
.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: var(--apmarker-normal-border-radius);
    overflow: hidden;
    margin-bottom: 5px;
}
.progress-bar .progress {
    height: 100%;
    background: var(--apmarker-main-color);
    width: 0%;
        background-image: linear-gradient(
        -45deg, /* 斜線角度 */
        rgba(255, 255, 255, 0.3) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.3) 75%,
        transparent 75%,
        transparent 100%
    );
    background-size: 20px 20px; /* 調整條紋大小 */
    animation: progressAnimation 1s linear infinite; /* 動畫效果 */
    transition: width 0.3s ease;
}

@keyframes progressAnimation {
    0% {
        background-position: 0 0; /* 初始位置 */
    }
    100% {
        background-position: 20px 20px; /* 移動到條紋的寬高 */
    }
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #555;
}
.user-item.selected {
    background-color: #e3f2fd;
    border-left: 4px solid var(--apmarker-main-color);
}
.user-item.selected input {
    margin-left: 5px;
}
.upload-status p {
    margin-bottom:0;
}

/* 圖片預覽區域 */
.preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.preview-item {
    position: relative;
    flex: 1 0 138px;
    max-width: 138px;
    border: 1px solid #ddd;
    border-radius: var(--apmarker-normal-border-radius);
    padding: 10px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: move;
    transition: transform 0.2s ease;
}

.preview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.preview-item.ui-sortable-helper {
    transform: rotate(5deg);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
}

.preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--apmarker-normal-border-radius);
}

/* 预览项中的移除按钮样式 */
.preview-item .file-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.preview-item .file-remove:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.assigned-student {
    margin-top: 5px;
    padding: 3px 6px;
    background:  #f329b9;
    color: white;
    font-size: 12px;
    border-radius: var(--apmarker-normal-border-radius);
    text-align: center;
}

/* 拖拽排序樣式 */
.sortable-placeholder {
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: var(--apmarker-normal-border-radius);
    margin: 0;
    min-height: 180px;
    width: 200px;
    box-sizing: border-box;
}

.sort-hint {
    text-align: center;
    color: #000;
    font-size: 15px;
    margin: 10px 0;
    padding: 10px;
    background: #c6e6ff;
    border-radius: var(--apmarker-normal-border-radius);
    flex: 1 0 100%;
}

.sort-hint span.apmarker-icon.hint {
    width: 13px;
    height: 13px;
    margin-bottom: -1px;
    margin-right: 5px;
}



/* 模態框樣式 */
#imageModal.modal {
  display: none; /* 默認隱藏 */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
}

.modal-content-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 30px 0;
  box-sizing: border-box;
}

#imageModal .modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  max-height: 80vh;
  object-fit: contain;
}

#imageModal #caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
}

#imageModal .close {
    position: absolute;
    top: 15px;
    right: 35px;
    z-index: 999999;
    background-color: var(--apmarker-main-color);
    background-repeat: no-repeat;
    background-position: 20px center;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: var(--apmarker-normal-border-radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

#imageModal .close svg {
    fill: #ffffff;
}

#imageModal .close:hover, 
#imageModal .close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
    background-color: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* 小屏幕適配 */
@media only screen and (max-width: 700px){
  #imageModal .modal-content {
    width: 100%;
  }
}


/*裁切功能*/
.crop-actions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10001;
}

/* Cropper.js 覆蓋樣式 */
.cropper-container {
    direction: ltr;
    font-size: 0;
    line-height: 0;
    position: relative;
    touch-action: none;
    user-select: none;
}

.cropper-modal {
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.cropper-view-box {
    display: block;
    height: 100%;
    outline: 1px solid var(--apmarker-main-color);
    outline-color: rgba(var(--apmarker-main-color-rgb), 0.75);
    overflow: hidden;
    width: 100%;
}

.cropper-dashed {
    border: 0 dashed #eee;
    display: block;
    opacity: 0.5;
    position: absolute;
}

.cropper-line {
    background-color: var(--apmarker-main-color);
    display: block;
    height: 100%;
    opacity: 0.1;
    position: absolute;
    width: 100%;
}

.cropper-point {
    background-color: var(--apmarker-main-color);
    height: 5px;
    opacity: 0.75;
    position: absolute;
    width: 5px;
}

.cropper-bg {
    background: #000;
}

.form-group-radio-radio {
    margin: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.form-group-radio label {
    display: inline-block;
    position: relative;
    padding-left: 30px;
    margin-right: 20px;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    line-height: 20px;
    transition: color 0.3s ease;
}

.form-group-radio.bigtextv1 label {
    font-size: 18px;
}

.form-group-radio label:hover {
    color: var(--apmarker-main-color);
}
.form-group-radio input[type="radio"],
.form-group-radio input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}
/* 自定義單選按鈕樣式 */
.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    transition: all 0.3s ease;
}
.form-group-radio label:hover input ~ .checkmark {
    border-color: var(--apmarker-main-color);
}
.form-group-radio input:checked ~ .checkmark {
    background-color: #fff;
    border-color: var(--apmarker-main-color);
}
/* 選中狀態的內部圓點 */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--apmarker-main-color);
    transition: all 0.3s ease;
}
.form-group-radio input:checked ~ .checkmark:after {
    display: block;
}

.submit-popup-message {
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgb(255 255 255 / 66%);
    top: 0;
    left: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 15px;
    font-size: 30px;
}

span.file-type {
    display: none;
}

.pdf-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--apmarker-normal-border-radius);
    position: relative;
    background: #dc3545;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.pdf-preview span.apmarker-icon.pdf-m {
    width: 50px;
    height: 50px;
}

.pdf-preview span.file-type-label {
    color: #fff;
}

/* 設計切換功能樣式 */
.design-toggle-group {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--apmarker-normal-border-radius);
    border: 1px solid #e9ecef;
}

.design-toggle-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    display: block;
}

.design-toggle-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.design-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid #dee2e6;
    background: #fff;
    border-radius: var(--apmarker-normal-border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #6c757d;
    min-width: 160px;
    justify-content: center;
}

.design-toggle-btn:hover {
    border-color: var(--apmarker-main-color);
    color: var(--apmarker-main-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.design-toggle-btn.active {
    background: var(--apmarker-main-color);
    border-color: var(--apmarker-main-color);
    color: #fff;
}

.design-icon {
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.design-icon.traditional {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"/></svg>');
}

.design-icon.new {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2M13,17H11V11H13V17M13,9H11V7H13V9Z"/></svg>');
}

.design-toggle-btn.active .design-icon.traditional,
.design-toggle-btn.active .design-icon.new {
    filter: brightness(0) invert(1);
}

/* 個別上傳模式樣式 */
.student-upload-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 15px 0;
}

.student-upload-box {
    border: 2px dashed #dee2e6;
    border-radius: var(--apmarker-normal-border-radius);
    padding: 20px;
    background: #fff;
    transition: all 0.3s ease;
    position: relative;
}

.student-upload-box:hover {
    border-color: var(--apmarker-main-color);
    box-shadow: 0 4px 12px rgba(0,123,255,0.1);
}

.student-upload-box.has-files {
    border-color: #28a745;
    background: #f8fff9;
}

.student-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--apmarker-main-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.student-name {
    font-weight: 600;
    color: #495057;
}

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: var(--apmarker-normal-border-radius);
    padding: 30px 15px;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    position: relative;
}

/* 文件輸入框樣式 - 隱藏但可通過label訪問 */
.upload-area input[type="file"] {
    display: none !important;
}

/* label樣式 - 作為可點擊區域 */
.upload-area {
    display: block;
    cursor: pointer;
}

.upload-area.processing {
    opacity: 0.7;
    pointer-events: none;
    cursor: not-allowed;
}

.upload-area.processing::after {
    content: '處理中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
}

.upload-area:hover {
    border-color: var(--apmarker-main-color);
    background: #e3f2fd;
}

.upload-area.drag-over {
    border-color: var(--apmarker-main-color);
    background: #e3f2fd;
    transform: scale(1.02);
}

.upload-area.has-files {
    border-color: #28a745;
    background: #f1f8e9;
}

.upload-icon {
    font-size: 32px;
    color: #6c757d;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 14px;
    color: #6c757d;
    margin: 5px 0;
}

.upload-text-big {
    font-size: 16px;
    color: #495057;
    font-weight: 500;
}

.file-list {
    max-height: 200px;
    overflow-y: auto;
}

.student-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: var(--apmarker-normal-border-radius);
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.student-file-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #6c757d;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 12px;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.file-size {
    font-size: 11px;
    color: #6c757d;
}

.file-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background: #f8d7da;
    color: #721c24;
}

.upload-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.upload-btn {
    background: var(--apmarker-main-color);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: var(--apmarker-normal-border-radius);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.upload-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .design-toggle-buttons {
        flex-direction: column;
    }
    
    .design-toggle-btn {
        min-width: auto;
        width: 100%;
    }
    
    .student-upload-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .student-upload-box {
        padding: 15px;
    }
    
    .upload-area {
        padding: 20px 10px;
    }
}

#individual-upload-section .preview-item {
    flex: 1 0 78px;
    max-width: 78px;
    padding: 0;
    background: var(--apmarker-green-color);
}

#individual-upload-section .pdf-preview,#individual-upload-section  .preview-item img {
    height: 55px;
    border-radius: 0;
}

#individual-upload-section .pdf-preview span.apmarker-icon {
    width: 20px;
    height: 20px;
}

#individual-upload-section .pdf-preview  span.file-type-label {
    font-size: 11px;
}

#individual-upload-section .checkfile, #individual-upload-section  .enlarge-image {
    position: relative;
    right: auto;
    top: auto;
    border-radius: 12px 12px 0 0;
    font-size: 8px;
}

#individual-upload-section .checkfile .apmarker-icon, #individual-upload-section .enlarge-image .apmarker-icon {
    width: 10px;
    height: 10px;
}

#individual-upload-section  .file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#individual-upload-section  .file-info,#individual-upload-section .file-name {
    background: transparent;
    color: #fff;
}