/* ============================================================
   MRP 应用商店 — Material Design 3
   兼顾手机端与 PC 端的响应式设计
   ============================================================ */

:root {
  /* Material 3 颜色令牌 (浅色) */
  --md-primary: #4f5bd5;
  --md-on-primary: #ffffff;
  --md-primary-container: #dee1ff;
  --md-on-primary-container: #00105c;
  --md-secondary-container: #e1e0f9;
  --md-on-secondary-container: #1a1b2c;

  --md-surface: #fffbff;
  --md-surface-1: #f7f5fd;   /* 卡片表面 */
  --md-surface-2: #efedf6;   /* 悬停表面 */
  --md-surface-variant: #e3e1ec;
  --md-bg: #f5f3fb;           /* 页面背景 */

  --md-on-surface: #1b1b21;
  --md-on-surface-variant: #46464f;
  --md-outline: #777680;
  --md-outline-variant: #c7c4d0;

  --md-success: #2e7d32;
  --md-error: #b3261e;

  /* Material 3 排版 (Roboto) */
  --md-font: "Roboto", "Segoe UI", system-ui, -apple-system, "Helvetica Neue",
    "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;

  /* Material 海拔阴影 */
  --elev-1: 0 1px 2px rgba(0,0,0,.12), 0 1px 3px 1px rgba(0,0,0,.08);
  --elev-2: 0 2px 6px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.12);
  --elev-3: 0 4px 8px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.12);
  --elev-4: 0 6px 12px rgba(0,0,0,.16), 0 2px 4px rgba(0,0,0,.12);
  --elev-5: 0 8px 16px rgba(0,0,0,.18), 0 3px 6px rgba(0,0,0,.12);

  --radius-card: 16px;
  --radius-dialog: 28px;
  --radius-chip: 8px;
  --radius-btn: 20px;

  --app-bar-h: 124px;
}

/* 深色模式 — 跟随系统 */
@media (prefers-color-scheme: dark) {
  :root {
    --md-primary: #bcc4ff;
    --md-on-primary: #132cb4;
    --md-primary-container: #2b399b;
    --md-on-primary-container: #dde1ff;
    --md-secondary-container: #3b3c53;
    --md-on-secondary-container: #e1e0f9;

    --md-surface: #16161d;
    --md-surface-1: #1f1f27;
    --md-surface-2: #2a2a33;
    --md-surface-variant: #2f2f38;
    --md-bg: #111117;

    --md-on-surface: #e6e1e5;
    --md-on-surface-variant: #c8c5d0;
    --md-outline: #928f9a;
    --md-outline-variant: #474750;

    --md-success: #7dd87f;
    --md-error: #ffb4a9;

    --elev-1: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px 1px rgba(0,0,0,.3);
    --elev-2: 0 2px 6px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.4);
    --elev-3: 0 4px 8px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.4);
    --elev-4: 0 6px 12px rgba(0,0,0,.5), 0 2px 4px rgba(0,0,0,.4);
    --elev-5: 0 8px 16px rgba(0,0,0,.55), 0 3px 6px rgba(0,0,0,.45);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--md-bg);
  color: var(--md-on-surface);
  font-family: var(--md-font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------------- 顶部应用栏 ---------------- */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--md-surface);
  padding: 10px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  transition: box-shadow .2s ease;
}
.app-bar.scrolled { box-shadow: var(--elev-2); }

.app-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 12px;
}
.app-bar-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}
.app-bar-title {
  flex: 1;
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: .15px;
  color: var(--md-on-surface);
}

/* Material 图标按钮 */
.icon-btn {
  position: relative;
  overflow: hidden;
  width: 40px; height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--md-on-surface-variant);
  cursor: pointer;
  transition: background .15s ease;
}
.icon-btn:hover { background: rgba(0,0,0,.06); }
.icon-btn:active { background: rgba(0,0,0,.12); }
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }

