/* ========== 积分/会员系统样式 ========== */

/* 顶栏积分显示 */
.credits-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.credits-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}
.credits-badge .credits-icon {
    font-size: 14px;
}
.credits-badge .credits-num {
    font-variant-numeric: tabular-nums;
}

/* 会员等级标签 */
.tier-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.tier-badge.free { background: #e5e7eb; color: #6b7280; }
.tier-badge.standard { background: #dbeafe; color: #1d4ed8; }
.tier-badge.pro { background: #fce7f3; color: #be185d; }
.tier-badge.enterprise { background: #fef3c7; color: #92400e; }

/* 会员中心弹窗 */
.modal.credits-modal {
    width: 720px;
    max-width: 95vw;
    max-height: 90vh;
}

.credits-modal .modal-body {
    padding: 0;
}

/* 会员中心标签页 */
.credits-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
}
.credits-tab {
    padding: 12px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.credits-tab:hover { color: var(--text-primary); }
.credits-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.credits-tab-content {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

/* 用户信息卡片 */
.user-info-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0f4ff, #fdf4ff);
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.user-info-left { display: flex; align-items: center; gap: 12px; }
.user-info-left .tier-badge { font-size: 12px; padding: 4px 10px; }
.user-info-left .credits-display {
    font-size: 24px;
    font-weight: 700;
    color: #f59e0b;
}
.user-info-left .credits-label { font-size: 12px; color: var(--text-muted); }
.user-info-right { text-align: right; font-size: 12px; color: var(--text-secondary); }

/* 会员套餐卡片 */
.tier-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.tier-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.tier-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.tier-card.current { border-color: var(--success); background: #ecfdf5; }
.tier-card.current::after {
    content: "当前";
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    color: var(--success);
    font-weight: 600;
}
.tier-card .tier-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.tier-card .tier-price { font-size: 24px; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
.tier-card .tier-price .per { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.tier-card .tier-features { list-style: none; padding: 0; margin: 0; }
.tier-card .tier-features li {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 3px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tier-card .tier-features li::before { content: "\2713"; color: var(--success); font-weight: 700; }
.tier-card .tier-features li.disabled { color: var(--text-muted); }
.tier-card .tier-features li.disabled::before { content: "\2717"; color: var(--text-muted); }
.tier-card .btn-subscribe {
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.tier-card .btn-subscribe:hover { background: var(--primary-dark); }
.tier-card .btn-subscribe:disabled { background: #d1d5db; cursor: not-allowed; }

/* 积分充值包 */
.pack-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.pack-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.pack-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.pack-card.popular { border-color: #f59e0b; }
.pack-card.popular::before {
    content: "推荐";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    padding: 2px 10px;
    border-radius: 10px;
}
.pack-card .pack-name { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.pack-card .pack-credits { font-size: 28px; font-weight: 700; color: var(--primary); }
.pack-card .pack-credits .unit { font-size: 12px; color: var(--text-muted); }
.pack-card .pack-bonus { font-size: 12px; color: var(--success); margin: 4px 0; }
.pack-card .pack-price { font-size: 18px; font-weight: 600; margin-top: 8px; }
.pack-card .pack-price .currency { font-size: 12px; color: var(--text-muted); }
.pack-card .btn-buy-pack {
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.pack-card .btn-buy-pack:hover { background: var(--primary); color: #fff; }

/* 增值服务 */
.service-list { display: flex; flex-direction: column; gap: 10px; }
.service-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s;
}
.service-card:hover { border-color: var(--primary); }
.service-card.owned { background: #ecfdf5; border-color: var(--success); }
.service-info .svc-name { font-size: 14px; font-weight: 600; }
.service-info .svc-desc { font-size: 12px; color: var(--text-muted); }
.service-action { display: flex; align-items: center; gap: 8px; }
.service-cost { font-size: 14px; font-weight: 600; color: #f59e0b; }
.btn-buy-service {
    padding: 6px 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.btn-buy-service:hover { background: var(--primary-dark); }
.btn-buy-service:disabled { background: #d1d5db; cursor: not-allowed; }

/* 交易记录 */
.tx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.tx-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
}
.tx-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.tx-table .tx-type { font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.tx-type.recharge, .tx-type.monthly, .tx-type.grant, .tx-type.subscribe { background: #d1fae5; color: #065f46; }
.tx-type.deduct, .tx-type.service { background: #fee2e2; color: #991b1b; }
.tx-type.refund, .tx-type.initial { background: #dbeafe; color: #1e40af; }
.tx-amount.positive { color: var(--success); font-weight: 600; }
.tx-amount.negative { color: var(--error); font-weight: 600; }

/* 积分不足弹窗 */
.insufficient-modal .modal { width: 420px; }
.insufficient-content { text-align: center; padding: 20px; }
.insufficient-icon { font-size: 48px; margin-bottom: 12px; }
.insufficient-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.insufficient-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }
.insufficient-actions { display: flex; flex-direction: column; gap: 10px; }
.insufficient-actions button {
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-recharge {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
}
.btn-recharge:hover { opacity: 0.9; }
.btn-upgrade {
    background: var(--primary);
    color: #fff;
}
.btn-upgrade:hover { background: var(--primary-dark); }
.btn-dismiss {
    background: #f3f4f6;
    color: var(--text-secondary);
}

/* 管理后台 */
.admin-section { margin-bottom: 20px; }
.admin-section h4 { font-size: 14px; margin-bottom: 10px; color: var(--text-primary); }
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.admin-stat-card {
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
    text-align: center;
}
.admin-stat-card .stat-value { font-size: 22px; font-weight: 700; color: var(--primary); }
.admin-stat-card .stat-label { font-size: 12px; color: var(--text-muted); }

/* 响应式 */
@media (max-width: 768px) {
    .tier-cards, .pack-cards { grid-template-columns: 1fr; }
    .admin-stats-grid { grid-template-columns: 1fr; }
    .modal.credits-modal { width: 95vw; }
}
