﻿/* ============================================================
   Butterfly 子页面样式 — 朱砂古风、无框、手机端
   ============================================================ */

/* ── 视图容器与转场 ── */
.view-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.view-layer.is-open { pointer-events: auto; }

/* 子页面打开时，提示条要浮在视图之上 */
.toast { z-index: 100; }
.view-shell {
  position: absolute; inset: 0;
  max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.6) 0%, transparent 60%),
    linear-gradient(180deg, #f9f5ec 0%, #f1e9da 100%);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1), filter .28s ease;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  will-change: transform;
}
.view-shell.is-active { transform: translateX(0); }
.view-shell.is-behind { filter: brightness(.94) saturate(.9); }

.view-bar {
  position: relative;
  flex: none;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  border-bottom: 1px dashed rgba(74,46,40,.16);
}
.view-back {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; background: transparent;
  color: var(--hint, #6b544d); cursor: pointer;
  border-radius: 12px;
  transition: transform .15s ease, background .15s ease;
}
.view-back:active { transform: scale(.9); background: rgba(74,46,40,.06); }
.view-title {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 136px);
  margin: 0;
  font-size: 17px; font-weight: 600;
  letter-spacing: .16em; color: var(--ink, #2c1b18);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.view-action { display: flex; justify-content: flex-end; margin-left: auto; padding-right: 2px; }
.view-action button {
  border: 0; background: transparent; cursor: pointer;
  color: var(--vermilion, #9e2e2b);
  font-size: 14px; letter-spacing: .1em;
  min-height: 44px; padding: 10px 8px; border-radius: 10px;
}
.view-action button:active { background: rgba(158,46,43,.08); }

.view-body {
  flex: 1; min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.view-body.no-pad { padding: 0; overflow: hidden; }

/* ── 分组与卡片 ── */
.pane {
  border: 1px solid rgba(74,46,40,.16);
  border-radius: 18px;
  background: rgba(255,253,248,.72);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.pane-title {
  font-size: 12px; letter-spacing: .18em;
  color: var(--hint, #6b544d); margin: 0 0 2px;
}
.pane-hint {
  font-size: 12px; line-height: 1.6;
  color: var(--hint, #6b544d); letter-spacing: .04em;
}

/* ── 表单 ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; letter-spacing: .12em; color: var(--hint, #6b544d); }
.field input, .field textarea, .field select {
  width: 100%;
  font: inherit; font-size: 14px;
  color: var(--ink, #2c1b18);
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(74,46,40,.2);
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.65; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: rgba(158,46,43,.55);
  box-shadow: 0 0 0 3px rgba(158,46,43,.08);
}
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; min-width: 0; }

/* ── 自绘下拉 ── */
.select-box {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font: inherit; font-size: 14px; text-align: left;
  color: var(--ink, #2c1b18);
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(74,46,40,.2);
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .15s ease;
}
.select-box:active { transform: scale(.99); }
.select-box:focus-visible { border-color: rgba(158,46,43,.55); }
.select-value {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.select-value.is-placeholder { color: var(--hint, #6b544d); }
.select-arrow {
  flex: none; display: grid; place-items: center;
  color: var(--hint, #6b544d); transition: transform .2s ease;
}
.select-box:active .select-arrow { transform: translateY(1px); }

.picker-overlay { position: fixed; inset: 0; z-index: 95; }
.picker-backdrop {
  position: absolute; inset: 0;
  background: rgba(30,16,14,0);
  transition: background .26s ease;
}
.picker-overlay.is-active .picker-backdrop { background: rgba(30,16,14,.42); }
.picker-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 480px; margin: 0 auto;
  max-height: 68dvh;
  display: flex; flex-direction: column;
  background: var(--panel, #fcf9f2);
  border-radius: 22px 22px 0 0;
  border-top: 1px solid rgba(74,46,40,.18);
  box-shadow: 0 -12px 34px rgba(44,27,24,.22);
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(102%);
  transition: transform .28s cubic-bezier(.32,.72,.28,1);
}
.picker-overlay.is-active .picker-sheet { transform: translateY(0); }
.picker-head {
  flex: none;
  padding: 16px 20px 10px;
  font-size: 12px; letter-spacing: .18em; color: var(--hint, #6b544d);
  border-bottom: 1px dashed rgba(74,46,40,.14);
}
.picker-list { overflow-y: auto; padding: 6px 10px 14px; }
.picker-item {
  width: 100%; text-align: left;
  font: inherit; font-size: 14.5px; letter-spacing: .06em;
  color: var(--ink, #2c1b18);
  background: transparent;
  border: 0; border-radius: 12px;
  padding: 13px 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: background .15s ease;
}
.picker-item:active { background: rgba(74,46,40,.06); }
.picker-item.is-on { color: var(--vermilion, #9e2e2b); }
.picker-item.is-on::after {
  content: ''; flex: none;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--vermilion, #9e2e2b);
}

/* ── 自绘开关 ── */
.switch-row { width: 100%; text-align: left; background: transparent; border: 0; }
.switch {
  flex: none;
  width: 44px; height: 26px; border-radius: 999px;
  background: rgba(74,46,40,.16);
  border: 1px solid rgba(74,46,40,.16);
  display: flex; align-items: center;
  padding: 2px;
  transition: background .22s ease, border-color .22s ease;
}
.switch-knob {
  width: 20px; height: 20px; border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 1px 3px rgba(44,27,24,.28);
  transition: transform .22s cubic-bezier(.32,.72,.28,1);
}
.switch-row.is-on .switch {
  background: radial-gradient(circle at 35% 30%, #b33935, #751d1b 85%);
  border-color: #6e1c1a;
}
.switch-row.is-on .switch-knob { transform: translateX(18px); }

/* ── 搜索框的自绘清除键 ── */
.search-clear {
  flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--hint, #6b544d); background: rgba(74,46,40,.07);
  border: 0; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.search-clear:active { background: rgba(158,46,43,.12); color: var(--vermilion, #9e2e2b); }

/* ── 列表搜索行 ── */
.list-search {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  min-height: 48px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(74,46,40,.18);
  border-radius: 12px;
}
.list-search input {
  flex: 1; min-width: 0;
  align-self: stretch;
  border: 0; background: transparent; outline: none;
  font: inherit; font-size: 14px; color: var(--ink, #2c1b18);
  padding: 0;
}
.list-search input::placeholder { color: var(--hint, #6b544d); }
.list-search .search-clear { width: 30px; height: 30px; }

/* ── 加载态 ── */
.loading {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 34px 0;
  color: var(--hint, #6b544d);
}
.loading-dots { display: flex; gap: 7px; }
.loading-dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--vermilion, #9e2e2b);
  opacity: .3;
  animation: bf-breathe 1.1s ease-in-out infinite;
}
.loading-dots i:nth-child(2) { animation-delay: .16s; }
.loading-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes bf-breathe {
  0%, 100% { opacity: .25; transform: translateY(0); }
  50% { opacity: .85; transform: translateY(-3px); }
}
.loading-text { font-size: 12.5px; letter-spacing: .12em; }

/* ── 空状态 ── */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px 20px;
  text-align: center;
}
.empty-mark {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 18px; letter-spacing: .06em;
  color: var(--vermilion, #9e2e2b);
  border: 1px dashed rgba(158,46,43,.48);
  background: rgba(255,255,255,.5);
}
.empty-text { font-size: 13px; line-height: 1.7; color: var(--hint, #6b544d); letter-spacing: .06em; }

/* ── 操作菜单 ── */
.action-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 480px; margin: 0 auto;
  background: var(--panel, #fcf9f2);
  border-radius: 22px 22px 0 0;
  border-top: 1px solid rgba(74,46,40,.18);
  box-shadow: 0 -12px 34px rgba(44,27,24,.22);
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--kb, 0px));
  transform: translateY(102%);
  transition: transform .28s cubic-bezier(.32,.72,.28,1);
}
.picker-overlay.is-active .action-sheet { transform: translateY(0); }
.action-sheet .picker-item.is-danger { color: #9e2e2b; }
.action-cancel {
  display: block; width: calc(100% - 20px); margin: 4px 10px 12px;
  font: inherit; font-size: 14.5px; letter-spacing: .1em;
  color: var(--hint, #6b544d);
  background: rgba(74,46,40,.05);
  border: 0; border-radius: 12px;
  padding: 13px 12px;
  cursor: pointer;
}
.action-cancel:active { background: rgba(74,46,40,.1); }

/* ── 可撤销提示条 ── */
.undo-bar {
  position: fixed; left: 0; right: 0;
  bottom: calc(22px + env(safe-area-inset-bottom));
  margin: 0 auto;
  width: calc(100% - 32px); max-width: 420px;
  z-index: 99;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(44,27,24,.94);
  color: #f6efe4;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(30,16,14,.3);
  opacity: 0; transform: translateY(14px);
  transition: opacity .24s ease, transform .24s cubic-bezier(.32,.72,.28,1);
}
.undo-bar.is-active { opacity: 1; transform: translateY(0); }
.undo-text { flex: 1; min-width: 0; font-size: 13.5px; letter-spacing: .06em; }
.undo-action {
  flex: none;
  font: inherit; font-size: 13.5px; letter-spacing: .1em;
  color: #f4d3b2;
  background: transparent; border: 0; cursor: pointer;
  min-height: 44px;
  padding: 6px 8px; border-radius: 8px;
}
.undo-action:active { background: rgba(246,239,228,.12); }

/* 软键盘让位 */
.view-shell, .editor-sheet { padding-bottom: var(--kb, 0px); }
.picker-sheet { padding-bottom: calc(env(safe-area-inset-bottom) + var(--kb, 0px)); }

/* ── 可折叠分组（世界书按分类分组用） ── */
.group { margin-bottom: 4px; }
button.group-head {
  display: flex; align-items: center; gap: 7px;
  width: 100%; text-align: left; font: inherit;
  min-height: 44px;
  padding: 13px 2px 7px;
  background: transparent; border: 0; cursor: pointer;
  font-size: 12.5px; letter-spacing: .16em; color: var(--hint, #6b544d);
}
button.group-head::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(74,46,40,.14);
}
.group-arrow {
  flex: none; display: grid; place-items: center;
  color: rgba(74,46,40,.42);
  transition: transform .2s ease;
}
button.group-head.is-closed .group-arrow { transform: rotate(-90deg); }
.group-name { flex: none; }
.group-count { flex: none; font-size: 11px; color: var(--hint, #6b544d); letter-spacing: .06em; }
.group-body { padding-left: 2px; }

.sub-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 10px 2px 3px 8px;
}
.sub-name { font-size: 12px; letter-spacing: .1em; color: var(--hint, #6b544d); }
.sub-head::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(74,46,40,.08);
}

/* ── 二级菜单行 ── */
button.list-item {
  width: 100%; text-align: left; font: inherit;
}
.menu-arrow {
  flex: none; display: grid; place-items: center;
  color: rgba(74,46,40,.32);
}
button.list-item:active { background: rgba(158,46,43,.05); }
button.list-item:disabled { opacity: .5; }

/* 顶栏右侧的文字按钮 */
.view-action-btn {
  font: inherit; font-size: 14px; letter-spacing: .1em;
  color: var(--vermilion, #9e2e2b);
  background: transparent; border: 0; cursor: pointer;
  padding: 8px 6px; border-radius: 8px;
}
.view-action-btn:active { background: rgba(158,46,43,.1); }

/* 危险按钮 */
.btn.btn-danger { color: #9e2e2b; border-color: rgba(158,46,43,.42); }
.btn.btn-danger:active { background: rgba(158,46,43,.1); }

/* 模型名小片 */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.chip { font-size: 12px; padding: 5px 10px; }

/* ── 角色页 ── */
.profile-hero { align-items: center; text-align: center; }
.profile-portrait {
  width: 132px; height: 132px; border-radius: 50%;
  overflow: hidden; margin: 4px auto 14px;
  display: grid; place-items: center;
  font-size: 46px; color: #fdfaf5;
  background: radial-gradient(circle at 35% 30%, #b33935, #751d1b 85%);
  border: 1px solid rgba(74,46,40,.2);
  box-shadow: 0 8px 22px rgba(58,37,34,.22), inset 0 0 0 5px rgba(253,250,245,.55);
}
.profile-portrait img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero .btn-row { justify-content: center; }
.profile-bg {
  width: 100%; height: 104px; border-radius: 12px;
  border: 1px dashed rgba(74,46,40,.26);
  background-color: rgba(255,255,255,.6);
  background-size: cover; background-position: center;
  display: grid; place-items: center;
}
.profile-bg:not(.is-set)::after {
  content: '还是素底'; font-size: 12px; letter-spacing: .14em; color: var(--hint, #6b544d);
}

/* ── 按钮 ── */
.btn {
  border: 1px solid rgba(74,46,40,.25);
  background: rgba(255,253,248,.9);
  color: var(--ink, #2c1b18);
  font: inherit; font-size: 14px; letter-spacing: .1em;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s ease, background .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.btn-primary {
  background: radial-gradient(circle at 35% 30%, #b33935, #751d1b 85%);
  color: #fdfaf5;
  border-color: #6e1c1a;
}
.btn-jade {
  background: linear-gradient(135deg, #e4f2ea 0%, #b8dac5 100%);
  border-color: #5d8c72; color: #1e3f2d;
}
.btn-quiet { border-color: rgba(74,46,40,.16); color: var(--hint, #6b544d); font-size: 13px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; text-align: center; }

/* ── 列表 ── */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px dashed rgba(74,46,40,.14);
  cursor: pointer;
  transition: background .15s ease;
}
.list-item:last-child { border-bottom: 0; }
.list-item:active { background: rgba(74,46,40,.04); }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list-name {
  font-size: 15px; letter-spacing: .08em; color: var(--ink, #2c1b18);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-sub {
  font-size: 12px; color: var(--hint, #6b544d); letter-spacing: .04em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-side { flex: none; font-size: 12px; color: var(--faint, #644d46); }
.list-tag {
  font-size: 11px; letter-spacing: .1em;
  color: var(--vermilion, #9e2e2b);
  border: 1px solid rgba(158,46,43,.35);
  border-radius: 6px; padding: 1px 6px;
}

/* ── 空状态小印 ── */
.seal-dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--vermilion, #9e2e2b);
  margin-right: 6px;
  vertical-align: middle;
}
.seal-dot.pulse { animation: sealPulse 2.4s ease-in-out infinite; }
@keyframes sealPulse {
  0%, 100% { opacity: .35; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* ── 提示条 ── */
.notice {
  font-size: 12.5px; line-height: 1.6;
  padding: 10px 12px;
  border-radius: 12px;
  letter-spacing: .04em;
}
.notice-info { background: rgba(136,170,150,.16); color: #3b664d; }
.notice-warn { background: rgba(158,46,43,.1); color: #8a2a27; }

/* ============================================================
   对坐闲叙 — 聊天
   ============================================================ */
.chat-body { padding: 0; gap: 0; overflow: hidden; }
.chat-scroll {
  flex: 1; min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 8px;
  display: flex; flex-direction: column; gap: 12px;
}
.bubble {
  max-width: 82%;
  padding: 11px 14px;
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: .03em;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 16px;
}
.bubble-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #e8f1ea 0%, #cfe3d6 100%);
  border: 1px solid rgba(95,140,114,.35);
  color: #24402f;
  border-bottom-right-radius: 6px;
}
.bubble-ai {
  align-self: flex-start;
  background: rgba(255,253,248,.92);
  border: 1px solid rgba(74,46,40,.16);
  color: var(--ink, #2c1b18);
  border-bottom-left-radius: 6px;
}
.bubble-ai.is-error { border-color: rgba(158,46,43,.4); color: #8a2a27; }
.bubble-meta {
  align-self: flex-start;
  font-size: 11px; color: var(--faint, #644d46);
  letter-spacing: .08em;
  padding: 0 4px;
}
.chat-divider {
  align-self: center;
  font-size: 11px; color: var(--faint, #644d46);
  letter-spacing: .14em;
  padding: 4px 0;
}
.inject-chip {
  align-self: flex-start;
  font-size: 11px; letter-spacing: .06em;
  color: #3b664d;
  background: rgba(136,170,150,.18);
  border-radius: 8px;
  padding: 3px 8px;
}
.typing { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.typing i {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(158,46,43,.55);
  animation: typingRise 1.1s ease-in-out infinite;
}
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes typingRise {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-compose {
  flex: none;
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px dashed rgba(74,46,40,.16);
  background: rgba(249,245,236,.92);
}
.chat-compose textarea {
  flex: 1;
  font: inherit; font-size: 15px; line-height: 1.55;
  color: var(--ink, #2c1b18);
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(74,46,40,.2);
  border-radius: 16px;
  padding: 10px 13px;
  max-height: 130px;
  resize: none;
  outline: none;
}
.chat-compose textarea:focus { border-color: rgba(158,46,43,.5); }
.chat-send {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid #6e1c1a;
  background: radial-gradient(circle at 35% 30%, #b33935, #751d1b 85%);
  color: #fdfaf5;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform .15s ease;
}
.chat-send:active { transform: scale(.9); }
.chat-send[disabled] { opacity: .4; }

/* ============================================================
   共赏音律 — 播放器
   ============================================================ */
.music-body { padding: 0; gap: 0; }
.music-stage {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: 16px;
  gap: 14px;
}
.disc-wrap { display: grid; place-items: center; padding: 10px 0 4px; }
.disc {
  width: 172px; height: 172px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #f4eee1 0 17%, transparent 17%),
    repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.05) 0 2px, rgba(0,0,0,.16) 2px 4px),
    radial-gradient(circle at 40% 35%, #4a2523, #1e1113 75%);
  border: 1px solid rgba(74,46,40,.4);
  box-shadow: 0 10px 26px rgba(44,27,24,.28);
  display: grid; place-items: center;
  animation: discSpin 18s linear infinite;
  animation-play-state: paused;
}
.disc.is-playing { animation-play-state: running; }
@keyframes discSpin { to { transform: rotate(360deg); } }
.disc-center {
  width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b33935, #751d1b 85%);
  border: 2px solid rgba(253,250,245,.85);
  display: grid; place-items: center;
  color: #fdfaf5; font-size: 15px; letter-spacing: .06em;
  animation: discSpin 18s linear infinite reverse;
  animation-play-state: paused;
}
.disc.is-playing .disc-center { animation-play-state: running; }

.track-title {
  text-align: center; font-size: 18px;
  letter-spacing: .1em; color: var(--ink, #2c1b18);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.track-artist {
  text-align: center; font-size: 12.5px;
  letter-spacing: .08em; color: var(--hint, #6b544d);
  margin-top: -8px;
}

.progress-row { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--faint, #644d46); }
.progress-track {
  flex: 1; height: 3px; border-radius: 3px;
  background: rgba(74,46,40,.16);
  position: relative; overflow: hidden;
}
.progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #b33935, #9e2e2b);
  border-radius: 3px;
  transition: width .18s linear;
}

.music-controls {
  display: flex; align-items: center; justify-content: center; gap: 20px;
}
.ctrl {
  border: 0; background: transparent; cursor: pointer;
  color: #6a504a; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  transition: transform .15s ease, background .15s ease;
}
.ctrl:active { transform: scale(.9); background: rgba(74,46,40,.06); }
.ctrl-main {
  width: 60px; height: 60px;
  background: radial-gradient(circle at 35% 30%, #b33935, #751d1b 85%);
  color: #fdfaf5;
  border: 2px solid rgba(253,250,245,.85);
  box-shadow: 0 4px 12px rgba(44,27,24,.22);
}

.lyric-box {
  flex: 1; min-height: 96px;
  overflow: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 7px;
  text-align: center;
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}
.lyric-line {
  font-size: 13px; line-height: 1.5;
  color: var(--faint, #644d46); letter-spacing: .04em;
  transition: color .2s ease, font-size .2s ease, opacity .2s ease;
  opacity: .55;
}
.lyric-line.is-current {
  color: var(--vermilion, #9e2e2b);
  font-size: 15px;
  opacity: 1;
}

.music-search {
  flex: none;
  display: flex; gap: 8px;
  padding: 10px 14px;
  border-top: 1px dashed rgba(74,46,40,.16);
}
.music-search input {
  flex: 1; font: inherit; font-size: 14px;
  padding: 10px 13px; border-radius: 14px;
  border: 1px solid rgba(74,46,40,.2);
  background: rgba(255,255,255,.8);
  outline: none; color: var(--ink, #2c1b18);
}
.qr-box { display: grid; place-items: center; gap: 12px; padding: 10px 0; }
.qr-box img {
  width: 200px; height: 200px;
  border-radius: 14px;
  border: 1px solid rgba(74,46,40,.2);
  background: #fff;
  padding: 6px;
}

/* ============================================================
   传音 / 对影 — 通话
   ============================================================ */
.call-shell {
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.18) 0%, transparent 55%),
    linear-gradient(180deg, #3a1f1e 0%, #1c1113 100%);
  color: #f6efe4;
}
.call-shell .view-bar { border-bottom-color: rgba(246,239,228,.14); }
.call-shell .view-title { color: #f6efe4; }
.call-shell .view-back { color: rgba(246,239,228,.8); }
.call-shell .view-action button { color: #f6efe4; }
.call-body {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
}
.call-portrait {
  width: 168px; height: 168px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(246,239,228,.35);
  background: radial-gradient(circle at 35% 30%, #6d3b36, #2a1a1c 85%);
  display: grid; place-items: center;
  box-shadow: 0 12px 34px rgba(0,0,0,.42);
  position: relative;
}
.call-portrait img { width: 100%; height: 100%; object-fit: cover; }
.call-portrait .portrait-fallback {
  font-size: 42px; letter-spacing: .1em;
  color: rgba(246,239,228,.6);
}
.call-portrait.is-talking { animation: callPulse 2.6s ease-in-out infinite; }
@keyframes callPulse {
  0%, 100% { box-shadow: 0 12px 34px rgba(0,0,0,.42), 0 0 0 0 rgba(246,239,228,.34); }
  50% { box-shadow: 0 12px 34px rgba(0,0,0,.42), 0 0 0 14px rgba(246,239,228,0); }
}
.call-video-stage {
  width: 100%; flex: 1; min-height: 0;
  border-radius: 22px; overflow: hidden;
  background: #120c0e;
  border: 1px solid rgba(246,239,228,.16);
  position: relative;
  display: grid; place-items: center;
}
/* 对影：整块舞台就是自己的镜头，镜像显示 */
.call-video-stage video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transform: scaleX(-1);
}
.call-video-stage .video-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: rgba(246,239,228,.5);
  font-size: 13px; letter-spacing: .12em;
  text-align: center; padding: 0 24px; line-height: 1.8;
  white-space: pre-line;
}
.call-name { font-size: 22px; letter-spacing: .18em; margin: 0; }
.call-state { font-size: 12.5px; letter-spacing: .12em; color: rgba(246,239,228,.62); margin: 6px 0 0; }
.call-timer { font-size: 13px; letter-spacing: .16em; color: rgba(246,239,228,.8); margin-top: 8px; }
.call-actions { display: flex; align-items: center; gap: 26px; }
.call-btn {
  width: 58px; height: 58px; border-radius: 50%;
  border: 1px solid rgba(246,239,228,.3);
  background: rgba(246,239,228,.1);
  color: #f6efe4;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.call-btn:active { transform: scale(.92); }
.call-btn.is-off { background: rgba(246,239,228,.28); }
.call-btn.hangup {
  background: radial-gradient(circle at 35% 30%, #c94b45, #7d211f 85%);
  border-color: #6e1c1a;
}
.call-subtitle {
  width: 100%;
  max-height: 132px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(246,239,228,.07);
  border: 1px solid rgba(246,239,228,.12);
  font-size: 13px; line-height: 1.7;
  letter-spacing: .03em;
}
.call-subtitle .sub-line { color: rgba(246,239,228,.72); }
.call-subtitle .sub-line.sub-user { color: rgba(184,218,197,.85); }

/* ── 藏忆阁标签页 ── */
.tabs {
  display: flex; gap: 4px;
  padding: 0 16px 10px;
  flex: none;
  border-bottom: 1px dashed rgba(74,46,40,.16);
}
.tab {
  flex: 1; text-align: center;
  border: 0; background: transparent;
  font: inherit; font-size: 13.5px; letter-spacing: .12em;
  color: var(--hint, #6b544d);
  min-height: 44px; padding: 12px 0; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.tab.is-on { color: var(--vermilion, #9e2e2b); border-bottom-color: var(--vermilion, #9e2e2b); }

/* ── 编辑器（覆盖式） ── */
.editor-sheet {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #f9f5ec 0%, #f1e9da 100%);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.editor-sheet.is-active { transform: translateY(0); }
.editor-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 14px;
}

/* ── 备份文本域 ── */
.dump-box {
  width: 100%; min-height: 140px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px; line-height: 1.5;
  border: 1px solid rgba(74,46,40,.2);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,.75);
  color: #4a3632;
  resize: vertical;
}

/* ── 确认弹层 ── */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(44,27,24,0);
  transition: background .22s ease;
  padding: 0 0 env(safe-area-inset-bottom);
}
.confirm-overlay.is-active { background: rgba(44,27,24,.42); }
.confirm-sheet {
  width: 100%; max-width: 480px;
  background: linear-gradient(180deg, #fdfbf7 0%, #f4ece0 100%);
  border-top: 1px solid rgba(74,46,40,.2);
  border-radius: 22px 22px 0 0;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
  transform: translateY(100%);
  transition: transform .24s cubic-bezier(.32,.72,0,1);
  box-shadow: 0 -8px 28px rgba(44,27,24,.18);
}
.confirm-overlay.is-active .confirm-sheet { transform: translateY(0); }
.confirm-text {
  margin: 0; font-size: 14.5px; line-height: 1.75;
  letter-spacing: .04em; color: var(--ink, #2c1b18);
}

/* 系统开了「减弱动态效果」 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .disc, .disc-center, .call-portrait.is-talking { animation: none; }
}
