* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.remember-me {
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.checkbox-label span {
    color: #333;
    font-size: 14px;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
    /* width: 100%; */
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #c82333;
}

/* 主页面样式 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 999;
    border-bottom: 1px solid #e9ecef;
}

.header h1 {
    margin: 0;
    color: #667eea;
}

.user-info {
    position: relative;
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.user-avatar #usernameInitial {
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 16px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 4px 0;
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    transition: background-color 0.2s;
    font-size: 14px;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item span:first-child {
    font-size: 16px;
}

.permissions {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
}

.main-content {
    display: block;
    padding-top: 80px; /* 为固定 header 留出空间 */
    padding-bottom: 100px; /* 为固定 action-buttons 留出空间 */
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.action-buttons {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100vw;
    z-index: 998;
    padding: 10px 0;
    box-sizing: border-box;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #e9ecef;
}

.action-buttons-box {
    max-width: 1400px;
    width: 100%;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin: 0 auto;
}

.action-buttons .btn {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    padding: 8px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
    min-width: 90px;
    justify-content: center;
    font-size: 14px;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.action-buttons .btn span {
    font-size: 14px;
}

.upload-area {
    margin-bottom: 15px;
}

.upload-dropzone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.upload-dropzone:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-dropzone.dragover {
    border-color: #667eea;
    background: #f0f4ff;
}

.input-text {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    margin-bottom: 10px;
}

.input-text:focus {
    outline: none;
    border-color: #667eea;
}

.create-directory {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.create-directory .input-text {
    flex: 1;
    margin-bottom: 0;
}

#uploadProgress {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

.upload-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* 已选文件列表样式 */
.selected-files-list {
    margin-top: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.selected-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.btn-clear {
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.btn-clear:hover {
    background: #dc3545;
    color: white;
}

.selected-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selected-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.selected-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.selected-file-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.selected-file-thumbnail {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.selected-file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selected-file-icon-fallback {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.selected-file-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.selected-file-size {
    font-size: 11px;
    color: #666;
}

.btn-remove-file {
    background: #dc3545;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
    padding: 0;
    margin-left: 10px;
}

.btn-remove-file:hover {
    background: #c82333;
    transform: scale(1.1);
}

.btn-remove-file:active {
    transform: scale(0.95);
}

.content-area {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s;
    overflow: hidden;
}

.modal-content-small {
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

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

.modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-close:active {
    transform: scale(0.95);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-body .form-group {
    margin-bottom: 15px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.modal-body .input-text {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.modal-body .input-text:focus {
    outline: none;
    border-color: #667eea;
}

.modal-body .input-text[readonly] {
    background: #f8f9fa;
    cursor: not-allowed;
}

/* 文件详情样式 */
.file-info-detail {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-row {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    min-width: 100px;
    font-weight: 500;
    color: #666;
    font-size: 14px;
}

.info-value {
    flex: 1;
    color: #333;
    font-size: 14px;
    word-break: break-all;
}

.info-link {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.info-link:hover {
    text-decoration: underline;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.breadcrumb {
    flex: 1;
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 0;
    font-size: 16px;
    font-weight: 500;
}

.breadcrumb span {
    color: #667eea;
    cursor: pointer;
    margin-right: 5px;
}

.breadcrumb span:hover {
    text-decoration: underline;
}

.breadcrumb span:not(:last-child)::after {
    content: ' / ';
    color: #999;
    margin-left: 5px;
}

.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.file-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

/* 文件详情按钮 */
.file-info-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    z-index: 5;
    transition: background-color 0.2s;
    padding: 0;
    color: #666;
}

.file-info-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.file-info-btn:active {
    background: rgba(102, 126, 234, 0.2);
}

.file-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.file-item.selected {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.file-item.directory {
    background: #fff3cd;
    border-color: #ffc107;
}

.file-item.directory.selected {
    background: #ffeaa7;
    border-color: #667eea;
}

/* 文件选择复选框 */
.file-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
}

.file-select-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

/* 批量操作工具栏 */
.batch-toolbar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.batch-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: #333;
}

.batch-info span {
    font-weight: 500;
}

.btn-link {
    background: transparent;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-link:hover {
    background: #e9ecef;
    text-decoration: underline;
}

.batch-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.batch-actions .btn {
    min-height: 36px;
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
}

.batch-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.file-icon {
    font-size: 56px;
    text-align: center;
    margin: 0;
}

/* 图片缩略图样式 */
.file-thumbnail {
    width: 100%;
    height: 120px;
    margin: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.file-item.image-file:hover .file-thumbnail img {
    transform: scale(1.05);
}

.file-item.image-file {
    cursor: pointer;
}

.file-name {
    font-weight: 500;
    margin-bottom: 5px;
    word-break: break-all;
    font-size: 14px;
}

.file-info {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.file-actions {
    margin-top: 10px;
    display: flex;
    gap: 5px;
    justify-content: center;
    position: relative;
}

.file-actions button {
    flex: 1;
    padding: 6px;
    font-size: 12px;
}

/* 文件菜单样式 */
.file-menu {
    position: relative;
    width: 100%;
}

.btn-menu-toggle {
    background: #6c757d;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 0;
    margin: 0 auto;
}

.btn-menu-toggle:hover {
    background: #5a6268;
    transform: scale(1.1);
}

.btn-menu-toggle:active {
    transform: scale(0.95);
}

.file-menu-dropdown {
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 100;
    overflow: hidden;
    animation: slideDown 0.2s;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.menu-item {
    display: block;
    width: 100%;
    padding: 10px 15px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: #f8f9fa;
}

.menu-item-danger {
    color: #dc3545;
}

.menu-item-danger:hover {
    background: #fee;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* 图片预览 */
.image-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    margin-top: 10px;
}


/* 移动端响应式设计 */
@media (max-width: 768px) {
    /* 登录页面移动端优化 */
    .login-box {
        padding: 30px 20px;
        margin: 20px;
    }

    .login-box h1 {
        font-size: 24px;
    }

    .form-group input {
        padding: 14px;
        font-size: 16px; /* 防止 iOS 自动缩放 */
    }

    .btn {
        padding: 14px 24px;
        font-size: 16px;
        min-height: 44px; /* 触摸友好 */
    }

    /* 主页面移动端优化 */
    .container {
        padding: 10px;
    }

    .header {
        /* flex-direction: column; */
        align-items: center;
        gap: 15px;
        padding: 12px 15px;
    }

    .header h1 {
        font-size: 20px;
    }

    .main-content {
        padding-top: 70px; /* 移动端 header 高度较小 */
    }

    .user-info {
        width: auto;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
    }

    .user-avatar #usernameInitial {
        font-size: 14px;
    }

    .user-dropdown {
        min-width: 160px;
        right: 0;
    }

    .dropdown-header {
        padding: 10px 14px;
        font-size: 14px;
    }

    .dropdown-item {
        padding: 10px 14px;
        font-size: 13px;
    }

    .permissions {
        font-size: 11px;
        padding: 3px 6px;
    }

    .btn-secondary {
        min-height: 44px;
        padding: 10px 20px;
    }

    .content-header {
        margin-bottom: 10px;
        /* flex-direction: column;
        align-items: flex-start; */
    }

    .action-buttons {
        padding: 15px;
    }

    .action-buttons-box {
        gap: 10px;
        justify-content: space-between;
        align-items: center;
    }

    .action-buttons .btn {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .content-area {
        padding: 15px;
    }

    .modal-content {
        max-width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body {
        padding: 15px;
    }

    /* 上传区域移动端优化 */
    .upload-dropzone {
        padding: 30px 20px;
        min-height: 120px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .upload-dropzone p {
        font-size: 14px;
    }

    .upload-hint {
        font-size: 11px;
        margin-top: 5px;
    }

    .selected-files-list {
        max-height: 200px;
        padding: 10px;
    }

    .selected-file-item {
        padding: 8px;
    }

    .selected-file-thumbnail {
        width: 40px;
        height: 40px;
    }

    .selected-file-name {
        font-size: 12px;
    }

    .selected-file-size {
        font-size: 10px;
    }

    .btn-remove-file {
        width: 22px;
        height: 22px;
        font-size: 18px;
    }

    .input-text {
        padding: 12px;
        font-size: 16px; /* 防止 iOS 自动缩放 */
        min-height: 44px;
    }

    /* 文件列表移动端优化 */
    .file-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .file-item {
        padding: 12px;
        touch-action: manipulation; /* 优化触摸响应 */
    }

    .file-icon {
        font-size: 40px;
    }

    .file-thumbnail {
        height: 120px;
    }

    .file-checkbox {
        top: 8px;
        left: 8px;
    }

    .file-select-checkbox {
        width: 24px;
        height: 24px;
    }

    .file-info-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
        top: 8px;
        right: 8px;
    }



    .batch-toolbar {
        flex-direction: column;
        gap: 10px;
        flex:none;
    }

    .batch-info {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 15px;
        width: 100%;
    }

    .batch-actions {
        display: flex;
        flex-direction: row;
        gap: 10px;
        width: 100%;
        flex-wrap: wrap;
    }

    .batch-actions .btn {
        width: auto;
        flex: 1;
        min-width: 0;
    }

    .file-name {
        font-size: 14px;
    }

    .file-info {
        font-size: 11px;
    }

    .file-actions {
        margin-top: 12px;
        gap: 8px;
    }

    .file-actions button {
        padding: 10px;
        font-size: 14px;
        min-height: 44px;
        flex: 1;
    }

    .btn-menu-toggle {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .file-menu-dropdown {
        min-width: 140px;
        font-size: 13px;
    }

    .menu-item {
        padding: 12px 15px;
        font-size: 13px;
    }

    /* 面包屑导航移动端优化 */
    .breadcrumb {
        font-size: 14px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .breadcrumb span {
        display: inline-block;
        padding: 4px 8px;
        min-height: 32px;
        line-height: 24px;
    }

    /* 创建目录移动端优化 */
    .create-directory {
        gap: 12px;
    }

    .create-directory .btn {
        width: 100%;
        min-height: 44px;
    }

    /* 上传按钮移动端优化 */
    #uploadBtn {
        width: 100%;
        min-height: 44px;
    }

    /* 图片预览移动端优化 */
    .image-preview {
        max-height: 70vh;
    }
}

/* 小屏幕手机优化 */
@media (max-width: 480px) {
    .login-box {
        padding: 25px 15px;
    }

    .container {
        padding: 8px;
    }

    .header {
        padding: 12px;
    }

    .header h1 {
        font-size: 18px;
    }

    .content-area {
        padding: 12px;
    }

    .upload-dropzone {
        padding: 25px 15px;
        min-height: 100px;
    }

    .file-item {
        padding: 10px;
    }

    .file-icon {
        font-size: 36px;
    }

    .file-thumbnail {
        height: 100px;
    }

    .file-actions button {
        padding: 8px;
        font-size: 13px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        opacity: 1;
    }

    .btn:active {
        opacity: 0.8;
        transform: scale(0.98);
    }

    .file-item:hover {
        border-color: #e9ecef;
        box-shadow: none;
    }

    .file-item:active {
        border-color: #667eea;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
        transform: scale(0.98);
    }

    .upload-dropzone:hover {
        border-color: #ddd;
        background: transparent;
    }

    .upload-dropzone:active {
        border-color: #667eea;
        background: #f0f4ff;
    }

    /* 移动端输入框优化 */
    input[type="text"],
    input[type="password"],
    input[type="file"] {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }

    /* 禁用文本选择（按钮） */
    .btn {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .file-item {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
    }
}

/* 防止移动端双击缩放 */
* {
    touch-action: manipulation;
}

/* 移动端滚动优化 */
@media (max-width: 768px) {
    body {
        -webkit-overflow-scrolling: touch;
    }

    .file-list {
        -webkit-overflow-scrolling: touch;
    }
}

    /* 横屏优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .login-container {
        padding: 20px;
    }

    .login-box {
        max-width: 500px;
    }

    .content-header {
        flex-direction: row;
        align-items: center;
    }

    .action-buttons {
        flex-direction: row;
        width: auto;
    }

    .action-buttons .btn {
        width: auto;
    }
}

/* 自定义弹窗样式 */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.custom-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.custom-modal-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.custom-modal-header {
    padding: 20px 20px 15px;
    border-bottom: 1px solid #e9ecef;
}

.custom-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.custom-modal-body {
    padding: 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.custom-modal-body p {
    margin: 0;
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    word-break: break-word;
}

.custom-modal-footer {
    padding: 15px 20px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #e9ecef;
}

.custom-modal-footer .btn {
    min-width: 80px;
    padding: 10px 20px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .custom-modal-content {
        width: 85%;
        max-width: 350px;
    }

    .custom-modal-header {
        padding: 18px 18px 12px;
    }

    .custom-modal-header h3 {
        font-size: 16px;
    }

    .custom-modal-body {
        padding: 18px;
        min-height: 50px;
    }

    .custom-modal-body p {
        font-size: 14px;
    }

    .custom-modal-footer {
        padding: 12px 18px 18px;
        flex-direction: column-reverse;
    }

    .custom-modal-footer .btn {
        width: 100%;
        min-width: auto;
    }
}

