* { box-sizing: border-box; }
/* hidden 属性必须始终生效（防止 display 规则覆盖导致视图叠加/混乱） */
[hidden] { display: none !important; }
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel2: #eef1f6;
  --line: #e2e7ef;
  --text: #1f2937;
  --dim: #5d6b7c;
  --accent: #c8901f;
  --accent2: #1f7f8f;
  --danger: #d0453a;
  --ok: #2f8f4f;
}
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px; line-height: 1.6; min-height: 100vh;
  display: flex; flex-direction: column;
}
.topbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 22px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; letter-spacing: .5px; flex: none; }
.brand span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--accent);
}
.brand svg { flex: none; filter: drop-shadow(0 2px 5px rgba(200,144,31,.28)); }
#nav { display: flex; gap: 8px; }
#nav[hidden] { display: none; }
.nav-btn {
  background: transparent; color: var(--dim); border: 1px solid transparent;
  padding: 7px 16px; border-radius: 20px; cursor: pointer; font-size: 14px;
  white-space: nowrap; flex: none; transition: all .15s;
}
.nav-btn:hover { color: var(--text); border-color: var(--line); }
.nav-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(200,144,31,.09); }
#userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; }
#userbox button {
  background: transparent; color: var(--danger); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 6px; cursor: pointer;
}
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 22px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; margin-bottom: 16px;
}
.card h1 { margin: 0 0 6px; font-size: 22px; }
.card h2 { margin: 0 0 4px; font-size: 18px; }
#view-login.card, #view-register.card { max-width: 480px; margin: 48px auto; }
.hint { color: var(--dim); font-size: 13px; margin: 4px 0 14px; }
.rowform { display: flex; gap: 10px; flex-wrap: wrap; }
.rowform input[type=text], .rowform input:not([type]), .rowform input[type=password], .rowform select {
  flex: 1; min-width: 220px; background: var(--panel2); border: 1px solid var(--line);
  color: var(--text); border-radius: 8px; padding: 9px 12px; font-size: 14px;
}
.rowform button, #login-form button {
  background: var(--accent); color: #141414; border: none; border-radius: 8px;
  padding: 9px 22px; font-weight: 700; cursor: pointer; font-size: 14px;
}
.rowform button:hover, #login-form button:hover { filter: brightness(1.08); }
label { display: block; margin: 10px 0; }
label input { width: 100%; margin-top: 4px; }
.msg { min-height: 20px; color: var(--danger); font-size: 13px; margin: 8px 0 0; }
.msg.ok { color: var(--ok); }

