/* 登录 / 注册 / 个人中心 */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.nav-login-btn,
.nav-register-btn {
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
}
.nav-login-btn { color: #555; }
.nav-login-btn:hover { color: var(--primary); text-decoration: none; }
.nav-register-btn { background: var(--primary); color: #fff; }
.nav-register-btn:hover { background: var(--primary-dark); text-decoration: none; }

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    padding: 4px 12px 4px 4px;
    border-radius: 20px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    text-decoration: none;
}
.nav-user-btn:hover { color: var(--primary); text-decoration: none; }
.nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-avatar-img { object-fit: cover; background: none; }

.auth-page {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 36px 32px;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
}
.auth-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: 8px; color: #111; }
.auth-subtitle { text-align: center; color: #888; font-size: 14px; margin-bottom: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #555; margin-bottom: 6px; }
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-error { color: #dc2626; font-size: 13px; margin-bottom: 12px; display: none; }
.form-error.show { display: block; }
.form-check-row { margin-bottom: 14px; font-size: 14px; color: #666; }
.input-with-btn { display: flex; gap: 10px; }
.input-with-btn .form-input { flex: 1; }
.auth-captcha { height: 40px; border-radius: 8px; cursor: pointer; }
.auth-submit {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
}
.auth-submit:hover { background: var(--primary-dark); }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: #888; }
.auth-footer a { color: var(--primary); font-weight: 500; }

.user-layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    gap: 24px;
    align-items: flex-start;
}
.user-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 0;
    position: sticky;
    top: 72px;
}
.user-profile-brief { text-align: center; padding: 0 20px 16px; border-bottom: 1px solid #f0f0f0; margin-bottom: 8px; }
.user-profile-meta { min-width: 0; }
.user-profile-brief .avatar-lg {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--primary); color: #fff;
    font-size: 24px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 10px;
}
.user-profile-brief .avatar-lg.has-img { background: none; overflow: hidden; padding: 0; }
.user-profile-brief .avatar-lg img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-profile-brief .name { font-size: 16px; font-weight: 600; color: #111; }
.user-profile-brief .email { font-size: 12px; color: #888; margin-top: 2px; }

.dash-activity-user {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 2px;
}
.sidebar-balance { font-size: 13px; color: var(--primary); margin-top: 8px; font-weight: 500; }

.user-side-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.user-side-nav a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: #555;
    text-decoration: none;
}
.user-side-nav a:hover { background: #f3f4f6; color: var(--primary); text-decoration: none; }
.user-side-nav a.active { background: #eff6ff; color: var(--primary); font-weight: 500; }
.user-side-nav .logout-link { color: #dc2626; margin-top: 8px; border-top: 1px solid #f0f0f0; padding-top: 14px; }

.user-main { flex: 1; min-width: 0; }
.user-panel {
    display: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 28px;
}
.user-panel.active { display: block; }
.user-panel h2 { font-size: 1.25rem; font-weight: 700; color: #111; margin-bottom: 6px; }
.user-panel .panel-desc { font-size: 14px; color: #888; margin-bottom: 20px; }
.user-subtitle { font-size: 16px; margin: 28px 0 12px; color: #333; }

.panel-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.search-input { flex: 1; min-width: 180px; max-width: 320px; }

.btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-ghost { background: #f3f4f6; color: #555; border: 1px solid #e5e7eb; }
.btn-ghost:hover { background: #e5e7eb; color: var(--primary); }
.btn-danger { background: #fee2e2; color: #dc2626; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { display: block; font-size: 12px; color: #999; margin-top: 4px; }
.form-input[readonly] { background: #f9fafb; color: #666; cursor: not-allowed; }

.avatar-upload-area {
    display: flex; align-items: center; gap: 20px;
    margin-bottom: 20px; padding: 16px;
    background: #f9fafb; border-radius: 10px; border: 1px solid #e5e7eb;
}
.avatar-preview-lg {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--primary); color: #fff;
    font-size: 28px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.avatar-preview-lg img { width: 100%; height: 100%; object-fit: cover; }
.avatar-actions { display: flex; flex-direction: column; gap: 8px; }

.recharge-card, .invite-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
}
.recharge-balance-display { font-size: 16px; margin-bottom: 16px; }
.recharge-balance-display strong { color: var(--primary); font-size: 22px; }
.recharge-options { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.recharge-amount,
.recharge-pay-type {
    padding: 10px 20px; border-radius: 8px;
    border: 1px solid #d1d5db; background: #fff;
    font-size: 15px; font-weight: 600; cursor: pointer;
}
.recharge-amount.active, .recharge-amount:hover,
.recharge-pay-type.active, .recharge-pay-type:hover { border-color: var(--primary); background: #eff6ff; color: var(--primary); }

.invite-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.invite-stat { text-align: center; padding: 14px; background: #fff; border-radius: 8px; border: 1px solid #e5e7eb; }
.invite-stat .num { display: block; font-size: 20px; font-weight: 700; color: var(--primary); }
.invite-stat .label { font-size: 12px; color: #888; }

.dash-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.dash-stat-card {
    padding: 16px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px;
}
.dash-stat-label { display: block; font-size: 12px; color: #888; margin-bottom: 6px; }
.dash-stat-value { font-size: 22px; font-weight: 700; color: var(--primary); }

.dash-quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 8px; }
.dash-quick-card {
    padding: 14px 16px; text-align: left;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    cursor: pointer; font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
.dash-quick-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(37,99,235,.08); }
.dash-quick-card strong { display: block; font-size: 14px; color: #111; margin-bottom: 4px; }
.dash-quick-card span { font-size: 12px; color: #888; }

.dash-mini-list { font-size: 14px; }
.dash-mini-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid #f0f0f0;
}
.dash-mini-item:last-child { border-bottom: none; }

.dash-activity-hint { margin: -4px 0 12px; font-size: 13px; }
.dash-activity-list { font-size: 14px; }
.dash-activity-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.dash-activity-item:last-child { border-bottom: none; }
.dash-activity-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #1d4ed8;
    background: #eff6ff;
}
.dash-activity-item.is-comment .dash-activity-type {
    color: #b45309;
    background: #fffbeb;
}
.dash-activity-item.is-media .dash-activity-type {
    color: #047857;
    background: #ecfdf5;
}
.dash-activity-item.is-recharge .dash-activity-type {
    color: #7c3aed;
    background: #f5f3ff;
}
.dash-activity-body { min-width: 0; }
.dash-activity-title {
    display: block;
    color: #111;
    font-weight: 500;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    background: none;
    border: 0;
    padding: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
}
a.dash-activity-title:hover,
button.dash-activity-title:hover { color: var(--primary, #2563eb); }
.dash-activity-meta {
    margin-top: 4px;
    font-size: 12px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-activity-date {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    padding-top: 2px;
}

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 2000; display: none;
    align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 12px; padding: 24px;
    width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.modal-box-lg { max-width: 640px; }
.modal-box-app {
    max-width: 720px;
    max-height: min(92vh, 900px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0;
}
.modal-box-app > h3 {
    flex-shrink: 0;
    margin-bottom: 12px;
}
.modal-box-app > form {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}
.modal-box-app .modal-actions {
    position: sticky;
    bottom: 0;
    margin: 0 -4px 0 0;
    padding: 12px 4px 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0), #fff 28%);
    z-index: 2;
}
.modal-box-app #app-readme-editor .md-textarea,
.modal-box-app #app-readme-editor .md-preview {
    min-height: 200px;
}
.modal-box h3 { font-size: 18px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.cover-upload { display: flex; align-items: center; gap: 14px; }
.cover-preview {
    width: 120px; height: 72px; border-radius: 8px;
    background: #f3f4f6; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }

.form-tag-select { display: flex; flex-wrap: wrap; gap: 6px; }
.form-tag-select .tag-pick {
    border: 1px solid #e5e7eb; cursor: pointer;
    background: #f3f4f6; font-family: inherit;
    padding: 4px 10px; border-radius: 20px; font-size: 12px;
}
.form-tag-select .tag-pick.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.data-table, .user-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td, .user-table th, .user-table td {
    padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0;
}
.data-table th, .user-table th { font-weight: 600; color: #888; font-size: 12px; }
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; }
.status-badge.paid { background: #dcfce7; color: #166534; }
.status-badge.pending { background: #fef9c3; color: #854d0e; }
.status-badge.published { background: #dbeafe; color: #1e40af; }
.status-badge.failed { background: #fee2e2; color: #991b1b; }
.status-badge.failed { background: #fee2e2; color: #991b1b; }
.status-badge.draft { background: #f1f3f4; color: #666; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 14px;
}
.empty-state .empty-icon { font-size: 32px; margin-bottom: 8px; }

.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.app-name-cell { display: flex; align-items: center; gap: 10px; }
.app-thumb {
    width: 40px; height: 40px; border-radius: 8px;
    object-fit: cover; flex-shrink: 0;
}
.app-thumb-placeholder {
    width: 40px; height: 40px; border-radius: 8px;
    background: #f3f4f6; display: flex; align-items: center;
    justify-content: center; font-size: 18px; flex-shrink: 0;
}
.version-item {
    padding: 12px 0; border-bottom: 1px solid #f0f0f0;
}
.version-item:last-child { border-bottom: none; }
.version-item-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.version-item-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.user-mobile-toggle {
    display: none;
    position: fixed; bottom: 20px; right: 20px; z-index: 1500;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary); border: none; cursor: pointer;
    flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    box-shadow: 0 4px 16px rgba(37,99,235,.35);
}
.user-mobile-toggle span {
    display: block; width: 20px; height: 2px; background: #fff; border-radius: 1px;
    transition: transform .2s, opacity .2s;
}
.user-mobile-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.user-mobile-toggle.is-open span:nth-child(2) { opacity: 0; }
.user-mobile-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.user-sidebar-backdrop {
    position: fixed;
    inset: 0;
    top: 64px;
    z-index: 1350;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.user-sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.user-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 12px;
    max-width: 100%;
}

.user-main .data-table {
    min-width: 520px;
}

/* 我的评论列表 */
.user-comment-list { display: flex; flex-direction: column; gap: 12px; }
.user-comment-item {
    padding: 16px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}
.user-comment-head {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin-bottom: 10px; font-size: 13px;
}
.user-comment-article a { color: var(--primary); font-weight: 600; text-decoration: none; }
.user-comment-article a:hover { text-decoration: underline; }
.user-comment-tag {
    font-size: 11px; padding: 2px 8px; border-radius: 99px;
    background: #f3f4f6; color: #666;
}
.user-comment-body {
    font-size: 14px; line-height: 1.65; color: #333;
    margin: 0 0 8px;
}
.user-comment-date { font-size: 12px; color: #888; }
.user-comment-foot {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
    margin-top: 4px;
}
.user-comment-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.user-comment-item.is-reply {
    border-left: 3px solid color-mix(in srgb, var(--primary) 55%, #e5e7eb);
    padding-left: 15px;
}
.user-comment-parent {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f9fafb;
    border-left: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
}
.user-comment-parent-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 600;
}
.user-comment-parent-body {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.55;
}
.user-comment-parent-foot { margin-top: 6px; }
.user-comment-parent-link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
}
.user-comment-parent-link:hover { text-decoration: underline; }
.user-comment-reply-form {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}
.user-comment-reply-form.hidden { display: none; }
.user-comment-reply-actions {
    display: flex; gap: 8px; margin-top: 8px;
}
.forum-post-link { color: var(--primary); font-weight: 600; text-decoration: none; }
.forum-post-link:hover { text-decoration: underline; }
.table-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.uc-loading { text-align: center; padding: 24px; color: #888; font-size: 14px; }

.uc-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.uc-pagination button { min-width: 36px; padding: 6px 10px; border: 1px solid #e5e7eb; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; }
.uc-pagination button.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.uc-pagination button:disabled { opacity: .45; cursor: not-allowed; }

.toast {
    position: fixed; top: 80px; left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 12px 24px; border-radius: 8px;
    font-size: 14px; z-index: 3000; opacity: 0; transition: all .3s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.toast-error { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }

.md-toolbar { display: flex; gap: 4px; padding: 8px; background: #f9fafb; border: 1px solid #e5e7eb; border-bottom: none; border-radius: 8px 8px 0 0; flex-wrap: wrap; }
.md-toolbar button { padding: 4px 8px; border: 1px solid #e5e7eb; background: #fff; border-radius: 4px; cursor: pointer; font-size: 12px; }
.md-textarea { border-radius: 0 0 8px 8px !important; min-height: 120px; font-family: monospace; font-size: 13px; }

@media (max-width: 900px) {
    .user-mobile-toggle,
    .user-sidebar-backdrop {
        display: none !important;
    }

    .user-layout {
        flex-direction: column;
        position: relative;
        padding: 12px 14px 32px;
        gap: 12px;
        max-width: 100%;
        min-width: 0;
    }

    /* 手机端侧栏常显：资料条 + 横向菜单，不再藏进抽屉 */
    .user-sidebar {
        position: static !important;
        left: auto;
        top: auto;
        bottom: auto;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        transform: none !important;
        border-radius: 12px;
        overflow: visible;
        box-shadow: none;
        padding: 0;
        background: #fff;
        border: 1px solid #e5e7eb;
        z-index: auto;
    }

    .user-sidebar.is-open {
        transform: none !important;
    }

    .user-profile-brief {
        display: flex;
        align-items: center;
        text-align: left;
        gap: 12px;
        padding: 12px 14px;
        margin: 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .user-profile-brief .avatar-lg {
        width: 44px;
        height: 44px;
        font-size: 18px;
        margin: 0;
        flex-shrink: 0;
    }

    .user-profile-meta {
        min-width: 0;
        flex: 1;
    }

    .user-profile-brief .name {
        font-size: 15px;
        line-height: 1.3;
    }

    .user-profile-brief .email {
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    .sidebar-balance {
        margin-top: 4px;
        font-size: 12px;
    }

    .user-side-nav {
        display: flex !important;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 10px 12px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        overscroll-behavior-x: contain;
    }

    .user-side-nav::-webkit-scrollbar {
        display: none;
    }

    .user-side-nav a {
        display: inline-flex !important;
        align-items: center;
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 12px;
        border-radius: 16px;
        font-size: 13px;
        line-height: 1.2;
        background: #f3f4f6;
        color: #444;
        border-left: none !important;
    }

    .user-side-nav a:hover {
        background: #e5e7eb;
        color: var(--primary);
    }

    .user-side-nav a.active {
        background: var(--primary);
        color: #fff !important;
        font-weight: 600;
    }

    .user-side-nav .logout-link {
        margin-top: 0;
        padding-top: 8px;
        border-top: none;
        color: #dc2626;
        background: #fee2e2;
    }

    .user-main {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .user-panel {
        padding: 18px 14px;
        border-radius: 12px;
        max-width: 100%;
        overflow: hidden;
    }

    .user-panel h2 {
        font-size: 1.15rem;
    }

    .user-panel .panel-desc {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .form-row { grid-template-columns: 1fr; gap: 0; }

    .invite-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .invite-stat {
        padding: 10px 6px;
    }

    .invite-stat .num {
        font-size: 16px;
        word-break: break-all;
    }

    .dash-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .dash-stat-card {
        padding: 12px;
        min-width: 0;
    }

    .dash-stat-value {
        font-size: 18px;
        word-break: break-word;
    }

    .dash-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .dash-quick-card {
        padding: 12px;
        min-width: 0;
    }

    .panel-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .search-input {
        min-width: 0;
        max-width: none;
        width: 100%;
        font-size: 16px;
    }

    .panel-toolbar .btn {
        width: 100%;
        text-align: center;
    }

    .avatar-upload-area {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 14px;
    }

    .avatar-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .input-with-btn {
        flex-direction: column;
    }

    .input-with-btn .btn {
        width: 100%;
    }

    .recharge-card,
    .invite-card {
        padding: 14px;
    }

    .recharge-options {
        gap: 6px;
    }

    .recharge-amount,
    .recharge-pay-type {
        padding: 8px 12px;
        font-size: 14px;
        flex: 1 1 calc(33.33% - 6px);
        text-align: center;
        min-width: 0;
    }

    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px;
        max-width: 100%;
    }

    #pf-api-password {
        font-size: 13px;
        word-break: break-all;
    }

    .modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .modal-box,
    .modal-box-lg,
    .modal-box-app {
        max-width: 100%;
        max-height: min(92vh, 100%);
        border-radius: 14px 14px 0 0;
        padding: 18px 14px calc(18px + env(safe-area-inset-bottom, 0px));
    }

    .modal-box-app {
        padding-bottom: 0;
    }

    .modal-box-app > form {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .modal-box-app .modal-actions {
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }

    .modal-actions {
        flex-wrap: wrap;
    }

    .modal-actions .btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .cover-upload {
        flex-direction: column;
        align-items: flex-start;
    }

    .cover-preview {
        width: 100%;
        max-width: 240px;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .user-comment-item {
        padding: 12px 14px;
    }

    .user-comment-head,
    .user-comment-foot {
        gap: 6px;
    }

    .dash-mini-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .dash-activity-item {
        grid-template-columns: auto 1fr;
        gap: 8px 12px;
    }
    .dash-activity-date {
        grid-column: 2;
        padding-top: 0;
    }

    .header-auth .nav-user-btn span:not(.nav-avatar):not(.nav-avatar-img) { display: none; }

    body.user-sidebar-open {
        overflow: auto;
    }
}

@media (max-width: 600px) {
    .user-layout {
        padding: 12px 12px 28px;
    }

    .user-panel {
        padding: 14px 12px;
    }

    .dash-stat-grid,
    .dash-quick-grid {
        grid-template-columns: 1fr 1fr;
    }

    .invite-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .invite-stat .label {
        font-size: 11px;
    }

    .recharge-amount,
    .recharge-pay-type {
        flex: 1 1 calc(50% - 6px);
    }

    .user-main .data-table {
        min-width: 480px;
        font-size: 13px;
    }

    .data-table th,
    .data-table td,
    .user-table th,
    .user-table td {
        padding: 8px 10px;
    }

    .app-name-cell {
        gap: 8px;
    }

    .app-thumb,
    .app-thumb-placeholder {
        width: 32px;
        height: 32px;
    }

    .toast {
        left: 12px;
        right: 12px;
        transform: translateY(-20px);
        width: auto;
        max-width: none;
        text-align: center;
    }

    .toast.show {
        transform: translateY(0);
    }
}

