html,
body.profile-browser-shell {
    min-height: 100%;
}

body.profile-browser-shell {
    color: #111827;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.profile-browser-shell .login-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.profile-browser-shell .login-modal-overlay.show {
    display: flex;
    pointer-events: auto;
}

.profile-browser-shell .login-modal-overlay:not(.show) {
    display: none !important;
    pointer-events: none !important;
}

.profile-browser-shell .login-modal-card {
    position: relative;
    width: 400px;
    max-width: 92vw;
    overflow: hidden;
    border: 1px solid rgba(255, 133, 162, 0.15);
    border-radius: 16px;
    background: #1a1a2e;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.profile-browser-shell .login-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: #888;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.profile-browser-shell .login-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.profile-browser-shell .login-modal-header {
    padding: 28px 28px 0;
    text-align: center;
}

.profile-browser-shell .login-modal-header .lm-title {
    font-size: 20px;
    font-weight: 600;
    color: #f5f5f5;
    background: linear-gradient(135deg, #FF85A2, #FFB0C4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-browser-shell .login-modal-header .lm-subtitle {
    margin-top: 6px;
    color: #a0a0a0;
    font-size: 13px;
}

.profile-browser-shell .login-mode-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 34px;
    margin: 18px 28px 0;
}

.profile-browser-shell .login-mode-tab {
    position: relative;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #a0a0a0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.18s;
}

.profile-browser-shell .login-mode-tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.18s;
}

.profile-browser-shell .login-mode-tab:hover,
.profile-browser-shell .login-mode-tab.active {
    color: #FF85A2;
}

.profile-browser-shell .login-mode-tab.active::after {
    background: #FF85A2;
}

.profile-browser-shell .login-modal-body {
    padding: 18px 28px 28px;
}

.profile-browser-shell .login-modal-body .form-group {
    margin-bottom: 16px;
}

.profile-browser-shell .login-modal-body .form-label {
    display: block;
    margin-bottom: 6px;
    color: #a0a0a0;
    font-size: 13px;
    font-weight: 500;
}

.profile-browser-shell .login-modal-body .form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #e5e5e5;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-browser-shell .login-modal-body .form-input::placeholder {
    color: #666;
}

.profile-browser-shell .login-modal-body .form-input:focus {
    border-color: #FF85A2;
    box-shadow: 0 0 0 3px rgba(255, 133, 162, 0.2);
}

.profile-browser-shell .login-modal-body .code-input-group {
    display: flex;
    gap: 8px;
}

.profile-browser-shell .login-modal-body .code-input-group .form-input {
    flex: 1 1 auto;
    min-width: 0;
}

.profile-browser-shell .login-modal-body .btn-send-code {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 1px solid rgba(255, 133, 162, 0.3);
    border-radius: 8px;
    background: rgba(255, 133, 162, 0.1);
    color: #FF85A2;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.profile-browser-shell .login-modal-body .btn-send-code:hover {
    background: rgba(255, 133, 162, 0.2);
}

.profile-browser-shell .login-modal-body .btn-send-code:disabled {
    border-color: #555;
    background: #444;
    color: #888;
    cursor: not-allowed;
}

.profile-browser-shell .login-modal-body .btn-login {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #FF85A2, #E8708A);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.profile-browser-shell .login-modal-body .btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 133, 162, 0.35);
}

.profile-browser-shell .login-modal-body .btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.profile-browser-shell .login-modal-body .form-hint {
    margin-top: 10px;
    color: #666;
    font-size: 11px;
}

