/* =========================================================
   校商易电商实训平台 - 共享样式
   Semi Design（字节跳动开源设计系统）浅色官方风格
   主色 #1664FF · 白底分层 · 克制圆角 · 细边框
   ========================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Semi Design 官方 token（semi.design） */
  --primary: #1664FF;              /* color-primary */
  --primary-hover: #4080FF;
  --primary-active: #0E42D2;
  --primary-light: #E8F3FF;        /* color-primary-light 浅蓝底 */
  --primary-light-hover: #D0E9FF;
  --primary-bg: rgba(22, 100, 255, .06);
  --gradient: linear-gradient(135deg, #1664FF 0%, #4080FF 100%);
  --bg: #F2F3F5;                   /* color-fill-0 页面浅灰底 */
  --bg-1: #F7F8FA;                 /* color-bg-1 */
  --card: #FFFFFF;                 /* color-bg-0 白卡片 */
  --card-hover: #F7F8FA;
  --text: #1C1F23;                 /* color-text-0 主文字 */
  --text-2: #4E5969;               /* color-text-1 次要文字 */
  --text-3: #86909C;               /* color-text-2 弱化文字 */
  --text-4: #C9CDD4;               /* color-text-3 禁用文字 */
  --line: #E5E8EF;                 /* color-border-light 细边框 */
  --line-strong: #D9DEE6;          /* color-border */
  --green: #3BBB6D;                /* color-success */
  --red: #F54949;                  /* color-danger */
  --warning: #FF7D00;              /* color-warning */
  --violet: #722ED1;
  --gold: #ffd24d;                 /* 直播间价格金色（深色视频区语义色） */
  --gold-deep: #D97706;            /* 金色在浅色底上的可读档 */
  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .14);
  /* 字体与字号体系 */
  --font: "Inter", -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --font-num: "Inter", "Segoe UI", "DIN Alternate", "Helvetica Neue", Arial, sans-serif;
  --fs-2xl: 26px;
  --fs-xl: 21px;
  --fs-lg: 17px;
  --fs-md: 15px;
  --fs-sm: 14px;
  --fs-xs: 13px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* 标题规范 */
h1, h2, h3 { font-weight: 600; letter-spacing: .2px; color: var(--text); }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
/* 数字统一等宽（统计对齐） */
.num, .stat-card .n, .g-price, .t-price, .score b, #progressText {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ===== 表单控件（Semi focus ring） ===== */
input, select, textarea {
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 7px 10px;
  background: #FFFFFF;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #B6BFD0; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 100, 255, .2);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:disabled, select:disabled { background: var(--bg-1); color: var(--text-4); cursor: not-allowed; }

/* ===== 滚动条（细、克制） ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D9DEE6; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #B6BFD0; }

/* ===== 标签/徽章规范 ===== */
.tag, .cust-tag, .v-badge, .r-badge, .cat-badge {
  font-size: 14px;
  padding: 1px 7px;
  border-radius: 4px;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.6;
}

/* ===== 空状态 ===== */
.empty {
  text-align: center; padding: 48px 20px; color: var(--text-3); font-size: var(--fs-sm);
}
.empty .empty-icon { font-size: 40px; margin-bottom: 10px; opacity: .5; }

/* ===== 表格（Semi 风格） ===== */
.table-card { overflow: hidden; }
.table-card table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table-card thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-1);
  padding: 10px 12px; text-align: left;
  font-weight: 600; color: var(--text-2);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap; font-size: var(--fs-xs);
  letter-spacing: .2px;
}
.table-card tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.table-card tbody tr:nth-child(even) { background: var(--bg-1); }
.table-card tbody tr:hover { background: var(--primary-bg); }

