/* ========================================
   User Center - Modern Card Design
   Layout changes gated behind body.euc-enhanced
   so page always works even if JS fails.
   ======================================== */

/* ========================================
   COSMETIC styles (always active)
   These only affect custom-injected elements
   and won't break the original layout.
   ======================================== */

/* Profile card (injected by JS) */
.euc-profile-card {
    padding: 24px 16px 18px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #eef2ff 100%);
    border-bottom: 1px solid #f0f0f1;
}

.euc-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #e8ecf4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.euc-avatar svg {
    width: 28px;
    height: 28px;
    color: #8b95a5;
}

.euc-avatar-img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
}

.euc-username {
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 6px;
}

.euc-badge-signed {
    display: inline-block;
    background: #ff9800;
    color: #fff;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.euc-badge {
    display: inline-block;
    background: #f0f0f1;
    color: #646970;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.euc-menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Summary cards (injected by JS) */
.euc-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.euc-card {
    background: #fff;
    border-radius: 12px;
    padding: 22px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}

.euc-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.euc-card-value {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.2;
}

.euc-card-value.orange { color: #e67e22; }
.euc-card-value.dark { color: #1d2327; }

.euc-card-unit {
    font-size: 14px;
    color: #999;
    font-weight: 400;
}

.euc-card-label {
    font-size: 13px;
    color: #8b95a5;
    margin-top: 4px;
}

.euc-card-level-name {
    font-size: 20px;
    font-weight: 700;
    color: #1d2327;
    margin-bottom: 2px;
}

/* Input wrapper (injected by JS) */
.euc-input-wrap {
    display: inline-flex;
    align-items: center;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.euc-input-wrap:focus-within {
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34,113,177,0.1);
}

.euc-input-wrap .erphpdown-sc-input {
    border: none;
    border-radius: 0;
    padding: 10px 14px;
    font-size: 15px;
    outline: none;
    box-shadow: none;
    width: 200px;
    margin: 0;
}

.euc-input-unit {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    background: #f6f7f7;
    color: #646970;
    font-size: 14px;
    min-height: 42px;
    border-left: 1px solid #dcdcde;
    font-weight: 500;
}

/* Payment option cards (injected by JS) */
.euc-pay-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid #dcdcde;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    margin-right: 10px;
}

.euc-pay-option:hover {
    border-color: #b8c4ce;
}

.euc-pay-option.euc-pay-selected {
    border-color: #2271b1;
    background: #f0f6fc;
}

.euc-pay-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.euc-pay-alipay { background: #1677ff; }
.euc-pay-wechat { background: #07c160; }

.euc-pay-label {
    font-size: 14px;
    color: #1d2327;
    font-weight: 500;
}

/* Submit button */
.euc-submit-btn {
    background: #ff9800 !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 0 !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    width: 100% !important;
    max-width: 320px !important;
    margin-top: 10px !important;
    box-shadow: 0 4px 12px rgba(255,152,0,0.25) !important;
}

.euc-submit-btn:hover {
    background: #f57c00 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255,152,0,0.35) !important;
}

.euc-submit-row td {
    padding-top: 16px;
}

/* ========================================
   STRUCTURAL changes (only after JS runs)
   Gated behind body.euc-enhanced
   ======================================== */

/* --- Force text selection (override theme restrictions) --- */
.page-id-139 .erphpdown-sc-user-wrap,
.page-id-139 .erphpdown-sc-user-wrap * {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* --- Hide theme page title --- */
body.euc-enhanced.page-id-139 .home-pingtai .home-title {
    display: none !important;
}

body.euc-enhanced.page-id-139 .home-pingtai .nr {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.euc-enhanced.page-id-139 .home-pingtai .nr .item {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

body.euc-enhanced.page-id-139 .home-pingtai .box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 20px 16px !important;
    min-height: auto !important;
    box-sizing: border-box !important;
}

/* --- Main layout: flex --- */
body.euc-enhanced.page-id-139 .erphpdown-sc-user-wrap {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 24px !important;
    max-width: 1100px !important;
    margin: 0 auto !important;
    align-items: flex-start !important;
    padding: 0 !important;
    position: relative !important;
    background: transparent !important;
}

/* --- Sidebar: fixed width --- */
/* CRITICAL: override erphpdown's position:absolute to position:static */
body.euc-enhanced.page-id-139 .erphpdown-sc-user-aside {
    position: static !important;
    display: block !important;
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
    overflow: hidden !important;
    float: none !important;
    box-sizing: border-box !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
}

/* Hide erphpdown's original active indicator bar */
body.euc-enhanced.page-id-139 .erphpdown-sc-user-aside li.active:before {
    display: none !important;
}

/* --- Sidebar menu items --- */
body.euc-enhanced.page-id-139 .erphpdown-sc-user-aside li {
    display: block !important;
    margin: 0 !important;
    list-style: none !important;
    padding: 0 !important;
    float: none !important;
}

body.euc-enhanced.page-id-139 .erphpdown-sc-user-aside li a {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 18px !important;
    color: #50575e !important;
    font-size: 14px !important;
    text-decoration: none !important;
    transition: all 0.15s !important;
    border-left: 3px solid transparent !important;
    line-height: 1.4 !important;
    float: none !important;
    width: auto !important;
}

body.euc-enhanced.page-id-139 .erphpdown-sc-user-aside li a:hover {
    background: #f6f7f7 !important;
    color: #1d2327 !important;
}

body.euc-enhanced.page-id-139 .erphpdown-sc-user-aside li.active a {
    background: #f0f6fc !important;
    color: #2271b1 !important;
    border-left-color: #2271b1 !important;
    font-weight: 600 !important;
}

/* --- Main content: flex child --- */
body.euc-enhanced.page-id-139 .erphpdown-sc-user-content {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    min-height: auto !important;
    width: auto !important;
    max-width: none !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
}

/* --- Content sections --- */
body.euc-enhanced.page-id-139 .erphpdown-sc {
    background: #fff !important;
    border-radius: 12px !important;
    padding: 24px 28px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
    margin: 0 0 20px 0 !important;
    border: none !important;
    box-sizing: border-box !important;
}

body.euc-enhanced.page-id-139 .erphpdown-sc h2 {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #1d2327 !important;
    margin: 0 0 20px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid #f0f0f1 !important;
}

/* --- Recharge form table --- */
body.euc-enhanced.page-id-139 .erphpdown-sc-table {
    width: 100% !important;
    border-collapse: collapse !important;
}

body.euc-enhanced.page-id-139 .erphpdown-sc-table tr {
    border: none !important;
}

body.euc-enhanced.page-id-139 .erphpdown-sc-table td {
    padding: 10px 6px !important;
    font-size: 14px !important;
    color: #50575e !important;
    vertical-align: middle !important;
    border: none !important;
}

body.euc-enhanced.page-id-139 .erphpdown-sc-td-title {
    font-weight: 500 !important;
    color: #50575e !important;
    width: 80px !important;
    white-space: nowrap !important;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    body.euc-enhanced.page-id-139 .erphpdown-sc-user-wrap {
        flex-direction: column !important;
        gap: 16px !important;
    }

    body.euc-enhanced.page-id-139 .erphpdown-sc-user-aside {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .euc-summary-cards {
        grid-template-columns: 1fr !important;
    }

    body.euc-enhanced.page-id-139 .erphpdown-sc {
        padding: 18px 16px !important;
    }
}
