
*{margin:0;padding:0;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;}
:root{
  --bg:#0a0e1a;--panel:rgba(15,23,42,0.75);--border:rgba(201,168,106,0.18);
  --accent:#3b82f6;--accent2:#60a5fa;--text:#e2e8f0;--muted:#94a3b8;
  --glass-bg:rgba(15,23,42,0.85);--glass-border:rgba(201,168,106,0.25);--glass-blur:blur(8px);
  --prosecution:#ef4444;--defense:#3b82f6;--judge:#f59e0b;--defendant:#a855f7;
  --success:#22c55e;--warning:#f59e0b;--danger:#ef4444;
  --gold:#c9a86a;
}
html,body{width:100%;height:100%;overflow:hidden;background:var(--bg);color:var(--text);}
#app{position:relative;width:100%;height:100%;}
#canvas-container{position:absolute;inset:0;}
canvas{display:block;}

/* ===== 顶部栏 ===== */
.topbar{
  position:absolute;top:0;left:0;right:0;height:52px;z-index:100;
  background:linear-gradient(180deg,rgba(10,14,26,0.95) 0%,rgba(10,14,26,0.7) 100%);
  border-bottom:1px solid var(--border);display:flex;align-items:center;padding:0 20px;gap:16px;
  backdrop-filter:blur(12px);
}
.topbar-logo{display:flex;align-items:center;gap:10px;font-weight:700;font-size:15px;}
.topbar-logo .icon{width:28px;height:28px;border-radius:6px;background:linear-gradient(135deg,#1e3a8a,#3b82f6);display:flex;align-items:center;justify-content:center;font-size:14px;}
.topbar-title{font-size:13px;color:var(--muted);border-left:1px solid var(--border);padding-left:16px;}
.topbar-right{margin-left:auto;display:flex;align-items:center;gap:12px;}
.conn-status{display:none;align-items:center;gap:6px;font-size:12px;padding:4px 10px;border-radius:20px;background:rgba(34,197,94,0.15);color:var(--success);border:1px solid rgba(34,197,94,0.3);}
.conn-status.offline{background:rgba(239,68,68,0.15);color:var(--danger);border-color:rgba(239,68,68,0.3);}
.conn-status .dot{width:6px;height:6px;border-radius:50%;background:currentColor;animation:pulse 2s infinite;}
@keyframes pulse{0%,100%{opacity:1;}50%{opacity:0.4;}}
.user-badge{display:flex;align-items:center;gap:8px;font-size:13px;padding:4px 12px;border-radius:20px;background:rgba(59,130,246,0.15);border:1px solid var(--border);}
.user-badge .role-dot{width:8px;height:8px;border-radius:50%;}

/* ===== 左侧参与者面板 ===== */
.sidebar-left{
  position:absolute;top:64px;left:16px;width:220px;z-index:90;
  background:var(--glass-bg);border:1px solid var(--glass-border);border-radius:12px;
  backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);
  box-shadow:0 8px 32px rgba(0,0,0,0.12),inset 0 1px 0 rgba(255,255,255,0.08);
  overflow:hidden;
}
.panel-header{padding:12px 14px;font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:0.5px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;}
.panel-header .count{background:var(--accent);color:#fff;font-size:10px;padding:1px 7px;border-radius:10px;}
.side-close{display:inline-block;margin-left:auto;background:none;border:none;color:var(--muted);font-size:14px;cursor:pointer;padding:2px 6px;border-radius:6px;line-height:1;}
.side-close:hover{background:rgba(255,255,255,0.1);color:var(--text);}
.participant-list{padding:8px;max-height:320px;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;}
.participant{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;transition:background 0.2s;position:relative;}
.participant:hover{background:rgba(255,255,255,0.05);}
.participant.speaking{background:rgba(245,158,11,0.1);}
.participant.speaking::before{content:'';position:absolute;left:0;top:50%;transform:translateY(-50%);width:3px;height:24px;background:var(--warning);border-radius:2px;animation:pulse 1s infinite;}
.p-avatar{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;color:#fff;flex-shrink:0;position:relative;}
.p-avatar .mic-icon{position:absolute;bottom:-2px;right:-2px;width:14px;height:14px;border-radius:50%;background:var(--bg);display:flex;align-items:center;justify-content:center;font-size:8px;border:1px solid var(--border);}
.p-info{flex:1;min-width:0;}
.p-name{font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.p-role{font-size:11px;color:var(--muted);}
.p-status{font-size:10px;padding:1px 6px;border-radius:8px;}
.status-online{background:rgba(34,197,94,0.2);color:var(--success);}

/* ===== 右侧案件信息面板 ===== */
.sidebar-right{
  position:absolute;top:64px;right:16px;width:280px;z-index:90;
  background:var(--glass-bg);border:1px solid var(--glass-border);border-radius:12px;
  backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);
  box-shadow:0 8px 32px rgba(0,0,0,0.12),inset 0 1px 0 rgba(255,255,255,0.08);
  overflow:hidden;max-height:calc(100vh - 140px);display:flex;flex-direction:column;
}
.case-tabs{display:flex;border-bottom:1px solid var(--border);}
.case-tab{flex:1;padding:10px;text-align:center;font-size:12px;cursor:pointer;color:var(--muted);transition:all 0.2s;border-bottom:2px solid transparent;}
.case-tab.active{color:var(--accent2);border-bottom-color:var(--accent);background:rgba(59,130,246,0.08);}
.case-content{padding:14px;overflow-y:auto;flex:1;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;}
.case-section{margin-bottom:16px;}
.case-section h4{font-size:12px;color:var(--muted);margin-bottom:6px;text-transform:uppercase;letter-spacing:0.3px;}
.case-section p{font-size:13px;line-height:1.7;color:var(--text);}
.case-tag{display:inline-block;font-size:11px;padding:2px 8px;border-radius:4px;margin-right:4px;margin-bottom:4px;}
.tag-prosecution{background:rgba(239,68,68,0.15);color:var(--prosecution);}
.tag-defense{background:rgba(59,130,246,0.15);color:var(--defense);}
.evidence-item{padding:8px 10px;border-radius:6px;background:rgba(255,255,255,0.03);border-left:3px solid var(--accent);margin-bottom:6px;font-size:12px;cursor:pointer;transition:background 0.2s;}
.evidence-item:hover{background:rgba(255,255,255,0.06);}
.evidence-item .e-title{font-weight:600;margin-bottom:2px;}
.evidence-item .e-meta{font-size:10px;color:var(--muted);}

/* ===== 底部控制栏 ===== */
.bottombar{
  position:absolute;bottom:16px;left:50%;transform:translateX(-50%);z-index:90;
  display:flex;align-items:center;gap:8px;padding:8px 12px;
  background:var(--glass-bg);border:1px solid var(--glass-border);border-radius:14px;
  backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);
  box-shadow:0 8px 32px rgba(0,0,0,0.12),inset 0 1px 0 rgba(255,255,255,0.08);
}
.ctrl-btn{
  width:44px;height:44px;border-radius:10px;border:1px solid var(--border);
  background:rgba(255,255,255,0.05);color:var(--text);cursor:pointer;
  display:flex;align-items:center;justify-content:center;font-size:18px;transition:all 0.2s;
}
.ctrl-btn:hover{background:rgba(59,130,246,0.2);border-color:var(--accent);}
.ctrl-btn.active{background:var(--accent);border-color:var(--accent);color:#fff;}
.ctrl-btn.danger{background:rgba(239,68,68,0.2);border-color:rgba(239,68,68,0.4);}
.ctrl-btn.danger:hover{background:var(--danger);}
.ctrl-divider{width:1px;height:28px;background:var(--border);margin:0 4px;}
.ctrl-label{font-size:11px;color:var(--muted);padding:0 4px;}

/* ===== 聊天面板 ===== */
.chat-panel{
  position:absolute;bottom:80px;right:16px;width:300px;height:340px;z-index:90;
  background:var(--glass-bg);border:1px solid var(--glass-border);border-radius:12px;
  backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);
  box-shadow:0 8px 32px rgba(0,0,0,0.12),inset 0 1px 0 rgba(255,255,255,0.08);
  display:flex;flex-direction:column;overflow:hidden;
  transform:translateY(20px);opacity:0;pointer-events:none;transition:all 0.3s;
}
.chat-panel.open{transform:translateY(0);opacity:1;pointer-events:auto;}
.chat-header{padding:10px 14px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;}
.chat-header span{font-size:13px;font-weight:600;}
.chat-close{background:none;border:none;color:var(--muted);cursor:pointer;font-size:16px;}
.chat-messages{flex:1;overflow-y:auto;padding:10px 12px;display:flex;flex-direction:column;gap:8px;}
.chat-msg{max-width:85%;font-size:12px;line-height:1.5;}
.chat-msg .sender{font-size:10px;color:var(--muted);margin-bottom:2px;}
.chat-msg .bubble{padding:7px 11px;border-radius:10px;background:rgba(255,255,255,0.06);word-break:break-word;}
.chat-msg.self{align-self:flex-end;}
.chat-msg.self .sender{text-align:right;}
.chat-msg.self .bubble{background:var(--accent);color:#fff;}
.chat-msg.system{align-self:center;max-width:100%;}
.chat-msg.system .bubble{background:transparent;color:var(--muted);font-size:11px;text-align:center;padding:2px;}

/* ===== 角色头顶发言气泡 ===== */
.speech-bubble{
  position:fixed;
  transform:translate(-50%, -100%);
  background:rgba(15,23,42,0.88);
  border:1px solid rgba(201,168,106,0.5);
  border-radius:12px;
  padding:9px 14px;
  color:#e2e8f0;
  font-size:13px;
  line-height:1.55;
  max-width:300px;
  pointer-events:none;
  z-index:150;
  box-shadow:0 6px 24px rgba(0,0,0,0.6),0 0 12px rgba(201,168,106,0.25);
  backdrop-filter:blur(8px);
  display:none;
  animation:sbFadeIn 0.25s ease;
}
@keyframes sbFadeIn{from{opacity:0;transform:translate(-50%,-90%);}to{opacity:1;transform:translate(-50%,-100%);}}
.speech-bubble .sb-speaker{font-size:11px;color:#c9a86a;margin-bottom:4px;font-weight:700;letter-spacing:0.5px;}
.speech-bubble .sb-text{word-break:break-word;}
.speech-bubble::after{
  content:'';position:absolute;bottom:-7px;left:50%;transform:translateX(-50%);
  border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid rgba(15,23,42,0.88);
}
.chat-input{display:flex;padding:8px 10px;border-top:1px solid var(--border);gap:6px;}
.chat-input input{flex:1;background:rgba(255,255,255,0.05);border:1px solid var(--border);border-radius:8px;padding:7px 10px;color:var(--text);font-size:12px;outline:none;}
.chat-input input:focus{border-color:var(--accent);}
.chat-input button{background:var(--accent);border:none;color:#fff;border-radius:8px;padding:0 12px;cursor:pointer;font-size:12px;}

/* ===== 发言提示 ===== */
.speaking-indicator{
  position:absolute;top:70px;left:50%;transform:translateX(-50%);z-index:95;
  padding:8px 18px;border-radius:20px;background:rgba(245,158,11,0.9);color:#000;
  font-size:13px;font-weight:600;display:none;align-items:center;gap:8px;
  box-shadow:0 4px 20px rgba(245,158,11,0.4);
}
.speaking-indicator.show{display:flex;animation:slideDown 0.3s;}
@keyframes slideDown{from{opacity:0;transform:translateX(-50%) translateY(-10px);}to{opacity:1;transform:translateX(-50%) translateY(0);}}
.speaking-indicator .waves{display:flex;gap:2px;align-items:flex-end;height:14px;}
.speaking-indicator .waves span{width:3px;background:#000;border-radius:2px;animation:wave 1s infinite ease-in-out;}
.speaking-indicator .waves span:nth-child(1){height:6px;animation-delay:0s;}
.speaking-indicator .waves span:nth-child(2){height:12px;animation-delay:0.1s;}
.speaking-indicator .waves span:nth-child(3){height:8px;animation-delay:0.2s;}
.speaking-indicator .waves span:nth-child(4){height:14px;animation-delay:0.3s;}
@keyframes wave{0%,100%{transform:scaleY(0.5);}50%{transform:scaleY(1);}}

/* ===== 视角/操作提示 ===== */
.hint-overlay{
  position:absolute;bottom:88px;left:16px;z-index:80;
  background:var(--panel);border:1px solid var(--border);border-radius:12px;
  padding:14px 16px;
  backdrop-filter:blur(12px);
  box-shadow:0 8px 30px rgba(0,0,0,0.35);
  min-width:240px;
  display:flex;flex-direction:column;
}

/* ---- 结构化标题栏：标题左 + ×按钮右（自然flex布局，无需absolute调距离） ---- */
.hint-overlay .hint-header{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  margin-bottom:10px;padding-bottom:8px;
  border-bottom:1px solid var(--border);
}
/* 标题（标题栏里的左项）*/
.hint-overlay .hint-title{
  font-size:13px;color:#cbd5e1;font-weight:700;letter-spacing:.2px;
  text-transform:none;
  display:flex;align-items:center;gap:8px;
  padding:0;margin:0;border:none;  /* padding/border/margin 全部交给 hint-header 统一控制 */
  flex:1;min-width:0;
}
.hint-overlay .hint-title::before{ display:none; } /* PC端清除移动端抽屉手柄伪元素 */

/* ×关闭按钮（标题栏里的右项）—— 不再用absolute，自然flex对齐 */
.hint-close{
  position:static !important;  /* 废弃absolute微调，避免距离算错 */
  flex-shrink:0;
  width:28px;height:28px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:rgba(148,163,184,0.12);
  border:none;color:#94a3b8;font-size:16px;cursor:pointer;line-height:1;
  transition:background .18s ease,color .18s ease,transform .12s ease;
  padding:0;
}
.hint-close:hover{ background:rgba(148,163,184,0.32); color:#fff; transform:scale(1.05); }
.hint-close:active{ transform:scale(0.95); }

/* 操作项（每一个操作键位+说明文字一行） */
.hint-item{
  display:flex;align-items:center;
  padding:7px 0;
  border-bottom:1px dashed rgba(148,163,184,0.15);
  gap:10px;
}
.hint-item:last-child{border-bottom:none;}
/* 键位容器：紧凑排列WASD键 */
.kbd-group{display:inline-flex;gap:4px;flex-shrink:0;align-items:center;}
.hint-overlay kbd{
  display:inline-flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,0.08);border:1px solid var(--border);
  border-radius:6px;padding:4px 9px;font-size:11.5px;font-weight:600;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color:var(--text);min-width:24px;min-height:22px;
  box-shadow:inset 0 -2px 0 rgba(0,0,0,0.25);
}
/* 说明文字：占满剩余宽度，不与键位挤 */
.hint-item .hint-label{
  color:#cbd5e1;font-size:12.5px;flex:1;min-width:0;line-height:1.4;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

/* 操作提示收纳按钮：PC端「竖排文字窄条贴左边缘」形式
   ——面板关闭后才显示，点击展开；贴左边缘（left:0），只有右侧两个圆角 */
.hint-toggle-btn{
  display:flex;align-items:center;justify-content:center;
  position:absolute;left:0;bottom:110px;z-index:85;
  /* 宽26px 高140px 竖条 */
  width:28px;height:140px;
  border:none;cursor:pointer;
  background:linear-gradient(180deg,#1e293b,#0f172a);
  color:#e2e8f0;
  border-top-right-radius:10px;border-bottom-right-radius:10px;
  border-top-left-radius:0;border-bottom-left-radius:0;
  border:1px solid rgba(148,163,184,0.3);border-left:none;
  backdrop-filter:blur(12px);
  box-shadow:4px 4px 20px rgba(0,0,0,0.45);
  transition:width .18s ease, background .18s ease, color .18s ease;
  padding:0;
}
/* 竖排文字（中文原生竖排，直立显示每个字：
   操
   作
   说
   明
）*/
.hint-toggle-btn .vtxt{
  writing-mode: vertical-lr;   /* 从左到右的竖排 */
  text-orientation: upright;  /* 每个汉字保持直立不旋转 */
  letter-spacing: 4px;        /* 字间距 */
  font-size: 14px;
  font-weight: 600;
  padding-left: 2px;          /* 左侧贴边留一点点呼吸 */
}
.hint-toggle-btn:hover{
  background:linear-gradient(180deg,#3b82f6,#1d4ed8);
  color:#fff;
  width:32px;
  box-shadow:4px 4px 26px rgba(59,130,246,0.55);
}
/* 不再需要 active 高亮：因为按钮显示意味着面板已关 */
.hint-toggle-btn.active{}

/* 左侧 👥 模拟角色列表：不支持收纳，按钮和×都永久隐藏 */
.side-toggle-btn.left { display:none !important; }
#sidebarLeft .side-close { display:none !important; }

/* 右侧 📋 案例演示信息：贴右边缘 竖排文字窄条 —— 与左侧「操作说明」对称设计
   ——面板✕关闭后才显示竖条按钮；点击重新展开 */
.side-toggle-btn.right{
  display:flex;align-items:center;justify-content:center;
  position:absolute;right:0;top:76px;z-index:95;
  width:28px;height:160px;
  border:none;cursor:pointer;
  background:linear-gradient(180deg,#1e293b,#0f172a);
  color:#e2e8f0;
  border-top-left-radius:10px;border-bottom-left-radius:10px;
  border-top-right-radius:0;border-bottom-right-radius:0;
  border:1px solid rgba(148,163,184,0.3);border-right:none;
  backdrop-filter:blur(12px);
  box-shadow:-4px 4px 20px rgba(0,0,0,0.45);
  transition:width .18s ease, background .18s ease, color .18s ease;
  padding:0;
}
.side-toggle-btn.right .vtxt{
  writing-mode: vertical-lr;     /* 中文竖排，从左到右 */
  text-orientation: upright;    /* 每个字保持直立 */
  letter-spacing: 3px;
  font-size: 13px;
  font-weight: 600;
  padding-right: 2px;
}
.side-toggle-btn.right:hover{
  background:linear-gradient(180deg,#3b82f6,#1d4ed8);
  color:#fff;
  width:32px;
  box-shadow:-4px 4px 26px rgba(59,130,246,0.55);
}
.side-toggle-btn.active{} /* 按钮显示即代表面板关闭，无需额外高亮 */

/* PC端：面板关闭后，按钮保持常驻，随时可重新点开 */

/* 面板展开/收纳的过渡动画（PC & 移动端通用） */
.hint-overlay,
.sidebar-left,
.sidebar-right{
  transition:transform .25s ease, opacity .2s ease, max-height .25s ease;
  transform-origin:left bottom;
}
/* PC端：面板隐藏时的状态（平滑收纳消失） */
.hint-overlay.hidden-panel,
.sidebar-left.hidden-panel,
.sidebar-right.hidden-panel{
  display:none;
}

/* ===== 移动端适配：顶部导航 + 收纳抽屉 ===== */
@media (max-width:768px){
  /* 顶部导航精简 */
  .topbar{padding:0 12px;gap:8px;height:48px;}
  .topbar-logo{font-size:13px;gap:6px;}
  .topbar-logo .icon{width:24px;height:24px;font-size:12px;}
  .topbar-title{display:none;} /* 隐藏过长副标题 */
  .conn-status{font-size:11px;padding:3px 8px;}
  .user-badge{font-size:12px;padding:3px 8px;}

  /* ===== 操作提示：移动端改为【底部全屏抽屉】（从下往上滑出，不再挤压）===== */
  .hint-overlay{
    /* 默认隐藏 */
    display:none !important;
    position:fixed !important;top:auto !important;left:0 !important;right:0 !important;bottom:0 !important;
    z-index:9999 !important;
    background:#0f172a !important;
    border:1px solid rgba(148,163,184,0.25) !important;border-bottom:none !important;
    border-radius:20px 20px 0 0 !important;
    padding:16px 20px 28px 20px !important;
    min-width:auto !important;max-width:100% !important;
    backdrop-filter:blur(16px) !important;
    box-shadow:0 -10px 40px rgba(0,0,0,0.6) !important;
    /* iOS安全区 */
    padding-bottom:calc(28px + env(safe-area-inset-bottom,0px)) !important;
  }
  .hint-overlay.show{
    display:block !important;
    animation:drawerSlideUp 0.32s cubic-bezier(.2,.8,.2,1);
  }
  @keyframes drawerSlideUp{
    from{transform:translateY(100%);opacity:0;}
    to{transform:translateY(0);opacity:1;}
  }
  /* 抽屉标题栏（更显眼） */
  .hint-overlay .hint-title{
    font-size:15px;font-weight:700;color:#e2e8f0;letter-spacing:.2px;
    padding:4px 0 14px 0 !important;margin-bottom:14px !important;
    border-bottom:1px solid rgba(148,163,184,0.2) !important;
    text-transform:none !important;
  }
  .hint-overlay .hint-title::before{
    content:"";
    position:absolute;top:8px;left:50%;transform:translateX(-50%);
    width:42px;height:4px;border-radius:999px;background:rgba(148,163,184,0.35);
  }
  /* 每一行操作项：独立卡片化，间距充足不挤压 */
  .hint-item{
    padding:14px 14px !important;margin:0 0 10px 0 !important;
    border:1px solid rgba(148,163,184,0.18);
    border-radius:12px !important;
    background:rgba(30,41,59,0.7);
    gap:14px !important;
    flex-wrap:nowrap !important;
    border-bottom:1px solid rgba(148,163,184,0.18) !important;
  }
  .hint-item:last-child{margin-bottom:0;}
  .hint-item .kbd-group{gap:6px;flex-shrink:0;}
  .hint-overlay kbd{
    padding:7px 12px !important;font-size:13px !important;
    min-width:30px !important;min-height:28px !important;
    border-radius:7px !important;
    box-shadow:inset 0 -2px 0 rgba(0,0,0,0.25),0 1px 2px rgba(0,0,0,0.4);
  }
  .hint-item .hint-label{
    font-size:14.5px !important;line-height:1.5 !important;
    color:#e2e8f0 !important;font-weight:500 !important;
    white-space:normal !important;overflow:visible !important;text-overflow:clip !important;
  }
  .hint-close{
    position:absolute;top:12px;right:16px;
    font-size:22px !important;color:#94a3b8;
    width:34px;height:34px;border-radius:50%;
    display:flex;align-items:center;justify-content:center;
    background:rgba(148,163,184,0.12);
  }
  /* 抽屉遮罩层（半透明黑，点击关闭抽屉） */
  .hint-mask{
    display:none;position:fixed;inset:0;z-index:9998;
    background:rgba(0,0,0,0.55);backdrop-filter:blur(2px);
  }
  .hint-mask.show{display:block;animation:fadeIn 0.2s ease;}
  @keyframes fadeIn{from{opacity:0;}to{opacity:1;}}

  .hint-toggle-btn{
    display:flex !important;
    /* 移动端：贴左边缘竖排文字窄条，位置比PC端再往上提一点，不与底部栏+抽屉按钮垂直挤 */
    left:0 !important;bottom:260px !important;
    width:26px !important;height:124px !important;
    border-radius:0 10px 10px 0 !important;
    font-size:13px !important;
    background:linear-gradient(180deg,#1e293b,#0f172a) !important;
    border:1px solid rgba(148,163,184,0.3) !important;border-left:none !important;
    /* 清除之前移动端遗留的尺寸/位置 */
    right:auto !important;
  }
  .hint-toggle-btn .vtxt{
    writing-mode: vertical-lr;text-orientation: upright;
    letter-spacing: 3px;font-size: 13px;font-weight: 600;
  }
  .hint-toggle-btn:hover{ width:30px !important; }

  /* 侧栏收纳为抽屉（展开时全屏覆盖的抽屉面板） */
  .sidebar-left, .sidebar-right{display:none;}
  .sidebar-left.show, .sidebar-right.show{display:flex;flex-direction:column;animation:hintSlide 0.25s ease;}
  .sidebar-left.show{top:56px;left:12px;width:min(280px, 82vw);max-height:calc(100vh - 200px);}
  .sidebar-right.show{top:56px;right:12px;width:min(300px, 88vw);max-height:calc(100vh - 200px);}
  .side-close{display:inline-block;margin-left:auto;}

  /* 👥左侧参与者按钮：移动端也永久隐藏（不支持收纳） */
  .side-toggle-btn.left{display:none !important;}

  /* 📋案例演示信息：移动端贴右边缘竖条（和PC端一样，对称设计）
     ——贴右边缘 position:fixed/absolute right:0 */
  .side-toggle-btn.right{
    display:flex !important;
    right:0 !important;top:180px !important;left:auto !important;
    width:26px !important;height:140px !important;
    border-radius:10px 0 0 10px !important;
    background:linear-gradient(180deg,#1e293b,#0f172a) !important;
    border:1px solid rgba(148,163,184,0.3) !important;border-right:none !important;
    bottom:auto !important;
  }
  .side-toggle-btn.right .vtxt{
    writing-mode: vertical-lr;text-orientation: upright;
    letter-spacing: 3px;font-size: 13px;font-weight: 600;
  }
  .side-toggle-btn.right:hover{ width:30px !important; }

  /* 聊天面板移动端适配（避免超出屏幕，可滚动） */
  .chat-panel{right:10px;left:10px;width:auto;height:46vh;bottom:150px;}
  .chat-messages{-webkit-overflow-scrolling:touch;overscroll-behavior:contain;}

  /* 移动端禁止文本选择，提升触摸手感 */
  body{-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;}
  canvas{touch-action:none;}
}

/* ===== 加载遮罩 ===== */
.loading-overlay{
  position:absolute;inset:0;z-index:1000;background:var(--bg);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;
  transition:opacity 0.5s;
}
.loading-overlay.hidden{opacity:0;pointer-events:none;}
.loading-logo{font-size:48px;animation:float 3s infinite ease-in-out;}
@keyframes float{0%,100%{transform:translateY(0);}50%{transform:translateY(-10px);}}
.loading-text{font-size:14px;color:var(--muted);}
.loading-bar{width:200px;height:3px;background:rgba(255,255,255,0.1);border-radius:2px;overflow:hidden;}
.loading-bar .fill{height:100%;background:linear-gradient(90deg,var(--accent),var(--accent2));border-radius:2px;animation:load 2s infinite;}
@keyframes load{0%{width:0%;margin-left:0;}50%{width:100%;margin-left:0;}100%{width:0%;margin-left:100%;}}

/* ===== 角色选择弹窗 ===== */
.role-modal{
  position:absolute;inset:0;z-index:500;background:rgba(0,0,0,0.7);
  display:flex;align-items:center;justify-content:center;backdrop-filter:blur(4px);
}
.role-modal.hidden{display:none;}
.role-box{background:var(--panel);border:1px solid var(--border);border-radius:16px;padding:28px;width:440px;max-width:90vw;}
.role-box h2{font-size:18px;margin-bottom:6px;}
.role-box .sub{font-size:13px;color:var(--muted);margin-bottom:20px;}
.role-options{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:20px;}
.role-option{padding:14px;border-radius:10px;border:2px solid var(--border);cursor:pointer;transition:all 0.2s;background:rgba(255,255,255,0.03);}
.role-option:hover{border-color:var(--accent);background:rgba(59,130,246,0.08);}
.role-option.selected{border-color:var(--accent);background:rgba(59,130,246,0.15);}
.role-option .r-icon{font-size:24px;margin-bottom:6px;}
.role-option .r-name{font-size:14px;font-weight:600;margin-bottom:2px;}
.role-option .r-desc{font-size:11px;color:var(--muted);}
.role-input{width:100%;padding:10px 12px;background:rgba(255,255,255,0.05);border:1px solid var(--border);border-radius:8px;color:var(--text);font-size:13px;margin-bottom:16px;outline:none;}
.role-input:focus{border-color:var(--accent);}
.role-enter{width:100%;padding:12px;background:var(--accent);border:none;color:#fff;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;transition:background 0.2s;}
.role-enter:hover{background:#2563eb;}
.role-enter:disabled{opacity:0.5;cursor:not-allowed;}

/* 滚动条 */
::-webkit-scrollbar{width:5px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.15);border-radius:3px;}
::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,0.25);}



/* ===== SEO 内容区样式 ===== */
.seo-content {
  max-width: 900px;
  margin: 80px auto 40px;
  padding: 30px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  line-height: 1.8;
  color: #1e293b;
  display: none; /* 3D 加载成功后隐藏 */
}

/* 搜索引擎爬虫可见(JS 禁用时显示) */
.no-js .seo-content,
.seo-fallback .seo-content {
  display: block;
}

.seo-content h1 {
  font-size: 28px;
  color: #1e293b;
  margin-bottom: 16px;
  border-bottom: 3px solid #3b82f6;
  padding-bottom: 12px;
  line-height: 1.4;
}

.seo-content h2 {
  font-size: 22px;
  color: #334155;
  margin: 32px 0 16px;
  padding-left: 12px;
  border-left: 4px solid #3b82f6;
  line-height: 1.4;
}

.seo-content h3 {
  font-size: 18px;
  color: #475569;
  margin: 24px 0 12px;
  line-height: 1.4;
}

.seo-content .meta-info {
  color: #64748b;
  font-size: 14px;
  margin-bottom: 24px;
  padding: 12px;
  background: #f1f5f9;
  border-radius: 6px;
}

.seo-content section {
  margin-bottom: 32px;
}

.seo-content p {
  margin: 12px 0;
  color: #334155;
}

.seo-content ul, .seo-content ol {
  padding-left: 24px;
  margin: 12px 0;
}

.seo-content li {
  margin: 8px 0;
  color: #334155;
}

.seo-content strong {
  color: #1e293b;
  font-weight: 600;
}

.seo-content .case-footer {
  background: #fef3c7;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #f59e0b;
  margin-top: 40px;
}

.seo-content .case-footer p {
  margin: 8px 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .seo-content {
    margin: 60px 16px 20px;
    padding: 20px;
  }
  
  .seo-content h1 {
    font-size: 22px;
  }
  
  .seo-content h2 {
    font-size: 18px;
  }
  
  .seo-content h3 {
    font-size: 16px;
  }
}

