/* ==========================================================================
   桃的密码本 · 全局样式
   设计基调：iOS 式留白与圆角，暖白底色，桃色只用于少量聚焦点
   ========================================================================== */

:root {
  --bg: #F4F1EE;
  --bg-deep: #EDE8E2;
  --surface: #FFFFFF;
  --surface-soft: #FBF8F5;
  --ink: #1A1815;
  --ink-2: #6B655D;
  --ink-3: #A39C93;
  --line: #E9E2DA;
  --peach: #D4826B;
  --peach-deep: #B96750;
  --peach-soft: #FBEDE7;
  --danger: #B2423A;
  --radius-card: 18px;
  --radius-field: 14px;
  --shadow-card: 0 1px 2px rgba(26, 24, 21, 0.04), 0 10px 26px -16px rgba(26, 24, 21, 0.18);
  --shadow-key: 0 1px 1px rgba(26, 24, 21, 0.05), 0 4px 14px -8px rgba(26, 24, 21, 0.24);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

/* ================= 外壳 ================= */

.app {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
  overflow-x: hidden;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: viewIn 0.26s var(--ease);
}

/* ================= 解锁 / 引导 ================= */

.lock-screen,
.onboard-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: calc(env(safe-area-inset-top) + 36px) 24px calc(env(safe-area-inset-bottom) + 24px);
}

.lock-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lock-head.compact {
  gap: 8px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  background: var(--peach-soft);
  color: var(--peach-deep);
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 1px;
  box-shadow: inset 0 0 0 1px rgba(212, 130, 107, 0.2);
}

.lock-title {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.6px;
  margin: 0;
}

.lock-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin: 0;
  text-align: center;
}

.lock-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.btn-bio {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.14s var(--ease), background 0.14s;
}

.btn-bio:active {
  transform: scale(0.97);
  background: var(--peach-soft);
}

.btn-bio svg {
  color: var(--peach-deep);
}

.link-btn {
  border: none;
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  padding: 10px 12px;
  min-height: 44px;
  cursor: pointer;
}

.link-btn:active {
  color: var(--peach-deep);
}

/* ---------- 密码键盘 ---------- */

.pinpad-host {
  width: 100%;
  max-width: 300px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 30px;
}

.pin-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid #CFC6BC;
  background: transparent;
  transition: background 0.22s var(--ease), border-color 0.22s var(--ease),
    transform 0.22s var(--ease);
}

.pin-dot.is-filled {
  background: var(--peach);
  border-color: var(--peach);
  transform: scale(1.08);
}

.pin-dots.is-error {
  animation: shake 0.42s;
}

.pin-dots.is-error .pin-dot {
  background: var(--danger);
  border-color: var(--danger);
}

.pin-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 18px;
}

.pin-key {
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 24px;
  font-weight: 400;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-key);
  transition: transform 0.12s var(--ease), background 0.12s;
  user-select: none;
}

.pin-key:active {
  background: var(--peach-soft);
  transform: scale(0.94);
}

.pin-key-ghost {
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  cursor: default;
}

.pin-key-del {
  color: var(--ink-2);
}

.pin-key-del:active {
  background: var(--bg-deep);
}

.pinpad-host.compact {
  max-width: 264px;
}

.pinpad-host.compact .pin-dots {
  margin-bottom: 20px;
}

.pinpad-host.compact .pin-keys {
  gap: 10px 14px;
}

.pinpad-host.compact .pin-key {
  font-size: 20px;
}

.onboard-security {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ================= 通用页头 ================= */

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 6px) 10px 6px;
  background: rgba(244, 241, 238, 0.84);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.nav-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin: 0;
  flex: 1;
  text-align: center;
}

.nav-icon,
.nav-text {
  min-width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  border-radius: 12px;
  flex: none;
}

.nav-icon:active,
.nav-text:active {
  background: rgba(0, 0, 0, 0.05);
}

.nav-text.strong {
  color: var(--peach-deep);
  font-weight: 600;
  padding: 0 8px;
}

.nav-text.placeholder {
  visibility: hidden;
  pointer-events: none;
}

.page {
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 36px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.page-home {
  padding-top: 0;
  gap: 10px;
}

/* ================= 搜索 / 筛选 ================= */

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  color: var(--ink-3);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.searchbar:focus-within {
  border-color: var(--peach);
  box-shadow: 0 0 0 3px rgba(212, 130, 107, 0.13);
}

.searchbar input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-size: 15px;
  color: var(--ink);
}

.searchbar input::placeholder {
  color: var(--ink-3);
}

.searchbar input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  border: none;
  background: var(--bg-deep);
  color: var(--ink-2);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  background: var(--peach-soft);
  color: var(--peach-deep);
  font-size: 13px;
  border: none;
  cursor: pointer;
}

.filter-chip span {
  font-size: 15px;
  line-height: 1;
  opacity: 0.7;
}

/* ================= 记录卡片 ================= */

.record-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 2px;
}

