/* menuframe 主壳样式 — 左右布局：AI 贯穿左侧，右侧目录区+内容区 */
:root {
  --gray-1: #fcfcfd; --gray-2: #f9f9fb; --gray-3: #f0f0f3; --gray-4: #e8e8ec;
  --gray-5: #e0e1e6; --gray-6: #d9d9e0; --gray-8: #b9bbc6; --gray-9: #8b8d98;
  --gray-10: #80838d; --gray-11: #60646c; --gray-12: #1c2024;
  --accent-4: #dbeafe; --accent-6: #63a3d8; --accent-8: #3182ce; --accent-9: #2b6cb0; --accent-11: #1a4e8a;
  /* 壳页面底为暖米白（reportview cream）；弹窗/独立页保持原冷白灰阶不动 */
  --paper: #ffffff;                 /* 面板底 */
  --page-bg: #FAF8F4;               /* 页面暖米白底（reportview cream） */
  --ink: #242421;                   /* 主文字（暖黑） */
  --ink-2: #5d5c56;                 /* 次级文字 */
  --ink-3: #85877f;                 /* 三级文字 */
  --hairline: rgba(0, 0, 0, 0.08);  /* 发丝边框 */
  --soft-shadow: 0 14px 32px rgba(39, 48, 41, 0.11);  /* 柔和绿调阴影 */
  --sage-dark: #4F5A50;             /* 深鼠尾草（替代纯黑） */
  --ai-width: 520px;      /* 左栏 AI 宽度 */
  --ai-gap: 16px;         /* 左右栏间距（分割线浮于其中） */
  --dirbar-h: 52px;       /* 目录区高度（恒定，展开区悬浮不改变它） */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: "Segoe UI", "Microsoft YaHei", sans-serif; background: var(--page-bg); color: var(--ink); }
.hidden { display: none !important; }

/* ===== 左栏：AI 界面贯穿 ===== */
#ai-sidebar {
  position: fixed; top: 0; left: 0; width: var(--ai-width);
  height: 100vh; z-index: 700; background: var(--paper);
  border-right: 1px solid rgba(0, 0, 0, 0.18);   /* 谷歌财经式竖向分割线 */
}
#ai-frame { width: 100%; height: 100%; border: none; }

/* ===== AI 侧栏四档宽度（core_ai 顶栏按钮 postMessage 指令：original/wide/half/full） ===== */
body.ai-wide #ai-sidebar { width: 40vw; }
body.ai-wide #right-panel { margin-left: calc(40vw + var(--ai-gap)); }
body.ai-wide #dirbar { left: calc(40vw + var(--ai-gap)); }
body.ai-half #ai-sidebar { width: 50vw; }
body.ai-half #right-panel { margin-left: calc(50vw + var(--ai-gap)); }
body.ai-half #dirbar { left: calc(50vw + var(--ai-gap)); }
/* 全屏档盖住目录条（z-index 999），登录/弹窗仍在其上 */
body.ai-full #ai-sidebar { width: 100vw; z-index: 1000; }

/* ===== AI 登录门禁：半透明灰幕 + 居中请登录（普通入口未登录时罩住 AI 区） ===== */
#ai-gate {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
}
.ai-gate-mask {
  position: absolute; inset: 0;
  background: rgba(165, 165, 165, 0.16);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}
