/* mmkweb 前台样式 —— 数值全部来自 SPEC.md「实测设计令牌」 */

:root {
    /* index.php 会用 settings 里的主题色覆盖这四个变量 */
    --bg: #00682D;
    --panel: #03522C;
    --accent: #FEE001;
    --gold: #FFD700;

    --text: #FFFFFF;
    --text-dim: rgba(255, 255, 255, .65);
    --text-soft: rgba(255, 255, 255, .85);

    --container: 450px;
    --header-h: 60px;
    --nav-h: 60px;

    --font: Inter, -apple-system, "system-ui", "Helvetica Neue", Helvetica, "Segoe UI",
            Arial, Roboto, "PingFang SC", "Noto Sans Myanmar", Padauk, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: var(--container); margin: 0 auto; }

/* ---------- header（固定，h60，z-index 100） ---------- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    max-width: var(--container);
    margin: 0 auto;
    background: var(--panel);
    z-index: 100;
}
.site-header-inner {
    max-width: var(--container);
    height: 100%;
    margin: 0 auto;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.brand-logo img {
    height: 35px;
    width: auto;
    aspect-ratio: 1117 / 217;   /* 原 logo 比例 ≈ 5.15:1 */
    object-fit: contain;
}
.brand-logo-text { font-size: 16px; font-weight: 800; color: var(--gold); }

.header-badge { display: flex; align-items: center; gap: 6px; height: 32px; }
.badge-icon { width: 20px; height: 20px; object-fit: contain; }
.badge-text { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }

/* 语言切换器 */
.lang-switch { position: relative; }
.lang-btn { display: flex; align-items: center; height: 32px; padding: 0 2px; }
.lang-btn img { width: 24px; height: 16px; object-fit: cover; border-radius: 2px; }
.lang-code { font-size: 13px; font-weight: 700; }
.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: var(--panel);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
    z-index: 110;
}
.lang-menu[hidden] { display: none; }
.lang-menu a {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-soft);
}
.lang-menu img { width: 24px; height: 16px; object-fit: cover; border-radius: 2px; }
.lang-menu a[aria-current] { color: var(--accent); font-weight: 700; }

.header-spacer { height: var(--header-h); }

/* ---------- stats-bar ---------- */
.stats-bar {
    background: var(--panel);
    padding: 12px 10px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
/* 窄屏放不下 4 列：每项固定 45px 图标 + 8px gap，375px 下文字只剩 ~30px，
   会压住图标并把整页撑出横向滚动条（语言切换器被切掉）。改 2×2。 */
@media (max-width: 480px) {
    .stats-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
}
.stat-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.stat-icon { width: 45px; height: 45px; aspect-ratio: 1 / 1; object-fit: contain; flex: none; }
.stat-body { min-width: 0; overflow: hidden; }
.stat-value { font-size: 15px; font-weight: 800; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--text-dim); overflow-wrap: anywhere; }

/* ---------- promo 红包倒计时 ---------- */
.promo {
    min-height: 14rem;
    background-color: var(--panel);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}
