/* ===== GeLing AI 直播助理 —— 设计系统(对齐对标网站) ===== */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-soft: #f1f5f9;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --primary: #0ea5e9;
  --primary-soft: #e0f7fe;
  --info-bg: #e0f7fe;
  --info-text: #0284c7;
  --warn-bg: #fef3e2;
  --warn-text: #b45309;
  --danger: #f56c6c;
  --success: #67c23a;
  --header-grad: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
}
a { color: var(--info-text); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.flex-1 { flex: 1; }
.text-right { text-align: right; }
.login-bg { position: fixed; inset: 0; background: linear-gradient(135deg, #f0f6ff 0%, #eaf3ff 50%, #f5f7fa 100%); display: grid; place-items: center; }
.login-card { background: var(--card); border-radius: 12px; padding: 48px 40px; width: 420px; box-shadow: 0 12px 40px rgba(23,32,51,.08); }
.login-card h1 { margin: 0 0 6px; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.login-card .logo-icon { width: 32px; height: 32px; background: var(--primary); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; }
.login-card .subtitle { color: var(--text-2); margin: 0 0 28px; font-size: 13px; }
.login-form input { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; margin-bottom: 12px; }
.login-form input:focus { outline: none; border-color: var(--primary); }
.login-form button { width: 100%; padding: 11px; background: var(--primary); color: #fff; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; }
.login-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 8px; }
.login-success { color: var(--success) !important; }
.captcha-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.captcha-row input { flex: 1; margin-bottom: 0; min-width: 0; }
.captcha-row img { width: 120px; height: 40px; border-radius: 4px; cursor: pointer; border: 1px solid var(--border); flex-shrink: 0; object-fit: cover; }
.login-link { text-align: center; font-size: 13px; color: var(--text-2); margin-top: 12px; }
.login-link a { color: var(--primary); cursor: pointer; }

/* 手机端登录卡片自适应，避免固定宽度溢出、验证码被裁 */
@media (max-width: 768px) {
  .login-card { width: calc(100vw - 32px); max-width: 420px; padding: 32px 20px; }
  .captcha-row img { width: 108px; height: 36px; }
}
.app { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; position: fixed; top: 0; bottom: 0; left: 0; }
.sidebar-brand { padding: 14px 20px; color: var(--primary); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.sidebar-brand .logo-icon { width: 26px; height: 26px; background: var(--primary); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text .brand-line1 { font-size: 16px; font-weight: 800; letter-spacing: .2px; }
.brand-text .brand-line2 { font-size: 13px; font-weight: 600; }
.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.sidebar-nav .divider { height: 1px; background: var(--border); margin: 8px 10px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 6px; color: var(--text); cursor: pointer; margin-bottom: 2px; font-size: 14px; }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item .icon { width: 18px; text-align: center; font-size: 15px; }
.sidebar-user { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.sidebar-logout { padding: 10px 14px; border-top: 1px solid var(--border); }
.sidebar-logout button { width: 100%; padding: 6px; background: transparent; border: none; color: var(--text-2); font-size: 13px; cursor: pointer; text-align: left; }
.sidebar-logout button:hover { color: var(--danger); }
.main { flex: 1; margin-left: 200px; }
/* ===== 顶部滚动消息栏（红底黄字，跑马灯） ===== */
.announce-bar { display: flex; align-items: center; height: 36px; background: #d81e06; border-bottom: 1px solid #b71c1c; overflow: hidden; flex-shrink: 0; }
.announce-label { flex-shrink: 0; height: 100%; display: flex; align-items: center; padding: 0 12px; font-size: 13px; font-weight: 700; color: #ffe600; border-right: 1px solid rgba(255,255,255,.25); background: #b71c1c; white-space: nowrap; }
.announce-marquee { flex: 1; overflow: hidden; height: 100%; display: flex; align-items: center; }
.announce-inner { display: inline-flex; white-space: nowrap; font-size: 13px; font-weight: 600; color: #ffe600; animation: announce-scroll 30s linear infinite; will-change: transform; }
.announce-inner span { padding-right: 48px; }
@keyframes announce-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.page-header { padding: 18px 24px; background: var(--header-grad); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.page-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; margin: 0; }
.page-title .emoji { font-size: 20px; }
.page-actions { display: flex; align-items: center; gap: 8px; }
.page-body { padding: 20px 24px; }
.btn { padding: 7px 16px; border: 1px solid var(--border); background: #fff; border-radius: 4px; font-size: 13px; color: var(--text); }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: #0a6cd0; color: #fff; }
.btn-danger { color: var(--danger); border-color: #fbc4c4; }
.btn-ghost { background: transparent; border: none; color: var(--info-text); padding: 4px 8px; }
.btn-sm { padding: 3px 10px; font-size: 12px; }
.switch { position: relative; width: 36px; height: 18px; display: inline-block; cursor: pointer; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #dcdfe6; border-radius: 18px; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; height: 14px; width: 14px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.live-section, .room-card, .device-detail-card, .module-layout, .mode-card { border-radius: 10px; box-shadow: var(--shadow); }
.card-title { font-size: 16px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
input[type="text"], input[type="number"], input[type="password"], select, textarea { font-family: inherit; font-size: 14px; color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 7px 10px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; min-height: 60px; }
label.field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); margin-bottom: 10px; }
label.field .label { width: 110px; color: var(--text-2); flex-shrink: 0; }
.num-input { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.num-input input { width: 70px; border: none; text-align: center; }
.num-input .ctrl { padding: 4px 9px; background: #f6f8fb; color: var(--text-2); cursor: pointer; user-select: none; }
.num-input .ctrl:hover { background: var(--primary-soft); color: var(--primary); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: #f6f8fb; color: var(--text-2); font-weight: 600; padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fafcff; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.badge-green { background: #ecf5ff; color: var(--success); }
.badge-red { background: #fef0f0; color: var(--danger); }
.badge-yellow { background: var(--warn-bg); color: var(--warn-text); }
.badge-grey { background: var(--bg); color: var(--text-3); }
.tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 4px; }
.tab { padding: 12px 20px; cursor: pointer; color: var(--text-2); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.mode-switch { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.module-layout { display: flex; gap: 0; background: var(--card); border: 1px solid var(--border); border-radius: 8px; min-height: 560px; }
.module-sidebar { width: 200px; border-right: 1px solid var(--border); padding: 14px 0; flex-shrink: 0; }
.module-sidebar .group-label { padding: 8px 16px 4px; font-size: 12px; color: var(--text-3); }
.module-sidebar .item { display: flex; align-items: center; justify-content: space-between; padding: 9px 16px; cursor: pointer; font-size: 13px; }
.module-sidebar .item:hover { background: var(--bg); }
.module-sidebar .item.active { background: var(--primary-soft); color: var(--primary); border-left: 3px solid var(--primary); }
.module-sidebar .item .left { display: flex; align-items: center; gap: 8px; }
.module-sidebar .item .emoji { font-size: 14px; }
.module-detail { flex: 1; padding: 24px 28px; }
.module-detail .header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.module-detail .header .emoji { font-size: 22px; }
.module-detail .header .title { font-size: 18px; font-weight: 700; }
.module-detail .header .count { color: var(--text-2); font-size: 13px; }
.module-detail .header .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.module-detail .field-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.module-detail .field-row .label { min-width: 100px; color: var(--text-2); font-size: 13px; }
.tpl-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border-soft); }
.tpl-row:last-child { border-bottom: none; }
.tpl-row .num { width: 22px; height: 22px; background: var(--bg); color: var(--text-2); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.tpl-row select { width: 110px; }
.tpl-row .text { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; min-width: 0; }
.tpl-row .counter { color: var(--text-3); font-size: 12px; white-space: nowrap; min-width: 60px; text-align: right; }
.tpl-row .del { color: var(--danger); cursor: pointer; padding: 4px 8px; white-space: nowrap; }
.kw-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px dashed var(--border-soft); }
.kw-row .num { width: 22px; height: 22px; background: var(--bg); color: var(--text-2); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.kw-row select { width: 110px; flex-shrink: 0; }
.kw-row .kw { width: 160px; }
.kw-row .reply { flex: 1; }
.kw-row .counter { color: var(--text-3); font-size: 12px; white-space: nowrap; min-width: 60px; text-align: right; }
.kw-row .del { color: var(--danger); cursor: pointer; }
.add-btn { width: 100%; padding: 9px; color: var(--text-3); border: 1px dashed var(--border); border-radius: 4px; background: transparent; cursor: pointer; margin-top: 12px; font-size: 13px; }
.add-btn:hover { color: var(--primary); border-color: var(--primary); }
.steps { display: flex; align-items: center; padding: 16px 0 8px; }
.step { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; position: relative; }
.step .dot { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text-3); background: #fff; border: 1px solid var(--border); }
.step .label { color: var(--text-3); font-size: 13px; }
.step.active .dot { background: var(--info-bg); color: var(--info-text); border-color: var(--info-bg); }
.step.active .label { color: var(--text); }
.step::after { content: ""; position: absolute; top: 13px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 1px; background: var(--border); }
.step:last-child::after { display: none; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin: 20px 0; }
.mode-card { background: var(--card); border: 2px solid var(--border); border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; transition: .15s; }
.mode-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.mode-card .emoji { font-size: 40px; margin-bottom: 10px; }
.mode-card .name { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.mode-card .desc { color: var(--text-2); font-size: 13px; margin-bottom: 14px; min-height: 38px; }
.mode-card .tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.mode-card .tag { padding: 2px 10px; border: 1px solid var(--border); border-radius: 3px; font-size: 12px; color: var(--text-2); }
.live-layout { display: flex; gap: 16px; min-height: 600px; }
.live-left { width: 30%; min-width: 320px; display: flex; flex-direction: column; }
.live-right { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.live-section { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 16px; flex-shrink: 0; }
.live-section.flex-fill { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.live-section h3 { margin: 0 0 12px; font-size: 14px; color: var(--text-2); font-weight: 600; }
.live-search { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 12px; }
.live-search input { flex: 1; border: none; outline: none; font-size: 13px; padding: 0; }
.live-device-card { padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; margin-bottom: 8px; }
.live-device-card.selected { border-color: var(--primary); background: var(--primary-soft); }
.live-device-card .name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.live-device-card .mac { font-size: 11px; color: var(--text-3); margin-top: 4px; font-family: monospace; }
.live-device-card .status-row { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; font-size: 12px; }
.live-header { padding: 16px; display: flex; align-items: center; justify-content: space-between; }
.live-header .title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.live-header .indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; }
.live-header .info { color: var(--text-2); font-size: 13px; margin-top: 4px; display: flex; align-items: center; gap: 12px; }
.live-stream-area { padding: 8px 0; flex: 1; overflow-y: auto; min-height: 200px; }
.live-stream-empty { text-align: center; color: var(--text-3); padding: 30px 0; font-size: 13px; }
.live-event { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); align-items: flex-start; }
.live-event:last-child { border-bottom: none; }
.live-event .content { flex: 1; font-size: 13px; }
.stream-block-btn { display: none; margin-left: auto; background: #fef0f0; color: var(--danger); border: 1px solid #fbc4c4; border-radius: 4px; padding: 1px 8px; font-size: 11px; cursor: pointer; flex-shrink: 0; }
.live-event:hover .stream-block-btn { display: inline-block; }
.live-input { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--card); border-radius: 0 0 8px 8px; }
.live-input input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; }
.live-input button { padding: 8px 20px; background: var(--bg); color: var(--text-2); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.live-select-row { display: flex; align-items: center; gap: 12px; padding: 0 16px 16px; }
.live-select-row select { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; }
.live-streaming-controls { display: flex; gap: 8px; align-items: center; }
.btn-start { background: var(--success); color: #fff; border: none; padding: 8px 24px; border-radius: 4px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-stop { background: var(--danger); color: #fff; border: none; padding: 6px 14px; border-radius: 4px; font-size: 13px; cursor: pointer; }
.btn-pause { background: #ffaa00; color: #fff; border: none; padding: 6px 14px; border-radius: 4px; font-size: 13px; cursor: pointer; }
.device-detail-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 20px; max-width: 720px; }
.device-detail-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.device-detail-card .name { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.device-detail-card .green-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); display: inline-block; }
.device-detail-card .grid { display: grid; grid-template-columns: 90px 1fr; row-gap: 10px; font-size: 13px; }
.device-detail-card .grid .k { color: var(--text-3); }
.device-detail-card .actions { margin-top: 18px; display: flex; gap: 10px; }
.device-detail-card .actions .right { margin-left: auto; }
.room-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 18px; display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.room-card .avatar { width: 48px; height: 48px; border-radius: 8px; background: var(--info-bg); color: var(--info-text); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.room-card .info { flex: 1; }
.room-card .info .name { font-size: 16px; font-weight: 700; }
.room-card .info .meta { color: var(--text-2); font-size: 13px; margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.room-card .room-id { font-family: monospace; color: var(--info-text); font-size: 28px; font-weight: 700; text-align: center; flex: 0 0 auto; min-width: 200px; }
.room-card .room-id a { font-size: 28px; }
.room-card .actions { display: flex; gap: 16px; align-items: center; }
.room-card .actions .link { color: var(--info-text); }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 8px; width: 800px; max-height: 80vh; display: flex; flex-direction: column; }
.modal-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header .title { font-size: 16px; font-weight: 700; }
.modal-header .close { cursor: pointer; color: var(--text-3); font-size: 18px; }
.modal-body { display: flex; flex: 1; overflow: hidden; }
.modal-sidebar { width: 160px; border-right: 1px solid var(--border); padding: 12px 0; overflow-y: auto; }
.modal-sidebar .item { padding: 9px 16px; font-size: 13px; cursor: pointer; display: flex; justify-content: space-between; }
.modal-sidebar .item.active { background: var(--info-bg); color: var(--info-text); font-weight: 600; }
.modal-main { flex: 1; padding: 16px; overflow-y: auto; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.voice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.voice-card { padding: 14px; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; }
.voice-card.selected { border-color: var(--primary); background: #f8fcff; }
.voice-card .top { display: flex; gap: 12px; align-items: center; }
.voice-card .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }
.voice-card .info { flex: 1; }
.voice-card .name { font-weight: 600; font-size: 14px; }
.voice-card .desc { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.priority-table { width: 100%; border-collapse: collapse; }
.priority-table th { background: var(--bg); padding: 10px; text-align: left; font-weight: 600; color: var(--text-2); font-size: 13px; }
.priority-table td { padding: 10px; border-top: 1px solid var(--border-soft); }
.red-tip { color: var(--danger); font-size: 12px; margin: 8px 0; line-height: 1.6; }
.tip { color: var(--text-2); font-size: 12px; margin: 6px 0; }
.hidden { display: none !important; }
.center-screen { display: grid; place-items: center; min-height: 300px; color: var(--text-3); }
.mono { font-family: Consolas, monospace; }
.purple { color: #7c3aed; }

/* ===== 智能模式表单（对齐卖货机）===== */
.form-row { margin-bottom: 16px; }
.form-label { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-label .required { color: var(--danger); margin-right: 2px; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-tip { font-size: 12px; color: var(--warn-text); background: var(--warn-bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; }
.codes-stats-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-top: 16px; }
.codes-stats-grid .card { margin-bottom: 0; }
.admin-devices-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; margin-top: 16px; }
.admin-devices-grid .card { margin-bottom: 0; }
/* 算力码统计卡片：标题单行、数字自适应 */
.codes-stat-label { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.codes-stat-value { font-size: 28px; font-weight: 800; margin-top: 6px; line-height: 1.2; }
@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .codes-stats-grid { grid-template-columns: 1fr; gap: 12px; }
  .admin-devices-grid { grid-template-columns: 1fr; gap: 12px; }
  .codes-stat-label { font-size: 12px; }
  .codes-stat-value { font-size: 22px; }
  .stats-cards .card { padding: 14px 8px; }
}
.counter { font-size: 12px; color: var(--text-3); text-align: right; margin-top: 2px; }
.form-row textarea { width: 100%; }

.persona-options { display: flex; gap: 10px; }
.persona-option { flex: 1; border: 2px solid var(--border); border-radius: 8px; padding: 12px 14px; cursor: pointer; transition: .15s; background: #fff; }
.persona-option:hover { border-color: var(--primary); }
.persona-option.selected { border-color: var(--primary); background: var(--primary-soft); }
.persona-name { font-weight: 700; font-size: 14px; }
.persona-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.product-table-header, .link-row {
  display: grid; grid-template-columns: 70px 1fr 150px 130px 36px; gap: 8px; align-items: center;
}
.product-table-header { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-3); font-weight: 600; }
.link-row { padding: 8px 0; border-bottom: 1px dashed var(--border-soft); }
.link-row .num { font-size: 12px; color: var(--text-2); }

.voice-pick-row { display: flex; gap: 8px; }
.voice-pick-row input { flex: 1; }

.stats-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0; }
@media (max-width: 768px) { .stats-cards { grid-template-columns: repeat(2, 1fr); } }

/* ===== 使用手册 ===== */
.manual-cover { text-align: center; padding: 40px 20px; background: linear-gradient(135deg, #fff 0%, #e0f7fe 100%); border-radius: 10px; margin-bottom: 20px; border: 1px solid var(--border); }
.manual-cover h1 { font-size: 24px; margin: 12px 0 6px; }
.manual-cover p { color: var(--text-2); margin: 0; }
.manual-layout { display: flex; gap: 20px; align-items: flex-start; }
.manual-toc { width: 180px; flex-shrink: 0; position: sticky; top: 70px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.manual-toc-title { font-weight: 700; margin-bottom: 8px; font-size: 14px; }
.manual-toc a { display: block; padding: 5px 0; color: var(--text-2); font-size: 13px; }
.manual-toc a:hover { color: var(--primary); }
.manual-content { flex: 1; min-width: 0; }
.manual-section { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.manual-section h2 { margin: 0 0 12px; font-size: 18px; }
.manual-section h3 { font-size: 15px; margin: 16px 0 8px; }
.manual-section p { margin: 6px 0; line-height: 1.7; }
.manual-section ul { margin: 6px 0; padding-left: 20px; }
.info-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0; }
.info-table th, .info-table td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; }
.info-table th { background: #f8fafc; }
@media (max-width: 768px) {
  .manual-layout { flex-direction: column; }
  .manual-toc { width: 100%; position: static; }
  .manual-toc a { display: inline-block; margin-right: 12px; }
}

/* ===== 手机端顶部栏 + 底部导航 + 功能导航抽屉 ===== */
.mobile-header, .mobile-nav { display: none; }
.drawer, .drawer-mask { display: none; }

.mobile-header {
  position: fixed; top: 0; left: 0; right: 0; height: 48px; background: #fff;
  border-bottom: 1px solid var(--border); align-items: center; justify-content: space-between;
  padding: 0 12px; z-index: 100;
  transform: translateZ(0); -webkit-transform: translateZ(0);  /* 强制合成，修复 iOS 滚动时 fixed 抖动 */
  will-change: transform;
}
.mobile-brand { display: flex; align-items: center; gap: 8px; color: var(--text); }
.mobile-nav-toggle { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); padding: 4px; }

.mobile-nav {
  position: fixed; bottom: 0; left: 0; right: 0; height: 56px; background: #fff;
  border-top: 1px solid var(--border); z-index: 100; padding-bottom: env(safe-area-inset-bottom);
}
.mn-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--text-3); cursor: pointer; }
.mn-item.active { color: var(--primary); }
.mn-icon { font-size: 20px; line-height: 1; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 78%; max-width: 320px; background: #fff;
  z-index: 201; transform: translateX(100%); transition: transform .25s ease;
  flex-direction: column; overflow-y: auto;
}
.drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200; }
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .drawer-mask { display: block; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 16px; font-weight: 700; font-size: 16px; border-bottom: 1px solid var(--border); }
.drawer-close { background: none; border: none; font-size: 22px; color: var(--text-3); cursor: pointer; }
.drawer-user { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.drawer-group { padding: 8px 0; }
.drawer-group-title { padding: 6px 16px; font-size: 12px; color: var(--text-3); }
.drawer-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 15px; cursor: pointer; }
.drawer-item:active { background: var(--bg); }
.drawer-item .di-icon { width: 20px; text-align: center; }
.drawer-item .arrow { margin-left: auto; color: var(--text-3); }

@media (max-width: 768px) {
  .sidebar { display: none !important; }
  .main { margin-left: 0 !important; padding-top: 48px; padding-bottom: 64px; }
  .mobile-header { display: flex; }
  .mobile-nav { display: flex; }
  .drawer { display: flex; }
}

/* ===== 侧边栏折叠（手机端收缩成一排图标）===== */
.sidebar-toggle {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 15px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 5px;
  line-height: 1;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--primary); }

.sidebar, .main { transition: width .2s ease, margin-left .2s ease; }

body.sidebar-collapsed .sidebar { width: 60px; }
body.sidebar-collapsed .main { margin-left: 60px; }
body.sidebar-collapsed .sidebar-brand { flex-direction: column; gap: 10px; padding: 14px 0; }
body.sidebar-collapsed .sidebar-brand .brand-text { display: none; }
body.sidebar-collapsed .sidebar-toggle { margin-left: 0; }
body.sidebar-collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .nav-item span:not(.icon) { display: none; }
body.sidebar-collapsed .sidebar-user { justify-content: center; }
body.sidebar-collapsed #side-user-phone { display: none; }
body.sidebar-collapsed .sidebar-logout button { text-align: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .sidebar-logout .label { display: none; }

/* 手机端整体阅读体验优化 */
@media (max-width: 768px) {
  html { overflow-x: hidden; }
  body { max-width: 100%; }
  .main { min-width: 0; }
  .page-body { padding: 12px; min-width: 0; }
  .page-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .page-title { font-size: 16px; }
  .page-actions { flex-wrap: wrap; width: 100%; }
  .page-actions .btn { white-space: nowrap; flex-shrink: 0; }

  /* 三列 / 销售模式卡片 → 单列 */
  .grid-3, .mode-cards { grid-template-columns: 1fr; }
  .mode-card { padding: 16px; }

  /* 开播台 → 上下堆叠 */
  .live-layout { flex-direction: column; }
  .live-left { width: 100%; min-width: 0; }
  .live-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .live-streaming-controls { width: 100%; display: flex; }
  .live-streaming-controls .btn-start,
  .live-streaming-controls .btn-stop,
  .live-streaming-controls .btn-pause { flex: 1 1 0; white-space: nowrap; padding: 8px 6px; }
  .live-select-row { flex-wrap: wrap; }

  /* 长文本 / 长 ID / 长链接 强制换行，不撑破边界 */
  .mono, .mac, .room-id, .room-card .room-id { word-break: break-all; overflow-wrap: anywhere; }
  .card, .live-section, .module-detail, .device-detail-card { min-width: 0; overflow-wrap: break-word; }

  /* 专家模式：模块菜单 → 顶部两列网格，整齐排列 */
  .module-layout { flex-direction: column; min-height: 0; }
  .module-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; }
  .module-sidebar .group-label { grid-column: 1 / -1; padding: 4px 4px 0; }
  .module-sidebar .item { padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border-soft); }
  .module-sidebar .item.active { border-left: none; border-color: var(--primary); }
  .module-detail { padding: 16px 12px; }
  .module-detail .header { flex-wrap: wrap; row-gap: 8px; }
  .module-detail .header .right { margin-left: auto; }

  /* 话术行 / 关键词行 → 自动换行 */
  .tpl-row, .kw-row { flex-wrap: wrap; row-gap: 8px; }
  .tpl-row .text { flex: 1 1 100%; }
  .kw-row .kw { width: 100%; }
  .kw-row .reply { flex: 1 1 100%; }

  /* 字段行 → 标签在上、输入在下 */
  .field-row { flex-wrap: wrap; }
  .field-row .label { min-width: 100%; }
  label.field { flex-direction: column; align-items: stretch; }
  label.field .label { width: auto; }

  /* 表格 → 横向滚动 */
  .tbl, .priority-table { display: block; overflow-x: auto; white-space: nowrap; }

  /* 输入控件不超宽 */
  input[type="text"], input[type="number"], input[type="password"], select, textarea { max-width: 100%; }

  /* 步骤条只留数字 */
  .steps .step .label { display: none; }

  /* 房间卡片换行 */
  .room-card { flex-wrap: wrap; }
  .room-card .actions { width: 100%; justify-content: flex-end; }

  /* 弹窗自适应 */
  .modal { max-width: 92vw; }
  .modal-body { flex-direction: column; }
  .modal-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; }
  .voice-grid { grid-template-columns: 1fr; }
}

/* ===== 手机端：短文字组件保持单行，避免因宽度断成多行 ===== */
@media (max-width: 768px) {
  /* 按钮 / 徽章 / 标签 / 导航项等短文字一律不折行 */
  .btn, .btn-sm, .badge, .mode-switch, .persona-name,
  .nav-item, .drawer-item, .drawer-group-title,
  .mn-item, .mn-label, .mn-icon,
  .page-title, .card-title, .form-label, .persona-option .persona-desc {
    white-space: nowrap;
  }

  /* Tab 栏：保持单行，横向可滚动，不挤压换行 */
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { white-space: nowrap; flex-shrink: 0; padding: 10px 14px; }

  /* 表格内文字、徽章、按钮在卡片里也不折行 */
  .tbl th, .tbl td .badge { white-space: nowrap; }
  .card .actions, .device-detail-card .actions { flex-wrap: wrap; }
  .card .actions .btn, .device-detail-card .actions .btn { white-space: nowrap; flex-shrink: 0; }

  /* 底部导航 5 个入口时文字仍单行、字号略收紧 */
  .mn-label { font-size: 10px; }
}
</​mm:tool:content>