/* 豆豆工坊 · 3 底 Tab 移动端手作拼豆小程序样式（严格遵循协议 2 安全区与右上角胶囊避让） */
:root {
  --wood-base: #E6C396;
  --cream: #FFFBF3;
  --cream-soft: #F6EBDA;
  --cream-line: rgba(164, 118, 72, 0.22);
  --ink-1: #442C1B;
  --ink-2: #7C5B42;
  --ink-3: #A48368;
  --coral: #E66858;
  --coral-deep: #BD4638;
  --coral-soft: rgba(230, 104, 88, 0.14);
  --sage: #4E9D64;
  --sky: #4B8FD9;
  --amber: #E99B38;
  --danger: #C9483B;

  --safe-top: var(--xb-safe-top, env(safe-area-inset-top, 0px));
  --safe-right: var(--xb-safe-right, env(safe-area-inset-right, 0px));
  --safe-bottom: var(--xb-safe-bottom, env(safe-area-inset-bottom, 0px));
  --safe-left: var(--xb-safe-left, env(safe-area-inset-left, 0px));
  --capsule-avoid-right: max(
    0px,
    calc(var(--xb-capsule-right, 0px) + var(--xb-capsule-width, 0px) + 8px - 14px)
  );

  --tabbar-h: 64px;
  --radius-lg: 20px;
  --radius-md: 15px;
  --radius-sm: 11px;
  --font-sans: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html, body {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-sans);
  color: var(--ink-1);
  background: var(--wood-base);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

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

button {
  cursor: pointer;
  border: 0;
  background: transparent;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

/* 铺满整个视口（含刘海和底部手势条后方）的暖阳橡木桌面 */
.wood-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #E3BC8B;
  background-image:
    radial-gradient(90% 55% at 15% 6%, rgba(255, 250, 238, 0.56), transparent 62%),
    radial-gradient(85% 55% at 88% 92%, rgba(188, 128, 72, 0.30), transparent 64%),
    url("../assets/shared/workbench/wood.webp");
  background-size: cover;
  background-position: center;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 宽屏桌面时居中呈精致竖屏/平板体验，制作台可放宽 */
.app-shell.mode-studio {
  max-width: 1080px;
}

/* ==================== 视图切换 ==================== */
.view {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  position: relative;
}

.view.active {
  display: flex;
}

.tab-header,
.sub-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(var(--safe-top) + 10px) calc(var(--safe-right) + 14px) 10px calc(var(--safe-left) + 14px);
  z-index: 6;
}

.capsule-avoid {
  padding-right: var(--capsule-avoid-right);
}

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

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(72, 43, 21, 0.22);
  border: 2px solid rgba(255, 252, 246, 0.9);
}

.brand-text strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.brand-text span {
  display: block;
  font-size: 11px;
  color: var(--ink-2);
  font-weight: 600;
  white-space: nowrap;
}

.page-title-block h1 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.page-title-block span {
  display: block;
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 2px;
}

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

.sub-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

/* 通用 44×44 触控圆按钮 */
.round-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 251, 243, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(72, 43, 21, 0.12);
  color: var(--ink-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s ease, background 0.14s ease;
  flex-shrink: 0;
}

.round-btn:active {
  transform: scale(0.93);
}

.sync-pill {
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 3px 10px rgba(72, 43, 21, 0.09);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.sync-dot.synced {
  background: var(--sage);
}

.count-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-1);
}

/* 按钮体系 */
.primary-btn {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, #EF7867, var(--coral));
  color: #FFFDF9;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(189, 70, 56, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.14s ease, filter 0.14s ease;
}

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

.secondary-btn {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(255, 251, 243, 0.92);
  border: 1px solid var(--cream-line);
  color: var(--ink-1);
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(72, 43, 21, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.14s ease;
}

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

.danger-btn {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(201, 72, 59, 0.11);
  border: 1px solid rgba(201, 72, 59, 0.28);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 800;
}

.primary-btn.compact,
.secondary-btn.compact {
  min-height: 38px;
  padding: 7px 13px;
  font-size: 12.5px;
  border-radius: 12px;
}

.full-width {
  width: 100%;
}

.text-btn {
  color: var(--coral);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==================== 滚动内容区 ==================== */
.tab-scroll,
.sub-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px calc(var(--safe-right) + 14px) calc(var(--tabbar-h) + var(--safe-bottom) + 22px) calc(var(--safe-left) + 14px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sub-scroll {
  padding-bottom: calc(var(--safe-bottom) + 26px);
}

/* ==================== Tab 1：大厅 ==================== */
.hero-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  min-height: 176px;
  box-shadow: 0 12px 26px rgba(72, 43, 21, 0.20);
  border: 2px solid rgba(255, 252, 246, 0.85);
}

.hero-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-scrim {
  position: relative;
  z-index: 1;
  min-height: 176px;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(44, 24, 12, 0.16) 0%, rgba(44, 24, 12, 0.10) 42%, rgba(44, 24, 12, 0.78) 100%);
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hero-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.90);
  color: var(--ink-1);
  font-size: 11px;
  font-weight: 800;
}

