:root {
  --page-bg: #FFFBF6;
  --page-bg-2: #F7E3C8;
  --accent: #D48246;
  --accent-soft: #FCEAD6;
  --ink: #4E3426;
  --meta-ink: #8F6B54;
  --surface: rgba(255, 253, 248, 0.88);
  --surface-strong: rgba(255, 253, 249, 0.96);
  --border-soft: rgba(188, 146, 98, 0.25);

  --bm-bg: #FFFDF9;
  --bm-bg-2: #FBEEDB;
  --bm-border: #E5BE8F;
  --bm-frame: #DBA971;
  --bm-ribbon: #E39256;
  --bm-ribbon-dark: #BF6F36;
  --bm-pattern: rgba(216, 158, 95, 0.21);
  --bm-shadow: rgba(148, 96, 48, 0.16);
  --bm-ink: #4E3426;
  --bm-meta-ink: #8F6B54;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Hiragino Maru Gothic ProN", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: linear-gradient(155deg, var(--page-bg) 0%, var(--page-bg-2) 100%);
  background-attachment: fixed;
  transition: background 0.45s var(--ease-soft), color 0.35s var(--ease-soft);
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* Soft ambient pastel background clouds */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(62px);
  opacity: 0.46;
  transition: background 0.5s var(--ease-soft);
}

.blob-1 {
  width: 360px;
  height: 360px;
  top: -90px;
  left: -80px;
  background: var(--accent-soft);
}

.blob-2 {
  width: 400px;
  height: 400px;
  bottom: -120px;
  right: -70px;
  background: var(--bm-bg-2);
}

.blob-3 {
  width: 240px;
  height: 240px;
  top: 44%;
  left: 48%;
  background: rgba(255, 255, 255, 0.72);
}

/* Top Bar */
.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 20px 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-avatar {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  box-shadow: 0 4px 12px var(--bm-shadow);
  border: 2px solid #FFFFFF;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
}

.brand-sub {
  font-size: 11px;
  color: var(--meta-ink);
  letter-spacing: 0.03em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-soft);
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(105, 110, 100, 0.07);
  transition: transform 0.2s var(--ease-spring), background 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.pill-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(105, 110, 100, 0.12);
  border-color: var(--bm-border);
}

.pill-btn:active {
  transform: scale(0.96);
}

.pill-btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 5px 15px rgba(244, 139, 159, 0.34);
}

.pill-btn.primary:hover {
  filter: brightness(1.03);
  box-shadow: 0 7px 18px rgba(244, 139, 159, 0.42);
}

/* Main Pure Centered Workspace */
.workspace {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 18px 28px;
  transition: padding-right 0.35s var(--ease-soft), padding-bottom 0.35s var(--ease-soft);
}

.topbar {
  transition: padding-right 0.35s var(--ease-soft);
}

/* Keep bookmark crystal clear & centered in the left visible area while settings are open */
@media (min-width: 800px) {
  body.settings-open .workspace {
    padding-right: 398px;
  }

  body.settings-open .topbar {
    padding-right: 400px;
  }
}

.bookmark-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.bookmark-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 22px;
  animation: gentleFloat 5.5s ease-in-out infinite;
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Top Ribbon Bow */
.bookmark-ribbon-area {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-soft), transform 0.35s var(--ease-spring);
}

.bookmark-ribbon-area.is-hidden {
  opacity: 0;
  transform: translateX(-50%) scale(0.75);
}

.bookmark-bow-svg {
  width: 84px;
  height: 50px;
  filter: drop-shadow(0 3px 5px rgba(138, 76, 94, 0.16));
}

/* Physical Bookmark Card */
.bookmark-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--bm-bg);
  background-image: linear-gradient(170deg, var(--bm-bg) 0%, var(--bm-bg-2) 100%);
  border: 2px solid var(--bm-border);
  border-radius: 28px;
  box-shadow:
    0 22px 46px -10px var(--bm-shadow),
    0 6px 14px rgba(110, 96, 76, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  overflow: visible;
  transition:
    width 0.38s var(--ease-soft),
    min-height 0.38s var(--ease-soft),
    background 0.35s var(--ease-soft),
    border-color 0.35s var(--ease-soft),
    box-shadow 0.35s var(--ease-soft);
}

.bookmark-card.shape-vertical {
  width: 314px;
  min-height: 540px;
  padding: 50px 24px 22px;
}

.bookmark-card.shape-card {
  width: 368px;
  min-height: 458px;
  padding: 46px 34px 22px;
}

/* Paper Textures clipped to card radius */
.bookmark-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 26px;
  pointer-events: none;
}

