/* ===== 代理中心(代理记录)页 (.ag-*) ===== */

.agent-page {
    position: fixed;
    inset: 0;
    background: #f2f3f5;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 24px rgba(0, 0, 0, .15);
}

.agent-page[hidden] { display: none; }

.ag-topbar {
    height: 54px;
    background: #ff4941;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 4px;
    flex: 0 0 auto;
}

.ag-back, .ag-home {
    width: 36px; height: 36px;
    background: transparent; border: 0; padding: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}

.ag-back svg, .ag-home svg {
    width: 22px; height: 22px;
}

.ag-title {
    flex: 1;
    text-align: center;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}

.ag-tabs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: #fff;
    border-bottom: 1px solid #eee;
    flex: 0 0 auto;
}

.ag-tabs[hidden] { display: none; }

.ag-tab {
    background: transparent;
    border: 0;
    padding: 14px 0;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    text-align: center;
}

.ag-tab.active {
    color: #e53935;
    font-weight: 600;
}

.ag-body {
    flex: 1;
    overflow-y: auto;
    background: #f2f3f5;
}

.ag-view {
    padding: 12px;
}

.ag-view[hidden] { display: none; }

/* ===== 日期筛选条 ===== */
.ag-date-filter {
    background: #fff;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #eee;
}

.ag-date-filter input[type="date"] {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
    color: #333;
    background: #fff;
}

.ag-date-filter .ag-date-sep {
    color: #666;
    font-size: 14px;
}

.ag-date-filter button {
    padding: 6px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    background: #f5f5f5;
    font-size: 13px;
    cursor: pointer;
    color: #333;
}

.ag-date-filter button:active {
    background: #eaeaea;
}

/* ===== 汇总 - 6 格统计 ===== */
.ag-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: #e6e6e6;
    margin-top: 12px;
}

.ag-stat-cell {
    background: #fff;
    padding: 18px 8px;
    text-align: center;
}

.ag-stat-cell.highlight {
    background: #f5f5f5;
}

.ag-stat-value {
    color: #e53935;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.ag-stat-label {
    color: #555;
    font-size: 13px;
}

/* ===== 投注 tab ===== */
.ag-total-strip {
    background: #fff6c8;
    border-bottom: 1px solid #ff4941;
    padding: 8px 14px;
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ag-total-strip .ag-total-text {
    flex: 1;
}

.ag-total-strip b {
    font-weight: 600;
    margin-left: 4px;
}

.ag-total-strip .ag-lose { color: #2ab94e; }
.ag-total-strip .ag-win { color: #e53935; }
.ag-total-strip .ag-net { color: #222; }

.ag-total-toggle {
    color: #e5b300;
    font-size: 18px;
    line-height: 1;
}

.ag-list {
    padding: 14px 12px;
    min-height: 200px;
}

.ag-empty {
    text-align: center;
    color: #999;
    padding: 80px 0 40px;
    font-size: 14px;
}

.ag-footer {
    background: #fff;
    padding: 10px 14px;
    text-align: center;
    font-size: 13px;
    color: #333;
    border-top: 1px solid #eee;
}

.ag-footer b { font-weight: 600; }
.ag-footer .ag-lose { color: #2ab94e; margin-left: 4px; }
.ag-footer .ag-win { color: #e53935; margin-left: 4px; }
.ag-footer .ag-net { color: #222; margin-left: 4px; }

/* ===== 盈亏 / 用户 表格 ===== */
.ag-table-head {
    display: grid;
    background: #fff;
    padding: 14px 14px;
    color: #666;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.ag-table-head.cols-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.ag-table-body {
    min-height: 200px;
    padding: 14px 12px;
    color: #333;
    font-size: 13px;
}

.ag-table-row {
    display: grid;
    background: #fff;
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
}

.ag-table-row.cols-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

/* ===== 推广 tab ===== */
.ag-promo {
    padding: 40px 24px;
    text-align: center;
}

.ag-promo-card {
    background: #fff;
    border-radius: 10px;
    padding: 28px 20px 24px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.ag-promo-qr {
    width: 160px;
    height: 160px;
    margin: 0 auto 18px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 13px;
}

.ag-promo-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px;
}

.ag-promo-sub {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}

.ag-promo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px dashed #ccc;
    border-radius: 6px;
    margin-bottom: 12px;
    color: #333;
    font-size: 13px;
    background: #fafafa;
}

.ag-promo-link .ag-link-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.ag-promo-copy {
    padding: 6px 10px;
    border: 0;
    background: #ff4941;
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
}