.hero-pill.subtle {
  background: rgba(68, 44, 27, 0.56);
  color: #FFFBF3;
  backdrop-filter: blur(8px);
}

.hero-bottom-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.hero-copy h1 {
  color: #FFFDF8;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.18;
  text-shadow: 0 2px 8px rgba(34, 16, 6, 0.45);
}

.hero-copy p {
  color: rgba(255, 248, 236, 0.92);
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 3px;
}

.hero-cta {
  flex-shrink: 0;
  padding: 9px 14px;
  font-size: 13px;
}

/* 三列核心玩法卡片 */
.feature-trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.trio-card {
  position: relative;
  text-align: left;
  padding: 12px 10px 11px;
  border-radius: 18px;
  background: rgba(255, 251, 243, 0.93);
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(72, 43, 21, 0.11);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.14s ease;
}

.trio-card:active {
  transform: scale(0.96);
}

.trio-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  color: #FFFDF9;
}

.trio-badge.coral { background: var(--coral); }
.trio-badge.sky { background: var(--sky); }
.trio-badge.sage { background: var(--sage); }

.trio-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.trio-free .trio-icon { background: rgba(230, 104, 88, 0.14); color: var(--coral); }
.trio-photo .trio-icon { background: rgba(75, 143, 217, 0.14); color: var(--sky); }
.trio-coop .trio-icon { background: rgba(78, 157, 100, 0.14); color: var(--sage); }

.trio-card strong {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-1);
}

.trio-card span:last-child {
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.3;
}

/* 续拼条 */
.resume-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 252, 245, 0.96), rgba(255, 241, 224, 0.94));
  border: 1.5px solid rgba(230, 104, 88, 0.30);
  box-shadow: 0 6px 16px rgba(72, 43, 21, 0.10);
}

.resume-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.resume-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--coral);
}

.resume-info strong {
  font-size: 14.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* 板块标题 */
.section-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.section-head h2 {
  font-size: 17px;
  font-weight: 800;
}

.section-head p {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 2px;
}

.section-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.82);
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-2);
}

/* 官方 4 款 50×50 精品卡片 */
.official-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pattern-card {
  text-align: left;
  border-radius: 20px;
  background: rgba(255, 251, 243, 0.95);
  border: 1.5px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(72, 43, 21, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease;
}

.pattern-card:active {
  transform: scale(0.97);
}

.pattern-thumb-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(circle at 50% 45%, #FFFFFF 0%, #FAF3E6 100%);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pattern-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 6px 10px rgba(68, 44, 27, 0.13));
}

.pattern-tag-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.92);
  border: 1px solid rgba(164, 118, 72, 0.2);
  font-size: 10px;
  font-weight: 800;
  color: var(--ink-1);
}

.pattern-done-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--sage);
  color: #FFFDF9;
  font-size: 10px;
  font-weight: 800;
}

.pattern-card-body {
  padding: 10px 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pattern-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pattern-card-title strong {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pattern-card-sub {
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pattern-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
}

.theme-dots {
  display: inline-flex;
  gap: 4px;
}

.theme-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(68, 44, 27, 0.16);
}

.pattern-mini-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(164, 118, 72, 0.16);
  overflow: hidden;
  margin-top: 2px;
}

.pattern-mini-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--coral);
}

