:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --light-bg: #f8f9fc;
    --border-color: #e3e6f0;
    --success-color: #4cc9f0;
    --warning-color: #f8961e;
}

body {
    /*background: linear-gradient(135deg, #f5f7fa 0%, #e4e7f1 100%);*/
    /*font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;*/
    min-height: 100vh;
    padding-bottom: 2rem;
}

.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2.5rem 0;
    margin-bottom: 2.5rem;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
}

.card {
    border-radius: 15px;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.08);
    border: none;
    margin-bottom: 1.8rem;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    background-color: rgba(255, 255, 255, 0.95);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(to right, var(--light-bg), white);
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    padding: 1.2rem 1.5rem;
    border-radius: 15px 15px 0 0 !important;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.4);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.2);
}

.preview-container {
    min-height: 480px;
    border: 2px dashed #d1d9ff;
    border-radius: 15px;
    background: linear-gradient(145deg, #f0f2ff, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.preview-container.drag-over {
    background: linear-gradient(145deg, #e6e9ff, #f8f9ff);
    border-color: var(--primary-color);
    box-shadow: inset 0 0 20px rgba(67, 97, 238, 0.1);
}

.grid-container {
    width: 100%;
    height: 100%;
    display: grid;
    position: absolute;
    top: 0;
    left: 0;
}

.grid-item {
    border: 1px solid rgba(255, 255, 255, 0.9);
    background-size: 100% 100%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.grid-item:hover {
    transform: scale(0.97);
    z-index: 20;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.grid-item.active {
    transform: scale(0.95);
    box-shadow: 0 0 0 3px var(--warning-color);
    z-index: 30;
}

.grid-number {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
}

.mode-btn {
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: white;
    border: 2px solid #e2e5f1;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.mode-btn:hover:not(.active) {
    background: #f5f7ff;
    border-color: var(--primary-color);
}

.custom-controls {
    background: linear-gradient(145deg, #f8f9ff, #f0f3ff);
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid #e2e5f1;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.03);
}

.slider-value {
    min-width: 45px;
    text-align: center;
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.placeholder-text {
    color: #6c757d;
    font-size: 1.2rem;
    text-align: center;
    padding: 2rem;
    max-width: 80%;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.footer {
    text-align: center;
    padding: 1.5rem 0;
    color: #6c757d;
    font-size: 0.95rem;
}

.drag-text {
    color: var(--primary-color);
    font-weight: 600;
}

.grid-size-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    max-width: 350px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.8rem;
    margin-right: 15px;
    color: var(--primary-color);
}

.toast-content h6 {
    margin-bottom: 3px;
    font-weight: 600;
}

.toast-content p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 2000;
    display: none;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.4s ease;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .preview-container {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .preview-container {
        min-height: 350px;
    }

    .mode-btn {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .header {
        padding: 1.8rem 0;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* 上传区域样式 */
.upload-area {
    border: 2px dashed #d1d9ff;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: rgba(245, 247, 255, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover, .upload-area.drag-over {
    background: rgba(231, 235, 255, 0.7);
    border-color: var(--primary-color);
}

.upload-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
}