.record-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid rgba(233, 226, 218, 0.8);
  box-shadow: var(--shadow-card);
  padding: 13px 15px 11px;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    border-color 0.18s;
  will-change: transform;
}

.record-card.is-press {
  transform: scale(0.985);
}

.record-card.is-dragging {
  transform: scale(1.02);
  border-color: var(--peach);
  box-shadow: 0 18px 36px -16px rgba(26, 24, 21, 0.34);
  z-index: 3;
  transition: box-shadow 0.16s, border-color 0.16s;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--bg-deep);
  color: var(--ink-2);
  font-size: 11.5px;
  letter-spacing: 0.3px;
}

.rec-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin: 9px 0 2px;
  word-break: break-word;
}

.rec-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin: 0;
  word-break: break-all;
}

.rec-pw {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 7px 6px 7px 11px;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid rgba(233, 226, 218, 0.9);
}

.pw-text {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  letter-spacing: 0.8px;
  color: var(--ink-2);
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}

.rec-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

.icon-action {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}

.icon-action:active {
  background: var(--bg-deep);
  color: var(--peach-deep);
}

/* ================= 空状态 ================= */

.empty-state {
  padding: 56px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.empty-desc {
  font-size: 13px;
  color: var(--ink-3);
  margin: 0;
  max-width: 260px;
  line-height: 1.6;
}

.empty-state .btn {
  margin-top: 16px;
  padding: 0 22px;
  height: 46px;
}

/* ================= 按钮 ================= */

.btn {
  height: 50px;
  border-radius: var(--radius-field);
  border: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 0 20px;
  cursor: pointer;
  transition: transform 0.14s var(--ease), opacity 0.14s, background 0.18s;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.42;
  pointer-events: none;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(178, 66, 58, 0.26);
  font-weight: 500;
}

.btn-block {
  width: 100%;
  display: block;
}

/* ================= 表单 ================= */

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.field-label {
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.4px;
  padding-left: 2px;
}

.input {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-field);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 14px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.input::placeholder {
  color: var(--ink-3);
}

.input:focus {
  border-color: var(--peach);
  box-shadow: 0 0 0 3px rgba(212, 130, 107, 0.13);
}

.input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(178, 66, 58, 0.12);
}

.textarea {
  height: auto;
  min-height: 92px;
  padding: 12px 14px;
  line-height: 1.55;
  resize: vertical;
}

.select-wrap {
  position: relative;
}

.select-wrap .input {
  padding-right: 38px;
  cursor: pointer;
}

.select-chevron {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
  display: grid;
  place-items: center;
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  padding-right: 6px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.input-actions:focus-within {
  border-color: var(--peach);
  box-shadow: 0 0 0 3px rgba(212, 130, 107, 0.13);
}

.input-actions .input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding-right: 4px;
}

.input-actions .input:focus {
  border: none;
  box-shadow: none;
}

.inline-icon {
  position: relative;
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}

.inline-icon:active {
  background: var(--bg-deep);
  color: var(--peach-deep);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-group .group-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group-index {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.4px;
}

.group-index i {
  font-style: normal;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--peach-soft);
  color: var(--peach-deep);
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 600;
}

.danger-zone {
  padding-top: 10px;
}

/* ================= 详情 ================= */

.detail-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 0 6px;
  text-align: center;
}

.detail-app {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  word-break: break-word;
}

.detail-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid rgba(233, 226, 218, 0.8);
  box-shadow: var(--shadow-card);
  padding: 2px 15px;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-key {
  flex: none;
  width: 66px;
  font-size: 13px;
  color: var(--ink-3);
}

.detail-val {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  text-align: right;
  word-break: break-all;
}

.detail-val.muted {
  color: var(--ink-3);
  font-size: 14px;
}

.detail-val.mono {
  font-size: 14px;
  letter-spacing: 0.6px;
}

.detail-actions {
  display: flex;
  gap: 2px;
  flex: none;
}

.detail-note {
  text-align: left;
  line-height: 1.6;
  font-size: 14px;
  color: var(--ink-2);
  white-space: pre-wrap;
}

/* ================= 设置 ================= */

.section-title {
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 1.2px;
  margin: 14px 4px 2px;
}

.section-title:first-child {
  margin-top: 4px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid rgba(233, 226, 218, 0.8);
  box-shadow: var(--shadow-card);
}