/* ==================== Tab 2：收藏软木板 ==================== */
.filter-pills {
  flex: 0 0 auto;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 calc(var(--safe-right) + 14px) 10px calc(var(--safe-left) + 14px);
  scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar { display: none; }

.filter-pill {
  flex-shrink: 0;
  min-height: 36px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
}

.filter-pill.active {
  background: var(--ink-1);
  color: #FFFBF3;
  border-color: var(--ink-1);
}

.corkboard-frame {
  flex: 1 0 auto;
  min-height: 380px;
  border-radius: 22px;
  padding: 16px 13px 22px;
  background:
    radial-gradient(rgba(120, 74, 34, 0.16) 1.1px, transparent 1.2px) 0 0 / 12px 12px,
    radial-gradient(rgba(255, 234, 198, 0.25) 1px, transparent 1.2px) 6px 6px / 12px 12px,
    linear-gradient(155deg, #D3A06A, #BE8752);
  border: 6px solid #8D5C34;
  box-shadow: inset 0 4px 16px rgba(68, 36, 12, 0.32), 0 10px 24px rgba(72, 43, 21, 0.18);
}

.corkboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.polaroid-card {
  position: relative;
  text-align: left;
  background: #FFFDF8;
  border-radius: 8px;
  padding: 10px 10px 12px;
  box-shadow: 0 8px 18px rgba(56, 30, 10, 0.28);
  transform: rotate(var(--tilt, -1deg));
  transition: transform 0.16s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.polaroid-card:active {
  transform: scale(0.96) rotate(0deg);
}

.pushpin {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--pin, var(--coral));
  box-shadow: 0 3px 5px rgba(42, 20, 8, 0.4), inset 0 2px 3px rgba(255, 255, 255, 0.55);
}

.polaroid-window {
  aspect-ratio: 1 / 1;
  border-radius: 5px;
  background:
    radial-gradient(rgba(164, 118, 72, 0.14) 1px, transparent 1px) 0 0 / 10px 10px,
    #FAF4E8;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.polaroid-window img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.polaroid-card strong {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.polaroid-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--ink-2);
  font-weight: 700;
}

.cork-empty {
  text-align: center;
  padding: 34px 16px;
  color: #FFFBF3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-polaroid {
  width: 72px;
  height: 78px;
  border-radius: 8px;
  background: rgba(255, 251, 243, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transform: rotate(-4deg);
  box-shadow: 0 8px 18px rgba(56, 30, 10, 0.25);
}

.cork-empty strong {
  font-size: 16px;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(56, 30, 10, 0.35);
}

.cork-empty p {
  font-size: 12.5px;
  line-height: 1.5;
  max-width: 280px;
  color: rgba(255, 251, 243, 0.94);
}

.empty-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==================== Tab 3：我的 ==================== */
.account-card {
  padding: 15px 14px;
  border-radius: 20px;
  background: rgba(255, 251, 243, 0.94);
  border: 1.5px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(72, 43, 21, 0.11);
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--coral);
  color: #FFFDF9;
  font-size: 21px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(189, 70, 56, 0.25);
}

.account-meta {
  flex: 1;
  min-width: 0;
}

.account-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.account-name-row strong {
  font-size: 16px;
  font-weight: 800;
}

.account-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(164, 118, 72, 0.15);
  color: var(--ink-2);
}

.account-badge.synced {
  background: rgba(78, 157, 100, 0.16);
  color: var(--sage);
}

.account-meta p {
  font-size: 11.5px;
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.4;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stat-tile {
  padding: 12px 6px;
  border-radius: 16px;
  background: rgba(255, 251, 243, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.92);
  text-align: center;
  box-shadow: 0 4px 12px rgba(72, 43, 21, 0.08);
}

.stat-tile strong {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: var(--ink-1);
}

.stat-tile span {
  display: block;
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 2px;
  font-weight: 700;
}

.mine-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 251, 243, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 16px rgba(72, 43, 21, 0.09);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.mine-card-head h3 {
  font-size: 15px;
  font-weight: 800;
}

.mine-card-head p {
  font-size: 11.5px;
  color: var(--ink-2);
  margin-top: 1px;
}

.mini-pill {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--cream-soft);
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-2);
  white-space: nowrap;
  flex-shrink: 0;
}

.drafts-list,
.shared-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.draft-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 13px;
  background: var(--cream-soft);
}

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

.draft-row-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draft-row-info span {
  display: block;
  font-size: 11.5px;
  color: var(--ink-2);
  margin-top: 2px;
}

.draft-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.empty-inline {
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
  padding: 12px 4px;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.setting-row strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
}

.setting-row span {
  display: block;
  font-size: 11.5px;
  color: var(--ink-2);
}