.bookmark-card.texture-cotton::before {
  opacity: 0.42;
  background-image:
    radial-gradient(rgba(165, 130, 90, 0.14) 0.7px, transparent 0.7px),
    radial-gradient(rgba(165, 130, 90, 0.09) 0.7px, transparent 0.7px);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}

.bookmark-card.texture-gingham::before {
  background-image:
    linear-gradient(90deg, var(--bm-pattern) 50%, transparent 50%),
    linear-gradient(var(--bm-pattern) 50%, transparent 50%);
  background-size: 26px 26px;
  opacity: 0.55;
}

.bookmark-card.texture-dots::before {
  background-image: radial-gradient(var(--bm-pattern) 2.6px, transparent 2.8px);
  background-size: 22px 22px;
  opacity: 0.9;
}

.bookmark-card.texture-cream::before {
  background: radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.65), transparent 70%);
}

/* Punched ribbon eyelet hole */
.bookmark-hole {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--page-bg-2);
  border: 2px solid var(--bm-border);
  box-shadow: inset 0 2px 4px rgba(100, 92, 74, 0.16);
  z-index: 3;
  transition: opacity 0.28s, transform 0.28s;
}

.bookmark-hole.is-hidden {
  opacity: 0;
  transform: translateX(-50%) scale(0.4);
}

/* Inner stitched bakery frame */
.bookmark-inner-frame {
  position: absolute;
  inset: 12px;
  border-radius: 20px;
  border: 1.8px dashed var(--bm-frame);
  pointer-events: none;
  z-index: 2;
  opacity: 0.85;
  transition: opacity 0.3s;
}

.bookmark-inner-frame.is-hidden {
  opacity: 0;
}

/* Corner stickers */
.bookmark-stickers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.3s;
}

.bookmark-stickers.is-hidden {
  opacity: 0;
}

.sticker {
  position: absolute;
  display: block;
  opacity: 0.88;
  filter: drop-shadow(0 2px 3px rgba(120, 80, 50, 0.1));
}

.sticker-tl {
  top: 22px;
  left: 18px;
  width: 28px;
  height: 28px;
  transform: rotate(-12deg);
}

.sticker-tr {
  top: 24px;
  right: 20px;
  width: 22px;
  height: 22px;
  transform: rotate(10deg);
}

.sticker-bl {
  bottom: 24px;
  left: 20px;
  width: 26px;
  height: 26px;
  transform: rotate(-8deg);
}

.sticker-br {
  bottom: 22px;
  right: 18px;
  width: 30px;
  height: 22px;
  transform: rotate(12deg);
}

/* Fixed Gentle Kaiti Left-Aligned Text Content */
.bookmark-content {
  position: relative;
  z-index: 4;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  padding: 20px 6px 10px;
  transition: opacity 0.24s var(--ease-soft), transform 0.28s var(--ease-soft);
}

.bookmark-content.is-switching {
  opacity: 0;
  transform: translateY(6px);
}

.bookmark-quote-wrap {
  display: flex;
  align-items: center;
  flex: 1;
}

.bookmark-quote {
  margin: 0;
  width: 100%;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "BiauKai", "FangSong", serif;
  font-size: 16px;
  line-height: 2;
  text-align: left;
  color: var(--bm-ink);
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: 0.04em;
}

.bookmark-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: var(--bm-meta-ink);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  transition: opacity 0.25s;
}

.bookmark-footer.is-hidden {
  display: none;
}

.bookmark-author {
  font-weight: 600;
}

.bookmark-date {
  font-size: 11.5px;
  opacity: 0.82;
}

/* Speech Bubble Directly Above Bottom CookieAnn Puppy */
.card-mascot-bubble {
  position: absolute;
  bottom: 98px;
  left: 50%;
  width: min(252px, calc(100% - 28px));
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1.8px solid var(--bm-border);
  box-shadow: 0 10px 26px rgba(90, 82, 72, 0.16);
  color: var(--ink);
  font-size: 12.8px;
  line-height: 1.55;
  text-align: center;
  z-index: 12;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px) scale(0.92);
  transform-origin: bottom center;
  transition: opacity 0.26s var(--ease-soft), transform 0.32s var(--ease-spring);
}

.card-mascot-bubble::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.96);
  border-right: 1.8px solid var(--bm-border);
  border-bottom: 1.8px solid var(--bm-border);
  transform: translateX(-50%) rotate(45deg);
}

.card-mascot-bubble.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Direct-Poke CookieAnn Puppy at Bottom of Bookmark */
.bookmark-mascot-slot {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto -6px;
  padding: 4px 10px 0;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring);
}

.bookmark-mascot-slot .cookie-puppy-svg {
  width: 90px;
  height: 82px;
  filter: drop-shadow(0 4px 8px rgba(130, 96, 54, 0.14));
  transition: transform 0.25s var(--ease-spring);
}

