/* ==========================================================================
   小玉手账 • 自由拖拽拼贴与动态虚线跟随 (Drag & Drop Canvas Edition)
   ========================================================================== */

:root {
  --paper-bg: #FAF7F2;
  --paper-grid: rgba(215, 205, 190, 0.32);
  --ink-primary: #2C2825;
  --ink-secondary: #6A6258;
  --ink-muted: #A3998C;
  --ink-handwritten: #3F3935;
  
  --tape-pink: rgba(254, 205, 211, 0.85);
  --tape-blue: rgba(186, 230, 253, 0.85);
  --tape-yellow: rgba(254, 240, 138, 0.85);
  
  --polaroid-shadow: 0 10px 24px -4px rgba(44, 40, 37, 0.12), 0 2px 5px -1px rgba(44, 40, 37, 0.06);
  --polaroid-dragging-shadow: 0 22px 45px -6px rgba(44, 40, 37, 0.28), 0 6px 14px -2px rgba(44, 40, 37, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--paper-bg);
  background-image: 
    linear-gradient(var(--paper-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink-primary);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", serif;
  min-height: 100vh;
  padding: 36px 14px 60px 14px;
  overflow-x: hidden;
  position: relative;
}

/* 硬件加速固定背景层（彻底杜绝滚动跳动与卡顿） */
.fixed-bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform, opacity, filter;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fixed-bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  background-color: transparent;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* 主长卷容器（类似工作台的彻底无界流动） */
.infinite-journal-scroll {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

/* 顶部极简问候与动态相见记录 */
.journal-header {
  text-align: center;
  margin-bottom: 24px;
  padding-top: 6px;
  position: relative;
}

.journal-greeting {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: ui-monospace, "SF Pro Rounded", Futura, sans-serif;
  color: var(--ink-primary);
  margin-bottom: 6px;
  line-height: 1.1;
}

.header-stats-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px dashed rgba(180, 168, 150, 0.45);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-secondary);
}

.header-stats-row strong {
  color: #E11D48;
  font-weight: 700;
  font-size: 13px;
}

.stat-sep {
  color: var(--ink-muted);
  font-size: 11px;
}

body.has-custom-bg {
  background-size: cover !important;
  background-position: center !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
}

/* ================= 每次见面的无界章节 (Meet Section) ================= */

.meet-section {
  position: relative;
  margin-bottom: 52px;
  padding-bottom: 20px;
}

/* 章节顶部淡雅素描细线（优雅分割，不割裂） */
.meet-divider-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(180, 168, 150, 0.45) 15%, rgba(180, 168, 150, 0.45) 85%, transparent 100%);
  margin-bottom: 20px;
}

/* 日期与地点（大字日期 + 无框内联修改） */
.meet-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.meet-date-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
  cursor: pointer;
}

.meet-day {
  font-size: 36px;
  font-weight: 800;
  font-family: ui-monospace, "SF Pro Rounded", Futura, sans-serif;
  color: var(--ink-primary);
  line-height: 1;
}

.meet-subdate {
  display: flex;
  flex-direction: column;
}

.meet-yearmonth {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.meet-weekday {
  font-size: 11px;
  color: var(--ink-muted);
}

.meet-location-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.85);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-secondary);
  border: 1px solid rgba(180, 168, 150, 0.35);
}

.inline-edit-location {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--ink-primary);
  font-family: inherit;
  width: 150px;
}

/* ================= 自由拖拽拼贴相册画布 (Draggable Canvas) ================= */

.photo-canvas-board {
  position: relative;
  width: 100%;
  min-height: 380px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px dashed rgba(180, 168, 150, 0.45);
  border-radius: 16px;
  padding: 16px;
  margin: 14px 0 22px 0;
  cursor: default;
  overflow: visible;
  transition: background 0.2s, border-color 0.2s;
  user-select: none;
}

.photo-canvas-board:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(180, 168, 150, 0.75);
}

/* 画布水印提示 */
.canvas-watermark-tip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #B8AA98;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.04em;
  pointer-events: none;
  text-align: center;
  font-family: "PingFang SC", "Kaiti", serif;
  width: 80%;
}

.canvas-watermark-subtip {
  position: absolute;
  bottom: 12px;
  right: 16px;
  color: #C0B4A4;
  font-size: 11px;
  pointer-events: none;
}

/* 贯穿相片之间的动态 SVG 贝塞尔虚线（实时跟随拖拽重绘与点击交互） */
.canvas-svg-connector {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}

.canvas-svg-connector path.conn-hit-area {
  fill: none;
  stroke: transparent;
  stroke-width: 28px;
  stroke-linecap: round;
  pointer-events: stroke;
  cursor: pointer;
}

