/**
 * [B2CHILD] 2026-07-07 邀请码展示页 — 样式文件
 * 
 * 布局说明：
 *   - 全宽内容区（无侧边栏），最大宽度 900px
 *   - 上方：邀请码卡片网格（4 列 → 平板 2 列 → 手机 2 列）
 *   - 下方：已使用邀请码列表
 */

/* ============================================
   页面容器
   ============================================ */
.inv-page-wrapper {
    margin: 0 auto;
    padding: 40px 20px 60px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* ============================================
   页面头部
   ============================================ */
.inv-page-header {
    text-align: center;
    margin-bottom: 44px;
}

.inv-page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #333;
    letter-spacing: 1px;
}

.inv-page-header .inv-subtitle {
    font-size: 14px;
    color: #999;
    line-height: 2;
    margin-bottom: 0;
}

.inv-page-header .inv-tips {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #fff8e1, #fff3cd);
    border: 1px solid #ffe082;
    border-radius: 24px;
    font-size: 13px;
    color: #f57c00;
    font-weight: 500;
}

.inv-tips .inv-count {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background: var(--diy-color);
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    padding: 0 6px;
    font-weight: 600;
}

/* ============================================
   区域标题
   ============================================ */
.inv-section {
    margin-bottom: 44px;
}

.inv-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-left: 14px;
    border-left: 3px solid var(--diy-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.inv-section-title .inv-badge {
    font-size: 12px;
    font-weight: 400;
    padding: 3px 10px;
    border-radius: 12px;
    background: #f5f5f5;
    color: #999;
}

/* ============================================
   邀请码卡片网格
   ============================================ */
.inv-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.inv-card {
    background: #fff;
    border-radius: 12px;
    padding: 22px 16px 18px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

/* 顶部彩色条 */
.inv-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--diy-color), #4db88d);
}

.inv-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 153, 102, 0.15);
}

/* 邀请码文字 — 内凹背景效果 */
.inv-card-code {
    font-family: 'Courier New', Consolas, 'Liberation Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    word-break: break-all;
    line-height: 1.4;
    padding: 8px 10px;
    background: #f5f7fa;
    border-radius: 6px;
    box-shadow: rgb(204, 219, 232) 2px 2px 4px 0px inset, rgba(255, 255, 255, 0.6) -2px -2px 4px 1px inset;
}

/* 奖励文字 */
.inv-card-credit {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 16px;
}

.inv-card-credit span {
    color: var(--diy-color);
    font-weight: 600;
}

/* 复制按钮 */
.inv-card-btn {
    display: inline-block;
    width: 100%;
    padding: 9px 0;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #fff;
    background: linear-gradient(135deg, var(--diy-color), #3cb882);
    outline: none;
    font-family: inherit;
}

.inv-card-btn:hover {
    opacity: 0.92;
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 153, 102, 0.25);
}

.inv-card-btn:active {
    transform: scale(0.97);
}

.inv-card-btn.copied {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    cursor: default;
}

.inv-card-btn.checking {
    background: #c0c0c0;
    cursor: wait;
    pointer-events: none;
}

/* ============================================
   空状态
   ============================================ */
.inv-empty {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}

.inv-empty-icon {
    font-size: 52px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.inv-empty p {
    font-size: 15px;
    margin-bottom: 10px;
    color: #999;
}

.inv-empty .inv-contact {
    font-size: 13px;
    color: #bbb;
    margin-top: 4px;
}

.inv-empty .inv-contact a {
    color: var(--diy-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--diy-color);
}

.inv-empty .inv-contact a:hover {
    color: #007a52;
}

/* ============================================
   已使用列表
   ============================================ */
.inv-used-list {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.inv-used-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
    font-size: 14px;
    gap: 12px;
}

.inv-used-item:last-child {
    border-bottom: none;
}

.inv-used-item:hover {
    background: #fafafa;
}

.inv-used-code {
    font-family: 'Courier New', Consolas, 'Liberation Mono', monospace;
    font-weight: 500;
    color: #bbb;
    flex: 0 0 220px;
    letter-spacing: 0.5px;
    text-decoration: line-through;
    text-decoration-color: #ddd;
    text-decoration-thickness: 1px;
    font-size: 13px;
}

.inv-used-user {
    flex: 1;
    color: #666;
    display: flex;
    align-items: center;
    gap: 10px;
}

.inv-used-user .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #f0f0f0;
    flex-shrink: 0;
}