.ai-gate-btn {
  position: relative;
  padding: 10px 30px;
  font-size: 14px; font-weight: 700;
  color: #fff;
  background: var(--accent-9);
  border: none; border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
  transition: background 0.15s ease, transform 0.15s ease;
}
.ai-gate-btn:hover { background: var(--accent-8); transform: translateY(-1px); }
.ai-gate-actions { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ai-gate-mcp {
  background: var(--gray-4); color: var(--gray-12);
  font-size: 12px; padding: 8px 22px; box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.ai-gate-mcp:hover { background: var(--gray-5); }

/* ===== MCP 文档弹窗 ===== */
#mcp-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; }
#mcp-modal .mcp-pop {
  position: relative; width: min(680px, 92vw); max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--gray-1); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.28);
  animation: menu-in 0.15s ease; overflow: hidden;
}
#mcp-modal .mcp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--gray-4); flex-shrink: 0;
}
#mcp-modal .mcp-title { font-size: 15px; font-weight: 700; color: var(--gray-12); }
#mcp-modal .mcp-close {
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: var(--gray-4); cursor: pointer;
  font-size: 12px; color: var(--gray-11); line-height: 1; position: static;
}
#mcp-modal .mcp-close:hover { background: var(--gray-5); }
#mcp-modal .mcp-body {
  padding: 14px 18px; overflow-y: auto; font-size: 12px;
  color: var(--gray-11); line-height: 1.7;
}
#mcp-modal .mcp-sec-title { font-size: 13px; font-weight: 700; color: var(--gray-12); margin: 10px 0 6px; }
#mcp-modal .mcp-divider { height: 1px; background: var(--gray-4); margin: 12px 0; }
#mcp-modal .mcp-note { font-size: 11px; color: var(--gray-9); margin-top: 4px; }
#mcp-modal pre {
  background: var(--gray-2); padding: 8px 10px; border-radius: 8px;
  overflow-x: auto; font-size: 11px; margin: 6px 0; white-space: pre-wrap; word-break: break-word;
}
#mcp-modal .mcp-table { width: 100%; border-collapse: collapse; font-size: 11px; }
#mcp-modal .mcp-table td { padding: 4px 10px; border-bottom: 1px solid var(--gray-4); vertical-align: top; }
#mcp-modal code { background: var(--gray-3); padding: 1px 5px; border-radius: 4px; font-size: 11px; }
#mcp-modal pre code { background: none; padding: 0; }
.mcp-key-card {
  background: var(--gray-3); padding: 10px 12px; border-radius: 8px;
  font-family: monospace; font-size: 12px; color: var(--gray-12);
  word-break: break-all; margin-bottom: 6px;
}
.mcp-key-note { color: var(--accent-11); font-size: 11px; margin-top: 4px; font-family: inherit; }
.mcp-key-btn {
  padding: 7px 14px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--accent-9); color: #083344; font-size: 12px; font-weight: 600;
}
.mcp-key-btn:disabled { opacity: 0.6; cursor: default; }
.mcp-key-hint { color: var(--gray-9); background: var(--gray-3); padding: 8px 12px; border-radius: 8px; }
.mcp-key-err { color: #e5484d; font-size: 11px; margin-top: 6px; }
.mcp-examples {
  background: var(--gray-3); padding: 8px 12px; border-radius: 8px;
  margin-top: 6px; color: var(--gray-12);
}

/* ===== 右栏（暖浅底，白色面板浮于其上） ===== */
#right-panel { margin-left: calc(var(--ai-width) + var(--ai-gap)); min-height: 100vh; background: var(--page-bg); }

/* ===== 目录区：暖白半透明 + 发丝底边 ===== */
#dirbar {
  position: fixed; top: 0; left: calc(var(--ai-width) + var(--ai-gap)); right: 0; z-index: 999;
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}

/* 外层边界容器：目录行内恒定高度；展开区绝对定位悬浮于内容之上，不改变目录总高度 */
.dir-panel { position: relative; flex-shrink: 0; }
.dir-panel.expanded { z-index: 1000; }

/* 悬浮展开盒：贴在按钮正下方、浮于内容之上（与按钮拼接成更高的边界） */
.float-expand {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--paper);
  border: 1px solid var(--hairline); border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: var(--soft-shadow);
}
.float-expand:not(.hidden) { animation: menu-in 0.15s ease; }
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* 搜索/研报/发现胶囊（形似输入框，实为按钮，不可输入），近实底 + 阴影 → 按钮感 */
#search-panel, #report-panel, #discover-panel {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(0,0,0,0.40);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.10);
  cursor: pointer; user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#search-panel, #report-panel, #discover-panel { width: 88px; }
