/* ==========================================================================
   金砖国家峰会 2026 线上申报系统 — 公共样式
   设计基准：Figma 393px 宽移动端画板
   换算规则：1rem = 100 个设计稿 px（例：设计 14px -> .14rem）
   ========================================================================== */

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

html {
    /* 等比缩放：任意手机宽度下与设计稿比例完全一致 */
    font-size: calc(100vw / 3.93);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* 超过常见手机最大宽度后锁定尺寸并居中，避免在平板/桌面上被无限放大 */
@media (min-width: 430px) {
    html {
        font-size: 109.4148px;
    }
}

body {
    margin: 0;
    overflow-x: hidden;
    /* 必须给 body 一个正常字号：html 的 font-size 是 rem 换算基准（约 100px），
       没有这行的话，任何未写死字号的元素都会继承 100px，行盒基线被撑到 100px 以上。 */
    font-size: 0.14rem;
    font-family: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC",
        "Noto Sans CJK SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont,
        "Helvetica Neue", Arial, sans-serif;
    color: #08265c;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* 设计稿中的数字、符号使用 Liberation Sans，Arial 与其字形度量一致 */
.u-num {
    font-family: Arial, Helvetica, "Liberation Sans", sans-serif;
}

img {
    border: 0;
}

button {
    margin: 0;
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

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

p,
h1,
h2,
h3,
h4 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

/* hidden 属性必须压过组件自身的 display，否则「隐藏」的弹窗会铺满全屏拦截点击 */
[hidden] {
    display: none !important;
}

/* Figma 图标由「定位层 + 图片层」两层构成：外层用 inset 定尺寸定位，内层图片铺满 */
.ic {
    position: absolute;
}

.ic > img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
}

.page {
    position: relative;
    width: 3.93rem;
    margin: 0 auto;
    overflow: hidden;
}

/* 刘海屏底部小白条留白 */
.page::after {
    display: block;
    height: env(safe-area-inset-bottom, 0);
    content: "";
}

/* --------------------------------------------------------------------------
   页脚（首页与填写页共用，设计稿 1:187+1:188 / 1:311+1:312）
   -------------------------------------------------------------------------- */

.site-footer {
    position: relative;
    width: 100%;
    height: 1.2rem;
}

.site-footer__bg {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.site-footer__text {
    position: absolute;
    top: 0.38rem;
    left: 50%;
    width: 3.2rem;
    font-size: 0.11rem;
    line-height: 0.2rem;
    color: #8a939f;
    text-align: center;
    transform: translate(-50%, -50%);
}

.site-footer__org {
    color: #2f4c7e;
}

.site-footer__text a {
    color: inherit;
    text-decoration: underline;
    text-underline-position: from-font;
}

/* --------------------------------------------------------------------------
   轻提示 Toast
   -------------------------------------------------------------------------- */

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 900;
    max-width: 2.6rem;
    padding: 0.12rem 0.18rem;
    font-size: 0.14rem;
    line-height: 0.2rem;
    color: #fff;
    text-align: center;
    pointer-events: none;
    background: rgba(6, 27, 62, 0.88);
    border-radius: 0.1rem;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* --------------------------------------------------------------------------
   邀请奖励入口海报（Figma「海报-1」366×154）
   首页、签到页两态、进度查询页两态共用，各页只覆盖上下外边距
   -------------------------------------------------------------------------- */

.rw-entry {
    position: relative;
    display: block;
    width: 3.66rem;
    height: 1.54rem;
    /* 签到页与进度页的卡间距都是 5px，首页是 3px（见 index.css 的覆盖） */
    margin: 0.05rem auto 0;
    overflow: hidden;
    border-radius: 0.08rem;
}

.rw-entry img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rw-entry:active {
    transform: scale(0.99);
}
