/* ═══════════════════════════════════════════
 * 光湖智库 · 主样式表 v3.0 · 星空呈住版
 * guanghu.online · ZY-PROJ-006
 * 守护: 铸渊 · ICE-GL-ZY001
 * 版权: 国作登字-2026-A-00037559
 *
 * v3.0: 三栏布局 + 双栏登录 + 书岱聊天拓开 · 霜砚设计
 * ═══════════════════════════════════════════ */

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root{
  /* 深空背景 */
  --bg-deep:#0a0e27;--bg-purple:#1a1438;
  /* 月光金 */
  --moon-gold:#d4a574;--moon-gold-soft:rgba(212,165,116,.4);--moon-gold-faint:rgba(212,165,116,.15);
  /* 湖水青 */
  --lake-blue:#6fa8dc;--lake-blue-soft:rgba(111,168,220,.3);
  /* 绿色·在线 */
  --green:#7fc8a9;
  /* 文字 */
  --text-main:#e8eaf6;--text-soft:#8892b0;--text-faint:#4a5278;
  /* 玻璃面板 */
  --glass-bg:rgba(20,25,60,.4);--glass-border:rgba(212,165,116,.2);
  /* 功能色 (兼容旧代码) */
  --bg:#0a0e27;--panel:rgba(12,18,40,0.94);
  --card:rgba(20,25,60,.4);--card-border:rgba(212,165,116,.15);
  --card-hover:rgba(212,165,116,.3);
  --purple:#a78bfa;--violet:#c4b5fd;--cyan:#22d3ee;--blue:#60a5fa;
  --ok:#7fc8a9;--warn:#fbbf24;--err:#f87171;
  --text:#e8eaf6;--dim:#8892b0;--muted:rgba(120,150,200,0.4);
  --border:rgba(212,165,116,.15);
  --font:'Noto Serif SC','Songti SC',-apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif;
  --mono:'SF Mono','JetBrains Mono','Fira Code',monospace
}

html{font-size:16px;scroll-behavior:smooth}
body{
  font-family:var(--font);background:var(--bg-deep);color:var(--text-main);
  height:100vh;overflow:hidden;
  -webkit-font-smoothing:antialiased
}
a{color:var(--lake-blue);text-decoration:none;transition:color .3s}
a:hover{color:var(--moon-gold)}
::-webkit-scrollbar{width:5px}
::-webkit-scrollbar-thumb{background:rgba(212,165,116,.2);border-radius:3px}
code{font-family:var(--mono);font-size:12px;padding:2px 6px;border-radius:4px;background:rgba(212,165,116,.1);color:var(--moon-gold)}

/* ═══ 背景 ═══ */
.cosmos{position:fixed;inset:0;z-index:0;pointer-events:none;
  background:
    radial-gradient(ellipse at 25% 30%,rgba(80,60,140,.35) 0%,transparent 50%),
    radial-gradient(ellipse at 75% 70%,rgba(40,80,140,.28) 0%,transparent 50%),
    radial-gradient(ellipse at 50% 50%,var(--bg-purple) 0%,var(--bg-deep) 70%)}