.toggle-switch {
  appearance: none;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(164, 118, 72, 0.28);
  position: relative;
  cursor: pointer;
  transition: background 0.16s ease;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFDF9;
  box-shadow: 0 2px 5px rgba(68, 44, 27, 0.24);
  transition: transform 0.16s ease;
}

.toggle-switch:checked {
  background: var(--coral);
}

.toggle-switch:checked::after {
  transform: translateX(20px);
}

/* ==================== 底部三 Tab 导航栏（24×24 双色 SVG + 56×32 胶囊） ==================== */
.bottom-tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 680px;
  z-index: 20;
  padding: 6px calc(var(--safe-right) + 12px) calc(var(--safe-bottom) + 8px) calc(var(--safe-left) + 12px);
  background: rgba(255, 251, 243, 0.94);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(164, 118, 72, 0.18);
  box-shadow: 0 -8px 24px rgba(72, 43, 21, 0.10);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.tab-item {
  min-height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-2);
  transition: color 0.15s ease;
}

.tab-pill {
  position: relative;
  width: 56px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, transform 0.16s ease;
}

.tab-pill .svg-fill {
  fill: transparent;
  transition: fill 0.16s ease;
}

.tab-item.active {
  color: var(--coral-deep);
}

.tab-item.active .tab-pill {
  background: var(--coral-soft);
  color: var(--coral);
}

.tab-item.active .tab-pill .svg-fill {
  fill: rgba(230, 104, 88, 0.24);
}

.tab-label {
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
}

.tab-badge {
  position: absolute;
  top: 1px;
  right: 7px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--coral);
  color: #FFFDF9;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==================== 二级全屏：制作台 ==================== */
.studio-title-wrap {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.studio-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-title-row strong {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-edit-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 251, 243, 0.85);
  font-size: 12px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.studio-progress-num {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-2);
  flex-shrink: 0;
}

.sub-desc {
  font-size: 11.5px;
  color: var(--ink-2);
}

.studio-meter {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.72);
  overflow: hidden;
  max-width: 190px;
}

.studio-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--coral));
  transition: width 0.2s ease;
}

/* 双人状态条 */
.coop-ribbon {
  flex: 0 0 auto;
  margin: 0 12px 6px;
  padding: 7px 10px;
  border-radius: 14px;
  background: rgba(255, 251, 243, 0.90);
  border: 1px solid rgba(78, 157, 100, 0.30);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.coop-ribbon-left,
.coop-ribbon-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.room-code-chip {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(78, 157, 100, 0.14);
  color: #2E6F42;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.live-dot.online {
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(78, 157, 100, 0.24);
}

.coop-score-pill {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-2);
  white-space: nowrap;
}

.mini-action-btn {
  padding: 5px 9px;
  min-height: 30px;
  border-radius: 999px;
  background: var(--cream-soft);
  border: 1px solid var(--cream-line);
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-1);
  white-space: nowrap;
  flex-shrink: 0;
}

.mini-action-btn.active {
  background: var(--sky);
  border-color: var(--sky);
  color: #FFFFFF;
}

.sticker-drawer {
  flex: 0 0 auto;
  margin: 0 12px 6px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 251, 243, 0.94);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sticker-drawer::-webkit-scrollbar { display: none; }

.sticker-btn {
  flex-shrink: 0;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--cream-soft);
  font-size: 12px;
  font-weight: 700;
}

/* 豆板画布舞台 */
.board-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  touch-action: none;
}

#beadCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* 左上参考图小卡 + 右上垫底图开关 */
.studio-ref-bar,
.free-float-bar {
  position: absolute;
  top: 6px;
  left: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.studio-ref-bar > *,
.free-float-bar > * {
  pointer-events: auto;
}

.ref-card-pin {
  position: relative;
  width: 70px;
  height: 70px;
  padding: 4px;
  border-radius: 12px;
  background: #FFFDF8;
  box-shadow: 0 8px 18px rgba(68, 44, 27, 0.22);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  transform: rotate(-2deg);
}

.ref-card-pin canvas {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  display: block;
}

.ref-tape {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(2deg);
  width: 30px;
  height: 12px;
  border-radius: 3px;
  background: rgba(246, 224, 178, 0.82);
}

.ref-zoom-badge {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink-1);
  color: #FFFDF8;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ref-bar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.underlay-toggle {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 14px rgba(68, 44, 27, 0.14);
  color: var(--ink-1);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.underlay-toggle[aria-pressed="true"] {
  background: var(--coral);
  color: #FFFDF9;
  border-color: var(--coral);
}

.ref-tip-text {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(68, 44, 27, 0.56);
  color: #FFFDF8;
  font-size: 10.5px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.free-size-pill {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 12px rgba(68, 44, 27, 0.12);
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-1);
}

/* 舞台提示气泡 */
.stage-hint {
  position: absolute;
  bottom: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(68, 44, 27, 0.82);
  color: #FFFDF8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

/* 左下全景/聚焦 & 右下熨烫按钮 */
.corner-pill {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 6;
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 16px rgba(68, 44, 27, 0.16);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.corner-right-stack {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
}

.corner-fab {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 251, 243, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 16px rgba(68, 44, 27, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-1);
}

.iron-fab {
  min-height: 44px;
  padding: 9px 15px;
  border-radius: 999px;
  background: linear-gradient(180deg, #F07B6B, var(--coral));
  color: #FFFDF9;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(189, 70, 56, 0.34);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.iron-fab.empty {
  background: rgba(255, 251, 243, 0.86);
  color: var(--ink-3);
  box-shadow: 0 4px 12px rgba(68, 44, 27, 0.10);
}

.iron-fab.ready-pulse {
  animation: pulseCoral 1.4s infinite ease-in-out;
}

@keyframes pulseCoral {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 20px rgba(230, 104, 88, 0.36); }
  50% { transform: scale(1.06); box-shadow: 0 10px 26px rgba(230, 104, 88, 0.56); }
}

.peel-prompt {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
}

.peel-btn {
  min-height: 46px;
  padding: 11px 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #F28268, var(--coral));
  color: #FFFDF9;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(189, 70, 56, 0.42);
  white-space: nowrap;
  animation: pulseCoral 1.4s infinite ease-in-out;
}

/* ==================== 底部手作豆盒托盘 ==================== */
.craft-tray {
  flex: 0 0 auto;
  background: rgba(255, 251, 243, 0.95);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 26px rgba(72, 43, 21, 0.14);
  padding: 10px calc(var(--safe-right) + 12px) calc(var(--safe-bottom) + 10px) calc(var(--safe-left) + 12px);
}

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

.mode-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  background: rgba(164, 118, 72, 0.14);
  gap: 2px;
}

.mode-btn {
  min-height: 36px;
  padding: 5px 9px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.mode-btn.active {
  background: #FFFDF9;
  color: var(--ink-1);
  box-shadow: 0 2px 6px rgba(68, 44, 27, 0.12);
}

.drag-cue-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tray-quick-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tray-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--cream-soft);
  color: var(--ink-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tray-icon-btn.active {
  background: var(--coral);
  color: #FFFDF9;
}

.palette-cats {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.palette-cats::-webkit-scrollbar { display: none; }

.palette-cat-btn {
  flex-shrink: 0;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--cream-soft);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
}

.palette-cat-btn.active {
  background: var(--ink-1);
  color: #FFFDF9;
}

/* 透明分格豆盒 & 1:1 柔光圆孔豆粒 */
.bead-box {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 4px;
  scrollbar-width: none;
  touch-action: pan-x;
}

.bead-box::-webkit-scrollbar { display: none; }

.bead-slot {
  flex: 0 0 60px;
  padding: 7px 4px 6px;
  border-radius: 14px;
  background: rgba(246, 235, 218, 0.72);
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  touch-action: none;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.bead-slot.selected {
  background: #FFFDF9;
  border-color: var(--coral);
  box-shadow: 0 5px 14px rgba(230, 104, 88, 0.22);
  transform: translateY(-2px);
}

.bead-slot.done {
  opacity: 0.48;
}

.bead-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bead-hex, #E66858);
  position: relative;
  box-shadow:
    inset 0 4px 5px rgba(255, 255, 255, 0.42),
    inset 0 -4px 6px rgba(42, 20, 10, 0.22);
}

.bead-swatch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 252, 246, 0.94);
  box-shadow: inset 0 1px 2px rgba(42, 20, 10, 0.22);
}

.bead-slot-name {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ink-1);
  max-width: 54px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bead-slot-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-2);
}

/* 熨烫状态卡 */
.iron-status-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.iron-ring-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.iron-ring {
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(164, 118, 72, 0.18);
  stroke-width: 6;
}

.ring-fill {
  fill: none;
  stroke: var(--coral);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.12s linear;
}

.iron-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
}

.iron-copy {
  flex: 1;
  min-width: 0;
}

