/* ==========================================================================
   首页温馨提示弹窗（替掉原来的会议预约弹窗）
   配色取自 rewards.php「新页面-1」的红金米色体系
   沿用 base.css 的换算：1rem = 100 个设计稿 px
   ========================================================================== */

.rwmodal {
    position: fixed;
    inset: 0;
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(28, 6, 0, 0.58);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.rwmodal[hidden] {
    display: none;
}

.rwmodal.is-open {
    opacity: 1;
}

.rwmodal__box {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 3.2rem;
    max-height: 86vh;
    padding-bottom: 0.16rem;
    background: #fffefc;
    border: 0.01rem solid #f5c06b;
    border-radius: 0.16rem;
    box-shadow: 0 0.08rem 0.3rem rgba(90, 10, 0, 0.3);
    transform: translateY(0.16rem) scale(0.96);
    transition: transform 0.28s ease;
}

.rwmodal.is-open .rwmodal__box {
    transform: none;
}

.rwmodal__head {
    flex-shrink: 0;
    height: 0.72rem;
    background: linear-gradient(180deg, #ff382e 0%, #cf001b 100%);
    border-radius: 0.15rem 0.15rem 0 0;
}

/* 金砖徽标压在红带下沿，一半在红底上一半在米底上 */
.rwmodal__logo {
    position: absolute;
    top: 0.36rem;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 0.64rem;
    height: 0.64rem;
    margin-left: -0.32rem;
    overflow: hidden;
    background: #fff6e9;
    border: 0.02rem solid #f5c06b;
    border-radius: 50%;
}

.rwmodal__logo img {
    display: block;
    width: 0.54rem;
    height: 0.54rem;
}

.rwmodal__close {
    position: absolute;
    top: 0.06rem;
    right: 0.08rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 0.28rem;
    height: 0.28rem;
    font-size: 0.22rem;
    line-height: 1;
    color: #ffe6c0;
}

.rwmodal__title {
    flex-shrink: 0;
    margin: 0.4rem 0 0;
    font-size: 0.18rem;
    font-weight: 700;
    line-height: 0.26rem;
    color: #d2071c;
    text-align: center;
}

/* 正文偏长，视窗矮时让正文自己滚，按钮始终可见 */
.rwmodal__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.1rem 0.12rem;
    margin: 0.1rem 0.14rem 0;
    overflow-y: auto;
    background: #fff2e4;
    border-radius: 0.09rem;
    -webkit-overflow-scrolling: touch;
}

.rwmodal__body p {
    margin: 0;
    font-size: 0.13rem;
    line-height: 0.21rem;
    color: #263445;
    word-break: break-word;
}

.rwmodal__body p + p {
    margin-top: 0.08rem;
}

.rwmodal__actions {
    display: flex;
    flex-shrink: 0;
    gap: 0.11rem;
    justify-content: center;
    margin: 0.12rem 0.14rem 0;
}

.rwmodal__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.38rem;
    height: 0.4rem;
    font-size: 0.15rem;
    font-weight: 700;
    border-radius: 0.2rem;
}

.rwmodal__btn--ghost {
    color: #c0391a;
    background: #fff2e4;
    border: 0.01rem solid #f3bb66;
}

.rwmodal__btn--primary {
    color: #fffbe6;
    background: linear-gradient(180deg, #ff382e 0%, #cf001b 100%);
    border: 0.01rem solid #f5c06b;
}

.rwmodal__btn:active {
    transform: scale(0.98);
}

/* 落款（APP 导流弹窗的「金砖专项工作办公室」）：样稿里顶在右下 */
.rwmodal__sign {
    text-align: right;
}

/* 按钮里有 <a>，默认带下划线与蓝色，统一掉 */
a.rwmodal__btn {
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   强制弹窗（APP 导流）：服务端直出打开态，不等 JS
   -------------------------------------------------------------------------- */

/* 直出就位，省掉入场动画——否则首屏会先看到一次缩放跳动 */
.rwmodal--force,
.rwmodal--force .rwmodal__box {
    transition: none;
}

.rwmodal--force {
    /* 正文长时整窗可滚，保证矮屏上两个按钮够得着 */
    padding: 0.12rem 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.rwmodal--force .rwmodal__box {
    margin: auto;
}

/* 锁住背后页面的滚动。common.js 也会设 body.overflow，
   这里再用纯 CSS 兜一道：JS 没跑起来时照样锁得住 */
html:has(.rwmodal--force),
html:has(.rwmodal--force) body {
    overflow: hidden;
}
