/* ============================================================
   我的邀请页面 - invite.css
   原创设计：渐变英雄卡 + 统计网格 + 邀请码卡片 + 时间线记录
   与moban3的表格式布局完全不同
   ============================================================ */

/* ====== 佣金英雄卡 ====== */
.inv-hero {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: var(--radius-lg);
    padding: 28px 28px 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
    animation: fadeUp .3s var(--ease-out) both;
}

.inv-hero::after {
    content: '';
    position: absolute;
    right: -30px;
    top: -30px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    pointer-events: none;
}

.inv-hero-label {
    font-size: 13px;
    opacity: .75;
    margin-bottom: 8px;
}

.inv-hero-amount {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
}

.inv-hero-num {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
}

.inv-hero-unit {
    font-size: 16px;
    opacity: .7;
    font-weight: 500;
}

.inv-hero-sub {
    font-size: 12px;
    opacity: .6;
    margin-bottom: 20px;
}

.inv-hero-actions {
    display: flex;
    gap: 10px;
}

.inv-hero-btn {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all .18s var(--ease-out);
}

.inv-hero-btn.primary {
    background: #fff;
    color: var(--accent);
}

.inv-hero-btn.primary:hover {
    background: rgba(255,255,255,.9);
    transform: translateY(-1px);
}

.inv-hero-btn.outline {
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,.3);
}

.inv-hero-btn.outline:hover {
    background: rgba(255,255,255,.25);
}

/* ====== 统计网格 ====== */
.inv-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    animation: fadeUp .3s var(--ease-out) .05s both;
}

.inv-stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.inv-stat-val {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.inv-stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* ====== 区块标题 ====== */
.inv-section {
    margin-bottom: 20px;
    animation: fadeUp .3s var(--ease-out) .1s both;
}

.inv-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.inv-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.inv-gen-btn {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all .18s var(--ease-out);
}

.inv-gen-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

/* ====== 邀请码卡片列表 ====== */
.inv-codes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inv-code-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    transition: all .15s var(--ease-out);
}

.inv-code-item:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,.07);
}

.inv-code-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.inv-code-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    letter-spacing: .5px;
}

.inv-code-date {
    font-size: 11px;
    color: var(--text-muted);
}

.inv-copy-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    background: rgba(108,92,231,.08);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.inv-copy-btn:hover {
    background: rgba(108,92,231,.15);
}

/* ====== 佣金记录时间线 ====== */
.inv-records {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inv-record-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.inv-record-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.inv-record-amount {
    font-size: 14px;
    font-weight: 600;
    color: #16A34A;
}

/* ====== 分页 ====== */
.inv-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 14px;
}

.inv-pager-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all .15s;
}

.inv-pager-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.inv-pager-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.inv-pager-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.inv-pager-info {
    font-size: 13px;
    color: var(--text-muted);
}

/* ====== 空状态 ====== */
.inv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.inv-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.inv-empty-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.inv-empty p {
    margin: 0;
    font-size: 13px;
}

/* ====== 弹窗 ====== */
.inv-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
    animation: invOverIn .2s var(--ease-out);
}

@keyframes invOverIn { from { opacity: 0; } }

.inv-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    max-width: calc(100% - 32px);
    background: #fff;
    border-radius: var(--radius-lg);
    z-index: 9001;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,.18);
    animation: invModalIn .3s var(--ease-out);
}

@keyframes invModalIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.95); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.inv-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--divider);
}

.inv-modal-head span {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.inv-modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--surface-alt);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.inv-modal-close:hover {
    background: var(--divider);
    color: var(--text-primary);
}

.inv-modal-close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.inv-modal-body {
    padding: 20px;
}

.inv-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #FEF9C3;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    color: #854D0E;
}

.inv-notice svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: #EAB308;
}

.inv-field {
    margin-bottom: 14px;
}

.inv-field:last-child {
    margin-bottom: 0;
}

.inv-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.inv-field input,
.inv-field select {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}

.inv-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108,92,231,.1);
}

.inv-field input:disabled {
    background: var(--surface-alt);
    color: var(--text-muted);
    cursor: not-allowed;
}

.inv-field input::placeholder {
    color: var(--text-muted);
}

/* 数字加减控件 */
.inv-num-wrap {
    position: relative;
}

.inv-num-wrap input {
    padding-right: 72px;
    -moz-appearance: textfield;
    appearance: textfield;
}

.inv-num-wrap input::-webkit-outer-spin-button,
.inv-num-wrap input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.inv-num-btns {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
}

.inv-num-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--divider);
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-secondary);
    transition: all .12s;
}

.inv-num-btn:hover {
    background: var(--surface-alt);
    color: var(--text-primary);
}

/* 下拉选择 */
.inv-select-wrap {
    position: relative;
}

.inv-select-trigger {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-primary);
    box-sizing: border-box;
    transition: border-color .2s;
}

.inv-select-trigger.open {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108,92,231,.1);
}

.inv-select-trigger .placeholder {
    color: var(--text-muted);
}

.inv-select-trigger svg {
    width: 16px;
    height: 16px;
    fill: var(--text-muted);
    transition: transform .2s;
}

.inv-select-trigger.open svg {
    transform: rotate(180deg);
}

.inv-select-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 100;
    overflow: hidden;
    animation: invDropIn .2s var(--ease-out);
}

@keyframes invDropIn {
    from { opacity: 0; transform: translateY(-6px); }
}

.inv-select-opt {
    padding: 11px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background .12s;
    color: var(--text-primary);
}

.inv-select-opt:hover {
    background: var(--surface-alt);
}

.inv-select-opt.selected {
    color: var(--accent);
    font-weight: 600;
    background: rgba(108,92,231,.06);
}

/* 弹窗底部按钮 */
.inv-modal-foot {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
}

.inv-modal-btn {
    flex: 1;
    height: 40px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .15s;
}

.inv-modal-btn.cancel {
    background: var(--surface-alt);
    color: var(--text-secondary);
}

.inv-modal-btn.cancel:hover {
    background: var(--divider);
}

.inv-modal-btn.confirm {
    background: var(--accent);
    color: #fff;
}

.inv-modal-btn.confirm:hover {
    background: var(--accent-dark);
}

/* ====== 响应式 ====== */
@media (max-width: 768px) {
    .inv-hero {
        padding: 22px 20px 20px;
    }

    .inv-hero-num {
        font-size: 32px;
    }

    .inv-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .inv-stat-val {
        font-size: 18px;
    }

    .inv-code-item {
        padding: 12px 14px;
    }

    .inv-record-item {
        padding: 12px 14px;
    }

    .inv-hero-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 380px) {
    .inv-hero-num {
        font-size: 28px;
    }

    .inv-hero-btn {
        padding: 7px 14px;
        font-size: 12px;
    }

    .inv-stat-card {
        padding: 12px 10px;
    }

    .inv-stat-val {
        font-size: 16px;
    }

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