/* ===== 动画（克制） ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.card, .msg, .rec-item { animation: fadeIn .25s ease; }

/* ===== 顶部导航（Semi 白底 + 蓝色细线） ===== */
.topbar {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text);
  padding: 0 24px;
  height: 52px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line-strong);
  position: sticky; top: 0; z-index: 50;
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(22, 100, 255, .35), transparent);
  pointer-events: none;
}
.topbar .logo {
  font-size: 17px; font-weight: 700; letter-spacing: .2px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topbar .logo small { font-weight: 400; font-size: 14px; color: var(--text-3); margin-left: 8px; }
.topbar nav { display: flex; gap: 4px; margin-left: auto; }
.topbar nav a {
  position: relative;
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 14px;
  transition: color .18s ease;
}
/* 下滑指示条：常态收起，hover / active 平滑滑出（"放上去就滑动"） */
.topbar nav a::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px; bottom: 1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #1664FF, #6c5ce7);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .28s cubic-bezier(.25,.8,.25,1);
}
.topbar nav a:hover { color: var(--primary); }
.topbar nav a:hover::after { transform: scaleX(1); }
.topbar nav a.active {
  color: var(--primary); font-weight: 600;
  background: linear-gradient(135deg, rgba(22,100,255,.08), rgba(108,92,231,.06));
}
.topbar nav a.active::after { transform: scaleX(1); }
/* 滑到其它导航项时，首页(active)的指示条先收回，只亮当前 hover 项；离开导航后恢复常驻 */
.topbar nav:hover a.active:not(:hover)::after { transform: scaleX(0); }
/* ===== 顶部导航 - 手机适配 ===== */
@media (max-width: 700px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .logo { font-size: 15px; white-space: nowrap; }
  .topbar .logo small { display: none; }
  .topbar nav { gap: 2px; min-width: 0; }
  .topbar nav a { padding: 6px 9px; font-size: 13.5px; white-space: nowrap; flex-shrink: 0; }
}
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: 52px; padding: 6px 10px; row-gap: 3px; }
  .topbar .logo { font-size: 14px; }
  .topbar .logo svg { width: 19px; height: 19px; }
  .topbar nav { flex: 1 0 100%; margin-left: 0; flex-wrap: wrap; }
  .topbar nav a { padding: 4px 10px; font-size: 13px; }
}

