/* ---------- reset + base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    background: #eef3fa;
    color: #1f2937;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a, button { cursor: pointer; }
a { text-decoration: none; color: inherit; }
button { border: 0; }
.ico { width: 1em; height: 1em; vertical-align: -0.15em; }

/* ---------- header ---------- */
.hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky; top: 0; z-index: 50;
}
.hd-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hd-logo {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .35);
}
.hd-text { min-width: 0; }
.hd-name {
    font-size: 1.1rem; font-weight: 700; color: #111827;
    line-height: 1.2; margin-bottom: 3px; white-space: nowrap;
}
.hd-tagline {
    font-size: 0.78rem; color: #6b7280; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.hd-domain { color: #2563eb; font-weight: 700; }

.hd-kefu {
    display: inline-flex; align-items: center; gap: 6px;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.85rem; font-weight: 600;
    transition: background .15s, transform .1s;
}
.hd-kefu:active { transform: scale(.96); }
.hd-kefu:hover  { background: #dbeafe; }
.hd-kefu .ico { font-size: 14px; }

/* ---------- banner slider ---------- */
.banner-slider {
    margin: 12px 14px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 22px rgba(15, 41, 90, .15);
    aspect-ratio: 23 / 10;
    background: #d4dbe5;
}
.banner-track {
    display: flex; height: 100%;
    transition: transform .5s ease;
    will-change: transform;
}
.slide {
    flex: 0 0 100%;
    width: 100%; height: 100%;
    position: relative;
    overflow: hidden;
    display: block;
}
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

.slide-bg { position: absolute; inset: 0; pointer-events: none; }
.slide-bg .dec {
    position: absolute;
    width: 80px; height: 80px;
    opacity: .6;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .3));
}
.slide-bg .d1 { top: 8%;   right: 6%;  width: 92px; height: 92px; }
.slide-bg .d2 { bottom: 10%; left: 8%;  width: 76px; height: 76px; transform: rotate(-15deg); }
.slide-bg .d3 { top: 14%;  left: 16%; width: 60px; height: 60px; transform: rotate(20deg); opacity: .35; }
.slide-bg .d4 { bottom: 18%; right: 22%; width: 58px; height: 58px; opacity: .35; }

.slide-text {
    position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
    color: #fff; max-width: 65%; z-index: 2;
}
.slide-eyebrow {
    display: inline-block;
    background: rgba(0, 0, 0, .35);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .68rem; font-weight: 700;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, .25);
    text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.slide-title {
    font-size: 1.15rem; font-weight: 800;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
    margin-bottom: 8px;
    line-height: 1.3;
}
.slide-cta {
    display: inline-block;
    background: #fff;
    color: #0f172a;
    font-size: .82rem; font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .25);
}

.banner-dots {
    position: absolute;
    bottom: 8px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px;
    z-index: 3;
}
.banner-dots .dot {
    width: 6px; height: 6px;
    background: rgba(255, 255, 255, .5);
    border-radius: 50%;
    transition: width .25s, background .25s;
    cursor: pointer;
}
.banner-dots .dot.active {
    width: 18px;
    background: #fff;
    border-radius: 6px;
}

/* ---------- notice ---------- */
.notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 14px 14px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.82rem;
    color: #4b5563;
    box-shadow: 0 2px 6px rgba(15, 41, 90, .04);
}
.notice-icon {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f97316, #ef4444);
    border-radius: 50%;
    flex-shrink: 0;
    color: #fff;
}
.notice-text {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notice-tail {
    color: #ef4444;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ---------- search bar ---------- */
.searchbar {
    margin: 0 14px 12px;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    transition: border-color .15s, box-shadow .15s;
    box-shadow: 0 2px 6px rgba(15, 41, 90, .04);
}
.searchbar:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}
.searchbar .ico { font-size: 18px; color: #94a3b8; }
.searchbar input {
    flex: 1;
    background: transparent;
    border: 0; outline: 0;
    color: #1f2937;
    font-size: .92rem;
}
.searchbar input::placeholder { color: #9ca3af; }

/* ---------- tabs ---------- */
.tabs {
    display: flex;
    gap: 8px;
    padding: 0 14px;
    margin-bottom: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
    flex-shrink: 0;
    padding: 9px 22px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    color: #6b7280;
    font-size: 0.88rem; font-weight: 500;
    transition: all .2s ease;
}
.tab-btn.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
}

/* ---------- cards ---------- */
.cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 14px;
}
.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 2px 6px rgba(15, 41, 90, .04);
}
.card:hover { box-shadow: 0 6px 14px rgba(15, 41, 90, .1); }
.card:active { transform: scale(.98); }
.card-logo {
    width: 56px; height: 56px;
    border-radius: 14px;
    flex-shrink: 0;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(15, 41, 90, .15);
}
.card-logo-initial {
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 900; font-size: 1.45rem;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .35);
}
.card-body { flex: 1; min-width: 0; }
.card-name {
    font-size: 1rem; font-weight: 700; color: #111827;
    margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-tagline {
    font-size: 0.78rem; color: #6b7280;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-cta {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff; font-weight: 700;
    font-size: 0.82rem;
    padding: 9px 18px;
    border-radius: 999px;
    flex-shrink: 0;
    transition: transform .1s, box-shadow .15s;
    box-shadow: 0 4px 10px rgba(37, 99, 235, .35);
}
.card-cta:active { transform: scale(.96); }

@media (max-width: 380px) {
    .card { padding: 12px; gap: 10px; }
    .card-logo { width: 48px; height: 48px; }
    .card-cta { padding: 7px 14px; font-size: 0.75rem; }
}

.bottom-spacer { height: 92px; }

/* ---------- bottom nav (.bnav class) ---------- */
.bnav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid #e5e7eb;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -4px 14px rgba(15, 41, 90, .06);
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    color: #9ca3af;
    font-size: 0.74rem;
    font-weight: 500;
    transition: color .15s, transform .1s;
    position: relative;
}
.nav-item:active { transform: scale(.94); }
.nav-item .icon {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: #f3f4f6;
}
.nav-item .icon .ico { font-size: 18px; }
.nav-item.active { color: #2563eb; }
.nav-item.active .icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, .35);
}

.nav-item.primary { color: #ef4444; font-weight: 700; }
.nav-item.primary .icon {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    box-shadow: 0 6px 16px rgba(239, 68, 68, .4);
    transform: scale(1.08);
}
.nav-item.primary .lbl { letter-spacing: .5px; }

.nav-item.placeholder { color: #d1d5db; }
.nav-item.placeholder .icon { background: #f9fafb; opacity: .6; }
.nav-item.placeholder:active { transform: none; }
.badge-soon {
    position: absolute;
    top: 0; right: 12%;
    font-size: 0.55rem;
    background: #fef3c7;
    color: #92400e;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 700; letter-spacing: .3px;
    border: 1px solid #fde68a;
}

/* toast */
.toast {
    position: fixed;
    bottom: 110px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(17, 24, 39, .95);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.85rem; font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
    z-index: 200;
    opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* lock indicator (debug only) */
.nav-item[data-locked="true"]::after {
    content: ""; position: absolute;
    top: 2px; right: 22%;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #fbbf24;
    opacity: 0; transition: opacity .15s;
}
body.show-locks .nav-item[data-locked="true"]::after { opacity: 1; }

/* template 02 uses `.bnav` class but JS uses `#bottomNav` id, both already match */
.bottom-nav { display: none; }  /* in case JS targets generic class — overridden by .bnav */