.profile-browser-shell .login-modal-body .lm-message {
    display: none;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.profile-browser-shell .login-modal-body .lm-message.error {
    display: block;
    border: 1px solid rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.profile-browser-shell .login-modal-body .lm-message.success {
    display: block;
    border: 1px solid rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.profile-browser-shell .agreement-check-row {
    margin: 10px 0 2px;
}

.profile-browser-shell .agreement-check-label {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #888;
    font-size: 12px;
    line-height: 1.6;
    cursor: pointer;
    user-select: none;
}

.profile-browser-shell .agreement-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.profile-browser-shell .agreement-check-box {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin-top: 3px;
    border: 1.5px solid #555;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.profile-browser-shell .agreement-check-box img {
    display: none;
}

.profile-browser-shell .agreement-checkbox:checked + .agreement-check-box {
    border-color: #FF85A2;
    background: #FF85A2;
}

.profile-browser-shell .agreement-checkbox:checked + .agreement-check-box img {
    display: inline;
}

.profile-browser-shell .agreement-check-text {
    flex: 1 1 auto;
}

.profile-browser-shell .agreement-text-link {
    text-decoration: none;
    transition: opacity 0.15s;
}

.profile-browser-shell .agreement-text-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.profile-browser-shell .link-pink { color: #FF85A2; }
.profile-browser-shell .link-blue { color: #6cb4ee; }
.profile-browser-shell .link-orange { color: #D4A574; }

body.profile-browser-shell .bg-layer {
    inset: var(--software-browser-gap, 0);
    width: auto;
    height: auto;
    overflow: hidden;
    border-radius: var(--software-browser-radius, 0);
    background: #f6f8fb;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.profile-page-shell {
    --profile-shell-side-gutter: clamp(16px, 2vw, 32px);
    --profile-shell-left-safe: calc(var(--app-shell-rail-width, 80px) + var(--profile-shell-side-gutter));
    position: fixed;
    inset: var(--software-browser-gap, 0);
    left: calc(var(--software-browser-gap, 0px) + var(--profile-shell-left-safe));
    display: grid;
    grid-template-columns: minmax(220px, 296px) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 76px);
    padding: 72px clamp(28px, 5vw, 96px) 48px 0;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: var(--software-browser-radius, 0);
}

.profile-sidebar-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.profile-avatar-edit {
    position: relative;
    width: 72px;
    height: 72px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: linear-gradient(135deg, #b7f0ff, #ffd1dc);
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.profile-avatar-img,
.profile-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.profile-avatar-img {
    display: none;
    object-fit: cover;
}

.profile-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0;
    font-family: Montserrat, Arial, sans-serif;
}

.profile-avatar-mask {
    position: absolute;
    inset: auto 0 0;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, 0.68);
    color: #fff;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.16s ease;
}

.profile-avatar-edit:hover .profile-avatar-mask {
    opacity: 1;
}

.profile-uuid-text {
    margin-top: 10px;
    max-width: 100%;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.profile-name-row {
    margin-top: 14px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-display-name {
    min-width: 0;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.35;
    color: #111827;
}

.profile-icon-button {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.profile-icon-button:hover {
    background: #e8edf3;
    color: #111827;
}

.profile-icon-button svg,
.profile-share-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-contact {
    min-height: 18px;
    margin-top: 6px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #64748b;
    font-size: 12px;
}

.profile-stats {
    margin-top: 44px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-stats div {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.profile-stats strong {
    font-size: 14px;
    color: #0f172a;
}

.profile-stats span {
    font-size: 13px;
    color: #334155;
}

.profile-share-button {
    margin-top: 24px;
    width: 100%;
    height: 36px;
    border: 0;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #e8edf3;
    color: #0f172a;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.profile-share-button:hover {
    background: #dfe7f0;
}

.profile-bio-view {
    margin-top: 26px;
    width: 100%;
    min-height: 42px;
}

.profile-bio-view p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.profile-edit-form {
    margin-top: 22px;
    width: 100%;
    display: grid;
    gap: 14px;
}

.profile-edit-form[hidden] {
    display: none;
}

.profile-edit-form label {
    display: grid;
    gap: 7px;
    color: #475569;
    font-size: 12px;
    font-weight: 650;
}

.profile-edit-form input,
.profile-edit-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d8e0ea;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.74);
    color: #111827;
    font: inherit;
    font-size: 13px;
    outline: none;
}

.profile-edit-form input {
    height: 36px;
    padding: 0 10px;
}

.profile-edit-form textarea {
    resize: vertical;
    min-height: 92px;
    padding: 10px;
    line-height: 1.5;
}

.profile-edit-form input:focus,
.profile-edit-form textarea:focus {
    border-color: #71b7ff;
    box-shadow: 0 0 0 3px rgba(113, 183, 255, 0.18);
}

.profile-form-actions {
    display: flex;
    gap: 8px;
}

.profile-primary-button,
.profile-secondary-button {
    height: 34px;
    border-radius: 7px;
    border: 0;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.profile-primary-button {
    background: #111827;
    color: #fff;
}

.profile-primary-button:disabled {
    cursor: default;
    opacity: 0.58;
}

.profile-secondary-button {
    background: #e8edf3;
    color: #334155;
}

.profile-message {
    min-height: 18px;
    margin-top: 14px;
    color: #64748b;
    font-size: 12px;
}

.profile-message.success {
    color: #059669;
}

.profile-message.error {
    color: #dc2626;
}

.profile-content-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.profile-tabs {
    height: 38px;
    display: flex;
    align-items: center;
    gap: clamp(22px, 4vw, 64px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.profile-tab {
    height: 32px;
    min-width: 72px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #0f172a;
    font-size: 13px;
    cursor: pointer;
}

.profile-tab.active {
    background: #e8edf3;
    font-weight: 650;
}

.profile-tab-body {
    position: relative;
    flex: 1;
    min-height: 360px;
}

.profile-empty-state {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    color: #8b98a9;
    font-size: 14px;
}

.profile-empty-state.active {
    display: flex;
}

.profile-empty-state p {
    margin: 0;
}

.profile-empty-visual {
    width: 104px;
    height: 86px;
    border-radius: 8px;
    background:
        radial-gradient(circle at 72% 34%, rgba(255, 209, 220, 0.9), transparent 28px),
        radial-gradient(circle at 38% 44%, rgba(90, 200, 250, 0.52), transparent 35px),
        linear-gradient(135deg, rgba(255,255,255,0.94), rgba(220,231,246,0.35));
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

@media (max-width: 860px) {
    .profile-page-shell {
        --profile-shell-side-gutter: 12px;
        left: calc(var(--software-browser-gap, 0px) + var(--profile-shell-left-safe));
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 58px 18px 34px 0;
        overflow-y: auto;
    }

    .profile-sidebar-panel {
        max-width: 320px;
    }

    .profile-tabs {
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .profile-tab {
        flex: 0 0 auto;
    }

    .profile-tab-body {
        min-height: 260px;
    }
}

body.profile-browser-shell {
    color: #e5e7eb;
    background: #24262a;
}

body.profile-browser-shell .bg-layer {
    background: #24262a;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

#pageProfile.profile-home-page {
    position: relative;
    padding: 0;
    background: #24262a;
}

#pageProfile.profile-home-page.active {
    display: block;
}

#pageProfile.profile-home-page .profile-page-shell {
    position: absolute;
    inset: 0;
    left: var(--profile-shell-left-safe);
    width: auto;
    height: 100%;
    border-radius: 0;
}

.profile-page-shell {
    background: #24262a;
}

.profile-avatar-edit {
    background: linear-gradient(135deg, #4b5563, #9ca3af);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.26);
}

.profile-avatar-fallback {
    color: #f9fafb;
}

.profile-display-name,
.profile-stats strong,
.profile-tab {
    color: #f3f4f6;
}

.profile-icon-button {
    color: #aeb5c2;
}

.profile-icon-button:hover,
.profile-share-button:hover,
.profile-secondary-button:hover {
    background: #3a3d43;
    color: #f9fafb;
}

.profile-stats span,
.profile-uuid-text,
.profile-bio-view p,
.profile-message,
.profile-empty-state {
    color: #aeb5c2;
}

.profile-share-button,
.profile-secondary-button {
    background: #34373d;
    color: #e5e7eb;
}

.profile-edit-form label {
    color: #cbd5e1;
}

.profile-edit-form input,
.profile-edit-form textarea {
    border-color: rgba(229, 231, 235, 0.12);
    background: #2f3136;
    color: #f8fafc;
}

.profile-edit-form input:focus,
.profile-edit-form textarea:focus {
    border-color: rgba(147, 197, 253, 0.62);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.profile-primary-button {
    background: #4b5563;
    color: #fff;
}

.profile-tabs {
    border-bottom-color: rgba(229, 231, 235, 0.12);
}

.profile-tab.active {
    background: #3a3d43;
}

.profile-empty-visual {
    background:
        linear-gradient(135deg, rgba(75, 85, 99, 0.92), rgba(31, 41, 55, 0.72)),
        radial-gradient(circle at 62% 28%, rgba(147, 197, 253, 0.34), transparent 30px);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.profile-message.success {
    color: #34d399;
}

.profile-message.error {
    color: #f87171;
}

@media (max-width: 860px) {
    #pageProfile.profile-home-page .profile-page-shell {
        left: var(--profile-shell-left-safe);
    }
}