.promo-top { display: flex; align-items: flex-start; gap: 12px; }
.promo-left { flex: 1; min-width: 0; }
.promo-title { font-size: .8rem; color: #E6C200; }
.promo-clock { font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 4px; }
.promo-units {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    font-size: .8rem;
    color: var(--text-soft);
    max-width: 11rem;
}
.promo-right { flex: 1; min-width: 0; text-align: right; }
.promo-code {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--accent);
    color: #03291A;
    font-size: .8rem; font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
}
.promo-code img { width: 1rem; height: 1rem; object-fit: contain; }
.promo-valid { margin: 6px 0 0; font-size: .8rem; line-height: 1rem; color: var(--text-soft); }
.promo-bottom { display: flex; align-items: center; }
.promo-next, .promo-cta { flex: 1; min-width: 0; font-size: .8rem; }
.promo-next { color: #E6C200; display: flex; flex-direction: column; gap: 2px; padding-right: 10px; }
.promo-next strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.promo-cta { border-left: 1px solid coral; padding-left: 10px; color: var(--text-soft); }

/* ---------- 通用 section ---------- */
.section { padding: 16px; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.section-title {
    display: flex; align-items: center; gap: 8px;
    margin: 0;
    font-size: 14px; font-weight: 800;
}
.see-more-btn {
    background: var(--panel);
    color: var(--accent);
    font-size: 12px; font-weight: 700;
    padding: 5px 6px;
    border-radius: 4px;
}

/* ---------- 合作伙伴 ---------- */
.partner-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.partner-card { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.partner-logo {
    width: 100%;
    max-width: 72.4px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    overflow: hidden;
    background: var(--panel);
}
.partner-name { font-size: 13px; font-weight: 600; color: var(--text-soft); text-align: center; }

/* ---------- banner 轮播 ---------- */
.banner-carousel { padding: 0 2px; overflow: hidden; }
.banner-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner-slide { flex: 0 0 100%; scroll-snap-align: center; }
.banner-slide img {
    width: 100%;
    aspect-ratio: 354 / 166.6;   /* ≈ 2.125:1 */
    object-fit: cover;
    border-radius: 8px;
    background: var(--panel);
}
.banner-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.banner-dot {
    /* 视觉 6px，热区撑到 44px */
    padding: 19px;
    background-clip: content-box;
    box-sizing: content-box;
    margin: -19px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-dim);
}
.banner-dot.is-active { background: var(--accent); width: 16px; border-radius: 3px; }

/* ---------- best casino ---------- */
.best-casino-title {
    margin: 0 0 20px;
    font-size: 20px; font-weight: 900;
    color: var(--gold);
    text-align: center;
}
.casino-list { display: flex; flex-direction: column; gap: 20px; }
.casino-row { display: flex; align-items: center; gap: 20px; min-height: 80px; }
.casino-logo {
    width: 72px; height: 72px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    flex: none;
    background: var(--panel);
}
.casino-body { flex: 1; min-width: 0; }
.casino-name { color: var(--accent); font-weight: 800; font-size: 14px; }
.casino-desc { margin: 4px 0 0; font-size: 12px; line-height: 1.4; color: var(--text-soft); }
/* 右侧悬浮社交列固定 48px + 16px 边距，站点行要让开这段，
   否则滚动时 CTA 会被压在按钮下面点不到 */
.casino-row { padding-right: 56px; }
.casino-cta {
    flex: none;
    background: var(--accent);
    color: #03291A;
    font-size: 12px; font-weight: 800;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ---------- FAQ ---------- */
.faq-title { margin: 0 0 20px; font-size: 24px; font-weight: 900; text-align: center; }
.faq-list { display: flex; flex-direction: column; gap: 6px; }
.faq-question {
    width: 100%;
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    background: var(--panel);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 13px; font-weight: 800;
    text-align: left;
}
.faq-arrow {
    flex: none;
    width: 8px; height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transform-origin: 60% 60%;
    transition: transform .2s ease;
}
.faq-question[aria-expanded="true"] .faq-arrow { transform: rotate(45deg) rotate(180deg); }
.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .22s ease;
}
.faq-item.is-open .faq-answer { grid-template-rows: 1fr; }
.faq-answer-inner {
    overflow: hidden;
    /* 仅 grid 行高折叠不会把内容移出无障碍树，读屏会念出全部答案 */
    visibility: hidden;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-soft);
}
.faq-item.is-open .faq-answer-inner { padding: 10px; visibility: visible; }

/* ---------- services 富文本（限制作用域） ---------- */
.services-section { padding: 16px 32px; }
.services-section h1,
.services-section h2,
.services-section h3 { text-align: center; color: var(--gold); margin: 16px 0 12px; }
.services-section h2 { font-size: 18px; font-weight: 900; }
.services-section p { margin: 0 0 12px; font-size: 13px; line-height: 1.75; color: var(--text-soft); }
.services-section img { width: 100%; height: auto; border-radius: 8px; }
.services-section ul, .services-section ol { padding-left: 20px; color: var(--text-soft); }
.services-section table { width: 100%; border-collapse: collapse; }
.services-section td, .services-section th { padding: 8px; }

/* ---------- footer ---------- */
.site-footer { padding: 24px 16px 80px; }
.footer-text { font-size: 14px; line-height: 1.75; text-align: justify; color: var(--text-soft); }
.footer-text .brand { color: var(--gold); font-weight: 700; }
.footer-socials { display: flex; justify-content: center; gap: 8px; margin: 20px 0; }
.footer-socials img { width: 32px; height: 32px; aspect-ratio: 1 / 1; object-fit: contain; }
.footer-social-text { font-size: 12px; color: var(--text-soft); }
.footer-logo {
    width: 272px;
    max-width: 100%;
    aspect-ratio: 272 / 52.8;
    object-fit: contain;
    margin: 0 auto 16px;
}
.copyright { font-size: 13px; font-weight: 800; text-align: center; color: var(--text-soft); }

/* ---------- bottom nav（固定，h60，z-index 200） ---------- */
.nav-spacer { height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    max-width: var(--container);
    margin: 0 auto;
    border-radius: 12.8px 12.8px 0 0;
    background: linear-gradient(#00682D, #03522C 60%);
    box-shadow: 0 -1.28px 2.56px rgba(0, 0, 0, .25);
    z-index: 200;
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    flex: 1;
    font-size: 12px;
    color: var(--text-soft);
}
.nav-item img { height: 20px; width: auto; object-fit: contain; }
.nav-item.is-active { color: var(--accent); }

/* ---------- 浮动社交（固定，right 16 / bottom 76，z-index 300） ---------- */
.floating-socials {
    position: fixed;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    right: max(16px, calc(50% - var(--container) / 2 + 16px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 300;
}
/* 可折叠：多个按钮常驻会压住页面右侧内容，默认只留一个开关 */
.floating-list { display: flex; flex-direction: column; gap: 12px; }
.floating-socials.is-collapsible .floating-list {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: max-height .25s ease, opacity .2s ease, transform .25s ease;
}
.floating-socials.is-collapsible.is-open .floating-list {
    max-height: 60vh;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}
.floating-toggle {
    width: 48px; height: 48px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: var(--panel);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: transform .25s ease;
}
.floating-toggle-bar {
    display: block;
    width: 18px; height: 2px;
    border-radius: 2px;
    background: var(--accent);
    transition: transform .25s ease, opacity .2s ease;
}
/* 展开后变成一个叉，表示"再点收起" */
.is-open .floating-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.is-open .floating-toggle-bar:nth-child(2) { opacity: 0; }
.is-open .floating-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (prefers-reduced-motion: reduce) {
    .floating-socials.is-collapsible .floating-list,
    .floating-toggle, .floating-toggle-bar { transition: none; }
}

.floating-item {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
    font-weight: 800;
}
.floating-item img { width: 26px; height: 26px; object-fit: contain; }

@media (prefers-reduced-motion: reduce) {
    .faq-answer, .faq-arrow { transition: none; }
    .banner-track { scroll-behavior: auto; }
}

/* ---------- 多页：页面大标题（首页不用） ---------- */
.page-title {
    margin: 20px 16px 0;
    font-size: 20px; font-weight: 900;
    color: var(--gold);
    text-align: center;
}

/* ---------- 优惠活动卡片 ---------- */
.promo-cards { display: flex; flex-direction: column; gap: 16px; }
.promo-card {
    background: var(--panel);
    border-radius: 12px;
    overflow: hidden;
}
.promo-card-img {
    width: 100%;
    aspect-ratio: 354 / 166.6;   /* 与轮播图同比例 */
    object-fit: cover;
}
.promo-card-body { padding: 12px; }
.promo-card-title { margin: 0; font-size: 14px; font-weight: 800; color: var(--accent); }
.promo-card-desc { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-soft); }
.promo-card-valid { margin: 6px 0 0; font-size: 12px; color: var(--text-dim); }
.promo-card-cta {
    display: inline-block;
    margin-top: 12px;
    background: var(--accent);
    color: #03291A;
    font-size: 12px; font-weight: 800;
    padding: 6px 12px;
    border-radius: 4px;
}

/* ---------- 404 ---------- */
.not-found { text-align: center; padding-top: 48px; }
.not-found .page-title { font-size: 48px; margin: 0; }
.not-found-text { margin: 12px 0 24px; font-size: 14px; color: var(--text-soft); }
.not-found-home {
    display: inline-block;
    background: var(--accent);
    color: #03291A;
    font-size: 13px; font-weight: 800;
    padding: 8px 20px;
    border-radius: 4px;
}