/* 决策卡输出 */
.decision-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.decision-card h3 { margin: 0 0 10px; font-size: 16px; color: var(--accent); }
.block { margin: 10px 0; }
.block .label { color: var(--dim); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.bose-pill {
  display: inline-block; padding: 3px 12px; border-radius: 20px; font-weight: 700; margin-right: 8px;
}
.bose-红 { background: #c0392b; color: #fff; }
.bose-蓝 { background: #2c6fbb; color: #fff; }
.bose-绿 { background: #2e8b57; color: #fff; }
.nums { display: flex; flex-wrap: wrap; gap: 6px; }
.num-chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 10px; font-size: 14px; font-variant-numeric: tabular-nums; }
.ticket-line { margin: 4px 0; color: var(--accent2); font-variant-numeric: tabular-nums; }
.warn { border-left: 3px solid var(--danger); background: rgba(224,123,106,.08); padding: 10px 12px; border-radius: 0 8px 8px 0; color: var(--dim); font-size: 13px; }
.actual-line { color: var(--dim); font-size: 13px; }

/* 元亨利贞式排盘 */
.pai-info { font-size: 13px; color: var(--text); line-height: 1.9; margin: 4px 0 10px; }
.pai-info .pai-title { font-weight: 700; color: var(--accent); margin-top: 6px; }
.paipan-table {
  width: 100%; border-collapse: collapse; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 14px;
}
.paipan-table th, .paipan-table td { border: 1px solid var(--line); padding: 6px 12px; text-align: center; }
.paipan-table th { background: var(--panel); color: var(--dim); font-size: 12px; letter-spacing: 1px; }
.paipan-table td.shen { color: var(--accent2); font-weight: 600; white-space: nowrap; }
.paipan-table .wx { font-variant-numeric: tabular-nums; }
.wx.wx-mu { color: #2e9e4f; }
.wx.wx-huo { color: #d0453a; }
.wx.wx-tu { color: #b8860b; }
.wx.wx-jin { color: #7a8794; }
.wx.wx-shui { color: #1f6fd0; }
.dong-flag { color: var(--danger); margin-right: 2px; }
.shi-flag { color: var(--accent); margin-left: 4px; }

/* 检索输出 */
.hit { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.hit .meta { color: var(--dim); font-size: 12px; margin-bottom: 4px; word-break: break-all; }
.hit .doc { font-size: 14px; }
.hit .dist { color: var(--accent2); font-size: 12px; }

/* 规则库 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.rule-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.rule-card h4 { margin: 0 0 6px; font-size: 15px; color: var(--accent); }
.rule-card .tag { color: var(--dim); font-size: 12px; margin-right: 8px; }
.rule-card p { margin: 6px 0 0; font-size: 13px; color: var(--dim); }
.rule-card.dead { border-color: rgba(224,123,106,.5); }
.rule-card.dead h4 { color: var(--danger); }

.foot { text-align: center; color: var(--dim); font-size: 12px; padding: 16px; border-top: 1px solid var(--line); }

/* ===== 智聊（zhiliao）新增 ===== */
.link { color: var(--accent2); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.user-chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 20px; padding: 4px 14px; font-variant-numeric: tabular-nums; }
#userbox a { margin-left: 4px; }
#userbox .mini { border-color: var(--line); color: var(--danger); }

/* 彩票下拉 */
.nav-drop { position: relative; }
.nav-drop-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 160px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; z-index: 20; box-shadow: 0 10px 28px rgba(15,23,42,.14);
}
.nav-drop-menu.open { display: block; }
.nav-drop-menu a {
  display: block; padding: 8px 14px; border-radius: 6px; color: var(--dim);
  font-size: 14px; cursor: pointer; text-decoration: none;
}
.nav-drop-menu a:hover { background: var(--panel); color: var(--accent); }
.nav-drop-menu a.active { color: var(--accent); }

/* 首页 hero + 卡片 */
.hero { text-align: center; padding: 34px 20px; }
.hero h1 { font-size: 28px; margin: 0 0 8px; letter-spacing: 1px; }
.hero .hint { margin-bottom: 0; }
.mod-hero { padding: 26px 20px; }
.mod-hero h1 { font-size: 26px; }
.mod-hero .hint { max-width: 720px; margin: 0 auto; }
.home-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* ===== 14 大模块大厅（主次分明） ===== */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 14px; }
.mod-card {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 15px 17px; cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.mod-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.mod-card h3 { margin: 0 0 6px; font-size: 15px; }
.mod-card p { margin: 0 0 10px; font-size: 12px; color: var(--dim); line-height: 1.55; }
/* 一级主模块：跨 2 列、金色描边、大标题、进入按钮 */
.mod-card.main {
  grid-column: span 2;
  border-color: rgba(200,144,31,.45);
  background: linear-gradient(135deg, rgba(200,144,31,.06), var(--panel) 60%);
}
.mod-card.main h3 { font-size: 18px; color: var(--accent); letter-spacing: .5px; }
.mod-card.main .mod-go {
  position: absolute; right: 15px; bottom: 12px; font-size: 12px; color: var(--accent);
  border: 1px solid rgba(232,184,75,.5); border-radius: 14px; padding: 3px 12px;
}
.mod-card.main .mod-subs { padding-right: 80px; }
/* 二级模块：中卡 */
.mod-card.sub { border-color: var(--line); }
.mod-card.sub h3 { color: var(--text); }
/* 三级模块：小卡（灰字小标题） */
.mod-card.mini { padding: 12px 14px; }
.mod-card.mini h3 { font-size: 13px; color: var(--dim); }
.mod-card.mini .mod-subs { margin-top: 4px; }
/* ===== 主页 AI 助手「恒心」（知了风格对话框） ===== */
#view-home { display: flex; flex-direction: column; align-items: center; }
#view-home .hengxin { width: 100%; max-width: 780px; margin: 8px auto 0; }
.hengxin { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.hx-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(200,144,31,.08), rgba(31,127,143,.06));
}
.hx-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 18px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 4px 12px rgba(200,144,31,.3);
}
.hx-avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.hx-name { font-weight: 700; font-size: 15px; }
.hx-sub { font-size: 12px; color: var(--dim); }
.hx-msgs {
  flex: 1; min-height: 240px; max-height: 420px; overflow-y: auto;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 12px;
  background: var(--panel2);
}
.hx-empty { margin: auto; color: var(--dim); font-size: 13.5px; text-align: center; max-width: 340px; line-height: 1.7; }
.hx-msg { display: flex; align-items: flex-start; gap: 9px; max-width: 86%; }
.hx-msg.mine { flex-direction: row-reverse; margin-left: auto; }
.hx-bubble {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  border-top-left-radius: 4px; padding: 9px 13px; font-size: 14px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.hx-msg.mine .hx-bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  border-color: transparent; border-top-left-radius: 14px; border-top-right-radius: 4px;
}
.hx-bubble.typing { color: var(--dim); animation: hxBlink 1.1s ease-in-out infinite; }
@keyframes hxBlink { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.hx-meta-row { font-size: 11px; color: var(--dim); margin-top: 3px; padding: 0 2px; white-space: nowrap; flex: none; }
.hx-meta { opacity: .85; }
.hx-input-row { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.hx-input-row input {
  flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid var(--line); border-radius: 20px;
  font-size: 14px; outline: none; background: var(--panel2); color: var(--text);
}
.hx-input-row input:focus { border-color: var(--accent); }
.hx-input-row button {
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  border: 0; padding: 0 22px; border-radius: 20px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.hx-input-row button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 600px) { .hx-msg { max-width: 94%; } }
/* 子入口链接 */
.mod-subs { display: flex; flex-wrap: wrap; gap: 6px; }
.mod-link {
  font-size: 12px; color: var(--accent2); text-decoration: none;
  border: 1px solid rgba(92,200,181,.35); padding: 2px 9px; border-radius: 12px;
}
.mod-link:hover { background: rgba(92,200,181,.12); }
/* 模块详情页 */
.mod-body { font-size: 14px; }
.mod-body .warn { white-space: pre-line; }
.mod-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.feat { cursor: pointer; transition: border-color .15s, transform .15s; }
.feat:hover { border-color: var(--accent); transform: translateY(-2px); }
.feat.locked { border-color: rgba(224,123,106,.5); opacity: .8; }
.feat.locked .mini { color: var(--danger); border-color: rgba(224,123,106,.5); }
.feat h3 { margin: 0 0 6px; font-size: 16px; }
.feat p { margin: 0 0 12px; font-size: 13px; color: var(--dim); }
.mini {
  background: transparent; color: var(--accent); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 14px; cursor: pointer; font-size: 13px;
}
.mini:hover { border-color: var(--accent); }

/* ===== 聊天室（版块版） ===== */
.chat-app {
  --ca: #5b8cff; --ca2: #7c5cff;
  display: flex; height: calc(100dvh - 128px); min-height: 420px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.chat-side {
  width: 236px; flex: 0 0 236px; display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--line); padding: 14px 12px;
}
.chat-brand { font-size: 13px; font-weight: 700; color: var(--dim); letter-spacing: 1px; padding: 4px 8px 12px; }
.chat-channels { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.chat-channel {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 11px; border: 0; background: transparent; color: var(--text);
  cursor: pointer; transition: .15s; font-size: 13.5px;
}
.chat-channel:hover { background: rgba(15,23,42,.05); }
.chat-channel.active { background: linear-gradient(135deg, rgba(91,140,255,.18), rgba(124,92,255,.10)); box-shadow: inset 0 0 0 1px rgba(91,140,255,.35); }
.cc-icon { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(15,23,42,.06); font-size: 16px; }
.chat-channel.active .cc-icon { background: rgba(91,140,255,.28); }
.cc-name { font-weight: 600; }
.chat-side-foot { margin-top: 12px; padding: 8px 8px 4px; font-size: 11px; color: var(--dim); border-top: 1px solid var(--line); line-height: 1.5; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.chat-menu-btn { display: none; }
.chat-head-info { flex: 1; min-width: 0; }
.chat-room { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.chat-room-sub { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-conn { font-size: 11px; color: var(--dim); background: rgba(15,23,42,.05); padding: 3px 9px; border-radius: 10px; flex: none; }
.chat-box { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 15px; }
.chat-msg { display: flex; gap: 11px; align-items: flex-start; width: max-content; max-width: 100%; align-self: flex-start; }
.chat-msg.mine { flex-direction: row-reverse; align-self: flex-end; }
.cm-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .5px; box-shadow: 0 3px 10px rgba(15,23,42,.22); }
.cm-avatar.lv2 { font-size: 11px; }
.cm-avatar.lv3 { font-size: 9px; }
.cm-lv { opacity: .72; }
.cm-bubble { min-width: 0; flex: 1 1 auto; }
.chat-msg.mine .cm-bubble { display: flex; flex-direction: column; align-items: flex-end; }
.cm-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--dim); margin: 0 4px 5px; }
.chat-msg.mine .cm-meta { flex-direction: row-reverse; }
.cm-meta b { color: #374151; }
.cm-text {
  display: inline-block; max-width: 100%;
  background: var(--panel2); border: 1px solid var(--line); padding: 10px 14px;
  border-radius: 15px; border-top-left-radius: 4px; line-height: 1.58; font-size: 14.5px;
  white-space: pre-wrap; word-break: break-word;
}
.chat-msg.mine .cm-text { background: linear-gradient(135deg, var(--ca), var(--ca2)); border-color: transparent; border-top-left-radius: 15px; border-top-right-radius: 4px; color: #fff; }
.chat-composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.chat-composer textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 150px; padding: 12px 14px;
  border-radius: 13px; background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  font-size: 14px; line-height: 1.4; outline: none; font-family: inherit; transition: .2s;
}
.chat-composer textarea:focus { border-color: var(--ca); box-shadow: 0 0 0 3px rgba(91,140,255,.14); }
.chat-send { height: 44px; padding: 0 22px; border: 0; border-radius: 13px; color: #fff; font-size: 14px; font-weight: 600; background: linear-gradient(135deg, var(--ca), var(--ca2)); cursor: pointer; flex: none; }
.chat-send:hover { filter: brightness(1.08); }
.chat-emoji {
  position: absolute; right: 84px; bottom: 74px; width: 300px; padding: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 14px 40px rgba(15,23,42,.16);
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; z-index: 40;
}
.chat-emoji button { background: transparent; border: 0; font-size: 20px; padding: 5px 0; border-radius: 8px; cursor: pointer; }
.chat-emoji button:hover { background: rgba(15,23,42,.07); }
.chat-composer .msg { position: static; padding: 0 6px 4px; }

/* 在线成员列 */
.chat-members {
  width: 190px; flex: 0 0 190px; display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line); padding: 14px 10px;
}
.chat-members-title { font-size: 12px; color: var(--dim); letter-spacing: 1px; padding: 2px 6px 10px; display: flex; justify-content: space-between; align-items: center; }
.chat-online-count { background: rgba(30,158,92,.12); color: #1e9e5c; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.chat-member-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.chat-member {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px;
  font-size: 13px; color: var(--text);
}
.chat-member:hover { background: rgba(15,23,42,.05); }
.chat-member.self .cm-m-name { color: var(--accent); font-weight: 600; }
.cm-m-avatar {
  width: 27px; height: 27px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel2); color: var(--text); font-weight: 700; font-size: 12px;
}
.cm-m-avatar.lv2 { font-size: 9px; }
.cm-m-avatar.lv3 { font-size: 8px; }
.chat-member.self .cm-m-avatar { background: linear-gradient(135deg, var(--ca), var(--ca2)); }
.cm-m-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-m-lv { font-size: 11px; color: var(--dim); flex: none; }
.cm-m-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #31d07a; box-shadow: 0 0 7px rgba(49,208,122,.6); }

/* 注册表单 */
#view-register label, #view-login label { max-width: 420px; }

/* 管理员表格 */
.admin-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.admin-stats .stat {
  flex: 1; min-width: 110px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; text-align: center;
}
.admin-stats .stat b { display: block; font-size: 22px; color: var(--accent); font-variant-numeric: tabular-nums; }
.admin-stats .stat span { font-size: 12px; color: var(--dim); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 13px; }
.admin-table th, .admin-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.admin-table th { background: var(--panel2); color: var(--dim); }
.admin-table .tag { color: var(--accent); font-size: 12px; margin-left: 6px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: var(--panel); color: var(--text); border: 1px solid var(--accent);
  border-radius: 10px; padding: 10px 22px; font-size: 14px; z-index: 50;
  box-shadow: 0 10px 26px rgba(15,23,42,.16); max-width: 80vw;
}
.toast[hidden] { display: none; }
.hidden { display: none !important; }

@media (max-width: 820px) {
  /* 手机/平板：品牌独立一行 + 导航一行 + 用户信息一行，大气不挤压 */
  .topbar { flex-wrap: wrap; overflow-x: visible; gap: 0; padding: 10px 14px 12px; }
  .brand {
    flex-basis: 100%; justify-content: center; padding: 2px 0 8px;
    border-bottom: 1px solid var(--line); margin-bottom: 8px;
  }
  .brand span { font-size: 19px; letter-spacing: 3px; }
  #nav { flex: 1 1 100%; min-width: 0; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  #nav::-webkit-scrollbar { display: none; }
  #nav .nav-btn { padding: 8px 13px; font-size: 13.5px; }
  #userbox {
    flex-basis: 100%; margin-left: 0; justify-content: flex-start;
    gap: 8px; padding: 9px 12px; border-top: 1px dashed var(--line);
    white-space: nowrap; overflow-x: auto; flex: none; -webkit-overflow-scrolling: touch;
    background: rgba(200,144,31,.05); border-radius: 10px; margin-top: 8px;
  }
  #userbox::-webkit-scrollbar { display: none; }
  .nav-drop { flex: none; }
  .nav-drop-menu { position: fixed; top: auto; left: 14px; right: 14px; min-width: 0; }
  main { padding: 14px; }
  .rowform { flex-direction: column; }
  .rowform input, .rowform select, .rowform button { min-width: 0; width: 100%; }
  .admin-table { font-size: 12px; }
  .admin-table th:nth-child(2), .admin-table td:nth-child(2),
  .admin-table th:nth-child(3), .admin-table td:nth-child(3) { display: none; }
  #view-login.card, #view-register.card { max-width: 420px; margin: 40px auto; }
  .chat-box { height: auto; }
  @media (max-width: 1024px) {
    .chat-members { display: none; }
  }
  @media (max-width: 640px) {
    .chat-app { height: calc(100dvh - 150px); position: relative; }
    .chat-side {
      position: absolute; top: 0; left: 0; bottom: 0; z-index: 60; width: 230px;
      transform: translateX(-102%); transition: transform .26s cubic-bezier(.3,.8,.3,1); box-shadow: 0 0 50px rgba(15,23,42,.18);
    }
    .chat-side.open { transform: none; }
    .chat-menu-btn { display: grid; }
    .chat-msg { max-width: 88%; }
    .chat-emoji { left: 10px; right: 10px; width: auto; }
  }
  .mod-card.main { grid-column: span 1; }
}

/* ===== 彩种历史开奖记录 ===== */
.draws-tabs { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 4px; }
.draws-tab-row { display: flex; flex-wrap: wrap; gap: 8px; }
.draws-tab-row.sub { padding-top: 6px; border-top: 1px dashed var(--line); }
.draws-tab-row .mini.active, .draws-cat-row .mini.active { border-color: var(--accent); background: rgba(200,144,31,.10); color: var(--accent); }
.draws-cat-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.draws-search { margin: 12px 0; }
.draws-search .rowform { display: flex; gap: 8px; }
.draws-search .rowform input { flex: 1; min-width: 0; }
.draws-table tr.draw-row { cursor: pointer; transition: background .15s; }
.draws-table tr.draw-row:hover { background: rgba(200,144,31,.07); }
.draws-meta { font-size: 13px; color: var(--dim); margin: 10px 0 8px; }
.draws-meta b { color: var(--accent); }
.draws-latest { font-size: 14px; margin: 0 0 12px; line-height: 2; }
.draws-latest b { color: var(--accent); }
.num-chip {
  display: inline-block; min-width: 26px; height: 26px; line-height: 26px; text-align: center;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 50%;
  font-size: 12px; font-variant-numeric: tabular-nums; margin: 1px 2px;
}
.num-chip.sp { background: rgba(200,144,31,.18); border-color: rgba(200,144,31,.55); color: #8a5f00; font-weight: 700; }
.draws-table td.num-cell { white-space: nowrap; }
.draws-nav { display: flex; align-items: center; gap: 12px; margin: 12px 0; font-size: 13px; color: var(--dim); }
.draws-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.chart-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.chart-card h4 { margin: 0 0 10px; font-size: 13px; color: var(--accent); letter-spacing: .3px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; font-size: 12px; }
.bar-label { width: 34px; flex: none; text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; }
.bar-track { flex: 1; height: 13px; background: var(--panel2); border-radius: 7px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 7px; background: linear-gradient(90deg, #c8901f, #e8b84b); min-width: 1px; }
.bar-fill.omit { background: linear-gradient(90deg, #1f7f8f, #5cc8b5); }
.bar-fill.sum { background: linear-gradient(90deg, #1f6fd0, #6aa8e8); }
.bar-fill.pct { background: linear-gradient(90deg, #2f8f4f, #6fbf73); }
.bar-fill.pct2 { background: linear-gradient(90deg, #5d6b7c, #8b99ab); }
.bar-val { width: 58px; flex: none; color: var(--dim); font-variant-numeric: tabular-nums; }
.draws-out .hint { margin-top: 14px; }
.draws-charts .sort-btn { padding: 2px 8px; font-size: 11px; border-radius: 7px; vertical-align: 1px; }
.chart-card.stats-mini h4 { margin-bottom: 8px; }
.stat-row { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line); }
.stat-row:last-child { border-bottom: 0; }
.stat-row span { color: var(--dim); }
.stat-row b { font-size: 14px; color: var(--accent); font-variant-numeric: tabular-nums; }
.bar-fill.span { background: linear-gradient(90deg, #7a4fd0, #a98ef0); }

/* ===== 主页：知了核心（D:\core 恒心本体，全屏嵌入） ===== */
#view-home.view-core { margin: -22px; width: calc(100% + 44px); height: calc(100vh - 100px); padding: 0; display: flex; }
#view-home .core-frame { flex: 1; width: 100%; height: 100%; min-height: 0; background: #fff; border-radius: 0; overflow: hidden; }
#view-home .core-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
@media (max-width: 820px) {
  #view-home.view-core { margin: -14px; width: calc(100% + 28px); height: calc(100vh - 128px); }
}
