.user-center-page {
    width: min(720px, calc(100% - 24px));
    min-height: calc(100vh - 82px);
    margin: 0 auto;
    padding: 16px 0 28px;
    color: var(--text, #222);
}

.user-center-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin-bottom: 12px;
}

.user-center-heading h1 {
    margin: 0;
    font-size: clamp(18px, 5.4vw, 20px);
    text-align: center;
}

.user-profile-card,
.user-feature-card {
    border: 1px solid color-mix(in srgb, var(--line, #ececec) 86%, transparent);
    border-radius: 18px;
    background: var(--surface, #fff);
    box-shadow: 0 9px 28px rgba(30, 34, 45, .06);
}

.user-profile-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 118px;
    padding: 20px;
    overflow: hidden;
}

.user-profile-card::before {
    position: absolute;
    top: -80px;
    right: -56px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent, #dd3d3d) 13%, transparent);
    content: "";
    pointer-events: none;
}

.user-profile-card__avatar {
    position: relative;
    z-index: 1;
    display: grid;
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border: 2px solid color-mix(in srgb, var(--accent, #dd3d3d) 42%, #fff);
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent, #dd3d3d) 8%, #fff);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--accent, #dd3d3d) 16%, transparent);
    place-items: center;
}

.user-profile-card__avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-profile-card__identity {
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 7px;
}

.user-profile-card__identity strong {
    overflow: hidden;
    font-size: clamp(17px, 5.1vw, 19px);
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-profile-card__identity span {
    overflow: hidden;
    color: var(--muted, #777);
    font-size: clamp(11px, 3.2vw, 12px);
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-profile-card__identity .user-profile-card__invite-code {
    color: color-mix(in srgb, var(--text, #222) 76%, var(--muted, #777));
    font-size: clamp(12px, 3.45vw, 13px);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: .035em;
}

.user-profile-card__guest-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.user-profile-card__guest-actions button,
.user-profile-card__logout {
    min-width: 64px;
    min-height: 36px;
    padding: 7px 14px;
    border: 1px solid color-mix(in srgb, var(--accent, #dd3d3d) 45%, #fff);
    border-radius: 999px;
    background: #fff;
    color: var(--accent-deep, var(--accent, #dd3d3d));
    cursor: pointer;
    font-size: clamp(12px, 3.45vw, 13px);
}

.user-profile-card__guest-actions button:first-child {
    border-color: var(--accent, #dd3d3d);
    background: var(--accent, #dd3d3d);
    color: #fff;
}

.user-profile-card__logout {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
}

.user-feature-card {
    margin-top: 12px;
    padding: 18px;
}

.user-feature-card h2 {
    margin: 0 0 15px;
    font-size: clamp(16px, 4.55vw, 17px);
    line-height: 1.3;
}

.user-feature-grid {
    display: grid;
    gap: 12px;
}

.user-feature-grid--common {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
}

.user-feature-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 76px;
    padding: 7px 1px 6px;
    border-radius: 12px;
    background: transparent;
    flex-direction: column;
    gap: 9px;
    -webkit-tap-highlight-color: transparent;
    text-align: center;
    transition: background-color .16s ease, transform .16s ease;
}

.user-feature-tile__icon {
    display: grid;
    width: 32px;
    height: 32px;
    background: transparent;
    color: #303136;
    place-items: center;
}

.user-feature-tile__icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.65;
}

.user-feature-tile strong {
    overflow: hidden;
    max-width: 100%;
    color: #303136;
    font-size: clamp(12px, 3.45vw, 13px);
    font-weight: 500;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-feature-tile:active {
    background: rgba(20, 21, 25, .065);
    transform: scale(.96);
}

.user-feature-tile:focus-visible {
    outline: 2px solid #303136;
    outline-offset: 2px;
}

.user-favorite-grid {
    display: grid;
    grid-auto-columns: clamp(104px, 22vw, 130px);
    grid-auto-flow: column;
    grid-template-columns: none;
    gap: 11px;
    padding: 1px 1px 7px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-color: rgba(60, 61, 66, .22) transparent;
    scrollbar-width: thin;
}

.user-favorite-card,
.user-favorite-more {
    position: relative;
    min-width: 0;
    scroll-snap-align: start;
}

.user-favorite-card__link {
    display: block;
    color: inherit;
}

.user-favorite-card__cover {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 11px;
    background: #ececef;
    object-fit: cover;
}

.user-history-card__type {
    position: absolute;
    z-index: 2;
    top: 6px;
    left: 6px;
    padding: 3px 6px;
    border-radius: 5px;
    background: rgba(0, 0, 0, .58);
    color: #fff;
    font-size: clamp(10px, 2.9vw, 11px);
    line-height: 1.25;
    pointer-events: none;
}

.user-favorite-card__title {
    display: -webkit-box;
    overflow: hidden;
    min-height: 36px;
    margin-top: 7px;
    color: #303136;
    font-size: clamp(12px, 3.45vw, 13px);
    font-weight: 600;
    line-height: 18px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.user-favorite-empty {
    margin: 9px 0 4px;
    color: #8b8d93;
    font-size: clamp(12px, 3.45vw, 13px);
    text-align: center;
}

.user-favorite-empty button {
    margin-left: 6px;
    padding: 0;
    border: 0;
    color: #303136;
    background: transparent;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.user-favorite-more {
    display: block;
    margin: 0;
    background: transparent;
    color: #303136;
    cursor: pointer;
    text-decoration: none;
}

.user-favorite-more__cover {
    display: flex;
    width: 100%;
    aspect-ratio: 3 / 4;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 9px;
    border: 1px solid #e2e3e6;
    border-radius: 11px;
    background: linear-gradient(145deg, #f7f7f8, #ececef);
    color: #55575e;
    font-size: clamp(12px, 3.45vw, 13px);
    font-weight: 650;
}

.user-favorite-more__cover svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.user-favorite-more:hover .user-favorite-more__cover,
.user-favorite-more:focus-visible .user-favorite-more__cover {
    border-color: #cfd0d4;
    background: linear-gradient(145deg, #f3f3f5, #e7e7ea);
}

.user-favorite-more:focus-visible {
    border-radius: 11px;
    outline: 2px solid #303136;
    outline-offset: 2px;
}

@media (hover: hover) {
    .user-feature-tile:hover {
        background: rgba(20, 21, 25, .035);
    }
}

.user-recommend-list__item {
    display: grid;
    width: 100%;
    grid-template-columns: 42px minmax(0, 1fr) 20px;
    align-items: center;
    min-height: 64px;
    padding: 0;
    border-top: 1px solid var(--line, #ececec);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.user-recommend-list__item:first-child {
    border-top: 0;
}

.user-recommend-list__icon {
    display: grid;
    width: 32px;
    height: 32px;
    border-radius: 0;
    background: transparent;
    color: #303136;
    place-items: center;
}

.user-recommend-list__item > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.user-recommend-list strong {
    font-size: clamp(13px, 3.75vw, 14px);
}

.user-recommend-list__item small {
    display: block;
    overflow: hidden;
    max-width: 100%;
    margin-top: 3px;
    color: #8b8d93;
    font-size: clamp(11px, 3.2vw, 12px);
    font-weight: 400;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-recommend-list b {
    color: #b8b8b8;
    font-size: 25px;
    font-weight: 400;
    text-align: right;
}

.user-center-feedback {
    position: fixed;
    z-index: 180;
    top: 50%;
    left: 50%;
    width: max-content;
    max-width: calc(100vw - 28px);
    min-height: 0;
    margin: 0;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(27, 29, 33, .92);
    box-shadow: 0 12px 34px rgba(14, 16, 21, .22);
    color: #fff;
    font-size: clamp(12px, 3.45vw, 13px);
    font-weight: 600;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    transform: translate(-50%, calc(-50% - 10px));
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    visibility: hidden;
    white-space: normal;
}

.user-center-feedback.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%);
    visibility: visible;
}

.user-center-feedback.is-error {
    background: rgba(185, 38, 48, .94);
    color: #fff;
}

.user-auth-form__feedback {
    color: #c62828;
}

.user-auth-modal {
    position: fixed;
    z-index: 150;
    inset: 0;
    display: grid;
    padding: 18px;
    place-items: center;
}

.user-auth-modal[hidden],
.user-profile-card__guest-actions[hidden],
.user-profile-card__logout[hidden],
.user-favorite-section[hidden],
.user-favorite-more[hidden],
.user-favorite-empty[hidden],
.user-favorite-empty button[hidden],
.user-auth-form[hidden],
.user-auth-captcha[hidden],
[data-register-control][hidden] {
    display: none !important;
}

.user-auth-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(20, 20, 24, .62);
}

.user-auth-modal__panel {
    position: relative;
    width: min(430px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    padding: 24px 28px 28px;
    overflow-y: auto;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .3);
    color: #242424;
}

.user-auth-modal__close {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    display: grid;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #d5d5d5;
    border-radius: 50%;
    background: #fff;
    color: #777;
    cursor: pointer;
    font-size: 0;
    line-height: 0;
    place-items: center;
}

.user-auth-modal__close::before,
.user-auth-modal__close::after,
.user-setting-modal__close::before,
.user-setting-modal__close::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 13px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    content: "";
    transform: translate(-50%, -50%) rotate(45deg);
}

.user-auth-modal__close::after,
.user-setting-modal__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.user-auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 8px 0 22px;
    border-bottom: 1px solid #ececec;
}

.user-auth-tabs button {
    position: relative;
    min-height: 50px;
    border: 0;
    background: transparent;
    color: #777;
    cursor: pointer;
    font-size: clamp(15px, 4.3vw, 16px);
}

.user-auth-tabs button.is-active {
    color: var(--accent, #dd3d3d);
    font-weight: 700;
}

.user-auth-tabs button.is-active::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--accent, #dd3d3d);
    content: "";
}

.user-auth-form > label,
.user-auth-captcha label {
    display: block;
    margin-top: 15px;
}

.user-auth-form > label > span:first-child,
.user-auth-captcha label > span:first-child {
    display: block;
    margin-bottom: 8px;
    font-size: clamp(13px, 3.75vw, 14px);
    font-weight: 650;
}

.user-auth-form input {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid #dcdcdc;
    border-radius: 9px;
    outline: 0;
    background: #fff;
    color: #222;
    font: inherit;
    /* 保持至少 16px，避免 iOS/WebKit 聚焦登录字段时缩放页面。 */
    font-size: 16px;
    line-height: 1.25;
}

.user-auth-form input:focus {
    border-color: var(--accent, #dd3d3d);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #dd3d3d) 10%, transparent);
}

.user-auth-password {
    position: relative;
    display: block;
}

.user-auth-password input {
    padding-right: 50px;
}

.user-auth-password button {
    position: absolute;
    top: 0;
    right: 0;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #888;
    cursor: pointer;
}

.user-auth-captcha label > span:last-child {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 126px;
    gap: 9px;
}

.user-auth-captcha button {
    height: 46px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #dcdcdc;
    border-radius: 9px;
    background: #f6f6f6;
    cursor: pointer;
}

.user-auth-captcha img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-auth-form__feedback {
    min-height: 21px;
    margin: 13px 0 0;
    font-size: clamp(12px, 3.45vw, 13px);
    line-height: 1.55;
}

.user-auth-form__submit {
    width: 100%;
    min-height: 46px;
    margin-top: 7px;
    border: 0;
    border-radius: 9px;
    background: var(--accent, #dd3d3d);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.user-auth-form__submit:disabled,
.user-setting-form__submit:disabled,
.user-profile-card__logout:disabled {
    cursor: wait;
    opacity: .6;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.has-user-auth-modal {
    overflow: hidden;
}

.user-setting-modal {
    position: fixed;
    z-index: 155;
    inset: 0;
    display: grid;
    padding: 18px;
    place-items: center;
}

.user-setting-modal[hidden],
.user-setting-form[hidden],
.user-customer-service[hidden] {
    display: none !important;
}

.user-setting-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(20, 20, 24, .62);
}

.user-setting-modal__panel {
    position: relative;
    width: min(430px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    padding: 22px 24px 26px;
    overflow-y: auto;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .3);
    color: #242424;
}

.user-setting-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.user-setting-modal__header h2 {
    margin: 0;
    font-size: clamp(18px, 5.4vw, 20px);
}

.user-setting-modal__close {
    position: relative;
    display: grid;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #d5d5d5;
    border-radius: 50%;
    background: #fff;
    color: #777;
    cursor: pointer;
    font-size: 0;
    line-height: 0;
    place-items: center;
}

.user-setting-form > label {
    display: block;
    margin-top: 14px;
}

.user-setting-form__current {
    margin: 0 0 4px;
    padding: 11px 13px;
    border-radius: 9px;
    background: #f5f5f6;
    color: #66686e;
    font-size: clamp(12px, 3.45vw, 13px);
    line-height: 1.45;
}

.user-setting-form__current[hidden] {
    display: none !important;
}

.user-setting-form > label > span {
    display: block;
    margin-bottom: 8px;
    font-size: clamp(13px, 3.75vw, 14px);
    font-weight: 650;
}

.user-setting-form input[type="password"],
.user-setting-form input[type="email"] {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid #dcdcdc;
    border-radius: 9px;
    outline: 0;
    font: inherit;
}

.user-setting-form input:focus {
    border-color: var(--accent, #dd3d3d);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #dd3d3d) 10%, transparent);
}

.user-setting-form__feedback {
    min-height: 21px;
    margin: 13px 0 0;
    color: #c62828;
    font-size: clamp(12px, 3.45vw, 13px);
}

.user-setting-form__submit {
    width: 100%;
    min-height: 46px;
    margin-top: 7px;
    border: 0;
    border-radius: 9px;
    background: var(--accent, #dd3d3d);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.user-avatar-choices {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.user-avatar-choice {
    position: relative;
    display: block;
    cursor: pointer;
}

.user-avatar-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.user-avatar-choice img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border: 3px solid transparent;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-choice input:checked + img,
.user-avatar-choice input:focus-visible + img {
    border-color: var(--accent, #dd3d3d);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #dd3d3d) 16%, transparent);
}

.user-customer-service__list {
    display: grid;
    gap: 0;
}

.user-customer-service__list a {
    display: flex;
    min-height: 52px;
    align-items: center;
    gap: 0;
    padding: 10px 14px;
    border-bottom: 1px solid #ededed;
    border-radius: 0;
    background: transparent;
    color: #242424;
}

.user-customer-service__list a:last-child {
    border-bottom: 0;
}

.user-customer-service__name {
    flex: 0 0 auto;
    font-size: clamp(14px, 4vw, 15px);
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
}

.user-customer-service__url {
    min-width: 0;
    flex: 1 1 auto;
    color: #6f6f73;
    font-size: clamp(12px, 3.45vw, 13px);
    font-weight: 450;
    line-height: 1.45;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 520px) {
    .user-center-page {
        width: min(100% - 20px, 720px);
        padding-top: 8px;
    }

    .user-center-heading {
        min-height: 44px;
        margin-bottom: 8px;
    }

    .user-profile-card {
        gap: 11px;
        min-height: 108px;
        padding: 17px 15px;
    }

    .user-profile-card__avatar {
        width: 64px;
        height: 64px;
    }

    .user-profile-card__identity strong {
        font-size: clamp(16px, 4.55vw, 17px);
    }

    .user-profile-card__guest-actions {
        gap: 6px;
    }

    .user-profile-card__guest-actions button,
    .user-profile-card__logout {
        min-width: 55px;
        min-height: 34px;
        padding: 6px 10px;
    }

    .user-feature-card {
        margin-top: 10px;
        padding: 16px;
    }

    .user-favorite-grid { gap: 9px; }

    .user-auth-modal {
        place-items: center;
        padding: 12px;
    }

    .user-auth-modal__panel {
        width: 100%;
        max-height: calc(100vh - 24px);
        padding: 20px 20px 24px;
        border-radius: 20px;
    }

    .user-setting-modal {
        padding: 12px;
    }

    .user-setting-modal__panel {
        max-height: calc(100vh - 24px);
        padding: 20px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .user-profile-card,
    .user-feature-card,
    .user-auth-modal__panel {
        animation: user-center-enter .22s ease-out both;
    }

    .user-feature-card:nth-of-type(3) {
        animation-delay: .04s;
    }

    @keyframes user-center-enter {
        from { opacity: 0; transform: translateY(7px); }
        to { opacity: 1; transform: translateY(0); }
    }
}
