/* Shared presentation refresh. Existing theme selection and all business handlers remain intact. */
html[data-ui-theme] {
    --refine-deep: #12283f;
    --refine-mid: #1b3856;
    --refine-light: #294964;
    --refine-edge: #42556b;
    --refine-ink: #27435c;
}
html[data-ui-theme="premium"] {
    --refine-deep: #26233f;
    --refine-mid: #3c355a;
    --refine-light: #50466c;
    --refine-edge: #5c546e;
    --refine-ink: #4b405f;
}
html[data-ui-theme="luxury"], html[data-ui-theme="atelier"] {
    --refine-deep: #102e29;
    --refine-mid: #193e35;
    --refine-light: #24463b;
    --refine-edge: #354c44;
    --refine-ink: #28483d;
}
html[data-ui-theme="sapphire"] {
    --refine-deep: #12243b;
    --refine-mid: #1b3453;
    --refine-light: #294765;
    --refine-edge: #3b516a;
    --refine-ink: #294761;
}
html[data-ui-theme]:is([data-ui-page="user"], [data-ui-page="userinfo"], [data-ui-page="profile"]) body {
    box-sizing: border-box;
    width: 100%;
    max-width: 600px;
    min-height: 100vh;
    margin: 0 auto;
    padding-top: 0;
    background: #f5f5f0;
    color: #293b40;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}
html[data-ui-theme]:is([data-ui-page="user"], [data-ui-page="userinfo"], [data-ui-page="profile"]) :is(button,input) { font-family: inherit; }
html[data-ui-theme]:is([data-ui-page="user"], [data-ui-page="profile"]) .bottom-nav {
    box-sizing: border-box;
    left: 50%;
    right: auto;
    width: min(100%, 600px);
    transform: translateX(-50%);
}
html[data-ui-theme]:is([data-ui-page="user"], [data-ui-page="profile"]) :is(.top-notice, .top-bar) {
    box-sizing: border-box;
    position: relative;
    width: 100%;
    border-bottom-color: #e8e9e3;
    background: #fffefa;
}
/* Refined cards shared by each theme's existing templates. */
html[data-ui-theme][data-ui-page="user"] :is(.hero, .header-card, .hero-card, .header),
html[data-ui-theme][data-ui-page="userinfo"] :is(.info-hero, .avatar-section),
html[data-ui-theme][data-ui-page="profile"] :is(.profile-hero, .profile-header, .header) {
    margin: 16px 16px 0;
    padding: 24px;
    border: 1px solid var(--refine-edge);
    border-radius: 22px;
    background: linear-gradient(125deg, var(--refine-deep) 0%, var(--refine-mid) 72%, var(--refine-light) 100%);
    box-shadow: 0 12px 28px #15352c12, inset 0 1px 0 #ffffff09;
    isolation: isolate;
}

html[data-ui-theme][data-ui-page="user"] :is(.hero, .header-card, .hero-card, .header)::before,
html[data-ui-theme][data-ui-page="userinfo"] :is(.info-hero, .avatar-section)::before,
html[data-ui-theme][data-ui-page="profile"] :is(.profile-hero, .profile-header, .header)::before {
    content: "";
    position: absolute;
    width: 106px;
    height: auto;
    inset: 0 22px 0 auto;
    border: 0;
    border-left: 1px solid #c6b4870c;
    border-right: 1px solid #c6b4870c;
    border-radius: 0;
    background: linear-gradient(155deg, transparent 47%, #c6b48709 47.2%, transparent 47.5%);
    box-shadow: none;
    pointer-events: none;
    z-index: -1;
}

html[data-ui-theme][data-ui-page="user"] :is(.hero, .header-card, .hero-card, .header)::after,
html[data-ui-theme][data-ui-page="userinfo"] :is(.info-hero, .avatar-section)::after,
html[data-ui-theme][data-ui-page="profile"] :is(.profile-hero, .profile-header, .header)::after {
    content: "";
    position: absolute;
    top: 0;
    left: 24px;
    width: 46px;
    height: 2px;
    background: #c4b18a;
    opacity: .85;
    pointer-events: none;
}

/* The amount leads; account status retains its existing dynamic content. */
html[data-ui-theme][data-ui-page="user"] .hero-top {
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 0;
    border-bottom: 0;
}

html[data-ui-theme][data-ui-page="user"] .hero-brand {
    gap: 10px;
}

html[data-ui-theme][data-ui-page="user"] .hero-brand-icon {
    width: 34px;
    height: 34px;
    border: 1px solid #c3b18d52;
    border-radius: 10px;
    background: #c3b18d0b;
    box-shadow: none;
}

html[data-ui-theme][data-ui-page="user"] .hero-brand-icon svg {
    color: #d8c7a4;
    width: 18px;
    height: 18px;
    stroke-width: 1.5;
}

html[data-ui-theme][data-ui-page="user"] .hero-brand span {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: #f7f5ec;
}

html[data-ui-theme][data-ui-page="user"] .hero-bell {
    width: 34px;
    height: 34px;
    border-color: #e3dfce24;
    border-radius: 50%;
    background: transparent;
}

html[data-ui-theme][data-ui-page="user"] .hero-bell svg {
    stroke: #c9d3c9;
    stroke-width: 1.5;
}

html[data-ui-theme][data-ui-page="user"] :is(.hero-center, .header-card, .hero-card, .header) :is(.hero-name, .header-name, #user-name) {
    margin-bottom: 10px;
    color: #dfe7df;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: .5px;
    overflow-wrap: anywhere;
}

html[data-ui-theme][data-ui-page="user"] :is(.hero-status, .header-status, #repay-status-text) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 22px;
    padding: 2px 8px;
    margin: 0 0 14px;
    border: 1px solid #c7b28a35;
    border-radius: 5px;
    background: #d4c3a00a;
    color: #d8c9ab;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: .3px;
}

html[data-ui-theme][data-ui-page="user"] :is(.hero-status, .header-status, #repay-status-text)::before {
    content: "";
    flex: 0 0 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
}

html[data-ui-theme][data-ui-page="user"] :is(.hero-amount, .header-amount, #user-amount) {
    margin: 0 0 21px;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(35px, 10.8vw, 48px);
    font-weight: 400;
    line-height: 1.14;
    letter-spacing: -1.6px;
    color: #fbf8ed;
    font-variant-numeric: lining-nums tabular-nums;
}

html[data-ui-theme][data-ui-page="user"] .hero-hint {
    padding-top: 15px;
    border-top: 1px solid #d9dcca1a;
    color: #b0c0b4;
    font-size: 10px;
    line-height: 1.8;
    letter-spacing: .2px;
}

html[data-ui-theme][data-ui-page="user"] :is(.hero, .header-card, .hero-card, .header).is-overdue {
    background: linear-gradient(125deg, var(--refine-deep) 0%, var(--refine-mid) 72%, var(--refine-light) 100%);
}

html[data-ui-theme][data-ui-page="user"] :is(.hero, .header-card, .hero-card, .header).is-overdue :is(.hero-status, .header-status, #repay-status-text) {
    color: #e0c0a5;
    border-color: #c99c783d;
    background: #c99c780b;
}

html[data-ui-theme][data-ui-page="user"] :is(.hero, .header-card, .hero-card, .header).is-overdue .hero-hint {
    color: #b0c0b4;
}

html[data-ui-theme][data-ui-page="user"] :is(.hero, .header-card, .hero-card, .header).is-settled :is(.hero-status, .header-status, #repay-status-text) {
    border-color: #b5cead40;
    color: #c1d6b7;
}

/* Quiet service dock, with the original unread badge and click handler. */
html[data-ui-theme][data-ui-page="user"] :is(.floating-cs-btn, .floating-cs) {
    right: max(18px, calc((100vw - 600px) / 2 + 18px));
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    width: 80px;
    height: 44px;
    flex-direction: row;
    gap: 7px;
    border: 1px solid #b8a47c80;
    border-radius: 24px;
    background: var(--refine-mid);
    color: #e7dcc4;
    box-shadow: 0 4px 16px #112f2926, inset 0 1px 0 #ffffff0d;
    animation: none;
    transition: transform .18s ease, box-shadow .18s ease;
}

html[data-ui-theme][data-ui-page="user"] :is(.floating-cs-btn, .floating-cs) svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.6;
}

html[data-ui-theme][data-ui-page="user"] :is(.floating-cs-btn, .floating-cs) :is(.float-label, .fl-label) {
    margin-top: 0;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .4px;
}

html[data-ui-theme][data-ui-page="user"] :is(.floating-cs-btn, .floating-cs):active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px #112f291a;
}