.list-card {
  display: flex;
  flex-direction: column;
  padding: 0 2px;
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-size: 15.5px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.row:last-child {
  border-bottom: none;
}

.row:active {
  background: var(--surface-soft);
}

.row-label {
  flex: 1;
  min-width: 0;
}

.row-tail {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  font-size: 14px;
  flex: none;
}

.row-note {
  font-size: 13px;
  color: var(--ink-3);
}

.chevron {
  font-size: 17px;
  line-height: 1;
  color: var(--ink-3);
  opacity: 0.8;
}

.switch {
  position: relative;
  width: 50px;
  height: 31px;
  flex: none;
  border: none;
  border-radius: 999px;
  background: #DED7CE;
  cursor: pointer;
  padding: 0;
  transition: background 0.22s var(--ease);
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.22s var(--ease);
}

.switch[aria-checked="true"] {
  background: var(--peach);
}

.switch[aria-checked="true"]::after {
  transform: translateX(19px);
}

/* 透明热区：把开关的可点击范围扩到 45px 高，视觉尺寸不变 */
.switch::before {
  content: "";
  position: absolute;
  inset: -7px -3px;
}

.footnote {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.65;
  margin: 16px 4px 0;
}

.info-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-title {
  font-size: 16.5px;
  font-weight: 600;
  margin: 0;
}

.card-text {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.65;
  margin: 0;
}

.info-card .btn {
  margin-top: 6px;
}

.notice-block {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--peach-soft);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0;
}

/* ================= 分类管理 ================= */

.category-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 14px;
  border-bottom: 1px solid var(--line);
}

.list-card .category-row:last-child {
  border-bottom: none;
}

.category-main {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  text-align: left;
  padding: 11px 0;
  font-size: 15.5px;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.category-count {
  font-size: 12.5px;
  color: var(--ink-3);
}

.category-actions {
  display: flex;
  gap: 2px;
  flex: none;
}

/* ================= 密码页 ================= */

.pinset-page {
  min-height: calc(100dvh - 64px);
  align-items: center;
  justify-content: center;
  gap: 28px;
  text-align: center;
}

.pinset-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

/* ================= 底部面板 ================= */

.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 16, 0.38);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease-out;
}

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface-soft);
  border-radius: 24px 24px 0 0;
  padding: 6px 18px calc(env(safe-area-inset-bottom) + 20px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: sheetUp 0.34s var(--ease);
}

/* 面板内容超出高度时改为滚动，禁止子元素被压缩变形 */
.sheet-panel > * {
  flex: 0 0 auto;
}

.sheet-grabber {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: #D9D2C9;
  margin: 4px auto 0;
}

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

.sheet-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.sheet-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin: -8px 0 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-3);
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn:active {
  background: var(--bg-deep);
}

.gen-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 60px;
}

.gen-value {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 15px;
  letter-spacing: 0.4px;
  word-break: break-all;
  color: var(--ink);
}

/* 小屏时面板内容可能超过可视高度，把主按钮固定在面板底部，避免被裁掉 */
#gen-apply {
  position: sticky;
  bottom: 0;
  margin-top: 4px;
  box-shadow: 0 -12px 20px -14px rgba(26, 24, 21, 0.4);
}

.gen-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}

.gen-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: var(--ink-2);
}

.gen-length {
  color: var(--peach-deep);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 30px;
  background: transparent;
  outline: none;
}

.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: #E3DCD3;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -10px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #D9D2C9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  padding: 10px 0;
}

.gen-block .switch-row + .switch-row {
  border-top: 1px solid var(--line);
}

.gen-warn {
  font-size: 12.5px;
  color: var(--danger);
  margin: -6px 0 0;
}

/* ================= 轻提示 / 对话框 ================= */

.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 34px);
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 84vw;
  pointer-events: none;
}

.toast {
  background: rgba(26, 24, 21, 0.9);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.5;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 12px 26px -14px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.24s var(--ease);
  backdrop-filter: blur(6px);
}

.toast.is-out {
  animation: toastOut 0.2s ease-in forwards;
}

.dialog-root {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.dialog-root.is-open {
  display: flex;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 16, 0.38);
  animation: fadeIn 0.18s ease-out;
}

.dialog-panel {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border-radius: 20px;
  padding: 22px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.42);
  animation: dialogIn 0.22s var(--ease);
}

.dialog-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  text-align: center;
}

.dialog-message {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.65;
  margin: 4px 0 0;
  text-align: center;
}

.dialog-input {
  width: 100%;
  height: 46px;
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 13px;
  font-size: 15px;
  background: var(--surface-soft);
  outline: none;
}

.dialog-input:focus {
  border-color: var(--peach);
  box-shadow: 0 0 0 3px rgba(212, 130, 107, 0.13);
}

.dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.dialog-btn {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.dialog-btn:active {
  transform: scale(0.98);
}

.dialog-btn-cancel {
  background: var(--bg-deep);
  color: var(--ink);
}

.dialog-btn-ok {
  background: var(--ink);
  color: #fff;
}

.dialog-btn-ok.danger {
  background: var(--danger);
}

/* ================= 动效 ================= */

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sheetUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shake {
  10%,
  90% {
    transform: translateX(-2px);
  }
  20%,
  80% {
    transform: translateX(4px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-6px);
  }
  40%,
  60% {
    transform: translateX(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================= 桌面适配（预览用） ================= */

@media (min-width: 560px) {
  body {
    background: #DCD6CE;
  }

  .app {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 30px 80px -40px rgba(0, 0, 0, 0.4);
  }

  .sheet-layer {
    align-items: center;
  }

  .sheet-panel {
    border-radius: 24px;
    max-width: 420px;
    margin-bottom: 24px;
  }
}
