/* 个人资料 / 创建角色 / 世界�?等通用表单页（�?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-player{
  display:flex; align-items:center;
  margin:26px auto 4px;
  max-width:420px;
  --up-avatar:110px;
  --up-gray:#E5E5EA;
  --up-gray-dark:#8E8E93;
}
.up-avatar{
  flex:0 0 auto;
  margin:0;
  width:var(--up-avatar); height:var(--up-avatar);
  border-radius:50%;
  background:#f4f4f6;
  border:9px solid var(--up-gray);
  box-shadow:0 14px 30px -12px rgba(0,0,0,.3);
  position:relative; z-index:2;
  overflow:hidden;
}
.up-avatar img{ border-radius:50%; background:#f4f4f6; }
.up-caps{
  flex:1; min-width:0;
  margin-left:-32px;
  display:flex; flex-direction:column;
  justify-content:center;
  gap:3px;
  padding:0;
  max-height:var(--up-avatar);
}
.up-cap{
  display:flex; align-items:center;
  border-radius:999px;
  min-width:0;
}
.up-cap-top{
  background:var(--up-gray);
  color:#3a3a3c;
  padding:6px 14px 6px 42px;
  min-height:0; height:44px;
  box-shadow:0 10px 22px -12px rgba(0,0,0,.35);
}
.up-names{ flex:1; min-width:0; text-align:left; }
.up-cap-top .user-name-line.up-name{
  text-align:left;
  font-size:16px; font-weight:700; margin:0;
  color:#3a3a3c;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  line-height:1.2;
}
.up-chat{
  margin:1px 0 0;
  font-size:11.5px; font-weight:400;
  color:#8E8E93;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  text-align:left;
}
.up-heart{ flex:0 0 auto; margin-left:10px; display:flex; }
.up-heart svg{ width:22px; height:22px; fill:#8E8E93; display:block; }
.up-cap-bottom{
  background:#fff;
  border:1.5px solid var(--up-gray);
  padding:2px 12px 2px 42px;
  min-height:0; height:38px;
  justify-content:space-between;
  box-shadow:0 10px 22px -14px rgba(0,0,0,.25);
}
.up-btn{
  width:30px; height:30px;
  border:none; background:transparent;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  color:var(--up-gray-dark); cursor:pointer;
  transition:background .15s, transform .15s;
}
.up-btn svg{
  width:18px; height:18px;
  fill:none; stroke:currentColor;
  stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round;
}
.up-btn:active{ transform:scale(.9); background:#efeff1; }
.up-btn.up-play{
  width:34px; height:34px;
  background:var(--up-gray-dark); color:#fff;
}
.up-btn.up-play svg{ width:16px; height:16px; fill:currentColor; stroke:none; }
.user-hint{
  text-align:center;
  font-size:12px; color:var(--gray-2);
  margin:10px 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; }
/* ============ 角色身份卡（浏览器窗口形�?============ */
.idcard-window{
  margin:8px 2px 2px;
  background:#fff;
  border-radius:26px;
  overflow:hidden;
  box-shadow:0 14px 34px -12px rgba(0,0,0,.28), 0 0 0 1px var(--hairline);
}
.idcard-bar{
  display:flex; align-items:center; justify-content:space-between;
  background:#ececee;
  padding:9px 18px;
}
.idcard-dots{ display:flex; gap:7px; }
.idcard-dots i{ width:15px; height:15px; border-radius:50%; background:#b9b9bd; display:block; }
.idcard-title{
  flex:1; text-align:center;
  font-size:13px; font-weight:800; letter-spacing:.18em; text-indent:.18em;
  color:#a9a9ad;
  white-space:nowrap; overflow:hidden;
}
.idcard-heart svg{ width:30px; height:30px; fill:#fff; display:block; }
.idcard-body{
  display:flex; align-items:center; gap:18px;
  padding:22px 22px 26px;
}
.idcard-avatar{
  position:relative; flex:0 0 auto;
  width:46%; aspect-ratio:1/1;
  border:none; padding:0; cursor:pointer;
  border-radius:16px; background:#0a0a0c;
  overflow:visible;
  display:block;
}
.idcard-avatar img{
  width:100%; height:100%; object-fit:cover; display:block;
  border-radius:16px; background:#0a0a0c;
}
.idcard-avatar-ph{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  border-radius:16px; background:#0a0a0c;
}
.idcard-avatar-ph svg{ width:34px; height:34px; fill:none; stroke:#3a3a40; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.idcard-avatar.has img + .idcard-avatar-ph{ display:none; }
.idcard-meta{ flex:1; min-width:0; }
.idcard-name{ font-size:12.5px; color:var(--gray-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.idcard-nick{ font-size:22px; font-weight:800; color:#1c1c1e; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.idcard-chat{ font-size:13px; color:#3a3a3c; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.idcard-tag{ margin-top:10px; line-height:1.35; }
.idcard-tag span{
  font-size:12px; font-weight:800; letter-spacing:.04em;
  color:#3a3a3c; white-space:nowrap;
  background:linear-gradient(to top, #e2e2e5 52%, transparent 52%);
  padding:0 4px 1px 2px;
  box-decoration-break:clone; -webkit-box-decoration-break:clone;
}
.idcard-tags-edit{
  margin:10px 2px 2px;
  background:var(--bg);
  border-radius:18px;
  box-shadow:0 1px 0 var(--hairline), 0 0 0 1px var(--hairline);
  padding:12px 14px;
}
.idcard-tags-edit > label{ font-size:13px; font-weight:600; color:var(--gray-1); }
.idcard-tags-inputs{
  display:flex; gap:8px; margin-top:8px;
}
.idcard-tags-inputs input{
  flex:1; min-width:0;
  height:36px;
  border:none; outline:none;
  background:var(--fill);
  border-radius:10px;
  padding:0 8px;
  font:inherit; font-size:13px; font-weight:700;
  color:var(--ink); text-align:center;
  text-transform:uppercase;
}
.idcard-tags-inputs input::placeholder{ color:var(--gray-3); font-weight:500; }
.idcard-tags-inputs input:last-child{ flex:1.6; }
.idcard-tags-tip{
  margin:8px 0 0;
  font-size:11px; line-height:1.5;
  color:var(--gray-3);
}
.persona-card-modeseg{ margin:0 22px 12px; }
.persona-card-preview-wrap{
  display:flex; justify-content:center;
  padding:4px 22px 14px;
}
#personaCardPreview{
  width:min(72vw, 300px); height:auto;
  aspect-ratio:4 / 3;
  border-radius:18px;
  background:transparent;
  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; background:var(--fill); display:block; }
.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; background:var(--fill); display:block; flex:0 0 auto; }
.book-cover-edit [hidden]{ display:none !important; }
.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; }

/* ������ͼƬ������ʾ������/��Ŀ��ͼ�����С��ȱ��������� */
.book-cover img{ width:100%; height:100%; object-fit:cover !important; display:block; }
.cover-wrap .book-cover-edit img{ width:100%; height:100%; max-width:none; max-height:none; object-fit:cover !important; }
.entry-card img,.book-info img{ max-width:100%; height:auto; }

/* ============ 编辑角色：顶栏下方 信息 / 关系网 左右切换 ============ */
.create-subseg-wrap{ padding:2px 20px 8px; background:var(--bg); }
.create-subseg-wrap[hidden]{ display:none; }
.create-subseg{ max-width:420px; margin:0 auto; }

/* ============ 角色关系网 ============ */
#createNetPanel[hidden]{ display:none; }
.npcnet-stage{
  position:relative;
  height:calc(100dvh - 210px);
  min-height:420px;
  margin:4px -20px -24px;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(var(--tint-rgb),.07), transparent 62%),
    var(--bg);
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
}
.npcnet-links{ position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.npcnet-canvas{ position:absolute; inset:0; }
.npcnet-node{
  position:absolute;
  width:76px;
  transform:translate(-50%,-50%);
  display:flex; flex-direction:column; align-items:center; gap:4px;
  cursor:pointer;
  z-index:2;
}
.npcnet-node .av{
  width:56px; height:56px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:22px; font-weight:700; color:#fff;
  border:3px solid #fff;
  box-shadow:0 6px 18px -6px rgba(0,0,0,.4);
  overflow:hidden;
  background:var(--gray-2);
}
.npcnet-node .av img{ width:100%; height:100%; object-fit:cover; display:block; }
.npcnet-node .nm{
  max-width:76px;
  font-size:11.5px; font-weight:600; color:var(--ink);
  background:var(--card);
  border:1px solid var(--hairline);
  border-radius:999px;
  padding:2px 8px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.npcnet-node .rl{
  max-width:76px;
  font-size:10px; color:var(--gray-1);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.npcnet-node.char .av{ width:72px; height:72px; font-size:28px; border-color:var(--primary); }
.npcnet-node.user .av{ width:64px; height:64px; font-size:24px; border-color:#34c759; }
.npcnet-node.shared .av{ border-style:dashed; }
.npcnet-tip{
  position:absolute; left:0; right:0; bottom:10px;
  margin:0; text-align:center;
  font-size:11px; color:var(--gray-2);
  pointer-events:none;
}
/* 右上角生成键：纯图标，无文字 */
.npcnet-gen{
  position:absolute; top:10px; right:14px;
  width:44px; height:44px; border-radius:50%;
  border:none; cursor:pointer;
  background:var(--ink); color:var(--bg);
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 8px 20px -6px rgba(0,0,0,.4);
  z-index:5;
}
.npcnet-gen:active{ transform:scale(.92); }
.npcnet-gen svg{ width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; }
/* 浮层 */
.npcnet-sheet{
  position:fixed; inset:0; z-index:60;
  background:rgba(0,0,0,.4);
  display:flex; align-items:flex-end; justify-content:center;
}
.npcnet-sheet[hidden]{ display:none; }
/* 居中弹窗 */
.npcnet-sheet.center{ align-items:center; padding:0 24px; }
.npcnet-modal-card{
  position:relative;
  width:100%; max-width:380px;
  background:var(--card);
  border-radius:22px;
  padding:20px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow:0 24px 60px -12px rgba(0,0,0,.45);
}
.npcnet-modal-acts{
  position:absolute; top:10px; right:12px;
  display:flex; gap:2px;
}
/* 纯图标小键：无文字 */
.npcnet-icon-btn{
  width:36px; height:36px; border:none; border-radius:50%;
  background:transparent; color:var(--gray-1);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.npcnet-icon-btn:active{ background:var(--fill); transform:scale(.92); }
.npcnet-icon-btn svg{ width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.npcnet-icon-btn.danger{ color:#ff3b30; }
/* 编辑态表单 */
#npcnetDetailEdit[hidden]{ display:none; }
#npcnetDetailView[hidden]{ display:none; }
.npcnet-edit-row{
  display:flex; align-items:center; gap:12px;
  padding:11px 2px;
  border-top:1px solid var(--hairline);
  font-size:14px;
}
.npcnet-edit-row > span{ width:96px; flex:0 0 auto; color:var(--gray-1); }
.npcnet-edit-row input{
  flex:1; min-width:0;
  border:none; outline:none; background:var(--fill);
  border-radius:10px; padding:8px 12px;
  font-family:inherit; font-size:14px; color:var(--ink);
  text-align:right;
}
.npcnet-edit-check{ justify-content:space-between; }
.npcnet-edit-check > span{ width:auto; }
.npcnet-switch{
  width:50px; height:30px; border:none; border-radius:999px;
  background:var(--fill); cursor:pointer; position:relative;
  transition:background .2s;
  flex:0 0 auto;
}
.npcnet-switch i{
  position:absolute; top:3px; left:3px;
  width:24px; height:24px; border-radius:50%;
  background:#fff; box-shadow:0 1px 4px rgba(0,0,0,.25);
  transition:left .2s;
  display:block;
}
.npcnet-switch.on{ background:#34c759; }
.npcnet-switch.on i{ left:23px; }
.npcnet-sheet-card{
  width:100%; max-width:520px;
  background:var(--card);
  border-radius:22px 22px 0 0;
  padding:18px 20px calc(20px + env(safe-area-inset-bottom));
}
.npcnet-sheet-title{ font-size:16px; font-weight:700; text-align:center; margin-bottom:12px; }
.npcnet-sheet-acts{ display:flex; gap:10px; margin-top:16px; }
.npcnet-btn{
  flex:1; height:46px; border:none; border-radius:14px;
  background:var(--ink); color:var(--bg);
  font-size:15px; font-weight:600; cursor:pointer;
}
.npcnet-btn.ghost{ background:var(--fill); color:var(--ink); }
.npcnet-btn.danger{ background:#ff3b30; color:#fff; }
.npcnet-btn:disabled{ opacity:.5; }
.npcnet-detail-head{ display:flex; align-items:center; gap:12px; margin-bottom:6px; }
.npcnet-detail-avatar{
  width:56px; height:56px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:22px; font-weight:700; color:#fff;
  overflow:hidden; flex:0 0 auto;
}
.npcnet-detail-avatar img{ width:100%; height:100%; object-fit:cover; }
.npcnet-detail-names b{ display:block; font-size:17px; }
.npcnet-detail-names span{ font-size:13px; color:var(--gray-1); }
.npcnet-detail-row{
  display:flex; align-items:center; gap:12px;
  padding:12px 2px;
  border-top:1px solid var(--hairline);
  font-size:14px;
}
.npcnet-detail-row span{ width:96px; flex:0 0 auto; color:var(--gray-1); }
.npcnet-detail-row em{ flex:1; font-style:normal; text-align:right; color:var(--ink); }
.npcnet-empty{
  position:absolute; left:0; right:0; top:38%;
  text-align:center; color:var(--gray-2); font-size:13px;
  padding:0 30px; pointer-events:none;
  line-height:1.8;
}


.idcard-summary-edit{margin:10px 2px 2px;background:var(--bg);border-radius:18px;box-shadow:0 1px 0 var(--hairline),0 0 0 1px var(--hairline);padding:12px 14px;}
.idcard-summary-head{display:flex;align-items:center;justify-content:space-between;}
.idcard-summary-head > label{font-size:13px;font-weight:600;color:var(--gray-1);}
.idcard-summary-gen{width:30px;height:30px;border:none;background:var(--fill);border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0;}
.idcard-summary-gen svg{width:16px;height:16px;fill:var(--ink);}
.idcard-summary-gen:disabled{opacity:.45;cursor:default;}
.idcard-summary-gen.busy svg{animation:spinPulse 1s linear infinite;}
@keyframes spinPulse{to{transform:rotate(360deg);}}
.idcard-summary-textarea{width:100%;min-height:76px;margin-top:8px;border:none;outline:none;resize:vertical;background:var(--fill);border-radius:12px;padding:10px 12px;font:inherit;font-size:13.5px;line-height:1.65;color:var(--ink);}
.idcard-summary-count{margin:6px 0 0;text-align:right;font-size:11px;color:var(--gray-3);}
.idcard-summary-tip{margin:8px 0 0;font-size:11px;line-height:1.5;color:var(--gray-3);}

.dialog-actions #delConfirm.is-neutral{background:var(--ink);color:var(--bg);}

/* World-book gallery: full-width global card, two-column library. */
#bookList{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:2px 0 24px}
#bookList .wb-tile{position:relative;display:block;isolation:isolate;min-width:0;margin:0;padding:0;border:1px solid var(--hairline);border-radius:24px;overflow:hidden;background:var(--card);box-shadow:0 8px 24px #00000008;color:var(--ink)}
#bookList .wb-tile.book-global{grid-column:1/-1;margin:0;border:1px solid var(--hairline);background:var(--card)}
#bookList .wb-open{position:relative;display:flex;flex-direction:column;justify-content:space-between;width:100%;min-height:246px;padding:16px 12px 17px;border:0;border-radius:inherit;text-align:left;font-family:inherit;background:transparent;color:inherit;cursor:pointer;overflow:hidden}
#bookList .book-global .wb-open{min-height:218px;padding:20px 24px 22px}
#bookList .wb-cover{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-2;pointer-events:none}
#bookList .wb-shade{display:none;position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(180deg,#00000008 0%,#00000005 25%,#0006 52%,#000d 100%)}
#bookList .has-cover{color:#fff}#bookList .has-cover .wb-shade{display:block}
#bookList .wb-topline{display:block;min-height:40px;padding-right:34px;margin-bottom:54px}
#bookList .book-global .wb-topline{margin-bottom:28px}
#bookList .wb-global-label{display:inline-block;font-size:10px;line-height:1.5;letter-spacing:1px;opacity:.65}
#bookList .wb-content{display:block;position:relative;width:100%;min-width:0}
#bookList .wb-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:19px;line-height:1.35;font-weight:600;letter-spacing:-.3px;overflow-wrap:anywhere}
#bookList .book-global .wb-title{font-size:26px;line-height:1.3;letter-spacing:1px}
#bookList .wb-note{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:10px;line-height:1.6;margin-top:6px;opacity:.65;overflow-wrap:anywhere}
#bookList .book-global .wb-note{font-size:12px}
#bookList .wb-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-top:16px;padding-top:12px;border-top:1px solid var(--hairline)}
#bookList .has-cover .wb-stats{border-color:#ffffff38}#bookList .wb-stat{display:flex;flex-direction:column;gap:4px;min-width:0}
#bookList .wb-stat>b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:1.35;font-weight:600}
#bookList .wb-stat>small{font-size:9px;line-height:1.4;font-weight:400;opacity:.55}
#bookList .book-global .wb-stats{gap:20px;margin-top:20px;padding-top:14px}#bookList .book-global .wb-stat>b{font-size:14px}#bookList .book-global .wb-stat>small{font-size:11px}
#bookList .wb-icon-button{position:absolute;top:12px;right:12px;z-index:2;width:36px;height:36px;padding:6px;display:grid;place-items:center;border:1px solid var(--hairline);border-radius:50%;background:var(--bg);color:var(--ink);cursor:pointer}
#bookList .book-global .wb-icon-button{top:17px;right:20px;width:40px;height:40px}
#bookList .has-cover .wb-icon-button{background:#ffffff22;border-color:#ffffff80;color:white;backdrop-filter:blur(8px)}
#bookList .wb-icon-button svg{display:block;width:24px;height:24px;margin:0;vertical-align:initial}
#bookList .selected{outline:2px solid var(--ink);outline-offset:-2px}#bookList .wb-select-mark{display:grid;place-items:center;width:23px;height:23px;border:1px solid currentColor;border-radius:50%;font-size:14px}
#bookList .wb-open:focus-visible,#bookList .wb-icon-button:focus-visible{outline:2px solid #81a590;outline-offset:-4px}
.wb-editor-details{display:flex;flex-direction:column;gap:10px;margin-top:18px;padding:16px;border:1px solid var(--hairline);border-radius:18px}.wb-editor-details>label,.wb-editor-icon>span{font-size:12px;color:var(--ink)}.wb-editor-details small{font-size:10px;color:var(--gray-2);font-weight:400;margin-left:5px}.wb-editor-details>textarea,.wb-editor-details>input{font:inherit;font-size:13px;line-height:1.6;padding:11px 12px;border:1px solid var(--hairline);border-radius:12px;background:var(--bg);color:var(--ink);width:100%;box-sizing:border-box}.wb-editor-details>textarea{resize:vertical;min-height:70px}
.wb-editor-icon{display:flex;align-items:center;justify-content:space-between;gap:12px}.wb-editor-icon>button{display:flex;align-items:center;gap:8px;font:inherit;font-size:11px;border:1px solid var(--hairline);border-radius:12px;padding:8px 11px;background:var(--bg);color:var(--ink)}.wb-editor-icon svg{width:26px;height:26px;vertical-align:initial}
#bookIconBackdrop .wb-icon-picker{width:100%;max-width:420px;max-height:80vh;overflow:auto;padding:20px;box-sizing:border-box;text-align:left}.wb-icon-head{display:flex;align-items:center;justify-content:space-between;gap:15px}.wb-icon-head h2{font-size:16px;margin:0}.wb-icon-head button{width:32px;height:32px;font-size:24px;background:var(--fill);border:0;border-radius:50%;color:var(--ink)}.wb-icon-picker>p{font-size:11px;color:var(--gray-2);margin:8px 0 18px}.wb-icon-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.wb-icon-options>button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:74px;min-width:0;padding:8px 4px;border:1px solid var(--hairline);border-radius:14px;background:var(--bg);color:var(--ink);cursor:pointer}.wb-icon-options>button[aria-pressed="true"]{border-color:var(--ink);background:var(--fill);box-shadow:inset 0 0 0 1px var(--ink)}.wb-icon-options svg{width:30px;height:30px;margin:0;vertical-align:initial}.wb-icon-options span{font-size:10px;line-height:1.3}
@media(max-width:360px){#bookList{gap:10px}#bookList .wb-open{padding:12px 9px 14px;min-height:225px}#bookList .wb-title{font-size:17px}#bookList .wb-stat>b{font-size:9px}#bookList .wb-stat>small{font-size:8px}#bookList .wb-stats{gap:3px}#bookList .book-global .wb-open{padding-left:18px;padding-right:18px}#bookList .book-global .wb-stats{gap:12px}}

/* 1.7.17 Worldbook: borderless glass and centered metadata. */
[data-view="books"] .wb-heading{margin:0;min-width:0}
[data-view="books"] #booksBackBtn{font-family:Arial,"PingFang SC","Microsoft YaHei",sans-serif;font-size:27px;font-weight:750;letter-spacing:-1px;line-height:1.2;color:var(--ink);border:0;padding:6px 0;background:none;cursor:pointer}
[data-view="books"] .wb-prompt-glass{position:relative;isolation:isolate;overflow:hidden;gap:16px;border:0;border-radius:26px;padding:18px 20px;background:linear-gradient(120deg,#ffffff66,#eff3f52b 55%,#ffffff7a);box-shadow:0 8px 25px #2538460c;backdrop-filter:blur(5px) saturate(140%);-webkit-backdrop-filter:blur(5px) saturate(140%)}
[data-view="books"] .wb-prompt-glass::before{content:'';position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse at 12% 0%,#ffffffb0,transparent 55%);z-index:-1}
#bookBuiltinPromptToggle{border:0;border-radius:999px;background:#9399a24d;box-shadow:0 3px 10px #24334612;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);flex-shrink:0}
#bookBuiltinPromptToggle.on{background:#323a43b3}
#bookBuiltinPromptToggle::after{border:0;border-radius:50%;background:linear-gradient(145deg,#fff,#ffffffe0);box-shadow:0 2px 7px #17232e26}
#bookList .wb-stats,#bookList .book-global .wb-stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
#bookList .wb-stat{align-items:center;text-align:center;gap:7px}
#bookList .wb-stat>b{width:100%;min-width:0}
#bookList .wb-stat>small{display:grid;place-items:center;opacity:.65}
#bookList .wb-stat svg{width:15px;height:15px}
#bookList .book-global .wb-stat svg{width:17px;height:17px}
#bookList .book-global .wb-title{font-size:26px;font-weight:700;letter-spacing:-.6px}
#bookList .wb-icon-button,#bookList .has-cover .wb-icon-button{border:0;background:linear-gradient(135deg,#ffffff42,#ffffff0d 60%,#ffffff26);box-shadow:0 4px 12px #00000016;backdrop-filter:blur(3px) saturate(155%);-webkit-backdrop-filter:blur(3px) saturate(155%)}
#bookList .wb-icon-button::before{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:radial-gradient(ellipse at 20% 0%,#ffffffa6,transparent 60%)}
#bookList .wb-icon-button svg{position:relative}
#bookList .has-cover .wb-shade{background:linear-gradient(180deg,transparent 28%,#0000000a 42%,#0005 68%,#000c 100%)}
#bookList .has-cover .wb-shade::after{content:'';position:absolute;inset:35% 0 0;background:#00000015;backdrop-filter:blur(14px) saturate(110%);-webkit-backdrop-filter:blur(14px) saturate(110%);mask-image:linear-gradient(transparent,#0003 25%,#000b 65%,#000);-webkit-mask-image:linear-gradient(transparent,#0003 25%,#000b 65%,#000)}

/* Editor cover and editable metadata share one compact header. */
[data-view="book-edit"] .wb-edit-hero{display:grid;grid-template-columns:minmax(90px,34%) minmax(0,1fr);gap:18px;align-items:start;margin:10px 0 24px}
[data-view="book-edit"] .wb-edit-hero .cover-wrap{margin:0;min-width:0;display:block}
[data-view="book-edit"] .wb-edit-hero .book-cover-edit{width:100%;height:auto;aspect-ratio:3/4;border-radius:18px}
[data-view="book-edit"] .wb-edit-hero .book-cover-edit img{position:absolute;inset:0;width:100%;height:100%}
[data-view="book-edit"] .wb-edit-info{display:flex;flex-direction:column;min-width:0;gap:6px}
[data-view="book-edit"] .wb-edit-info #bkName{display:block;width:100%;min-width:0;box-sizing:border-box;font:700 25px/1.3 Arial,"PingFang SC",sans-serif;letter-spacing:-.5px;color:var(--ink);padding:0 0 8px;border:0;border-radius:0;background:transparent}
[data-view="book-edit"] .wb-edit-info>label{font-size:10px;font-weight:400;color:var(--gray-2);margin-top:3px}
[data-view="book-edit"] .wb-edit-info #bkNote,[data-view="book-edit"] .wb-edit-info #bkGroup{width:100%;min-width:0;box-sizing:border-box;border:0;border-radius:9px;background:var(--fill);font-weight:400;font-family:inherit;font-size:12px;line-height:1.5;color:var(--ink);padding:7px 9px}
[data-view="book-edit"] .wb-edit-info #bkNote{resize:vertical;min-height:48px}
[data-view="book-edit"] .wb-edit-info .wb-editor-icon{margin-top:5px;gap:8px;flex-wrap:wrap}
[data-view="book-edit"] .wb-edit-info .wb-editor-icon>span{font-size:10px;color:var(--gray-2)}
[data-view="book-edit"] .wb-edit-info .wb-editor-icon>button{border:0;border-radius:12px;background:var(--fill);padding:6px 8px;font-size:10px;max-width:100%}
[data-view="book-edit"] .wb-edit-info .wb-editor-icon svg{width:22px;height:22px}
#bookList .wb-stat>small,#bookList .book-global .wb-stat>small{display:block;font-family:"Helvetica Neue",Arial,sans-serif;font-size:7px;line-height:1.4;font-weight:200;letter-spacing:.05px;opacity:.6}
#bookList .book-global .wb-stat>small{font-size:9px}
@media(max-width:360px){[data-view="book-edit"] .wb-edit-hero{gap:12px;grid-template-columns:30% minmax(0,1fr)}[data-view="book-edit"] .wb-edit-info #bkName{font-size:22px}}

.wb-entry-help{margin-top:10px;padding:12px 14px;border-radius:12px;background:var(--fill);color:var(--gray-1);font-size:11px;line-height:1.7}.wb-entry-help p{margin:0}.wb-entry-help p+p{margin-top:8px}.wb-entry-help b{font-weight:500;color:var(--ink)}

[data-view="book-edit"] .wb-edit-hero{align-items:stretch}
[data-view="book-edit"] .wb-edit-hero .cover-wrap{position:relative;min-height:176px}
[data-view="book-edit"] .wb-edit-hero .book-cover-edit{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto}
[data-view="book-edit"] .wb-edit-info .wb-editor-icon{margin-top:auto;padding-top:6px}
#bookHelpDialog{width:min(420px,calc(100vw - 36px));max-height:80dvh;padding:0;border:0;border-radius:24px;background:var(--card,#fff);color:var(--ink,#171819);box-shadow:0 20px 70px #0003;overflow:auto;box-sizing:border-box}
#bookHelpDialog::backdrop{background:#0005;backdrop-filter:blur(3px)}
.wb-help-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 22px 12px;position:sticky;top:0;background:var(--card,#fff)}
.wb-help-head h2{font-size:19px;margin:0}.wb-help-head button{border:0;border-radius:50%;background:var(--fill,#f3f4f6);color:inherit;width:32px;height:32px;font-size:24px}
.wb-help-content{padding:0 22px 24px}.wb-help-content h3{font-size:13px;margin:18px 0 6px}.wb-help-content p{font-size:12px;line-height:1.8;margin:0;color:var(--gray-1,#777)}

/* ===== World Book priority editor ===== */
.entry-card{
  padding:14px 15px 15px;
  transition:padding .24s var(--spring), box-shadow .2s ease;
}
.entry-head{
  gap:3px;
  margin-bottom:12px;
  min-height:30px;
}
.entry-card.collapsed{padding-bottom:12px;}
.entry-card.collapsed .entry-head{margin-bottom:0;}
.entry-index{
  flex:0 0 23px;
  color:var(--gray-2);
  font-size:10.5px;
  line-height:1;
  font-weight:600;
  letter-spacing:.02em;
  font-variant-numeric:tabular-nums;
  text-align:left;
  user-select:none;
}
.entry-name{
  padding:5px 2px;
  font-size:14.5px;
  font-weight:600;
}
.entry-name::placeholder{color:var(--gray-3);font-weight:450;}
.entry-order-actions{
  display:flex;
  align-items:center;
  flex:0 0 auto;
  gap:0;
  margin-left:2px;
}
.entry-move-btn{
  display:grid;
  place-items:center;
  width:27px;
  height:30px;
  padding:0;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--gray-2);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:color .16s ease, transform .16s var(--spring), opacity .16s ease;
}
.entry-move-btn svg{
  width:14px;
  height:14px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.entry-move-btn:active:not(:disabled){transform:scale(.82);}
.entry-move-btn:disabled{opacity:.2;cursor:default;}
@media (hover:hover) and (pointer:fine){
  .entry-move-btn:hover:not(:disabled){color:var(--ink);background:var(--fill);}
}
.entry-toggle{
  width:27px;
  height:30px;
  border-radius:8px;
}
.entry-toggle:active{transform:scale(.9);}
.entry-remove{
  flex:0 0 27px;
  width:27px;
  height:30px;
  border-radius:8px;
  font-size:18px;
  line-height:1;
}
.entry-body{
  display:grid;
  grid-template-rows:1fr;
  min-height:0;
  opacity:1;
  overflow:hidden;
  transition:grid-template-rows .28s var(--spring), opacity .2s ease;
}
.entry-body-inner{min-height:0;overflow:hidden;}
.entry-card.collapsed .entry-body{
  display:grid;
  grid-template-rows:0fr;
  opacity:0;
  pointer-events:none;
}
.entry-card.collapsed .entry-chev{transform:rotate(-90deg);}
@media (prefers-reduced-motion:reduce){
  .entry-card,.entry-body,.entry-chev,.entry-move-btn,.entry-toggle,.entry-remove{transition:none!important;}
}