/* Identity information uses a compact, formal masthead. */
html[data-ui-theme][data-ui-page="userinfo"] :is(.info-hero, .avatar-section) {
    padding: 18px 22px 28px;
}

html[data-ui-theme][data-ui-page="userinfo"] :is(.info-hero, .avatar-section) .back-btn {
    width: 34px;
    height: 34px;
    margin: 0 0 22px -2px;
    border: 1px solid #e6deca2b;
    border-radius: 50%;
    background: transparent;
    color: #f3eee2;
}

html[data-ui-theme][data-ui-page="userinfo"] :is(.info-hero, .avatar-section) .back-btn svg {
    width: 19px;
    height: 19px;
    stroke-width: 1.5;
}

html[data-ui-theme][data-ui-page="userinfo"] .hero-icon-box {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    margin-right: 15px;
    border: 1px solid #c6b38b54;
    border-radius: 13px;
    background: #c6b38b0b;
}

html[data-ui-theme][data-ui-page="userinfo"] .hero-icon-box svg {
    width: 23px;
    height: 23px;
    stroke: #dbcbab;
    stroke-width: 1.5;
}

html[data-ui-theme][data-ui-page="userinfo"] .hero-title {
    color: #faf7ed;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 1.5px;
}

html[data-ui-theme][data-ui-page="userinfo"] .hero-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: #bccbbd;
    font-size: 11px;
    letter-spacing: .5px;
}

