:root {
  --bg: #f5f7fa; --panel: #ffffff; --ink: #1f2937; --muted: #6b7280;
  --brand: #2563eb; --brand2: #0ea5e9; --ok: #16a34a; --warn: #d97706; --bad: #dc2626;
  --line: #e5e7eb; --chip: #eef2ff;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 16px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.logo { font-weight: 800; font-size: 18px; color: var(--brand); }
.btn { background: var(--brand); color: #fff; border: none; padding: 9px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.btn:hover { opacity: .92; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; }
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3,1fr); }
.grid.cols-4 { grid-template-columns: repeat(4,1fr); }
label { font-size: 13px; color: var(--muted); display: block; margin: 8px 0 4px; }
input, select, textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; }
.chip { display: inline-block; background: var(--chip); color: var(--brand); border-radius: 999px; padding: 3px 10px; font-size: 12px; margin: 2px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.tag.ok { background: #dcfce7; color: var(--ok); }
.tag.warn { background: #fef3c7; color: var(--warn); }
.tag.bad { background: #fee2e2; color: var(--bad); }
.tag.gray { background: #f1f5f9; color: var(--muted); }
/* chat */
.chat { height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fafafa; }
.msg { margin: 8px 0; max-width: 80%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.msg.ai { background: #fff; border: 1px solid var(--line); }
.msg.me { background: var(--brand); color: #fff; margin-left: auto; }
.err { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 8px; padding: 6px 10px; font-size: 13px; margin: 6px 0; }
.hidden { display: none; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tab { padding: 8px 14px; cursor: pointer; border-radius: 8px 8px 0 0; font-size: 14px; color: var(--muted); }
.tab.active { background: var(--brand); color: #fff; }
.kpi { font-size: 26px; font-weight: 800; }
.kpi small { font-size: 12px; color: var(--muted); font-weight: 400; display: block; }
.bar { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.pill { border:1px solid var(--line); border-radius:999px; padding:4px 10px; font-size:12px; }

/* ---------- 沉浸模式（视频对话 / AR 实景） ---------- */
.mode-tabs { display:flex; gap:8px; margin:12px 0; }
.mode-tab { flex:1; text-align:center; padding:12px; border:1px solid var(--line); border-radius:12px; cursor:pointer; background:#fff; font-weight:600; }
.mode-tab.active { border-color:var(--brand); background:var(--chip); color:var(--brand); }
.stage { position:relative; width:100%; aspect-ratio:3/4; max-height:62vh; background:#0b1220; border-radius:16px; overflow:hidden; margin:10px 0; }
.stage video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transform:scaleX(-1); }
.stage .placeholder { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#9fb3c8; font-size:14px; text-align:center; padding:20px; }
/* 数字人 */
.avatar-wrap { position:absolute; right:14px; bottom:14px; width:120px; height:120px; }
.avatar { width:100%; height:100%; }
.avatar .mouth { transform-origin:center; transition:transform .08s; }
.speaking .avatar .mouth { animation:talk .32s infinite; }
@keyframes talk { 0%,100%{transform:scaleY(.35)} 50%{transform:scaleY(1)} }
.avatar-name { position:absolute; bottom:-22px; left:0; right:0; text-align:center; font-size:11px; color:#e2e8f0; }
/* AR 浮窗 */
.ar-tag { position:absolute; transform:translate(-50%,-50%); background:rgba(37,99,235,.92); color:#fff; padding:6px 10px; border-radius:999px; font-size:13px; cursor:pointer; box-shadow:0 4px 14px rgba(0,0,0,.35); }
.ar-tag small { display:block; font-size:10px; opacity:.85; }
.ar-badge { position:absolute; top:10px; left:10px; background:rgba(0,0,0,.5); color:#fff; font-size:11px; padding:4px 8px; border-radius:8px; }
.ar-panel { background:#fff; border:1px solid var(--line); border-radius:12px; padding:12px; margin-top:10px; }
.transcript { height:200px; overflow-y:auto; border:1px solid var(--line); border-radius:10px; padding:10px; background:#fafafa; margin-top:10px; }
.transcript .msg.ai { background:#eef2ff; }
.transcript .msg.me { background:var(--brand); color:#fff; margin-left:auto; }
.feature-card { border:1px dashed var(--brand); border-radius:12px; padding:14px; margin:10px 0; background:#f8fbff; }
.feature-card h4 { margin:0 0 6px; color:var(--brand); }
.skel-note { font-size:12px; color:var(--muted); }

/* ---------- H5 移动版 ---------- */
.h5 { max-width:480px; margin:0 auto; min-height:100vh; background:var(--bg); padding-bottom:64px; }
.h5 .topbar { border-radius:0; }
.h5-card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px; margin:12px; }
.h5-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:0 12px; }
.h5-grid .scn { background:#fff; border:1px solid var(--line); border-radius:12px; padding:12px; cursor:pointer; }
.h5-grid .scn .t { font-weight:700; font-size:14px; }
.h5-grid .scn .m { font-size:12px; color:var(--muted); margin-top:4px; }
.bottom-nav { position:fixed; bottom:0; left:0; right:0; max-width:480px; margin:0 auto; display:flex; background:#fff; border-top:1px solid var(--line); }
.bottom-nav a { flex:1; text-align:center; padding:10px 4px; font-size:12px; color:var(--muted); text-decoration:none; }
.bottom-nav a.active { color:var(--brand); font-weight:700; }
.bottom-nav a .ic { font-size:20px; display:block; }
.h5-chat { height:52vh; overflow-y:auto; padding:10px; }
.h5-input { position:fixed; bottom:0; max-width:480px; margin:0 auto; left:0; right:0; display:flex; gap:8px; padding:10px 12px; background:#fff; border-top:1px solid var(--line); }
.h5-input input { flex:1; }
@media (max-width:520px){ .wrap{max-width:100%;} .grid.cols-3{grid-template-columns:1fr 1fr;} .grid.cols-4{grid-template-columns:1fr 1fr;} }
