/* ========== 字体 @font-face ========== */
@font-face {
  font-family: 'XiaolaiMono';
  src: url('../../XiaolaiMono-Regular.subset.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* 横屏首页大框尺寸（仅横屏生效，竖屏宽度保持不变） */
:root {
  --home-landscape-width: 1120px;
  --home-landscape-height: 560px;
}

/* ========== 基础重置 ========== */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  /* 用 clip 而非 hidden：hidden 会把另一轴计算成 auto，使 html/body
     变成滚动容器，滚动发生在 body 内部 → mdui 顶栏/底栏监听的 window
     scroll 事件收不到，shrink/elevate/hide 全部失效。clip 不创建滚动容器。 */
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: rgb(var(--mdui-color-surface));   /* 与设置页背景统一 */
  color: rgb(var(--mdui-color-on-surface));
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;          /* 供非活动页 absolute 定位参照 */
  min-height: 100vh;
  padding: 124px 16px 80px;   /* 为 medium 变体顶栏(112px)预留空间 */
  /* 不设 overflow-y：让内容自然撑开 document，由 window 统一滚动 */
}
body.font-page-open { overflow: hidden; }
body.focus-mode { overflow: hidden; }

/* ========== 主题配色 ==========
   配色由 mdui.setColorScheme(种子色) 动态生成，会写入 <html> 的
   mdui-custom-color-scheme-* 类，自动产出浅色/深色两套变量。
   这里不再硬编码任何 -light/-dark 颜色，避免覆盖动态生成的配色。 */

/* ========== 顶栏 ========== */
.app-top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
}
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 6px;
}
/* 顶栏左上角 logo：1:1 自适应
   相对下移 5px，使中心与右侧“切换深浅色”按钮中心平齐 */
.top-bar-logo {
  width: 30px;
  height: 30px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin-left: 2px;
  flex: 0 0 auto;
  position: relative;
  top: 5px;
}

/* ========== 主页面布局 ========== */
.app {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  /* 首页参与文档流，使用 window 滚动条 */
}
body.view-settings .app {
  /* 设置态：首页脱离文档流（不撑高度），淡出 */
  position: absolute;
  top: 124px; left: 0; right: 0;
  pointer-events: none;
}
.page { display: none; }
.page.active { display: block; }

/* ========== 卡片 ========== */
.card {
  background: rgb(var(--mdui-color-surface-container));
  border-radius: 24px;
  padding: 26px 24px 22px;
  box-shadow: 0 4px 20px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.04);
  margin-bottom: 18px;
  position: relative;
}
.title {
  font-size: 14px;
  letter-spacing: 3px;
  text-align: center;
  color: rgb(var(--mdui-color-on-surface-variant));
  margin-bottom: 6px;
  white-space: nowrap;
}