html[data-ui-theme][data-ui-page="userinfo"] .hero-subtitle::before {
    content: "";
    width: 5px;
    height: 5px;
    border: 1px solid #b9c9af;
    border-radius: 50%;
}

/* Profile identity and assets form one deliberate layered composition. */
html[data-ui-theme][data-ui-page="profile"] :is(.profile-hero, .profile-header, .header) {
    padding: 29px 23px 57px;
}

html[data-ui-theme][data-ui-page="profile"] :is(.avatar, .profile-avatar, .avatar-box) {
    width: 53px;
    height: 53px;
    margin-right: 16px;
    border: 1px solid #c8b59070;
    border-radius: 50%;
    background: #c8b5900d;
    box-shadow: inset 0 0 0 4px #c8b59006;
}

html[data-ui-theme][data-ui-page="profile"] :is(.avatar, .profile-avatar, .avatar-box) svg {
    width: 25px;
    height: 25px;
    color: #d8c6a2;
    stroke-width: 1.45;
}

html[data-ui-theme][data-ui-page="profile"] :is(.user-name, .profile-name, .name) {
    color: #f8f5e9;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 1.2px;
}

html[data-ui-theme][data-ui-page="profile"] :is(.user-phone, .profile-phone, .phone) {
    margin-top: 5px;
    color: #b5c6b9;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 12px;
    letter-spacing: 1.5px;
}

html[data-ui-theme][data-ui-page="profile"] .asset-card {
    margin: -31px 28px 20px;
    padding: 21px 22px 24px;
    border: 1px solid #dfdfd3;
    border-radius: 17px;
    background: linear-gradient(135deg, #fffefa, #ffffff);
    box-shadow: 0 8px 24px #1c382b08;
    overflow: hidden;
}

html[data-ui-theme][data-ui-page="profile"] .asset-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    color: #59645a;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
}

html[data-ui-theme][data-ui-page="profile"] .asset-title::before {
    content: "";
    width: 3px;
    height: 10px;
    border-radius: 1px;
    background: #b9a176;
}