#search-panel:hover, #report-panel:hover, #discover-panel:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.16);
}
/* 胶囊内的圆钮：K=融合K线 / 研=研报库 / 信=发现日报（暗金，与移动端同款） */
#search-panel .k-btn, #report-panel .k-btn, #discover-panel .k-btn {
  width: 24px; height: 24px; margin-left: 8px; flex-shrink: 0;
  border: none; border-radius: 50%; cursor: pointer;
  background: #8C6A2F; color: #fff;
  font-size: 12px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
#search-panel .k-btn:hover, #report-panel .k-btn:hover, #discover-panel .k-btn:hover { background: #73561F; }
#search-panel .search-text, #report-panel .search-text, #discover-panel .search-text {
  flex: 1; min-width: 0; padding: 0 10px 0 6px;
  font-size: 13px; color: var(--ink);
  white-space: nowrap; overflow: hidden;
  line-height: 38px;
}

/* 一级菜单组：各组专属深底浅字，展开态颜色不变 */
#menu-groups { display: flex; gap: 6px; }
.group-panel { width: 200px; }
/* 一级菜单按钮：中金研报目录风——白底宋体衬线墨字 + 左侧 2px 细金竖线（平面无阴影），
   展开组切换暗金实底+白字（竖线融入实底） */
.group-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; height: 38px; cursor: pointer;
  background: transparent;
  border: none; border-left: 2px solid #8C6A2F; border-radius: 0;
  padding: 0 10px 0 12px;
  font-family: "Songti SC", "Noto Serif SC", "SimSun", serif;
  font-size: 14px; font-weight: 600; color: var(--ink);
  transition: background 0.15s ease, border-left-color 0.15s ease;
}
.group-btn:hover { background: #FAF8F4; border-left-color: #D4A017; }
/* 展开态：暗金实底白字，仅此一组实底（开合一眼分明） */
.group-panel.expanded .group-btn {
  background: #8C6A2F; color: #fff; border-radius: 6px 6px 0 0;
  border-left-color: #8C6A2F;
}
.group-caret {
  font-size: 20px; color: var(--ink-3); transition: transform 0.2s ease;
}
.group-panel.expanded .group-caret { transform: rotate(180deg); color: #fff; }

/* 二级菜单：白卡片发丝边框全宽单行，选中 = 本组实色 */
.group-expand {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px;
}
.sub-btn {
  flex: 1 1 100%; width: 100%;
  border: 1px solid var(--hairline); background: var(--paper); cursor: pointer;
  padding: 7px 10px; font-size: 13px; font-weight: 500; color: var(--ink-2);
  font-family: "Songti SC", "Noto Serif SC", "SimSun", serif;
  border-radius: 2px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: all 0.15s ease;
}
.sub-btn:hover { background: #FAF8F4; color: var(--ink); }
/* 仅选中项统一暗金（中金主色） */
.sub-btn.active {
  background: #8C6A2F; border-color: #73561F; color: #fff; font-weight: 700;
}

/* 内测标签：金黄胶囊（与红色 HOT 区分） */
.badge-beta {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  font-size: 10px; font-weight: 700; line-height: 1.5;
  color: #6b4e00; background: linear-gradient(135deg, #ffd54a, #f0a500);
  border-radius: 8px; vertical-align: middle;
  box-shadow: 0 1px 4px rgba(240, 165, 0, 0.45);
}

/* HOT 标签：炽红胶囊 */
.badge-hot {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  font-size: 10px; font-weight: 800; line-height: 1.5; letter-spacing: 0.5px;
  color: #fff; background: linear-gradient(135deg, #ff2d55, #d1121f);
  border-radius: 8px; vertical-align: middle;
  box-shadow: 0 1px 4px rgba(209, 18, 31, 0.5);
}

/* 右端：用户 */
.user-dropdown { position: relative; flex-shrink: 0; height: 40px; display: flex; align-items: center; }
.user-trigger {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  border: none; background: transparent; padding: 4px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.user-trigger:hover { background: rgba(0,0,0,0.045); color: var(--ink); }
/* 未登录态：圆形图标按钮（与手机端同款） */
.user-trigger.icon-trigger {
  width: 34px; height: 34px; padding: 0; justify-content: center;
  border-radius: 50%; background: var(--gray-4); font-size: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.20);
}
.user-trigger.icon-trigger:hover { background: var(--gray-5); }
.role-badge { font-size: 10px; padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.role-admin { background: #fde8e8; color: #c81e1e; }
.role-vipuser { background: #fdf6e3; color: #b45309; }
.role-normaluser { background: #e8f0fe; color: #1d4ed8; }
.user-menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 1200;
  background: var(--paper); border: 1px solid var(--hairline); border-radius: 6px;
  box-shadow: var(--soft-shadow); padding: 10px; min-width: 180px;
}
.user-menu a, .user-menu button {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  padding: 8px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--ink);
  text-decoration: none;
}
.user-menu a:hover, .user-menu button:hover { background: rgba(0,0,0,0.045); }
.user-menu .menu-divider { height: 1px; background: var(--hairline); margin: 6px 0; }

/* ===== 内容区 ===== */
#content {
  padding-top: calc(var(--dirbar-h) + 10px);
  padding-left: var(--ai-gap);   /* 内容左侧与分割线保持同一间距 */
  min-height: 100vh;
}
#page-frame {
  width: 100%; height: calc(100vh - var(--dirbar-h) - 10px);
  border: none; display: block; background: #fff;
}

/* ===== 登录悬浮弹窗 ===== */
.login-logo {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--gray-3); backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: center;
}
#login-modal {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
#login-modal .login-catcher { position: absolute; inset: 0; background: rgba(0,0,0,0.35); }
#login-modal .login-pop {
  position: relative; width: 340px; max-width: calc(100vw - 32px);
  background: var(--gray-1); border-radius: 14px; padding: 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  animation: menu-in 0.15s ease;
}
#login-modal .login-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: var(--gray-4); cursor: pointer;
  font-size: 12px; color: var(--gray-11); line-height: 1;
}
#login-modal .login-close:hover { background: var(--gray-5); }
#login-modal h1 { font-size: 18px; margin-bottom: 4px; text-align: center; }
#login-modal .sub { font-size: 12px; color: var(--gray-9); margin-bottom: 18px; text-align: center; }
#login-modal .login-err { color: #c81e1e; font-size: 12px; min-height: 18px; margin-bottom: 8px; text-align: center; }
#login-modal input {
  width: 100%; height: 40px; margin-bottom: 12px; padding: 0 12px;
  border: 1px solid var(--gray-6); border-radius: 10px; font-size: 14px;
}
#login-modal input:focus { outline: none; border-color: var(--accent-8); }
#login-submit {
  width: 100%; height: 40px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--accent-9); color: #fff; font-size: 14px; font-weight: 700;
}
#login-submit:hover { background: var(--accent-8); }