.iron-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.iron-copy p {
  font-size: 11.5px;
  color: var(--ink-2);
  margin-top: 2px;
}

.iron-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

/* ==================== 照片转拼豆页面 ==================== */
.photo-preview-card {
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 251, 243, 0.95);
  border: 1.5px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(72, 43, 21, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.photo-preview-stage {
  position: relative;
  width: min(100%, 290px);
  aspect-ratio: 1 / 1;
}

#photoPreviewCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 14px;
  background: #FAF4E8;
  border: 1px solid rgba(164, 118, 72, 0.20);
  cursor: zoom-in;
}

.preview-zoom-pill {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(68, 44, 27, 0.78);
  color: #FFFDF8;
  font-size: 11.5px;
  font-weight: 800;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 10px rgba(42, 20, 8, 0.22);
}

.photo-preview-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.photo-preview-badges span {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cream-soft);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-2);
}

.photo-source-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-btn {
  width: 100%;
  cursor: pointer;
}

.sample-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sample-chip {
  padding: 9px 8px;
  border-radius: 13px;
  background: rgba(255, 251, 243, 0.92);
  border: 1.5px solid transparent;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-1);
}

.sample-chip.active {
  border-color: var(--coral);
  background: #FFFDF9;
  color: var(--coral-deep);
}

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

.control-group label {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-1);
}

.control-group.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
}

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

input[type="range"] {
  width: 100%;
  accent-color: var(--coral);
  height: 28px;
}

.seg-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.seg-pill {
  min-height: 36px;
  border-radius: 10px;
  background: var(--cream-soft);
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-2);
}

.seg-pill.active {
  background: var(--ink-1);
  color: #FFFDF9;
}

.custom-grid-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.custom-grid-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 11px;
  background: var(--cream-soft);
  border: 1.5px solid var(--cream-line);
}

.custom-grid-field span {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-2);
  flex-shrink: 0;
}

.custom-grid-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-1);
  outline: none;
  text-align: center;
}

.custom-grid-sep {
  font-size: 14px;
  font-weight: 900;
  color: var(--ink-2);
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.bill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.bill-chip {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--cream-soft);
  border: 1.5px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
}

.bill-chip.active {
  border-color: var(--coral);
  background: #FFFDF9;
}

.bill-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(68, 44, 27, 0.18);
  flex-shrink: 0;
}

/* ==================== 双人合拼大厅 ==================== */
.coop-pattern-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.coop-pick-item {
  padding: 9px;
  border-radius: 14px;
  background: var(--cream-soft);
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
}

.coop-pick-item.active {
  background: #FFFDF9;
  border-color: var(--coral);
}

.coop-pick-item img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: #FFFDF8;
  padding: 3px;
}

.coop-pick-item strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.coop-pick-item span {
  display: block;
  font-size: 11px;
  color: var(--ink-2);
}

.coop-create-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.generated-room-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--cream-soft);
}

.generated-room-code span {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
}

.generated-room-code strong {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--ink-1);
}

.coop-join-row {
  display: flex;
  gap: 8px;
}

.text-input {
  flex: 1;
  min-height: 44px;
  padding: 0 13px;
  border-radius: 13px;
  border: 1.5px solid var(--cream-line);
  background: #FFFDF9;
  font-size: 14px;
  font-weight: 700;
  outline: none;
}

.text-input:focus {
  border-color: var(--coral);
}

