* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

header {
    text-align: center;
    padding: 15px 0; /* 减小头部内边距 */
}

header h1 {
    font-size: 2.2rem; /* 稍微减小标题字号 */
    color: #2c3e50;
    margin-bottom: 5px; /* 减小底部边距 */
}

header p {
    font-size: 1rem; /* 减小副标题字号 */
    color: #7f8c8d;
    max-width: 800px;
    margin: 0 auto;
}

.main-app {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* 减小左右面板间距 */
}

.left-panel {
    flex: 1;
    min-width: 320px;
    background: white;
    border-radius: 12px; /* 稍微减小圆角 */
    padding: 20px; /* 减小内边距 */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.right-panel {
    flex: 2;
    min-width: 600px;
    background: white;
    border-radius: 12px; /* 稍微减小圆角 */
    padding: 20px; /* 减小内边距 */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.section-title {
    font-size: 1.2rem; /* 减小标题字号 */
    color: #3498db;
    margin-bottom: 15px; /* 减小底部边距 */
    padding-bottom: 8px; /* 减小底部内边距 */
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    font-size: 1.1rem;
}

.upload-area {
    border: 3px dashed #3498db;
    border-radius: 10px;
    padding: 25px 20px; /* 大幅减小内边距，降低高度 */
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8fafc;
    margin-bottom: 15px; /* 减小底部边距 */
}

.upload-area i {
    font-size: 2.5rem; /* 减小图标大小 */
    color: #3498db;
    margin-bottom: 10px; /* 减小底部边距 */
}

.upload-area h3 {
    font-size: 1.2rem; /* 减小标题字号 */
    margin-bottom: 5px; /* 减小底部边距 */
    color: #2c3e50;
}

.upload-area p {
    color: #7f8c8d;
    margin-bottom: 10px; /* 减小底部边距 */
    font-size: 0.9rem; /* 减小字号 */
}

#fileInput {
    display: none;
}

.upload-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 20px; /* 减小按钮尺寸 */
    border-radius: 6px;
    font-size: 0.9rem; /* 减小字号 */
    cursor: pointer;
    transition: background 0.3s;
    display: inline-block;
}

.upload-btn:hover {
    background: #2980b9;
}

.image-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); /* 减小缩略图尺寸 */
    gap: 8px; /* 减小间距 */
    margin-top: 10px; /* 减小上边距 */
    max-height: 250px; /* 减小最大高度 */
    overflow-y: auto;
    padding: 8px 5px; /* 减小内边距 */
    border: 1px solid #eee;
    border-radius: 6px;
}

.image-item {
    position: relative;
    border-radius: 6px; /* 减小圆角 */
    overflow: hidden;
    aspect-ratio: 1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* 减小阴影 */
    cursor: pointer;
    transition: transform 0.2s;
}

.image-item:hover {
    transform: scale(1.03); /* 减小悬停放大效果 */
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-item .remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    width: 18px; /* 减小尺寸 */
    height: 18px; /* 减小尺寸 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem; /* 减小字号 */
    cursor: pointer;
    z-index: 10;
}

.image-item .index {
    position: absolute;
    bottom: 3px;
    left: 3px;
    background: rgba(52, 152, 219, 0.8);
    color: white;
    width: 20px; /* 减小尺寸 */
    height: 20px; /* 减小尺寸 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem; /* 减小字号 */
    font-weight: bold;
}

.control-group {
    margin-bottom: 20px; /* 减小底部边距 */
}

.control-label {
    display: block;
    margin-bottom: 5px; /* 减小底部边距 */
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem; /* 减小字号 */
}

.control-row {
    display: flex;
    align-items: center;
    gap: 12px; /* 减小间距 */
    margin-bottom: 12px; /* 减小底部边距 */
}

/* 标准布局按钮 - 应用与分辨率按钮相同的高度 */
.layout-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px; /* 减小间距，与分辨率按钮一致 */
    margin-top: 5px;
}

.layout-btn {
    padding: 6px 5px; /* 减小内边距，与分辨率按钮一致 */
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s;
    font-size: 0.8rem; /* 减小字号，与分辨率按钮一致 */
    min-height: 32px; /* 设置最小高度，与分辨率按钮一致 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-btn:hover {
    background: #e9ecef;
}

.layout-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* 创意布局按钮 - 应用与分辨率按钮相同的高度 */
.special-layouts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px; /* 减小间距，与分辨率按钮一致 */
    margin-top: 10px; /* 减小上边距 */
}

