/* 汇文明朝体 WebFont */
@font-face {
  font-family: "HuiwenMingchao";
  src: url("./fonts/HuiwenMingchao.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  interpolate-size: allow-keywords;

  --bg-page: #F2F2F7;
  --bg-surface: #FFFFFF;
  --bg-surface-secondary: #EFEFF4;
  --bg-glass: rgba(242, 242, 247, 0.82);
  --bg-glass-dock: rgba(255, 255, 255, 0.86);

  --text-primary: #1C1C1E;
  --text-secondary: #6E6E73;
  --text-tertiary: #8E8E93;

  --accent: #007AFF;
  --accent-pressed: #0062CC;
  --primary-btn-bg: #1D1D1F;
  --primary-btn-fg: #FFFFFF;

  --separator: rgba(60, 60, 67, 0.12);
  --hairline: rgba(0, 0, 0, 0.06);

  --radius-card: 18px;
  --radius-control: 12px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-stage: 0 14px 38px rgba(0, 0, 0, 0.09), 0 2px 8px rgba(0, 0, 0, 0.05);

  --target-size: 28px;
  --dock-height: 76px;
  --header-height: 54px;

  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-ui);
  background-color: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  scroll-padding-top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 12px);
  scroll-padding-bottom: calc(var(--dock-height) + env(safe-area-inset-bottom, 0px) + 16px);
}

body {
  margin: 0;
  min-block-size: 100dvh;
  background-color: var(--bg-page);
  color: var(--text-primary);
  overflow-wrap: break-word;
  padding-bottom: calc(var(--dock-height) + env(safe-area-inset-bottom, 0px) + 20px);
}