/* ==================== 模态弹窗 ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(42, 24, 12, 0.56);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 88dvh;
  overflow-y: auto;
  border-radius: 24px;
  background: #FFFBF3;
  padding: 20px 18px calc(var(--safe-bottom) + 18px);
  box-shadow: 0 20px 44px rgba(34, 16, 6, 0.32);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream-soft);
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.complete-badge {
  align-self: flex-start;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--coral-soft);
  color: var(--coral-deep);
  font-size: 12px;
  font-weight: 800;
}

.complete-preview-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 240px;
  border-radius: 16px;
  background:
    radial-gradient(rgba(164, 118, 72, 0.14) 1px, transparent 1px) 0 0 / 12px 12px,
    #FAF4E8;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.complete-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.complete-title-input {
  width: 100%;
  text-align: center;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--cream-line);
  background: #FFFFFF;
  font-size: 17px;
  font-weight: 800;
}

.complete-stats {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 700;
}

.complete-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

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

.poster-img-wrap {
  border-radius: 14px;
  overflow: hidden;
  background: #EFE4D2;
  max-height: 54dvh;
  display: flex;
  justify-content: center;
}

.poster-img-wrap img {
  width: 100%;
  height: auto;
  max-height: 54dvh;
  object-fit: contain;
}

.ref-sheet-head h3 {
  font-size: 16px;
  font-weight: 800;
  padding-right: 36px;
}

.ref-sheet-head span {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 700;
}

.ref-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--cream-line);
  background: #FFFDF8;
  touch-action: none;
}

.ref-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

.ref-canvas-wrap canvas:active {
  cursor: grabbing;
}

.ref-zoom-controls {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 251, 243, 0.94);
  border: 1px solid rgba(164, 118, 72, 0.26);
  box-shadow: 0 5px 14px rgba(68, 44, 27, 0.18);
}

.ref-zoom-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cream-soft);
  color: var(--ink-1);
  font-size: 18px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ref-zoom-btn:active {
  transform: scale(0.92);
}

.ref-zoom-pct {
  min-width: 50px;
  height: 34px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-1);
}

.ref-modal-tip {
  font-size: 11.5px;
  color: var(--ink-2);
  text-align: center;
}

.sheet-sub {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}

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

.login-form label {
  font-size: 12.5px;
  font-weight: 800;
}

.avatar-color-row {
  display: flex;
  gap: 12px;
}

.color-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--dot);
  border: 3px solid transparent;
  box-shadow: 0 3px 8px rgba(68, 44, 27, 0.18);
}

.color-dot.active {
  border-color: var(--ink-1);
  transform: scale(1.1);
}

.menu-action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-row-btn {
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 13px;
  background: var(--cream-soft);
  text-align: left;
  font-size: 14px;
  font-weight: 800;
}

.menu-row-btn.danger {
  background: rgba(201, 72, 59, 0.12);
  color: var(--danger);
}

/* 轻提示 Toast */
.toast {
  position: fixed;
  top: calc(var(--safe-top) + 64px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(68, 44, 27, 0.90);
  color: #FFFDF8;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(34, 16, 6, 0.25);
  max-width: calc(100vw - 32px);
  text-align: center;
}

@media (min-width: 720px) {
  .modal-backdrop {
    align-items: center;
  }
  .official-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 370px) {
  .feature-trio {
    gap: 7px;
  }
  .trio-card {
    padding: 10px 8px;
  }
  .trio-card strong {
    font-size: 12.5px;
  }
}

/* ==================== 焕新「我的」页、分享导入与多人房样式 ==================== */
.section-chip.clickable {
  background: rgba(255, 251, 243, 0.94);
  border: 1px solid var(--cream-line);
  color: var(--coral-deep);
  cursor: pointer;
}

.profile-hero-card {
  padding: 16px 15px 14px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 252, 245, 0.97), rgba(252, 238, 218, 0.94));
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(72, 43, 21, 0.12);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.craft-rank-box {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(164, 118, 72, 0.14);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.craft-rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
}

.craft-rank-title {
  color: var(--ink-1);
}

.craft-rank-next {
  color: var(--ink-2);
  font-weight: 700;
}

.craft-rank-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(164, 118, 72, 0.16);
  overflow: hidden;
}

.craft-rank-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--coral));
  transition: width 0.25s ease;
}

.profile-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.storage-summary-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
}

.profile-btn-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.stat-tile.interactive {
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.stat-tile.interactive:active {
  transform: scale(0.96);
}

.import-banner-card {
  padding: 13px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 252, 245, 0.96), rgba(235, 244, 255, 0.92));
  border: 1.5px solid rgba(75, 143, 217, 0.28);
  box-shadow: 0 6px 16px rgba(72, 43, 21, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.import-banner-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.import-banner-copy strong {
  font-size: 14px;
  font-weight: 800;
}

.import-banner-copy span {
  font-size: 11.5px;
  color: var(--ink-2);
}

.import-banner-card .primary-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.mine-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.draft-filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.draft-filter-row::-webkit-scrollbar { display: none; }

.mini-filter {
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--cream-soft);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 800;
}

.mini-filter.active {
  background: var(--ink-1);
  color: #FFFDF9;
}