/* ===== 聊天头部（旺旺会话栏） ===== */
.chat-head {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-strong);
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
}
.ww-head-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ww-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #1664FF, #4080FF);
  color: #fff; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(22, 100, 255, .25);
}
.ww-name { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.ww-online { font-size: 14px; color: #2E9B5B; background: #E8F8EF; padding: 1px 6px; border-radius: 999px; }
.ww-status { font-size: 14px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.ww-head-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ww-head-right .score { font-size: 14px; color: var(--text-2); }
.ww-head-right .score b { color: var(--primary); font-size: 15px; }

/* ===== 通用卡片 ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--line-strong);
}
.card-title {
  padding: 12px 16px;
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: .2px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
  gap: 8px;
  overflow: hidden;
}
.card-title .hint {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-weight: 400;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn {
  border: none;
  border-radius: 4px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 500;
  background: var(--primary);
  color: #fff;
  transition: all .2s;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(22, 100, 255, .2);
}
.btn:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(22, 100, 255, .28); }
.btn:active { background: var(--primary-active); transform: scale(.98); }
.btn.ghost {
  background: #FFFFFF;
  color: var(--primary);
  border: 1px solid var(--primary);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--primary-light); }
.btn.small { padding: 4px 10px; font-size: 14px; border-radius: 4px; }
/* 危险操作按钮（删除/清空类确认） */
.btn.danger { background: var(--red); box-shadow: 0 2px 8px rgba(245, 73, 73, .2); }
.btn.danger:hover { background: #d93a3a; box-shadow: 0 4px 12px rgba(245, 73, 73, .3); }
.btn.danger:active { background: #c22f2f; }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.ghost:disabled, .btn.ghost[disabled] { opacity: .55; cursor: not-allowed; background: #fff; color: var(--text-3); }

/* ===== 难度筛选 ===== */
.diff-bar {
  display: flex; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--line); background: var(--card);
  align-items: center;
}
.diff-bar select {
  flex: 1;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: #FFFFFF; color: var(--text); font-size: 14px;
  padding: 7px 12px; cursor: pointer; outline: none;
  font-family: inherit;
  transition: all .15s;
}
.diff-bar select:hover, .diff-bar select:focus { border-color: var(--primary); }
.diff-bar select:focus { box-shadow: 0 0 0 3px rgba(22, 100, 255, .2); }

/* ===== 客户分类折叠 ===== */
.cat-header {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; margin: 6px 6px 2px;
  border-radius: 6px; background: var(--bg-1);
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text);
  transition: background .15s;
  user-select: none;
}
.cat-header:hover { background: var(--primary-light); }
.cat-arrow {
  display: inline-block; transition: transform .2s;
  font-size: 14px; color: var(--primary);
}
.cat-arrow.open { transform: rotate(90deg); }
.cat-badge {
  margin-left: auto; font-size: 14px; color: var(--text-3);
  font-weight: 400; background: var(--bg-1); border-radius: 999px; padding: 1px 8px;
  border: 1px solid var(--line-strong);
}
.cat-body { padding: 0 4px; }

/* ===== 客户列表项 ===== */
.cust-item { position: relative; transition: all .15s; border-radius: 8px; margin: 2px 0; }
.cust-item:hover { background: var(--primary-bg); transform: translateX(2px); }
.cust-item.active {
  background: var(--primary-light);
  border: 1.5px solid rgba(22, 100, 255, .35);
  box-shadow: 0 2px 8px rgba(22, 100, 255, .08);
}
.cust-item.active::before {
  content: ''; position: absolute; left: -3px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 55%; border-radius: 2px; background: var(--primary);
}

/* ===== 卡片统一质感 ===== */
.card { border: 1px solid var(--line-strong); }
.chat-body { background: var(--bg); }
.bubble { box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.msg.from-me .bubble { box-shadow: 0 2px 8px rgba(22, 100, 255, .25); }

/* ===== 首页卡片 ===== */
.home-card { transition: transform .2s, box-shadow .2s; }
.home-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* ===== 直播间美化 ===== */
.live-top { border: 1px solid var(--line-strong); }

/* ===== 弹窗 ===== */
.modal-mask { animation: fadeIn .2s ease; }
.modal {
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}
.modal-head {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-lg);
  padding: 14px 18px;
  font-weight: 600;
}
.modal-body { line-height: 1.7; padding: 16px 18px; }
.modal-foot { padding: 12px 18px; }

/* ===== 自定义对话框（替代原生 alert/confirm） ===== */
.dialog-mask {
  position: fixed; inset: 0; background: rgba(31, 35, 41, .45);
  /* 需高于页面内所有自绘业务弹窗遮罩（如 z910/912/1200），否则校验/确认对话框被压在下层不可见 */
  z-index: 3000; display: flex; align-items: center; justify-content: center;
  animation: fadeIn .18s ease;
}
.dialog {
  width: 420px; max-width: 90vw; background: var(--card);
  border-radius: 8px; border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.dialog-title {
  padding: 18px 22px 6px; font-size: 17px; font-weight: 600; color: var(--text);
}
.dialog-body {
  padding: 10px 22px 20px; color: var(--text-2);
  font-size: 15px; line-height: 1.8; white-space: pre-line;
}
.dialog-body .dialog-emoji { font-size: 30px; margin-bottom: 8px; }
.dialog-foot {
  padding: 12px 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ===== 客服实训三栏布局 ===== */
.cs-layout {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  gap: 14px;
  padding: 14px;
  height: calc(100vh - 52px);
  min-height: 560px;
}
.cs-layout > * { display: flex; flex-direction: column; overflow: hidden; }
/* 右栏（话术库+评分+成绩）：窄屏(<1100px)整列隐藏，避免 grid 把它排到第二行错位 */
.cs-layout .phrases-col {
  display: flex; flex-direction: column; gap: 14px; overflow: hidden; min-width: 0;
}

/* 客户列表 */
.cust-list { overflow-y: auto; padding: 8px; }
.cust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .15s;
}
.cust-item:hover { background: var(--primary-light); }
.cust-item.active { background: var(--primary-light); border-color: var(--primary); }
.cust-avatar {
  width: 40px; height: 40px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}
.cust-info { flex: 1; min-width: 0; }
.cust-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cust-tag {
  font-size: 14px; padding: 1px 6px; border-radius: 4px;
  background: var(--primary-light); color: var(--primary); white-space: nowrap;
}
.cust-intent { font-size: 14px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-status { font-size: 14px; color: var(--text-3); margin-top: 2px; }
.cust-status.waiting { color: var(--blue); }
.cust-status.done { color: var(--green); }

/* 聊天窗口 */
.chat-wrap { position: relative; }
.chat-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-strong);
  display: flex; align-items: center; gap: 10px;
}
.chat-head .title { font-weight: 600; font-size: 15px; }
.chat-head .score { margin-left: auto; font-size: 14px; color: var(--text-2); }
.chat-head .score b { color: var(--primary); font-size: 18px; }
.chat-body {
  flex: 1;
  min-height: 0;   /* 关键：防止内容多时挤压底部输入框 */
  overflow-y: auto;
  padding: 16px;
  background: var(--bg);   /* 浅灰聊天背景 */
  display: flex; flex-direction: column; gap: 10px;
}
.msg { display: flex; gap: 8px; max-width: 78%; animation: fadeIn .2s ease; }
.msg .bubble {
  padding: 9px 13px;
  border-radius: 4px;
  font-size: var(--fs-sm);
  line-height: 1.6;
  word-break: break-word;
  position: relative;
}
.msg.from-cust .bubble { background: var(--card); border: 1px solid var(--line-strong); border-top-left-radius: 2px; }
.msg.from-me { flex-direction: row-reverse; margin-left: auto; }
.msg.from-me .bubble { background: var(--primary); color: #fff; border-top-right-radius: 2px; }
.msg .time { font-size: 14px; color: var(--text-3); align-self: flex-end; margin: 0 2px; font-family: var(--font-num); }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.typing {
  font-size: 14px; color: var(--text-3);
  display: flex; align-items: center; gap: 6px; padding: 4px 2px;
}
.typing .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1s infinite; }
.typing .dot:nth-child(2) { animation-delay: .2s; }
.typing .dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .3; } 50% { opacity: 1; } }

/* 话术库 & 输入区 */
.phrases { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; }
.phrases .group-title { font-size: 14px; color: var(--text-3); margin-top: 4px; }
.phrases .ph {
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  background: #FFFFFF;
  cursor: pointer;
  line-height: 1.45;
  transition: all .15s;
}
.phrases .ph:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.chat-input {
  border-top: 1px solid var(--line-strong);
  padding: 10px 12px;
  display: flex; gap: 8px; align-items: flex-end;
  background: var(--card);
  flex-shrink: 0;
}
.chat-input textarea {
  flex: 1 1 auto;
  width: 100%;
  height: 64px;
  min-height: 64px;
  max-height: 140px;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: var(--fs-sm);
  line-height: 1.6;
  outline: none;
  resize: none;
  transition: border-color .15s, box-shadow .15s;
}
.chat-input textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 100, 255, .2);
}
.send-btn { padding: 11px 22px; align-self: stretch; border-radius: 4px; font-size: var(--fs-sm); font-weight: 500; }

