/* ==============================================
   TypeZen User Center Styles
   ============================================== */

/* ==============================================
   Layout & Containers
   ============================================== */
.user-center-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Homepage-Standard Layout Optimization */
@media (min-width: 992px) {
    .user-center-container>.row {
        display: flex;
        align-items: flex-start;
        /* Changed from stretch to allow natural height */
        margin: 0;
        min-height: calc(100vh - var(--m-header-height));
    }

    /* Fix: Reset .m-sidebar-left to flow naturally within the grid */
    .user-center-container .m-sidebar-left {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        border-right: none !important;
        padding: 24px 0 !important;
        transform: none !important;
        background: transparent !important;
    }

    /* Left Sidebar: Fixed via Flex */
    .user-center-container>.row>.col-md-3:first-child {
        flex: 0 0 var(--m-sidebar-left);
        width: var(--m-sidebar-left);
        max-width: var(--m-sidebar-left);
        padding: 0;
        border-right: 1px solid var(--m-gray-100);
        /* Matched to homepage #f2f2f2 */
        background: var(--m-white);
        position: sticky;
        /* Keep it sticky like homepage */
        top: var(--m-header-height);
        height: calc(100vh - var(--m-header-height));
        overflow-y: auto;
        z-index: 10;
        scrollbar-width: none;
        /* Hide scrollbar for cleaner look */
    }

    /* Hide scrollbar for Webkit */
    .user-center-container>.row>.col-md-3:first-child::-webkit-scrollbar {
        display: none;
    }

    /* Middle Content: Fluid Space */
    .user-center-container>.row>.col-md-6 {
        flex: 1;
        width: auto;
        max-width: none;
        padding: 48px;
        /* Match m-channel-header padding logic */
        border-right: 1px solid var(--m-gray-200);
        min-height: calc(100vh - var(--m-header-height));
    }

    /* Right Sidebar: Fixed via Variable */
    .user-center-container>.row>.col-md-3:last-child {
        flex: 0 0 var(--m-sidebar-right);
        width: var(--m-sidebar-right);
        max-width: var(--m-sidebar-right);
        padding: 40px 32px;
        background: var(--m-white);
    }
}

.user-profile-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* ==============================================
   Header Section
   ============================================== */
.user-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--m-gray-200);
    padding-bottom: 0;
    gap: 24px;
    flex-wrap: wrap;
}

.user-profile-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--m-black);
    margin: 0;
    line-height: 1.2;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ==============================================
   Lists (Common Styles)
   ============================================== */
.orders-list,
.comments-list,
.archives-list,
.collections-list {
    display: flex;
    flex-direction: column;
}

.order-item,
.comment-item,
.archive-item,
.collection-item {
    display: flex;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid var(--m-gray-100);
}

.order-item:last-child,
.comment-item:last-child,
.archive-item:last-child,
.collection-item:last-child {
    border-bottom: none;
}

/* Thumbnails */
.archive-thumb {
    width: 160px;
    flex-shrink: 0;
}

.archive-thumb img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 4px;
}

.order-thumb {
    width: 120px;
    flex-shrink: 0;
}

.order-thumb img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
}

.collection-thumb {
    width: 140px;
    flex-shrink: 0;
}

.collection-thumb img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 4px;
}

.comment-thumb {
    width: 60px;
    flex-shrink: 0;
}

.comment-thumb img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

/* Content */
.archive-content,
.order-content,
.collection-content,
.comment-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.archive-title,
.order-title,
.collection-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.archive-title a,
.order-title a,
.collection-title a {
    color: var(--m-black);
    text-decoration: none;
}

.archive-meta,
.order-meta,
.collection-meta {
    display: flex;
    gap: 16px;
    color: var(--m-gray-500);
    font-size: 13px;
    align-items: center;
}

/* Actions */
.archive-actions {
    margin-top: 12px;
}

/* ==============================================
   Forms
   ============================================== */
.user-profile-form .form-section {
    margin-bottom: 32px;
}

.user-profile-form .form-item {
    margin-bottom: 24px;
}

.user-profile-form .form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--m-black);
}

.user-profile-form .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--m-gray-200);
    border-radius: 6px;
    transition: all 0.2s;
    font-family: var(--m-font-sans);
}

.user-profile-form .form-input:focus {
    border-color: var(--m-black);
    outline: none;
}

