/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    padding-top: 100px;
    position: relative;
}

.container {
    width: 100%;
    max-width: 560px;
}

.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px 30px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    text-align: center;
    color: #333;
    font-size: 28px;
    margin-bottom: 12px;
    font-weight: 600;
}

.privacy-tip {
    text-align: center;
    color: #059669;
    font-size: 13px;
    margin-bottom: 24px;
    padding: 8px 12px;
    background: #ecfdf5;
    border-radius: 8px;
    border: 1px solid #a7f3d0;
}

.option-group {
    margin-bottom: 18px;
}

.option-label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 15px;
}

#contentInput {
    width: 100%;
    min-height: 100px;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

#contentInput:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.quick-btn {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-btn:hover {
    border-color: #10b981;
    color: #059669;
    background: #ecfdf5;
}

.options-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.length-value {
    color: #10b981;
    font-weight: 700;
    font-size: 16px;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    border: none;
}

#ecLevelSelect {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

#ecLevelSelect:focus {
    outline: none;
    border-color: #10b981;
}

.color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-row input[type="color"] {
    width: 44px;
    height: 36px;
    border: none;
    padding: 0;
    background: none;
    cursor: pointer;
}

.color-row span {
    font-size: 13px;
    color: #666;
}

.qr-preview-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 24px 0 20px;
    padding: 20px;
    background: #f9fafb;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    min-height: 280px;
    justify-content: center;
}

#qrCodeContainer {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

#qrCodeContainer img,
#qrCodeContainer canvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.qr-placeholder {
    color: #9ca3af;
    font-size: 14px;
    text-align: center;
    line-height: 1.6;
}

.error-msg {
    color: #ef4444;
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
    display: none;
}

.error-msg.show {
    display: block;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.generate-btn {
    flex: 1;
    min-width: 140px;
    padding: 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.55);
}

.secondary-btn {
    flex: 1;
    min-width: 120px;
    padding: 16px;
    background: #fff;
    color: #059669;
    border: 2px solid #10b981;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover:not(:disabled) {
    background: #ecfdf5;
}

.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    body {
        padding-top: 90px;
    }

    .card {
        padding: 28px 18px;
    }

    h1 {
        font-size: 24px;
    }

    .options-row {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .generate-btn,
    .secondary-btn {
        width: 100%;
    }
}

@media (max-width: 400px) {
    body {
        padding-top: 85px;
    }
}
