/* 二维码生成工具样式 */
.content-section {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.url-shortener {
    margin-bottom: 20px;
    padding: 12px;
    background: var(--secondary-bg);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.url-shortener label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.url-shortener input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.option-group {
    display: flex;
    flex-direction: column;
}

.option-group label {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.option-group select,
.option-group input[type="color"] {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.option-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.option-group input[type="color"] {
    height: 40px;
    padding: 4px;
    cursor: pointer;
}

.option-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.option-group input[type="color"]::-webkit-color-swatch {
    border: 2px solid var(--border-color);
    border-radius: 4px;
}

.image-options {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.image-options h3 {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.options-row:last-child {
    margin-bottom: 0;
}

.options-row .option-group {
    flex: 1;
    min-width: 150px;
}

.option-group input[type="range"] {
    width: 100%;
    margin: 8px 0;
}

.option-group input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.option-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.logo-size-display {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary {
    flex: 1;
    min-width: 150px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    min-width: 120px;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--button-bg);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(52, 152, 219, 0.05);
}

.btn-secondary:disabled,
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.preview-section {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.preview-container {
    max-width: 350px;
    width: 100%;
    text-align: center;
}

.qrcode-preview {
    position: relative;
    width: 256px;
    height: 256px;
    margin: 0 auto 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    opacity: 0.6;
}

.placeholder svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.placeholder p {
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
}

#qrcodeCanvas {
    max-width: 100%;
    max-height: 100%;
    display: none;
}

.file-format {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 15px;
    background: var(--secondary-bg);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.file-format label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.format-options {
    display: flex;
    gap: 15px;
}

.format-options label {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: normal;
    color: var(--text-primary);
    cursor: pointer;
}

.format-options input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
}

.info-section {
    margin-top: 20px;
}

.info-section h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.info-section h3:first-child {
    margin-top: 0;
}

.info-section ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.info-section li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-section li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .options-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    
    .qrcode-preview {
        width: 200px;
        height: 200px;
        padding: 15px;
    }
    
    .placeholder svg {
        width: 60px;
        height: 60px;
    }
    
    .file-format {
        flex-direction: column;
        gap: 10px;
    }
    
    .format-options {
        justify-content: center;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.qrcode-preview {
    animation: fadeIn 0.3s ease;
}

/* 加载状态 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 20px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 二维码生成成功动画 */
@keyframes successPulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.qrcode-preview.success {
    animation: successPulse 1s ease;
    border: 2px solid #2ecc71;
}

/* 悬停效果 */
.qrcode-preview:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* 打印友好样式 */
@media print {
    .tool-nav,
    .btn-group,
    .file-format,
    .image-options,
    .url-shortener,
    .info-section {
        display: none;
    }
    
    .qrcode-preview {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}