/* 邀请返利页面样式 */

/* 全局防溢出设置 */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

/* 移除固定的container样式，让Bootstrap响应式系统正常工作 */

/* 页面布局 */
.main-content {
    min-height: calc(100vh - 64px - 102px);
    /* 减去导航栏和页脚高度 */
    padding-top: 5rem;
    /* 增加与导航栏的间距 */
    margin-bottom: 3rem;
    /* 增加与页脚的间距 */
    width: 100%;
    overflow-x: hidden;
}

/* 页面标题区域 */
.page-header {
    position: relative;
    margin-bottom: 2rem;
}

.page-title-bg {
    position: relative;
    padding: 2rem 0;
    text-align: center;
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-info) 100%);
    border-radius: var(--border-radius-custom);
    color: white;
    overflow: hidden;
}

.page-title-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 60% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px, 60px 60px, 30px 30px, 40px 40px;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.page-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

/* 统计卡片 */
.stats-card {
    border: none;
    border-radius: var(--border-radius-custom);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stats-card:hover {
    /* 移除transform以防止布局偏移 */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius-custom);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(var(--bs-primary-rgb), 0.05);
    /* 移除transform以防止布局偏移 */
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.stat-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.stat-item:hover .stat-icon::before {
    left: 100%;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--bs-dark);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--bs-secondary);
    font-weight: 500;
}

/* 卡片通用样式 */
.invite-card,
.transfer-card,
.withdraw-card,
.commission-card {
    border: none;
    border-radius: var(--border-radius-custom);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    animation: slideInUp 0.6s ease-out;
    overflow: hidden;
}

.invite-card:hover,
.transfer-card:hover,
.withdraw-card:hover,
.commission-card:hover {
    /* 移除transform以防止布局偏移 */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.card-header {
    background: linear-gradient(135deg, var(--bs-light) 0%, rgba(var(--bs-primary-rgb), 0.1) 100%);
    border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.1);
    border-radius: var(--border-radius-custom) var(--border-radius-custom) 0 0 !important;
}

.card-title {
    color: var(--bs-dark);
    font-weight: 600;
}

/* 邀请码列表 */
.invite-codes-list {
    max-height: 400px;
    overflow-y: auto;
}

.invite-code-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--border-radius-custom);
    margin-bottom: 0.75rem;
    background: var(--bs-body-bg);
    transition: all 0.3s ease;
}

.invite-code-item:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 2px 10px rgba(var(--bs-primary-rgb), 0.1);
    /* 移除transform以防止布局偏移 */
}

.invite-code-info {
    flex: 1;
}

.invite-code {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bs-primary);
    margin-bottom: 0.25rem;
}

.invite-code-meta {
    font-size: 0.85rem;
    color: var(--bs-secondary);
}

.invite-code-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-copy {
    position: relative;
    overflow: hidden;
}

.btn-copy::after {
    content: '已复制!';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bs-success);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn-copy.copied::after {
    opacity: 1;
}

/* 余额信息 */
.balance-info {
    background: linear-gradient(135deg, var(--bs-light) 0%, rgba(var(--bs-success-rgb), 0.1) 100%);
    border-radius: var(--border-radius-custom);
    padding: 1rem;
    border: 1px solid rgba(var(--bs-success-rgb), 0.2);
}

.balance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.balance-item:last-child {
    margin-bottom: 0;
}

.balance-label {
    font-size: 0.9rem;
    color: var(--bs-secondary);
    font-weight: 500;
}

.balance-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* 表单样式 */
.form-control {
    border-radius: var(--border-radius-custom);
    border: 1px solid var(--bs-border-color);
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.input-group-text {
    border-radius: var(--border-radius-custom) 0 0 var(--border-radius-custom);
    background: var(--bs-light);
    border-color: var(--bs-border-color);
}

/* 按钮样式 */
.btn {
    border-radius: var(--border-radius-custom);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    /* 移除transform以防止布局偏移 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 佣金记录列表 */
.commission-list {
    max-height: 500px;
    overflow-y: auto;
}

.commission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    transition: all 0.3s ease;
}

.commission-item:hover {
    background: rgba(var(--bs-primary-rgb), 0.05);
    /* 移除transform以防止布局偏移 */
}

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

.commission-info {
    flex: 1;
}

.commission-user {
    font-weight: 600;
    color: var(--bs-dark);
    margin-bottom: 0.25rem;
}

.commission-meta {
    font-size: 0.85rem;
    color: var(--bs-secondary);
}

.commission-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bs-success);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--bs-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    margin-bottom: 0.5rem;
    color: var(--bs-dark);
}

