/* 公共基础样式：移动端优先，1rem = 100rpx（设计稿 750rpx 宽） */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    /* 桌面上最宽按 430px 排版并居中，移动端按视口宽度等比缩放 */
    font-size: calc(min(100vw, 430px) / 7.5);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: #DCE9F7;
    color: #16283C;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    display: flex;
    justify-content: center;
}

.app {
    position: relative;
    width: 7.5rem;
    min-height: 100vh;
    background: linear-gradient(180deg, #F8FBFF 0%, #EFF6FF 46%, #E7F2FF 100%);
    overflow-x: hidden;
}

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

button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
}

img {
    border: 0;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* ---------- 顶部栏（答题页 / 拼图页共用） ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.32rem 0.4rem 0;
}

.brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

.brand-icon {
    display: flex;
    flex-shrink: 0;
    width: 0.64rem;
    height: 0.64rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.2rem;
    background: linear-gradient(135deg, #4D97FF, #2E7BF6);
    box-shadow: 0 0.08rem 0.2rem rgba(46, 123, 246, 0.28);
    color: #FFFFFF;
    font-size: 0.3rem;
    font-weight: 700;
}

.brand-icon-green {
    background: linear-gradient(135deg, #5BCF9F, #35A87C);
    box-shadow: 0 0.08rem 0.2rem rgba(53, 168, 124, 0.28);
}

.brand-name {
    margin-left: 0.18rem;
    overflow: hidden;
    color: #16283C;
    font-size: 0.3rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score-chip {
    flex-shrink: 0;
    margin-left: 0.2rem;
    padding: 0.12rem 0.26rem;
    border: 1px solid #D6E7FA;
    border-radius: 999px;
    background: #FFFFFF;
    box-shadow: 0 0.06rem 0.16rem rgba(46, 123, 246, 0.08);
    color: #2E7BF6;
    font-size: 0.26rem;
    font-weight: 600;
}

.score-chip.chip-warn {
    border-color: #FFD6CF;
    color: #E86A5C;
}

/* ---------- 通用按钮 ---------- */
.btn-primary {
    display: flex;
    width: 100%;
    height: 0.92rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.28rem;
    background: linear-gradient(135deg, #4D97FF, #2E7BF6);
    box-shadow: 0 0.12rem 0.28rem rgba(46, 123, 246, 0.28);
    color: #FFFFFF;
    font-size: 0.32rem;
    font-weight: 600;
    line-height: 1;
    transition: opacity 0.12s ease;
}

.btn-primary:active {
    opacity: 0.86;
}

.btn-ghost {
    display: flex;
    width: 100%;
    height: 0.88rem;
    align-items: center;
    justify-content: center;
    border: 1px solid #D6E7FA;
    border-radius: 0.28rem;
    background: #FFFFFF;
    color: #5B7089;
    font-size: 0.3rem;
    font-weight: 600;
    line-height: 1;
    transition: opacity 0.12s ease;
}

.btn-ghost:active {
    opacity: 0.7;
}

/* ---------- 弹窗 ---------- */
.mask {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.48rem;
    background: rgba(22, 40, 60, 0.42);
}

.mask.show {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 6.3rem;
    padding: 0.4rem 0.4rem 0.36rem;
    border-radius: 0.44rem;
    background: #FFFFFF;
    box-shadow: 0 0.24rem 0.8rem rgba(22, 40, 60, 0.25);
    animation: modal-pop 0.28s ease-out;
}

@keyframes modal-pop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-art {
    width: 100%;
    height: 3rem;
    border-radius: 0.28rem;
    background: #EAF3FF;
    object-fit: cover;
    display: block;
}

.modal-title {
    display: block;
    margin-top: 0.28rem;
    text-align: center;
    color: #2E7BF6;
    font-size: 0.4rem;
    font-weight: 700;
}

.modal-desc {
    display: block;
    margin-top: 0.18rem;
    color: #5B7089;
    font-size: 0.27rem;
    line-height: 1.8;
}

.modal-desc-center {
    text-align: center;
}

.modal .btn-primary {
    margin-top: 0.34rem;
}

.modal .btn-ghost {
    margin-top: 0.2rem;
}

/* ---------- 轻提示 ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 2.2rem;
    z-index: 200;
    max-width: 6.4rem;
    padding: 0.18rem 0.34rem;
    border-radius: 0.3rem;
    background: rgba(22, 40, 60, 0.88);
    color: #FFFFFF;
    font-size: 0.26rem;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    transform: translateX(-50%);
    transition: opacity 0.2s ease;
}

.toast.show {
    opacity: 1;
}

/* ---------- 页脚说明 ---------- */
.site-foot {
    padding: 0.4rem 0.48rem 0.6rem;
    color: #9BB2CC;
    font-size: 0.22rem;
    line-height: 1.7;
    text-align: center;
}
