/* image-watermark.html 私有样式 */
.container {
    max-width: 1400px;
}

/* ---- 水印位置3列网格 ---- */
.pos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* ---- 上传区 ---- */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #eef2ff;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-text {
    color: #6b7280;
    font-size: 14px;
}

.upload-text strong {
    color: #667eea;
}

/* ---- 缩略图网格 ---- */
.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 8px 0;
    max-height: 600px;
    overflow-y: auto;
}

.thumb-item {
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    aspect-ratio: 1;
}

.thumb-item:hover {
    border-color: #667eea;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 10px;
    padding: 2px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thumb-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.thumb-item:hover .thumb-del {
    opacity: 1;
}

.thumb-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(22, 163, 74, 0.9);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ---- 弹窗预览 ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 10px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    color: #374151;
    gap: 12px;
}

.modal-header span:first-child {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.modal-nav .btn {
    padding: 4px 10px;
    font-size: 12px;
}

.modal-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.modal-close:hover {
    background: #e5e7eb;
}

.modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: auto;
    background: #f9fafb;
}

.modal-body img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    border-radius: 4px;
}

.modal-footer {
    display: flex;
    justify-content: center;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
}

/* ---- 颜色/透明度 ---- */
.color-row {
    display: flex;
    gap: 10px;
}

.color-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background: #fff;
}

.color-item:hover {
    border-color: #667eea;
}

.color-item input[type="color"] {
    width: 30px;
    height: 26px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0;
    background: none;
    cursor: pointer;
}

.opacity-slider {
    display: flex;
    align-items: center;
    gap: 10px;
}

.opacity-slider input[type="range"] {
    flex: 1;
    accent-color: #667eea;
}

.opacity-slider .opacity-val {
    font-size: 13px;
    color: #374151;
    font-weight: 600;
    min-width: 36px;
    text-align: right;
}

/* ---- 说明区 ---- */
.info-section {
    max-width: 1200px;
    margin: 20px auto;
    padding: 24px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.info-section h3 {
    margin: 0 0 16px;
    color: #374151;
    font-size: 18px;
}

.info-section p {
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 12px;
}

.info-content {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.info-item {
    padding: 12px 16px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    color: #4b5563;
    line-height: 1.6;
}

.info-item strong {
    color: #374151;
}

@media (max-width: 900px) {
    .main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .color-row {
        flex-direction: column;
    }
    .info-section {
        padding: 16px;
    }
    .thumb-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}
