/* ============================================
   极速贷 H5 公共样式（index 模块）
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: #e9ebef;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #333;
    font-size: 15px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, li {
    list-style: none;
}

button {
    outline: none;
    cursor: pointer;
    font-family: inherit;
}

.h5-page {
    max-width: 500px;
    margin: 0 auto;
    background: #f5f6f8;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 18px rgba(0, 0, 0, .06);
}

.card {
    background: #fff;
    border-radius: 12px;
    margin: 10px;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: #222;
}

/* ---------------- 顶部标题栏 ---------------- */
.topbar,
.navbar {
    height: 50px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-title,
.nav-title {
    font-size: 19px;
    font-weight: 700;
    color: #111;
}

.nav-back {
    position: absolute;
    left: 0;
    top: 0;
    width: 48px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-back svg {
    width: 22px;
    height: 22px;
}

/* 合同页：PDF 内嵌框撑满导航栏以下区域 */
.contract-frame {
    display: block;
    width: 100%;
    height: calc(100vh - 50px);
    border: 0;
    background: #f5f6f8;
}

/* ---------------- 首页橙色头部 ---------------- */
.hero {
    background: linear-gradient(135deg, #ff9f2b 0%, #ff7300 100%);
    color: #fff;
    text-align: center;
    padding: 26px 20px 24px;
}

.hero-name {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: 1px;
}

.hero-status {
    margin-top: 14px;
    font-size: 18px;
}

.hero-amount {
    margin-top: 8px;
    font-size: 16px;
}

.hero-btn {
    display: inline-block;
    margin-top: 16px;
    min-width: 168px;
    padding: 11px 30px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4dd46b 0%, #22b14c 100%);
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    box-shadow: 0 5px 12px rgba(26, 160, 80, .35);
}

.hero-btn-gray {
    background: #bdbdbd;
    box-shadow: none;
}

.hero-slogan {
    margin-top: 18px;
    font-size: 15px;
    opacity: .95;
    letter-spacing: 2px;
}

/* ---------------- 滚动播报 ---------------- */
.notice {
    display: flex;
    align-items: center;
    height: 38px;
    background: #fff3e0;
    padding: 0 12px;
    overflow: hidden;
}

.notice-bell {
    width: 20px;
    height: 20px;
    flex: none;
}

.marquee {
    flex: 1;
    overflow: hidden;
    margin-left: 8px;
    white-space: nowrap;
}

.marquee-inner {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 22s linear infinite;
}

.notice-text {
    color: #f06b10;
    font-size: 14px;
    margin-right: 36px;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ---------------- 功能宫格 ---------------- */
.menu-grid {
    display: flex;
    flex-wrap: wrap;
    padding: 10px 10px 0;
}

.menu-item {
    width: calc((100% - 20px) / 3);
    margin-right: 10px;
    margin-bottom: 10px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.menu-item:nth-child(3n) {
    margin-right: 0;
}

.menu-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.menu-icon svg {
    width: 30px;
    height: 30px;
}

.gradient-orange {
    background: linear-gradient(135deg, #ffb237 0%, #ff7a00 100%);
}

.gradient-green {
    background: linear-gradient(135deg, #a8d84a 0%, #74c23a 100%);
}

.gradient-blue {
    background: linear-gradient(135deg, #39a3f7 0%, #1d7ef0 100%);
}

.gradient-pink {
    background: linear-gradient(135deg, #ff5f9e 0%, #ef2d7d 100%);
}

.gradient-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #6a3ed3 100%);
}

.gradient-amber {
    background: linear-gradient(135deg, #ffb433 0%, #ff8c00 100%);
}

.menu-text {
    font-size: 14px;
    color: #333;
}

/* ---------------- 逾期影响 ---------------- */
.block-title {
    padding: 16px 14px 12px;
    font-size: 18px;
    font-weight: 800;
    color: #222;
}

.block-title-inner {
    padding: 6px 14px 10px;
}

.impact-card {
    background: #fff;
    border-radius: 12px;
    margin: 0 10px 12px;
    display: flex;
    padding: 18px 4px;
}

.impact-item {
    flex: 1;
    text-align: center;
}

.impact-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #d9ecff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}

.impact-icon svg {
    width: 30px;
    height: 30px;
}

.impact-text {
    font-size: 13px;
    color: #666;
}

/* ---------------- 信息行（还款/收银台） ---------------- */
.info-card,
.confirm-card {
    padding: 6px 16px;
}

.confirm-card .card-title {
    padding: 12px 0 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 2px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 16px;
}

.info-row .label {
    color: #8a8a8a;
}

.info-row .value {
    color: #222;
    font-weight: 600;
}

.info-row.is-danger .label,
.info-row.is-danger .value {
    color: #f5222d;
}

.info-row:last-child {
    border-bottom: none;
}

.total-row .label {
    color: #f5222d !important;
    font-weight: 700;
    font-size: 17px;
}

.total-row .value {
    color: #f5222d !important;
    font-size: 22px;
    font-weight: 800;
}

/* ---------------- 操作按钮 ---------------- */
.action-row {
    display: flex;
    margin: 14px 10px;
}

.btn {
    flex: 1;
    height: 54px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-green {
    background: linear-gradient(135deg, #46d170 0%, #27bd56 100%);
    color: #fff;
    margin-right: 12px;
    box-shadow: 0 4px 10px rgba(38, 190, 86, .3);
}

.btn-outline {
    background: #fff;
    color: #333;
    border: 1px solid #e2e2e2;
}

/* ---------------- 上传凭证 ---------------- */
.upload-card {
    padding: 18px 16px;
}

.upload-card .card-title {
    margin-bottom: 16px;
}

.btn-blue {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f8cff 0%, #2f6cf5 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(47, 108, 245, .25);
}

.voucher-preview {
    display: flex;
    flex-wrap: wrap;
    margin-top: 12px;
}

.voucher-preview img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 8px 8px 0;
    border: 1px solid #eee;
}

/* ---------------- 分期卡片 ---------------- */
.period {
    position: relative;
    background: #fff;
    border-radius: 12px;
    margin: 12px 10px;
    padding: 18px 16px;
    border-left: 4px solid #f5222d;
}

.period-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.period-title {
    font-size: 19px;
    font-weight: 800;
    color: #1a1a1a;
}

.period-status {
    color: #f5222d;
    font-size: 16px;
}

.period-line {
    color: #666;
    font-size: 15px;
    line-height: 2;
}

.period-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.btn-pay {
    flex: none;
    background: #f54040;
    color: #fff;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(245, 64, 64, .3);
}

/* 已还的期：灰色不可点击 */
.btn-pay-paid {
    background: #c2c8cf;
    box-shadow: none;
    cursor: default;
}

/* ---------------- 收银台还款方式 ---------------- */
.pay-card {
    padding: 20px 18px;
}

.bank-card {
    border: 1.5px solid #4a90ff;
    box-shadow: 0 0 0 1px rgba(74, 144, 255, .15);
}

.pay-title {
    font-size: 18px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.bank-line {
    font-size: 16px;
    color: #444;
    line-height: 2.1;
}

.bank-note {
    color: #666;
}

.alipay {
    text-align: center;
    color: #999;
    font-size: 18px;
    margin-top: 16px;
}

.qr-card {
    border: 1.5px solid #2ecc71;
    text-align: center;
    margin-bottom: 20px;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo {
    width: 26px;
    height: 26px;
    margin-right: 7px;
}

.brand-name {
    color: #16a34a;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 1px;
}

.qr-panel {
    width: 220px;
    margin: 16px auto 0;
    background: #0a9d48;
    border-radius: 8px;
    padding: 14px;
}

.qr-panel canvas,
.qr-panel img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.qr-tip {
    color: #fff;
    font-size: 14px;
    margin-top: 10px;
}

/* ---------------- 会员中心 ---------------- */
.profile-card {
    display: flex;
    align-items: center;
    padding: 22px 18px;
    margin: 10px;
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 16px;
    flex: none;
}

.avatar svg {
    width: 100%;
    height: 100%;
    display: block;
}

.profile-name {
    font-size: 21px;
    font-weight: 800;
    color: #1a1a1a;
}

.profile-mobile {
    color: #888;
    font-size: 15px;
    margin-top: 6px;
}

/* 我的资料 - 储蓄卡 */
.savings-card {
    margin: 12px 10px 0;
    padding: 18px 16px 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff3b30, #e60012);
    color: #fff;
    box-shadow: 0 4px 10px rgba(230, 0, 18, 0.25);
}

.savings-title {
    font-size: 17px;
    font-weight: 800;
}

.savings-no {
    margin-top: 14px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}

.menu-card {
    overflow: hidden;
    padding: 0 16px;
}

.menu-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 17px;
    color: #222;
}

.menu-card .menu-row:last-child {
    border-bottom: none;
}

.menu-arrow {
    width: 18px;
    height: 18px;
}

/* ---------------- 底部导航 ---------------- */
.tabbar-holder {
    height: 58px;
}

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
}

.tabbar-inner {
    max-width: 500px;
    margin: 0 auto;
    height: 58px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8a8a8a;
    font-size: 12px;
}

.tab-item svg {
    width: 23px;
    height: 23px;
    margin-bottom: 2px;
}

.tab-item.active {
    color: #1e88e5;
}

/* ---------------- 轻提示 ---------------- */
.js-toast {
    position: fixed;
    left: 50%;
    bottom: 96px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, .75);
    color: #fff;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 8px;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s;
}

.js-toast.show {
    opacity: 1;
}

/* ---------------- 登录页 ---------------- */
.login-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 290px;
    background: linear-gradient(160deg, #ff9d26 0%, #f6790b 70%, #f98512 100%);
    z-index: 0;
    /* 底边浅弧：中间缓缓下凹，中央被登录卡片覆盖，两侧露出弧肩 */
    border-radius: 0 0 50% 50% / 0 0 46px 46px;
}

.login-wrap {
    position: relative;
    z-index: 1;
    padding: 0 30px;
}

.login-card {
    margin-top: 125px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(180, 90, 0, .12);
    padding: 46px 32px 42px;
}

.login-title {
    text-align: center;
    font-size: 30px;
    font-weight: 800;
    color: #4a4a4a;
    margin-bottom: 38px;
    letter-spacing: 2px;
}

.login-input {
    width: 100%;
    height: 58px;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 0 18px;
    font-size: 16px;
    color: #333;
    background: #fcfcfc;
    outline: none;
}

.login-input:focus {
    border-color: #ff8a1e;
    background: #fff;
}

.login-input::placeholder {
    color: #b5b5b5;
}

.login-btn {
    width: 100%;
    height: 56px;
    margin-top: 34px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff9d2e 0%, #f87c0c 100%);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 6px;
    text-indent: 6px;
    box-shadow: 0 6px 14px rgba(248, 124, 12, .32);
}

.login-btn:active {
    opacity: .88;
}

/* ---------------- 在线客服 ---------------- */
/* 顶部导航：客服头像 + 标题 + 在线状态 */
.chat-navbar {
    height: 60px;
    background: linear-gradient(135deg, #ff9f2b 0%, #ff7300 100%);
    display: flex;
    align-items: center;
    padding: 0 14px 0 50px;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: 0 2px 10px rgba(255, 115, 0, .22);
}

.chat-navbar .nav-back {
    height: 60px;
}

.chat-nav-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    margin-right: 10px;
}

.chat-nav-avatar svg {
    width: 25px;
    height: 25px;
    display: block;
}

.chat-nav-info {
    line-height: 1.3;
}

.chat-nav-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

.chat-nav-sub {
    display: flex;
    align-items: center;
    font-size: 11.5px;
    color: rgba(255, 255, 255, .88);
    margin-top: 2px;
}

.chat-online {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4df58d;
    margin-right: 5px;
    box-shadow: 0 0 0 2px rgba(77, 245, 141, .25);
    animation: chat-blink 1.6s infinite;
}

@keyframes chat-blink {
    50% {
        opacity: .4;
    }
}

/* 防诈骗安全提示条 */
.chat-safe {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: #fff3e6;
    color: #b45309;
    font-size: 11.5px;
    padding: 7px 14px;
    text-align: center;
}

.chat-safe svg {
    width: 13px;
    height: 13px;
    flex: none;
}

/* 主体：消息区 + 快捷问题 + 输入栏（导航 60px + 提示条约 31px） */
.chat-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 91px);
    overflow: hidden;
    background: #f4f5f7;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 12px 18px;
}

/* 居中系统提示 / 时间戳 */
.chat-sys,
.chat-time {
    text-align: center;
    font-size: 12px;
    color: #a8abb2;
    margin-bottom: 14px;
}

.chat-sys {
    display: block;
    width: fit-content;
    margin: 0 auto 16px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .05);
    color: #8a8f99;
}

/* 消息行 */
.chat-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    animation: chat-in .2s ease-out;
}

@keyframes chat-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-item.is-user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex: none;
}

.chat-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* 气泡：靠近头像一侧为小圆角，无小三角，更干净 */
.chat-bubble {
    position: relative;
    max-width: 72%;
    margin: 0 10px;
    padding: 10px 14px;
    border-radius: 4px 18px 18px 18px;
    background: #fff;
    font-size: 15.5px;
    line-height: 1.5;
    color: #262626;
    word-break: break-word;
    white-space: pre-wrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.is-user .chat-bubble {
    border-radius: 18px 4px 18px 18px;
    background: linear-gradient(135deg, #ff9f35 0%, #ff7300 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(255, 115, 0, .25);
}

.chat-bubble img {
    display: block;
    width: 170px;
    max-width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 10px;
    cursor: zoom-in;
}

/* 快捷问题：横向滑动的胶囊按钮 */
.chat-quick {
    flex: none;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 12px;
    background: #fff;
    border-top: 1px solid #efefef;
    scrollbar-width: none;
}

.chat-quick::-webkit-scrollbar {
    display: none;
}

.chat-quick-item {
    flex: none;
    padding: 6px 13px;
    border-radius: 999px;
    background: #fff5ea;
    border: 1px solid #ffe1bf;
    color: #f56a00;
    font-size: 13px;
}

.chat-quick-item:active {
    background: #ffe8d2;
}

/* 输入栏 */
.chat-input-bar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #efefef;
}

.chat-plus-btn {
    flex: none;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f2f3f5;
    color: #8a8f99;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-plus-btn svg {
    width: 22px;
    height: 22px;
    display: block;
}

.chat-plus-btn:active {
    background: #e6e7eb;
}

.chat-text-input {
    flex: 1;
    height: 36px;
    border: none;
    border-radius: 18px;
    background: #f4f5f7;
    padding: 0 15px;
    font-size: 15.5px;
    color: #262626;
    outline: none;
}

.chat-text-input::placeholder {
    color: #b5b8c0;
}

/* 圆形发送按钮，有内容时高亮 */
.chat-send-btn {
    flex: none;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #d4d6db;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.chat-send-btn svg {
    width: 19px;
    height: 19px;
    margin-left: 1px;
    display: block;
}

.chat-send-btn.is-active {
    background: linear-gradient(135deg, #ff9f35 0%, #ff7300 100%);
    box-shadow: 0 2px 6px rgba(255, 115, 0, .35);
}

.chat-send-btn.is-active:active {
    opacity: .85;
}

/* 图片全屏预览 */
.chat-viewer {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: viewer-in .15s ease-out;
}

@keyframes viewer-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.chat-viewer img {
    max-width: 94%;
    max-height: 90%;
    border-radius: 4px;
}