/* ===== 充值中心弹窗 ===== */
#recharge-modal {
  position: fixed; inset: 0; z-index: 2100;
  display: flex; align-items: center; justify-content: center;
}
#recharge-modal .rc-pop {
  position: relative; width: 440px; max-width: calc(100vw - 32px); max-height: 88vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--gray-1); border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.22);
  animation: menu-in 0.18s ease;
}
#recharge-modal .rc-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--gray-4);
}
#recharge-modal .rc-head-title { font-size: 16px; font-weight: 800; color: var(--gray-12); letter-spacing: 1px; }
#recharge-modal .rc-head .login-close { position: static; flex-shrink: 0; }
#recharge-modal .rc-body { padding: 16px 20px 20px; overflow-y: auto; }
/* 当前状态 */
#recharge-modal .rc-status {
  background: linear-gradient(135deg, #f0f7ff 0%, #f7f9fc 100%);
  border: 1px solid var(--gray-4); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 16px;
}
#recharge-modal .rc-status .rc-balance { font-size: 26px; font-weight: 800; color: var(--accent-11); line-height: 1.2; }
#recharge-modal .rc-status .rc-balance small { font-size: 12px; font-weight: 500; color: var(--gray-9); margin-left: 4px; }
#recharge-modal .rc-status .rc-sub { font-size: 12px; color: var(--gray-11); margin-top: 4px; line-height: 1.7; }
#recharge-modal .rc-status .rc-badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; margin-right: 6px;
  background: var(--accent-4); color: var(--accent-11);
}
#recharge-modal .rc-status .rc-badge.gray { background: var(--gray-4); color: var(--gray-9); }
#recharge-modal .rc-status .rc-pending { color: #b45309; font-weight: 700; }
/* 标签 */
#recharge-modal .rc-label { font-size: 12px; font-weight: 700; color: var(--gray-11); margin: 0 0 8px; }
/* 档位卡片 */
#recharge-modal .rc-plans { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 16px; }
#recharge-modal .rc-plan-card {
  border: 1.5px solid var(--gray-5); border-radius: 10px; background: var(--gray-1);
  padding: 12px 6px; text-align: center; cursor: pointer;
  transition: all 0.15s ease;
}
#recharge-modal .rc-plan-card:hover { border-color: var(--gray-8); }
#recharge-modal .rc-plan-card.active {
  border-color: var(--accent-9); background: var(--accent-4);
  box-shadow: 0 2px 10px rgba(43,108,176,0.18);
}
#recharge-modal .rc-plan-card .rc-plan-num { font-size: 22px; font-weight: 800; color: var(--gray-12); line-height: 1.2; }
#recharge-modal .rc-plan-card.active .rc-plan-num { color: var(--accent-11); }
#recharge-modal .rc-plan-card .rc-plan-unit { font-size: 11px; color: var(--gray-9); }
#recharge-modal .rc-plan-card .rc-plan-price { font-size: 12px; font-weight: 700; color: var(--gray-11); margin-top: 6px; }
#recharge-modal .rc-plan-card.active .rc-plan-price { color: var(--accent-11); }
/* 周期分段 */
#recharge-modal .rc-periods { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 16px; }
#recharge-modal .rc-period-btn {
  border: 1.5px solid var(--gray-5); border-radius: 10px; background: var(--gray-1);
  padding: 9px 4px; text-align: center; cursor: pointer; font-size: 12px;
  color: var(--gray-11); transition: all 0.15s ease; line-height: 1.5;
}
#recharge-modal .rc-period-btn:hover { border-color: var(--gray-8); }
#recharge-modal .rc-period-btn.active {
  border-color: var(--accent-9); background: var(--accent-9); color: #fff; font-weight: 700;
}
#recharge-modal .rc-period-btn .rc-period-save { font-size: 10px; opacity: 0.85; }
/* 金额与明细 */
#recharge-modal .rc-paybox {
  background: var(--gray-3); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px;
}
#recharge-modal .rc-pay { font-size: 24px; font-weight: 800; color: var(--accent-11); line-height: 1.2; }
#recharge-modal .rc-pay small { font-size: 12px; font-weight: 400; color: var(--gray-9); margin-left: 4px; }
#recharge-modal .rc-detail { font-size: 11px; color: var(--gray-9); margin-top: 6px; line-height: 1.7; }
/* 内测提示 */
#recharge-modal .rc-notice {
  background: #fdf6e3; border: 1px solid #f0e2b6; border-radius: 10px;
  padding: 10px 12px; font-size: 12px; color: #8a6d1a; text-align: center;
  line-height: 1.7; margin-bottom: 14px;
}
/* 申请按钮 */
#recharge-modal .rc-apply {
  width: 100%; height: 42px; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent-9) 0%, var(--accent-8) 100%);
  color: #fff; font-size: 14px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(43,108,176,0.25);
  transition: all 0.15s ease;
}
#recharge-modal .rc-apply:hover { filter: brightness(1.08); }
#recharge-modal .rc-apply:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
#recharge-modal #rc-msg { font-size: 12px; margin-top: 10px; text-align: center; }
#recharge-modal #rc-msg .rc-ok { color: #15803d; line-height: 1.7; }
#recharge-modal #rc-msg .rc-err { color: #c81e1e; }