.canvas-svg-connector path.conn-visible-line {
  fill: none;
  pointer-events: none;
  transition: stroke-width 0.15s ease, filter 0.15s ease;
}

.canvas-svg-connector path.conn-hit-area:active + path.conn-visible-line,
.canvas-svg-connector path.conn-hit-area:hover + path.conn-visible-line {
  filter: drop-shadow(0 0 4px rgba(225, 29, 72, 0.45));
}

/* 单张拍立得（绝对定位·自由拖拽排版） */
.polaroid-box {
  position: absolute;
  background: #FFFFFF;
  padding: 9px 9px 18px 9px;
  border-radius: 3px;
  box-shadow: var(--polaroid-shadow);
  border: 1px solid rgba(0,0,0,0.06);
  width: 175px;
  cursor: grab;
  touch-action: none;
  z-index: 10;
  transition: box-shadow 0.2s ease, transform 0.15s ease-out;
}

.polaroid-box.is-dragging {
  cursor: grabbing;
  z-index: 60 !important;
  box-shadow: var(--polaroid-dragging-shadow);
  transform: scale(1.04) !important;
}

/* 长按激活连线源节点视觉反馈 */
.polaroid-box.is-connecting-source {
  box-shadow: 0 0 0 3px #E11D48, 0 12px 30px rgba(225, 29, 72, 0.3) !important;
  z-index: 80 !important;
  animation: pulseConnecting 1.6s infinite ease-in-out;
}

@keyframes pulseConnecting {
  0%, 100% { transform: scale(1.02); }
  50% { transform: scale(1.06); }
}

.polaroid-box.is-connecting-source::after {
  content: "🔗 连线起点";
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: #E11D48;
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.4);
  pointer-events: none;
}

/* 和纸胶带装饰 */
.washi-tape-polaroid {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 15px;
  background: var(--tape-yellow);
  opacity: 0.85;
  clip-path: polygon(4% 0%, 96% 0%, 100% 100%, 0% 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  pointer-events: none;
}

.polaroid-photo-inner {
  width: 100%;
  height: 145px;
  background: #F3EFE9;
  overflow: hidden;
  border-radius: 2px;
  cursor: pointer;
}

.polaroid-photo-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}

/* 拍立得下方手写 Caption (楷体深墨水灰·支持直接触碰输入) */
.polaroid-caption-input {
  width: 100%;
  border: none;
  border-bottom: 1px dashed transparent;
  background: transparent;
  outline: none;
  text-align: center;
  margin-top: 8px;
  padding: 4px 2px;
  font-size: 13px;
  color: var(--ink-handwritten);
  font-family: "PingFang SC", "Kaiti", "STKaiti", "楷体", serif;
  letter-spacing: 0.04em;
  cursor: text;
  transition: all 0.2s ease;
  border-radius: 2px;
  box-sizing: border-box;
}

.polaroid-caption-input:focus {
  border-bottom-color: rgba(180, 168, 150, 0.85);
  background: rgba(254, 240, 138, 0.25);
}

.polaroid-caption-input::placeholder {
  color: #C0B7A8;
  font-style: italic;
  font-size: 11px;
}

.polaroid-btn-remove {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 20px;
  height: 20px;
  background: #E11D48;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  display: none;
  z-index: 35;
}