.special-btn {
    padding: 6px 5px; /* 减小内边距，与分辨率按钮一致 */
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s;
    font-size: 0.8rem; /* 减小字号，与分辨率按钮一致 */
    min-height: 32px; /* 设置最小高度，与分辨率按钮一致 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.special-btn:hover {
    background: #e9ecef;
}

.special-btn.active {
    background: #3498db;  /* 按钮底色改为蓝色，和标准布局一致 */
    color: white;
    border-color: #3498db;
}

/* 画布比例按钮 - 应用与分辨率按钮相同的高度 */
.ratio-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px; /* 减小间距，与分辨率按钮一致 */
    margin-top: 5px;
}

.ratio-btn {
    padding: 6px 5px; /* 减小内边距，与分辨率按钮一致 */
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem; /* 减小字号，与分辨率按钮一致 */
    font-weight: 600;
    color: #495057;
    transition: all 0.2s;
    text-align: center;
    min-height: 32px; /* 设置最小高度，与分辨率按钮一致 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.ratio-btn:hover {
    background: #e9ecef;
}

.ratio-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* 分辨率按钮 - 保持原样，作为高度参考 */
.resolution-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}

.resolution-btn {
    padding: 6px 10px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s;
    flex: 1;
    min-width: 60px;
    text-align: center;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resolution-btn:hover {
    background: #e9ecef;
}

.resolution-btn.active {
    background: #9b59b6;
    color: white;
    border-color: #9b59b6;
}

.custom-layout {
    display: flex;
    align-items: center;
    gap: 8px; /* 减小间距 */
    margin-top: 10px; /* 减小上边距 */
}

.custom-layout input {
    width: 60px; /* 减小宽度 */
    padding: 8px; /* 减小内边距 */
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem; /* 减小字号 */
}

.custom-layout button {
    padding: 8px 12px; /* 减小内边距 */
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem; /* 减小字号 */
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px; /* 减小间距 */
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px; /* 减小高度 */
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; /* 减小尺寸 */
    height: 16px; /* 减小尺寸 */
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

.slider-value {
    min-width: 35px; /* 减小最小宽度 */
    text-align: center;
    font-weight: 600;
    color: #3498db;
    font-size: 0.9rem; /* 减小字号 */
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 10px; /* 减小间距 */
}

#backgroundColor {
    width: 40px; /* 减小宽度 */
    height: 30px; /* 减小高度 */
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
}

.format-buttons {
    display: flex;
    gap: 6px; /* 减小间距 */
}

.format-btn {
    padding: 6px 15px; /* 减小内边距 */
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 4px; /* 减小圆角 */
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s;
    font-size: 0.9rem; /* 减小字号 */
    min-height: 32px; /* 设置最小高度，与其他按钮一致 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.format-btn:hover {
    background: #e9ecef;
}

.format-btn.active {
    background: #9b59b6;
    color: white;
    border-color: #9b59b6;
}

.help-btn {
    background: transparent;
    border: none;
    color: #7f8c8d;
    font-size: 1.1rem; /* 减小图标大小 */
    cursor: pointer;
    padding: 3px;
    transition: color 0.2s;
}

.help-btn:hover {
    color: #3498db;
}

.preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 8px; /* 减小圆角 */
    padding: 15px; /* 减小内边距 */
    overflow: auto;
    min-height: 450px; /* 减小最小高度 */
    position: relative;
}

#puzzleCanvas {
    flex: 1;
    background: white;
    border-radius: 6px; /* 减小圆角 */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.grid-container {
    display: grid;
    gap: 0;
    width: 100%;
    height: 100%;
    position: relative;
}

.grid-item {
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    cursor: default;
    transition: transform 0.2s, box-shadow 0.2s;
}

