/* 个人资料 / 创建角色 / 世界书 等通用表单页（原 index.html 第 566-1091 行） */

/* ============ 个人资料页（点击头像进入） ============ */
.user-view{ background:var(--bg); }
.user-head{
  display:flex; align-items:center; gap:4px;
  padding:var(--head-top) 14px 4px;
}
.back-btn{
  width:44px; height:44px;
  border:none; background:transparent;
  color:var(--ink);
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  transition:background .18s, transform .18s var(--spring);
}
@media (hover: hover) and (pointer: fine){
.back-btn:hover{ background:rgba(var(--tint-rgb),.05); }
}

.back-btn:active{ transform:scale(.9); }
.back-btn svg{ width:26px; height:26px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.user-head h1{
  flex:1;
  font-size:17px; font-weight:600; margin:0;
}
.head-actions{ display:flex; gap:2px; }
.head-actions .icon-btn{ width:42px; height:42px; }
.user-body{
  flex:1; min-height:0;
  overflow-y:auto;
  padding:8px 20px 24px;
}
.user-avatar-wrap{
  margin:22px auto 6px;
  width:96px; height:96px;
  border-radius:50%;
  box-shadow:0 12px 30px -10px rgba(0,0,0,.3);
}
.user-avatar-wrap img{
  width:100%; height:100%;
  border-radius:50%; object-fit:cover;
}
.user-hint{
  text-align:center;
  font-size:12px; color:var(--gray-2);
  margin:0 0 6px;
}
.user-name-line{
  text-align:center;
  font-size:20px; font-weight:700; margin:0;
}
.field-list{
  margin-top:26px;
  background:var(--bg);
  border-radius:22px;
  overflow:hidden;
  box-shadow:0 1px 0 var(--hairline), 0 0 0 1px var(--hairline);
}
.field{
  display:flex; align-items:center; gap:12px;
  padding:14px 18px;
  background:var(--bg);
}
.field + .field{ border-top:1px solid var(--hairline); }
.field label{
  width:76px; flex:0 0 auto;
  font-size:14px; font-weight:500;
  color:var(--gray-1);
}
.field input{
  flex:1; min-width:0;
  border:none; outline:none; background:transparent;
  font-family:inherit; font-size:15px;
  text-align:right; color:var(--ink);
  padding:2px 0;
}
.field input::placeholder{ color:var(--gray-3); }
.field select{
  flex:1; min-width:0;
  border:none; outline:none;
  background:var(--fill);
  font-family:inherit; font-size:14px;
  color:var(--ink);
  text-align:right; text-align-last:right;
  appearance:none; -webkit-appearance:none;
  cursor:pointer;
  padding:7px 14px;
  border-radius:10px;
}
.field select::-ms-expand{ display:none; }
.field svg{
  width:16px; height:16px;
  color:var(--gray-3);
  flex:0 0 auto;
  fill:none; stroke:currentColor;
  stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round;
}
/* 性别分段选择 */
.field-gender{ gap:14px; }
.seg{
  flex:1; display:flex;
  background:var(--fill);
  border-radius:12px;
  padding:3px; gap:2px;
}
.seg-btn{
  flex:1; height:32px;
  border:none; border-radius:9px;
  background:transparent;
  font-size:13px; font-weight:500;
  color:var(--gray-1);
  cursor:pointer;
  transition:background .2s, color .2s, box-shadow .2s;
}
.seg-btn.active{
  background:var(--card); color:var(--ink); font-weight:600;
  box-shadow:0 1px 4px rgba(0,0,0,.1);
}

/* 位置 / 绑定世界书（可展开行，无箭头） */
.field-loc{ cursor:pointer; }
.field-loc .loc-value{
  flex:1; text-align:right;
  font-size:14px; color:var(--gray-1);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.loc-panel{
  border-top:1px solid var(--hairline);
  background:var(--fill);
  padding:2px 0;
}
.loc-panel .field{ background:transparent; padding:12px 18px 12px 30px; }
.loc-real{
  flex:1; display:flex; align-items:center;
  justify-content:flex-end; gap:10px; min-width:0;
}
.loc-btn{
  flex:0 0 auto;
  height:32px; padding:0 14px;
  border:none; border-radius:10px;
  background:var(--primary); color:var(--ink);
  font-size:12.5px; font-weight:600;
  cursor:pointer;
  transition:transform .18s var(--spring), opacity .2s;
}
.loc-btn:active{ transform:scale(.94); }
.loc-btn:disabled{ opacity:.5; }
.loc-result{
  flex:1; min-width:0;
  font-size:13px; color:var(--gray-1);
  text-align:right;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* 人设：大输入框 + 删除 */
.persona-card{
  margin-top:26px;
  background:var(--bg);
  border-radius:22px;
  box-shadow:0 1px 0 var(--hairline), 0 0 0 1px var(--hairline);
  padding:16px 18px 18px;
}
.persona-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.persona-label{
  font-size:14px; font-weight:500;
  color:var(--gray-1);
}
.persona-head-actions{
  display:flex; align-items:center; gap:6px; flex:0 0 auto;
}
.persona-import-btn{
  border:none; background:var(--fill);
  color:var(--ink); font:inherit; font-size:12.5px; font-weight:560;
  padding:6px 12px; border-radius:999px; cursor:pointer;
  flex:0 0 auto;
}
.persona-import-btn:active{ opacity:.75; }
.persona-card-preview-wrap{
  display:flex; justify-content:center;
  padding:4px 22px 14px;
}
#personaCardPreview{
  width:min(56vw, 220px); height:auto;
  aspect-ratio:1 / 1;
  border-radius:18px;
  box-shadow:0 8px 28px rgba(11,11,15,.18);
  background:#1a1a1a;
  display:block;
}
.persona-card-export-fields{
  padding:0 22px 8px;
}
.persona-card-export-fields .field{ margin-bottom:12px; }
.persona-card-note{
  width:100%; min-height:64px; resize:vertical;
  border:none; outline:none;
  background:var(--fill);
  border-radius:14px;
  padding:12px 14px;
  font:inherit; font-size:14px; line-height:1.55;
  color:var(--ink);
}
.persona-textarea{
  width:100%; min-height:130px;
  margin-top:12px;
  border:none; outline:none; resize:vertical;
  background:var(--fill);
  border-radius:16px;
  padding:14px 16px;
  font-family:inherit; font-size:15px; line-height:1.75;
  color:var(--ink);
  transition:box-shadow .2s;
}
.persona-textarea::placeholder{ color:var(--gray-3); }
.persona-textarea:focus{ box-shadow:0 0 0 1.5px var(--ink); }

/* 锁脸：人设参考脸，生图时注入 */
.face-lock{
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--hairline);
}
.face-lock-row{
  display:flex; align-items:center; gap:14px;
}
.face-lock-preview{
  flex:0 0 auto;
  width:72px; height:72px;
  border-radius:18px;
  border:none; padding:0;
  background:var(--fill);
  overflow:hidden;
  cursor:pointer;
  position:relative;
  display:flex; align-items:center; justify-content:center;
}
.face-lock-preview img{
  width:100%; height:100%;
  object-fit:cover; display:block;
}
.face-lock-ph{
  font-size:12px; font-weight:560;
  color:var(--gray-3);
}
.face-lock-preview.has .face-lock-ph{ display:none; }
.face-lock-meta{ flex:1; min-width:0; }
.face-lock-meta b{
  display:block;
  font-size:14px; font-weight:600;
  color:var(--ink);
}
.face-lock-meta p{
  margin:4px 0 10px;
  font-size:12.5px; line-height:1.45;
  color:var(--gray-2);
}
.face-lock-acts{
  display:flex; align-items:center; gap:6px; flex-wrap:wrap;
}

/* ============ 人设页：绑定世界书 ============ */
.wb-bind-card{
  margin-top:26px;
  background:var(--bg);
  border-radius:22px;
  box-shadow:0 1px 0 var(--hairline), 0 0 0 1px var(--hairline);
  overflow:hidden;
}
.wb-bind-head{
  width:100%;
  display:flex; align-items:center; gap:14px;
  padding:16px 18px;
  border:none; background:transparent;
  text-align:left; cursor:pointer;
  font:inherit; color:inherit;
  transition:background .15s;
}
.wb-bind-head:active{ background:rgba(var(--tint-rgb),.04); }
.wb-bind-ico{
  flex:0 0 auto;
  width:42px; height:42px; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  background:rgba(var(--tint-rgb),.1);
  color:var(--tint, var(--ink));
}
.wb-bind-ico svg{
  width:20px; height:20px;
  fill:none; stroke:currentColor;
  stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round;
}
.wb-bind-copy{
  flex:1; min-width:0;
  display:flex; flex-direction:column; gap:3px;
}
.wb-bind-title{
  font-size:15px; font-weight:650; color:var(--ink);
  letter-spacing:.01em;
}
.wb-bind-sub{
  font-size:12.5px; color:var(--gray-2);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.wb-bind-chip{
  flex:0 0 auto;
  min-width:22px; height:22px; padding:0 7px;
  border-radius:999px;
  display:inline-flex; align-items:center; justify-content:center;
  background:var(--ink); color:var(--bg);
  font-size:11.5px; font-weight:700;
  transition:transform .2s var(--spring, cubic-bezier(.2,.8,.2,1));
}
.wb-bind-chip:not([hidden]){ animation:wbChipIn .28s var(--spring, cubic-bezier(.2,.8,.2,1)); }
@keyframes wbChipIn{
  from{ transform:scale(.6); opacity:0; }
  to{ transform:scale(1); opacity:1; }
}
.wb-bind-chev{
  flex:0 0 auto;
  width:18px; height:18px;
  color:var(--gray-3);
  display:flex; align-items:center; justify-content:center;
  transition:transform .22s var(--spring, cubic-bezier(.2,.8,.2,1));
}
.wb-bind-chev svg{
  width:16px; height:16px;
  fill:none; stroke:currentColor;
  stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round;
}
.wb-bind-head.open .wb-bind-chev{ transform:rotate(90deg); }
.wb-bind-panel{
  border-top:1px solid var(--hairline);
  padding:12px 12px 14px;
  background:linear-gradient(180deg, rgba(var(--tint-rgb),.03), transparent 48px);
}
.wb-bind-panel[hidden]{ display:none; }
.wb-bind-banner{
  display:flex; align-items:flex-start; gap:10px;
  margin:0 2px 12px;
  padding:11px 12px;
  border-radius:14px;
  background:rgba(var(--tint-rgb),.08);
  color:var(--ink);
}
.wb-bind-banner-ico{
  flex:0 0 auto;
  width:28px; height:28px; border-radius:9px;
  display:flex; align-items:center; justify-content:center;
  background:rgba(var(--tint-rgb),.14);
  color:var(--tint, var(--ink));
}
.wb-bind-banner-ico svg{
  width:14px; height:14px;
  fill:currentColor; stroke:none;
}
.wb-bind-banner-copy{
  flex:1; min-width:0;
  display:flex; flex-direction:column; gap:2px;
}
.wb-bind-banner-copy b{
  font-size:13px; font-weight:650;
}
.wb-bind-banner-copy em{
  font-style:normal;
  font-size:11.5px; color:var(--gray-2); line-height:1.45;
}
.wb-bind-empty{
  display:flex; flex-direction:column; align-items:center;
  gap:6px; padding:22px 16px 18px;
  text-align:center; color:var(--gray-2);
}
.wb-bind-empty-ico{
  width:44px; height:44px; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  background:var(--fill); color:var(--gray-3);
  margin-bottom:4px;
}
.wb-bind-empty-ico svg{
  width:22px; height:22px;
  fill:none; stroke:currentColor;
  stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round;
}
.wb-bind-empty p{
  margin:0; font-size:14px; font-weight:600; color:var(--ink);
}
.wb-bind-empty span{ font-size:12px; line-height:1.5; }
.wb-bind-summary{
  margin:0 4px 10px;
  font-size:12px; color:var(--gray-2);
}
.wb-bind-summary b{ color:var(--ink); font-weight:700; }
.wb-bind-list{
  display:flex; flex-direction:column; gap:8px;
  max-height:min(52vh, 420px);
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding-right:2px;
}
.wb-bind-list::-webkit-scrollbar{ width:3px; }
.wb-bind-list::-webkit-scrollbar-thumb{
  background:rgba(var(--tint-rgb),.25);
  border-radius:3px;
}
.wb-bind-item{
  width:100%;
  display:flex; align-items:center; gap:12px;
  padding:10px 12px;
  border:1px solid var(--hairline);
  border-radius:16px;
  background:var(--bg);
  text-align:left; cursor:pointer;
  font:inherit; color:inherit;
  transition:border-color .18s, background .18s, transform .18s var(--spring, cubic-bezier(.2,.8,.2,1));
}
.wb-bind-item:active{ transform:scale(.985); }
.wb-bind-item.on{
  border-color:rgba(var(--tint-rgb),.45);
  background:rgba(var(--tint-rgb),.07);
  box-shadow:inset 0 0 0 1px rgba(var(--tint-rgb),.12);
}
.wb-bind-cover{
  flex:0 0 auto;
  width:36px; height:48px; border-radius:7px;
  overflow:hidden;
  background:var(--fill);
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 10px -6px rgba(0,0,0,.28);
}
.wb-bind-cover img{ width:100%; height:100%; object-fit:cover; }
.wb-bind-cover-ph{
  color:var(--gray-3);
  display:flex; align-items:center; justify-content:center;
}
.wb-bind-cover-ph svg{
  width:16px; height:16px;
  fill:none; stroke:currentColor;
  stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round;
}
.wb-bind-info{
  flex:1; min-width:0;
  display:flex; flex-direction:column; gap:3px;
}
.wb-bind-name{
  font-size:14.5px; font-weight:620; color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.wb-bind-meta{
  font-size:11.5px; color:var(--gray-2);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.wb-bind-tick{
  flex:0 0 auto;
  width:22px; height:22px; border-radius:50%;
  border:1.5px solid var(--hairline);
  background:var(--bg);
  display:flex; align-items:center; justify-content:center;
  transition:background .18s, border-color .18s;
}
.wb-bind-tick svg{
  width:11px; height:11px;
  fill:none; stroke:#fff; stroke-width:2.6;
  stroke-linecap:round; stroke-linejoin:round;
  opacity:0;
}
.wb-bind-item.on .wb-bind-tick{
  background:var(--ink); border-color:var(--ink);
}
.wb-bind-item.on .wb-bind-tick svg{ opacity:1; }

.del-persona-btn{
  width:100%; height:46px;
  margin-top:14px;
  border:1px solid var(--hairline);
  border-radius:16px;
  background:transparent;
  color:var(--gray-1);
  font-size:14px; font-weight:500;
  cursor:pointer;
  transition:color .2s, background .2s, transform .18s var(--spring);
}
@media (hover: hover) and (pointer: fine){
.del-persona-btn:hover{ background:rgba(var(--tint-rgb),.04); color:var(--ink); }
}

.del-persona-btn:active{ transform:scale(.97); }

/* 切换人设底部面板 */
.sheet-backdrop{
  position:absolute; inset:0;
  background:rgba(11,11,15,.42);
  opacity:0; pointer-events:none;
  transition:opacity .25s;
  z-index:80;
}
.sheet-backdrop.show{ opacity:1; pointer-events:auto; }
.sheet{
  position:absolute; left:0; right:0; top:0;
  background:var(--bg);
  border-radius:0 0 28px 28px;
  padding:8px 0 18px;
  transform:translateY(-105%);
  transition:transform .35s var(--spring);
  z-index:90;
  max-height:72%;
  overflow-y:auto;
}
.sheet-backdrop.show .sheet{ transform:none; }
/* 自下而上的操作面板（发图选择等） */
.sheet-backdrop.sheet-up{
  display:flex; align-items:flex-end; justify-content:center;
}
.sheet-backdrop.sheet-up .sheet,
.sheet.sheet-from-bottom{
  position:relative; left:auto; right:auto; top:auto;
  width:100%;
  border-radius:28px 28px 0 0;
  transform:translateY(108%);
  padding:8px 0 calc(18px + env(safe-area-inset-bottom, 0px));
  max-height:78%;
}
.sheet-backdrop.sheet-up.show .sheet{ transform:none; }
/* 左右双按钮：真实图片 / 虚拟图片 */
.img-pick-row{
  display:flex; gap:12px;
  padding:6px 20px 10px;
}
.img-pick-btn{
  flex:1; min-width:0;
  display:flex; flex-direction:column; align-items:center; gap:6px;
  padding:18px 12px 16px;
  border:none; border-radius:20px;
  background:var(--fill);
  color:var(--ink);
  cursor:pointer;
  transition:transform .18s var(--spring), background .15s;
}
.img-pick-btn:active{ transform:scale(.97); background:rgba(var(--tint-rgb),.08); }
.img-pick-ico{
  width:40px; height:40px;
  display:flex; align-items:center; justify-content:center;
  border-radius:14px;
  background:var(--card);
  color:var(--ink);
  box-shadow:0 0 0 1px var(--hairline);
}
.img-pick-ico svg{
  width:22px; height:22px;
  fill:none; stroke:currentColor; stroke-width:1.7;
  stroke-linecap:round; stroke-linejoin:round;
}
.img-pick-btn b{
  font-size:15px; font-weight:600;
}
.img-pick-btn > span:last-child{
  font-size:11.5px; color:var(--gray-2);
  line-height:1.3;
}
/* 虚拟图片卡片（动态 / 论坛 / 编辑预览） */
.virtual-img{
  box-sizing:border-box;
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  background:var(--card);
  color:var(--ink);
  font-size:13px; line-height:1.55;
  white-space:pre-wrap; word-break:break-word;
  box-shadow:0 0 0 1px var(--hairline);
}
.virtual-img .photo-mark{ opacity:.55; font-weight:600; }
.post-imgs .virtual-img,
.fm-imgs .virtual-img{
  aspect-ratio:auto; min-height:72px;
  display:flex; align-items:flex-start;
}
.post-imgs.single .virtual-img{ max-width:100%; }
.feed-edit-cell .virtual-img,
.fc-cell .virtual-img{
  position:absolute; inset:0;
  border-radius:inherit;
  overflow:auto;
  font-size:11.5px;
  padding:8px;
}
/* 评论面板：列表区滚动，输入行固定在底部 */
.sheet-comments{
  display:flex; flex-direction:column;
  overflow:hidden;
}
.sheet-comments .comment-list{ flex:1; min-height:0; overflow-y:auto; }
.sheet-handle{
  width:36px; height:4px;
  border-radius:999px;
  background:var(--gray-3);
  margin:6px auto 2px;
}
.sheet-title{
  font-size:13px; font-weight:500;
  color:var(--gray-2);
  text-align:center;
  padding:8px 0 10px;
}
.sheet-item{
  display:flex; align-items:center; gap:12px;
  width:100%;
  padding:14px 24px;
  border:none; background:none;
  cursor:pointer;
  text-align:left;
  transition:background .15s;
}
@media (hover: hover) and (pointer: fine){
.sheet-item:hover{ background:rgba(var(--tint-rgb),.03); }
}

.sheet-item:active{ background:rgba(var(--tint-rgb),.05); }
.sheet-item + .sheet-item{ border-top:1px solid var(--hairline); }
.sheet-av{
  width:36px; height:36px; border-radius:50%;
  object-fit:cover; flex:0 0 auto; background:var(--fill);
}
.sheet-item-name{ font-size:15px; font-weight:600; color:var(--ink); }
.sheet-item-preview{
  font-size:12.5px; color:var(--gray-2);
  margin-top:2px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  max-width:280px;
}
.sheet-item .sheet-check{ margin-left:auto; color:var(--ink); flex:0 0 auto; }
.sheet-item .sheet-check svg{
  width:20px; height:20px;
  fill:none; stroke:currentColor;
  stroke-width:2; stroke-linecap:round; stroke-linejoin:round;
}
.sheet-empty{
  padding:30px 24px;
  text-align:center;
  font-size:13px; color:var(--gray-2);
  line-height:1.7;
}

.save-btn{
  margin-top:30px;
  width:100%; height:50px;
  border:none; border-radius:25px;
  background:var(--primary); color:var(--ink);
  font-size:16px; font-weight:600;
  cursor:pointer;
  transition:transform .2s var(--spring), opacity .2s;
}
@media (hover: hover) and (pointer: fine){
.save-btn:hover{ opacity:.92; }
}

.save-btn:active{ transform:scale(.97); }

/* 删除二次确认弹窗 */
.dialog-backdrop{
  position:absolute; inset:0;
  background:rgba(11,11,15,.42);
  display:flex; align-items:center; justify-content:center;
  padding:0 44px;
  z-index:85;
}
.dialog-backdrop[hidden]{ display:none; }
.dialog{
  width:100%;
  background:var(--bg);
  border-radius:26px;
  padding:26px 24px 20px;
  animation:viewIn .25s var(--ease-out) both;
}
.dialog h3{ margin:0 0 8px; font-size:17px; font-weight:600; }
.dialog p{ margin:0; font-size:13.5px; color:var(--gray-1); line-height:1.75; }
.dialog-actions{ display:flex; gap:10px; margin-top:22px; }
.dialog-actions button{
  flex:1; height:46px;
  border:none; border-radius:16px;
  font-size:15px; font-weight:600;
  cursor:pointer;
  transition:transform .18s var(--spring), opacity .2s;
}
.dialog-actions button:active{ transform:scale(.96); }
.dialog-actions #delCancel{ background:var(--fill); color:var(--ink); }
.dialog-actions #delConfirm{ background:var(--danger); color:#fff; }

/* ============ 世界书：列表 / 编辑 ============ */
.book-card{
  display:flex; align-items:center; gap:14px;
  padding:14px 20px;
  border-top:1px solid var(--hairline);
  cursor:pointer;
  transition:background .15s;
}
.book-card:first-child{ border-top:none; }
@media (hover: hover) and (pointer: fine){
.book-card:hover{ background:rgba(var(--tint-rgb),.028); }
}

.book-cover{
  flex:0 0 auto;
  width:46px; height:62px;
  border-radius:8px;
  overflow:hidden;
  background:var(--fill);
  display:flex; align-items:center; justify-content:center;
}
.book-cover img{ width:100%; height:100%; object-fit:cover; }
.book-cover-ph{
  color:var(--gray-2);
  display:flex; align-items:center; justify-content:center;
}
.book-cover-ph svg{
  width:20px; height:20px;
  fill:none; stroke:currentColor;
  stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round;
}
.book-info{ flex:1; min-width:0; }
.book-name{
  font-size:16px; font-weight:600;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.book-meta{
  font-size:12.5px; color:var(--gray-2);
  margin-top:3px;
}
.book-check{
  flex:0 0 auto;
  width:24px; height:24px;
  color:var(--gray-3);
  display:flex; align-items:center; justify-content:center;
}
.book-check svg{
  width:20px; height:20px;
  fill:none; stroke:currentColor;
  stroke-width:2; stroke-linecap:round; stroke-linejoin:round;
}
.book-card.selected .book-check{ color:var(--ink); }
.book-card.book-global{
  background:rgba(var(--tint-rgb),.04);
}
.book-global-tag{
  display:inline-block;
  margin-right:6px;
  padding:1px 6px;
  border-radius:4px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.02em;
  vertical-align:middle;
  color:var(--tint, var(--ink));
  background:rgba(var(--tint-rgb),.12);
}

/* 世界书编辑模式操作栏 */
.book-edit-bar{
  flex:0 0 auto;
  display:flex; align-items:center; gap:10px;
  padding:10px 20px calc(10px + env(safe-area-inset-bottom));
  border-top:1px solid var(--hairline);
  background:var(--bg);
}
.book-edit-bar[hidden]{ display:none; }
.book-sel-count{ flex:1; font-size:13px; color:var(--gray-2); }
.bar-btn{
  height:40px; padding:0 20px;
  border:none; border-radius:20px;
  background:var(--fill); color:var(--ink);
  font-size:14px; font-weight:600;
  cursor:pointer;
  transition:transform .18s var(--spring), opacity .2s;
}
.bar-btn:active{ transform:scale(.95); }
.bar-btn.danger{ background:var(--danger); color:#fff; }

/* 世界书编辑页 */
.cover-wrap{ display:flex; justify-content:center; margin:12px 0 2px; }
.book-cover-edit{
  position:relative;
  width:132px; height:176px;   /* 竖版封面（宽:高 = 3:4） */
  border-radius:16px;
  background:var(--fill);
  overflow:hidden;
  cursor:pointer;
  box-shadow:0 8px 22px -10px rgba(0,0,0,.22);
  display:flex; align-items:center; justify-content:center;
}
.book-cover-edit img{ width:100%; height:100%; object-fit:cover; }
.cover-placeholder{
  display:flex; flex-direction:column; align-items:center; gap:8px;
  color:var(--gray-2); font-size:11.5px;
  padding:0 12px; text-align:center;
}
.cover-placeholder svg{
  width:26px; height:26px;
  fill:none; stroke:currentColor;
  stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round;
}
.cover-remove{
  position:absolute; top:6px; right:6px;
  width:24px; height:24px; border-radius:50%;
  background:var(--primary); color:var(--ink);
  display:flex; align-items:center; justify-content:center;
  font-size:15px; line-height:1;
  cursor:pointer;
  border:none;
}
.entries-head{
  display:flex; align-items:baseline; gap:8px;
  margin:26px 4px 2px;
  font-size:14px; font-weight:600;
}
.entries-count{
  font-size:12px; color:var(--gray-2); font-weight:500;
  font-variant-numeric:tabular-nums;
}
.entry-card{
  margin-top:14px;
  background:var(--bg);
  border-radius:22px;
  box-shadow:0 1px 0 var(--hairline), 0 0 0 1px var(--hairline);
  padding:16px 18px 18px;
}
.entry-head{
  display:flex; align-items:center; gap:4px;
  margin-bottom:14px;
}
.entry-toggle{
  flex:0 0 auto;
  width:28px; height:28px;
  border:none; border-radius:50%;
  background:transparent; color:var(--gray-2);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  transition:background .15s, color .15s;
}
@media (hover: hover) and (pointer: fine){
.entry-toggle:hover{ background:var(--fill); color:var(--ink); }
}

.entry-chev{
  width:16px; height:16px;
  fill:none; stroke:currentColor;
  stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;
  transition:transform .28s var(--spring);
}
.entry-card.collapsed .entry-chev{ transform:rotate(-90deg); }
.entry-name{
  flex:1; min-width:0;
  border:none; outline:none; background:transparent;
  font-family:inherit; font-size:15px; font-weight:600;
  color:var(--ink);
  padding:4px 0;
}
.entry-name::placeholder{ color:var(--gray-3); font-weight:500; }
.entry-card.collapsed .entry-body{ display:none; }
.entry-remove{
  width:30px; height:30px;
  border:none; border-radius:50%;
  background:transparent; color:var(--gray-2);
  font-size:16px; cursor:pointer;
  transition:background .15s, color .15s;
}
@media (hover: hover) and (pointer: fine){
.entry-remove:hover{ background:var(--fill); color:var(--ink); }
}

.entry-trigger{ display:flex; align-items:center; gap:12px; }
.entry-label{
  flex:0 0 auto; width:76px;
  font-size:13.5px; color:var(--gray-1); font-weight:500;
}
.entry-seg{ flex:1; }
.entry-seg .seg-btn{ height:34px; font-size:12.5px; }
.entry-field{ display:flex; align-items:center; gap:12px; margin-top:12px; }
.entry-field input{
  flex:1; min-width:0; height:40px;
  border:none; outline:none;
  background:var(--fill);
  border-radius:12px;
  padding:0 14px;
  font-family:inherit; font-size:14px; color:var(--ink);
}
.entry-field input::placeholder{ color:var(--gray-3); }
.entry-row{ display:flex; gap:12px; margin-top:12px; }
.entry-num{ flex:1; display:flex; align-items:center; gap:12px; }
.entry-num input{
  flex:1; min-width:0; width:100%; height:40px;
  border:none; outline:none;
  background:var(--fill);
  border-radius:12px;
  padding:0 14px;
  font-family:inherit; font-size:14px; color:var(--ink);
  -moz-appearance:textfield;
}
.entry-num input::-webkit-outer-spin-button,
.entry-num input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.entry-content{
  width:100%; min-height:92px;
  margin-top:12px;
  border:none; outline:none; resize:vertical;
  background:var(--fill);
  border-radius:14px;
  padding:12px 14px;
  font-family:inherit; font-size:14px; line-height:1.7;
  color:var(--ink);
}
.entry-content::placeholder{ color:var(--gray-3); }
.add-entry-btn{
  width:100%; height:46px;
  margin-top:14px;
  border:1px dashed var(--gray-3);
  border-radius:16px;
  background:transparent;
  color:var(--gray-1);
  font-size:14px; font-weight:500;
  cursor:pointer;
  transition:color .2s, border-color .2s, transform .18s var(--spring);
}
@media (hover: hover) and (pointer: fine){
.add-entry-btn:hover{ color:var(--ink); border-color:var(--ink); }
}

.add-entry-btn:active{ transform:scale(.98); }
.move-body{ padding:4px 24px 24px; }
.move-body input{
  width:100%; height:46px;
  border:none; outline:none;
  background:var(--fill);
  border-radius:14px;
  padding:0 16px;
  font-family:inherit; font-size:15px; color:var(--ink);
}
.move-body input::placeholder{ color:var(--gray-3); }
.move-body .save-btn{ margin-top:16px; }
