@font-face {
  font-family: "Feather";
  src: url("/vendor/fonts/feather.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Smiley Sans";
  src: url("/vendor/fonts/smiley.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "China";
  src: url("/vendor/fonts/china.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Pixel";
  src: url("/vendor/fonts/pixel.woff2") format("woff2");
  font-display: swap;
}

.font-theme-system {
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

.font-theme-china {
  font-family: "China", "Avenir Next", "PingFang SC", serif;
}

.font-theme-feather {
  font-family: "Feather", "Avenir Next", "PingFang SC", sans-serif;
}

.font-theme-smiley {
  font-family: "Smiley Sans", "Avenir Next", "PingFang SC", sans-serif;
}

.font-theme-pixel {
  font-family: "Pixel", "PingFang SC", monospace;
}

:root {
  color-scheme: dark;
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
  margin: 0;
  background: #000;
  caret-color: transparent;
  /* 修复页面边缘意外获得焦点时出现闪动输入光标的 bug */
}

input,
textarea,
[contenteditable] {
  caret-color: auto;
  /* 仅对真正的输入区域恢复光标 */
}

.media-shell {
  background: linear-gradient(140deg, rgba(15, 23, 42, 0.94), rgba(17, 24, 39, 0.72));
  backdrop-filter: blur(18px);
}

.classic-stage {
  background: #efe3c7;
}

.classic-mat {
  background: #f7f1e5;
  box-shadow: 0 20px 60px rgba(51, 38, 22, 0.12);
}

.vinyl-stage {
  background: #000;
}

.vinyl-mask {
  width: 98vmin;
  height: 98vmin;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.vinyl-mask img,
.vinyl-mask video {
  width: 100%;
  height: 100%;
}

.glass-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.16), transparent 40%),
    radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.12), transparent 46%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 14px rgba(255, 255, 255, 0.04);
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04) 20%, transparent 42%),
    radial-gradient(140% 95% at 14% 4%, rgba(255, 255, 255, 0.16), transparent 42%);
  opacity: 0.38;
}

.glass-panel.warm-glass {
  background:
    radial-gradient(circle at top left, rgba(251, 113, 133, 0.16), transparent 42%),
    radial-gradient(circle at bottom right, rgba(251, 191, 36, 0.1), transparent 45%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.04);
}

.glass-panel.cool-glass {
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.16), transparent 40%),
    radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.12), transparent 46%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.04);
}

.glass-control {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.12),
    inset 1px 1px 0 rgba(255, 255, 255, 0.34),
    inset -1px -1px 0 rgba(255, 255, 255, 0.06);
}

.glass-control::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02) 18%, transparent 32%),
    radial-gradient(120% 100% at 10% 8%, rgba(255, 255, 255, 0.14), transparent 34%);
  opacity: 0.55;
}

.glass-card {
  --liquid-card-blur: 3px;
  --liquid-card-filter: url(#gx-liquid-glass-card) saturate(1.06) brightness(1.03);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.08),
    inset 1px 1px 0 rgba(255, 255, 255, 0.3),
    inset -1px -1px 0 rgba(255, 255, 255, 0.05);
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  backdrop-filter: blur(var(--liquid-card-blur));
  -webkit-backdrop-filter: blur(var(--liquid-card-blur));
  filter: var(--liquid-card-filter);
  transform: translateZ(0);
}

.glass-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.015) 32%, transparent 60%),
    radial-gradient(120% 120% at 10% 8%, rgba(255, 255, 255, 0.16), transparent 24%),
    radial-gradient(90% 95% at 90% 18%, rgba(255, 255, 255, 0.06), transparent 22%),
    rgba(255, 255, 255, 0.095);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 0 5px rgba(255, 255, 255, 0.14);
}

.glass-card>*,
.glass-panel>*,
.glass-control>* {
  position: relative;
  z-index: 2;
}

.compat-lite-glass .glass-panel {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.compat-lite-glass .glass-control {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.compat-lite-glass .glass-card {
  --liquid-card-blur: 2px;
}

.compat-lite-glass .glass-card::before {
  filter: none;
}

.compat-fallback-glass .glass-panel,
.compat-fallback-glass .glass-control {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.1);
}

.compat-fallback-glass .glass-card {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.12);
}

