*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body.pref-email-page {
    font-family: "HarmonyOS Sans SC Light";
    background: #f4f6f8;
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

.pref-email-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 48px 20px 64px;
}

.pref-email-card {
    width: 100%;
    max-width: 640px;
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 4px;
    padding: 40px 44px 48px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.pref-email-logo {
    text-align: center;
    margin-bottom: 28px;
}

.pref-email-logo a {
    display: inline-block;
    line-height: 0;
}

.pref-email-logo img {
    max-width: 220px;
    width: 100%;
    height: auto;
    vertical-align: middle;
}

.pref-email-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px;
    text-align: center;
    color: #111;
    letter-spacing: -0.02em;
}

.pref-email-sub {
    font-size: 15px;
    color: #555;
    text-align: center;
    margin: 0 0 36px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.pref-email-form {
    text-align: left;
}

.pref-email-section {
    margin-bottom: 28px;
}

.pref-email-section-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #333;
    margin-bottom: 12px;
}

.pref-email-hint {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px;
}

.pref-email-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 16px;
}

.pref-email-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 15px;
    color: #222;
    cursor: pointer;
    line-height: 1.35;
}

.pref-email-check input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    flex-shrink: 0;
    accent-color: #0b2434;
}

.pref-email-days {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.pref-email-field {
    margin-bottom: 20px;
}

.pref-email-field label.pref-email-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #333;
    margin-bottom: 8px;
}

.pref-email-readonly {
    width: 100%;
    max-width: 100%;
    padding: 11px 12px;
    font-size: 15px;
    border: 1px solid #c5ccd3;
    border-radius: 2px;
    background: #f4f6f8;
    color: #111;
    word-break: break-all;
    min-height: 2.75rem;
    line-height: 1.45;
}

.pref-email-readonly.pref-email-readonly--empty {
    color: #666;
}

.pref-email-field input[type="email"],
.pref-email-field select {
    width: 100%;
    max-width: 100%;
    padding: 11px 12px;
    font-size: 15px;
    border: 1px solid #c5ccd3;
    border-radius: 2px;
    background: #fff;
    color: #111;
}

.pref-email-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.pref-email-field input:focus,
.pref-email-field select:focus {
    outline: 2px solid #0b2434;
    outline-offset: 1px;
    border-color: #0b2434;
}

.pref-email-msg {
    min-height: 1.25rem;
    font-size: 14px;
    color: #b00020;
    margin-bottom: 12px;
}

.pref-email-msg--ok {
    color: #1b5e20;
}

.pref-email-actions {
    margin-top: 28px;
    text-align: center;
}

.pref-email-submit {
    display: inline-block;
    min-width: 160px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #0b2434;
    border: 1px solid #0b2434;
    border-radius: 2px;
    cursor: pointer;
    letter-spacing: 0.04em;
}

.pref-email-submit:hover {
    background: #153a52;
    border-color: #153a52;
}

.pref-email-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pref-email-foot {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #e8ecef;
    font-size: 14px;
    color: #777;
    text-align: center;
    line-height: 1.6;
}

.pref-email-foot a {
    color: #0b2434;
    text-decoration: underline;
}

.pref-email-foot a:hover {
    color: #153a52;
}

/* 未登录提示（与意见反馈页 guest 区类似） */
.pref-email-guest {
    text-align: center;
    padding: 8px 0 24px;
}

.pref-email-guest p {
    margin: 0 0 16px;
    font-size: 15px;
    color: #444;
    line-height: 1.6;
}

.pref-email-login-btn {
    display: inline-block;
    min-width: 160px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #0b2434;
    border: 1px solid #0b2434;
    border-radius: 2px;
    text-decoration: none;
    letter-spacing: 0.04em;
}

.pref-email-login-btn:hover {
    background: #153a52;
    border-color: #153a52;
    color: #fff;
}

.pref-email-guest-link {
    display: inline-block;
    margin-top: 20px;
    font-size: 14px;
    color: #0b2434;
}

.pref-email-guest-link:hover {
    color: #153a52;
}

.pref-email-loading {
    font-size: 14px;
    color: #666;
    padding: 8px 0;
}

.pref-email-skeleton {
    min-height: 120px;
    background: linear-gradient(90deg, #f0f2f4 25%, #e8eaed 50%, #f0f2f4 75%);
    background-size: 200% 100%;
    animation: pref-shimmer 1.2s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes pref-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 五档：Phone≤767 | Small 768–1024 | Mid 1025–1439 | Large 1440–1679 | XLarge≥1680 */

@media screen and (max-width: 1679px) {
    .pref-email-title {
        font-size: max(var(--kyd-text-sm-min, 14px), calc(24px * var(--kyd-text-scale, 1)));
    }
    .pref-email-sub,
    .pref-email-check,
    .pref-email-readonly,
    .pref-email-field input[type="email"],
    .pref-email-field select,
    .pref-email-submit,
    .pref-email-guest p,
    .pref-email-login-btn {
        font-size: max(var(--kyd-text-sm-min, 14px), calc(15px * var(--kyd-text-scale, 1)));
    }
    .pref-email-section-title,
    .pref-email-hint,
    .pref-email-field label.pref-email-label,
    .pref-email-msg,
    .pref-email-foot,
    .pref-email-guest-link,
    .pref-email-loading {
        font-size: max(var(--kyd-text-sm-min, 14px), calc(14px * var(--kyd-text-scale, 1)));
    }
}

@media screen and (min-width: 1440px) and (max-width: 1679px) {
    .pref-email-wrap {
        padding: 44px 24px 60px;
    }
    .pref-email-card {
        padding: 36px 40px 44px;
    }
}

@media screen and (min-width: 1025px) and (max-width: 1439px) {
    .pref-email-wrap {
        padding: 40px 20px 56px;
    }
    .pref-email-card {
        padding: 34px 36px 42px;
    }
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
    .pref-email-wrap {
        padding: 40px 20px 56px;
    }
    .pref-email-card {
        padding: 32px 28px 40px;
    }
    .pref-email-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 767px) {
    .pref-email-wrap {
        padding: 32px 16px 48px;
    }
    .pref-email-card {
        padding: 28px 20px 36px;
    }
    .pref-email-grid {
        grid-template-columns: 1fr;
    }
}
