@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

.glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-hover {
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.card-hover:active {
    transform: scale(0.98);
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 隐藏滚动条但保持可滚动 */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: env(safe-area-inset-bottom);
}

/* 底部弹出弹窗 */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: white;
    border-radius: 24px 24px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.bottom-sheet.active {
    transform: translateY(0);
}

.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.bottom-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* 状态徽章 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-unused {
    background: #dcfce7;
    color: #16a34a;
}

.badge-used {
    background: #f3f4f6;
    color: #6b7280;
}

.badge-refunded {
    background: #fef3c7;
    color: #d97706;
}

/* 触摸友好的按钮 */
.touch-btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 骨架屏动画 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 脉冲动画 */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 确认弹窗 */
.confirm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.confirm-modal.hidden {
    display: none;
}

.confirm-content {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 1.5rem;
    width: 20rem;
    animation: fadeIn 0.3s ease;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
    animation: fadeIn 0.3s ease;
    color: white;
}

.toast-success {
    background-color: #22c55e;
}

.toast-error {
    background-color: #ef4444;
}

/* 加载动画 */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 自定义题库选择弹窗 */
.bank-select-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    background: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.bank-select-modal.active {
    transform: translateY(0);
}

.bank-select-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    z-index: 1;
}

.bank-select-search {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.bank-select-search:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.bank-select-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.bank-select-item {
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bank-select-item:active {
    background: #f3f4f6;
}

.bank-select-item.selected {
    background: #ede9fe;
    color: #7c3aed;
}

.bank-select-item-name {
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
}

.bank-select-item-price {
    font-size: 13px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 20px;
}

.bank-select-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.bank-select-loading {
    text-align: center;
    padding: 40px 20px;
    color: #8b5cf6;
}

/* 扣除金额提示 */
.deduction-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    color: white;
    padding: 12px 24px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.3);
    z-index: 100;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.deduction-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
