/* ============================================================
 * H5 全局样式（复刻原版视觉：浅蓝底/白卡片/圆角阴影/紫蓝主按钮）
 * ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
a { text-decoration: none; -webkit-tap-highlight-color: transparent; }
input, textarea, select, button { outline: none; font-family: inherit; }

body {
    background: #EFF5FF;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #333;
    padding-bottom: 70px; /* 给底部导航留位 */
}

/* 非微信引导条 */
.wx-guide {
    background: #fff7e6; color: #a05a00; font-size: 12px;
    padding: 8px 12px; display: flex; justify-content: space-between; align-items: center;
}
.wx-guide i { font-style: normal; font-size: 16px; padding: 0 6px; }

/* 页面头部 */
.h5-header {
    height: 80px; display: flex; align-items: flex-start;
    padding: 20px; background: linear-gradient(135deg, #e3ecff, #f6f9ff);
}
.h5-header .t { font-size: 20px; color: #000; line-height: 20px; letter-spacing: 5px; font-weight: 600; }

/* 首页顶部标题栏（左上角小标题 + 中间居中大标题） */
.home-top {
    height: 44px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #e3ecff, #f6f9ff);
    position: relative; -webkit-tap-highlight-color: transparent;
}
.home-top .home-corner {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    font-size: 13px; color: #7082e4; font-weight: 500;
}
.home-top .home-center {
    font-size: 18px; color: #000; font-weight: 600; letter-spacing: 3px;
}

/* 返回式小头部（写信/人脸页） */
.h5-header-bar {
    height: 46px; display: flex; align-items: center; justify-content: center;
    background: #fff; font-size: 16px; font-weight: 600; position: relative;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.h5-header-bar .back {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: #333; font-size: 20px; line-height: 1;
}

/* 白色卡片 */
.card {
    width: 94%; margin: 15px auto; background: #fff;
    border-radius: 10px; padding: 14px;
    box-shadow: 0 0 10px 0 #e2e2e2;
}
.card h1 { font-size: 16px; display: flex; align-items: center; }
.card h1 svg { width: 18px; height: 18px; margin-right: 6px; fill: #7082e4; }

/* 表单元素 */
.f-label { font-size: 14px; font-weight: 500; margin: 15px 0 5px; }
.f-input, .f-select {
    width: 100%; border: none; background: #f4f5f7;
    border-radius: 5px; height: 40px; padding: 10px; font-size: 14px;
}
.f-textarea {
    width: 100%; border: none; background: #f4f5f7;
    border-radius: 5px; padding: 10px; font-size: 14px; min-height: 140px; resize: none;
}

/* 主按钮 */
.btn-main {
    background: #7082e4; border: none; width: 100%;
    border-radius: 5px; height: 40px; margin-top: 20px;
    color: #fff; font-size: 15px; cursor: pointer;
}
.btn-main:active { opacity: .85; }
.btn-main[disabled] { background: #b9c0e8; }
.btn-plain {
    border: 1px solid #7082e4; color: #7082e4; background: #fff;
    border-radius: 6px; padding: 4px 16px; font-size: 13px; cursor: pointer;
}

/* 滚动公告 */
.notice-bar {
    width: 94%; margin: 15px auto; background: #fff; border-radius: 10px;
    padding: 6px 10px; box-shadow: 0 0 10px 0 #e2e2e2;
    color: #4162ff; font-size: 13px;
    white-space: nowrap; overflow: hidden;
}
.notice-bar .marq { display: inline-block; animation: marq 14s linear infinite; }
@keyframes marq { from { transform: translateX(100%);} to { transform: translateX(-100%);} }

/* 横幅图占位（CSS 渐变，无需外部图片） */
.banner {
    width: 94%; margin: 0 auto; height: 41vw; max-height: 280px;
    border-radius: 10px; overflow: hidden;
    background: linear-gradient(120deg, #7082e4, #9ab0ff);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 20px; letter-spacing: 4px;
}

/* 首页入口卡片：整卡可点击，不再单独设置"去写信"按钮 */
.home-grid { width: 94%; margin: 15px auto; }
.home-item {
    display: flex; /* 改为flex布局，让右侧箭头靠右、垂直居中 */
    align-items: center;
    background: #fff; border-radius: 10px; box-shadow: 0 0 10px 0 #e2e2e2;
    padding: 16px 14px; margin-bottom: 12px;
    color: inherit; /* 链接默认色重置，保持文字原色 */
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow .15s;
}
/* 三个模块卡片各自淡彩色背景（轻柔不刺眼） */
.home-item:nth-child(1) { background: #fef5f7; } /* 写信：淡粉色 */
.home-item:nth-child(2) { background: #E6F7EF; } /* 和解电话：淡薄荷绿，呼应电话接听经典色 */
.home-item:nth-child(3) { background: #f5fbf0; } /* 人工传话：淡米黄绿，与和解电话做深浅区分 */
.home-item:active { box-shadow: 0 0 10px 0 #c9cdf5; } /* 点击反馈 */
.home-item .l { display: flex; align-items: center; flex: 1; } /* 左侧内容占满剩余空间，箭头自然靠右 */
.home-item .l svg { width: 34px; height: 34px; margin-right: 12px; }
.home-item .l .tt { font-size: 16px; font-weight: 600; }
.home-item .l .dd { font-size: 12px; color: #999; margin-top: 3px; }
/* 卡片右侧统一右箭头：柔和暖灰色，三个卡片大小位置完全一致 */
.home-item .arr {
    font-size: 22px;
    line-height: 1;
    color: #c4bfb5;
    margin-left: 8px;
    flex-shrink: 0;
}

/* 页面顶部左右切换标签（写信/写信记录、和解电话/消费记录、传话/传话记录） */
.page-tabs {
    display: flex; width: 94%; margin: 12px auto 0; background: #fff;
    border-radius: 10px; box-shadow: 0 0 10px 0 #e2e2e2; overflow: hidden;
    position: sticky; top: 0; z-index: 50;
}
.page-tab {
    flex: 1; text-align: center; padding: 13px 0; font-size: 15px;
    color: #999; border-bottom: 2px solid transparent; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.page-tab.on { color: #7082e4; font-weight: 600; border-bottom-color: #7082e4; }

/* 标签内容面板（切换显示/隐藏） */
.tab-pane { display: none; }
.tab-pane.on { display: block; }

/* 记录列表行（内联记录复用样式） */
.rec-row { padding: 12px 0; border-bottom: 1px solid #f4f5f7; font-size: 13px; }
.rec-row:last-child { border: none; }
.rec-row .p1 { font-weight: 600; margin-bottom: 4px; display: flex; justify-content: space-between; }
.rec-row .p2 { color: #666; font-size: 13px; margin: 3px 0; word-break: break-all; }
.rec-row .p3 { color: #999; font-size: 12px; margin-top: 4px; }
.rec-ok { color: #2ba245; } .rec-fail { color: #e64545; } .rec-wait { color: #f0a04b; }
.rec-imgs img { width: 58px; height: 58px; object-fit: cover; border-radius: 6px; margin: 4px 4px 0 0; }
.fb-box { background: #f6f8ff; border-radius: 6px; padding: 8px 10px; margin-top: 8px; font-size: 13px; }
.fb-box .fb-t { color: #7082e4; font-weight: 600; margin-bottom: 4px; }

/* 和解电话页黄色主按钮（提交拨打 / 联系客服 同色且常亮） */
.btn-amber {
    background: #ffb300; border: none; width: 100%;
    border-radius: 5px; height: 40px; margin-top: 20px;
    color: #fff; font-size: 15px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.btn-amber:active { opacity: .85; }
.btn-amber[disabled] { background: #ffd980; } /* 禁用态：浅黄 */

/* 底部导航 */
.tabbar {
    position: fixed; left: 0; bottom: 0; width: 100%; height: 56px;
    background: #fff; display: flex; box-shadow: 0 -2px 8px rgba(0,0,0,.06);
    z-index: 100;
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #999; }
.tabbar a svg { width: 22px; height: 22px; fill: #b9b9b9; }
.tabbar a p { font-size: 11px; margin-top: 2px; }
.tabbar a.on { color: #ec81a7; }
.tabbar a.on svg { fill: #ec81a7; }

/* ===================== 自写弹窗组件 ===================== */
.dlg-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.53); z-index: 999;
    display: flex; align-items: center; justify-content: center;
}
.dlg-box {
    width: 82%; max-width: 340px; background: #fff; border-radius: 10px;
    padding: 18px 16px; position: relative; max-height: 75vh; overflow-y: auto;
}
.dlg-box .dlg-title { font-size: 16px; font-weight: 700; text-align: center; margin-bottom: 10px; }
.dlg-box .dlg-close { position: absolute; right: 10px; top: 8px; font-size: 18px; color: #999; cursor: pointer; }
.dlg-box p { margin: 6px 0; }
.dlg-box .sub { font-size: 12px; color: #747474; }
/* 轻提示 toast */
.toast {
    position: fixed; left: 50%; top: 45%; transform: translate(-50%,-50%);
    background: rgba(0,0,0,.7); color: #fff; font-size: 14px;
    padding: 10px 18px; border-radius: 6px; z-index: 1000; max-width: 80%;
    text-align: center; line-height: 1.5;
}
/* 加载中 */
.toast .spin {
    display: inline-block; width: 16px; height: 16px; margin-right: 6px;
    border: 2px solid #fff; border-top-color: transparent; border-radius: 50%;
    vertical-align: -3px; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg);} }

/* 记录列表项 */
.rec-item { background: #f4f5f7; border-radius: 5px; margin: 10px 0; padding: 10px; position: relative; }
.rec-item .p1 { font-size: 14px; }
.rec-item .p2 { font-size: 12px; color: #7a7a7a; }
.rec-item .act { position: absolute; color: #7082e4; right: 10px; top: 20px; font-size: 12px; }

/* 绑定手机号弹层 */
.bind-phone { display: none; }
.code-row { display: flex; gap: 8px; }
.code-row .f-input { flex: 1; }
.code-row button {
    border: 1px solid #7082e4; background: #fff; color: #7082e4;
    border-radius: 5px; padding: 0 12px; font-size: 13px; white-space: nowrap;
}

/* 人脸结果页 */
.face-result { text-align: center; padding: 30px 0 10px; }
.face-result .icon { font-size: 54px; }
.face-result .ok { color: #2ba245; }
.face-result .no { color: #e64545; }
