* {
    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;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.main-content {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.input-section {
    flex: 1;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.canvas-section {
    flex: 1;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

h2 {
    color: #4a4a4a;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

h3 {
    color: #666;
    margin: 20px 0 15px 0;
    font-size: 1.2em;
}

small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 12px;
    font-style: italic;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.style-options {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.option-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-group label {
    min-width: 80px;
    font-weight: bold;
    color: #555;
}

.option-group select,
.option-group input[type="text"] {
    flex: 1;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.option-group input[type="range"] {
    flex: 1;
    margin: 0 10px;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
}

.option-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: background 0.3s;
}

.option-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #5a6fd8;
}

.option-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.option-group span {
    min-width: 50px;
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

.option-group input[type="checkbox"] {
    width: auto;
    transform: scale(1.2);
    margin-right: 10px;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#generateBtn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

#generateBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

#clearBtn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
}

#clearBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

#downloadBtn {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
}

#downloadBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(78, 205, 196, 0.4);
}

.canvas-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#signatureCanvas {
    border: 3px solid #ddd;
    border-radius: 10px;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.canvas-info {
    text-align: center;
    color: #666;
}

.size-controls {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.size-controls button {
    flex: none;
    padding: 8px 15px;
    font-size: 14px;
    background: #f8f9fa;
    color: #666;
    border: 2px solid #ddd;
}

.size-controls button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.custom-size-controls {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.custom-size-controls h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 14px;
    text-align: center;
}

.size-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.size-input-group label {
    min-width: 50px;
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

.size-input-group input[type="number"] {
    flex: 1;
    padding: 6px 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    max-width: 80px;
}

.size-input-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.size-input-group span {
    font-size: 12px;
    color: #666;
    min-width: 20px;
}

#applyCustomSize {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

#applyCustomSize:hover {
    background: #5a6fd8;
    transform: none;
    box-shadow: none;
}

.test-section {
    margin-top: 25px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
}

.test-section h4 {
    margin: 0 0 10px 0;
    color: #856404;
    font-size: 14px;
}

.test-section button {
    width: 100%;
    padding: 8px 15px;
    background: #ffc107;
    color: #212529;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 8px;
}

.test-section button:last-of-type {
    background: #17a2b8;
    color: white;
}

.test-section button:last-of-type:hover {
    background: #138496;
}

.test-section button:hover {
    background: #e0a800;
}

.test-section small {
    color: #856404;
    font-size: 11px;
    line-height: 1.4;
}

.usage-info {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: transform 0.3s, box-shadow 0.3s;
}

.info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.info-item h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
        margin-bottom: 20px;
    }
    
    .info-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    #signatureCanvas {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .size-controls {
        flex-direction: column;
        gap: 5px;
    }
    
    .option-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .option-group label {
        margin-bottom: 5px;
    }
    
    .option-group input[type="range"] {
        margin: 5px 0;
        width: 100%;
    }
    
    .custom-size-controls {
        margin-top: 15px;
    }
    
    .size-input-group {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 15px;
    }
    
    .size-input-group label {
        margin-bottom: 5px;
    }
    
    .size-input-group input[type="number"] {
        max-width: none;
        width: 100%;
    }
} 