/* ========================================
   会员中心专用样式
   ======================================== */

.member-center {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.member-header {
    text-align: center;
    padding: 32px 0 40px;
}

.member-header h1 {
    font-size: 2rem;
    color: #5C2E0E;
    margin-bottom: 6px;
}

.member-header p {
    color: #888;
    font-size: 1rem;
}

/* 网格布局 */
.member-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

/* 右侧栏弹性容器 */
.member-right-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    height: 100%;
}

/* 会员信息卡片 */
.member-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05), 0 6px 16px rgba(0,0,0,0.04);
    padding: 28px;
    border: 1px solid #ede7df;
}

.member-card h3 {
    color: #5C2E0E;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0ebe0;
    font-size: 1.1rem;
}

/* 信息条目 */
.info-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f8f5f0;
}

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

.info-item .label {
    color: #888;
    font-size: 0.85rem;
    min-width: 80px;
}

.info-item .value {
    font-weight: 500;
    flex: 1;
}

.member-code {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 0.95rem;
    letter-spacing: 1px;
    color: #5C2E0E;
    background: #f8f5f0;
    padding: 2px 8px;
    border-radius: 4px;
}

.status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.pending {
    background: #fff8e5;
    color: #b85c00;
}

.status-badge.activated {
    background: #e6f4ea;
    color: #1e7e34;
}

.copy-btn {
    margin-left: 8px;
}

/* 激活成功消息 */
.activated-message {
    text-align: center;
    padding: 32px 20px;
}

.activated-message .success-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: bounce-in 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.activated-message h3 {
    border: none;
    margin-bottom: 8px;
    text-align: center;
}

.activated-message p {
    color: #888;
}

@keyframes bounce-in {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 绑定表单 */
.bind-serial-container {
    margin-top: 0;
}

.bind-form .form-group {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.bind-form .form-control {
    flex: 1;
}

.bind-form .btn {
    white-space: nowrap;
}

#bind_message {
    margin-bottom: 12px;
}

/* 绑定记录 */
.bind-serial-container h3 {
    margin-top: 24px;
}

.records-list {
    max-height: 360px;
    overflow-y: auto;
}

/* 底部说明 */
.member-footer {
    margin-top: 32px;
}

.info-box {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05), 0 6px 16px rgba(0,0,0,0.04);
    padding: 24px 28px;
    border: 1px solid #ede7df;
}

.info-box h4 {
    color: #5C2E0E;
    margin-bottom: 12px;
    font-size: 1rem;
}

.info-box ul {
    list-style: none;
    padding: 0;
}

.info-box li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    color: #666;
    font-size: 0.9rem;
}

.info-box li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 13px;
    width: 6px;
    height: 6px;
    background: #8B4513;
    border-radius: 50%;
}

/* ========================================
   我的唐卡管理 - 表格区域
   ======================================== */

.member-records-section {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05), 0 6px 16px rgba(0,0,0,0.04);
    padding: 28px;
    border: 1px solid #ede7df;
    margin-top: 24px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.member-records-section h3 {
    color: #5C2E0E;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0ebe0;
    font-size: 1.1rem;
}

/* 搜索栏 */
.records-search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.records-search-bar input {
    max-width: 320px;
    padding: 8px 14px;
    border: 1px solid #ede7df;
    border-radius: 8px;
    background: #f8f5f0;
    font-size: 0.9rem;
    color: #5C2E0E;
    transition: border-color 0.2s;
}

.records-search-bar input:focus {
    outline: none;
    border-color: #5C2E0E;
    background: #fff;
}

/* 数据表格 */
.records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.records-table thead th {
    background: #f8f5f0;
    color: #5C2E0E;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    text-align: left;
    border-bottom: 2px solid #ede7df;
}

.records-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0ebe0;
    vertical-align: middle;
    color: #444;
}

.records-table tbody tr:hover {
    background: #faf8f4;
}

.records-table tbody tr:last-child td {
    border-bottom: none;
}