.compat-fallback-glass .glass-card::before {
  display: none;
}

.compat-fallback-glass .glass-card::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03) 30%, transparent 60%),
    radial-gradient(120% 120% at 10% 8%, rgba(255, 255, 255, 0.14), transparent 24%),
    rgba(255, 255, 255, 0.14);
}

.compat-stable-time-card {
  transition: none !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.9s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.fade-enter-to,
.fade-leave-from {
  opacity: 1;
}

.metadata-spinner {
  animation: metadataSpinner 0.8s linear infinite;
}

@keyframes metadataSpinner {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.media-motion {
  animation-duration: var(--motion-duration, 10s);
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
  animation-iteration-count: 1;
  transform-origin: center center;
  will-change: transform;
}

.media-motion.zoom-in {
  animation-name: mediaZoomIn;
}

.media-motion.zoom-pulse {
  animation-name: mediaZoomPulse;
}

@keyframes mediaZoomIn {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.06);
  }
}

@keyframes mediaZoomPulse {
  0% {
    transform: scale(1);
  }
  55% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1.02);
  }
}

/* 圆框 + 对勾选中态，统一替代原生 radio/checkbox 样式 */
.check-radio {
  appearance: none;
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, background-color 0.15s;
}

.check-radio:checked {
  border-color: #7dd3fc;
  /* sky-300 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.2l2.8 2.8 5.2-5.2' stroke='%237dd3fc' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.8rem;
}

/*
 * ─── 经典复古主题拟物细节 ──────────────────────────────────────────────────
 */
.classic-stage {
  background-color: #f2e8d3 !important;
}

.classic-mat {
  background-color: #000; /* 核心修复：将底色改为黑色，防止亚像素漏光产生白色/米色缝隙 */
  box-sizing: border-box; /* 核心修复：确保 borders 不会撑大盒子导致比例计算偏移 */

  /* 光源来自右上角
     上边/右边 = 背光面 → 更深的暖棕色
     左边/下边 = 受光面 → 更亮但仍属暖系，不用纯白 */
  border-top: 10px solid #bab3a8;
  /* 背光：暖棕灰 */
  border-right: 10px solid #bfb9ae;
  /* 背光：暖棕灰（略浅于上边） */
  border-left: 10px solid #e6e1d8;
  /* 受光：暖奶白 */
  border-bottom: 10px solid #e2ddd4;
  /* 受光：暖奶白（略深于左边） */

  /* 紧贴照片开口的内边缘再叠一层柔化阴影，消除色块感 */
  box-shadow:
    inset 3px 3px 8px rgba(90, 70, 45, 0.18),
    /* 内口顶部/左侧柔性暗角 */
    inset -2px -2px 6px rgba(255, 250, 240, 0.45);
  /* 内口底部/右侧微高光 */
}

.classic-mat::after {
  content: none;
}

/*
 * ─── Widget 尺寸规范 (已更新) ───────────────────────────────────────────────────────────
 * 基于 12 列栅格，基准单元 1u = 80px
 *
 * 名称    | 列×行 | 像素 (1.0x基准) | 用途
 * --------|-------|----------------|-------------------
 * Sliver  | 4×1   | 320 × 80 px    | 信息条 (不含EXIF)
 * Square  | 2×2   | 160 × 160 px   | 天气卡片 / 默认单卡
 * Medium  | 4×2   | 320 × 160 px   | 时间卡片 / 完整信息条
 * Large   | 4×4   | 320 × 320 px   | 弹窗详情 (万年历)
 *
 * 缩放系数由 cardScale 控制：sm=0.8x / md=1x / lg=1.5x
 * ──────────────────────────────────────────────────────────────────────────── */

.ios-pwa-fullscreen {
  /* 温和补偿方案：0.6rem (10px) 兼顾了新款灵动岛与老款宽刘海的避让极限，不产生遮挡且缩短了空隙 */
  width: 100vw !important;
  height: 100vh !important;
  box-sizing: border-box !important;
  padding: 0 calc(var(--safe-right) - 0.6rem) 0 calc(var(--safe-left) - 0.6rem) !important;
}

.ios-pwa-fullscreen section {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
}

@media (display-mode: standalone) {
  body {
    margin: 0 !important;
    height: 100vh !important;
    overflow: hidden;
  }
}