/* 会员卡管理 - 移动端适配 */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success-color: #10b981;
    --success-light: #d1fae5;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --danger-light: #fee2e2;
    --text-main: #1f2937;
    --text-sub: #6b7280;
    --text-light: #9ca3af;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg, #e0e7ff 0%, #f3f4f6 20%);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.6;
    padding-top: 60px;
    min-height: 100vh;
}

/* 顶部导航 */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.nav-left, .nav-right {
    width: 44px;
}

.back-link {
    color: white;
    font-size: 26px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background 0.2s;
}

.back-link:hover {
    background: rgba(255,255,255,0.15);
}

.nav-title {
    color: white;
    font-size: 19px;
    font-weight: 600;
    text-align: center;
    flex: 1;
    letter-spacing: 0.5px;
}

/* 搜索栏 */
.search-bar {
    background: var(--card-bg);
    padding: 14px 16px;
    position: sticky;
    top: 60px;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: #f9fafb;
    border-radius: 16px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.search-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-icon {
    width: 19px;
    height: 19px;
    color: var(--text-light);
    margin-right: 10px;
    flex-shrink: 0;
}

#searchInput {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
    color: var(--text-main);
}

#searchInput::placeholder {
    color: var(--text-light);
}

/* 会员列表 */
.member-list {
    padding: 16px;
    padding-bottom: 90px;
}

.member-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.03);
}

.member-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.vip-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.vip-0 { background: #f3f4f6; color: var(--text-sub); }
.vip-1 { background: #dbeafe; color: #1d4ed8; }
.vip-2 { background: #fce7f3; color: #be185d; }
.vip-3 { background: #fef3c7; color: #b45309; }

.card-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 15px;
    color: var(--text-main);
    font-weight: 500;
}

.info-value.amount {
    color: var(--danger-color);
    font-weight: 700;
    font-size: 18px;
}

.status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-1 { background: #d1fae5; color: #065f46; }
.status-0 { background: #fee2e2; color: #991b1b; }

.card-footer {
    display: flex;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-color);
}

.card-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.card-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.card-btn-primary:active {
    transform: scale(0.96);
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.25);
}

.card-btn-secondary {
    background: #f3f4f6;
    color: var(--text-sub);
}

.card-btn-secondary:active {
    background: #e5e7eb;
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 13px;
}

/* 悬浮按钮 */
.fab-btn {
    position: fixed;
    right: 20px;
    bottom: 24px;
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    z-index: 80;
    transition: all 0.3s;
}

.fab-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
}

.fab-btn:active {
    transform: scale(0.95);
}

.fab-btn svg {
    width: 26px;
    height: 26px;
}

/* 弹窗遮罩 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.55);
    z-index: 200;
    display: none;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 底部弹窗 */
.bottom-modal {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card-bg);
    border-radius: 24px 24px 0 0;
    z-index: 210;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.bottom-modal.show {
    transform: translateY(0);
}

.bottom-modal-large {
    max-height: 90vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 10;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 22px;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e5e7eb;
    color: var(--text-main);
}

.modal-body {
    padding: 20px;
    max-height: calc(85vh - 62px);
    overflow-y: auto;
}

.bottom-modal-large .modal-body {
    max-height: calc(90vh - 62px);
}

/* 会员信息卡片 */
.member-info-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}

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

.info-label {
    color: var(--text-light);
    font-size: 13px;
    font-weight: 500;
}

.info-value {
    color: var(--text-main);
    font-weight: 600;
    font-size: 15px;
}

.info-value.amount {
    color: var(--danger-color);
    font-size: 22px;
    font-weight: 700;
}

/* 操作按钮组 */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.action-btn {
    padding: 14px 8px;
    border: none;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.action-btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* 表单样式 */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    background: #fafafa;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    background: var(--card-bg);
}

.form-control::placeholder {
    color: var(--text-light);
}

.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.amount-prefix {
    position: absolute;
    left: 16px;
    color: var(--text-sub);
    font-size: 16px;
    font-weight: 600;
}

.amount-input {
    padding-left: 40px !important;
}

.form-tip {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
}

.form-actions {
    display: flex;
    gap: 14px;
    margin-top: 24px;
}

.btn-cancel {
    flex: 1;
    padding: 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    background: var(--card-bg);
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #f9fafb;
}

.btn-submit {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    transition: all 0.2s;
}

.btn-submit:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

/* 流水列表 */
.water-list-container {
    max-height: 55vh;
    overflow-y: auto;
}

.water-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.water-filter input {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    outline: none;
}

.water-filter input:focus {
    border-color: var(--primary-color);
}

.water-filter-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
}

.water-item {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.water-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.water-type {
    font-size: 15px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
}

.oper-type-1 { 
    color: var(--success-color); 
    background: var(--success-light);
}
.oper-type-2 { 
    color: var(--danger-color); 
    background: var(--danger-light);
}
.oper-type-3 { 
    color: var(--warning-color); 
    background: #fef3c7;
}
.oper-type-4 { 
    color: #8b5cf6; 
    background: #ede9fe;
}

.water-time {
    font-size: 12px;
    color: var(--text-light);
}

.water-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
}

.water-detail span {
    color: var(--text-light);
}

.water-detail span.value {
    color: var(--text-main);
    text-align: right;
    font-weight: 500;
}

.water-detail span.amount {
    font-weight: 700;
}

.water-detail span.amount-positive {
    color: var(--success-color);
}

.water-detail span.amount-negative {
    color: var(--danger-color);
}

.water-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 12px;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 14px 28px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow-xl);
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.empty-state .empty-icon {
    font-size: 72px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 15px;
    color: var(--text-sub);
}

/* 统计信息 */
.stat-row {
    display: flex;
    gap: 10px;
    padding: 0 16px 16px;
}

.stat-card {
    flex: 1;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* 红字备注警告 */
.warning-note {
    background: #fef2f2;
    border-left: 4px solid var(--danger-color);
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
}

.warning-note span {
    color: var(--danger-color);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}

/* ==================== 消费项目搜索下拉（与报备页同款交互） ==================== */
.searchable-select-wrapper {
    position: relative;
    display: flex;
    gap: 10px;
}
.name-input-container {
    flex: 1;
    position: relative;
}
.real-input-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}
.quantity-input {
    width: 84px;
    flex-shrink: 0;
    padding: 14px 10px;
    text-align: center;
}
.options-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    margin-top: 4px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 2000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    display: none;
}
.options-list.show {
    display: block;
}
.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-main);
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
}
.option-item:last-child {
    border-bottom: none;
}
.option-item:hover {
    background-color: #eef2ff;
}
.option-item .option-price {
    color: var(--danger-color);
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}
/* 只读扣卡金额：视觉上明确不可编辑 */
#consumeAmountShow {
    background: #f3f4f6 !important;
    color: var(--danger-color);
    font-weight: 700;
    font-size: 18px;
    cursor: not-allowed;
}