.user-profile-form .form-input[disabled] {
    background-color: var(--m-gray-50);
    cursor: not-allowed;
}

.input-with-action {
    display: flex;
    gap: 12px;
}

.btn-action {
    padding: 0 16px;
    background: transparent;
    border: 1px solid var(--m-gray-200);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.form-actions {
    margin-top: 40px;
    display: flex;
    gap: 16px;
}

/* ==============================================
   Avatar Upload
   ============================================== */
.user-avatar-upload {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 40px;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-upload-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--m-black);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ==============================================
   Empty State
   ============================================== */
.empty-state {
    padding: 60px 0;
    text-align: center;
    color: var(--m-gray-400);
}

.empty-state svg {
    margin-bottom: 16px;
    color: var(--m-gray-200);
}

.empty-state p {
    margin: 0;
    font-size: 15px;
}

/* ==============================================
   Pagination
   ============================================== */
.pagination-wrapper {
    margin-top: 40px;
    text-align: center;
}

.pagination {
    display: inline-flex;
    gap: 8px;
}

.pagination>li>a,
.pagination>li>span {
    border: none;
    background: transparent;
    color: var(--m-gray-600);
    padding: 6px 12px;
    border-radius: 4px;
}

.pagination>.active>a,
.pagination>.active>span {
    background: var(--m-black);
    color: #fff;
}

/* ==============================================
   Channel Tabs (for Archives)
   ============================================== */
.channel-tabs {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--m-gray-100);
    padding-bottom: 0;
    overflow-x: auto;
    scrollbar-width: none;
    /* Firefox */
}

.channel-tabs::-webkit-scrollbar {
    display: none;
}

.channel-tab {
    padding-bottom: 12px;
    position: relative;
    white-space: nowrap;
}

.channel-tab a {
    color: var(--m-gray-500);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.channel-tab.active a {
    color: var(--m-black);
    font-weight: 600;
}

.channel-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--m-black);
    border-radius: 2px;
}

/* ==============================================
   VIP Status & Badge
   ============================================== */
.vip-status {
    display: flex;
    align-items: center;
    gap: 16px;
}

.vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%);
    color: #8B4513;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
}

.vip-badge.vip-none {
    background: var(--m-gray-100);
    color: var(--m-gray-500);
}

.vip-expire {
    font-size: 13px;
    color: var(--m-gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==============================================
   VIP Tabs (Custom Style)
   ============================================== */
.vip-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    padding: 4px;
    background: var(--m-gray-50);
    border-radius: 12px;
}

.vip-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.vip-tab.active {
    background: var(--m-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.vip-tab-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--m-gray-600);
}

.vip-tab.active .vip-tab-name {
    color: var(--m-black);
}

.vip-tab-label {
    font-size: 12px;
    color: var(--m-gray-400);
    margin-top: 2px;
}

/* ==============================================
   VIP Panels & Sections
   ============================================== */
.vip-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.vip-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vip-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--m-black);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--m-gray-400);
    font-size: 16px;
}

/* ==============================================
   VIP Rights Grid
   ============================================== */
.vip-rights {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.vip-right-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--m-gray-50);
    border-radius: 12px;
    align-items: flex-start;
}

.right-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.right-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.right-content {
    flex: 1;
}

.right-title {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--m-black);
}

.right-desc {
    margin: 0;
    font-size: 13px;
    color: var(--m-gray-500);
    line-height: 1.4;
}

/* ==============================================
   VIP Price Cards
   ============================================== */
.vip-prices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.price-card {
    border: 2px solid var(--m-gray-100);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.price-card:hover {
    border-color: var(--m-gray-300);
}

.price-card.active {
    border-color: var(--m-black);
    background: var(--m-gray-50);
}

.price-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--m-gray-600);
    margin-bottom: 12px;
}

.price-value {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    color: var(--m-black);
    line-height: 1;
    margin-bottom: 8px;
}

.price-currency {
    font-size: 16px;
    margin-top: 4px;
    font-weight: 600;
}

.price-number {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--m-font-sans);
}

.price-desc {
    font-size: 13px;
    color: var(--m-gray-400);
}

@media (max-width: 768px) {
    .vip-prices {
        grid-template-columns: 1fr;
    }
}

/* ==============================================
   Payment Methods
   ============================================== */
.payment-methods {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.payment-item {
    position: relative;
    border: 1px solid var(--m-gray-200);
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--m-white);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
}