html[data-ui-theme][data-ui-page="profile"] .asset-title::after {
    content: "";
    flex: 1;
    height: 1px;
    margin-left: 7px;
    background: linear-gradient(90deg, #e9e8df, transparent);
}

html[data-ui-theme][data-ui-page="profile"] .asset-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

html[data-ui-theme][data-ui-page="profile"] .asset-item {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
    text-align: left;
}

html[data-ui-theme][data-ui-page="profile"] .asset-item:first-child {
    padding-right: 12px;
    border-right: 1px solid #e8e8de;
}

html[data-ui-theme][data-ui-page="profile"] .asset-item + .asset-item {
    padding-left: 20px;
}

html[data-ui-theme][data-ui-page="profile"] .asset-label {
    margin: 0;
    color: #8c9287;
    font-size: 11px;
    line-height: 1.5;
    letter-spacing: .3px;
}

html[data-ui-theme][data-ui-page="profile"] :is(.asset-value, .asset-num) {
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(21px, 6.1vw, 29px);
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: -.9px;
    font-variant-numeric: lining-nums tabular-nums;
    overflow-wrap: anywhere;
}

html[data-ui-theme][data-ui-page="profile"] :is(.asset-value, .asset-num).blue {
    color: var(--refine-ink);
}

html[data-ui-theme][data-ui-page="profile"] :is(.asset-value, .asset-num).green {
    color: #9c8050;
}

@media (max-width: 359px) {
    html[data-ui-theme][data-ui-page="user"] :is(.hero, .header-card, .hero-card, .header),
    html[data-ui-theme][data-ui-page="userinfo"] :is(.info-hero, .avatar-section),
    html[data-ui-theme][data-ui-page="profile"] :is(.profile-hero, .profile-header, .header) {
        margin-left: 12px;
        margin-right: 12px;
        padding-left: 20px;
        padding-right: 20px;
        border-radius: 19px;
    }

    html[data-ui-theme][data-ui-page="profile"] .asset-card {
        margin-left: 22px;
        margin-right: 22px;
        padding: 19px 17px 22px;
    }

    html[data-ui-theme][data-ui-page="profile"] .asset-item + .asset-item {
        padding-left: 14px;
    }

    html[data-ui-theme][data-ui-page="user"] :is(.floating-cs-btn, .floating-cs) {
        right: 14px;
        width: 74px;
    }
}

@media (min-width: 601px) {
    html[data-ui-theme][data-ui-page="user"] :is(.hero, .header-card, .hero-card, .header),
    html[data-ui-theme][data-ui-page="userinfo"] :is(.info-hero, .avatar-section),
    html[data-ui-theme][data-ui-page="profile"] :is(.profile-hero, .profile-header, .header) {
        margin-left: 20px;
        margin-right: 20px;
        padding-left: 30px;
        padding-right: 30px;
    }

    html[data-ui-theme][data-ui-page="profile"] .asset-card {
        margin-left: 36px;
        margin-right: 36px;
        padding-left: 28px;
        padding-right: 28px;
    }
}

/* Earlier templates use different structure for the same account surfaces. */
html[data-ui-theme][data-ui-page="user"] :is(.hero, .header-card, .hero-card, .header) {
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    text-align: left;
    color: #f8f5e9;
}

html[data-ui-theme][data-ui-page="user"] .header[style*="background"] {
    background: linear-gradient(125deg, var(--refine-deep), var(--refine-mid) 72%, var(--refine-light)) !important;
}

html[data-ui-theme][data-ui-page="user"] :is(.header-amount-box, .hero-amount-box) {
    margin: 17px 0 20px;
    text-align: left;
}

html[data-ui-theme][data-ui-page="user"] :is(.header-amount-label, .hero-amount-label) {
    margin-bottom: 7px;
    color: #b9c5c5;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .6px;
    opacity: 1;
}

html[data-ui-theme][data-ui-page="user"] .header > p:has(#user-amount) {
    margin: 12px 0 20px;
    font-size: 11px;
    color: #b9c5c5;
    line-height: 1.7;
}

html[data-ui-theme][data-ui-page="user"] .header #user-amount {
    display: block;
    margin-top: 7px;
    margin-bottom: 0;
}

html[data-ui-theme][data-ui-page="user"] :is(.header-card, .hero-card, .header) #repayBtn {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 45px;
    margin: 8px 0 0;
    padding: 12px 18px;
    border: 1px solid #d5c5a1;
    border-radius: 10px;
    background: #e7ddc5;
    color: var(--refine-deep);
    box-shadow: 0 3px 8px #0000000a;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    line-height: 1.4;
}