/* ===== 企业端口提示弹窗 ===== */
#enterprise-modal {
  position: fixed; inset: 0; z-index: 2200;
  display: flex; align-items: center; justify-content: center;
}
#enterprise-modal .ent-pop {
  position: relative; width: 360px; max-width: calc(100vw - 32px);
  background: linear-gradient(160deg, #16335f 0%, #0d6f9c 55%, #00a2c7 100%);
  border-radius: 18px; padding: 36px 28px 32px; text-align: center;
  box-shadow: 0 18px 56px rgba(13, 111, 156, 0.45);
  animation: menu-in 0.2s ease;
}
#enterprise-modal .login-close {
  position: absolute; top: 12px; right: 12px;
  width: 26px; height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px; line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}
#enterprise-modal .login-close:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  transform: scale(1.06);
}
#enterprise-modal .ent-logo {
  width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(240, 213, 140, 0.45);
  box-shadow: 0 2px 14px rgba(0,0,0,0.28), inset 0 0 18px rgba(240, 213, 140, 0.10);
  display: flex; align-items: center; justify-content: center;
}
#enterprise-modal h2 {
  font-size: 22px; font-weight: 800; color: #fff;
  letter-spacing: 6px; margin-bottom: 14px;
}
#enterprise-modal .ent-text {
  font-size: 14px; color: rgba(255,255,255,0.88); line-height: 2; letter-spacing: 1px;
}

