/* css/profile.css */

        .profile-card { padding: 16px; text-align: left; }
        .profile-summary-row {
            display: flex;
            align-items: center;
            gap: 14px;
        }
        .profile-avatar-readonly { margin-bottom: 0; cursor: default; }
        .profile-summary-text { flex: 1; min-width: 0; }
        .profile-summary-name {
            font-size: 17px;
            font-weight: 800;
            color: var(--text-main);
            margin-bottom: 6px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .profile-menu-row {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 14px 16px;
            border: none;
            border-bottom: 1px solid #eef2f6;
            background: transparent;
            text-align: left;
            cursor: pointer;
        }
        .profile-menu-row:last-child { border-bottom: none; }
        .profile-menu-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
        .profile-menu-main strong {
            font-size: 15px;
            font-weight: 800;
            color: var(--text-main);
        }
        .profile-menu-main small {
            font-size: 12px;
            color: var(--text-muted);
            font-weight: 600;
        }
        .profile-menu-arrow {
            color: var(--text-muted);
            font-size: 20px;
            font-weight: 400;
            flex-shrink: 0;
        }
        .profile-sub-pane {
            display: none;
            position: fixed;
            left: 0;
            right: 0;
            top: var(--top-bar-height, 44px);
            bottom: 0;
            z-index: 9400;
            background: var(--bg-main);
            flex-direction: column;
        }
        .profile-sub-pane.open { display: flex; }
        .profile-sub-hd {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            background: var(--bg-card);
            border-bottom: 1px solid #E1E8ED;
            flex-shrink: 0;
        }
        .profile-sub-pane .chat-back-btn,
        .profile-sub-pane .profile-back-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: none;
            background: transparent;
            color: var(--text-main, #1A212D);
            font-size: 28px;
            font-weight: 400;
            cursor: pointer;
            padding: 0 4px;
            line-height: 1;
            white-space: nowrap;
            flex-shrink: 0;
            min-width: 36px;
            height: 36px;
        }
        .profile-sub-title {
            flex: 1;
            font-size: 15px;
            font-weight: 800;
            color: var(--text-main);
            text-align: center;
        }
        .profile-sub-spacer { width: 48px; }
        .profile-sub-body {
            flex: 1;
            overflow-y: auto;
            padding: 14px 12px 24px;
            -webkit-overflow-scrolling: touch;
        }
        .profile-avatar-wrap {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            margin-bottom: 14px;
            cursor: pointer;
        }
        .profile-avatar-img, .profile-avatar-fallback {
            width: 76px;
            height: 76px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid #E1E8ED;
            background: #F0F3F6;
        }
        .profile-avatar-fallback {
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 28px;
            font-weight: 800;
            color: #657786;
        }
        .profile-avatar-hint {
            font-size: 12px;
            color: var(--accent);
            font-weight: 700;
        }
        .profile-meta-line {
            font-size: 13px;
            color: var(--text-muted);
            margin-bottom: 8px;
        }
        .profile-meta-line strong { color: var(--text-main); }
        .profile-meta-uid {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 6px;
        }
        .profile-copy-uid-btn {
            border: 1px solid var(--accent, #e53935);
            background: transparent;
            color: var(--accent, #e53935);
            border-radius: 999px;
            padding: 2px 10px;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            line-height: 1.4;
        }
        .profile-copy-uid-btn:active { opacity: 0.85; }
        .profile-field { margin-top: 12px; }
        .profile-field label {
            display: block;
            font-size: 12px;
            font-weight: 700;
            color: var(--text-muted);
            margin-bottom: 6px;
        }
        .profile-field input {
            width: 100%;
            box-sizing: border-box;
            background: #F8F9FA;
            border: 1px solid #CCD6DD;
            border-radius: 8px;
            padding: 10px 12px;
            font-size: 14px;
            color: #1A212D;
        }
        .profile-section-title {
            font-size: 15px;
            font-weight: 800;
            color: var(--text-main);
            margin-bottom: 12px;
        }
        .profile-pwd-modes {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
        }
        .profile-mode-btn {
            flex: 1;
            border: 1px solid #dce3ea;
            background: #f8f9fb;
            color: var(--text-muted);
            border-radius: 8px;
            padding: 9px 6px;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
        }
        .profile-mode-btn.active {
            border-color: var(--accent);
            background: rgba(29, 161, 242, 0.1);
            color: var(--accent);
        }
        .profile-sms-row {
            display: flex;
            gap: 8px;
        }
        .profile-sms-row input { flex: 1; }
        .profile-sms-row .btn-captcha {
            flex-shrink: 0;
            border: none;
            border-radius: 8px;
            padding: 0 12px;
            background: var(--accent);
            color: #fff;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            white-space: nowrap;
        }
        .profile-sms-row .btn-captcha:disabled {
            opacity: 0.55;
            cursor: default;
        }
        .profile-logout-btn {
            width: 100%;
            margin: 18px 0 8px;
            border: 1px solid #ffcdd2;
            background: #fff5f5;
            color: #e53935;
            border-radius: 12px;
            padding: 14px;
            font-size: 15px;
            font-weight: 800;
            cursor: pointer;
        }

        .wallet-ledger-list {
            display: flex;
            flex-direction: column;
            background: #fff;
            border-radius: 12px;
            border: 1px solid #E1E8ED;
            overflow: hidden;
        }
        .wallet-ledger-item {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            padding: 14px;
            border-bottom: 1px solid #f0f3f6;
        }
        .wallet-ledger-item:last-child { border-bottom: none; }
        .wallet-ledger-main { flex: 1; min-width: 0; }
        .wallet-ledger-title {
            font-size: 14px;
            font-weight: 800;
            color: var(--text-main);
            margin-bottom: 4px;
        }
        .wallet-ledger-sub {
            font-size: 12px;
            color: var(--text-muted);
            line-height: 1.4;
            word-break: break-word;
        }
        .wallet-ledger-time {
            margin-top: 4px;
            font-size: 11px;
            color: #9aa5b1;
        }
        .wallet-ledger-amount {
            flex-shrink: 0;
            font-size: 15px;
            font-weight: 800;
            color: var(--text-main);
            white-space: nowrap;
        }
        .wallet-ledger-amount.plus { color: #00C853; }
        .wallet-ledger-amount.minus { color: #E53935; }
        .wallet-ledger-empty {
            padding: 36px 16px;
            text-align: center;
            color: var(--text-muted);
            font-size: 13px;
        }
        .wallet-ledger-more {
            width: 100%;
            margin-top: 12px;
            border: 1px solid #E1E8ED;
            background: #fff;
            color: var(--text-main);
            border-radius: 10px;
            padding: 12px;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
        }
        .wallet-ledger-more:disabled { opacity: 0.6; cursor: default; }

        #mainDashboardView.has-bottom-bar {
            padding-bottom: 78px;
        }
        .tab-page { display: none; animation: fadeSlideIn 0.28s ease; }
        .tab-page.active { display: block; }
        .page-hero-title {
            font-size: 15px;
            font-weight: 900;
            color: var(--text-main);
            margin: 0 0 12px;
            letter-spacing: 0.2px;
        }
        .page-hero-sub {
            font-size: 12px;
            color: var(--text-muted);
            margin: -6px 0 14px;
            line-height: 1.45;
            font-weight: 600;
        }
        .profile-ex-tabs {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0;
            margin: 0 0 12px;
            border-radius: 10px;
            overflow: hidden;
            border: 1px solid #e1e8ed;
            background: #f5f7fa;
        }
        .profile-ex-tab {
            border: none;
            background: transparent;
            padding: 12px 8px;
            font-size: 13px;
            font-weight: 800;
            color: var(--text-muted);
            cursor: pointer;
            line-height: 1.3;
        }
        .profile-ex-tab.active {
            background: #fff;
            color: var(--secondary, #0071FF);
            box-shadow: inset 0 -2px 0 var(--secondary, #0071FF);
        }
        .profile-ex-tab:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }
        .profile-ex-card .profile-ex-head {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-bottom: 10px;
        }
        .profile-ex-card .profile-ex-head strong {
            font-size: 15px;
            color: var(--text-main);
        }
        .profile-ex-card .profile-ex-head small,
        .profile-ex-meta,
        .profile-ex-hint,
        .profile-ex-preview {
            font-size: 12px;
            color: var(--text-muted);
            line-height: 1.45;
        }
        .profile-ex-meta { margin-bottom: 8px; }
        .profile-ex-preview {
            margin: 8px 0 12px;
            color: var(--secondary, #0071FF);
            font-weight: 700;
        }
        .profile-ex-closed {
            margin-top: 8px;
            padding: 10px 12px;
            border-radius: 8px;
            background: #fff3e0;
            color: #e65100;
            font-size: 13px;
            font-weight: 700;
            text-align: center;
        }
        .exchange-closed-banner {
            margin: 0 0 12px;
            padding: 14px 12px;
            border-radius: 10px;
            background: #fff3e0;
            color: #e65100;
            font-size: 14px;
            font-weight: 800;
            text-align: center;
        }