#starCanvas{position:absolute;inset:0;width:100%;height:100%}
.nebula{position:fixed;border-radius:50%;filter:blur(120px);opacity:.06;pointer-events:none;z-index:0}
.neb-1{width:55vw;height:50vh;background:radial-gradient(circle,#a78bfa,transparent);top:-10%;right:-5%;animation:nebDrift 22s ease-in-out infinite alternate}
.neb-2{width:45vw;height:40vh;background:radial-gradient(circle,#6fa8dc,transparent);bottom:5%;left:-8%;animation:nebDrift 28s ease-in-out infinite alternate-reverse}
.neb-3{width:35vw;height:30vh;background:radial-gradient(circle,#d4a574,transparent);top:40%;left:30%;animation:nebDrift 32s ease-in-out infinite alternate;opacity:.04}
@keyframes nebDrift{0%{transform:translate(0,0) scale(1)}100%{transform:translate(15px,-10px) scale(1.05)}}

/* ═══ 登录弹窗 · 双栏版 ═══ */
.login-overlay{
  position:fixed;inset:0;z-index:100;
  display:flex;align-items:center;justify-content:center;padding:40px;
  animation:fadeIn .5s ease-out
}
.login-overlay.hidden{display:none}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}

.login-card{
  display:grid;grid-template-columns:1fr 1fr;
  width:100%;max-width:880px;min-height:540px;
  background:var(--glass-bg);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);
  border:1px solid var(--glass-border);border-radius:24px;overflow:hidden;
  box-shadow:0 20px 80px rgba(0,0,0,.6),0 0 100px rgba(212,165,116,.08);
  animation:slideUp .6s ease-out
}
@keyframes slideUp{from{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}

/* 左侧·守藏者插画区 */
.login-illust{
  position:relative;
  background:
    radial-gradient(circle at 50% 35%,rgba(212,165,116,.18) 0%,transparent 60%),
    linear-gradient(180deg,rgba(40,30,80,.4),rgba(20,15,50,.6));
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:48px 32px;border-right:1px solid rgba(212,165,116,.15)
}

/* 灯笼 */
.lantern{width:80px;height:100px;position:relative;margin-bottom:32px}
.lantern-light{
  position:absolute;inset:-30px;border-radius:50%;
  background:radial-gradient(circle,rgba(212,165,116,.5) 0%,transparent 70%);
  animation:halo 3.5s ease-in-out infinite
}
@keyframes halo{0%,100%{opacity:.5;transform:scale(1)}50%{opacity:.95;transform:scale(1.2)}}
.lantern-body{
  position:absolute;top:15px;left:15px;right:15px;bottom:15px;
  background:linear-gradient(180deg,#d4a574,#a87f4e);
  border-radius:50% 50% 45% 45% / 60% 60% 40% 40%;
  box-shadow:0 0 30px rgba(212,165,116,.6),inset 0 -10px 20px rgba(0,0,0,.3)
}
.lantern-top{position:absolute;top:0;left:30px;width:20px;height:8px;background:#3a2d1c;border-radius:2px}
.lantern-rope{position:absolute;top:-15px;left:38px;width:2px;height:18px;background:#5a4a30}

.illust-title{font-size:24px;font-weight:400;letter-spacing:.5em;color:var(--text-main);margin-bottom:12px;padding-left:.5em}
.illust-sub{font-family:'Inter',sans-serif;font-size:11px;letter-spacing:.4em;color:var(--text-soft);margin-bottom:24px}
.illust-verse{text-align:center;font-size:14px;font-style:italic;color:var(--moon-gold);line-height:2;letter-spacing:.1em;animation:vbreathe 6s ease-in-out infinite}
@keyframes vbreathe{0%,100%{opacity:.55}50%{opacity:.95}}

/* 右侧·表单区 */
.login-form-side{padding:64px 56px;display:flex;flex-direction:column;justify-content:center}
.login-welcome{font-size:13px;letter-spacing:.3em;color:var(--lake-blue);margin-bottom:8px;font-family:'Inter',sans-serif}
.login-title{font-size:28px;font-weight:400;letter-spacing:.15em;color:var(--text-main);margin-bottom:8px}
.login-sub{font-size:13px;color:var(--text-soft);line-height:1.8;margin-bottom:36px;letter-spacing:.05em}
.login-form{display:flex;flex-direction:column;gap:16px}
.login-field{display:flex;flex-direction:column;gap:8px}
.login-label{font-size:11px;letter-spacing:.25em;color:var(--text-soft);font-family:'Inter',sans-serif}
.login-input{
  width:100%;padding:14px 18px;font-size:15px;color:var(--text-main);
  background:rgba(10,15,40,.5);border:1px solid rgba(212,165,116,.2);border-radius:10px;
  font-family:inherit;letter-spacing:.05em;transition:all .3s;outline:none
}
.login-input:focus{border-color:var(--moon-gold);box-shadow:0 0 0 3px rgba(212,165,116,.15)}
.login-input::placeholder{color:var(--text-faint)}
.login-code-wrap{display:flex;gap:8px}
.login-code-input{flex:1}
.login-send-btn{
  padding:10px 16px;border-radius:10px;border:1px solid rgba(111,168,220,.3);
  background:rgba(111,168,220,.08);color:var(--lake-blue);font-size:13px;
  cursor:pointer;transition:all .25s;font-family:inherit;white-space:nowrap
}
.login-send-btn:hover:not(:disabled){background:rgba(111,168,220,.15);transform:translateY(-1px)}
.login-send-btn:disabled{opacity:.4;cursor:not-allowed}
.login-btn{
  width:100%;padding:16px;margin-top:4px;font-size:15px;letter-spacing:.3em;
  background:linear-gradient(135deg,rgba(212,165,116,.25),rgba(212,165,116,.15));
  color:var(--moon-gold);border:1px solid var(--moon-gold);border-radius:10px;
  cursor:pointer;font-family:inherit;transition:all .4s
}
.login-btn:hover{
  background:linear-gradient(135deg,rgba(212,165,116,.5),rgba(212,165,116,.3));
  color:#fff;box-shadow:0 8px 30px rgba(212,165,116,.4)
}
.login-verify-btn{color:var(--lake-blue);border-color:var(--lake-blue)}
.login-verify-btn:hover{background:linear-gradient(135deg,rgba(111,168,220,.3),rgba(111,168,220,.15));color:#fff;box-shadow:0 8px 30px rgba(111,168,220,.3)}
.login-msg{margin-top:12px;font-size:12px;min-height:18px;color:var(--text-soft)}
.login-msg.err{color:var(--err)}
.login-msg.ok{color:var(--ok)}
.login-msg.info{color:var(--lake-blue)}
.login-footer{margin-top:28px;font-size:10px;letter-spacing:.2em;color:var(--text-faint);line-height:2;font-family:'Inter',sans-serif}

@media(max-width:720px){
  .login-card{grid-template-columns:1fr;max-width:440px}
  .login-illust{padding:36px;min-height:200px}
  .login-form-side{padding:40px 32px}
}

/* ═══ 主页面框架 ═══ */
.page{position:relative;z-index:1}

/* ═══ 顶栏 ═══ */
.topbar{
  position:fixed;top:0;left:0;right:0;height:56px;
  display:flex;align-items:center;justify-content:space-between;
  padding:0 24px;background:rgba(10,14,39,.7);backdrop-filter:blur(20px);
  border-bottom:1px solid rgba(212,165,116,.1);z-index:10
}
.brand{display:flex;align-items:center;gap:10px;font-size:15px;letter-spacing:.2em;color:var(--text-main)}
.brand-icon{
  width:28px;height:28px;border-radius:6px;
  background:linear-gradient(135deg,#d4a574,#a87f4e);
  display:flex;align-items:center;justify-content:center;
  font-size:12px;color:#0a0e27;font-weight:600;font-family:'Inter',sans-serif
}
.brand-sub{font-family:'Inter',sans-serif;font-size:11px;color:var(--text-faint);letter-spacing:.15em;margin-left:8px}
.topbar-right{display:flex;align-items:center;gap:16px;font-size:12px;color:var(--text-soft)}
.uptime-label{font-family:'Inter',sans-serif;letter-spacing:.1em}
.api-status{font-family:'Inter',sans-serif}
.api-status.ok{color:var(--ok)}
.api-status.err{color:var(--err)}
.api-status.warn{color:var(--warn)}
.user-bar{display:flex;align-items:center;gap:8px;padding:6px 12px;border-radius:10px;
  background:rgba(212,165,116,.06);border:1px solid rgba(212,165,116,.1);font-size:12px;color:var(--text-soft)}
.user-logout-btn{
  padding:4px 10px;border:1px solid rgba(248,113,113,.15);border-radius:6px;
  background:transparent;color:var(--err);font-size:11px;cursor:pointer;
  transition:all .2s;font-family:inherit
}
.user-logout-btn:hover{background:rgba(248,113,113,.08)}

/* ═══ 三栏布局 ═══ */
.shell{
  position:fixed;top:56px;bottom:0;left:0;right:0;
  display:grid;grid-template-columns:240px 1fr 320px;
  gap:12px;padding:12px;overflow:hidden
}

/* ═══ 左侧边栏 ═══ */
.side-l{
  background:var(--glass-bg);backdrop-filter:blur(24px);
  border:1px solid var(--glass-border);border-radius:16px;
  padding:20px 16px;overflow-y:auto;display:flex;flex-direction:column;gap:0
}
.nav-section{margin-bottom:24px}
.nav-title{font-size:10px;letter-spacing:.3em;color:var(--text-faint);margin-bottom:10px;font-family:'Inter',sans-serif}
.nav-item{
  display:flex;align-items:center;gap:8px;padding:9px 10px;border-radius:8px;
  font-size:13px;color:var(--text-soft);cursor:pointer;transition:all .25s;
  margin-bottom:3px;letter-spacing:.05em
}
.nav-item:hover{background:rgba(212,165,116,.08);color:var(--text-main)}
.nav-item.active{
  background:rgba(212,165,116,.15);color:var(--moon-gold);
  border-left:2px solid var(--moon-gold);padding-left:8px
}
.stat-card{
  padding:12px 14px;border-radius:10px;background:rgba(10,15,40,.4);
  border:1px solid rgba(212,165,116,.1);margin-bottom:8px
}
.stat-num{font-size:20px;font-family:'Inter',sans-serif;font-weight:300;color:var(--moon-gold);letter-spacing:.05em}
.stat-cos{color:var(--ok)}
.stat-label{font-size:10px;color:var(--text-soft);letter-spacing:.2em;margin-top:3px}

/* ═══ 中央主区 ═══ */
.center{display:flex;flex-direction:column;gap:10px;min-height:0;overflow:hidden}

.greet{
  flex:0 0 auto;padding:16px 22px;
  background:var(--glass-bg);backdrop-filter:blur(24px);
  border:1px solid var(--glass-border);border-radius:14px;
  display:flex;align-items:center;justify-content:space-between;gap:16px
}
.greet-title{font-size:18px;font-weight:400;letter-spacing:.15em;color:var(--text-main)}
.greet-sub{font-size:12px;color:var(--text-soft);letter-spacing:.1em;margin-top:3px}

.search-mini{
  flex:0 0 auto;display:flex;align-items:center;gap:8px;
  padding:8px 14px;background:rgba(10,15,40,.5);
  border:1px solid rgba(212,165,116,.15);border-radius:999px;width:260px
}
.search-mini:focus-within{border-color:var(--moon-gold);box-shadow:0 0 0 2px rgba(212,165,116,.1)}
.search-icon{color:var(--text-soft);flex:0 0 auto}
.search-mini-input{
  flex:1;background:none;border:none;color:var(--text-main);font-size:13px;
  font-family:inherit;outline:none
}
.search-mini-input::placeholder{color:var(--text-faint)}
.search-mini-btn{
  flex:0 0 auto;background:none;border:none;color:var(--moon-gold);
  font-size:12px;cursor:pointer;letter-spacing:.1em;font-family:inherit;
  transition:opacity .2s
}
.search-mini-btn:hover{opacity:.7}

/* 搜索结果面板 */
.search-results-panel{
  flex:1;overflow-y:auto;background:var(--glass-bg);backdrop-filter:blur(24px);
  border:1px solid var(--glass-border);border-radius:14px;padding:16px;min-height:0
}
.search-results-panel::-webkit-scrollbar{width:5px}
.search-results-panel::-webkit-scrollbar-thumb{background:rgba(212,165,116,.2);border-radius:3px}

/* ═══ 聊天区 ═══ */
.chat{
  flex:1;background:var(--glass-bg);backdrop-filter:blur(24px);
  border:1px solid var(--glass-border);border-radius:14px;
  display:flex;flex-direction:column;min-height:0;overflow:hidden
}
.chat-head{
  flex:0 0 auto;padding:14px 20px;border-bottom:1px solid rgba(212,165,116,.1);
  display:flex;align-items:center;gap:12px;flex-wrap:wrap
}
.chat-avatar{
  position:relative;width:40px;height:40px;border-radius:50%;
  background:linear-gradient(135deg,#d4a574,#a87f4e);
  display:flex;align-items:center;justify-content:center;font-size:18px;flex:0 0 40px
}
.chat-avatar::after{
  content:'';position:absolute;bottom:-1px;right:-1px;
  width:11px;height:11px;border-radius:50%;
  background:var(--green);border:2px solid var(--bg-deep);
  animation:dot-pulse 2s ease-in-out infinite
}
@keyframes dot-pulse{0%,100%{opacity:.6;transform:scale(.9)}50%{opacity:1;transform:scale(1.2)}}
.chat-head-name{font-size:14px;letter-spacing:.1em;color:var(--text-main)}
.chat-head-id{font-family:'Inter',sans-serif;font-size:10px;color:var(--text-faint);letter-spacing:.2em;margin-top:1px}
.chat-head-quote{margin-left:auto;font-size:11px;color:var(--moon-gold);font-style:italic;letter-spacing:.05em;opacity:.7;flex:0 1 auto;text-align:right}
.agent-status{font-size:10px;color:var(--ok);font-family:'Inter',sans-serif;flex:0 0 auto}

.msgs{
  flex:1;overflow-y:auto;padding:24px 28px;
  display:flex;flex-direction:column;gap:18px;min-height:0
}
.msgs::-webkit-scrollbar{width:5px}
.msgs::-webkit-scrollbar-thumb{background:rgba(212,165,116,.2);border-radius:3px}

.msg{display:flex;gap:10px;max-width:78%}
.msg.bot{align-self:flex-start}
.msg.me{align-self:flex-end;flex-direction:row-reverse}
.msg-avatar{
  flex:0 0 32px;width:32px;height:32px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;font-size:14px
}
.msg.bot .msg-avatar{background:linear-gradient(135deg,#d4a574,#a87f4e)}
.msg.me .msg-avatar{background:linear-gradient(135deg,#6fa8dc,#4a7cb0)}
.bubble{
  padding:13px 16px;border-radius:14px;font-size:14px;
  line-height:1.85;letter-spacing:.03em;color:var(--text-main);
  animation:msgIn .3s ease-out
}
@keyframes msgIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
.msg.bot .bubble{
  background:rgba(212,165,116,.06);border:1px solid rgba(212,165,116,.12);
  border-top-left-radius:4px
}
.msg.me .bubble{
  background:rgba(111,168,220,.1);border:1px solid rgba(111,168,220,.18);
  border-top-right-radius:4px
}
.bubble.shulan-welcome{
  background:rgba(212,165,116,.04) !important;
  border-color:rgba(212,165,116,.1) !important;
  line-height:2 !important
}

/* 旧版agent-msg兼容（JS appendAgentMessage 使用这些类） */
.agent-msg{display:flex;gap:10px;max-width:78%;animation:msgIn .3s ease-out}
.agent-msg-bot{align-self:flex-start}
.agent-msg-user{align-self:flex-end;flex-direction:row-reverse}
.agent-msg-content{
  padding:13px 16px;border-radius:14px;font-size:14px;line-height:1.85;
  background:rgba(212,165,116,.06);border:1px solid rgba(212,165,116,.12);
  border-top-left-radius:4px;color:var(--text-main)
}
.agent-msg-user .agent-msg-content{
  background:rgba(111,168,220,.1);border-color:rgba(111,168,220,.18);
  border-top-left-radius:14px;border-top-right-radius:4px;color:var(--lake-blue)
}
.agent-msg-thinking .agent-msg-content{color:var(--dim);font-style:italic}

/* 聊天输入栏 */
.chat-input-bar{
  flex:0 0 auto;padding:14px 20px;border-top:1px solid rgba(212,165,116,.1);
  display:flex;gap:10px;align-items:flex-end
}
.chat-input-area{
  flex:1;display:flex;padding:10px 14px;
  background:rgba(10,15,40,.5);border:1px solid rgba(212,165,116,.2);
  border-radius:12px;transition:border .3s
}
.chat-input-area:focus-within{border-color:var(--moon-gold);box-shadow:0 0 0 3px rgba(212,165,116,.1)}
.agent-input-ta{
  flex:1;background:none;border:none;color:var(--text-main);font-size:14px;
  font-family:inherit;outline:none;resize:none;line-height:1.6;
  max-height:120px;letter-spacing:.03em
}
.agent-input-ta::placeholder{color:var(--text-faint);font-style:italic}
/* 兼容旧版 agent-input (JS 读取 #agentInput 的 .value) */
.agent-input{
  flex:1;background:none;border:none;color:var(--text-main);font-size:14px;
  font-family:inherit;outline:none;resize:none;line-height:1.6;
  max-height:120px;letter-spacing:.03em
}
.agent-input::placeholder{color:var(--text-faint);font-style:italic}
.chat-send-btn{
  flex:0 0 auto;padding:10px 20px;
  background:linear-gradient(135deg,rgba(212,165,116,.3),rgba(212,165,116,.15));
  color:var(--moon-gold);border:1px solid var(--moon-gold);border-radius:10px;
  cursor:pointer;font-family:inherit;font-size:13px;letter-spacing:.2em;
  transition:all .3s;white-space:nowrap
}
.chat-send-btn:hover{
  background:linear-gradient(135deg,rgba(212,165,116,.5),rgba(212,165,116,.3));
  color:#fff;box-shadow:0 4px 16px rgba(212,165,116,.3)
}

/* ═══ 右侧模块列表 ═══ */
.side-r{
  overflow-y:auto;display:flex;flex-direction:column;gap:10px
}
.side-r::-webkit-scrollbar{width:4px}
.side-r::-webkit-scrollbar-thumb{background:rgba(212,165,116,.15);border-radius:3px}
.module-card{
  flex:0 0 auto;padding:14px 16px;
  background:var(--glass-bg);backdrop-filter:blur(24px);
  border:1px solid var(--glass-border);border-radius:12px;
  cursor:pointer;transition:all .3s;display:flex;align-items:center;gap:12px
}
.module-card:hover{
  border-color:var(--moon-gold);transform:translateX(-2px);
  box-shadow:-4px 0 20px rgba(212,165,116,.12)
}
.module-icon{font-size:22px;flex:0 0 auto;filter:drop-shadow(0 0 5px var(--moon-gold-soft))}
.module-info{flex:1;min-width:0}
.module-name{font-size:13px;color:var(--text-main);letter-spacing:.08em;margin-bottom:3px}
.module-desc{font-size:11px;color:var(--text-soft);letter-spacing:.03em;line-height:1.5}
.module-status{font-size:10px;font-family:'Inter',sans-serif;letter-spacing:.15em;flex:0 0 auto;display:flex;align-items:center;gap:4px}
.s-dot{width:6px;height:6px;border-radius:50%;animation:dot-pulse 2s ease-in-out infinite}
.s-on .s-dot{background:var(--green);box-shadow:0 0 6px var(--green)}
.s-on{color:var(--green)}
.s-pending .s-dot{background:var(--moon-gold);box-shadow:0 0 6px var(--moon-gold);animation-delay:.5s}
.s-pending{color:var(--moon-gold)}
.side-r-foot{
  margin-top:auto;padding:12px;text-align:center;
  font-size:9px;color:var(--text-faint);letter-spacing:.15em;line-height:1.8;
  border-top:1px solid rgba(212,165,116,.08);font-family:'Inter',sans-serif
}

/* ═══ 下载进度 ═══ */
.download-progress-card{
  padding:16px 20px;border-radius:12px;margin-bottom:10px;
  background:rgba(111,168,220,.04);border:1px solid rgba(111,168,220,.12);
  animation:dlFadeIn .4s ease-out
}
@keyframes dlFadeIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}
.download-progress-card.dl-done{border-color:rgba(127,200,169,.2);background:rgba(127,200,169,.04)}
.dl-title{font-size:13px;font-weight:600;margin-bottom:10px;color:var(--text-main)}
.dl-bar-wrap{height:6px;border-radius:3px;background:rgba(111,168,220,.08);overflow:hidden;margin-bottom:8px}
.dl-bar{height:100%;border-radius:3px;background:linear-gradient(90deg,var(--lake-blue),var(--moon-gold));transition:width .5s ease-out}
.dl-status{font-size:11px;color:var(--text-soft)}

/* ═══ 搜索结果 v3.0 ═══ */
.search-summary{font-size:11px;color:var(--text-soft);margin-bottom:10px;padding:0 4px}
.search-loading{animation:search-pulse 1.5s ease-in-out infinite;text-align:center;padding:24px;color:var(--text-soft)}
@keyframes search-pulse{0%,100%{opacity:1}50%{opacity:.5}}
.no-results{text-align:center;padding:24px;color:var(--text-soft);font-size:13px}
.search-result-card{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:14px 16px;border-radius:12px;margin-bottom:8px;
  background:rgba(10,15,40,.5);border:1px solid var(--card-border);transition:all .25s
}
.search-result-card:hover{border-color:var(--moon-gold-soft);background:rgba(10,15,40,.7)}
.result-info{flex:1;min-width:0}
.result-title{font-size:14px;font-weight:600;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text-main)}
.result-meta{font-size:11px;color:var(--text-soft);margin-bottom:6px}
.result-source{display:flex;gap:6px;flex-wrap:wrap}
.source-badge{
  font-size:10px;padding:2px 8px;border-radius:10px;
  border:1px solid rgba(212,165,116,.2);color:var(--text-soft);font-family:var(--mono)
}
.local-badge{color:var(--ok);border-color:rgba(127,200,169,.2);background:rgba(127,200,169,.06)}
.result-actions{display:flex;gap:6px;flex-shrink:0}
.result-btn{
  padding:7px 12px;border-radius:9px;border:1px solid var(--border);
  background:rgba(10,15,40,.5);color:var(--text-main);font-size:12px;
  cursor:pointer;transition:all .25s;font-family:inherit;white-space:nowrap
}
.result-btn:hover{border-color:var(--moon-gold);background:rgba(212,165,116,.08)}
.result-btn-dl{color:var(--lake-blue);border-color:rgba(111,168,220,.2)}
.result-btn-dl:hover{background:rgba(111,168,220,.1);border-color:rgba(111,168,220,.4)}
.result-btn-read{color:var(--moon-gold);border-color:rgba(212,165,116,.2)}
.result-btn-read:hover{background:rgba(212,165,116,.1);border-color:rgba(212,165,116,.4)}
.source-status-bar{
  padding:10px 14px;margin-bottom:10px;border-radius:10px;
  background:rgba(248,113,113,.06);border:1px solid rgba(248,113,113,.15);
  color:var(--warn);font-size:12px;line-height:1.8
}
.source-err-tag{
  display:inline-block;padding:2px 8px;margin:2px 4px;border-radius:6px;
  background:rgba(248,113,113,.08);border:1px solid rgba(248,113,113,.12);
  color:var(--err);font-size:11px;font-family:var(--mono)
}

/* ═══ 书岱 Agent 消息增强 ═══ */
.agent-code{font-size:10px;color:var(--text-faint);font-family:var(--mono);font-weight:400;margin-left:6px}
.agent-msg-tool{
  margin-top:8px;padding:10px 14px;border-radius:10px;font-size:11px;
  background:rgba(127,200,169,.06);border:1px solid rgba(127,200,169,.1);
  color:var(--ok);font-family:var(--mono);max-height:200px;overflow-y:auto
}
.thinking-dots{display:inline-block;animation:shulanDots 1.4s steps(3,end) infinite}
@keyframes shulanDots{0%{opacity:.3}50%{opacity:1}100%{opacity:.3}}
.shulan-divider{border:none;border-top:1px solid rgba(212,165,116,.12);margin:12px 0}
.shulan-quote{
  border-left:2px solid rgba(212,165,116,.3);
  padding:4px 12px;margin:8px 0;color:var(--text-soft);
  font-style:italic;background:rgba(212,165,116,.02);border-radius:0 6px 6px 0
}
.shulan-bold{color:var(--text-main);font-weight:700}
.shulan-italic{color:var(--text-soft);font-style:italic}
.shulan-book-title{color:var(--moon-gold);font-weight:600;text-shadow:0 0 8px rgba(212,165,116,.1)}
.agent-search-title{color:var(--moon-gold)!important;font-size:12px;font-weight:700;margin-bottom:10px;padding-bottom:6px;border-bottom:1px solid rgba(212,165,116,.1)}
.agent-search-results{padding:10px 14px !important}
.agent-book-item{
  display:flex;align-items:center;gap:8px;padding:6px 0;
  border-bottom:1px solid rgba(212,165,116,.06);font-size:12px
}
.agent-book-item:last-child{border-bottom:none}
.agent-book-title{font-weight:600;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.agent-book-meta{color:var(--text-soft);font-size:10px;white-space:nowrap}
.agent-dl-btn{
  padding:4px 10px;border-radius:8px;border:1px solid rgba(111,168,220,.2);
  background:rgba(111,168,220,.06);color:var(--lake-blue);font-size:11px;
  cursor:pointer;transition:all .2s;flex-shrink:0
}
.agent-dl-btn:hover{background:rgba(111,168,220,.15);border-color:rgba(111,168,220,.4)}
.agent-local-tag{font-size:10px;color:var(--ok);padding:2px 8px;border-radius:6px;background:rgba(127,200,169,.06);border:1px solid rgba(127,200,169,.15)}

/* 书岱 书卡 */
.shulan-book-card{
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;padding:10px 14px;margin-bottom:6px;
  border-radius:10px;background:rgba(10,15,40,.4);
  border:1px solid rgba(212,165,116,.06);transition:all .25s
}
.shulan-book-card:hover{border-color:rgba(212,165,116,.15);background:rgba(10,15,40,.6)}
.shulan-book-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.shulan-book-name{font-size:13px;font-weight:600;color:var(--text-main);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.shulan-book-meta{font-size:10px;color:var(--text-soft);display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.shulan-book-actions{display:flex;gap:6px;flex-shrink:0;flex-wrap:wrap}
.shulan-action-btn{
  padding:6px 12px;border-radius:8px;font-size:11px;font-weight:600;
  cursor:pointer;transition:all .25s;font-family:inherit;white-space:nowrap;border:1px solid
}
.shulan-btn-read{color:var(--moon-gold);border-color:rgba(212,165,116,.2);background:rgba(212,165,116,.06)}
.shulan-btn-read:hover{background:rgba(212,165,116,.12);border-color:rgba(212,165,116,.35);transform:translateY(-1px)}
.shulan-btn-dl{color:var(--lake-blue);border-color:rgba(111,168,220,.2);background:rgba(111,168,220,.06)}
.shulan-btn-dl:hover{background:rgba(111,168,220,.12);border-color:rgba(111,168,220,.35);transform:translateY(-1px)}

/* ═══ 在线阅读器 ═══ */
.reader-overlay{
  position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999;
  background:var(--bg-deep);
  display:flex;justify-content:center;align-items:stretch;
  animation:fadeIn .3s ease
}
.reader-container{
  width:100%;max-width:100%;height:100vh;
  display:flex;flex-direction:column;
  background:var(--bg-deep);color:var(--text-main)
}
.reader-header{
  display:flex;align-items:center;gap:12px;
  padding:10px 20px;
  background:rgba(10,14,39,.9);
  border-bottom:1px solid var(--border);
  flex-shrink:0;z-index:10
}
.reader-back-btn{
  background:none;border:1px solid var(--border);
  color:var(--lake-blue);padding:6px 14px;border-radius:8px;
  cursor:pointer;font-size:14px;transition:all .3s
}
.reader-back-btn:hover{background:rgba(111,168,220,.1);border-color:var(--lake-blue)}
.reader-book-title{
  flex:1;font-size:16px;font-weight:600;color:var(--moon-gold);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
.reader-controls{display:flex;gap:6px}
.reader-ctrl-btn{
  background:none;border:1px solid var(--border);
  color:var(--text-soft);padding:6px 10px;border-radius:8px;
  cursor:pointer;font-size:13px;transition:all .3s
}
.reader-ctrl-btn:hover{background:rgba(212,165,116,.1);color:var(--moon-gold);border-color:var(--moon-gold)}
.reader-overlay .reader-container{
  display:grid;
  grid-template-rows:auto 1fr;
  grid-template-columns:240px 1fr;
  height:100vh
}
.reader-header{grid-column:1/3}
.reader-sidebar{
  grid-column:1;grid-row:2;
  background:rgba(10,14,39,.98);
  border-right:1px solid var(--border);
  overflow-y:auto;display:flex;flex-direction:column
}
.reader-sidebar-title{
  padding:14px 16px 10px;font-size:14px;font-weight:600;
  color:var(--moon-gold);border-bottom:1px solid var(--border);flex-shrink:0
}
.reader-chapter-list{flex:1;overflow-y:auto;padding:4px 0}
.reader-chapter-item{
  display:flex;align-items:center;gap:8px;
  padding:8px 16px;cursor:pointer;transition:background .2s;
  font-size:13px;color:var(--text-soft);border-left:3px solid transparent
}
.reader-chapter-item:hover{background:rgba(212,165,116,.06);color:var(--text-main)}
.reader-chapter-item.active{
  background:rgba(212,165,116,.1);color:var(--lake-blue);
  font-weight:600;border-left-color:var(--lake-blue)
}
.reader-chapter-item .ch-index{min-width:28px;text-align:right;font-size:11px;color:var(--muted);font-family:var(--mono)}
.reader-chapter-item .ch-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reader-body{grid-column:2;grid-row:2;overflow-y:auto;padding:0;display:flex;flex-direction:column}
.reader-content{flex:1;max-width:800px;margin:0 auto;padding:32px 40px 80px;width:100%}
.reader-chapter-title{font-size:22px;font-weight:700;color:var(--moon-gold);margin:0 0 24px;padding-bottom:16px;border-bottom:1px solid var(--border)}
.reader-text{font-size:18px;line-height:2;color:var(--text-main)}
.reader-para{text-indent:2em;margin:0 0 8px;word-break:break-all}
.reader-nav{
  display:flex;align-items:center;justify-content:center;gap:16px;
  padding:16px;border-top:1px solid var(--border);
  background:rgba(10,14,39,.9);flex-shrink:0
}
.reader-nav-btn{
  background:none;border:1px solid var(--border);
  color:var(--lake-blue);padding:8px 20px;border-radius:10px;
  cursor:pointer;font-size:14px;transition:all .3s
}
.reader-nav-btn:hover:not(:disabled){background:rgba(111,168,220,.1);border-color:var(--lake-blue)}
.reader-nav-btn:disabled{color:var(--muted);cursor:not-allowed;border-color:transparent}
.reader-nav-info{font-size:13px;color:var(--text-soft);min-width:80px;text-align:center}
.reader-loading{text-align:center;padding:60px 20px;color:var(--text-soft);font-size:16px}
.reader-error{text-align:center;padding:60px 20px;color:var(--warn);font-size:15px}
.reader-empty{text-align:center;padding:40px 20px;color:var(--muted);font-size:13px}
.reader-light{background:#faf9f6 !important;color:#2c2c2c !important}
.reader-light .reader-header{background:#f0ede6;border-bottom-color:#d8d4cc}
.reader-light .reader-back-btn{color:#4a7a8a;border-color:#d8d4cc}
.reader-light .reader-back-btn:hover{background:rgba(74,122,138,.08)}
.reader-light .reader-book-title{color:#a87040}
.reader-light .reader-ctrl-btn{color:#666;border-color:#d8d4cc}
.reader-light .reader-ctrl-btn:hover{color:#a87040;border-color:#a87040;background:rgba(168,112,64,.06)}
.reader-light .reader-sidebar{background:#f5f2ec;border-right-color:#d8d4cc}
.reader-light .reader-sidebar-title{color:#a87040;border-bottom-color:#d8d4cc}
.reader-light .reader-chapter-item{color:#777}
.reader-light .reader-chapter-item:hover{background:rgba(168,112,64,.05);color:#333}
.reader-light .reader-chapter-item.active{background:rgba(168,112,64,.08);color:#4a7a8a;border-left-color:#4a7a8a}
.reader-light .reader-chapter-item .ch-index{color:#aaa}
.reader-light .reader-body{background:#faf9f6}
.reader-light .reader-chapter-title{color:#a87040;border-bottom-color:#e0ddd6}
.reader-light .reader-text{color:#333}
.reader-light .reader-nav{background:#f0ede6;border-top-color:#d8d4cc}
.reader-light .reader-nav-btn{color:#4a7a8a;border-color:#d8d4cc}
.reader-light .reader-nav-btn:hover:not(:disabled){background:rgba(74,122,138,.08)}
.reader-light .reader-nav-info{color:#999}
.reader-light .reader-loading,.reader-light .reader-error{color:#888}

@media(max-width:768px){
  .reader-overlay .reader-container{grid-template-columns:1fr}
  .reader-sidebar{display:none}
  .reader-body{grid-column:1}
  .reader-header{grid-column:1}
  .reader-content{padding:20px 16px 60px}
  .reader-chapter-title{font-size:18px}
}

/* ═══ 响应式 ═══ */
@media(max-width:900px){
  .shell{grid-template-columns:200px 1fr}
  .side-r{display:none}
}
@media(max-width:640px){
  body{overflow:auto}
  .page{height:auto;overflow:auto}
  .shell{position:static;grid-template-columns:1fr;height:auto;overflow:visible;padding:8px;gap:8px}
  .topbar{position:fixed}
  body{padding-top:50px}
  .side-l{display:none}
  .topbar{height:50px;padding:0 16px}
  .brand-sub{display:none}
  .greet{flex-direction:column;align-items:flex-start;gap:10px}
  .search-mini{width:100%}
  .chat{min-height:60vh}
  .msgs{max-height:50vh}
}