/* 顶部栏「更多」菜单 (Material Menu) */
.menu-anchor { position: relative; }

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 248px;
  max-width: calc(100vw - 24px);
  background: var(--md-surface);
  border-radius: 14px;
  box-shadow: var(--elev-3);
  padding: 8px 0;
  z-index: 30;
  overflow: hidden;
  animation: menu-in .15s ease;
}
.menu[hidden] { display: none; }
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.menu-item {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 400;
  font-family: inherit;
  color: var(--md-on-surface);
  text-decoration: none;
  text-align: left;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.menu-item:hover { background: var(--md-surface-2); }
.menu-item:active { background: var(--md-surface-variant); }
.menu-item svg {
  width: 20px; height: 20px;
  fill: var(--md-on-surface-variant);
  flex-shrink: 0;
}

/* Material 搜索框 (filled) */
.search-field {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--md-surface-variant);
  border-radius: 28px;
  padding: 0 8px 0 16px;
  height: 48px;
  transition: background .15s ease;
}
.search-field:focus-within {
  background: var(--md-surface-2);
  box-shadow: inset 0 0 0 2px var(--md-primary);
}
.search-leading {
  width: 22px; height: 22px;
  fill: var(--md-on-surface-variant);
  flex-shrink: 0;
}
.search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  color: var(--md-on-surface);
  padding: 0 8px;
}
.search-field input::placeholder { color: var(--md-on-surface-variant); opacity: .8; }
/* 去掉浏览器自带的 search 清除按钮，使用自定义 */
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear {
  border: none;
  background: transparent;
  color: var(--md-on-surface-variant);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.search-clear[hidden] { display: none !important; }
.search-clear svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------------- 分辨率筛选 Chips ---------------- */
.chip-bar {
  position: sticky;
  top: var(--app-bar-h);
  z-index: 15;
  display: flex;
  gap: 8px;
  padding: 10px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  background: var(--md-bg);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chip-bar::-webkit-scrollbar { display: none; }

.chip {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 16px;
  border-radius: var(--radius-chip);
  border: 1px solid var(--md-outline-variant);
  background: var(--md-surface);
  color: var(--md-on-surface-variant);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { background: var(--md-surface-2); }
.chip.active {
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
  border-color: var(--md-secondary-container);
}
.chip .chip-count {
  font-size: 12px;
  opacity: .7;
}

/* ---------------- 内容容器 ---------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px max(16px, env(safe-area-inset-left)) 32px max(16px, env(safe-area-inset-right));
}

.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

/* ---------------- Material 卡片 ---------------- */
.card {
  position: relative;
  overflow: hidden;
  background: var(--md-surface-1);
  border-radius: var(--radius-card);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--elev-1);
  transition: box-shadow .2s ease, transform .2s ease, background .2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.card:hover {
  box-shadow: var(--elev-3);
  transform: translateY(-3px);
  background: var(--md-surface-2);
}
.card:focus-visible {
  outline: 2px solid var(--md-primary);
  outline-offset: 2px;
}

.card-icon {
  width: 64px; height: 64px;
  object-fit: contain;
  border-radius: 14px;
  margin-bottom: 12px;
  background: var(--md-surface-variant);
}
.card-icon-placeholder {
  width: 64px; height: 64px;
  border-radius: 14px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--md-primary), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
}
.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--md-on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 作者与分辨率同行 */
.card-meta {
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.card-vendor {
  font-size: 12px;
  font-weight: 400;
  color: var(--md-on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* 右上角角标 (顶 / 新)，单字圆形 */
.card-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  border-radius: 50%;
  color: #fff;
  box-shadow: var(--elev-1);
}
.badge-pin { background: #e8590c; }  /* 顶：橙红 */
.badge-new { background: #2e7d32; }  /* 新：绿 */

/* 卡片上的分辨率标签 */
.card-scr {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .3px;
  color: var(--md-on-surface-variant);
  background: var(--md-surface-variant);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--md-on-surface-variant);
  padding: 48px 16px;
  font-size: 15px;
}

/* ---------------- Material 涟漪 ---------------- */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: .2;
  transform: scale(0);
  pointer-events: none;
  animation: ripple-anim .6s ease-out forwards;
}
@keyframes ripple-anim {
  to { transform: scale(1); opacity: 0; }
}

/* ---------------- 详情弹窗 (Dialog / Bottom Sheet) ---------------- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* 关键修复：移动端浏览器地址栏会动态收起，inset:0 的 bottom:0 锚定的是
     「布局视口」(包含地址栏背后的区域)，导致底部抽屉被地址栏遮挡；
     改用 100dvh 锚定到「可见视口」，始终排除地址栏，避免打开后上跳。 */
  height: 100vh;      /* 回退 */
  height: 100dvh;     /* 动态视口高度：自动排除移动端地址栏 */
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  animation: fade-in .2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* 内嵌网页展示 (Material 全屏对话框) */
.webview {
  position: fixed;
  top: 0; left: 0; right: 0;
  /* 同弹窗：用 100dvh 锚定可见视口，避免移动端地址栏导致的上跳 */
  height: 100vh;
  height: 100dvh;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.webview[hidden] { display: none; }

.webview-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  animation: fade-in .2s ease;
}

.webview-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1000px, 100%);
  height: 100%;
  max-height: 92vh;
  max-height: 92dvh;
  background: var(--md-surface);
  border-radius: var(--radius-dialog);
  box-shadow: var(--elev-5);
  overflow: hidden;
  animation: dialog-in .25s cubic-bezier(.2,.7,.3,1);
}

.webview-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--md-out-line-variant);
  background: var(--md-surface);
}
.webview-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--md-on-surface);
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.webview-frame-wrap {
  position: relative;
  flex: 1;
  min-height: 0;            /* 允许 flex 子项收缩，使 iframe 可滚动 */
  background: var(--md-surface-variant);
}
.webview-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--md-surface);
}
.webview-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--md-surface);
  color: var(--md-on-surface-variant);
  font-size: 14px;
}
.webview-loading.hidden { display: none; }
.spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--md-surface-variant);
  border-top-color: var(--md-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 菜单分隔线 */
.menu-divider {
  height: 1px;
  margin: 6px 12px;
  background: var(--md-out-line-variant);
}

.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 90vh;
  max-height: 90dvh;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--md-surface);
  border-radius: var(--radius-dialog);
  box-shadow: var(--elev-5);
  animation: dialog-in .25s cubic-bezier(.2,.7,.3,1);
}
@keyframes dialog-in {
  from { opacity: 0; transform: scale(.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.sheet-handle { display: none; }

.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  color: var(--md-on-surface-variant);
  z-index: 2;
}
.modal-close:hover { background: rgba(0,0,0,.06); }

.modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 24px 16px;
  border-bottom: 1px solid var(--md-outline-variant);
}
.modal-icon {
  width: 72px; height: 72px;
  object-fit: contain;
  border-radius: 18px;
  background: var(--md-surface-variant);
  flex-shrink: 0;
}
.modal-title {
  margin: 0;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: .1px;
  color: var(--md-on-surface);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.modal-subtitle {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--md-on-surface-variant);
}

.modal-body { padding: 16px 24px 24px; }

.detail-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  margin: 0 0 20px;
}
.detail-list div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.detail-list dt {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--md-on-surface-variant);
}
.detail-list dd {
  margin: 0;
  font-size: 15px;
  color: var(--md-on-surface);
  word-break: break-word;
}
.detail-list .full-row { grid-column: 1 / -1; }
.detail-list .full-row dd { line-height: 1.6; }