/* ===== 表情面板 ===== */
.emoji-wrap { position: relative; align-self: flex-end; margin-bottom: 2px; }
.emoji-btn {
  width: 40px; height: 40px; border: 1px solid var(--line-strong);
  border-radius: 6px; background: #FFFFFF; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.emoji-btn:hover { border-color: var(--primary); background: var(--primary-light); transform: scale(1.05); }
.emoji-panel {
  position: absolute; bottom: 48px; left: 0; z-index: 30;
  width: 264px; background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px;
}
.emoji-item {
  text-align: center; font-size: 20px; padding: 5px 2px;
  border-radius: 4px; cursor: pointer; transition: background .12s;
}
.emoji-item:hover { background: var(--primary-light); transform: scale(1.15); }

/* 评分面板 */
.score-panel { padding: 12px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.score-row { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.score-row .dot { width: 8px; height: 8px; border-radius: 50%; }
.score-row .ok { color: var(--green); }
.score-row .no { color: var(--text-4); }
.score-bar { height: 8px; border-radius: 4px; background: var(--bg-1); overflow: hidden; }
.score-bar i { display: block; height: 100%; background: linear-gradient(90deg, #4080FF, var(--primary)); transition: width .4s; }
.grade { text-align: center; font-size: 14px; color: var(--text-2); }
.grade b { font-size: 20px; color: var(--primary); }

/* ===== 直播模拟（Semi 浅色直播间，视频区保持黑色） ===== */
.live-wrap {
  background: var(--bg);
  min-height: calc(100vh - 52px);
  color: var(--text);
  padding: 14px;
}
.live-top {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.live-top .host-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 8px rgba(22, 100, 255, .3);
}
.live-top .host-name { font-size: 15px; font-weight: 600; color: var(--text); }
.live-top .host-sub { font-size: 14px; color: var(--text-3); }
.live-top .stats { margin-left: auto; display: flex; gap: 18px; }
.live-top .stats .num { font-size: 18px; font-weight: 700; color: var(--primary); }
.live-top .stats .lbl { font-size: 14px; color: var(--text-3); }
.live-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-rows: auto 1fr;
  gap: 14px;
}
.video-card {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
}
.video-card video { width: 100%; height: 100%; object-fit: contain; }
.video-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(ellipse at 30% 20%, #2b3240, #101318); }
.video-fallback .live-badge {
  position: absolute; top: 12px; left: 12px;
  background: #ff2d2d; color: #fff; font-size: 14px; font-weight: 700;
  padding: 3px 10px; border-radius: 4px;
  display: flex; align-items: center; gap: 6px;
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .65; } }
.video-fallback .scene {
  font-size: 42px; font-weight: 700; color: #4080FF;
  text-shadow: 0 0 30px rgba(64, 128, 255, .5);
  letter-spacing: 2px;
}
.video-fallback .scene-sub { color: #9aa0ab; font-size: 14px; }
.video-fallback .file-btn {
  background: rgba(255, 255, 255, .1); border: 1px dashed rgba(255, 255, 255, .35);
  color: #fff; border-radius: 6px; padding: 8px 16px; font-size: 14px;
}
.video-fallback .file-btn:hover { background: rgba(255, 255, 255, .2); }
.video-fallback .now-selling {
  position: absolute; bottom: 12px; left: 12px; right: 12px;
  background: rgba(0, 0, 0, .55);
  border-radius: 8px; padding: 10px 14px;
  display: flex; align-items: center; gap: 12px;
  backdrop-filter: blur(4px);
}
.video-fallback .now-selling .thumb {
  width: 46px; height: 46px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  flex-shrink: 0;
}
.video-fallback .now-selling .t-name { font-size: 14px; font-weight: 600; color: #fff; }
.video-fallback .now-selling .t-price { font-size: 16px; color: var(--gold); font-weight: 700; }
.video-fallback .now-selling .t-count { margin-left: auto; font-size: 14px; color: #9aa0ab; }

/* 商品列表 */
.goods-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 10px; }
.goods-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 2px solid transparent;
  border-radius: 6px; padding: 8px 10px;
  cursor: pointer; transition: all .15s;
}
.goods-item:hover { border-color: var(--primary-hover); transform: translateY(-1px); background: var(--bg-1); }
.goods-item.selling { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 12px rgba(22, 100, 255, .15); }
.goods-item .no { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-1); color: var(--text-3); font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.goods-item.selling .no { background: var(--primary); color: #fff; }
.goods-item .thumb { width: 44px; height: 44px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.goods-item .g-name { font-size: 14px; line-height: 1.3; color: var(--text); }
.goods-item .g-price { font-size: 14px; color: var(--gold-deep); font-weight: 700; margin-top: 2px; }
.goods-item .g-sold { font-size: 14px; color: var(--text-3); }
.goods-item .g-btn { margin-left: auto; }
.goods-item .g-btn.bought { background: var(--green); }

/* 聊天区（直播） */
.live-chat { display: flex; flex-direction: column; height: 100%; min-height: 380px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--bg-1); }
.lc-msg { font-size: 14px; line-height: 1.5; animation: pop .25s ease; }
.lc-msg .who { color: var(--primary); }
.lc-msg .say { color: var(--text); }
.lc-msg .sys { color: var(--gold-deep); }
.lc-msg.mine .who { color: var(--warning); }
.lc-msg .gift { display: inline-block; animation: fly .8s ease; }
@keyframes fly { 0% { transform: scale(.4); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
.chat-input-bar { display: flex; gap: 8px; padding: 10px; background: var(--card); border-top: 1px solid var(--line-strong); }
.chat-input-bar input { flex: 1; background: var(--bg-1); border: 1px solid var(--line); border-radius: 4px; padding: 9px 12px; color: var(--text); font-size: 14px; outline: none; }
.chat-input-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(22, 100, 255, .2); }
.chat-input-bar button { background: var(--primary); border: none; color: #fff; border-radius: 4px; padding: 0 16px; font-size: 14px; font-weight: 600; }
.chat-input-bar button:hover { background: var(--primary-hover); }
.like-btn {
  width: 42px; border-radius: 4px; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--gold-deep); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.like-btn:hover { background: var(--bg-1); }

/* 点赞飘心 */
.heart-fly { position: fixed; pointer-events: none; z-index: 999; animation: heartUp 1.2s ease-out forwards; }
@keyframes heartUp { 0% { transform: translateY(0) scale(.6); opacity: 1; } 100% { transform: translateY(-120px) scale(1.3); opacity: 0; } }

/* 订单浮层 */
.order-side { display: flex; flex-direction: column; min-height: 0; }
.order-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.order-item { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.order-item .o-thumb { width: 34px; height: 34px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.order-item .o-info { flex: 1; min-width: 0; }
.order-item .o-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-item .o-price { color: var(--gold-deep); font-size: 14px; }
.order-item .o-tag { font-size: 14px; color: var(--text-3); }

/* ===== 首页 ===== */
.home-wrap { max-width: 1080px; margin: 40px auto; padding: 0 24px; }
.home-wrap h1 {
  font-size: 30px; margin-bottom: 8px;
  font-weight: 700; letter-spacing: .3px;
  color: var(--text);
}
.home-wrap .sub { color: var(--text-2); margin-bottom: 32px; font-size: var(--fs-md); }
.home-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .home-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .home-cards { grid-template-columns: 1fr; } }
.home-card {
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.home-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.home-card .icon { font-size: 32px; margin-bottom: 12px; display: inline-block; }
.home-card h2 { font-size: var(--fs-lg); margin-bottom: 10px; }
.home-card p { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.8; margin-bottom: 16px; }
.home-card .feat { font-size: var(--fs-xs); color: var(--text-3); margin-top: -6px; margin-bottom: 16px; line-height: 2; }
.home-card .go { display: inline-block; }

@media (max-width: 1100px) {
  .cs-layout { grid-template-columns: 220px 1fr; }
  .cs-layout .phrases-col { display: none; }
  .live-layout { grid-template-columns: 1fr; }
}