.grid-item.dragging {
    z-index: 100;
    opacity: 0.8;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.grid-item.drag-over {
    background: #d4edda;
    border-color: #c3e6cb !important;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-item .img-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.empty-slot {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    color: #adb5bd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem; /* 减小图标大小 */
}

.grid-item .slot-number {
    position: absolute;
    top: 3px;
    left: 3px;
    background: rgba(0,0,0,0.5);
    color: white;
    width: 20px; /* 减小尺寸 */
    height: 20px; /* 减小尺寸 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem; /* 减小字号 */
    font-weight: bold;
    z-index: 5;
}

/* 右侧操作按钮 - 减小尺寸 */
.action-buttons {
    display: flex;
    gap: 10px; /* 减小间距 */
    margin-top: 15px; /* 减小上边距 */
}

.action-btn {
    flex: 1;
    padding: 10px 12px; /* 大幅减小内边距，降低高度 */
    border: none;
    border-radius: 6px; /* 减小圆角 */
    font-size: 0.95rem; /* 减小字号 */
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* 减小图标和文字间距 */
    transition: all 0.3s;
    min-height: 40px; /* 设置最小高度，比原来小 */
}

/* 清除排列按钮样式 */
.clear-arrange-btn {
    background: #e74c3c;          /* 红色背景 */
    color: white;                 /* 白色文字 */
    border: none;
    padding: 8px 15px;           /* 减小内边距 */
    border-radius: 6px;           /* 减小圆角 */
    font-size: 0.85rem;           /* 减小字号 */
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;         /* 改为inline-flex，不占满宽度 */
    align-items: center;
    justify-content: center;
    gap: 6px;                     /* 图标和文字间距 */
    transition: all 0.3s;
    margin-top: 8px;             /* 减小上边距 */
    width: auto;                  /* 自动宽度 */
    min-width: 140px;             /* 减小最小宽度 */
}

.clear-arrange-btn:hover {
    background: #c0392b;          /* 深红色hover */
    transform: translateY(-2px);  /* 上浮效果 */
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3); /* 红色阴影 */
}

.clear-arrange-btn:active {
    transform: translateY(0);     /* 点击时恢复 */
}

/* 如果想要按钮在控制面板中居中 */
.control-group .clear-arrange-btn {
    display: block;               /* 块级显示 */
    margin: 10px auto 0;          /* 减小上下边距，水平居中 */
    width: 70%;                   /* 减小宽度 */
    max-width: 180px;             /* 减小最大宽度 */
}

/* 响应式调整 */
@media (max-width: 768px) {
    .clear-arrange-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-width: 120px;
    }
}

.download-btn {
    background: #2ecc71;
    color: white;
}

.download-btn:hover {
    background: #27ae60;
}

.reset-btn {
    background: #e74c3c;
    color: white;
}

.reset-btn:hover {
    background: #c0392b;
}

.auto-fill-btn {
    background: #9b59b6;
    color: white;
}

.auto-fill-btn:hover {
    background: #8e44ad;
}

/* 右边预览窗无图时的提示内容 */
.empty-preview {
    display: flex;                    /* 使用flex布局 */
    flex-direction: column;           /* 垂直排列 */
    align-items: center;              /* 水平居中 */
    justify-content: center;          /* 垂直居中 */
    text-align: center;               /* 文字居中 */
    color: #adb5bd;
    width: 100%;
    height: 100%;
    position: absolute;               /* 绝对定位 */
    top: 0;
    left: 0;
}

/* 右边预览窗无图时的提示内容文字大小控制 */
.empty-preview h3 {
    font-size: 1.5rem;      /* 减小标题字号 */
    color: #e2e2e2;         /* 深色更醒目 */
    font-weight: 600;       /* 加粗 */
    margin-bottom: 15px;    /* 减小底部边距 */
}

.empty-preview p {
    font-size: 1rem;        /* 减小正文字号 */
    color: #d2d2d2;         /* 中灰色 */
    line-height: 1.6;       /* 调整行高 */
    margin-bottom: 8px;     /* 减小段落间距 */
    max-width: 450px;       /* 减小最大宽度 */
}

.empty-preview p:last-child {
    font-size: 0.9rem;      /* 减小小字提示字号 */
    color: #adb5bd;         /* 浅灰色 */
    margin-top: 10px;       /* 减小上边距 */
}

.empty-preview i {
    font-size: 3rem;        /* 减小图标大小 */
    margin-bottom: 15px;    /* 减小底部边距 */
    color: #dee2e6;
}

.image-count {
    margin-top: 8px;        /* 减小上边距 */
    font-size: 0.8rem;      /* 减小字号 */
    color: #7f8c8d;
    text-align: center;
}

footer {
    text-align: center;
    margin-top: 20px;       /* 减小上边距 */
    color: #7f8c8d;
    font-size: 0.85rem;     /* 减小字号 */
    padding-top: 15px;      /* 减小上内边距 */
    border-top: 1px solid #eee;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 550px; /* 减小最大宽度 */
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px; /* 减小内边距 */
    background: #3498db;
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem; /* 减小字号 */
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem; /* 减小图标大小 */
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.modal-close:hover {
    transform: scale(1.1);
}

.modal-body {
    padding: 20px; /* 减小内边距 */
    overflow-y: auto;
    max-height: calc(80vh - 130px);
}

.ratio-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px; /* 减小底部边距 */
}