.empty-state p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* 分页样式 */
.pagination {
    margin-top: 1.5rem;
}

.page-link {
    border-radius: var(--border-radius-custom);
    margin: 0 0.125rem;
    border: 1px solid var(--bs-border-color);
    color: var(--bs-primary);
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
    /* 移除transform以防止布局偏移 */
}

.page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* 加载状态 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-custom);
    z-index: 10;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 992px) {
    .main-content {
        padding-top: 4rem;
    }

    .page-title {
        font-size: 2.2rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .stat-item {
        padding: 0.75rem;
    }

    .stat-icon {
        width: 55px;
        height: 55px;
        font-size: 1.4rem;
    }

    .stat-number {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding-top: 3rem;
        margin-bottom: 2rem;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .page-subtitle {
        font-size: 0.95rem;
    }

    .page-title-bg {
        padding: 1.5rem 1rem;
    }

    .stat-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        padding: 0.75rem 0.5rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
        margin: 0 auto;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .invite-code-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem 0.75rem;
    }

    .invite-code-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .invite-code-actions .btn {
        flex: 1;
        min-width: 120px;
    }

    .commission-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem 0.75rem;
    }

    .commission-amount {
        align-self: center;
        font-size: 1.2rem;
    }

    .balance-info {
        padding: 0.75rem;
    }

    .form-control,
    .form-select {
        font-size: 16px;
        /* 防止iOS缩放 */
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .main-content {
        padding-top: 3.5rem;
        /* 增加移动端卡片到导航栏的间距 */
    }

    .page-title {
        font-size: 1.6rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    .page-title-bg {
        padding: 1.25rem 0.75rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem 0.75rem;
    }

    .card-header {
        padding: 0.75rem;
    }

    .stat-item {
        padding: 0.5rem;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .invite-code {
        font-size: 1rem;
        word-break: break-all;
    }

    .commission-user {
        font-size: 0.95rem;
    }

    .commission-meta {
        font-size: 0.8rem;
    }

    .commission-amount {
        font-size: 1.1rem;
    }

    .empty-state {
        padding: 2rem 0.75rem;
    }

    .empty-state i {
        font-size: 2.5rem;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }

    .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        margin: 0;
    }
}

/* 超小屏幕优化 */
@media (max-width: 400px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .page-subtitle {
        font-size: 0.85rem;
    }

    .card-body {
        padding: 0.75rem 0.5rem;
    }

    .card-header {
        padding: 0.5rem;
    }

    .stat-item {
        padding: 0.5rem 0.25rem;
    }

    .invite-code-actions .btn {
        min-width: 100px;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
}

/* 暗色主题适配 */
[data-bs-theme="dark"] .stats-card,
[data-bs-theme="dark"] .invite-card,
[data-bs-theme="dark"] .transfer-card,
[data-bs-theme="dark"] .commission-card,
[data-bs-theme="dark"] .withdraw-card {
    background: rgba(33, 37, 41, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.125);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .stats-card:hover,
[data-bs-theme="dark"] .invite-card:hover,
[data-bs-theme="dark"] .transfer-card:hover,
[data-bs-theme="dark"] .commission-card:hover,
[data-bs-theme="dark"] .withdraw-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .card-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(var(--bs-primary-rgb), 0.15) 100%);
    border-bottom-color: rgba(255, 255, 255, 0.125);
}

[data-bs-theme="dark"] .card-title {
    color: rgba(255, 255, 255, 0.95);
}

[data-bs-theme="dark"] .page-title-bg {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-info) 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .stat-item:hover {
    background: rgba(var(--bs-primary-rgb), 0.1);
}

[data-bs-theme="dark"] .stat-number {
    color: rgba(255, 255, 255, 0.95);
}

[data-bs-theme="dark"] .stat-label {
    color: rgba(255, 255, 255, 0.7);
}

[data-bs-theme="dark"] .invite-code-item {
    background: rgba(33, 37, 41, 0.8);
    border-color: rgba(255, 255, 255, 0.125);
}

[data-bs-theme="dark"] .invite-code-item:hover {
    border-color: var(--bs-primary);
    background: rgba(33, 37, 41, 0.95);
    box-shadow: 0 2px 10px rgba(var(--bs-primary-rgb), 0.2);
}

[data-bs-theme="dark"] .invite-code {
    color: var(--bs-primary);
}

[data-bs-theme="dark"] .invite-code-meta {
    color: rgba(255, 255, 255, 0.6);
}

[data-bs-theme="dark"] .balance-info {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(var(--bs-success-rgb), 0.15) 100%);
    border-color: rgba(var(--bs-success-rgb), 0.3);
}

[data-bs-theme="dark"] .balance-label {
    color: rgba(255, 255, 255, 0.7);
}

[data-bs-theme="dark"] .balance-value {
    color: rgba(255, 255, 255, 0.95);
}

[data-bs-theme="dark"] .commission-item {
    border-bottom-color: rgba(255, 255, 255, 0.125);
}

[data-bs-theme="dark"] .commission-item:hover {
    background: rgba(var(--bs-primary-rgb), 0.1);
}

[data-bs-theme="dark"] .commission-user {
    color: rgba(255, 255, 255, 0.95);
}

[data-bs-theme="dark"] .commission-meta {
    color: rgba(255, 255, 255, 0.6);
}

[data-bs-theme="dark"] .commission-amount {
    color: var(--bs-success);
}

[data-bs-theme="dark"] .empty-state {
    color: rgba(255, 255, 255, 0.6);
}

[data-bs-theme="dark"] .empty-state h5 {
    color: rgba(255, 255, 255, 0.8);
}

[data-bs-theme="dark"] .form-control {
    background-color: rgba(33, 37, 41, 0.8);
    border-color: rgba(255, 255, 255, 0.125);
    color: rgba(255, 255, 255, 0.95);
}

[data-bs-theme="dark"] .form-control:focus {
    background-color: rgba(33, 37, 41, 0.9);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
    color: rgba(255, 255, 255, 0.95);
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

[data-bs-theme="dark"] .form-select {
    background-color: rgba(33, 37, 41, 0.8);
    border-color: rgba(255, 255, 255, 0.125);
    color: rgba(255, 255, 255, 0.95);
}

[data-bs-theme="dark"] .form-select:focus {
    background-color: rgba(33, 37, 41, 0.9);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

[data-bs-theme="dark"] .input-group-text {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.125);
    color: rgba(255, 255, 255, 0.8);
}

[data-bs-theme="dark"] .form-text {
    color: rgba(255, 255, 255, 0.6);
}

[data-bs-theme="dark"] .form-label {
    color: rgba(255, 255, 255, 0.9);
}

[data-bs-theme="dark"] .page-link {
    background-color: rgba(33, 37, 41, 0.8);
    border-color: rgba(255, 255, 255, 0.125);
    color: var(--bs-primary);
}

[data-bs-theme="dark"] .page-link:hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

[data-bs-theme="dark"] .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

[data-bs-theme="dark"] .loading-overlay {
    background: rgba(33, 37, 41, 0.9);
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

/* 暗色主题下的滚动条样式 */
[data-bs-theme="dark"] .invite-codes-list::-webkit-scrollbar,
[data-bs-theme="dark"] .commission-list::-webkit-scrollbar {
    width: 6px;
}

[data-bs-theme="dark"] .invite-codes-list::-webkit-scrollbar-track,
[data-bs-theme="dark"] .commission-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

[data-bs-theme="dark"] .invite-codes-list::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] .commission-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

[data-bs-theme="dark"] .invite-codes-list::-webkit-scrollbar-thumb:hover,
[data-bs-theme="dark"] .commission-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 通用滚动条样式 */
.invite-codes-list::-webkit-scrollbar,
.commission-list::-webkit-scrollbar {
    width: 6px;
}

.invite-codes-list::-webkit-scrollbar-track,
.commission-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.invite-codes-list::-webkit-scrollbar-thumb,
.commission-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.invite-codes-list::-webkit-scrollbar-thumb:hover,
.commission-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* 防止文本溢出 */
.invite-code,
.commission-user,
.balance-value,
.stat-number {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 确保表格和卡片不会溢出 */
.card,
.invite-code-item,
.commission-item {
    max-width: 100%;
    overflow: hidden;
}

/* 按钮组响应式 */
.invite-code-actions,
.btn-group {
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* 输入框组响应式 */
.input-group {
    flex-wrap: nowrap;
}

.input-group .form-control {
    min-width: 0;
    flex: 1;
}

/* 动画延迟 */
.invite-card {
    animation-delay: 0.1s;
}

.transfer-card,
.withdraw-card {
    animation-delay: 0.2s;
}

.commission-card {
    animation-delay: 0.3s;
}

/* 性能优化 */
.card,
.btn,
.form-control,
.form-select {
    will-change: transform;
}

/* 减少动画在低性能设备上的影响 */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}