body {
    margin: 0;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fa;
    color: #222;
    box-sizing: border-box;
}

.main {
    margin: 0 auto;
    max-width: 600px;
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

h1 {
    text-align: center;
    font-size: 20px;
    margin: 0;
    font-weight: 600;
}

.type-select {
    display: flex;
    gap: 10px;
    margin: 10vh 0 20px;
}

.type-select button {
    flex: 1;
    padding: 12px;
    font-size: 17px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: #e9edf2;
    color: #333;
    cursor: pointer;
}

.form-item {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 10px;
}

#qrcode {
    margin: 20px auto;
    width: 220px;
    height: 220px;
}

.form-item input,
.form-item select {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 17px;
    border: 1px solid #d5dbe1;
    border-radius: 10px;
    background: #ffffff;
    outline: none;
}

.form-item label {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
}

.password-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.password-row input {
    flex: 1;
}

#toggle-password {
    flex: none;
    padding: 6px 10px;
    font-size: 14px;
}

#generate-button {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    font-size: 17px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: #333;
    color: #fff;
    cursor: pointer;
}

#save-button {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 10px auto 0;
    padding: 12px 18px;
    font-size: 17px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: #e9edf2;
    color: #333;
    cursor: pointer;
}

.type-select button:active {
    transform: scale(0.85);
}

#save-button:active,
#generate-button:active,
#toggle-password:active {
    transform: scale(0.85);
}

.type-select button.active {
    background: #7ab7e9;
    color: #fff;
}

.qr-title {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}