img,
canvas,
svg {
  max-inline-size: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:where(button, select, textarea, input:not([type="checkbox"], [type="radio"], [type="range"])) {
  min-block-size: var(--target-size);
}

button:focus-visible,
summary:focus-visible,
textarea:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon {
  inline-size: 18px;
  block-size: 18px;
  flex-shrink: 0;
}

/* 顶部毛玻璃导航栏 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
  padding-top: env(safe-area-inset-top, 0px);
}

.app-header-inner {
  max-inline-size: 460px;
  margin-inline: auto;
  min-block-size: var(--header-height);
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.header-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  min-inline-size: 0;
}

.header-text-link {
  text-decoration: none;
}

.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.header-right {
  display: flex;
  justify-content: flex-end;
  min-inline-size: 0;
}

.app-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
}

.font-status {
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-tertiary);
  margin-top: 2px;
  transition: opacity 0.3s ease;
}

.font-status.is-ready {
  color: #34C759;
}

.font-status.is-hidden {
  display: none;
}

.header-text-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.header-text-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.header-text-btn:active {
  background: rgba(0, 122, 255, 0.1);
  opacity: 0.75;
}

/* 主体内容列 */
.app-main {
  max-inline-size: 460px;
  margin-inline: auto;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 预览舞台区 */
.stage-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.card-stage-shell {
  position: relative;
  inline-size: 100%;
  max-inline-size: 360px;
  border-radius: 12px;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: var(--shadow-stage);
  border: 0.5px solid var(--hairline);
  transition: box-shadow 0.25s ease;
}

.card-canvas {
  display: block;
  inline-size: 100%;
  block-size: auto;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

.card-canvas.is-draggable {
  cursor: grab;
  touch-action: none;
}

.card-canvas.is-dragging {
  cursor: grabbing;
}

.empty-photo-overlay {
  position: absolute;
  left: 10.4%;
  top: 9.2%;
  width: 79.2%;
  height: 63.3%;
  z-index: 3;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-photo-overlay[hidden] {
  display: none;
}

.text-zone-overlay {
  position: absolute;
  left: 9%;
  top: 74%;
  width: 82%;
  height: 20%;
  z-index: 3;
  border: 1.5px dashed transparent;
  border-radius: 10px;
  background: transparent;
  padding: 0;
  cursor: text;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.text-zone-overlay:hover {
  background: rgba(0, 122, 255, 0.04);
  border-color: rgba(0, 122, 255, 0.24);
}

.text-zone-overlay:active {
  background: rgba(0, 122, 255, 0.08);
}

.text-zone-overlay.is-editing {
  background: rgba(0, 122, 255, 0.045);
  border-color: rgba(0, 122, 255, 0.36);
}

.empty-photo-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.empty-photo-overlay:active .empty-photo-pill {
  transform: scale(0.96);
}

.floating-photo-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  border: 0.5px solid rgba(255, 255, 255, 0.35);
  background: rgba(28, 28, 30, 0.62);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 11px;
  min-block-size: 32px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.floating-photo-btn .icon {
  inline-size: 14px;
  block-size: 14px;
}

.floating-photo-btn[hidden] {
  display: none;
}

.floating-photo-btn:active {
  transform: scale(0.95);
  background: rgba(28, 28, 30, 0.8);
}

.stage-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  text-wrap: pretty;
}

/* iOS 分组卡片 */
.group-card {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 0.5px solid var(--hairline);
}

/* 文字输入卡片 */
.composer-card {
  padding: 14px 16px 12px;
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}

.composer-card.is-active-focus {
  border-color: rgba(0, 122, 255, 0.28);
  box-shadow: 0 2px 10px rgba(0, 122, 255, 0.08), var(--shadow-card);
}

.composer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.group-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.char-count {
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.clear-text-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  padding: 2px 6px;
  min-block-size: 28px;
  border-radius: 6px;
  cursor: pointer;
}

.clear-text-btn[hidden] {
  display: none;
}

.diary-textarea {
  display: block;
  inline-size: 100%;
  border: 0;
  background: var(--bg-page);
  border-radius: var(--radius-control);
  padding: 11px 13px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-primary);
  resize: none;
  overflow-y: hidden;
  min-block-size: 74px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.diary-textarea::placeholder {
  color: var(--text-tertiary);
}

.diary-textarea:focus {
  background: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.22);
  outline: none;
}

/* 折叠参数设置（遵循现代 details + ::details-content 规范） */
.settings-details {
  overflow: clip;
}

.settings-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  min-block-size: 52px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.settings-summary::-webkit-details-marker {
  display: none;
}

.summary-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-inline-size: 0;
  flex-shrink: 0;
}

.summary-title-wrap::before {
  content: "";
  inline-size: 14px;
  block-size: 14px;
  flex-shrink: 0;
  background-color: var(--text-secondary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center / contain;
  rotate: -90deg;
}

.settings-details[open] > .settings-summary .summary-title-wrap::before {
  rotate: 0deg;
}

@media (prefers-reduced-motion: no-preference) {
  .summary-title-wrap::before {
    transition: rotate 0.22s ease;
  }
}

.summary-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.summary-meta {
  font-size: 12.5px;
  color: var(--text-secondary);
  text-align: right;
  min-inline-size: 0;
  overflow-wrap: break-word;
}

.settings-details::details-content {
  interpolate-size: allow-keywords;
  overflow: clip;
  contain: layout;
}

.settings-details:not([open])::details-content {
  block-size: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .settings-details::details-content {
    transition: block-size, content-visibility, display;
    transition-duration: 0.28s;
    transition-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1);
    transition-behavior: allow-discrete;
  }
}

.settings-body {
  padding: 4px 16px 16px;
  border-top: 0.5px solid var(--separator);
  display: flex;
  flex-direction: column;
}

.setting-block {
  padding-block: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setting-block + .setting-block {
  border-top: 0.5px solid var(--separator);
}

.setting-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.setting-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.setting-val {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.setting-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* iOS 分段控制器 */
.segmented-control {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 3px;
  padding: 3px;
  background: var(--bg-surface-secondary);
  border-radius: 11px;
}

.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 6px;
  min-block-size: 36px;
  border-radius: 8.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

@media (pointer: coarse) {
  .seg-btn {
    min-block-size: 40px;
  }
}

.seg-btn.is-active {
  background: #FFFFFF;
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* 胶囊网格（图片比例） */
.chip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.chip-btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--bg-page);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.chip-btn.is-active {
  background: rgba(0, 122, 255, 0.1);
  border-color: rgba(0, 122, 255, 0.38);
  color: var(--accent);
  font-weight: 600;
}

/* 颜色色板 */
.color-swatch-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
}

.color-swatch {
  appearance: none;
  position: relative;
  inline-size: 32px;
  block-size: 32px;
  min-inline-size: 32px;
  min-block-size: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: var(--swatch, #FFFFFF);
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

@media (pointer: coarse) {
  .color-swatch {
    inline-size: 34px;
    block-size: 34px;
    min-inline-size: 34px;
    min-block-size: 34px;
  }
}

.color-swatch.is-active {
  box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--accent);
  transform: scale(1.04);
}

.custom-color-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(
    #FF3B30,
    #FF9500,
    #FFCC00,
    #34C759,
    #007AFF,
    #AF52DE,
    #FF2D55,
    #FF3B30
  );
  border: 1px solid rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.custom-color-swatch::after {
  content: "+";
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.custom-color-swatch input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  inline-size: 100%;
  block-size: 100%;
  cursor: pointer;
  border: 0;
  padding: 0;
}

/* iOS 开关行 */
.setting-row-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ios-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-size);
  cursor: pointer;
}

.ios-switch input {
  position: absolute;
  opacity: 0;
  inline-size: 51px;
  block-size: 31px;
  margin: 0;
  cursor: pointer;
}

.ios-switch-track {
  position: relative;
  inline-size: 51px;
  block-size: 31px;
  border-radius: 999px;
  background: #E5E5EA;
  transition: background-color 0.22s ease;
}

.ios-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  inline-size: 27px;
  block-size: 27px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18), 0 0 1px rgba(0, 0, 0, 0.08);
  transition: transform 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ios-switch input:checked + .ios-switch-track {
  background: #34C759;
}

.ios-switch input:checked + .ios-switch-track::after {
  transform: translateX(20px);
}

.ios-switch input:focus-visible + .ios-switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 日期选项子区 */
.date-options-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.date-options-group[hidden] {
  display: none;
}

.setting-subrow {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-label {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.ios-select,
.ios-datetime-input {
  inline-size: 100%;
  border: 0.5px solid var(--separator);
  background: var(--bg-page);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14.5px;
  color: var(--text-primary);
  min-block-size: 42px;
}

.datetime-control-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.datetime-control-wrap .ios-datetime-input {
  flex: 1 1 auto;
  min-inline-size: 0;
}

.mini-pill-btn {
  appearance: none;
  border: 0;
  background: rgba(0, 122, 255, 0.12);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 0 14px;
  min-block-size: 42px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.mini-pill-btn:active {
  background: rgba(0, 122, 255, 0.2);
}

.inline-link-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  padding: 2px 6px;
  min-block-size: 28px;
  cursor: pointer;
}

/* 缩放滑块 */
.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-edge {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-inline-size: 38px;
}

.slider-edge:last-child {
  text-align: right;
}

.ios-slider {
  flex: 1 1 auto;
  min-inline-size: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* 底部毛玻璃固定栏 */
.bottom-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--bg-glass-dock);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: 0.5px solid var(--separator);
  padding-top: 10px;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.bottom-dock-inner {
  max-inline-size: 460px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 0.9fr 1.35fr;
  gap: 10px;
}

.dock-btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  min-block-size: 50px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease, background-color 0.16s ease;
}

.dock-btn:active {
  transform: scale(0.975);
}

.dock-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.dock-btn-secondary {
  background: var(--bg-surface-secondary);
  color: var(--text-primary);
}

.dock-btn-secondary:active {
  background: #E2E2E8;
}

.dock-btn-primary {
  background: var(--primary-btn-bg);
  color: var(--primary-btn-fg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

.dock-btn-primary:active {
  background: #000000;
}

/* 原生保存弹窗 Sheet */
.save-dialog {
  padding: 0;
  border: 0;
  background: transparent;
  max-inline-size: min(400px, calc(100vw - 32px));
  inline-size: 100%;
  margin: auto;
  overflow: visible;
}

.save-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.save-dialog-surface {
  background: #FFFFFF;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  display: flex;
  flex-direction: column;
}

.save-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 0.5px solid var(--separator);
}

.save-dialog-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  text-wrap: balance;
}

.icon-close-btn {
  appearance: none;
  border: 0;
  background: var(--bg-surface-secondary);
  color: var(--text-secondary);
  inline-size: 32px;
  block-size: 32px;
  min-inline-size: 32px;
  min-block-size: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-close-btn svg {
  inline-size: 16px;
  block-size: 16px;
}

.save-dialog-body {
  padding: 16px 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-block-size: 66dvh;
  overflow-y: auto;
}

.save-preview-frame {
  inline-size: 100%;
  max-inline-size: 300px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-stage);
  border: 0.5px solid var(--hairline);
}

.save-preview-img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  -webkit-touch-callout: default;
}

.save-dialog-tip {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: center;
  text-wrap: pretty;
}

.save-dialog-actions {
  padding: 12px 18px max(16px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 0.5px solid var(--separator);
}

.save-dialog-actions .dock-btn[hidden] {
  display: none;
}

/* 苹果风胶囊轻提示 */
.apple-toast {
  position: fixed;
  bottom: calc(var(--dock-height) + env(safe-area-inset-bottom, 0px) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: rgba(28, 28, 30, 0.88);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  max-inline-size: calc(100vw - 32px);
  text-align: center;
  pointer-events: none;
}

.apple-toast[hidden] {
  display: none;
}

@media (max-width: 350px) {
  .segmented-control {
    gap: 2px;
  }
  .seg-btn {
    font-size: 12px;
    padding-inline: 3px;
  }
  .bottom-dock-inner {
    grid-template-columns: 1fr 1.25fr;
  }
}