.inv-used-credit {
    color: var(--diy-color);
    font-weight: 600;
    flex: 0 0 90px;
    text-align: right;
    font-size: 13px;
}

.inv-used-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    background: #f0f0f0;
    color: #aaa;
    flex-shrink: 0;
}

/* ============================================
   使用记录分页
   ============================================ */
.inv-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 400;
}

.inv-page-nav {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    color: var(--diy-color);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 12px;
}

.inv-page-nav:hover {
    background: rgba(0, 153, 102, 0.08);
    color: #007a52;
}

.inv-page-nav.disabled {
    color: #ccc;
    cursor: default;
    pointer-events: none;
}

.inv-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: 6px;
    color: #999;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s;
}

.inv-page-num:hover {
    background: #f0f0f0;
    color: #333;
}

.inv-page-num.current {
    background: var(--diy-color);
    color: #fff;
    font-weight: 600;
    cursor: default;
}

.inv-pagination-info {
    text-align: right;
    font-size: 12px;
    color: #bbb;
    padding: 12px 0 0;
}

/* ============================================
   响应式 — 平板
   ============================================ */
@media (max-width: 768px) {
    .inv-page-wrapper {
        padding: 30px 16px 50px;
    }

    .inv-page-header h1 {
        font-size: 24px;
    }

    .inv-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .inv-card {
        padding: 18px 12px 14px;
    }

    .inv-card-code {
        font-size: 13px;
    }

    .inv-used-code {
        flex: 0 0 150px;
        font-size: 12px;
    }

    .inv-used-credit {
        flex: 0 0 65px;
        font-size: 12px;
    }

    .inv-used-item {
        padding: 12px 14px;
    }
}

/* ============================================
   响应式 — 手机
   ============================================ */
@media (max-width: 480px) {
    .inv-page-header h1 {
        font-size: 21px;
    }

    .inv-page-header .inv-subtitle {
        font-size: 13px;
    }

    .inv-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .inv-card {
        padding: 16px 14px 14px;
    }

    .inv-card-code {
        font-size: 14px;
        letter-spacing: 1px;
    }

    /* 移动端使用记录 — 两行布局 */
    .inv-used-item {
        flex-wrap: wrap;
        padding: 12px 14px;
        gap: 4px 8px;
    }

    .inv-used-code {
        flex: 1 1 100%;
        font-size: 12px;
        order: 1;
        padding-bottom: 4px;
        border-bottom: 1px dashed #eee;
    }

    .inv-used-user {
        flex: 1;
        order: 2;
        font-size: 13px;
    }

    .inv-used-credit {
        flex: 0 0 auto;
        order: 3;
        font-size: 12px;
        text-align: left;
    }

    .inv-used-badge {
        order: 4;
        margin-left: auto;
    }

    /* 移动端分页简化 */
    .inv-pagination {
        gap: 2px;
    }

    .inv-page-num {
        min-width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .inv-page-nav {
        font-size: 11px;
        padding: 4px 6px;
    }
}

/* ============================================
   复制成功提示 toast
   ============================================ */
.diy-inv-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    animation: diyToastIn 0.3s ease-out, diyToastOut 0.3s 2s ease-in forwards;
    pointer-events: none;
    white-space: nowrap;
}

.diy-inv-toast.success {
    background: linear-gradient(135deg, var(--diy-color), #27ae60);
}

.diy-inv-toast.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

@keyframes diyToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes diyToastOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