/* ===== 注册表单 ===== */
#login-modal .reg-code-row { display: flex; gap: 8px; margin-bottom: 12px; }
#login-modal .reg-code-row input { flex: 1; margin-bottom: 0; }
#login-modal #reg-sendcode {
  flex-shrink: 0; width: 92px; height: 40px; border: 1px solid var(--accent-9);
  border-radius: 10px; background: var(--gray-1); color: var(--accent-11);
  font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
#login-modal #reg-sendcode:hover { background: var(--accent-4); }
#login-modal #reg-sendcode:disabled { opacity: 0.55; cursor: default; }
#login-modal #reg-submit {
  width: 100%; height: 40px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--accent-9); color: #fff; font-size: 14px; font-weight: 700;
}
#login-modal #reg-submit:hover { background: var(--accent-8); }
#login-modal .login-switch { margin-top: 12px; text-align: center; }
#login-modal .login-switch a {
  font-size: 12px; color: var(--accent-11); cursor: pointer; text-decoration: none;
}
#login-modal .login-switch a:hover { text-decoration: underline; }

/* ===== 移动端元素 ===== */
#mobile-login-panel {
  position: fixed; top: 48px; right: 8px; z-index: 1001; min-width: 200px;
  background: var(--gray-1); border: 1px solid var(--gray-5); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.20); padding: 12px;
}
#mobile-login-catcher { position: fixed; inset: 0; z-index: 1000; background: transparent; }

/* 移动端顶部条（桌面隐藏）：皓月AI + 目录 + K + 登录 同一行 */
#mobile-tools {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 950;
  background: #FDFCF7; border-bottom: 1px solid var(--gray-5);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
