/* ===== 理财面板 - 参照商店面板从底部滑出风格 ===== */

/* 遮罩层 */
.finance-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

/* 面板主体 - 从底部滑出 */
.finance-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5001;
    max-height: 82vh;
    background: linear-gradient(180deg, rgba(25, 25, 35, 0.98), rgba(15, 15, 22, 0.98));
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    --tab-primary: #fbbf24;
    --tab-secondary: #f59e0b;
    --tab-glow: rgba(251, 191, 36, 0.3);
}

.finance-panel.active {
    transform: translateY(0);
}

/* 拖拽指示条 */
.finance-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
    margin: 8px auto 4px;
    flex-shrink: 0;
}

/* 标题栏 */
.finance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 6px;
    flex-shrink: 0;
}

.finance-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.finance-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.finance-close:active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: scale(0.9);
}

/* 分类标签栏 */
.finance-tabs {
    display: flex;
    gap: 6px;
    padding: 4px 16px 8px;
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.finance-tabs::-webkit-scrollbar {
    display: none;
}

.finance-tab {
    flex: 1;
    min-width: 0;
    padding: 8px 6px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.finance-tab:active {
    transform: scale(0.95);
}

.finance-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 0 12px var(--tab-glow);
}

/* 内容区域 */
.finance-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 12px 20px;
}

.finance-content::-webkit-scrollbar {
    width: 3px;
}

.finance-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* 安全区域（适配 iPhone 底部） */
.finance-safe-area {
    height: calc(4px + env(safe-area-inset-bottom, 0px));
    flex-shrink: 0;
}

/* ===== 加载 / 空状态 ===== */
.finance-loading,
.finance-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    line-height: 1.5;
}

/* ===== 理财方案卡片列表 ===== */
.finance-plans-list,
.finance-progress-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== 理财方案卡片 ===== */
.finance-plan-card {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.15s ease;
}

.finance-plan-card:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.08);
}

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

.finance-plan-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}

.finance-plan-badge {
    font-size: 13px;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    padding: 3px 10px;
    border-radius: 10px;
}

/* 方案详情行 */
.finance-plan-details {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.finance-plan-detail-item {
    flex: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 8px 4px;
}

.finance-plan-detail-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    display: block;
    margin-bottom: 2px;
}

.finance-plan-detail-value {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.finance-plan-detail-value.gold {
    color: #fbbf24;
}

.finance-plan-detail-value.highlight {
    color: #34d399;
}

/* 描述文字 */
.finance-plan-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.4;
    margin-bottom: 10px;
}

/* 标签 */
.finance-plan-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.finance-plan-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

/* 参加按钮 */
.finance-plan-footer {
    text-align: center;
}

.finance-plan-join-btn {
    width: 100%;
    padding: 11px 0;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--tab-primary), var(--tab-secondary));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 12px var(--tab-glow);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.finance-plan-join-btn:active {
    transform: scale(0.97);
    box-shadow: 0 1px 6px var(--tab-glow);
}

/* ===== 理财进度卡片 ===== */
.finance-progress-card {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.15s ease;
}

.finance-progress-card:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.08);
}

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

.finance-progress-plan-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}

.finance-progress-status {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.finance-progress-status.status-ongoing {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.15);
}

.finance-progress-status.status-settled {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.15);
}

.finance-progress-status.status-cancelled {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.15);
}

/* 进度条 */
.finance-progress-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.finance-progress-bar-bg {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.finance-progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.finance-progress-bar-text {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    min-width: 36px;
    text-align: right;
}

/* 进度详情 */
.finance-progress-details {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.finance-progress-detail-item {
    flex: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 8px 4px;
}

.finance-progress-detail-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    display: block;
    margin-bottom: 2px;
}

.finance-progress-detail-value {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.finance-progress-detail-value.gold {
    color: #fbbf24;
}

.finance-progress-detail-value.profit {
    color: #34d399;
}

/* 进度底部 */
.finance-progress-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.finance-progress-footer-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.finance-progress-footer-right {
    flex-shrink: 0;
}

/* 倒计时文本 */
.finance-countdown-text {
    font-size: 13px;
    font-weight: 600;
    color: #fbbf24;
}

/* 取款按钮 */
.finance-withdraw-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #f472b6, #ec4899);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 12px rgba(244, 114, 182, 0.25);
    letter-spacing: 0.3px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.finance-withdraw-btn:active {
    transform: scale(0.94);
    box-shadow: 0 1px 6px rgba(244, 114, 182, 0.15);
}

/* ===== 确认弹窗 ===== */
.finance-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
}

.finance-confirm-overlay.active {
    display: flex;
}

.finance-confirm-dialog {
    width: 300px;
    max-width: 85vw;
    background: linear-gradient(145deg, rgba(30, 30, 40, 0.96), rgba(20, 20, 28, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 24px 20px 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.finance-confirm-dialog.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.finance-confirm-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    letter-spacing: 0.3px;
}

.finance-confirm-content {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    line-height: 1.6;
    width: 100%;
}

.finance-confirm-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
}

.finance-confirm-btn {
    flex: 1;
    padding: 11px 0;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.finance-confirm-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.finance-confirm-cancel:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.97);
}

.finance-confirm-ok {
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.finance-confirm-ok:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ===== Toast 提示 ===== */
.finance-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 10001;
    padding: 18px 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.9));
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    line-height: 1.6;
    letter-spacing: 0.3px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-width: 80vw;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.finance-toast.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.finance-toast-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
    border-color: rgba(248, 113, 113, 0.3);
}