/* 缩略图 */
.records-table .thangka-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ede7df;
    display: block;
}

.records-table .no-thumb {
    display: block;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    border: 1px dashed #ddd;
    background: #fafafa;
}

/* 序列号 */
.records-table code {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 0.85rem;
    background: #f8f5f0;
    padding: 2px 8px;
    border-radius: 4px;
    color: #5C2E0E;
}

/* 站外链接 */
.external-link-btn {
    display: inline-block;
    padding: 4px 14px;
    font-size: 0.8rem;
    color: #5C2E0E;
    border: 1px solid #5C2E0E;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.external-link-btn:hover {
    background: #5C2E0E;
    color: #fff;
    text-decoration: none;
}

.no-link {
    color: #ccc;
}

/* 加载/空状态 */
.records-table .loading,
.records-table .empty {
    text-align: center;
    color: #aaa;
    padding: 32px 14px;
    font-size: 0.9rem;
}

/* 分页 */
.records-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0ebe0;
    flex-wrap: wrap;
}

.records-pagination .page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #ede7df;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #5C2E0E;
    text-decoration: none;
    transition: all 0.2s;
}

.records-pagination .page-number:hover {
    background: #f8f5f0;
    border-color: #5C2E0E;
}

.records-pagination .page-number.current {
    background: #5C2E0E;
    color: #fff;
    border-color: #5C2E0E;
}

.records-pagination .total-info {
    margin-left: auto;
    font-size: 0.85rem;
    color: #888;
}

/* ========================================
   积分商城样式
   ======================================== */

.points-value {
    font-weight: 700;
    color: #C7956D;
    font-size: 1.05rem;
}

.points-shop {
    margin-top: 20px;
}

.points-balance-card {
    flex: 1;
    min-width: 200px;
    background: linear-gradient(135deg, #5C2E0E, #8B4513);
    color: #fff;
    padding: 24px 28px;
    border-radius: 12px;
}

.points-total-card {
    flex: 1;
    min-width: 200px;
    background: #f9f6f0;
    padding: 24px 28px;
    border-radius: 12px;
    border: 1px solid #ede7df;
}

.points-header {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.points-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #ede7df;
}

.points-tab {
    padding: 10px 20px;
    font-weight: 600;
    color: #888;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.points-tab.active {
    color: #5C2E0E;
    border-bottom-color: #5C2E0E;
}

.points-tab:hover {
    color: #5C2E0E;
}

/* 奖品网格 */
.prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.prize-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #ede7df;
    transition: box-shadow 0.2s;
}

.prize-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* ========================================
   积分商城 CTA 卡片（会员中心右侧）
   ======================================== */

.points-cta-card {
    background: linear-gradient(135deg, #5C2E0E 0%, #8B4513 100%);
    color: #fff;
    border: none;
}

.points-cta-card h3 {
    color: rgba(255,255,255,0.9);
    border-bottom-color: rgba(255,255,255,0.15);
}

.points-cta-body {
    text-align: center;
    padding: 8px 0 4px;
}

.points-cta-balance {
    margin-bottom: 14px;
}

.points-cta-label {
    display: block;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.65);
    margin-bottom: 4px;
}

.points-cta-number {
    font-size: 2rem;
    font-weight: 700;
    color: #f0c78e;
    letter-spacing: 1px;
}

.points-cta-desc {
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0 0 20px;
}

.points-cta-btn {
    display: inline-block;
    padding: 10px 28px;
    background: #f0c78e;
    color: #5C2E0E;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.points-cta-btn:hover {
    background: #e8b870;
    transform: translateY(-1px);
    color: #5C2E0E;
    text-decoration: none;
}