.draft-mode-badge {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.draft-mode-badge.official { background: rgba(233, 155, 56, 0.18); }
.draft-mode-badge.free { background: rgba(230, 104, 88, 0.16); }
.draft-mode-badge.photo { background: rgba(75, 143, 217, 0.16); }
.draft-mode-badge.coop { background: rgba(78, 157, 100, 0.18); }

.draft-mini-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(164, 118, 72, 0.18);
  overflow: hidden;
  margin-top: 5px;
  max-width: 150px;
}

.draft-mini-bar span {
  display: block;
  height: 100%;
  background: var(--coral);
  border-radius: 999px;
}

/* 多人合拼大厅三模式 & 房主审批条 */
.coop-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.coop-free-setup {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coop-free-setup label {
  font-size: 12.5px;
  font-weight: 800;
}

.coop-photo-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  background: var(--cream-soft);
}

#coopPhotoMiniCanvas {
  width: 78px;
  height: 78px;
  border-radius: 10px;
  background: #FFFDF8;
  border: 1px solid var(--cream-line);
  flex-shrink: 0;
}

.coop-photo-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.coop-photo-meta strong {
  font-size: 13.5px;
  font-weight: 800;
}

.coop-photo-meta span {
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.35;
}

.coop-photo-btns {
  display: flex;
  gap: 7px;
  margin-top: 3px;
}

.coop-members-pill {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--cream-soft);
  border: 1px solid var(--cream-line);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-1);
  white-space: nowrap;
  flex-shrink: 0;
}

.member-dots {
  display: inline-flex;
  align-items: center;
}

.member-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #FFFBF3;
  margin-left: -3px;
  display: inline-block;
}

.member-dots i:first-child {
  margin-left: 0;
}

.approval-ribbon {
  flex: 0 0 auto;
  margin: 0 12px 6px;
  padding: 8px 11px;
  border-radius: 14px;
  background: linear-gradient(135deg, #FFF5EC, #FFEAE5);
  border: 1.5px solid rgba(230, 104, 88, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.approval-text {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-1);
}

.approval-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.mini-approve-btn {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--sage);
  color: #FFFDF9;
  font-size: 12px;
  font-weight: 800;
}

.mini-reject-btn {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(201, 72, 59, 0.14);
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.pending-ribbon {
  flex: 0 0 auto;
  margin: 0 12px 6px;
  padding: 8px 12px;
  border-radius: 13px;
  background: rgba(233, 155, 56, 0.22);
  border: 1px solid rgba(233, 155, 56, 0.45);
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-1);
  text-align: center;
}

/* 导入图纸弹窗 & 成员列表弹窗 */
.import-input-row {
  display: flex;
  gap: 8px;
}

.import-preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

#importPreviewCanvas {
  width: min(100%, 240px);
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid var(--cream-line);
  background: #FFFDF8;
}

.host-policy-box {
  padding: 12px;
  border-radius: 14px;
  background: var(--cream-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 13px;
  background: var(--cream-soft);
}

.member-row-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.member-avatar-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #FFFDF9;
  font-size: 13px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.member-row-left strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
}

.member-row-left span {
  display: block;
  font-size: 11px;
  color: var(--ink-2);
}

.member-row-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

/* 统一账号登录 / 注册弹窗增强样式 */
.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.code-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.code-input-row .secondary-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.auth-error-banner {
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(201, 72, 59, 0.12);
  border: 1px solid rgba(201, 72, 59, 0.30);
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
}

.register-hint-box {
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(78, 157, 100, 0.14);
  color: #2B6D3F;
  font-size: 12.5px;
  font-weight: 700;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--cream-line);
}

/* ==================== 制作台容器：手机竖屏上下，PC 宽屏左右工作台 ==================== */
.studio-workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 900px) {
  .app-shell.mode-studio {
    max-width: 1260px;
  }

  .studio-workspace {
    flex-direction: row;
    gap: 12px;
    padding: 0 14px 14px;
  }

  .board-stage {
    border-radius: 22px;
    background: rgba(255, 251, 243, 0.16);
  }

  .craft-tray {
    width: 318px;
    flex: 0 0 318px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 28px rgba(72, 43, 21, 0.14);
    padding: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .tray-placing {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
  }

  .bead-box {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-content: start;
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    gap: 8px;
    padding: 4px 2px;
  }

  .bead-slot {
    flex: none;
    width: 100%;
  }

  .iron-status-card {
    flex-direction: column;
    text-align: center;
    padding: 10px 4px;
  }

  .iron-actions {
    width: 100%;
    flex-direction: row;
    justify-content: center;
  }
}
