/**
 * disk.375 — RWD 档位样式（uni-rule/RWD.md）
 * 依赖 assets/rwd.js 在 <html> 上设置的 data-rwd-* 属性。
 */

html {
    --rwd-ui-scale: 1;
    --rwd-content-max: 500px;
}

/* §1.1 桌面：内容区最大宽度约 500px */
html[data-rwd-tier="desktop"] .logo-container,
html[data-rwd-recommended="desktop"] .embed-panel-window {
    max-width: var(--rwd-content-max);
}

/* §1.1 ≤600 平板窄视口 */
html[data-rwd-tier="tablet"] .switch-to-mobile,
html[data-rwd-tier="tablet"] .switch-to-pc .drawer-menu-item {
    font-size: 9px;
    padding: 6px 10px;
}

/* §1.1 ≤480 移动端 */
html[data-rwd-tier="mobile"] .embed-panel-window,
html[data-rwd-tier="mobile-bias"] .embed-panel-window {
    width: calc((100vw - 16px) * 0.45) !important;
}

/* §1.6 331–370 窄屏区间 */
html[data-rwd-tier="narrow-mid"] {
    font-size: 95%;
}

/* §1.5 ≤330 超小屏 — 控件缩放，避免整页 transform 破坏 fixed 布局 */
html[data-rwd-tier="xs"] .switch-to-mobile,
html[data-rwd-tier="xs"] .logo-image,
html[data-rwd-tier="xnarrow"] .switch-to-mobile {
    transform: scale(var(--rwd-ui-scale, 0.8));
    transform-origin: top right;
}

html[data-rwd-tier="xs"] .logo-image {
    transform-origin: top center;
}

/* §1.2 ≥380 较宽屏 — 横向对比区（若存在） */
html[data-rwd-tier="desktop"] .rider-compare,
html[data-rwd-tier="mobile-bias"] .rider-compare,
html[data-rwd-tier="tablet"] .rider-compare {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

@media (min-width: 381px) {
    .rider-compare {
        display: flex;
        flex-direction: row;
    }
}

/* §1.2 ≤768 偏移动端悬浮控件 */
@media (max-width: 768px) {
    .floating-save-btn,
    .save-toast,
    .embed-fab {
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }
}

/* §1.2 ≤359 极窄屏 */
html[data-rwd-tier="xnarrow"] .wallet-stats,
html[data-rwd-tier="xs"] .wallet-stats {
    grid-template-columns: 1fr !important;
}

/* §3 Safe area */
html[data-rwd-edition="mobile"] body {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

html.rwd-touch .hotbar-slot,
html.rwd-coarse .hotbar-slot {
    touch-action: manipulation;
}

html.rwd-touch {
    -webkit-overflow-scrolling: touch;
}
