/* 霍格沃茨：查无此人 —— 界面样式 */
:root{
  --bg:#0d0b09;
  --bg2:#141110;
  --panel:#161310;
  --line:#2a2319;
  --line-soft:#211b14;
  --ink:#e8ddc9;
  --ink-soft:#cbbda5;
  --dim:#8d8170;
  --dim2:#6b6153;
  --gold:#c0955a;
  --gold-dim:#8a6a3c;
  --glow:rgba(192,149,90,.13);
  --serif:"Noto Serif SC","Source Han Serif SC","Songti SC",STSong,"华文宋体","宋体",SimSun,serif;
  --display:"Noto Serif SC","华文中宋",STZhongsong,"华文宋体","宋体",SimSun,serif;
  --sans:"Noto Sans SC","Microsoft YaHei UI","微软雅黑",system-ui,sans-serif;
}
*{box-sizing:border-box;}
html,body{height:100%;margin:0;max-width:100%;overflow-x:hidden;}
body{
  background:radial-gradient(120% 90% at 50% -10%, #17130f 0%, var(--bg) 55%, #080706 100%);
  color:var(--ink);
  font-family:var(--sans);
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  font-kerning:normal;text-rendering:optimizeLegibility;
  display:flex;flex-direction:column;
  overflow:hidden;
  position:relative;
}

/* ---------- 场景插画 ---------- */
.msg.user .meta .undo{
  margin-left:8px;padding:0 6px;height:18px;line-height:16px;
  border:1px solid rgba(192,149,90,.34);border-radius:4px;
  background:transparent;color:#8d8170;font-size:11px;cursor:pointer;
  font-family:var(--serif);transition:color .2s,border-color .2s;
}
.msg.user .meta .undo:hover{color:#c0955a;border-color:rgba(192,149,90,.7);}

.scene-bg{
  position:fixed;inset:0;z-index:0;
  background-size:cover;background-position:center 38%;
  background-repeat:no-repeat;
  opacity:0;transition:opacity 1.5s ease;
  filter:blur(1.6px) saturate(.9) brightness(.95) contrast(1.02);
}
.scene-bg.on{opacity:.46;}
.scene-bg.title.on{opacity:.55;}
.scene-bg.title{filter:brightness(.92) saturate(.95);background-size:contain;background-position:center center;background-repeat:no-repeat;background-color:#0d0b09;}
.scene-bg::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(90deg, rgba(13,11,9,.10) 0%, rgba(13,11,9,.34) 12%, rgba(13,11,9,.92) 30%, rgba(13,11,9,.94) 70%, rgba(13,11,9,.34) 88%, rgba(13,11,9,.10) 100%),linear-gradient(180deg, rgba(13,11,9,.55) 0%, rgba(13,11,9,.18) 26%, rgba(13,11,9,.28) 68%, rgba(13,11,9,.80) 100%);
}

/* ---------- 氛围层 ---------- */
.ambient{position:fixed;inset:0;pointer-events:none;z-index:0;overflow:hidden;}
.ambient .glow{position:absolute;border-radius:50%;filter:blur(90px);opacity:.9;transition:background 1.2s ease;}
.ambient .g1{
  width:70vw;height:70vw;left:-18vw;top:-28vw;
  background:radial-gradient(circle, var(--glow), transparent 68%);
  animation:drift1 70s ease-in-out infinite;
}
.ambient .g2{
  width:60vw;height:60vw;right:-20vw;bottom:-24vw;
  background:radial-gradient(circle, rgba(150,110,70,.10), transparent 70%);
  animation:drift2 90s ease-in-out infinite;
}
.ambient .grain{
  position:absolute;inset:0;opacity:.05;mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift1{0%,100%{transform:translate3d(0,0,0)}50%{transform:translate3d(6vw,4vh,0)}}
@keyframes drift2{0%,100%{transform:translate3d(0,0,0)}50%{transform:translate3d(-5vw,-4vh,0)}}

body[data-scene="forest"]{--glow:rgba(96,132,92,.14);}
body[data-scene="lake"]{--glow:rgba(86,124,150,.14);}
body[data-scene="night"]{--glow:rgba(96,104,150,.12);}
body[data-scene="castle"]{--glow:rgba(192,149,90,.15);}
body[data-scene="village"]{--glow:rgba(176,130,86,.14);}

body::after{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:2;
  background:radial-gradient(120% 80% at 50% 45%, transparent 45%, rgba(0,0,0,.55) 100%);
}

/* ---------- 顶栏 ---------- */
.topbar{
  position:relative;
  flex:0 0 auto;height:58px;z-index:3;
  display:flex;align-items:center;justify-content:space-between;
  padding:0 18px;gap:14px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg, rgba(26,21,16,.92), rgba(13,11,9,.86));
  backdrop-filter:blur(6px);
}
.brand{display:flex;align-items:center;gap:11px;min-width:0;}
.crest{
  width:34px;height:34px;flex:0 0 auto;border-radius:3px;
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(160deg,#3a2f22,#221b14);
  border:1px solid var(--gold-dim);
  color:var(--gold);font-family:Georgia,serif;font-size:17px;
  box-shadow:inset 0 0 12px rgba(192,149,90,.15);
}
.title{
  font-family:var(--serif);font-size:15px;letter-spacing:2px;color:#f0e6d3;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.sub{font-size:10.5px;color:var(--dim2);margin-top:3px;letter-spacing:.6px;}
.topbtns{display:flex;align-items:center;gap:6px;flex:0 0 auto;}
.scene{
  font-family:var(--serif);font-size:12px;color:#b08a55;
  letter-spacing:2px;margin-right:12px;white-space:nowrap;
  opacity:0;transition:opacity .5s;
}
.scene.on{opacity:1;}

/* ---------- 按钮 ---------- */
button{
  font-family:var(--sans);font-size:12px;color:var(--ink-soft);
  background:transparent;border:1px solid var(--line);
  padding:6px 11px;border-radius:4px;cursor:pointer;
  transition:.18s;white-space:nowrap;
}
button:hover{border-color:var(--gold-dim);color:#fff;background:rgba(192,149,90,.06);}
button.ghost{background:rgba(28,24,19,.6);}
button.icon{width:31px;height:31px;padding:0;display:flex;align-items:center;justify-content:center;font-size:13px;}
button.primary{
  background:linear-gradient(180deg,#c0955a,#9a7440);
  border:1px solid #d8b075;color:#1a1409;font-weight:600;
}
button.primary:hover{filter:brightness(1.08);color:#1a1409;background:linear-gradient(180deg,#c9a068,#a17b45);}
button.wide{width:100%;padding:10px;margin-top:16px;}
button:disabled{opacity:.45;cursor:default;}

/* ---------- 正文 ---------- */
.log{
  position:relative;
  flex:1 1 auto;overflow-y:auto;overflow-x:hidden;z-index:1;
  padding:44px 24px 20px;
  scroll-behavior:smooth;
  display:flex;flex-direction:column;
  scrollbar-width:thin;scrollbar-color:#2c251c transparent;
}
.log::-webkit-scrollbar{width:10px;}
.log::-webkit-scrollbar-thumb{background:#2a231a;border-radius:6px;border:2px solid transparent;background-clip:content-box;}
.log::-webkit-scrollbar-thumb:hover{background:#3a3126;background-clip:content-box;}

/* 空状态 */
.empty{max-width:640px;margin:auto;text-align:center;padding:44px 40px;background:radial-gradient(closest-side, rgba(9,7,6,.80), rgba(9,7,6,.35) 62%, rgba(9,7,6,0) 100%);}
.empty .orn{
  font-size:11px;color:var(--gold-dim);letter-spacing:8px;margin-bottom:26px;opacity:.8;
}
.empty .big{
  font-family:var(--serif);
  font-size:34px;letter-spacing:9px;color:#f2e8d5;margin:0 0 6px;
  text-shadow:0 0 30px rgba(192,149,90,.22);
}
.empty .rule{
  width:110px;height:1px;margin:22px auto 24px;
  background:linear-gradient(90deg,transparent,var(--gold-dim),transparent);
}
.empty p{color:#b5a992;font-size:13px;line-height:2.1;margin:0 0 6px;font-family:var(--serif);letter-spacing:.5px;}
.empty .dim{color:#8a7f6d;font-size:12px;}
.empty button{margin-top:30px;padding:11px 42px;font-size:13px;letter-spacing:3px;}

/* 消息 */
.msg{max-width:40em;width:100%;margin:0 auto 3em;position:relative;animation:rise .45s ease-out both;}
@keyframes rise{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:none;}}

.msg .meta{
  font-family:var(--sans);font-size:9.5px;color:var(--dim2);
  letter-spacing:2.5px;margin-bottom:14px;text-transform:uppercase;
}

.msg.assistant::before{
  content:"◆";display:block;text-align:center;
  color:var(--gold-dim);opacity:.32;font-size:8px;
  margin:0 0 20px;letter-spacing:0;
}

.msg.assistant .bubble{
  font-family:var(--serif);
  font-size:var(--read-size,18px);line-height:var(--read-lh,2.08);letter-spacing:.012em;
  font-feature-settings:"kern" 1;
  color:#e9dfcd;
  word-break:break-word;
  text-align:justify;
  text-wrap:pretty;
}
.msg.assistant .bubble p{text-indent:2em;margin:0 0 .95em;}
.msg.assistant .bubble p:last-child{margin-bottom:0;}
.msg.assistant .bubble p.dialog{text-indent:0;}
.msg.assistant .bubble p.brk{
  text-indent:0;text-align:center;color:var(--gold-dim);
  letter-spacing:.6em;margin:1.8em 0;font-size:13px;
}
.msg.assistant .bubble p.opt{
  text-indent:0;color:var(--ink-soft);
  padding-left:1.2em;margin-bottom:.4em;
}
.msg.assistant .bubble b{color:#fff6e6;font-weight:600;}
.msg.assistant.speaking .bubble{
  color:#fff8ea;
  text-shadow:0 0 18px rgba(192,149,90,.28);
}

.msg.user{display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-end;margin-bottom:2.4em;}
.msg.user .meta{display:flex;align-items:center;margin-bottom:4px;}
.msg.user .meta > span:first-child{display:none;}
.msg.user .bubble{
  background:linear-gradient(180deg, rgba(40,34,26,.9), rgba(28,23,18,.9));
  border:1px solid #3a3025;
  padding:10px 15px;border-radius:3px;
  font-size:13.5px;line-height:1.75;max-width:78%;
  color:#ddd0ba;
  white-space:pre-wrap;word-break:break-word;
  box-shadow:0 2px 14px rgba(0,0,0,.35);
}

.typing::after{content:"▍";color:var(--gold);animation:blink 1s steps(2) infinite;margin-left:2px;}
@keyframes blink{50%{opacity:0;}}

/* 选项 */
.choices{display:flex;flex-direction:column;gap:9px;margin:24px 0 0;}
.choices button{
  text-align:left;font-family:var(--sans);font-size:13.5px;line-height:1.7;
  padding:11px 15px;border-radius:3px;
  border:1px solid var(--line-soft);
  background:linear-gradient(180deg, rgba(26,21,16,.85), rgba(19,16,13,.85));
  color:var(--ink-soft);transition:.18s;
}
.choices button:hover{
  border-color:var(--gold-dim);color:#fff;
  background:linear-gradient(180deg, rgba(44,36,26,.9), rgba(28,23,18,.9));
  transform:translateX(3px);
}

/* ---------- 输入区 ---------- */
.composer{
  position:relative;
  flex:0 0 auto;z-index:3;border-top:1px solid var(--line);
  background:linear-gradient(180deg, rgba(19,15,12,.92), rgba(11,9,8,.96));
  backdrop-filter:blur(7px);
  padding:10px 18px 14px;
}
.quick{display:flex;gap:7px;overflow-x:auto;padding-bottom:10px;scrollbar-width:none;}
.quick::-webkit-scrollbar{display:none;}
.quick button{
  font-size:11px;padding:4px 11px;color:var(--dim2);
  border-color:#241f18;background:rgba(22,18,14,.7);border-radius:20px;
  letter-spacing:.5px;
}
.quick button:hover{color:var(--gold);border-color:var(--gold-dim);background:rgba(192,149,90,.08);}
.inputrow{display:flex;gap:9px;align-items:flex-end;max-width:860px;margin:0 auto;}
textarea{
  flex:1;resize:none;max-height:170px;overflow-y:hidden;
  background:rgba(24,20,16,.85);color:var(--ink);
  border:1px solid var(--line);border-radius:4px;
  padding:12px 14px;font-size:14px;line-height:1.7;
  font-family:var(--sans);outline:none;transition:.2s;
}
textarea::placeholder{color:#5c5347;}
textarea:focus{border-color:var(--gold-dim);box-shadow:0 0 0 3px rgba(192,149,90,.07);}
.send{
  height:47px;padding:0 24px;border-radius:4px;
  background:linear-gradient(180deg,#c0955a,#9a7440);
  color:#1a1409;font-weight:600;border:1px solid #d8b075;
  letter-spacing:2px;
}
.send:hover{filter:brightness(1.1);}

/* ---------- 抽屉 ---------- */
.scrim{
  position:fixed;inset:0;background:rgba(6,5,4,.62);
  opacity:0;pointer-events:none;transition:.25s;z-index:20;
  backdrop-filter:blur(2px);
}
.scrim.on{opacity:1;pointer-events:auto;}
.drawer{
  position:fixed;top:0;right:0;height:100%;width:380px;max-width:92vw;
  background:linear-gradient(180deg,#17130f,#120f0c);
  border-left:1px solid var(--line);
  display:none;z-index:21;flex-direction:column;
  box-shadow:-20px 0 60px rgba(0,0,0,.5);
}
.drawer.on{display:flex;animation:drawerIn .24s ease-out;}
@keyframes drawerIn{from{opacity:0;transform:translateX(20px);}to{opacity:1;transform:none;}}
.drawer-head{
  height:56px;display:flex;align-items:center;justify-content:space-between;
  padding:0 16px;border-bottom:1px solid var(--line);
  font-family:var(--serif);font-size:14px;color:#e5d9c3;letter-spacing:3px;
}
.drawer-body{padding:18px 18px 34px;overflow-y:auto;}
.field{display:block;margin-bottom:16px;}
.field>span{
  display:block;font-size:10.5px;color:var(--dim);
  margin-bottom:7px;letter-spacing:1.8px;
}
.field input[type=password],.field input[type=text],.field select{
  width:100%;background:#100d0a;border:1px solid var(--line);
  color:var(--ink);border-radius:3px;padding:10px 11px;
  font-size:12.5px;font-family:var(--sans);outline:none;
}
.field input:focus,.field select:focus{border-color:var(--gold-dim);}
.field input[type=range]{width:100%;accent-color:var(--gold);}
.row{display:flex;gap:8px;}
.row button{flex:1;}
.hint{font-size:11.5px;color:var(--dim2);line-height:1.8;margin:-6px 0 16px;letter-spacing:0;text-align:left;}
.hint.small{font-size:10.5px;}
.check{display:flex;align-items:center;gap:9px;margin:4px 0 8px;cursor:pointer;}
.check input{width:15px;height:15px;accent-color:var(--gold);}
.check span{font-size:13px;color:var(--ink-soft);}
hr{border:none;border-top:1px solid var(--line-soft);margin:20px 0;}

/* ---------- 存档弹窗 ---------- */
.modal{
  position:fixed;inset:0;z-index:22;display:none;
  align-items:center;justify-content:center;
  background:rgba(6,5,4,.6);backdrop-filter:blur(3px);
}
.modal.on{display:flex;animation:fade .18s ease-out;}
@keyframes fade{from{opacity:0}to{opacity:1}}
.modal-box{
  width:520px;max-width:92vw;max-height:82vh;display:flex;flex-direction:column;
  background:linear-gradient(180deg,#181410,#13100d);
  border:1px solid var(--line);border-radius:4px;
  box-shadow:0 30px 80px rgba(0,0,0,.6);
}
.modal-head{
  height:54px;display:flex;align-items:center;justify-content:space-between;
  padding:0 16px;border-bottom:1px solid var(--line);
  font-family:var(--serif);font-size:14px;letter-spacing:3px;color:#e5d9c3;
}
.modal-body{padding:16px;overflow-y:auto;display:flex;flex-direction:column;gap:10px;}
.modal-foot{padding:12px 16px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;}
.slot{
  display:flex;align-items:center;gap:12px;
  border:1px solid var(--line-soft);border-radius:3px;
  padding:13px 14px;background:rgba(22,18,14,.6);
  transition:.18s;
}
.slot:hover{border-color:var(--gold-dim);background:rgba(30,24,18,.7);}
.slot-info{min-width:0;flex:1;text-align:left;}
.slot-name{font-size:13.5px;color:var(--ink);letter-spacing:1px;}
.tag{
  display:inline-block;font-size:9.5px;color:var(--gold);
  border:1px solid var(--gold-dim);border-radius:2px;
  padding:0 5px;margin-left:7px;vertical-align:1px;letter-spacing:1px;
}
.slot-meta{
  font-size:11px;color:var(--dim2);margin-top:5px;text-align:left;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

/* ---------- 场景卡 ---------- */
.scene-card{
  position:fixed;inset:0;display:flex;align-items:center;justify-content:center;
  pointer-events:none;z-index:15;
  animation:cardIn .9s ease-out both;
}
.scene-card::before{
  content:"";position:absolute;inset:0;
  background:radial-gradient(58% 38% at 50% 50%, rgba(6,5,4,.90), rgba(6,5,4,.55) 55%, rgba(6,5,4,0) 82%);
}
.scene-card span{
  position:relative;
  font-family:var(--serif);font-size:28px;letter-spacing:12px;
  color:#f4e9d2;padding:20px 40px 20px 52px;
  border-top:1px solid rgba(192,149,90,.32);
  border-bottom:1px solid rgba(192,149,90,.32);
  text-shadow:0 0 34px rgba(192,149,90,.5);
}
.scene-card.out{animation:cardOut .85s ease-in both;}
@keyframes cardIn{from{opacity:0;transform:scale(1.05);}to{opacity:1;transform:none;}}
@keyframes cardOut{to{opacity:0;}}

/* ---------- toast ---------- */
.toast{
  position:fixed;left:50%;bottom:104px;transform:translate(-50%,12px);
  background:linear-gradient(180deg,#2b241a,#211b14);
  border:1px solid var(--gold-dim);color:#ecdfc7;
  padding:10px 18px;border-radius:3px;font-size:12.5px;letter-spacing:.8px;
  opacity:0;pointer-events:none;transition:.22s;z-index:30;
  box-shadow:0 10px 30px rgba(0,0,0,.5);
}
.toast.on{opacity:1;transform:translate(-50%,0);}

@media (max-width:640px){
  .topbar{height:52px;padding:0 10px;gap:6px;}
  .title{font-size:12.5px;letter-spacing:1px;max-width:30vw;}
  .sub{font-size:9.5px;}
  .topbtns{gap:4px;}
  .scene{display:none;}
  .ghost{padding:5px 7px;font-size:11px;}
  .log{padding:24px 14px 10px;}
  .empty .big{font-size:24px;letter-spacing:4px;}
  .msg.assistant .bubble{font-size:16.5px;line-height:2.0;}
  .composer{padding:8px 10px 12px;}
  .drawer{width:100%;max-width:100%;}
}


/* ---------- 新内容提示 ---------- */
.jump{
  position:fixed;right:26px;bottom:104px;z-index:12;
  display:none;align-items:center;gap:6px;
  padding:8px 14px;border-radius:20px;
  background:linear-gradient(180deg,rgba(40,33,24,.95),rgba(26,21,16,.95));
  border:1px solid var(--gold-dim);color:var(--gold);
  font-size:12px;letter-spacing:1px;cursor:pointer;
  box-shadow:0 8px 24px rgba(0,0,0,.45);
  animation:rise .3s ease-out both;
}
.jump.on{display:flex;}
.jump:hover{background:linear-gradient(180deg,rgba(52,43,31,.96),rgba(32,26,20,.96));}

/* 对话行比叙述更亮一点 */
.msg.assistant .bubble p.dialog{color:#f3e9d7;}

/* 抽屉里的分组 */
.drawer-body .group{
  border:1px solid var(--line-soft);border-radius:5px;
  padding:14px 14px 2px;margin-bottom:14px;
  background:rgba(255,255,255,.015);
}
.drawer-body .group-title{
  font-size:10px;letter-spacing:2.5px;color:var(--gold-dim);
  margin:-4px 0 12px;
}

.msg .meta{display:flex;align-items:center;gap:8px;}
.msg .meta .speak{
  appearance:none;-webkit-appearance:none;
  background:transparent;border:1px solid rgba(192,149,90,.28);
  color:rgba(192,149,90,.72);
  width:22px;height:22px;line-height:1;border-radius:50%;
  font-size:11px;cursor:pointer;padding:0;
  display:inline-flex;align-items:center;justify-content:center;
  transition:color .2s, border-color .2s, background .2s;
  position:relative;z-index:3;pointer-events:auto;
}
.msg .meta .speak:hover{
  color:#e8cfa4;border-color:rgba(192,149,90,.7);background:rgba(192,149,90,.12);
}
.msg.speaking .meta .speak{color:#e8cfa4;border-color:rgba(192,149,90,.7);}
/* 状态面板 */
.wide-box{max-width:620px;}
.ptabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:14px;}
.ptab{
  font-family:var(--serif);font-size:13px;color:var(--dim);
  background:transparent;border:1px solid rgba(192,149,90,.22);
  padding:5px 14px;border-radius:999px;cursor:pointer;transition:.18s;
}
.ptab:hover{color:var(--gold);border-color:rgba(192,149,90,.5);}
.ptab.on{color:#1a1510;background:var(--gold);border-color:var(--gold);}
.pbody{
  font-family:var(--serif);font-size:14.5px;line-height:1.95;color:#cdc0a9;
  min-height:190px;max-height:52vh;overflow-y:auto;white-space:pre-wrap;
  padding:4px 2px;
}

/* 任务横幅 */
.qbar{
  display:none;align-items:center;gap:10px;
  padding:9px 22px;position:relative;z-index:3;
  border-bottom:1px solid rgba(192,149,90,.10);
  background:linear-gradient(90deg, rgba(192,149,90,.07), rgba(192,149,90,0) 60%);
  font-family:var(--serif);font-size:12.5px;color:#b9a98c;
  cursor:pointer;transition:.2s;
}
.qbar.on{display:flex;}
.qbar:hover{background:linear-gradient(90deg, rgba(192,149,90,.12), rgba(192,149,90,0) 60%);}
.qbar .qtag{
  flex:none;font-size:10.5px;letter-spacing:2px;color:#1a1510;
  background:#8f7346;padding:2px 7px;border-radius:3px;
}
.qbar.warn{border-bottom-color:rgba(192,149,90,.30);color:#d6c3a0;}
.qbar.warn .qtag{background:#b98d4e;}
.qbar.now{color:#f0dcbb;background:linear-gradient(90deg, rgba(192,120,60,.16), rgba(192,120,60,0) 70%);}
.qbar.now .qtag{background:#c9762f;animation:pulse 1.8s infinite;}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.55}}

/* 时段圆点 */
.ap{font-size:9px;letter-spacing:4px;color:#8f7346;margin-right:10px;}
.ap .off{color:rgba(143,115,70,.28);}

/* 状态变化提示 */
.delta{
  font-family:var(--serif);font-size:11.5px;color:#8a7f6d;
  margin-top:8px;letter-spacing:.4px;line-height:1.7;
}
.delta b{color:#b98d4e;font-weight:400;}

/* 章节目录 */
.cyear{
  font-family:var(--serif);font-size:12px;color:#b98d4e;letter-spacing:2px;
  margin:14px 0 7px;padding-bottom:5px;border-bottom:1px solid rgba(192,149,90,.14);
}
.cyear:first-child{margin-top:2px;}
.citem{
  display:flex;gap:10px;align-items:baseline;
  padding:4px 2px;font-size:13px;color:#7d7264;line-height:1.9;
}
.citem .cid{font-family:var(--serif);font-size:11px;color:#6b6155;min-width:26px;}
.citem .ct{flex:1;}
.citem .cwhen{font-size:11px;color:#5f574c;}
.citem.done{color:#6f665a;}
.citem.cur{color:#e6d8bd;}
.citem.cur .ct{font-weight:400;}
.citem.cur .cid{color:#c0955a;}


.linky{
  display:inline-block;margin-top:18px;padding:4px 2px;
  background:none;border:none;cursor:pointer;
  font-family:var(--serif);font-size:12.5px;letter-spacing:1px;
  color:#8c7b62;border-bottom:1px dashed rgba(192,149,90,.35);
}
.linky:hover{color:#c0955a;border-bottom-color:#c0955a;}

.linky{display:block;margin:18px auto 0;}

.mini{
  font-family:var(--sans,inherit);font-size:12px;color:var(--gold);
  background:transparent;border:1px solid rgba(192,149,90,.34);
  border-radius:8px;padding:6px 12px;cursor:pointer;transition:.18s;
}
.mini:hover{border-color:rgba(192,149,90,.7);color:#e3c79a;}
.row2{display:flex;gap:8px;margin:10px 0 6px;}

/* ---------- 两侧页边 ---------- */
.edge{position:fixed;top:50%;transform:translateY(-50%);writing-mode:vertical-rl;
  font-family:var(--serif);font-size:12.5px;letter-spacing:.34em;line-height:1.9;
  color:rgba(192,149,90,.40);z-index:2;pointer-events:none;user-select:none;
  transition:opacity .6s;text-shadow:0 0 18px rgba(0,0,0,.75);}
.edge-l{left:30px;}
.edge-r{right:30px;color:rgba(192,149,90,.52);}
.edge span{display:block;font-size:11px;letter-spacing:.3em;color:rgba(192,149,90,.24);margin-top:1.1em;}
@media (max-width:1180px){.edge{display:none;}}

/* ---------- 右侧信息栏 ---------- */
.rail{position:fixed;right:0;top:58px;bottom:92px;width:252px;padding:26px 26px 26px 20px;
  z-index:3;display:none;overflow:hidden;box-sizing:border-box;
  font-family:var(--serif);font-size:11.5px;line-height:1.95;color:rgba(206,186,156,.60);
  border-left:1px solid rgba(192,149,90,.07);
  background:linear-gradient(90deg, rgba(9,7,6,0), rgba(9,7,6,.62) 40%, rgba(9,7,6,.72));}
@media (min-width:1400px){.rail{display:block;}}
.rail-sec{margin-bottom:16px;}
.rail-sec .k{font-size:9.5px;letter-spacing:.26em;color:rgba(192,149,90,.34);margin-bottom:3px;}
.rail-sec .v{color:rgba(210,190,160,.70);}
.rail .dots{letter-spacing:.26em;color:rgba(192,149,90,.52);}
.rail .dots i{font-style:normal;opacity:.22;}
.rail .bar{height:2px;background:rgba(192,149,90,.12);margin-top:5px;position:relative;}
.rail .bar > b{position:absolute;left:0;top:0;bottom:0;background:rgba(192,149,90,.48);}
.rail .task{color:rgba(210,190,160,.76);margin-bottom:2px;}
.rail .task.warn{color:#c9a063;}
.rail .task.now{color:#d98b4a;}

/* ---------- 书页边线 ---------- */
.pf{position:fixed;top:98px;bottom:112px;width:1px;z-index:2;pointer-events:none;
  background:linear-gradient(180deg,transparent,rgba(192,149,90,.13) 16%,rgba(192,149,90,.13) 84%,transparent);}
.pf-l{left:calc(50% - 386px);}
.pf-r{left:calc(50% + 386px);}
.page-foot{position:fixed;bottom:98px;left:50%;transform:translateX(-50%);z-index:2;
  font-family:var(--serif);font-size:11px;letter-spacing:.34em;color:rgba(202,164,110,.42);
  pointer-events:none;user-select:none;}
@media (max-width:1180px){.pf,.page-foot{display:none;}}

/* ---------- 两侧幕布 ---------- */
.curtain{position:fixed;top:0;bottom:0;width:110px;z-index:1;pointer-events:none;}
.curtain.l{left:0;background:linear-gradient(90deg, rgba(6,5,4,.94), rgba(6,5,4,.55) 45%, rgba(6,5,4,0));}
.curtain.r{right:0;background:linear-gradient(270deg, rgba(6,5,4,.88), rgba(6,5,4,.42) 45%, rgba(6,5,4,0));}
@media (max-width:1180px){.curtain{display:none;}}

/* ---------- 左侧日志栏 ---------- */
.logside{position:fixed;left:0;top:58px;bottom:92px;width:272px;z-index:4;
  display:flex;box-sizing:border-box;padding:22px 20px 22px 30px;overflow:hidden;
  background:linear-gradient(270deg, rgba(9,7,6,0), rgba(9,7,6,.90) 34%, rgba(9,7,6,.94));
  border-right:1px solid rgba(192,149,90,.07);
  transform:translateX(-100%);transition:transform .32s ease;}
.logside.open{transform:none;}
.side-tab{position:fixed;left:0;top:calc(50% - 42px);z-index:6;width:22px;height:84px;
  display:none;align-items:center;justify-content:center;
  writing-mode:vertical-rl;letter-spacing:.28em;font-family:var(--serif);font-size:10.5px;
  color:rgba(192,149,90,.55);background:rgba(12,10,8,.86);
  border:1px solid rgba(192,149,90,.16);border-left:0;border-radius:0 3px 3px 0;
  cursor:pointer;padding:0;transition:color .2s,background .2s;}
.side-tab:hover{color:rgba(214,176,120,.9);background:rgba(24,19,14,.95);}
@media (min-width:1400px){.side-tab{display:flex;}}
.side-inner{width:100%;overflow-y:auto;overflow-x:hidden;
  font-family:var(--serif);font-size:11.5px;line-height:1.85;color:rgba(206,186,156,.62);}
.side-inner::-webkit-scrollbar{width:0;}
.side-sec{margin-bottom:16px;}
.side-k{font-size:9.5px;letter-spacing:.26em;color:rgba(192,149,90,.34);margin-bottom:5px;}
.side-item{color:rgba(210,190,160,.68);margin-bottom:5px;padding-left:10px;position:relative;}
.side-item:before{content:"·";position:absolute;left:0;color:rgba(192,149,90,.4);}
.side-item i{font-style:normal;color:rgba(192,149,90,.44);font-size:10px;margin-right:6px;}
.side-empty{color:rgba(192,149,90,.26);}
@media (max-width:1399px){.logside{display:none;}}

/* ---------- 侧栏可读性修正 ---------- */
.logside{top:100px;width:288px;padding:22px 18px 22px 32px;
  background:linear-gradient(270deg, rgba(8,7,6,.55), rgba(8,7,6,.97) 26%, rgba(8,7,6,.99));
  border-right:1px solid rgba(192,149,90,.10);}
.rail{top:100px;width:264px;
  background:linear-gradient(90deg, rgba(8,7,6,.55), rgba(8,7,6,.97) 30%, rgba(8,7,6,.99));
  border-left:1px solid rgba(192,149,90,.10);}
.side-inner,.rail{font-size:13px;line-height:2.0;}
.side-k,.rail-sec .k{font-size:10.5px;letter-spacing:.24em;color:rgba(202,160,104,.62);margin-bottom:6px;}
.side-item{color:rgba(226,210,186,.88);margin-bottom:6px;padding-left:11px;}
.side-item i{color:rgba(202,160,104,.62);font-size:11px;}
.side-empty{color:rgba(202,160,104,.42);}
.rail-sec .v{color:rgba(226,210,186,.88);}
.rail .task{color:rgba(226,210,186,.92);}
.rail .task.warn{color:#d8b06a;}
.rail .task.now{color:#e89a55;}
.side-tab{font-size:11px;color:rgba(202,160,104,.72);background:rgba(14,12,10,.94);}

/* ---------- 状态面板改右侧抽屉 ---------- */
#panel{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;
  pointer-events:none;align-items:stretch;justify-content:flex-end;}
#panel.on{pointer-events:none;}
#panel .modal-box{position:fixed;right:0;top:100px;bottom:92px;width:430px;height:auto;
  max-height:none;min-height:0;border-radius:0;pointer-events:auto;
  display:flex;flex-direction:column;overflow:hidden;
  background:linear-gradient(90deg, rgba(8,7,6,.55), rgba(8,7,6,.975) 26%, rgba(8,7,6,.99));
  border-left:1px solid rgba(192,149,90,.12);
  transform:translateX(102%);transition:transform .34s cubic-bezier(.22,.8,.3,1);
  box-shadow:none;}
#panel.on .modal-box{transform:none;}
#panel .modal-head{padding:16px 22px 12px;border-bottom:1px solid rgba(192,149,90,.10);}
#panel .modal-body{flex:1;overflow-y:auto;padding:16px 22px 22px;font-size:13px;line-height:1.95;}
#panel .modal-foot{border-top:1px solid rgba(192,149,90,.10);padding:12px 22px;}
#panel .ptabs{margin-bottom:14px;}
#panel .ptab{font-size:12px;padding:5px 11px;}
@media (max-width:1400px){#panel .modal-box{width:100%;max-width:430px;}}
.rail{cursor:pointer;}
.rail:hover{background:linear-gradient(90deg, rgba(8,7,6,.55), rgba(8,7,6,.97) 30%, rgba(8,7,6,.99));}
.rail-hint{font-size:10px;letter-spacing:.2em;color:rgba(192,149,90,.38);margin-top:14px;}

body.panel-open .rail{opacity:0;pointer-events:none;}
.rail{transition:opacity .2s;}

/* ---------- 语音输入 ---------- */
.mic{width:52px;height:46px;flex:0 0 auto;border-radius:3px;cursor:pointer;
  background:transparent;border:1px solid rgba(192,149,90,.28);color:rgba(206,186,156,.8);
  font-size:17px;line-height:1;transition:all .2s;}
.mic:hover{border-color:rgba(206,166,110,.6);color:rgba(232,200,150,.95);}
.mic.rec{border-color:#c2603a;color:#e8804f;background:rgba(150,50,20,.22);
  animation:micPulse 1.1s ease-in-out infinite;}
@keyframes micPulse{0%,100%{box-shadow:0 0 0 0 rgba(200,90,50,.45);}50%{box-shadow:0 0 0 7px rgba(200,90,50,0);}}

body.empty-mode .rail,body.empty-mode .side-tab{display:none !important;}

.empty .sub2{letter-spacing:.34em;font-size:11.5px;margin-top:10px;color:#8a7f6d;}

/* scrollbar-skin */
html{color-scheme:dark;}
::-webkit-scrollbar{width:6px;height:6px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{
  background:rgba(192,149,90,.18);
  border-radius:3px;
  border:1px solid transparent;
  background-clip:content-box;
}
::-webkit-scrollbar-thumb:hover{background:rgba(192,149,90,.38);background-clip:content-box;}
::-webkit-scrollbar-corner{background:transparent;}
#panel .modal-body::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar,
.log::-webkit-scrollbar,
.side-inner::-webkit-scrollbar{width:4px;}
#panel .modal-body::-webkit-scrollbar-thumb,
.drawer-body::-webkit-scrollbar-thumb,
.log::-webkit-scrollbar-thumb,
.side-inner::-webkit-scrollbar-thumb{background:rgba(192,149,90,.16);border:0;border-radius:2px;}
#panel .modal-body:hover::-webkit-scrollbar-thumb,
.drawer-body:hover::-webkit-scrollbar-thumb,
.log:hover::-webkit-scrollbar-thumb,
.side-inner:hover::-webkit-scrollbar-thumb{background:rgba(192,149,90,.34);border:0;}

html,body{overflow:hidden;height:100%;}

.lore{
  position:fixed;right:26px;top:150px;z-index:6;width:266px;
  display:flex;gap:12px;padding:14px 14px 13px;
  background:linear-gradient(180deg,rgba(23,19,15,.965),rgba(17,14,11,.975));
  border:1px solid rgba(192,149,90,.26);border-radius:3px;
  box-shadow:0 18px 46px rgba(0,0,0,.55);
  opacity:0;transform:translateX(14px);pointer-events:none;
  transition:opacity .38s ease,transform .38s ease;
}
.lore.on{opacity:1;transform:none;pointer-events:auto;}
.lore-face{
  width:62px;height:78px;flex:0 0 62px;position:relative;overflow:hidden;
  border:1px solid rgba(192,149,90,.30);border-radius:2px;
  background:radial-gradient(120% 100% at 50% 0%,rgba(192,149,90,.16),rgba(20,16,13,.9));
  display:flex;align-items:center;justify-content:center;
}
.lore-face img{width:100%;height:100%;object-fit:cover;display:none;}
.lore-face.has img{display:block;}
.lore-face.has span{display:none;}
.lore-face span{font-family:var(--serif);font-size:26px;color:rgba(192,149,90,.72);}
.lore-txt{min-width:0;flex:1;}
.lore-name{font-family:var(--serif);font-size:15.5px;color:#e6d6ba;letter-spacing:.06em;}
.lore-sub{font-size:11px;color:#8f8371;margin-top:4px;letter-spacing:.04em;}
.lore-rel{font-size:11px;color:#b99a68;margin-top:7px;}
.lore-line{font-size:11.5px;color:#9d9182;line-height:1.7;margin-top:8px;
  border-top:1px solid rgba(192,149,90,.14);padding-top:7px;}
body.empty-mode .lore{display:none !important;}
@media (max-width:1400px){.lore{display:none;}}

body.lore-on .rail{opacity:0;pointer-events:none;}
.rail{transition:opacity .3s ease;}
.lore{top:96px;}

/* 左栏：在场的人 */
.cast{display:flex;gap:9px;align-items:flex-start;padding:9px 0;cursor:pointer;
  border-bottom:1px solid rgba(192,149,90,.10);transition:background .2s;}
.cast:hover{background:rgba(192,149,90,.05);}
.cast:last-child{border-bottom:0;}
.cast-face{width:38px;height:48px;flex:0 0 38px;overflow:hidden;border-radius:2px;
  border:1px solid rgba(192,149,90,.26);
  background:radial-gradient(120% 100% at 50% 0%,rgba(192,149,90,.14),rgba(20,16,13,.9));
  display:flex;align-items:center;justify-content:center;}
.cast-face img{width:100%;height:100%;object-fit:cover;display:none;}
.cast-face.has img{display:block;}
.cast-face.has span{display:none;}
.cast-face span{font-family:var(--serif);font-size:17px;color:rgba(192,149,90,.72);}
.cast-txt{min-width:0;flex:1;}
.cast-n{font-family:var(--serif);font-size:14px;color:#e2d2b6;letter-spacing:.05em;}
.cast-s{font-size:10.5px;color:#867a68;margin-top:3px;line-height:1.6;}
.cast-r{font-size:10.5px;color:#b09162;margin-top:4px;}

/* 右侧信息栏：收起 */
.rail-tab{position:fixed;right:0;top:50%;transform:translateY(-50%);z-index:9;
  writing-mode:vertical-rl;background:rgba(22,18,14,.92);color:rgba(192,149,90,.62);
  border:1px solid rgba(192,149,90,.24);border-right:0;border-radius:3px 0 0 3px;
  padding:13px 6px;font-size:11.5px;letter-spacing:.34em;cursor:pointer;
  font-family:var(--serif);display:block;}
.rail-tab:hover{color:rgba(224,190,138,.95);background:rgba(32,26,20,.96);}
body.rail-off .rail{transform:translateX(104%);opacity:0;pointer-events:none;}
body.rail-off .lore{display:none;}
@media (max-width:1400px){.rail-tab{display:none !important;}}

/* 左栏与正文之间的在场卡片 */
.castcol{
  position:fixed;left:300px;top:96px;width:198px;z-index:4;
  transition:left .32s ease,opacity .32s ease;
}
body.left-off .castcol{left:24px;}
.cast-head{
  display:flex;align-items:center;justify-content:space-between;
  font-size:10.5px;color:rgba(192,149,90,.55);letter-spacing:.22em;
  padding:0 2px 8px;border-bottom:1px solid rgba(192,149,90,.14);margin-bottom:6px;
}
.cast-head b{font-weight:400;margin-left:4px;color:rgba(192,149,90,.8);}
.cast-fold{
  background:none;border:0;color:rgba(192,149,90,.45);cursor:pointer;
  font-size:11px;padding:0 2px;line-height:1;
}
.cast-fold:hover{color:rgba(224,190,138,.95);}
.cast-body{max-height:calc(100vh - 240px);overflow-y:auto;overflow-x:hidden;}
body.cast-off .cast-body{display:none;}
body.cast-off .castcol{width:auto;}
body.cast-off .cast-head{border-bottom:0;}
@media (max-width:1500px){.castcol{display:none;}}

.rail{transition:transform .34s cubic-bezier(.22,.61,.36,1),opacity .34s ease;}
body.rail-off .rail{transform:translateX(104%);opacity:0;pointer-events:none;}

.composer .inputrow{display:flex;align-items:flex-end;gap:10px;}
.cont{
  flex:0 0 auto;height:44px;padding:0 20px;border-radius:3px;cursor:pointer;
  background:rgba(192,149,90,.10);color:#d8c3a0;
  border:1px solid rgba(192,149,90,.34);
  font-family:var(--serif);font-size:14.5px;letter-spacing:.16em;
  transition:background .2s,color .2s,border-color .2s;
}
.cont:hover{background:rgba(192,149,90,.20);color:#f0e2c8;border-color:rgba(192,149,90,.55);}
.cont:active{transform:translateY(1px);}

/* ---- 左栏布局修正（覆盖旧规则） ---- */
.logside{left:0 !important;top:100px !important;width:268px !important;}
.logside .side-item,.logside .side-empty,.logside .side-k{overflow-wrap:anywhere;word-break:break-word;}
.castcol{
  left:288px !important;top:100px !important;width:186px !important;
  transition:left .34s cubic-bezier(.22,.61,.36,1),opacity .3s ease;
}
body.left-off .castcol{left:26px !important;}
.cast-head{
  padding:0 2px 7px !important;margin-bottom:8px !important;
  letter-spacing:.2em;font-size:10px;
}
.cast{display:flex;gap:8px;padding:8px 0;align-items:flex-start;}
.cast-face{width:34px !important;height:44px !important;flex:0 0 34px !important;}
.cast-n{font-size:13px !important;letter-spacing:.04em;}
.cast-s{font-size:10px !important;line-height:1.5 !important;overflow-wrap:anywhere;}
.cast-r{font-size:10px !important;line-height:1.5 !important;overflow-wrap:anywhere;color:#a8905f;}
.cast-body{
  max-height:calc(100vh - 240px);opacity:1;
  transition:max-height .38s cubic-bezier(.22,.61,.36,1),opacity .26s ease;
  overflow-y:auto;overflow-x:hidden;
}
body.cast-off .cast-body{max-height:0 !important;opacity:0;overflow:hidden;}
.cast-fold{
  width:18px;height:18px;line-height:16px;text-align:center;
  border:1px solid rgba(192,149,90,.22);border-radius:2px;
  font-size:10px;color:rgba(192,149,90,.55);
  transition:transform .34s cubic-bezier(.22,.61,.36,1),color .2s,border-color .2s;
}
.cast-fold:hover{color:rgba(232,200,150,.95);border-color:rgba(192,149,90,.5);}
body.cast-off .cast-fold{transform:rotate(-90deg);}
body.cast-off .castcol{width:auto !important;}
@media (max-width:1500px){.castcol{display:none;}}

/* 折叠控件放大 + 整条标题可点 */
.cast-head{font-size:11px !important;color:rgba(192,149,90,.62) !important;cursor:pointer;user-select:none;
  display:flex;align-items:center;justify-content:space-between;gap:8px;}
.cast-head:hover{color:rgba(232,200,150,.92) !important;}
.cast-fold{
  width:24px !important;height:24px !important;line-height:22px !important;
  border-radius:3px;font-size:12px !important;
  background:rgba(192,149,90,.06);
}
.cast-head:hover .cast-fold{background:rgba(192,149,90,.16);border-color:rgba(192,149,90,.55);}

/* 逐张滑入 */
@keyframes castIn{
  from{opacity:0;transform:translateX(-16px);}
  to{opacity:1;transform:translateX(0);}
}
body.cast-anim .castcol .cast{
  animation:castIn .44s cubic-bezier(.22,.61,.36,1) both;
  animation-delay:calc(var(--i,0) * 85ms);
}
body.cast-off .castcol .cast{animation:none;opacity:1;}
body.cast-off .cast-body{transition:max-height .26s ease,opacity .18s ease;}

/* —— 仪式感版本（覆盖前面的节奏） —— */
@keyframes castIn{
  from{opacity:0;transform:translateX(-34px) translateY(6px);filter:blur(2px);}
  60%{opacity:1;}
  to{opacity:1;transform:translateX(0) translateY(0);filter:blur(0);}
}
body.cast-anim .castcol .cast{
  animation:castIn .82s cubic-bezier(.16,.84,.28,1) both;
  animation-delay:calc(var(--i,0) * 140ms);
}
.castcol{transition:left .5s cubic-bezier(.16,.84,.28,1),opacity .45s ease;}
.cast-body{
  transition:max-height .55s cubic-bezier(.16,.84,.28,1),opacity .4s ease;
}
body.cast-off .cast-body{transition:max-height .4s cubic-bezier(.5,0,.75,0),opacity .3s ease;}
.cast-head{transition:color .3s ease;}

/* 名字晚一拍 */
@keyframes nameIn{
  from{opacity:0;transform:translateY(4px);}
  to{opacity:1;transform:translateY(0);}
}
body.cast-anim .castcol .cast-n,
body.cast-anim .castcol .cast-s,
body.cast-anim .castcol .cast-r{
  animation:nameIn .5s cubic-bezier(.22,.61,.36,1) both;
  animation-delay:calc(var(--i,0) * 140ms + 240ms);
}

/* 卡片改 grid：立绘 + 名字一行，「对你」通栏在下面 */
.cast{
  display:grid !important;
  grid-template-columns:34px 1fr;
  column-gap:9px;row-gap:5px;
  align-items:start;
  padding:8px 0 !important;
}
.cast-face{grid-column:1;grid-row:1;}
.cast-txt{grid-column:2;grid-row:1;min-width:0;}
.cast-r{
  grid-column:1 / -1;grid-row:2;
  margin-top:2px;padding-top:4px;
  border-top:1px solid rgba(192,149,90,.12);
  font-size:10px !important;line-height:1.55;
  color:#a8905f;
}

/* ===== 页边注（右中栏，三段） ===== */
.notecol{
  position:fixed;right:272px;top:100px;width:246px;
  display:none;flex-direction:column;
  z-index:4;
}
@media (min-width:1760px){.notecol{display:flex;}}
.note-sec{border-top:1px solid rgba(192,149,90,.11);padding:9px 0 11px;}
.note-sec:first-child{border-top:none;padding-top:0;}
.note-head{display:flex;align-items:center;justify-content:space-between;gap:8px;cursor:pointer;padding:2px 0 7px;}
.note-k{font-family:var(--serif);font-size:10.5px;letter-spacing:.24em;color:rgba(192,149,90,.55);}
.note-head:hover .note-k{color:rgba(232,200,150,.92);}
.note-fold{width:19px;height:19px;line-height:17px;text-align:center;font-size:10px;
  color:rgba(192,149,90,.4);background:transparent;border:1px solid rgba(192,149,90,.16);
  border-radius:2px;transition:transform .32s cubic-bezier(.22,.61,.36,1),color .2s,border-color .2s;}
.note-head:hover .note-fold{color:rgba(232,200,150,.9);border-color:rgba(192,149,90,.45);}
.note-sec.off .note-fold{transform:rotate(-90deg);}
.note-body{max-height:300px;overflow:hidden;opacity:1;
  transition:max-height .42s cubic-bezier(.16,.84,.28,1),opacity .3s ease,transform .3s ease;}
.note-sec.off .note-body{max-height:0;opacity:0;transform:translateY(-4px);}
.note-src{font-family:var(--serif);font-size:10.5px;color:rgba(192,149,90,.5);letter-spacing:.05em;margin-bottom:6px;}
.note-txt{font-family:var(--serif);font-size:12.5px;line-height:1.9;color:#b3a48c;text-align:justify;}
.note-txt b{font-weight:normal;color:#d8c3a0;}

/* 页脚书签 */
.page-foot{font-family:var(--serif);font-size:11px;letter-spacing:.2em;color:rgba(192,149,90,.45);text-align:center;}
.page-foot span{color:rgba(192,149,90,.28);margin:0 10px;}

/* ===== 适配 150% 缩放的窄视口 ===== */
.logside{max-height:calc(100vh - 104px) !important;overflow:hidden !important;}
.logside .side-inner{max-height:calc(100vh - 152px) !important;overflow-y:auto !important;}
.castcol{max-height:calc(100vh - 112px) !important;}

.notecol{
  right:258px !important;width:186px !important;top:104px !important;
}
@media (min-width:1500px){.notecol{display:flex !important;}}
@media (max-width:1499px){.notecol{display:none !important;}}
.note-k{font-size:10px !important;letter-spacing:.2em !important;}
.note-src{font-size:10px !important;}
.note-txt{font-size:11.5px !important;line-height:1.85 !important;}
.note-sec{padding:8px 0 9px !important;}
.note-head{padding:1px 0 5px !important;}

.chap{
  font-family:var(--serif);font-size:11px;letter-spacing:.16em;
  color:rgba(192,149,90,.42);margin-right:14px;white-space:nowrap;
}

/* ===== 三段均分整列高度 ===== */
.notecol{
  top:104px !important;
  bottom:104px !important;
  height:auto !important;
  display:flex;flex-direction:column;
  justify-content:space-between;
}
.note-sec{
  flex:1 1 0 !important;
  min-height:0;
  display:flex;flex-direction:column;
  border-top:1px solid rgba(192,149,90,.10);
  padding:12px 0 14px !important;
}
.note-sec:first-child{border-top:none;padding-top:2px !important;}
.note-head{flex:0 0 auto;}
.note-body{
  flex:1 1 auto;
  min-height:0;
  max-height:none !important;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:2px;
}
.note-sec.off{flex:0 0 auto !important;}
.note-sec.off .note-body{max-height:0 !important;}
/* 空段落（没内容/没触发）自动收起，把高度让给有内容的段 */
.note-sec.is-empty{flex:0 0 auto !important;opacity:.5;}
.note-sec.is-empty .note-body{max-height:0 !important;overflow:hidden;}

/* ===== 不重合 ===== */
.logside{max-height:calc(100vh - 152px) !important;}
.logside .side-inner{max-height:calc(100vh - 196px) !important;}
.castcol{max-height:calc(100vh - 152px) !important;}

.notecol{right:286px !important;width:172px !important;bottom:150px !important;}
.rail{border-left:1px solid rgba(192,149,90,.09);}

/* 每段内容在自己的三分之一里垂直居中 */
.note-body{display:flex;flex-direction:column;justify-content:center;}

/* ===== 左栏底部留出快捷条 ===== */
.logside{max-height:calc(100vh - 240px) !important;}
.logside .side-inner{max-height:calc(100vh - 286px) !important;}
.castcol{max-height:calc(100vh - 240px) !important;}
.cast-body{max-height:calc(100vh - 300px) !important;}

.note-sec{justify-content:center !important;}
.note-body{flex:0 1 auto !important;justify-content:flex-start !important;}

.logside{
  bottom:auto !important;
  height:auto !important;
  max-height:calc(100vh - 240px) !important;
}
.logside .side-inner{max-height:calc(100vh - 292px) !important;}

.logside{
  top:100px !important;
  bottom:152px !important;
  height:auto !important;
  max-height:none !important;
}
.logside .side-inner{max-height:none !important;overflow-y:auto !important;}

.logside{
  -webkit-mask-image:linear-gradient(180deg,#000 0%,#000 52%,rgba(0,0,0,.55) 82%,rgba(0,0,0,0) 100%);
  mask-image:linear-gradient(180deg,#000 0%,#000 52%,rgba(0,0,0,.55) 82%,rgba(0,0,0,0) 100%);
  bottom:170px !important;
}

/* ===== 侧栏可读性 ===== */
.side-k,.note-k,.rail .k,.cast-head{
  color:rgba(216,180,124,.86) !important;
  font-size:11.5px !important;
  letter-spacing:.18em !important;
}
.side-item,.side-empty{
  color:#c0b096 !important;
  font-size:12.5px !important;
  line-height:1.85 !important;
}
.note-src{
  color:rgba(210,174,120,.82) !important;
  font-size:10.5px !important;
}
.note-txt{
  color:#cbbba1 !important;
  font-size:12.5px !important;
  line-height:1.95 !important;
}
.rail .k{color:rgba(216,180,124,.8) !important;}
.rail .v,.rail div{color:#c2b197;}
.rail .v{font-size:12.5px !important;}
.cast-n{color:#e0cba6 !important;font-size:13.5px !important;}
.cast-s{color:#a8987e !important;font-size:10.5px !important;}
.cast-r{color:#c0a878 !important;font-size:10.5px !important;}
.note-fold,.cast-fold{color:rgba(216,180,124,.7) !important;}

/* ===== 旧课本占比更大 + 折叠更顺 ===== */
.note-tools{display:flex;align-items:center;gap:6px;}
.note-more{
  width:19px;height:19px;line-height:17px;text-align:center;font-size:11px;
  color:rgba(216,180,124,.55);background:transparent;
  border:1px solid rgba(192,149,90,.16);border-radius:2px;cursor:pointer;
  transition:color .2s,border-color .2s,transform .4s;
}
.note-head:hover .note-more{color:rgba(232,200,150,.95);border-color:rgba(192,149,90,.45);}
.note-more:active{transform:rotate(180deg);}

.note-sec{transition:flex-grow .45s cubic-bezier(.16,.84,.28,1);}
/* 按内容高低自然排：每段只占自己需要的高度，多出来的空白统一留在整列最下方 */
.note-sec[data-sec="lore"]{flex-grow:0 !important;}
.note-sec[data-sec="paper"]{flex-grow:0 !important;}
.note-sec[data-sec="notice"]{flex-grow:0 !important;}
.notecol{justify-content:flex-start !important;}
.note-sec{flex:0 0 auto !important;}
.note-sec > .note-body{flex:0 0 auto !important;max-height:none !important;}
.note-sec.off{flex-grow:0 !important;flex-basis:42px !important;min-height:42px;}

.note-sec{justify-content:flex-start !important;padding-top:14px !important;}
.note-sec:first-child{padding-top:4px !important;}
.note-body{justify-content:flex-start !important;}
.note-txt p{margin:0 0 7px;}
.note-txt p:last-child{margin-bottom:0;}
.note-hint{
  margin-top:9px !important;padding-top:7px;
  border-top:1px dashed rgba(192,149,90,.16);
  color:#c9a96f !important;font-size:11.5px !important;
}

/* ===== 旧课本排版修正 ===== */
.note-head{
  min-height:26px;
  display:flex !important;align-items:center !important;
}
.note-tools{display:flex;align-items:center;gap:6px;height:20px;}
.note-more,.note-fold{
  width:20px !important;height:20px !important;
  line-height:18px !important;
  font-size:11px !important;
  border-radius:2px !important;
  border:1px solid rgba(192,149,90,.22) !important;
  background:transparent;
  color:rgba(216,180,124,.6) !important;
  padding:0 !important;
  display:inline-flex;align-items:center;justify-content:center;
}
.note-more{position:relative;top:1px;}

.note-sec[data-sec="lore"] .note-src{
  font-size:11.5px;color:rgba(192,149,90,.72);letter-spacing:.06em;
  margin-bottom:10px;
}
.note-sec[data-sec="lore"] .note-txt p{
  font-size:13px;line-height:2.0;color:#cbbba1;margin:0 0 9px;
}
.note-hint{
  border-top:none !important;
  margin-top:12px !important;padding-top:0 !important;
  position:relative;
}
.note-hint::before{
  content:'';display:block;width:26px;height:1px;
  background:rgba(192,149,90,.35);margin-bottom:8px;
}
.note-sec[data-sec="lore"] .note-body::after{
  content:'·  ·  ·';
  display:block;text-align:center;letter-spacing:.3em;
  color:rgba(192,149,90,.22);font-size:11px;margin-top:16px;
}

/* ===== 旧课本四段式 ===== */
.lore-book{
  font-size:11px;color:rgba(192,149,90,.62);letter-spacing:.04em;
  margin-bottom:3px;
}
.lore-page{margin-left:8px;color:rgba(192,149,90,.42);}
.lore-title{
  font-family:var(--serif);font-size:13.5px;color:#e2d3b4;
  letter-spacing:.08em;margin-bottom:10px;
}
.lore-quote{
  font-size:13px;line-height:2.0;color:#cbbba1;
  padding-left:10px;border-left:1px solid rgba(192,149,90,.22);
  margin-bottom:10px;
}
.lore-note{
  font-size:12.5px;line-height:1.95;color:#a89a83;
  padding-left:10px;border-left:1px solid rgba(192,149,90,.10);
  margin-bottom:12px;font-style:italic;
}
.lore-hint{
  font-size:11.5px;line-height:1.8;color:#c9a96f;
  padding-top:8px;border-top:1px dashed rgba(192,149,90,.18);
}

/* 原文在上 / 横线 / 备注在下 / 提示并进备注 */
.lore-quote{
  border-left:none !important;
  padding-left:0 !important;
  font-family:var(--serif);
  font-size:13.5px !important;line-height:2.0;
  color:#ded0b2 !important;
  margin-bottom:0 !important;
}
.lore-rule{
  height:1px;background:rgba(192,149,90,.20);
  margin:13px 0 12px;
}
.lore-note{
  border-left:none !important;
  padding-left:0 !important;
  font-size:12.5px !important;line-height:1.95;
  color:#b9ab93 !important;
  margin-bottom:7px !important;
}
.lore-hint{
  border-top:none !important;
  padding-top:0 !important;
  font-size:12px !important;line-height:1.85;
  color:rgba(203,187,161,.62) !important;
}
.lore-hint::before{content:'\2014\2009';}

/* 备注：金色、正体、左对齐 */
.lore-note{
  font-style:normal !important;
  font-size:12.5px !important;
  line-height:1.95 !important;
  color:#d3b077 !important;
  text-align:left !important;
  letter-spacing:.01em;
  margin-bottom:8px !important;
}
/* 提示：暗一档，前缀小圆点 */
.lore-hint{
  font-size:11.5px !important;
  line-height:1.85 !important;
  color:rgba(203,187,161,.55) !important;
  text-align:left !important;
}
.lore-hint::before{
  content:'\00b7\2002' !important;
  color:rgba(192,149,90,.55);
}
.lore-quote,.lore-note,.lore-hint{text-align:left !important;}

.lore-note{font-style:italic !important;color:#d8b478 !important;}

/* ===== 禁书区（无名之书）===== */
.note-body.fbd .lore-book{color:rgba(178,110,84,.55) !important;}
.note-body.fbd .lore-title{
  color:#ecd3ab !important;letter-spacing:.14em;
}
.note-body.fbd .lore-title::before{
  content:'\25c6\2002';color:rgba(176,92,66,.85);font-size:9px;vertical-align:2px;
}
.note-body.fbd .lore-quote{
  color:#e0cfaf !important;font-size:14px !important;
}
.note-body.fbd .lore-rule{
  background:linear-gradient(90deg,rgba(176,92,66,.45),rgba(192,149,90,.06)) !important;
}
.note-body.fbd .lore-note{color:#c1925f !important;}
.note-body.fbd .lore-hint{color:rgba(200,160,120,.55) !important;}
.note-body.fbd .note-src{color:rgba(178,110,84,.5) !important;}

body.panel-open .notecol,
body.panel-open .logside,
body.panel-open .castcol{opacity:0;pointer-events:none;transition:opacity .2s;}
body.panel-open .side-tab{opacity:.35;}
#panel .modal-box{background:#141110 !important;}

/* 世界意志：不署名的一行行字 */
p.decree{
  font-family:var(--serif);
  color:#c9a86a !important;
  letter-spacing:.08em;
  text-align:center !important;
  text-indent:0 !important;
  margin:14px 0 !important;
  font-size:15px;
  opacity:.92;
}
/* 作者模式：页边批注 */
p.author{
  font-family:var(--serif);
  color:rgba(190,178,160,.72) !important;
  font-size:13px;
  letter-spacing:.05em;
  text-align:left !important;
  text-indent:0 !important;
  padding-left:14px;
  border-left:1px solid rgba(192,149,90,.22);
  margin:16px 0 !important;
}

/* 章节成就栏 */
.cbar{padding:2px 0 14px;margin-bottom:10px;border-bottom:1px solid rgba(192,149,90,.14);}
.cbar-t{font-size:12px;color:#c8b391;letter-spacing:.06em;}
.cbar-line{height:2px;background:rgba(192,149,90,.14);margin:8px 0 6px;border-radius:2px;overflow:hidden;}
.cbar-line i{display:block;height:100%;background:linear-gradient(90deg,rgba(192,149,90,.55),#d8b478);}
.cbar-s{font-size:11px;color:rgba(203,187,161,.55);}
.citem.future{opacity:.42;}
.citem.future .ct{letter-spacing:.06em;}
.citem.done .cid{color:rgba(192,149,90,.75);}
.citem.cur .ct{color:#e8d3ab;}

/* 首次填 Key 的引导 */
.keybox{margin:22px auto 0;max-width:420px;text-align:left;}
.keybox .kb-t{font-size:12px;color:#c8b391;margin-bottom:8px;letter-spacing:.04em;}
.keybox .kb-row{display:flex;gap:8px;}
.keybox input{flex:1;background:rgba(0,0,0,.35);border:1px solid rgba(192,149,90,.25);color:#e8ddc8;
  padding:10px 12px;border-radius:4px;font-size:13px;font-family:var(--mono,Consolas,monospace);}
.keybox input:focus{outline:none;border-color:rgba(192,149,90,.6);}
.keybox button{background:rgba(192,149,90,.16);border:1px solid rgba(192,149,90,.45);color:#e8d3ab;
  padding:0 16px;border-radius:4px;cursor:pointer;font-size:13px;}
.keybox button:hover{background:rgba(192,149,90,.28);}
.keybox .kb-h{font-size:11px;color:rgba(203,187,161,.45);margin-top:8px;line-height:1.8;}

.ptabs{flex-wrap:wrap;row-gap:6px;}
.ptab{padding:4px 9px !important;font-size:11.5px !important;}

body.panel-open .notecol,body.panel-open .logside,body.panel-open .castcol,body.panel-open .rail{display:none !important;}

body.empty-mode .notecol,body.empty-mode .logside,body.empty-mode .castcol{display:none !important;}

.scene-bg.on{opacity:.40 !important;}
.scene-bg.title.on{opacity:.62 !important;}


/* 这一轮没给选项时的提示 */
.optnone {
  margin: 10px 0 2px;
  font-size: 12px;
  color: rgba(230, 220, 205, .34);
  letter-spacing: .02em;
}


/* 等待：三个呼吸点 */
.waitdots{display:flex;gap:7px;align-items:center;padding:12px 2px}
.waitdots i{width:5px;height:5px;border-radius:50%;background:rgba(228,214,190,.55);
  animation:wd 1.5s ease-in-out infinite}
.waitdots i:nth-child(2){animation-delay:.25s}
.waitdots i:nth-child(3){animation-delay:.5s}
@keyframes wd{0%,100%{opacity:.18;transform:translateY(0)}45%{opacity:.75;transform:translateY(-3px)}}
@media (prefers-reduced-motion: reduce){.waitdots i{animation:none;opacity:.45}}


/* 屏外内容跳过渲染，滚动更稳 */
.drawer .pane > *{content-visibility:auto;contain-intrinsic-size:auto 64px}
#chapList > *{content-visibility:auto;contain-intrinsic-size:auto 44px}
@media (prefers-reduced-motion: reduce){.msg{animation:none}}

.loglist { display: flex; flex-direction: column; gap: 10px; }
.logitem { display: flex; gap: 10px; font-size: 14.5px; line-height: 1.6; }
.logn { flex: 0 0 auto; opacity: .4; font-variant-numeric: tabular-nums; width: 18px; text-align: right; }
.logt { flex: 1 1 auto; }

#btnLogQuick{display:none;}

/* 窗口不够宽时，顶栏的「读档」收起来（「存/读档」里两件事都能做），少挤一个按钮 */
@media (max-width:1500px){
  #btnLoad{display:none;}
  .topbtns{gap:6px;}
}

.cast-en{font-family:"Noto Sans SC",system-ui,sans-serif;font-size:11px;letter-spacing:.05em;
  color:rgba(214,200,178,.52);margin-top:3px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ===== 顶栏「更多」菜单 ===== */
#btnLoad,#btnNew{display:none !important;}
.moremenu{position:fixed;right:104px;top:52px;z-index:70;min-width:132px;
  background:rgba(20,18,16,.985);border:1px solid rgba(192,149,90,.30);border-radius:10px;
  padding:6px;display:flex;flex-direction:column;gap:2px;box-shadow:0 14px 34px rgba(0,0,0,.62);}
.moremenu[hidden]{display:none !important;}
.moremenu button{appearance:none;background:none;border:0;border-radius:7px;padding:9px 12px;
  text-align:left;font:inherit;font-size:13px;color:rgba(232,214,186,.92);cursor:pointer;}
.moremenu button:hover{background:rgba(192,149,90,.14);color:#f2e2c6;}
.icon.on{color:#d9a05b !important;border-color:rgba(217,160,91,.55) !important;background:rgba(217,160,91,.10);}
body.tts-paused .msg.speaking{opacity:.72;}
/* ===== 字号 / 缩进 / 配色 ===== */
body.no-indent .bubble p{text-indent:0 !important;}
.seg{display:flex;gap:6px;}
.segbtn{flex:1 1 0;padding:8px 0;border-radius:8px;border:1px solid rgba(192,149,90,.28);
  background:rgba(255,255,255,.02);color:rgba(232,214,186,.8);font:inherit;font-size:13px;cursor:pointer;}
.segbtn.on{background:rgba(192,149,90,.18);border-color:rgba(217,160,91,.66);color:#f2e2c6;}

/* 羊皮纸：只覆盖"看的这几块"，不重写整套皮肤 */
/* ===== 羊皮纸主题（重做版）===== */
body.paper{
  --ink:#2b2114; --ink-soft:#3c2f1d; --dim:rgba(70,52,30,.62); --dim2:rgba(70,52,30,.45);
  --line:rgba(120,92,58,.30); --line-soft:rgba(120,92,58,.20);
  background:
    linear-gradient(180deg, var(--p1,#f3e9d2) 0%, var(--p2,#e9dcc0) 46%, var(--p3,#ddcdac) 100%) !important;
}
body.paper .bg,body.paper .bgwrap{display:none !important;}
body.paper .topbar{
  background:linear-gradient(180deg,var(--p1,#f3e9d2),var(--p2,#e9dcc0)) !important;
  border-bottom-color:rgba(120,92,58,.28) !important;
  box-shadow:0 1px 0 rgba(255,255,255,.5) inset !important;
}
body.paper .title,body.paper .chap,body.paper .scene,body.paper .brand b{color:var(--pink2,#3a2a16) !important;}
body.paper .sub,body.paper .dim{color:rgba(70,52,30,.66) !important;}
body.paper .msg.assistant .bubble{color:var(--pink,#2b2114) !important;text-shadow:none !important;}
body.paper .msg.assistant .bubble strong,body.paper .msg.assistant .bubble em,body.paper .msg.assistant .bubble b{color:#1b1208 !important;}
/* 选项：必须是 .choices button */
body.paper .choices button{
  background:linear-gradient(180deg,var(--pc1,#fdf8ec),var(--pc2,#f4ead4)) !important;
  border-color:rgba(120,92,58,.30) !important;
  color:var(--pink,#2b2114) !important;
  box-shadow:0 1px 0 rgba(255,255,255,.7) inset,0 1px 2px rgba(90,66,36,.08) !important;
}
body.paper .choices button:hover,body.paper .choices button:focus{
  background:linear-gradient(180deg,#fffdf6,#f8f0dc) !important;
  border-color:rgba(150,108,60,.65) !important;
  box-shadow:0 2px 6px rgba(90,66,36,.12) !important;
}
body.paper .choices button .k,body.paper .choices button b{color:#8a6432 !important;}
body.paper .msg.user .bubble{
  background:linear-gradient(180deg,#e3d3b2,#d9c7a2) !important;
  color:var(--pink,#2b2114) !important;border-color:rgba(120,92,58,.26) !important;
}
body.paper .composer{
  background:linear-gradient(180deg,var(--p2,#e9dcc0),var(--p3,#ddcdac)) !important;
  border-top-color:rgba(120,92,58,.24) !important;
}
body.paper #input{
  background:var(--pi,#fffdf6) !important;color:var(--pink,#2b2114) !important;
  border-color:rgba(120,92,58,.30) !important;
}
body.paper #send,body.paper .composer .send{
  background:linear-gradient(180deg,#d8b579,#c39a55) !important;
  color:#241a0d !important;border-color:rgba(120,92,58,.45) !important;
}
body.paper .ghost,body.paper .icon{
  color:var(--pink3,#4a361f) !important;border-color:rgba(120,92,58,.32) !important;
  background:rgba(255,252,244,.62) !important;
}
body.paper .ghost:hover,body.paper .icon:hover{background:#fffdf6 !important;}
body.paper .logside,body.paper .rail,body.paper .castcol,body.paper .notecol{
  color:var(--pink2,#3a2c1a) !important;background:transparent !important;border-color:rgba(120,92,58,.20) !important;
}
body.paper .side-k,body.paper .cast-n,body.paper .note-k,body.paper .note-txt,body.paper .note-src{color:var(--pink3,#3f3020) !important;}
body.paper .side-item,body.paper .side-empty,body.paper .cast-s{color:rgba(70,52,30,.78) !important;}
body.paper .cast-face{border-color:rgba(120,92,58,.28) !important;background:#efe2c6 !important;color:#6b4c26 !important;}
body.paper .drawer,body.paper .modal-box,body.paper .mover{background:var(--p2,#f6ecd8) !important;color:var(--pink,#2b2114) !important;border-color:rgba(120,92,58,.30) !important;}
body.paper .drawer-head,body.paper .drawer-body{color:var(--pink,#2b2114) !important;border-color:rgba(120,92,58,.20) !important;}
body.paper .field span,body.paper .check span,body.paper .hint,body.paper label{color:var(--pink3,#3f3020) !important;}
body.paper select,body.paper input[type=text],body.paper input[type=password]{
  background:var(--pi,#fffdf6) !important;color:var(--pink,#2b2114) !important;border-color:rgba(120,92,58,.30) !important;
}
body.paper .segbtn{background:rgba(255,252,244,.55) !important;color:var(--pink3,#4a361f) !important;border-color:rgba(120,92,58,.28) !important;}
body.paper .segbtn.on{background:linear-gradient(180deg,#d8b579,#c39a55) !important;color:#241a0d !important;}
body.paper .page-foot{color:rgba(80,60,36,.45) !important;}
body.paper .keybox .kb-t{color:var(--pink3,#5b452a) !important;opacity:1 !important;}
body.paper .keybox .kb-h{color:rgba(70,52,30,.6) !important;}
body.paper .keybox input{background:#fffdf6 !important;border-color:rgba(120,92,58,.34) !important;color:var(--pink,#2b2114) !important;}
body.paper .keybox button{background:rgba(160,120,70,.14) !important;border-color:rgba(120,92,58,.4) !important;color:var(--pink3,#4a361f) !important;font-weight:600;}
body.paper button.primary{background:linear-gradient(180deg,#d8b579,#c39a55) !important;color:#241a0d !important;border-color:rgba(120,92,58,.5) !important;}
body.paper .quick button,body.paper #quick button{
  background:rgba(255,252,244,.72) !important;color:var(--pink3,#4a361f) !important;border-color:rgba(120,92,58,.35) !important;
}
body.paper #readBar{background:rgba(120,92,58,.16) !important;}
body.paper #readFill{background:linear-gradient(180deg,rgba(140,104,58,.9),rgba(120,92,58,.5)) !important;}
body.paper #bmBox,body.paper #readTip{
  background:#f6ecd8 !important;color:var(--pink,#2b2114) !important;border-color:rgba(120,92,58,.34) !important;
}
body.paper #bmBox h4{color:var(--pink2,#3a2a16) !important;}
body.paper #bmBox .bm-t{color:var(--pink3,#3c2f1d) !important;}
body.paper #bmBox .bm-d{color:rgba(70,52,30,.55) !important;}
body.paper #bmBox .bm-x{color:var(--pink3,#5b452a) !important;border-color:rgba(120,92,58,.3) !important;}
body.paper #readTip{color:var(--pink2,#3a2a16) !important;}
body.paper .tts-cur{background:rgba(160,120,70,.14) !important;box-shadow:inset 3px 0 0 rgba(150,108,60,.6) !important;}
body.paper ::-webkit-scrollbar-thumb{background:rgba(120,92,58,.32) !important;}
body.paper ::selection{background:rgba(160,120,70,.28) !important;}
/* 左对齐开关 */
body.align-left .msg.assistant .bubble{text-align:left !important;}


/* 阅读进度条 */
#readBar{position:fixed;width:3px;border-radius:2px;background:rgba(192,149,90,.14);z-index:30;pointer-events:none;opacity:0;transition:opacity .25s;}
#readBar.on{opacity:1;}
#readFill{display:block;width:100%;height:0;border-radius:2px;background:linear-gradient(180deg,rgba(217,160,91,.85),rgba(192,149,90,.45));}
.moremenu button[disabled]{opacity:.42;cursor:default;}

/* 朗读当前段高亮 */
.tts-cur{background:rgba(217,160,91,.13);box-shadow:inset 3px 0 0 rgba(217,160,91,.6);border-radius:6px;transition:background .18s;}
#readBar{cursor:pointer;}
#readBar.on{pointer-events:auto;}


/* 书签列表 */
#bmList{position:fixed;inset:0;z-index:80;display:none;background:rgba(6,5,4,.62);backdrop-filter:blur(3px);}
#bmList.on{display:block;}
#bmBox{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(520px,86vw);max-height:70vh;overflow:auto;
  background:#141210;border:1px solid rgba(192,149,90,.28);border-radius:14px;padding:18px 18px 10px;color:#e9dfcd;}
#bmBox h4{margin:0 0 12px;font-size:15px;font-weight:600;letter-spacing:.04em;color:#f0e2c6;}
#bmBox .bm-row{display:flex;align-items:center;gap:10px;padding:10px 8px;border-radius:9px;cursor:pointer;}
#bmBox .bm-row:hover{background:rgba(192,149,90,.10);}
#bmBox .bm-t{flex:1 1 auto;font-size:13px;color:#d9cbb2;}
#bmBox .bm-d{font-size:11px;color:rgba(200,185,160,.5);}
#bmBox .bm-x{padding:2px 8px;border-radius:6px;border:1px solid rgba(192,149,90,.22);background:transparent;color:rgba(220,200,175,.7);font-size:11px;cursor:pointer;}
#bmBox .bm-empty{font-size:13px;color:rgba(200,185,160,.55);padding:16px 4px;}
#bmClose{position:absolute;right:12px;top:10px;border:none;background:transparent;color:rgba(230,215,190,.7);font-size:18px;cursor:pointer;}

/* 拖动百分比气泡 */
#readTip{position:fixed;z-index:31;padding:3px 8px;border-radius:7px;background:rgba(20,17,13,.92);
  border:1px solid rgba(192,149,90,.35);color:#f0dfc0;font-size:11px;pointer-events:none;opacity:0;transition:opacity .12s;}
#readTip.on{opacity:1;}

/* ===== 窄视口分级：1100–1499 只保留左栏，右侧三栏与在场收起；<1100 只留正文 ===== */
@media (min-width:1100px) and (max-width:1499px){
  .logside{display:block !important;width:216px !important;padding-right:14px !important;}
  .logside .side-inner{max-height:calc(100vh - 152px) !important;overflow-y:auto !important;}
  .castcol{display:none !important;}
  .notecol{display:none !important;}
  .msg{max-width:min(46em, calc(100vw - 500px)) !important;}
}
@media (max-width:1099px){
  .castcol{display:none !important;}
}
/* 羊皮纸：彻底关掉场景照片，只留纸 */
body.paper .scene-bg,body.paper #bgA,body.paper #bgB{opacity:0 !important;filter:none !important;}
body.paper .edge{opacity:0 !important;}
body.paper::before{display:none !important;}
/* 纸面纹理（很轻的暖色颗粒） */
body.paper::after{display:none !important;
  content:"";position:fixed;inset:0;pointer-events:none;z-index:0;opacity:.5;
  background-image:radial-gradient(rgba(120,92,58,.05) 1px,transparent 1px);
  background-size:3px 3px;
}
/* 羊皮纸：右侧三栏不许叠字，用户气泡加深 */
body.paper .notecol{height:auto !important;max-height:calc(100vh - 150px) !important;overflow-y:auto !important;overflow-x:hidden !important;}
body.paper .note-sec{flex:0 0 auto !important;}
body.paper .note-body{max-height:none !important;overflow:visible !important;}
body.paper .msg.user .bubble{background:linear-gradient(180deg,#e2cfa9,#d6c196) !important;color:var(--pink,#241a0f) !important;border-color:rgba(120,92,58,.34) !important;}
body.paper .rail,body.paper .rail *{color:var(--pink2,#3a2c1a) !important;}
body.paper .rail .k,body.paper .rail .lab{color:rgba(70,52,30,.72) !important;}
body.paper .logside .side-k{color:var(--pink3,#5b452a) !important;}
body.paper .logside .side-item,body.paper .logside .side-empty{color:var(--pink3,#3c2f1d) !important;}
/* 羊皮纸：右栏恢复裁剪，正文整体让出右栏宽度 */
body.paper .notecol{top:104px !important;bottom:150px !important;height:auto !important;}
body.paper .note-body{max-height:260px !important;overflow:hidden !important;}
@media (min-width:1500px){
  #log{padding-left:478px !important;padding-right:272px !important;}
  .msg{max-width:min(46em, calc(100vw - 760px)) !important;margin-left:auto !important;margin-right:auto !important;}
}
@media (min-width:1500px) and (max-width:1679px){
  .notecol{display:none !important;}
}
@media (min-width:1680px){
  #log{padding-right:470px !important;}
  .msg{max-width:min(46em, calc(100vw - 970px)) !important;}
}
@media (min-width:1100px) and (max-width:1499px){
  #log{padding-left:238px !important;padding-right:8px !important;}
}
/* 羊皮纸：去掉旧课本里的装饰叠字 */
body.paper .note-sec[data-sec="lore"] .note-body::after{display:none !important;}

/* 羊皮纸：去掉暗角，标题页也要干净 */
body.paper::after{display:none !important;}
body.paper .landing,body.paper #landing,body.paper .hero{background:transparent !important;}
body.paper .keybox .kb-h,body.paper .keybox .hint,body.paper .sub,body.paper .dim{color:rgba(70,52,30,.72) !important;}
body.paper .keybox button{color:#3f3020 !important;}
body.paper #startBtn,body.paper .start{background:linear-gradient(180deg,#d8b579,#c39a55) !important;color:#241a0d !important;}
/* 羊皮纸：标题页的暗色光晕换成暖白光 */
body.paper #empty{background:radial-gradient(closest-side, rgba(255,252,244,.62), rgba(255,252,244,0) 78%) !important;}
body.paper #empty .dim,body.paper #empty p{color:rgba(70,52,30,.72) !important;}
/* ===== 羊皮纸：把侧栏/正文里所有漏网的浅色字一次性压成墨色 ===== */
body.paper .logside *,body.paper .castcol *,body.paper .notecol *,body.paper .rail *{
  color:var(--pink,#2b2114) !important;text-shadow:none !important;
}
body.paper .logside .side-k,body.paper .notecol .note-k,body.paper .note-src,
body.paper .cast-head,body.paper .rail .k,body.paper .rail .lab{
  color:var(--pink2,#3a2a16) !important;
}
body.paper .msg.assistant .bubble,body.paper .msg.assistant .bubble *,
body.paper .msg.assistant .bubble p.opt{color:var(--pink,#2b2114) !important;}
body.paper .choices button,body.paper .choices button *{color:var(--pink,#2b2114) !important;}
body.paper .choices button .k,body.paper .choices button b{color:var(--pink2,#6b4c26) !important;}
body.paper .meta,body.paper .scene-line,body.paper .stage{color:var(--pink3,#3f3020) !important;}
.lic{font-size:10.5px;letter-spacing:.06em;color:rgba(176,150,108,.72);margin-top:2px;}
body.paper .lic{color:rgba(96,76,48,.72) !important;}

#btnRestart{display:inline-flex !important;align-items:center;}
#btnRestart:hover{color:#f2e2c6;border-color:rgba(192,149,90,.5);}

.cfm{position:fixed;inset:0;z-index:90;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.56)}
.cfm[hidden]{display:none!important;}
.cfm-box{width:min(420px,86vw);background:#1a1613;border:1px solid rgba(192,149,90,.28);border-radius:14px;padding:22px 22px 16px;box-shadow:0 18px 48px rgba(0,0,0,.5)}
.cfm-box p{margin:0 0 18px;font-size:15.5px;line-height:1.75;color:#e3d3b6}
.cfm-btns{display:flex;justify-content:flex-end;gap:10px}
.cfm-btns button{min-width:86px;height:34px;border-radius:8px;font-size:13.5px}
body.paper .cfm-box{background:#f2e7cf;border-color:rgba(120,92,58,.3)}
body.paper .cfm-box p{color:#2b2114}