#mobile-tools .m-topbar {
  display: flex; align-items: center; gap: 5px;
  height: 44px; padding: 6px 8px; flex-shrink: 0;
}
/* 皓月AI：暖金→铜红渐变, 撑满顶条上下与左边界的一段色块(无圆角无阴影无浮动) */
#mobile-tools .m-ai-btn {
  flex-shrink: 0; height: 100%; padding: 0 16px; cursor: pointer;
  margin: -6px 0 -6px -8px;
  border: none; border-radius: 0;
  font-family: "Songti SC", "Noto Serif SC", "SimSun", serif;
  font-size: 12px; font-weight: 600; letter-spacing: 2px; color: #fff; white-space: nowrap;
  background: linear-gradient(135deg, #C9A15A 0%, #A8572F 100%);
  box-shadow: none;
  transition: filter 0.15s ease;
}
#mobile-tools .m-ai-btn:hover { filter: brightness(1.06); }
/* 分组目录：压缩版桌面样式（组色顶边 + 组色浅底），横向滚动 */
#mobile-tools .m-group-tabs {
  display: flex; gap: 4px; overflow-x: auto;
  flex: 1; min-width: 0; height: 30px; align-items: center;
  scrollbar-width: none;
}
#mobile-tools .m-group-tabs::-webkit-scrollbar { display: none; }
#mobile-tools .m-group-tab {
  flex-shrink: 0; height: 28px; padding: 0 8px; cursor: pointer;
  border: none; border-left: 2px solid #8C6A2F; border-radius: 0;
  background: transparent;
  font-family: "Songti SC", "Noto Serif SC", "SimSun", serif;
  font-size: 11px; font-weight: 600; color: var(--ink); white-space: nowrap;
}
/* 移动端分组 tab：与桌面一级按钮同款中金目录风（白底衬线墨字+金竖线，展开组实底白字） */
#mobile-tools .m-group-tab.active { background: #8C6A2F; color: #fff; }
/* K 圆形按钮：点击进入融合K线（暗金，与目录金竖线同源） */
#mobile-tools .m-k-btn {
  flex-shrink: 0; width: 30px; height: 30px; border: none; cursor: pointer;
  border-radius: 50%; background: #8C6A2F; color: #fff;
  font-size: 14px; font-weight: 800; line-height: 1;
}
/* 登录圆形按钮（顶部条内） */
#mobile-login-btn {
  flex-shrink: 0; width: 30px; height: 30px; border: none; cursor: pointer;
  border-radius: 50%; background: var(--gray-4); font-size: 14px;
}
#mobile-tools .m-page-list {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px; max-height: 45vh; overflow-y: auto;
}
#mobile-tools .m-page-btn {
  border: 1px solid var(--hairline); background: var(--paper); border-radius: 2px; padding: 6px 12px;
  font-family: "Songti SC", "Noto Serif SC", "SimSun", serif;
  font-size: 12px; cursor: pointer; color: var(--ink-2);
}

/* ===== 移动端断点（<62em） ===== */
@media (max-width: 62em) {
  :root { --m-topbar-offset: max(env(safe-area-inset-top, 26px), 26px); }
  #dirbar { display: none; }
  #right-panel { margin-left: 0; }
  #content { padding-top: 50px; padding-left: 0; height: 100vh; height: 100dvh; }
  #page-frame { height: calc(100vh - 50px); height: calc(100dvh - 50px); }
  #ai-sidebar { display: none; }
  /* AI 全屏页下移：让出顶部目录条与手机状态栏空间（目录条贴顶 0） */
  body.mobile-ai #ai-sidebar {
    display: block; position: fixed;
    top: max(var(--m-topbar-offset, 26px), 44px);
    left: 0; right: 0; bottom: auto; z-index: 600; width: 100vw;
    /* 高度随浏览器工具栏动态伸缩（dvh），贴底输入框不被底部工具栏遮挡；vh 为老内核回退 */
    height: calc(100vh - max(var(--m-topbar-offset, 26px), 44px));
    height: calc(100dvh - max(var(--m-topbar-offset, 26px), 44px));
  }
  #mobile-login-btn { display: flex; align-items: center; justify-content: center; }
  #mobile-tools { display: flex; flex-direction: column; top: 0; }
}
