/* ============================================================
   index 首页 - 严格按设计图重建（BBVA 银行泰语版）
   全部图标/国旗用 CSS 绘制，无外部图片
   ============================================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Thai", sans-serif;
    color: #0d2240;
    max-width: 480px;
    margin: 0 auto;
}
thead{
    border-bottom: none;
}
th{
    border-bottom: none;
}

/* ---------- 顶部 Header（白底，不浮动） ---------- */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.bbva-logo {
    display: flex;
    align-items: center;
}
.bbva-logo img {
    height: 38px;
    width: auto;
    display: block;
}

.region-tag {
    font-size: 12px;
    color: #8a94a6;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---------- 第一行 Banner（白底） ---------- */
.banner {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 4px 16px 20px;
    min-height: 90px;
}

.banner-left {
    flex: 0 0 auto;
    width: 130px;
    height: 100px;
    position: relative;
    z-index: 1;
}

.banner-left .cards-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.banner-right {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 2;
    padding-left: 10px;
}

.banner-title {
    margin-bottom: 10px;
    text-align: right;
}

.banner-title .title-img {
    width: 100%;
    max-width: 280px;
    height: auto;
    display: inline-block;
}

.circle-btns {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.circle-btn {
    width: 54px;
    height: 54px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}

.circle-btn small {
    font-size: 7px;
    font-weight: 500;
    opacity: 0.95;
    margin-top: 1px;
}

.circle-btn.cny {
    background: linear-gradient(145deg, #1f6feb, #0d47a1);
}

.circle-btn.usd {
    background: linear-gradient(145deg, #e0a800, #b58400);
}

.circle-btn.thb {
    background: #ffffff;
    color: #1d3a6e;
    border: 2px solid #d4a017;
    box-shadow: none;
    font-size: 11px;
}

.circle-btn.thb small {
    color: #b58400;
    font-weight: 600;
}
/* 客服图标（猫爪图片） */
.circle-btn .cs-icon {
    display: block;
    width: 24px;
    height: 24px;
    background: url('../myimg/ui-kefu.png') no-repeat center center / contain;
    margin-bottom: 1px;
}

/* ---------- EXCHANGE RATE 白色大圆角卡片 ---------- */
.rate-card {
    background: #ffffff;
    border-radius: 20px;
    margin: 0 16px 16px;
    padding: 16px;
    box-shadow: 0 6px 20px rgba(13, 34, 64, 0.18), 0 0 0 1px rgba(13, 34, 64, 0.04);
    z-index: 99;
    position: relative;
}

.rate-head {
    /* display: flex; */
    align-items: center;
    /* justify-content: space-between; */
    text-align: center;
    margin-bottom: 4px;
}

.rate-title {
    font-size: 17px;
    font-weight: 800;
    color: #285390;
    letter-spacing: 0.3px;
}

.rate-date {
    font-size: 11px;
    color: #9aa5b5;
}

.rate-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.rate-table th {
    font-size: 12px;
    color: #8a94a6;
    font-weight: 600;
    padding: 8px 0;
    border-bottom: none;
}

.rate-table th:nth-child(2),
.rate-table th:nth-child(3),
.rate-table td:nth-child(2),
.rate-table td:nth-child(3) {
    text-align: right;
    padding-right: 18px;
}

.rate-table td {
    padding: 10px 0;
    border-bottom: none;
    font-size: 14px;
    font-weight: 600;
    color: #0d2240;
    text-align: left;
}

.rate-table td:first-child {
    padding-left: 6px;
}

.rate-table tr:last-child td {
    border-bottom: none;
}

.rate-cur {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-weight: 800;
}

.rate-cur .cur-abbr {
    font-weight: 600;
    color: #3a4657;
}

/* 国旗图标（统一圆形显示，原版圆形 PNG + 新生成方形 JPG 都用 cover 填充） */
.flag {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: block;
    border-radius: 50%;
    overflow: hidden;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* 泰 */
.flag-th {
    background: linear-gradient(180deg, #f5f5f5 0 30%, #2b2b2b 30% 40%, #f5f5f5 40% 60%, #a51931 60% 70%, #f5f5f5 70% 100%);
}

/* 美 */
.flag-us {
    background:
        repeating-linear-gradient(180deg, #b22234 0 3px, #ffffff 3px 6px) 0 0/100% 60% no-repeat,
        #3c3b6e;
}

.flag-us::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 34%;
    background: #3c3b6e;
}

/* 德 */
.flag-de {
    background: linear-gradient(180deg, #000000 0 33%, #dd0000 33% 66%, #ffce00 66% 100%);
}

/* 日 */
.flag-jp {
    background: #ffffff;
}

.flag-jp::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 11px;
    height: 11px;
    transform: translate(-50%, -50%);
    background: #bc002d;
    border-radius: 50%;
}

/* 英 */
.flag-uk {
    background:
        linear-gradient(180deg, transparent 0 44%, #b22234 44% 56%, transparent 56%),
        linear-gradient(90deg, transparent 0 44%, #b22234 44% 56%, transparent 56%),
        linear-gradient(180deg, transparent 0 34%, #00247d 34% 66%, transparent 66%),
        linear-gradient(90deg, transparent 0 34%, #00247d 34% 66%, transparent 66%), #ffffff;
}

/* 加 */
.flag-ca {
    background: linear-gradient(90deg, #d80621 0 33%, #ffffff 33% 67%, #d80621 67% 100%);
}

.flag-ca::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 10px;
    transform: translate(-50%, -50%);
    background: #d80621;
    border-radius: 4px 4px 2px 2px;
    clip-path: polygon(0 0, 100% 0, 100% 30%, 50% 100%, 0 30%);
}

/* 中 CNY */
.flag-cny {
    background: #de2910;
}

.flag-cny::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 30%;
    width: 6px;
    height: 6px;
    background: #ffde00;
    transform: rotate(20deg);
}

/* 英 GBP */
.flag-gbp {
    background: #012169;
}

.flag-gbp::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 42%, #ffffff 42% 50%, #c8102e 50% 58%, transparent 58%),
        linear-gradient(180deg, transparent 42%, #ffffff 42% 50%, #c8102e 50% 58%, transparent 58%);
}

/* 韩 KRW */
.flag-krw {
    background: #ffffff;
}

.flag-krw::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #cd2e3a 0 50%, #0047a0 50% 100%);
    border-radius: 50%;
}

/* 美 USD */
.flag-usd {
    background: repeating-linear-gradient(180deg, #b22234 0 3px, #ffffff 3px 6px);
}

.flag-usd::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: #3c3b6e;
}

/* 欧 EUR */
.flag-eur {
    background: #003399;
}

.flag-eur::after {
    content: '★';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffcc00;
    font-size: 13px;
}

.rate-note {
    font-size: 9px;
    color: #b0b8c4;
    text-align: left;
    margin-top: 8px;
}

/* ---------- 蓝色大背景区域（交易市场 + 历史） ---------- */
.blue-section {
    background: linear-gradient(90deg, #568bd5 0%, #245eb0 60%, #214d95 100%);
    border-radius: 22px 22px 0 0;
    padding: 20px 16px 110px;
    margin-top: -256px;
    position: relative;
    padding-top: 300px;
}

.section-title-white {
    /* display: flex;
    align-items: center;
    justify-content: space-between; */
    margin-bottom: 14px;
    width: 100%;
    text-align: center;
}

.section-title-white h3 {
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.3px;

}

.section-title-white .view-more {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
}

/* 交易市场白色卡片 */
.market-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 22px 12px;
    margin-bottom: 54px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

/* 交易市场 6 国旗 3x2 */
.market-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 8px;
}

.market-item {
    text-align: center;
    cursor: pointer;
}

.market-item:active {
    opacity: 0.7;
}

.market-item .flag-big {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 auto 6px;
    /* background-color: #FFF; */
}

.market-item .m-name {
    font-size: 12px;
    font-weight: 700;
    color: #5874db;
    letter-spacing: 0.3px;
}

.market-item .m-tip {
    font-size: 10px;
    color: rgba(148, 148, 148, 0.7);
    margin-top: 2px;
}

/* ---------- RESULT HISTORY 表格（从下往上滚动，初始即有数据） ---------- */
.history-wrap {
    margin-top: 0;
    overflow: hidden;
    height: 160px;
    position: relative;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 12px;
}

.history-table th {
    background: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    padding: 8px 4px;
    font-size: 11px;
}

.history-table td {
    padding: 9px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    color: #ffffff;
}

.history-table .h-amount {
    font-weight: 700;
}

.history-table .h-qty {
    color: #9fdcff;
    font-weight: 700;
}

/* 滚动容器：表头固定，数据部分从下往上滚动 */
.history-scroll-wrap {
    height: 132px;
    overflow: hidden;
    position: relative;
}

/* 从下往上滚动动画 */
@keyframes historyUp {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50%);
    }
}

.scroll-inner {
    display: block;
    animation: historyUp 16s linear infinite;
}

.scroll-inner .history-list {
    margin: 0;
    padding: 0;
}

/* 底部导航样式在公共文件 mycss/footer-nav.css 中，此处不再重复 */