/* 页面切换 */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* 页面头部 */
.page-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
}

.page-header h2 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.back-btn {
    background: transparent;
    border: none;
    color: #007bff;
    font-size: 18px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.back-btn:active {
    background: rgba(0, 123, 255, 0.1);
}

/* 主页面按钮容器 */
.button-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4vh;
    width: 90vw;
    max-width: 500px;
    margin: 30px 0;
}

/* 照片容器 */
.photos-container {
    padding: 20px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (min-width: 768px) {
    .photos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .photos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 照片卡片磨砂玻璃效果 */
.photo-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.photo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    z-index: -1;
}

.photo-card:active {
    transform: scale(0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.photo-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.photo-name {
    padding: 12px;
    font-size: 12px;
    color: white;
    text-align: center;
    word-break: break-all;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 统一磨砂框宽度 - 打印页面和状态页面 */
#printPage .number-card,
#printStatusPage .number-card,
#printPage .single-photo,
#printStatusPage .single-photo,
#printPage .photo-card,
#printStatusPage .photo-card {
    max-width: 320px;
    margin: 0 auto;
}

/* 打印页面照片样式调整 */
#printPage .photo-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    height: auto;
    min-height: 300px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#printPage .photo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    z-index: -1;
}

#printPage .photo-img {
    width: calc(100% - 8px);
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

#printPage .photo-card:active .photo-img {
    transform: scale(0.98);
}

#printPage .photo-name {
    display: none;
}

/* 单张照片在打印页面的特殊样式 */
#printPage .single-photo {
    height: auto;
    min-height: 350px;
    padding: 4px;
}

#printPage .single-photo .photo-img {
    width: calc(100% - 8px);
    height: auto;
    max-height: 450px;
    object-fit: contain;
    border-radius: 8px;
}

/* 打印页面打印编号卡片调整 */
#printPage .number-card {
    padding: 20px;
    margin-bottom: 25px;
}

/* 状态页面照片样式调整 */
#printStatusPage .photo-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    height: auto;
    min-height: 300px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#printStatusPage .photo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    z-index: -1;
}

#printStatusPage .photo-img {
    width: calc(100% - 8px);
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

#printStatusPage .photo-card:active .photo-img {
    transform: scale(0.98);
}

#printStatusPage .photo-name {
    display: none;
}

/* 状态页面单张照片样式 */
#printStatusPage .single-photo {
    height: auto;
    min-height: 350px;
    padding: 4px;
}

#printStatusPage .single-photo .photo-img {
    width: calc(100% - 8px);
    height: auto;
    max-height: 450px;
    object-fit: contain;
    border-radius: 8px;
}

/* 状态页面打印编号卡片调整 */
#printStatusPage .number-card {
    padding: 20px;
    margin-bottom: 25px;
}

/* 下载页面保持原有样式（显示文件名） */
#downloadPage .photo-card {
    /* 保持原有样式，显示文件名 */
    max-width: none; /* 重置最大宽度 */
}

#downloadPage .photo-img {
    height: 150px;
    object-fit: cover;
}

#downloadPage .photo-name {
    display: block;
}

/* 空状态磨砂玻璃效果 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 20px;
    position: relative;
    overflow: hidden;
}

.empty-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    z-index: -1;
}

.empty-state p {
    margin: 0 0 10px 0;
    font-size: 18px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.empty-subtext {
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.8);
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 20px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.empty-message {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 打印编号信息样式 - 磨砂玻璃效果 */
.print-number-info {
    margin-bottom: 25px;
}

.number-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.number-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    z-index: -1;
}

.number-icon {
    font-size: 40px;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.number-content h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 500;
    opacity: 0.9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.print-number {
    font-size: 32px;
    font-weight: bold;
    margin: 15px 0;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    background: linear-gradient(135deg, #ffffff, #e6f7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.print-tip {
    margin: 10px 0 0 0;
    font-size: 14px;
    opacity: 0.8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.print-status {
    margin-top: 15px;
}

/* 状态徽章磨砂玻璃效果 */
.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.status-badge.printed {
    background: rgba(76, 175, 80, 0.2);
    color: #c8e6c9;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.status-badge.pending {
    background: rgba(255, 152, 0, 0.2);
    color: #ffe0b2;
    border: 1px solid rgba(255, 152, 0, 0.4);
}

/* 信息提示框磨砂玻璃效果 */
.info-tip {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.info-tip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    z-index: -1;
}

.info-tip p {
    margin: 8px 0;
    color: white;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.success-text {
    color: #a5d6a7 !important;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.waiting-text {
    color: #ffcc80 !important;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 刷新按钮磨砂玻璃效果 */
.refresh-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.refresh-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    z-index: -1;
}

.refresh-btn:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.98);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.refresh-icon {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 模态框磨砂玻璃效果 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 10vh auto;
    padding: 0;
    border-radius: 20px;
    width: 90vw;
    max-width: 400px;
    max-height: 100vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-body {
    padding: 25px;
}

/* 打印确认模态框样式 */
.print-confirm-section {
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 10px 20px;
}

.confirm-title {
    color: #333;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 600;
}

.selected-photo-preview {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.selected-photo-preview .preview-image {
    max-height: 40vh;
    object-fit: contain;
}

.preview-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* 确认信息样式 */
.confirm-info {
    margin: 15px 0;
}

.existing-task-info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.info-content p {
    margin: 0 0 5px 0;
    color: #0066cc;
    font-size: 14px;
}

.info-content p:last-child {
    margin-bottom: 0;
}

.print-id-info {
    font-weight: 500;
}

.print-id-info strong {
    color: #d32f2f;
    font-size: 16px;
}

.confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 确认按钮显示控制 */
.confirm-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
}

.confirm-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.close-btn {
    width: 100%;
    padding: 14px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:active {
    background: #545b62;
    transform: translateY(1px);
}

/* 照片预览模态框样式 */
.photo-preview-modal {
    max-width: 95vw;
    max-height: 95vh;
    margin: 2.5vh auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.preview-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.preview-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.preview-body {
    padding: 20px;
    text-align: center;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.preview-image-large {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.preview-tip {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 123, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 8px;
    color: #0066cc;
    font-weight: 500;
    border: 1px solid rgba(0, 123, 255, 0.2);
}

/* 响应式调整 */
@media (max-width: 480px) {
    .photos-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .photo-img {
        height: 200px;
    }
    
    .page-header {
        padding: 12px 15px;
    }
    
    .photos-container {
        padding: 15px;
    }
    
    .number-card {
        padding: 20px;
    }
    
    .print-number {
        font-size: 28px;
    }
    
    .modal-body {
        padding: 20px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .photos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .photo-img {
        height: 120px;
    }
}

/* 禁用状态的照片卡片 */
.photo-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.photo-card.disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
}

.photo-card.disabled:active {
    transform: none;
}

/* 打印页面的照片容器特殊处理 */
#printPage .photos-container {
    max-height: calc(100vh - 80px);
}

/* 修复滚动条样式美化 */
.photos-container::-webkit-scrollbar {
    width: 6px;
}

.photos-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.photos-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.photos-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 状态页面容器调整 */
#printStatusPage .container {
    padding: 20px;
    text-align: center;
}

.action-section {
    margin-top: 30px;
    text-align: center;
}

.refresh-section {
    margin-top: 20px;
}

.action-buttons {
    margin-top: 30px;
}

.action-btn.primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
}

.action-btn.primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4);
}

/* 确保背景样式一致 - 蓝色渐变 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #1E46E6, #1a3bc4);
    background-size: cover;
    background-position: center;
    z-index: -1;
}