.prize-card .prize-image {
    height: 160px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(135deg, #f5ede0, #ede0cc);
}

.prize-card .prize-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prize-card .prize-image-placeholder {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

/* 积分流水表格 */
.records-table {
    width: 100%;
    border-collapse: collapse;
}

.records-table th {
    padding: 10px 12px;
    text-align: left;
    color: #888;
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 1px solid #ede7df;
}

.records-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f5f0e8;
    font-size: 0.9rem;
}

.records-table .points-positive {
    color: #27ae60;
    font-weight: 600;
}

.records-table .points-negative {
    color: #e74c3c;
    font-weight: 600;
}

/* 兑换弹窗 */
#redeem-modal .form-group label {
    display: block;
    margin-bottom: 4px;
    color: #5C2E0E;
    font-weight: 600;
    font-size: 0.9rem;
}

#redeem-modal .form-group input,
#redeem-modal .form-group textarea {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

#redeem-submit-btn {
    width: 100%;
    padding: 12px;
    background: #5C2E0E;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

#redeem-submit-btn:hover {
    background: #8B4513;
}

#redeem-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 响应式 */
@media (max-width: 768px) {
    .points-header {
        flex-direction: column;
    }

    .prizes-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .points-tab {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .member-grid {
        grid-template-columns: 1fr;
    }

    .bind-form .form-group {
        flex-direction: column;
    }

    .points-cta-card {
        order: 3;
    }

    .member-header { padding: 20px 0 24px; }
    .member-header h1 { font-size: 1.5rem; }

    .member-records-section {
        padding: 16px;
    }

    .records-search-bar {
        flex-direction: column;
    }

    .records-search-bar input {
        max-width: none;
    }

    .records-table thead th,
    .records-table tbody td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .records-table .thangka-thumb,
    .records-table .no-thumb {
        width: 36px;
        height: 36px;
    }

    .records-pagination {
        justify-content: center;
    }

    .records-pagination .total-info {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }

    .member-sets-section {
        padding: 16px;
    }

    .set-card-body {
        flex-wrap: wrap;
    }
}

/* ========================================
   套卡进度
   ======================================== */

.member-sets-section {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05), 0 6px 16px rgba(0,0,0,0.04);
    padding: 28px;
    border: 1px solid #ede7df;
    margin-top: 24px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.member-sets-section h3 {
    color: #5C2E0E;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0ebe0;
    font-size: 1.1rem;
}

.member-sets-section h3 + .sets-grid {
    margin-top: 0;
}

.sets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.set-card {
    border: 1px solid #e8e3d8;
    border-radius: 12px;
    overflow: hidden;
    background: #fdfcf9;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.set-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.set-card.set-card-complete {
    border-color: #81C784;
    background: #f6fdf7;
}

.set-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px 6px;
    gap: 8px;
}

.set-card-title {
    color: #5C2E0E;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

.set-card-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: #FFF3E0;
    color: #E65100;
    white-space: nowrap;
    flex-shrink: 0;
}

.set-card-badge.badge-done {
    background: #E8F5E9;
    color: #2E7D32;
}

.set-card-bar {
    height: 6px;
    background: #e8e3d8;
    margin: 8px 16px;
    border-radius: 3px;
    overflow: hidden;
}

.set-card-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #C7956D, #5C2E0E);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.set-card-bar-fill.bar-done {
    background: linear-gradient(90deg, #66BB6A, #2E7D32);
}

.set-card-pools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 14px;
}

.set-pool-item {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    background: #f0ede6;
    color: #999;
    border: 1px solid #e0dbd0;
}

.set-pool-item.collected {
    background: #FFF8E1;
    color: #5C2E0E;
    border-color: #C7956D;
    font-weight: 600;
}

/* 展开按钮 */
.sets-toggle-btn {
    display: block;
    width: 100%;
    padding: 10px 0;
    border: 1px dashed #d5cfc4;
    border-radius: 10px;
    background: transparent;
    color: #8B7355;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    grid-column: 1 / -1;
}

.sets-toggle-btn:hover {
    background: #f8f5f0;
    border-color: #C7956D;
    color: #5C2E0E;
}

@media (max-width: 900px) {
    .sets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .sets-grid {
        grid-template-columns: 1fr;
    }
}