.bookmark-mascot-slot:hover .cookie-puppy-svg {
  transform: translateY(-2px) scale(1.06);
}

/* Cute Puppy SVG Animations */
.cookie-puppy-svg .puppy-eyes-happy {
  opacity: 0;
}

.cookie-puppy-svg .puppy-ear-left {
  transform-origin: 58px 76px;
  animation: earSwayLeft 3.8s ease-in-out infinite;
}

.cookie-puppy-svg .puppy-ear-right {
  transform-origin: 122px 76px;
  animation: earSwayRight 3.8s ease-in-out infinite;
}

@keyframes earSwayLeft {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(4deg); }
}

@keyframes earSwayRight {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-4deg); }
}

.is-poked .cookie-puppy-svg {
  animation: puppyBounce 0.56s var(--ease-spring);
}

.is-poked .cookie-puppy-svg .puppy-eyes-normal {
  opacity: 0;
}

.is-poked .cookie-puppy-svg .puppy-eyes-happy {
  opacity: 1;
}

@keyframes puppyBounce {
  0% { transform: scale(1, 1); }
  25% { transform: scale(1.16, 0.85) translateY(4px); }
  55% { transform: scale(0.92, 1.12) translateY(-10px); }
  80% { transform: scale(1.04, 0.97) translateY(1px); }
  100% { transform: scale(1, 1); }
}

/* Clean Minimal Stage Controls Under Bookmark */
.stage-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.stage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-soft);
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(100, 108, 102, 0.09);
  transition: transform 0.2s var(--ease-spring), border-color 0.22s, background 0.22s, color 0.22s;
}

.stage-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.stage-btn:active {
  transform: scale(0.95);
}

.next-btn {
  padding: 0 20px;
}

.next-btn.is-loading .spin-icon {
  animation: spinRotate 0.7s linear infinite;
}

@keyframes spinRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fav-btn {
  width: 40px;
  padding: 0;
}

.fav-btn.is-favorited {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.fav-btn.is-favorited svg {
  fill: var(--accent);
}

/* Unified Settings Slide-Over Drawer (Zero Blur so left/top bookmark stays 100% clear) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 40;
  opacity: 0;
  transition: opacity 0.25s;
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 92vw);
  background: rgba(255, 253, 249, 0.97);
  border-left: 1.5px solid var(--border-soft);
  z-index: 50;
  box-shadow: -14px 0 38px rgba(70, 62, 54, 0.12);
  display: flex;
  flex-direction: column;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(16px + env(safe-area-inset-bottom));
  transform: translateX(104%);
  transition: transform 0.35s var(--ease-soft);
}

.settings-drawer.is-open {
  transform: translateX(0);
}

@media (max-width: 799px) {
  .settings-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(56vh, 470px);
    border-left: none;
    border-top: 1.5px solid var(--border-soft);
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -12px 34px rgba(70, 62, 54, 0.14);
    padding: 16px 18px calc(14px + env(safe-area-inset-bottom));
    transform: translateY(104%);
  }

  .settings-drawer.is-open {
    transform: translateY(0);
  }
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.drawer-title {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}

.drawer-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--meta-ink);
}

.icon-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.drawer-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 5px;
  margin-bottom: 14px;
  border-radius: var(--radius-pill);
  background: rgba(244, 240, 232, 0.72);
  border: 1px solid var(--border-soft);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 35px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--meta-ink);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}

.tab-btn.is-active {
  background: #FFFFFF;
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(100, 96, 86, 0.1);
}

.mini-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeSlide 0.22s var(--ease-soft);
}

.tab-pane.is-active {
  display: flex;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.field-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--meta-ink);
  letter-spacing: 0.03em;
}

.choice-pills {
  display: flex;
  gap: 8px;
}

.choice-pill {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-soft);
  background: #FFFFFF;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s var(--ease-soft);
}

.choice-pill.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.theme-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: var(--radius-md);
  border: 1.8px solid var(--border-soft);
  background: #FFFFFF;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-soft);
}

.theme-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.theme-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.theme-dot::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 50%;
  height: 50%;
  background: var(--dot-accent);
  border-top-left-radius: 100%;
}

.texture-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.texture-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px;
  border-radius: var(--radius-md);
  border: 1.8px solid var(--border-soft);
  background: #FFFFFF;
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-soft);
}

.texture-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.texture-preview {
  width: 100%;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--bm-border);
  background-color: var(--bm-bg);
}

.texture-preview.prev-cotton {
  background-image:
    radial-gradient(rgba(165, 130, 90, 0.22) 0.9px, transparent 0.9px),
    radial-gradient(rgba(165, 130, 90, 0.14) 0.9px, transparent 0.9px);
  background-size: 10px 10px;
  background-position: 0 0, 5px 5px;
}

.texture-preview.prev-gingham {
  background-image:
    linear-gradient(90deg, var(--bm-pattern) 50%, transparent 50%),
    linear-gradient(var(--bm-pattern) 50%, transparent 50%);
  background-size: 16px 16px;
}

.texture-preview.prev-dots {
  background-image: radial-gradient(var(--bm-pattern) 2.5px, transparent 2.6px);
  background-size: 14px 14px;
}

.texture-preview.prev-cream {
  background: linear-gradient(135deg, var(--bm-bg) 0%, var(--bm-bg-2) 100%);
}

.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  border: 1.5px solid var(--border-soft);
  cursor: pointer;
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.toggle-desc {
  font-size: 11.5px;
  color: var(--meta-ink);
  line-height: 1.4;
}

.soft-switch {
  -webkit-appearance: none;
  appearance: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #E4DDD4;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.25s;
}

.soft-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 5px rgba(80, 72, 64, 0.18);
  transition: transform 0.25s var(--ease-spring);
}

.soft-switch:checked {
  background: var(--accent);
}

.soft-switch:checked::after {
  transform: translateX(18px);
}

.vault-status {
  margin: 0;
  font-size: 11.5px;
  color: var(--meta-ink);
  padding-left: 2px;
}

/* Favorites List */
.fav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fav-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--meta-ink);
  font-size: 13px;
  line-height: 1.7;
}