.payment-item img {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.payment-item input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
}

.payment-item.active {
    border-color: var(--m-black);
    background: var(--m-gray-50);
}

/* ==============================================
   VIP Records List
   ============================================== */
.vip-records {
    display: flex;
    flex-direction: column;
}

.vip-record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--m-gray-100);
}

.vip-record-item:last-child {
    border-bottom: none;
}

.record-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.record-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--m-black);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.record-title i {
    color: #FDB931;
}

.record-meta {
    font-size: 13px;
    color: var(--m-gray-400);
}

.record-status {
    font-size: 14px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 4px;
    background: var(--m-gray-100);
    color: var(--m-gray-600);
}

.record-status.success {
    background: #ecfdf5;
    color: #059669;
}

/* ==============================================
   Core Login/Register Page Overrides
   ============================================== */
/* Container & Background */
#content-container .container {
    max-width: 480px;
    padding-top: 60px;
}

.login-section {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Tabs */
.logon-tab {
    display: flex;
    justify-content: center;
    gap: 32px;
    border-bottom: none !important;
    margin-bottom: 40px;
}

.logon-tab a {
    float: none !important;
    background: transparent !important;
    border: none !important;
    font-size: 18px;
    font-weight: 500;
    color: var(--m-gray-400);
    padding: 8px 0;
    position: relative;
    transition: all 0.2s;
}

.logon-tab a.active {
    color: var(--m-black);
    font-weight: 600;
}

.logon-tab a.active:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--m-black);
    border-radius: 2px;
}

.logon-tab a:hover {
    color: var(--m-black);
}

/* Form Container */
.login-main {
    background: var(--m-white);
    padding: 0 !important;
    border: none !important;
}

/* Form Controls */
.login-main .form-group {
    margin-bottom: 24px;
}

.login-main .control-label {
    font-weight: 500;
    color: var(--m-black);
    margin-bottom: 8px;
    font-size: 14px;
}

.login-main .form-control {
    height: 48px;
    padding: 10px 16px;
    border: 1px solid var(--m-gray-200);
    border-radius: 8px !important;
    background: var(--m-gray-50);
    box-shadow: none !important;
    font-size: 15px;
    transition: all 0.2s;
}

.login-main .form-control:focus {
    background: var(--m-white);
    border-color: var(--m-black);
}

/* Buttons */
.login-main .btn-primary {
    background: var(--m-black);
    border-color: var(--m-black);
    color: #fff;
    height: 48px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
    margin-top: 16px;
}

.login-main .btn-primary:hover {
    background: #333;
    border-color: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Secondary Button (Register on Login page) */
.login-main .btn-default {
    background: transparent;
    border: 1px solid var(--m-gray-200);
    color: var(--m-gray-600);
    height: 48px;
    border-radius: 24px;
    font-size: 15px;
    margin-top: 16px;
}

.login-main .btn-default:hover {
    border-color: var(--m-black);
    color: var(--m-black);
    background: transparent;
}

/* Checkbox & Forgot Password */
.login-main .checkbox label {
    padding-left: 24px;
    color: var(--m-gray-600);
}

.login-main .btn-forgot {
    color: var(--m-gray-500);
    font-size: 14px;
}

.login-main .btn-forgot:hover {
    color: var(--m-black);
    text-decoration: underline;
}

/* Footer Copyright Hide (Optional for layout clean-up) */
footer.footer {
    border-top: none;
    background: transparent;
    padding: 40px 0;
    color: var(--m-gray-400);
}

/* ==============================================
   Deep Login Optimization (Action-Specific)
   ============================================== */

/* 1. Hide Navbar & Footer */
body.action-login .navbar,
body.action-login footer.footer,
body.action-register .navbar,
body.action-register footer.footer {
    display: none !important;
}

/* 2. Hide Tabs */
body.action-login .logon-tab,
body.action-register .logon-tab {
    display: none !important;
}

/* 3. Global Layout Centering */
body.action-login #content-container .container,
body.action-register #content-container .container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 0;
}

/* 4. Add Logo (Moved to HTML for clickability) */
body.action-login .login-header-logo,
body.action-register .login-header-logo {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 40px;
}

body.action-login .login-header-logo img,
body.action-register .login-header-logo img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

/* 5. Flexbox Order Reordering for Social Login */
body.action-login #login-form,
body.action-register #register-form {
    display: flex;
    flex-direction: column;
}

