/* =========================================================
   底部应用栏：mdui-bottom-app-bar + 右下角悬浮 FAB
   参考 mdui 官方"固定浮动操作按钮"示例（fab-detach）
   ========================================================= */
mdui-bottom-app-bar.quick-bar {
  --z-index: 999993;
}
/* 焦点模式隐藏底部应用栏；detach 的 FAB 脱离在 body 上，需单独隐藏 */
body.quick-nav-hidden mdui-bottom-app-bar.quick-bar { display: none !important; }
body.quick-nav-hidden #playFab { display: none !important; }
/* 悬浮 FAB 略微离开边角，避免贴边 */
mdui-fab#playFab { margin: 0 4px 4px 0; }
/* 播放按钮使用 mdui 默认主题色（filled FAB = primary 填充 / on-primary 图标），
   不再覆盖 ::part(button)/::part(icon)，跟随主题自动切换。 */

/* =========================================================
   设置页面
   ========================================================= */
/* =========================================================
   选项卡切换动画：淡入淡出（复刻 prompt.html）
   - 页面切换用 opacity 淡入淡出，缓动 cubic-bezier(0.4,0,0.6,1)
   关键：由 body.view-settings 单一状态驱动两个页面，动画全部交给
   CSS transition，JS 不再用 setTimeout 改 class —— 快速连点时
   CSS 会自动从当前插值平滑过渡，绝不会两个页面同时全透明。
   ========================================================= */

.settings-page-overlay {
  /* 非设置态：脱离文档流、隐藏、淡出（visibility 延迟到淡出结束）
     用 fixed 而非 absolute：absolute 元素仍会撑开 body 的滚动高度，
     设置页内容有 1400+px，导致首页下方出现大片可滚动空白。
     fixed 完全不参与文档高度计算，同时保留 opacity 淡入淡出。 */
  position: fixed;
  top: 124px; left: 0; right: 0;
  z-index: 800;                /* 低于顶栏(900)，让顶栏覆盖在本页之上 */
  visibility: hidden;
  pointer-events: none;
  background: rgb(var(--mdui-color-surface));
  opacity: 0;
  transition: opacity 340ms cubic-bezier(0.4, 0, 0.6, 1), visibility 0s linear 340ms;
}
body.view-settings .settings-page-overlay {
  /* 设置态：参与文档流，内容撑开 body → window 滚动条生效 → 顶栏 shrink 生效 */
  position: static;
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  transition: opacity 340ms cubic-bezier(0.4, 0, 0.6, 1), visibility 0s;
}
.settings-page-content {
  /* 不再用内部独立滚动条；随 body/window 整体滚动 */
  box-sizing: border-box;
  padding: 0 0 20px;
}
.settings-inner {
  max-width: 520px;
  margin: 0 auto;
  /* 自然流式布局：元素从首行开始，依次排列并自然换行 */
}
/* 首页：切到设置时淡出；切回时淡入（prompt.html 式淡入淡出） */
#dashboardPage {
  transition: opacity 340ms cubic-bezier(0.4, 0, 0.6, 1);
}
body.view-settings #dashboardPage {
  opacity: 0;
  pointer-events: none;
}
.settings-desc {
  font-size: 13px;
  color: rgb(var(--mdui-color-on-surface-variant));
  margin: -4px 0 14px;
  line-height: 1.5;
}
/* 深浅色分段按钮：每个按钮带 icon，文字自适应换行 */
.theme-segmented { width: 100%; }
.theme-segmented mdui-segmented-button {
  --mdui-comp-segmented-button-label-font-size: 13px;
  white-space: nowrap;
}
/* 主题配色选择：预设色圆点 + 自定义取色器 */
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 16px;
}
.color-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgb(var(--mdui-color-outline));
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform .15s, box-shadow .15s;
  flex: 0 0 auto;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected {
  box-shadow: 0 0 0 2px rgb(var(--mdui-color-surface)), 0 0 0 4px rgb(var(--mdui-color-primary));
}
.custom-color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgb(var(--mdui-color-on-surface-variant));
}
.custom-color-row input[type="color"] {
  width: 44px;
  height: 34px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.custom-color-value {
  font-variant-numeric: tabular-nums;
  font-family: 'XiaolaiMono', 'Consolas', monospace;
  color: rgb(var(--mdui-color-on-surface));
}
.widget-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-caption {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: rgb(var(--mdui-color-on-surface-variant));
  margin: 18px 0 9px;
}
.preview-caption::before {
  content: '';
  width: 3px; height: 12px; border-radius: 2px;
  background: rgb(var(--mdui-color-primary));
}
.widget-preview {
  border-radius: 28px;
  padding: 28px;
  background: rgb(var(--mdui-color-surface-container-highest));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 216px;
  justify-content: center;
  overflow: hidden;
}
.widget-preview .wp-item { text-align: center; max-width: 100%; }
.wp-clock {
  font-size: 56px;
  font-variant-numeric: tabular-nums;
  font-family: 'XiaolaiMono', 'Consolas', monospace;
  color: rgb(var(--mdui-color-on-surface));
  line-height: 1.1;
}
.wp-subject {
  font-size: 36px; font-weight: 700;
  color: rgb(var(--mdui-color-primary));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wp-range, .wp-next {
  font-size: 20px;
  color: rgb(var(--mdui-color-on-surface-variant));
  font-variant-numeric: tabular-nums;
}
.wp-next b { color: rgb(var(--mdui-color-on-surface)); font-weight: 600; }
.wp-empty { font-size: 20px; color: rgb(var(--mdui-color-on-surface-variant)); }

/* 焦点大界面里由 chips 控制的部件区 */
.focus-widgets {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  max-width: 100%;
}
.focus-widgets .fw-item {
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  text-align: center;
}
.focus-widgets .fw-subject {
  font-size: clamp(28px, 4.316vw, 40px);
  font-weight: 700;
  color: rgb(var(--mdui-color-primary));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.focus-widgets .fw-range, .focus-widgets .fw-next, .focus-widgets .fw-clock {
  font-size: clamp(20px, 2.988vw, 28px);
  color: rgb(var(--mdui-color-on-surface-variant));
}
.focus-widgets .fw-next b { color: rgb(var(--mdui-color-on-surface)); }
.focus-widgets .fw-clock {
  font-family: 'XiaolaiMono', 'Consolas', monospace;
}
[hidden] { display: none !important; }

