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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

h1 {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 28px;
    font-weight: 600;
}

.controls {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background: #f8f9fa;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.control-group input,
.control-group select {
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

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

.control-group input[type="range"] {
    padding: 5px;
}

#fontSizeValue {
    text-align: center;
    font-weight: 600;
    color: #667eea;
    margin-top: 5px;
}

button {
    grid-column: 1 / -1;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

button:active {
    transform: translateY(0);
}

/* 文本控制行样式 */
.text-controls-row {
    grid-column: 1 / -1;
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

/* 文本控制组样式 */
.text-control-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    flex: 1;
    min-width: 0;
}

.text-control-group h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 16px;
    text-align: center;
}

.canvas-container {
    padding: 30px;
    text-align: center;
    background: white;
}

.canvas-wrapper {
    position: relative;
    display: inline-block;
    margin: 0 auto;
}

#imageCanvas {
    border: 3px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    max-width: 100%;
    height: auto;
}

/* 可拖放文本框样式 */
.draggable-text {
    position: absolute;
    cursor: move;
    user-select: none;
    border: 2px dashed transparent;
    border-radius: 4px;
    padding: 4px 8px;
    min-width: 50px;
    min-height: 20px;
    transition: border-color 0.2s ease;
}

.draggable-text:hover {
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

.draggable-text.dragging {
    border-color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.1);
    z-index: 1000;
}

.draggable-text .text-content {
    display: inline-block;
    font-weight: bold;
    pointer-events: none;
    white-space: nowrap;
}

.status {
    padding: 15px 30px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border-top: 1px solid #c3e6cb;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border-top: 1px solid #f5c6cb;
}

.status.info {
    background: #d1ecf1;
    color: #0c5460;
    border-top: 1px solid #bee5eb;
}

@media (max-width: 1080px) {
    .controls {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .text-controls-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .text-control-group {
        margin-bottom: 10px;
    }
    
    .canvas-container {
        padding: 20px;
    }
    
    h1 {
        font-size: 24px;
        padding: 20px;
    }
}