/* Social Login Parent */
body.action-login #login-form .social-login,
body.action-register #register-form .social-login {
    order: -1;
    /* Move to Top */
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px !important;
}

/* Social Login Buttons Base */
body.action-login .social-login a,
body.action-register .social-login a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 60px !important;
    min-height: 60px !important;
    border-radius: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none !important;
    box-shadow: none !important;
    line-height: 60px !important;
    /* Fallback */
}

body.action-login #login-form .social-login a:hover,
body.action-register #register-form .social-login a:hover {
    transform: translateY(-2px);
}

/* Social Icons Spacing */
.social-login a i {
    margin-right: 12px;
    /* Increased from 8px */
    font-size: 20px;
    /* Increased from 18px */
}

/* 1. WeChat (Green) */
body.action-login .social-login .btn-success,
body.action-register .social-login .btn-success {
    background-color: rgba(7, 193, 96, 0.12);
    color: #07c160;
    box-shadow: none;
    border: 1px solid rgba(7, 193, 96, 0.1);
}

body.action-login .social-login .btn-success:hover,
body.action-register .social-login .btn-success:hover {
    background-color: rgba(7, 193, 96, 0.18);
    box-shadow: none;
    transform: translateY(-1px);
}

/* 2. QQ (Blue) */
body.action-login .social-login .btn-info,
body.action-register .social-login .btn-info {
    background-color: rgba(0, 153, 255, 0.12);
    color: #0099ff;
    box-shadow: none;
    border: 1px solid rgba(0, 153, 255, 0.1);
}

body.action-login .social-login .btn-info:hover,
body.action-register .social-login .btn-info:hover {
    background-color: rgba(0, 153, 255, 0.18);
    box-shadow: none;
    transform: translateY(-1px);
}

/* 3. Weibo (Red) */
body.action-login .social-login .btn-danger,
body.action-register .social-login .btn-danger {
    background-color: rgba(255, 90, 95, 0.12);
    color: #ff5a5f;
    box-shadow: none;
    border: 1px solid rgba(255, 90, 95, 0.1);
}

body.action-login .social-login .btn-danger:hover,
body.action-register .social-login .btn-danger:hover {
    background-color: rgba(255, 90, 95, 0.18);
    box-shadow: none;
    transform: translateY(-1px);
}

/* Add Separation Divider visual */
body.action-login #login-form .social-login::after,
body.action-register #register-form .social-login::after {
    content: '或使用账号登录';
    display: block;
    text-align: center;
    font-size: 13px;
    color: var(--m-gray-400);
    margin-top: 24px;
    position: relative;
    width: 100%;
}

/* Hide Default Register Button Link helper in form group if visually redundant? No keep it */

/* ==============================================
   Pixel-Level Refinements (TypeZen)
   ============================================== */

/* Soften Labels */
.login-main .control-label {
    color: var(--m-gray-500);
}

/* Input Focus Ring */
.login-main .form-control:focus {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05) !important;
}

/* Secondary Button (Ghost Style) */
.login-main .btn-default.no-border {
    border: none !important;
    background: transparent !important;
    color: var(--m-gray-600);
    box-shadow: none;
    font-weight: normal;
}

.login-main .btn-default.no-border:hover {
    background: var(--m-gray-50) !important;
    color: var(--m-black);
}



/* Ensure consistent spacing for social login divider */
body.action-login .social-login::after,
body.action-register .social-login::after {
    margin-top: 32px;
    margin-bottom: 8px;
}

/* Login Announcement */
.login-alert {
    background: #fff9e6;
    /* Soft amber */
    color: #bfa15f;
    /* Darker amber text */
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.4;
    text-align: center;
}


/* Captcha Input Group Fix */
.login-main .input-group .form-control {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    height: 48px;
}

.login-main .input-group-btn .btn {
    height: 48px;
    line-height: normal;
    display: flex;
    /* Ensure vertical centering */
    align-items: center;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    margin: 0;
    background: var(--m-gray-100);
    border: 1px solid var(--m-gray-200);
    border-left: none;
    color: var(--m-gray-600);
    box-shadow: none !important;
    padding: 0 16px;
    font-size: 14px;
}

.login-main .input-group-btn .btn:hover {
    background: var(--m-gray-200);
    color: var(--m-black);
}