.fav-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 15px;
  border: 1.5px solid var(--border-soft);
  background: #FFFFFF;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.fav-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.fav-card-body {
  flex: 1;
  min-width: 0;
}

.fav-card-quote {
  margin: 0 0 4px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fav-card-meta {
  font-size: 11.5px;
  color: var(--meta-ink);
}

.fav-del-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(244, 139, 159, 0.12);
  color: #C75D79;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.drawer-footer-tip {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #FFF7DF;
  font-size: 11.5px;
  line-height: 1.5;
  color: #8A6848;
}

/* Cookie & Heart Particle Shower */
.particle-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  overflow: hidden;
}

.burst-particle {
  position: fixed;
  font-size: 20px;
  user-select: none;
  will-change: transform, opacity;
  animation: particleFly var(--dur, 1.25s) cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes particleFly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
  }
  16% {
    opacity: 1;
    transform: translate(calc(-50% + var(--tx) * 0.25), calc(-50% + var(--ty) * 0.35)) scale(1.14) rotate(calc(var(--rot) * 0.3));
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty) + 125px)) scale(0.75) rotate(var(--rot));
  }
}

/* Fullscreen Immersive Mode */
.fullscreen-hud {
  display: none;
}

body.is-fullscreen .topbar,
body.is-fullscreen .stage-controls {
  display: none !important;
}

body.is-fullscreen .workspace {
  min-height: 100dvh;
  padding: 24px;
}

body.is-fullscreen .bookmark-wrapper {
  transform: scale(1.06);
}

body.is-fullscreen .fullscreen-hud {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 248, 0.88);
  backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(100, 92, 82, 0.16);
  z-index: 60;
  transition: opacity 0.3s, transform 0.3s;
}

body.is-fullscreen.hud-hidden .fullscreen-hud {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(14px);
}

/* Toast Notification */
.toast {
  position: fixed;
  top: calc(64px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(68, 56, 50, 0.92);
  color: #FFFDF8;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(68, 56, 50, 0.22);
  opacity: 0;
  pointer-events: none;
  z-index: 95;
  transition: opacity 0.25s, transform 0.3s var(--ease-spring);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mobile Responsive Polish */
@media (max-width: 600px) {
  .topbar {
    padding: 10px 14px 4px;
    gap: 8px;
  }

  .brand-sub {
    display: none;
  }

  .brand-avatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .brand-title {
    font-size: 15px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .pill-btn {
    height: 35px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  .bookmark-card.shape-vertical {
    width: min(292px, 84vw);
    min-height: 500px;
    padding: 46px 24px 20px;
  }

  .bookmark-card.shape-card {
    width: min(338px, 90vw);
    min-height: 420px;
    padding: 42px 24px 20px;
  }

  .bookmark-quote {
    font-size: 16px;
  }
}

@media (max-width: 440px) {
  .topbar-actions .btn-label {
    display: none;
  }

  .topbar-actions .pill-btn {
    padding: 0 9px;
  }

  .topbar-actions .pill-btn.primary {
    padding: 0 11px;
  }

  .topbar-actions .pill-btn.primary .btn-label {
    display: inline;
  }
}