.polaroid-box:hover .polaroid-btn-remove {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================= 随笔随手记 ================= */

.note-paper-section {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(180, 168, 150, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 14px;
}

.note-paper-textarea {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  line-height: 1.8;
  color: #38302A;
  resize: none;
  font-family: inherit;
  font-weight: 300;
  display: block;
  overflow: hidden;
}

.card-bottom-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 10px;
  padding-top: 4px;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.btn-card-action {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--ink-secondary);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-card-action:hover {
  color: #E11D48;
}

/* 卷轴末端温润极简页脚 */
.journal-footer {
  text-align: center;
  padding: 40px 0 20px 0;
  margin-top: 20px;
}

.footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed rgba(180, 168, 150, 0.45);
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 12px;
  margin-bottom: 12px;
}

.btn-footer-link {
  background: transparent;
  border: none;
  color: var(--ink-secondary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.15s ease;
}

.btn-footer-link:hover {
  color: #E11D48;
}

.footer-sep {
  color: var(--ink-muted);
  font-size: 11px;
}

.footer-whisper {
  font-size: 12px;
  color: var(--ink-muted);
  font-family: "PingFang SC", "Kaiti", "STKaiti", serif;
  letter-spacing: 0.05em;
  font-style: italic;
}

/* 全屏灯箱 (Lightbox) */
.lightbox-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(18, 15, 13, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.lightbox-modal.active { display: flex; }
.lightbox-content { max-width: 90vw; max-height: 85vh; display: flex; flex-direction: column; align-items: center; }
.lightbox-img { max-width: 100%; max-height: 75vh; object-fit: contain; border-radius: 4px; box-shadow: 0 20px 50px rgba(0,0,0,0.6); }
.lightbox-caption { color: #FAF7F2; margin-top: 14px; font-size: 14px; font-family: "PingFang SC", "Kaiti", serif; letter-spacing: 0.05em; }
.lightbox-close { position: absolute; top: 24px; right: 24px; color: #FFF; background: rgba(255,255,255,0.15); border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer; }

/* ================= 连线模式顶部提示条 ================= */
.conn-mode-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 150;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.conn-mode-toast.active {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(36, 32, 29, 0.94);
  color: #FAF7F2;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.toast-icon {
  font-size: 16px;
  margin-right: 6px;
}

.toast-text {
  flex: 1;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.toast-cancel-btn {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #FFF;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 10px;
  transition: background 0.15s ease;
}

.toast-cancel-btn:active {
  background: rgba(255, 255, 255, 0.35);
}

/* ================= 手账复古日历卡弹窗 (Bespoke Calendar Modal) ================= */
.calendar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(4px);
  z-index: 220;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.calendar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.calendar-modal-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 90%;
  max-width: 310px;
  background: #FAF7F2;
  border-radius: 20px;
  border: 1px solid rgba(215, 205, 190, 0.85);
  box-shadow: 0 16px 45px rgba(44, 40, 37, 0.22);
  z-index: 230;
  padding: 20px 16px 14px 16px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.calendar-modal-card.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.calendar-washi-tape {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%) rotate(0.8deg);
  width: 55px;
  height: 16px;
  background: var(--tape-pink);
  opacity: 0.88;
  clip-path: polygon(3% 0%, 97% 0%, 100% 100%, 0% 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.calendar-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cal-nav-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--ink-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.cal-nav-btn:hover { background: rgba(0,0,0,0.05); }

.cal-month-title {
  font-size: 15px;
  font-weight: 700;
  font-family: ui-monospace, "SF Pro Rounded", Futura, sans-serif;
  color: var(--ink-primary);
  letter-spacing: 0.04em;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-family: ui-monospace, sans-serif;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid transparent;
  color: var(--ink-primary);
  transition: all 0.15s ease;
}

.cal-day-cell:active { transform: scale(0.9); }
.cal-day-cell.other-month { color: #C8BFB2; }
.cal-day-cell.is-today { border-color: rgba(225, 29, 72, 0.5); font-weight: 700; color: #E11D48; }
.cal-day-cell.is-selected {
  background: #2C2825 !important;
  color: #FAF7F2 !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(44, 40, 37, 0.25);
}

.calendar-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(215, 205, 190, 0.6);
}

.cal-btn-text {
  background: none;
  border: none;
  font-size: 12px;
  color: #E11D48;
  cursor: pointer;
  font-weight: 600;
}

.cal-btn-done {
  background: #2C2825;
  color: #FAF7F2;
  border: none;
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
}

/* ================= 连线设计可无极拖拽高度抽屉 (Semi-sheet Resizable Drawer) ================= */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  z-index: 180;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.line-style-drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(105%);
  width: 100%;
  max-width: 520px;
  height: 330px; /* 默认半屏高度，上方画布一览无余 */
  min-height: 180px;
  max-height: 80vh;
  background: #FAF7F2;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -12px 48px rgba(36, 30, 24, 0.25);
  z-index: 190;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  border-top: 1px solid rgba(215, 205, 190, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.line-style-drawer.active {
  transform: translateX(-50%) translateY(0);
}

.drawer-handle-zone {
  width: 100%;
  padding: 8px 0 4px 0;
  cursor: ns-resize;
  touch-action: none;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.drawer-handle {
  width: 44px;
  height: 5px;
  background: #D8CEBE;
  border-radius: 999px;
  transition: all 0.2s;
}

.drawer-handle-zone:active .drawer-handle {
  background: #2C2825;
  width: 54px;
}

/* 顶部紧凑标头 */
.drawer-header-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px 10px 20px;
  border-bottom: 1px solid rgba(215, 205, 190, 0.4);
  flex-shrink: 0;
}

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.washi-pill-tag {
  background: var(--tape-yellow);
  color: #78350F;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 3px;
  transform: rotate(-1.5deg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.drawer-main-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-primary);
  letter-spacing: -0.01em;
}

.drawer-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--ink-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.15s;
}

.drawer-close-btn:hover {
  color: var(--ink-primary);
}

/* 实时手绘效果纸张预览卡片 */
.stroke-live-preview-card {
  margin: 12px 20px 6px 20px;
  background: #FFFFFF;
  border: 1px solid rgba(215, 205, 190, 0.6);
  border-radius: 14px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02), 0 2px 8px rgba(44,40,37,0.04);
  flex-shrink: 0;
}

.preview-line-wrap {
  flex: 1;
  height: 32px;
  display: flex;
  align-items: center;
  margin-right: 14px;
}

.preview-line-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.preview-ink-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #F8F5F0;
  border: 1px solid rgba(210, 200, 185, 0.6);
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.ink-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  border: 1.5px solid #FFFFFF;
}

.ink-name-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-primary);
  letter-spacing: 0.02em;
}

.ink-hex-label {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  color: var(--ink-muted);
}

/* 抽屉可滚动正文 */
.drawer-scroll-body {
  padding: 10px 20px 32px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.drawer-section {
  margin-bottom: 18px;
}

.section-label-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.section-num {
  font-size: 10px;
  font-family: ui-monospace, monospace;
  font-weight: 700;
  color: #B8AA98;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-secondary);
  letter-spacing: 0.03em;
}

.section-hint {
  font-size: 11px;
  color: var(--ink-muted);
  margin-left: auto;
}

/* 1. 线形切换 Tabs */
.style-pill-tabs {
  display: flex;
  gap: 8px;
}

.style-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #FFFFFF;
  border: 1px solid rgba(195, 185, 170, 0.45);
  padding: 8px 4px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  color: var(--ink-secondary);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.style-tab svg {
  color: currentColor;
}

.style-tab.active {
  background: #2C2825;
  color: #FFFFFF;
  border-color: #2C2825;
  box-shadow: 0 3px 10px rgba(44, 40, 37, 0.18);
  transform: translateY(-1px);
}

/* 2. 粗细切换 Tabs */
.width-pill-tabs {
  display: flex;
  gap: 8px;
}

.width-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #FFFFFF;
  border: 1px solid rgba(195, 185, 170, 0.45);
  padding: 8px 4px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  color: var(--ink-secondary);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.width-indicator {
  display: block;
  width: 24px;
  background: currentColor;
  border-radius: 999px;
}

.width-tab.active {
  background: #2C2825;
  color: #FFFFFF;
  border-color: #2C2825;
  box-shadow: 0 3px 10px rgba(44, 40, 37, 0.18);
  transform: translateY(-1px);
}

/* 3. 经典手账墨水瓷盘 (12色网格) */
.ink-wells-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.ink-well-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid rgba(210, 200, 185, 0.6);
  border-radius: 10px;
  padding: 6px 3px;
  cursor: pointer;
  position: relative;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.ink-well-btn:active {
  transform: scale(0.94);
}

.ink-well-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink-c);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.22), 0 1px 3px rgba(0,0,0,0.1);
  border: 1.5px solid #FFFFFF;
  margin-bottom: 4px;
  transition: transform 0.15s;
}

.ink-well-name {
  font-size: 10px;
  color: var(--ink-secondary);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.ink-well-btn.active {
  border-color: #2C2825;
  background: #F3EFE9;
  box-shadow: 0 0 0 2px #2C2825, 0 4px 12px rgba(44, 40, 37, 0.15);
  transform: translateY(-2px);
}

.ink-well-btn.active .ink-well-dot {
  transform: scale(1.12);
}

.ink-well-btn.active .ink-well-name {
  font-weight: 700;
  color: var(--ink-primary);
}

/* 4. 自调墨水色谱条 (纯原生、告别任何系统弹窗) */
.custom-mixer-section {
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed rgba(195, 185, 170, 0.7);
  border-radius: 14px;
  padding: 12px 14px;
}

.slider-control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-secondary);
  font-weight: 500;
}

.slider-val-tag {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: var(--ink-muted);
}

.custom-slider-track {
  position: relative;
  width: 100%;
  height: 20px;
  border-radius: 999px;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(255,255,255,0.8);
  border: 1.5px solid #FFFFFF;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.hue-track {
  background: linear-gradient(to right, 
    #FF0000 0%, #FF7F00 14%, #FFFF00 28%, #00FF00 42%, 
    #00FFFF 57%, #0000FF 71%, #8B00FF 85%, #FF007F 95%, #FF0000 100%);
}

.tone-track {
  background: linear-gradient(to right, #0A0908 0%, var(--pure-hue, #D97706) 50%, #FFFFFF 100%);
}

.custom-slider-track input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  margin: 0;
  outline: none;
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
}

.custom-slider-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid #2C2825;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  cursor: grab;
  transition: transform 0.1s ease;
}

.custom-slider-track input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
}