/* ---------------- Material 按钮 ---------------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .5px;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .15s ease, background .15s ease, opacity .15s ease;
  -webkit-tap-highlight-color: transparent;
  /* 禁止按钮内文字被选中/长按出现矩形高亮（包括按钮整体与子元素） */
  user-select: none;
  -webkit-user-select: none;
}
/* 让所有子元素对指针透明，统一由按钮自身接收点击/长按，
   避免点击文字时出现选区矩形或子元素拦截事件。涟漪/进度条也无需成为命中目标。 */
.btn > * { pointer-events: none; }
.btn svg { width: 18px; height: 18px; fill: currentColor; position: relative; z-index: 1; }
/* 下载按钮内的文字标签：与 SVG 一样浮在进度条之上，但不应用「文字按钮」变体的 padding/flex，
   避免图标被推到一端、文字跑到另一端，并消除选区矩形背景。 */
.btn-label {
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

/* 按钮内下载进度条 */
.btn-progress {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(79,91,213,.10);
  overflow: hidden;
}
.btn-progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--md-primary);
  opacity: .32;
  transition: width .2s ease;
}
.btn-progress-fill.indeterminate {
  width: 40% !important;
  animation: indeterminate 1.1s ease-in-out infinite;
}
@keyframes indeterminate {
  0%   { left: -40%; }
  100% { left: 100%; }
}
.btn.downloading { cursor: progress; }
.btn:disabled { opacity: .85; cursor: progress; }