html[data-ui-theme][data-ui-page="user"] :is(.header-tips, .hero-tips, .header > p:last-child) {
    margin: 13px 0 0;
    color: #b6c2bd;
    text-align: center;
    font-size: 10px;
    line-height: 1.8;
    opacity: 1;
}

html[data-ui-theme][data-ui-page="user"] .floating-cs-btn i {
    font-size: 18px;
    line-height: 1;
}

html[data-ui-theme][data-ui-page="user"] :is(.floating-cs-btn, .floating-cs) {
    box-sizing: border-box;
}

html[data-ui-theme][data-ui-page="user"] #floatingCsBadge {
    box-sizing: border-box;
    top: -4px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid #fffefa;
    border-radius: 10px;
    background: #a55b4b;
    color: white;
    font-size: 9px;
    line-height: 14px;
    box-shadow: none;
}

html[data-ui-theme][data-ui-page="userinfo"] .avatar-section {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 16px;
    align-items: center;
    padding: 26px 23px;
    text-align: left;
}

html[data-ui-theme][data-ui-page="userinfo"] .avatar-section .avatar-circle {
    box-sizing: border-box;
    grid-row: 1 / span 2;
    width: 48px;
    height: 48px;
    margin: 0;
    border: 1px solid #c6b38b54;
    border-radius: 13px;
    background: #c6b38b0b;
}

html[data-ui-theme][data-ui-page="userinfo"] .avatar-circle svg {
    width: 25px;
    height: 25px;
    stroke: #dbcbab;
}

html[data-ui-theme][data-ui-page="userinfo"] .avatar-name {
    align-self: end;
    color: #faf7ed;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 1px;
    overflow-wrap: anywhere;
}

html[data-ui-theme][data-ui-page="userinfo"] .avatar-status {
    justify-self: start;
    align-self: start;
    margin-top: 7px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #becbc2;
    font-size: 11px;
    line-height: 1.6;
}

html[data-ui-theme][data-ui-page="userinfo"] .info-card {
    margin-top: 16px;
}

html[data-ui-theme][data-ui-page="userinfo"] > body > .header {
    box-sizing: border-box;
    min-height: 88px;
    margin: 16px;
    padding: 27px 58px;
    border: 1px solid var(--refine-edge);
    border-radius: 20px;
    background: linear-gradient(125deg, var(--refine-deep), var(--refine-mid));
    color: #faf7ed;
    font-size: 19px;
    font-weight: 500;
    letter-spacing: 1px;
}

html[data-ui-theme][data-ui-page="userinfo"] .header .back {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    left: 20px;
    border: 1px solid #e6deca2b;
    border-radius: 50%;
    color: #f3eee2;
    font-size: 18px;
    line-height: 1;
}

html[data-ui-theme][data-ui-page="profile"] :is(.profile-hero, .profile-header, .header) {
    position: relative;
    overflow: hidden;
}

html[data-ui-theme][data-ui-page="profile"] :is(.user-info-row, .profile-row) > :last-child,
html[data-ui-theme][data-ui-page="profile"] .user-info {
    min-width: 0;
    overflow-wrap: anywhere;
}

html[data-ui-theme][data-ui-page="profile"] :is(.avatar, .profile-avatar, .avatar-box) {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #d8c6a2;
}

html[data-ui-theme][data-ui-page="profile"] .avatar-box img {
    opacity: .8;
}

html[data-ui-theme][data-ui-page="profile"] .header {
    padding-bottom: 29px;
}

html[data-ui-theme][data-ui-page="profile"] .member-row + .asset-card {
    margin-top: 16px;
}

html[data-ui-theme][data-ui-page="profile"] .asset-num {
    color: var(--refine-ink);
}

html[data-ui-theme][data-ui-page="profile"] .asset-item + .asset-item .asset-num {
    color: #9c8050;
}

html[data-ui-theme][data-ui-page="profile"] > body > .layui-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 17px 20px 2px !important;
}

html[data-ui-theme][data-ui-page="profile"] > body > .layui-container h2 {
    color: #53616a;
    font-size: 15px !important;
    font-weight: 500;
    line-height: 1.6;
}