.custom-slider-track input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid #2C2825;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  cursor: grab;
}

/* 5. 底部操作按钮行 */
.drawer-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn-drawer-cut {
  flex: 0 0 38%;
  background: #FFF1F2;
  color: #E11D48;
  border: 1px dashed #FDA4AF;
  height: 42px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-drawer-cut:active {
  background: #FEE2E2;
  transform: scale(0.98);
}

.btn-drawer-done {
  flex: 1;
  background: #2C2825;
  color: #FAF7F2;
  border: none;
  height: 42px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(44, 40, 37, 0.2);
  transition: all 0.2s ease;
}

.btn-drawer-done:active {
  background: #191614;
  transform: scale(0.98);
}

/* ================= 背景效果调节工坊 (Background Studio Modal) ================= */
.bg-studio-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.5);
  backdrop-filter: blur(5px);
  z-index: 240;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.bg-studio-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.bg-studio-modal {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(105%);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  background: #FAF7F2;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -12px 48px rgba(36, 30, 24, 0.28);
  z-index: 250;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 12px 20px 32px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.bg-studio-modal.active {
  transform: translateX(-50%) translateY(0);
}

.bg-studio-handle {
  width: 40px;
  height: 4.5px;
  background: #D8CEBE;
  border-radius: 999px;
  margin: 0 auto 12px auto;
}

.bg-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(215, 205, 190, 0.45);
}