.btn-filled {
  flex: 1;
  min-width: 130px;
  background: var(--md-primary);
  color: var(--md-on-primary);
  box-shadow: var(--elev-1);
}
.btn-filled:hover { box-shadow: var(--elev-2); background: var(--md-primary); filter: brightness(1.05); }
.btn-filled:active { box-shadow: var(--elev-1); }

.btn-outlined {
  flex: 1;
  min-width: 130px;
  background: transparent;
  color: var(--md-primary);
  border: 1px solid var(--md-outline);
}
.btn-outlined:hover { background: rgba(79,91,213,.08); }
.btn-outlined:active { background: rgba(79,91,213,.14); }

.btn-text {
  flex: 1;
  min-width: 130px;
  background: transparent;
  color: var(--md-primary);
  padding: 0 12px;
}
.btn-text:hover { background: rgba(79,91,213,.08); }

.btn-small {
  flex: initial;
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

/* ---------------- 本地打开兜底 ---------------- */
.fallback {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(245, 166, 35, .12);
  border: 1px solid rgba(245, 166, 35, .35);
}
.fallback-title {
  margin: 0 0 12px;
  font-size: 14px;
  color: #9a6700;
}
@media (prefers-color-scheme: dark) {
  .fallback { background: rgba(245, 166, 35, .14); }
  .fallback-title { color: #f0c674; }
}
.fallback-links { display: flex; flex-wrap: wrap; gap: 10px; }

.footer {
  text-align: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  color: var(--md-on-surface-variant);
  font-size: 13px;
}

/* ---------------- Material Snackbar ---------------- */
.snackbar {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 24px);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, calc(100% - 32px));
  padding: 14px 20px;
  border-radius: 8px;
  background: #323232;
  color: #fff;
  font-size: 14px;
  box-shadow: var(--elev-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.snackbar.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.snackbar-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
  display: none;
}
.snackbar.loading .snackbar-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   响应式 — 手机端优先的调整
   ============================================================ */

/* 平板 / 小桌面：更多列 */
@media (min-width: 600px) {
  .list { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
}

/* 手机端：弹窗变底部抽屉 (Material Bottom Sheet) */
@media (max-width: 600px) {
  :root { --app-bar-h: 116px; }

  .app-bar-title { font-size: 20px; }

  .modal {
    align-items: flex-end;
    padding: 0;
  }
  .modal-card {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 28px 28px 0 0;
    animation: sheet-in .3s cubic-bezier(.2,.7,.3,1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  @keyframes sheet-in {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .sheet-handle {
    display: block;
    width: 32px;
    height: 4px;
    border-radius: 2px;
    background: var(--md-outline-variant);
    margin: 10px auto 0;
  }
  .modal-header { padding: 8px 20px 14px; }
  .modal-icon { width: 60px; height: 60px; }
  .modal-title { font-size: 20px; }
  .modal-body { padding: 14px 20px 20px; }
  .detail-list { grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  .actions { flex-direction: column; }
  .btn { width: 100%; flex: none; }

  .snackbar {
    left: 16px; right: 16px;
    transform: translateY(24px);
    max-width: none;
  }
  .snackbar.show { transform: translateY(0); }

  /* 内嵌网页在手机端全屏展示 */
  .webview { padding: 0; }
  .webview-card {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }
}

/* 大桌面：限制卡片宽度、优化留白 */
@media (min-width: 1024px) {
  .list { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .container { padding-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
