/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    height: 100%;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f0f0;
}
body {
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* ===== 手机框架 ===== */
.phone-frame {
    width: 100%;
    max-width: 420px;
    min-height: 100vh;
    background: #f2f2f2;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0,0,0,.08);
}
@media (min-width: 480px) {
    .phone-frame {
        min-height: 90vh;
        margin: 20px 0;
        border-radius: 24px;
        overflow: hidden;
    }
}

/* ===== 列表页顶部标题栏 ===== */
.header-red {
    background: linear-gradient(135deg, #d0021b 0%, #b00016 100%);
    padding: 40px 0 20px;
    text-align: center;
    flex-shrink: 0;
}
.header-title {
    color: #fff;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 2px;
}

/* ===== 基金列表 ===== */
.fund-list-page {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    padding-bottom: 70px;
    -webkit-overflow-scrolling: touch;
}
.fund-list-page::-webkit-scrollbar { width: 0; }

/* 基金卡片（Tab 修改前原样式） */
.fund-card-list {
    display: block;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    cursor: pointer;
    transition: transform .1s;
}
.fund-card-list:active { transform: scale(.99); }

/* 卡片主体：基金名下方左右两列，天然同行对齐（不再用魔法数字硬凑） */
.fund-card-body {
    display: flex;
    align-items: flex-start;
}
.fund-card-left { flex: 1; }
.fund-card-right { min-width: 120px; text-align: right; }

.fund-card-name {
    font-size: 16px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.fund-card-row {
    font-size: 13px;
    margin-bottom: 4px;
    line-height: 1.6;
}
.fund-card-label { color: #888; }
.fund-card-red { color: #d0021b; font-weight: 500; }
.fund-card-green { color: #0a7d2f; font-weight: 500; }
.fund-card-gray { color: #999; }

/* ===== 底部Tab（列表页） ===== */
.tab-bar-red {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    display: flex;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    flex-shrink: 0;
}
.tab-bar-red .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #999;
    font-size: 10px;
    cursor: pointer;
    transition: color .2s;
}
.tab-bar-red .tab-item.active { color: #d0021b; }

/* ===== 详情页顶部导航 ===== */
.detail-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
    padding-top: env(safe-area-inset-top, 10px);
}
.back-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.detail-header-title {
    font-size: 17px;
    font-weight: 500;
    color: #333;
}

/* ===== 详情页净值信息区 ===== */
.detail-info-area {
    background: #fff;
    padding: 12px 16px 16px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.detail-fund-name {
    font-size: 18px;
    font-weight: 600;
    color: #444;
    margin-bottom: 12px;
}
.detail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}
.detail-info-item {
    font-size: 13px;
}
.detail-info-label { color: #888; }
.detail-info-red { color: #d0021b; font-weight: 500; }
.detail-info-green { color: #0a7d2f; font-weight: 500; }
.detail-info-gray { color: #999; }

/* ===== 走势图 Tab ===== */
.chart-tab-bar {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.chart-tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: color .2s;
}
.chart-tab:first-child { border-right: 1px solid #f0f0f0; }
.chart-tab.active {
    color: #d0021b;
    font-weight: 500;
}

/* ===== 图例 ===== */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 10px 8px;
    background: #fff;
    font-size: 11px;
    color: #666;
    flex-shrink: 0;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* ===== 走势图容器 ===== */
.chart-container {
    background: #fff;
    padding: 0 12px 12px;
    height: 260px;
    flex-shrink: 0;
}

/* ===== 下方 Tab ===== */
.bottom-tab-bar {
    display: flex;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.bottom-tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: color .2s;
    border-bottom: 2px solid transparent;
}
.bottom-tab.active {
    color: #d0021b;
    border-bottom-color: #d0021b;
    font-weight: 500;
}

/* ===== 面板内容 ===== */
.panel-content {
    flex: 1;
    overflow-y: auto;
    background: #f2f2f2;
    -webkit-overflow-scrolling: touch;
}
.panel-content::-webkit-scrollbar { width: 0; }

/* ===== 净值表格 ===== */
.nav-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
}
.nav-table thead th {
    background: #b0a9a0;
    color: #fff;
    padding: 10px;
    font-weight: 500;
    text-align: center;
}
.nav-table tbody td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
    color: #333;
}
.nav-table tbody tr:last-child td { border-bottom: none; }

/* ===== 介绍面板 ===== */
.intro-panel {
    background: #fff;
    padding: 16px;
}
.intro-section { margin-bottom: 20px; }
.intro-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    padding-left: 8px;
    border-left: 3px solid #d0021b;
}
.intro-text {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
}

/* ===== 通用 ===== */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 13px;
}
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #d0021b;
    border-radius: 50%;
    margin: 0 auto 8px;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* ===== 产品介绍信息列表（MySQL 真实数据版） ===== */
.intro-text { white-space: pre-line; }
.intro-text p { margin: 0 0 4px 0; }
.info-list { background: #fff; }
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #f2f2f2;
    font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: #999; flex-shrink: 0; }
.info-value { color: #333; text-align: right; word-break: break-all; line-height: 1.5; }

/* ===== 客户认证页面样式 ===== */
/* 认证面板容器 */
.auth-panel {
    padding: 30px 24px 20px;
    text-align: center;
}
/* 认证标题 */
.auth-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 12px 0 8px;
}
/* 认证说明文字 */
.auth-desc {
    font-size: 12px;
    color: #999;
    line-height: 1.7;
    margin-bottom: 20px;
}
/* 填写提示条：提醒客户按基金合同上的姓名和证件号填写 */
.auth-tip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fdf2f2;      /* 浅红底，与整体红色主题呼应 */
    border: 1px solid #f5c6c6;
    border-radius: 8px;
    color: #c0392b;           /* 深红文字 */
    font-size: 12px;
    line-height: 1.5;
    padding: 8px 12px;
    margin-bottom: 12px;
    text-align: left;
}
/* 提示条内图标不收缩 */
.auth-tip svg {
    flex-shrink: 0;
}
/* 认证表单容器 */
.auth-form {
    background: #fff;
    border-radius: 8px;
    padding: 6px 16px;
    text-align: left;
}
/* 表单行 */
.auth-form-item {
    padding: 10px 0;
    border-bottom: 1px solid #f2f2f2;
}
.auth-form-item:last-of-type {
    border-bottom: none;
}
/* 表单标签 */
.auth-label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}
/* 表单输入框 */
.auth-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    color: #333;
    background: transparent;
    padding: 2px 0;
}
.auth-input::placeholder {
    color: #ccc;
}
/* 输入框校验错误状态：红色边框（配合 .auth-error 提示文案） */
.auth-input.input-error {
    border-bottom: 1px solid #e74c3c;
}
/* 字段校验错误提示：红色小字，默认占位保持布局稳定 */
.auth-error {
    min-height: 16px;
    font-size: 11px;
    color: #e74c3c;
    line-height: 16px;
    margin-top: 2px;
}
/* 提交认证按钮 */
.auth-btn {
    width: 100%;
    margin-top: 16px;
    padding: 12px 0;
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    font-size: 15px;
    border: none;
    border-radius: 22px;
}
.auth-btn:active {
    opacity: 0.85;
}
/* 当前模拟 openid 提示（便于测试不同用户流程，正式环境可删除） */
.openid-hint {
    font-size: 11px;
    color: #bbb;
    margin-bottom: 10px;
    word-break: break-all;
}

/* ===== 页面内 Toast 提示（替代 alert，兼容微信 web-view 等屏蔽原生弹窗的环境） ===== */
.toast-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* 初始隐藏 */
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.toast-mask.show {
    opacity: 1;
    pointer-events: auto;
}
.toast-box {
    max-width: 80%;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
    padding: 14px 22px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