.ratio-table th {
    background: #f8f9fa;
    padding: 8px 12px; /* 减小内边距 */
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    font-size: 0.9rem; /* 减小字号 */
}

.ratio-table td {
    padding: 8px 12px; /* 减小内边距 */
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem; /* 减小字号 */
}

.ratio-table tr:last-child td {
    border-bottom: none;
}

.ratio-table tr:hover td {
    background: #f8fafc;
}

.modal-tips {
    background: #e8f4fc;
    border-radius: 6px;
    padding: 15px; /* 减小内边距 */
    margin-top: 15px; /* 减小上边距 */
}

.modal-tips p {
    margin: 0 0 8px 0; /* 减小底部边距 */
    color: #2c3e50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem; /* 减小字号 */
}

.modal-tips ul {
    margin: 0;
    padding-left: 18px; /* 减小左内边距 */
    color: #495057;
    font-size: 0.9rem; /* 减小字号 */
}

.modal-tips li {
    margin-bottom: 4px; /* 减小底部边距 */
    line-height: 1.4;
}

.modal-tips li:last-child {
    margin-bottom: 0;
}

.modal-footer {
    padding: 15px 20px; /* 减小内边距 */
    text-align: right;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.modal-ok-btn {
    padding: 8px 20px; /* 减小内边距 */
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px; /* 减小圆角 */
    font-size: 0.95rem; /* 减小字号 */
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.modal-ok-btn:hover {
    background: #2980b9;
}

@media (max-width: 1100px) {
    .main-app {
        flex-direction: column;
    }
    
    .left-panel, .right-panel {
        min-width: 100%;
    }
    
    .ratio-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ratio-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .ratio-table {
        font-size: 0.8rem;
    }
    
    .ratio-table th,
    .ratio-table td {
        padding: 6px 8px;
    }
    
    .action-buttons {
        flex-wrap: wrap; /* 小屏幕时允许换行 */
    }
    
    .action-btn {
        min-width: 120px; /* 设置最小宽度 */
    }
}

.tooltip {
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px; /* 减小内边距 */
    border-radius: 3px; /* 减小圆角 */
    font-size: 0.75rem; /* 减小字号 */
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
}


/* 新拖拽图片方案 */

/* 格子选中状态 */
.grid-item.selected {
    border-color: #3498db !important;
    border-width: 3px !important;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5); /* 减小阴影 */
    z-index: 5;
}

/* 图片列表选中状态 */
.image-item.selected {
    border: 2px solid #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.5); /* 减小阴影 */
}

/* 操作提示 */
.tooltip-hint {
    position: absolute;
    top: 8px; /* 调整位置 */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 6px 12px; /* 减小内边距 */
    border-radius: 15px; /* 减小圆角 */
    font-size: 0.8rem; /* 减小字号 */
    z-index: 100;
    white-space: nowrap;
    animation: fadeInOut 3s ease-in-out;
    display: none;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

/* 多选提示 */
.multi-select-info {
    position: fixed;
    bottom: 15px; /* 调整位置 */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(46, 204, 113, 0.9);
    color: white;
    padding: 8px 15px; /* 减小内边距 */
    border-radius: 20px; /* 减小圆角 */
    font-size: 0.85rem; /* 减小字号 */
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px; /* 减小间距 */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: none;
}

.multi-select-info .close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.1rem; /* 减小图标大小 */
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 键盘快捷键提示 */
.keyboard-hint {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 1px 4px; /* 减小内边距 */
    border-radius: 2px; /* 减小圆角 */
    font-size: 0.6rem; /* 减小字号 */
    opacity: 0;
    transition: opacity 0.2s;
}

.grid-item:hover .keyboard-hint {
    opacity: 1;
}

/* 左侧缩略图已用和未用的标记 */

/* 图片列表状态样式 */
/* 未使用图片：绿色边框，表示可用状态 */
.image-item.unused {
    border: 2px solid #2ecc71 !important;  /* 绿色边框，强调可用 */
    position: relative;  /* 为子元素（标记、提示）提供定位参考 */
}

/* 已使用图片：灰色半透明边框，表示已被占用 */
.image-item.used {
    opacity: 0.5;  /* 50%透明度，视觉上变灰表示"不可用" */
    border: 2px solid #95a5a6 !important;  /* 灰色边框 */
    position: relative;
}

/* 被选中格子使用的图片：蓝色高亮，表示与当前选中格子关联 */
.image-item.used-in-selected {
    opacity: 1;  /* 完全不透明，突出显示 */
    border: 2px solid #3498db !important;  /* 蓝色边框，表示激活状态 */
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.5);  /* 减小发光效果 */
    position: relative;
}

/* 使用标记 - 右上角的小圆形标记 */
.use-mark {
    position: absolute;  /* 相对于父元素.image-item定位 */
    top: 2px;  /* 减小距离顶部 */
    right: 2px;  /* 减小距离右侧 */
    background: rgba(52, 152, 219, 0.9);  /* 蓝色半透明背景 */
    color: white;  /* 白色文字 */
    width: 18px;  /* 减小尺寸 */
    height: 18px;  /* 减小尺寸，形成圆形 */
    border-radius: 50%;  /* 圆形边框 */
    display: flex;  /* 弹性布局，用于居中内容 */
    align-items: center;  /* 垂直居中 */
    justify-content: center;  /* 水平居中 */
    font-size: 0.6rem;  /* 减小字号 */
    font-weight: bold;  /* 粗体字 */
    z-index: 20;  /* 层级高于图片 */
}

/* 多位置使用标记：紫色背景，表示图片在多个位置使用 */
.use-mark.multiple {
    background: rgba(155, 89, 182, 0.9);  /* 紫色背景，区分单次使用 */
    font-size: 0.55rem;  /* 减小字号，适应"×2"这样的内容 */
}

/* 状态提示 - 鼠标悬停时显示的提示框 */
.status-tooltip {
    position: absolute;  /* 绝对定位 */
    top: -25px;  /* 调整位置，更靠近图片 */
    left: 50%;  /* 水平居中起点 */
    transform: translateX(-50%);  /* 向左平移50%自身宽度，实现真正居中 */
    background: rgba(0, 0, 0, 0.8);  /* 黑色半透明背景 */
    color: white;  /* 白色文字 */
    padding: 4px 8px;  /* 减小内边距 */
    border-radius: 3px;  /* 减小圆角 */
    font-size: 0.7rem;  /* 减小字号 */
    white-space: nowrap;  /* 不换行，保持单行显示 */
    opacity: 0;  /* 默认完全透明（隐藏） */
    transition: opacity 0.2s;  /* 透明度变化有0.2秒过渡动画 */
    pointer-events: none;  /* 不响应鼠标事件，避免干扰 */
    z-index: 100;  /* 最高层级，确保显示在最前面 */
}

/* 鼠标悬停在图片上时，显示提示框 */
.image-item:hover .status-tooltip {
    opacity: 1;  /* 完全不透明（显示） */
}

/* 未用图片的悬停效果：放大突出显示，暗示可点击 */
.image-item.unused:hover {
    transform: scale(1.05);  /* 减小放大效果 */
    transition: transform 0.2s;  /* 缩放动画0.2秒 */
    z-index: 10;  /* 提高层级，避免被其他元素遮挡 */
}



/* 页面图片流畅优化  只添加以下新样式，保持原有所有样式不变 */

/* 图片加载状态 - 最小化修改 */
.image-item.loading {
    opacity: 0.7;
    background: #f8f9fa;
}

.image-item.loading::after {
    content: '...';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.5rem; /* 减小字号 */
    color: #3498db;
}

/* 文件大小提示 - 小而不显眼 */
.size-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.5rem; /* 减小字号 */
    padding: 1px 2px; /* 减小内边距 */
    border-radius: 2px;
    z-index: 5;
}

/* 导出加载提示 - 保持原有模态框样式 */
.export-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8); /*生成高质量图片遮罩提示白色半透明80% */
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    flex-direction: column;
    gap: 10px; /* 减小间距 */
}

.export-loading.show {
    display: flex;
}

.export-spinner {
    width: 35px; /* 减小尺寸 */
    height: 35px; /* 减小尺寸 */
    border: 3px solid #f3f3f3; /* 减小边框 */
    border-top: 3px solid #3498db; /* 减小边框 */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.export-text {
    font-size: 1.2rem; /* 减小字号 */
    color: #2c3e50;
}

/* 分享链接区域样式 */
#shareSection {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#shareLink {
    background: #fff;
    cursor: text;
}

#copyLinkBtn {
    transition: all 0.3s;
}

#copyLinkBtn:active {
    transform: scale(0.95);
}