/* ===== H5 移动端样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
    --primary: #18395C;
    --primary-light: #2c5282;
    --primary-bg: #f0f4f8;
    --bg: #f5f5f7;
    --card-bg: #fff;
    --text: #1d1d1f;
    --text-secondary: #86868b;
    --border: #e5e5ea;
    --success: #34c759;
    --danger: #ff3b30;
    --warning: #ff9500;
    --info: #007aff;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(0,0,0,0.06);
}
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; padding-bottom: 70px; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font-family: inherit; }

/* ===== 顶部导航 ===== */
.nav-bar { position: sticky; top: 0; z-index: 100; background: var(--primary); color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.nav-bar h1 { font-size: 17px; font-weight: 600; }
.nav-bar .back { font-size: 20px; cursor: pointer; width: 30px; }
.nav-bar .right { font-size: 13px; opacity: 0.9; cursor: pointer; }

/* ===== 底部导航 ===== */
.tab-bar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--border); display: flex; z-index: 100; padding-bottom: env(safe-area-inset-bottom); }
.tab-item { flex: 1; text-align: center; padding: 8px 0; color: var(--text-secondary); font-size: 11px; cursor: pointer; }
.tab-item.active { color: var(--primary); }
.tab-item .tab-icon { font-size: 20px; display: block; margin-bottom: 2px; }

/* ===== 卡片 ===== */
.card { background: var(--card-bg); border-radius: var(--radius); margin: 12px; padding: 16px; box-shadow: var(--shadow); }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }

/* ===== 按钮 ===== */
.btn { display: inline-block; padding: 12px 20px; border: none; border-radius: 10px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; text-align: center; width: 100%; transition: opacity 0.2s; }
.btn:active { opacity: 0.8; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-danger { background: var(--danger); }
.btn-block { width: 100%; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; background: #fafafa;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); background: #fff; }

/* ===== 商品列表 ===== */
.goods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
.goods-item { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.goods-img { width: 100%; height: 150px; background: linear-gradient(135deg, #e0e7ff, #f0f4f8); display: flex; align-items: center; justify-content: center; font-size: 40px; }
.goods-info { padding: 10px; }
.goods-name { font-size: 13px; font-weight: 500; margin-bottom: 6px; line-height: 1.3; height: 34px; overflow: hidden; }
.goods-price { color: var(--danger); font-size: 16px; font-weight: 700; }
.goods-price small { font-size: 12px; }

/* ===== 商品详情 ===== */
.detail-img { width: 100%; height: 300px; background: linear-gradient(135deg, #e0e7ff, #f0f4f8); display: flex; align-items: center; justify-content: center; font-size: 80px; }
.detail-info { padding: 16px; }
.detail-name { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.detail-price { color: var(--danger); font-size: 24px; font-weight: 700; }
.detail-desc { margin-top: 16px; color: var(--text-secondary); line-height: 1.6; }

/* ===== 钱包 ===== */
.wallet-banner { background: linear-gradient(135deg, #18395C, #2c5282); color: #fff; padding: 24px 20px; border-radius: 0 0 20px 20px; }
.wallet-banner h2 { font-size: 14px; opacity: 0.8; font-weight: 400; }
.wallet-total { font-size: 32px; font-weight: 700; margin: 8px 0; }
.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.wallet-item { background: #fff; border-radius: 12px; padding: 16px; text-align: center; box-shadow: var(--shadow); }
.wallet-item .w-icon { font-size: 28px; margin-bottom: 6px; }
.wallet-item .w-name { font-size: 12px; color: var(--text-secondary); }
.wallet-item .w-balance { font-size: 18px; font-weight: 700; color: var(--primary); margin-top: 4px; }

/* ===== 列表项 ===== */
.list-item { display: flex; align-items: center; padding: 14px 16px; background: #fff; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.list-item .item-icon { font-size: 22px; margin-right: 12px; }
.list-item .item-content { flex: 1; }
.list-item .item-title { font-size: 14px; font-weight: 500; }
.list-item .item-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.list-item .item-extra { font-size: 13px; color: var(--text-secondary); }
.item-arrow { color: #c7c7cc; font-size: 16px; margin-left: 8px; }

/* ===== 标签 ===== */
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.tag-blue { background: #e8f0fe; color: #1967d2; }
.tag-green { background: #e6f4ea; color: #137333; }
.tag-red { background: #fce8e6; color: #c5221f; }
.tag-orange { background: #fef7e0; color: #b06000; }

/* ===== 流水 ===== */
.log-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--border); }
.log-item .log-left .log-title { font-size: 14px; }
.log-item .log-left .log-time { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.log-item .log-amount { font-size: 15px; font-weight: 600; }
.log-amount.income { color: var(--success); }
.log-amount.expense { color: var(--danger); }

/* ===== 空状态 ===== */
.empty { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

/* ===== 弹窗 ===== */
.modal-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-box { background: #fff; border-radius: 16px; padding: 20px; width: 85%; max-width: 320px; }
.modal-title { font-size: 16px; font-weight: 600; text-align: center; margin-bottom: 12px; }
.modal-content { font-size: 14px; color: var(--text-secondary); text-align: center; margin-bottom: 16px; }
.modal-btns { display: flex; gap: 10px; }
.modal-btns .btn { flex: 1; }

/* ===== 工具 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-10 { gap: 10px; }