.bg-studio-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.bg-studio-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--ink-muted);
  cursor: pointer;
  line-height: 1;
}

/* 独立整体效果预览区（不带相片，纯粹看手账质感融合） */
.bg-studio-preview-card {
  position: relative;
  width: 100%;
  height: 160px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(215, 205, 190, 0.8);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(44,40,37,0.06);
  margin-bottom: 18px;
  background-color: var(--paper-bg);
}

.preview-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.preview-card-content {
  position: relative;
  z-index: 2;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.preview-sample-greeting {
  font-size: 18px;
  font-weight: 800;
  font-family: ui-monospace, Futura, sans-serif;
  color: var(--ink-primary);
  line-height: 1;
}

.preview-sample-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  background: rgba(255,255,255,0.7);
  border: 1px dashed rgba(180,168,150,0.5);
  padding: 2px 8px;
  border-radius: 999px;
  margin: 5px 0 8px 0;
  color: var(--ink-secondary);
}

.preview-sample-divider {
  width: 100%;
  height: 1px;
  background: rgba(180, 168, 150, 0.4);
  margin-bottom: 8px;
}

.preview-sample-date {
  font-size: 18px;
  font-weight: 800;
  font-family: ui-monospace, sans-serif;
  color: var(--ink-primary);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.preview-sample-date span {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}

.preview-sample-box {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.75);
  border: 1px dashed rgba(180, 168, 150, 0.6);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  color: var(--ink-secondary);
  text-align: center;
}

/* 滑杆区域 */
.bg-studio-controls {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(215, 205, 190, 0.6);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.bg-control-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bg-control-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-secondary);
  font-weight: 600;
}

.bg-control-val {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-primary);
  background: rgba(0,0,0,0.05);
  padding: 1px 6px;
  border-radius: 4px;
}

.bg-slider-track {
  position: relative;
  width: 100%;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(to right, rgba(250, 247, 242, 0.2), rgba(28, 25, 23, 0.8));
  border: 1.5px solid #FFFFFF;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
}

.bg-slider-track.brightness-track {
  background: linear-gradient(to right, #1A1715, #D97706, #FFFFFF);
}

.bg-slider-track input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  margin: 0;
  outline: none;
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
}

.bg-slider-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid #2C2825;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: grab;
}

.bg-slider-track input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid #2C2825;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: grab;
}

/* 操作按钮 */
.bg-studio-actions {
  display: flex;
  gap: 10px;
}

.btn-bg-reselect {
  flex: 0 0 40%;
  background: #FFFFFF;
  color: var(--ink-secondary);
  border: 1px solid rgba(195, 185, 170, 0.7);
  height: 44px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-bg-apply {
  flex: 1;
  background: #2C2825;
  color: #FAF7F2;
  border: none;
  height: 44px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(44, 40, 37, 0.2);
  transition: all 0.2s;
}
