/* ============================================================
   短视频运营网站 · 全局共用样式 common.css
   功能：
   1) 统一全站基础颜色变量 (亮色/暗色模式)
   2) 暗色模式全局样式适配 (包括输入框、选择框、下拉框、侧边栏)
   3) PC 端操盘台宽屏自适应 (600px -> 960px) + 双列排版优化
   4) 页面过渡平滑化
   ============================================================ */

/* 1. 统一的基础变量 - 默认亮色模式 (暖灰柔和色调) */
:root {
  --bg: #f4f4f0;
  --card: #ffffff;
  --card2: #faf9f6;
  --ink: #15161b;
  --ink2: #41464f;
  --muted: #7c8295;
  --soft: #aeb4c4;
  --line: #e8e6e0;
  --line2: #f0efea;
  --shadow: 0 2px 10px rgba(20,22,30,.06), 0 10px 34px rgba(20,22,30,.06);
  --shadow2: 0 16px 52px rgba(20,22,30,.18);
  --shadow-lg: 0 12px 40px rgba(124,58,255,.14);
}

/* 2. 暗色模式变量覆盖 */
html[data-theme="dark"] {
  --bg: #0f0f13;
  --card: #1a1a22;
  --card2: #22222c;
  --ink: #e8e8ec;
  --ink2: #b0b4c0;
  --muted: #6b7080;
  --soft: #4a4f5c;
  --line: #2a2a35;
  --line2: #1f1f28;
  --shadow: 0 2px 10px rgba(0,0,0,.3), 0 10px 34px rgba(0,0,0,.4);
  --shadow2: 0 16px 52px rgba(0,0,0,.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.45);
}

/* 全局基础适配 */
body {
  background-color: var(--bg) !important;
  color: var(--ink) !important;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* 暗色模式通配元素适配 */
html[data-theme="dark"] select,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea {
  background-color: var(--card2) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}

/* 针对全站知识库/SOP/速查台等各种非操盘台页面暗色背景处理 */
html[data-theme="dark"] .paper,
html[data-theme="dark"] .how,
html[data-theme="dark"] .step,
html[data-theme="dark"] .card,
html[data-theme="dark"] .lw-card,
html[data-theme="dark"] .acct-menu,
html[data-theme="dark"] .dstat {
  background-color: var(--card) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}

html[data-theme="dark"] aside {
  background-color: #121217 !important;
  border-right: 1px solid var(--line) !important;
}

html[data-theme="dark"] aside .brand {
  background-color: #121217 !important;
}

html[data-theme="dark"] aside .brand .home {
  border-color: var(--line) !important;
  color: var(--ink2) !important;
}

html[data-theme="dark"] .navlink:not(.active) {
  color: var(--muted) !important;
}

/* AI 对话消息泡泡适配 */
html[data-theme="dark"] .cmsg.user {
  background-color: var(--line2) !important;
  color: var(--ink) !important;
}

html[data-theme="dark"] .cmsg.ai {
  background-color: var(--card) !important;
  color: var(--ink) !important;
}

/* 首页/登录墙及其他特定块暗色适应 */
html[data-theme="dark"] .loginwall {
  background: linear-gradient(150deg, #121218 0%, #171520 45%, #20151a 100%) !important;
}

html[data-theme="dark"] .hero {
  background: #181920 !important;
}

html[data-theme="dark"] .marq .run span {
  color: var(--muted) !important;
}

html[data-theme="dark"] .cal-day {
  background-color: var(--card2) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .todo-item,
html[data-theme="dark"] .cal-item {
  background-color: var(--card2) !important;
}

html[data-theme="dark"] .todo-empty {
  background-color: var(--card2) !important;
  color: var(--muted) !important;
}

/* ==================== 3. PC端操盘台宽屏自适应 ==================== */
@media (min-width: 992px) {
  /* 拓宽 Console 页面宽度以及所有的浮动/全屏/抽屉/底部容器 */
  .app,
  .tabbar,
  .fullview,
  .loginwall,
  .chat-bar,
  .mat-sheet,
  #view-ai,
  #ai-sess-listview,
  .ai-top,
  .ai-bottom,
  .composer,
  .modal,
  .scardv,
  .scardv .schd,
  .scardv .sc-scroll,
  .scardv .sc-ft,
  .lc-scroll,
  .lvcard,
  .lvcard .lc-scroll,
  .ovcard,
  .ovcard .lc-scroll {
    max-width: 960px !important;
  }

  /* 让所有固定定位、绝对定位的弹窗/全屏层在 PC 宽屏下水平居中，避免偏向左侧 */
  .tabbar,
  .fullview,
  .loginwall,
  .chat-bar,
  .mat-sheet,
  #view-ai,
  #ai-sess-listview,
  .ai-top,
  .ai-bottom,
  .composer,
  .scardv,
  .lvcard,
  .ovcard {
    left: 0 !important;
    right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* 双列排版自动适配 */
  .body .slist,
  .body .plist,
  .body .pgrid,
  .body .sgrid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }

  /* 排列里面的全宽项例外 */
  .body .addbar {
    grid-column: span 2 !important;
    margin-top: 8px;
  }
  
  /* 双列网格下的一些细节调整 */
  .search, .toolrow, .seg, .cats {
    grid-column: span 2 !important;
  }

  /* PC端内容操盘台数据面板美化：增高转化漏斗和整体体检格 */
  .bfun-track {
    height: 38px !important;
  }
  .bfun-fill span {
    font-size: 15.5px !important;
  }
  .dg {
    padding: 20px 10px !important;
  }
  .dg .v {
    font-size: 24px !important;
    font-weight: 900 !important;
  }
  .dg .l {
    font-size: 12.5px !important;
    margin-top: 5px !important;
  }

  /* PC端直播操盘台：本场商品双列 */
  .prodgrid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ==================== 主题切换按钮定位 ==================== */
.theme-toggle-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.2s, background-color 0.3s;
}

.theme-toggle-btn:hover {
  transform: scale(1.08);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
}

/* 在手机底部有 Tab 栏的操盘台页面，把按钮稍微往上移 */
.has-tabbar .theme-toggle-btn {
  bottom: 96px;
}

/* ==================== 4. 升级全站卡片、输入框、按钮的动态交互感 (Vibrant UI) ==================== */

/* 升级输入框 & 选择框焦点态 */
input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand, var(--ind, #2f5cff)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, var(--ind, #2f5cff)) 15%, transparent),
              0 4px 12px color-mix(in srgb, var(--brand, var(--ind, #2f5cff)) 8%, transparent) !important;
  transform: translateY(-1px);
  background-color: var(--card) !important;
}

/* 升级卡片微悬停动画 (微升、阴影羽化、色边柔和) */
.card,
.scard,
.pcard,
.inc-card,
.oprec,
.talkcard,
.step,
.dstat,
.me-st3 .x,
.dcell,
.mcell {
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), 
              box-shadow 0.28s ease, 
              border-color 0.28s ease,
              background-color 0.3s ease !important;
}

.card:hover,
.scard:hover,
.pcard:hover,
.inc-card:hover,
.oprec:hover,
.talkcard:hover,
.step:hover,
.dstat:hover,
.me-st3 .x:hover,
.dcell:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--brand, var(--ind, #2f5cff)) 10%, rgba(20,22,30,.06)),
              0 2px 8px color-mix(in srgb, var(--brand, var(--ind, #2f5cff)) 4%, transparent) !important;
  border-color: color-mix(in srgb, var(--brand, var(--ind, #2f5cff)) 35%, transparent) !important;
}

/* 升级按钮悬停与回弹按压感 */
.btn,
.addbar,
.ai-gbtn,
.aiset-test,
.lc-export,
.tk-lvbtn,
.prod-add,
.chat-new-btn,
.lw-go {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), 
              box-shadow 0.2s ease, 
              background-color 0.25s ease !important;
}

.btn:hover,
.addbar:hover,
.ai-gbtn:hover,
.aiset-test:hover,
.lc-export:hover,
.tk-lvbtn:hover,
.prod-add:hover,
.chat-new-btn:hover,
.lw-go:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand, var(--ind, #2f5cff)) 30%, transparent) !important;
}

.btn:active,
.addbar:active,
.ai-gbtn:active,
.aiset-test:active,
.lc-export:active,
.tk-lvbtn:active,
.prod-add:active,
.chat-new-btn:active,
.lw-go:active {
  transform: translateY(0) scale(0.96) !important;
}

/* 升级状态胶囊与选择标签 (Hover微凸，选中更立体) */
.cats .ct,
.cats span,
.chips span,
.fchip,
.tchip,
.chip,
.seg .s {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), 
              box-shadow 0.2s ease, 
              background-color 0.25s ease, 
              color 0.2s ease !important;
}

.cats .ct:hover,
.cats span:hover,
.chips span:hover,
.fchip:hover,
.tchip:hover,
.chip:hover,
.seg .s:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand, var(--ind, #2f5cff)) 15%, transparent) !important;
}

.cats .ct:active,
.cats span:active,
.chips span:active,
.fchip:active,
.tchip:active,
.chip:active,
.seg .s:active {
  transform: translateY(0) scale(0.94) !important;
}

.cats .ct.on,
.cats span.on,
.chips.on,
.fchip.on,
.tchip.on,
.chip.on,
.seg .s.on {
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand, var(--ind, #2f5cff)) 35%, transparent) !important;
}

/* 统一列表淡入与缩放展现的动效，增强视觉流畅度 */
@keyframes scin {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==================== 5. 共享的现代数据卡与多媒体上传排版系统 ==================== */
.datacard2 {
  padding: 16px;
}
.dc-head {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  justify-content: space-between;
}
.dc-name {
  font-size: 17px;
  font-weight: 900;
  color: var(--ink);
}
.dc-body {
  display: flex;
  gap: 10px;
}
.bigvid.tall {
  aspect-ratio: auto;
  width: 108px;
  flex: none;
  align-self: stretch;
  border-radius: 16px;
  background: linear-gradient(150deg, var(--brandb, #e9efff), var(--line2, #f4f3ee)) !important;
  border: 2.5px dashed color-mix(in srgb, var(--brand, var(--ind, #2f5cff)) 40%, transparent) !important;
}
.bigvid.tall .bigvid-ic {
  margin: 0;
  width: 48px;
  height: 48px;
  font-size: 26px;
  background: linear-gradient(135deg, var(--brand, #ff4d8d), var(--brand2, #ff5b3a));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand, #ff4d8d) 40%, transparent);
}
.mgrid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px !important;
}
.mcell {
  background: var(--card2) !important;
  border: 1px solid var(--line2) !important;
  border-radius: 13px !important;
  padding: 12px 6px 9px !important;
  text-align: center;
  position: relative;
  transition: 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.mcell input {
  width: 100%;
  border: none !important;
  background: none !important;
  outline: none !important;
  text-align: center;
  font-size: 19px !important;
  font-weight: 900 !important;
  color: var(--ink) !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}
.mcell input::placeholder {
  color: var(--soft);
}
.mcell:focus-within {
  background: var(--card) !important;
  box-shadow: 0 0 0 2px var(--brand, var(--indp)) inset !important;
}
.mcell label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 3px;
}
.mcell.static .mv {
  font-size: 19px;
  font-weight: 900;
  background: linear-gradient(92deg, var(--brand, #ff4d8d), var(--brand2, #7c3aff));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 大视频/多媒体上传卡 */
.bigvid {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  border: 2px dashed color-mix(in srgb, var(--brand, var(--ind, #2f5cff)) 40%, transparent);
  background: linear-gradient(135deg, var(--brandb, #e9efff), var(--line2, #f4f3ee));
  aspect-ratio: 16/10;
  display: grid;
  place-items: center;
  transition: 0.2s;
}
.bigvid:hover {
  border-color: var(--brand, var(--ind));
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.bigvid.has {
  border-style: solid;
  border-color: transparent;
}
.bigvid img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bigvid-mask {
  position: absolute;
  inset: 0;
  background: rgba(20,22,30,0.32);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: 0.2s;
}
.bigvid:hover .bigvid-mask {
  opacity: 1;
}
.bigvid-mask span {
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  background: rgba(0,0,0,0.4);
  padding: 8px 16px;
  border-radius: 20px;
}
.bigvid-add {
  text-align: center;
  color: var(--brand, var(--ind));
}
.bigvid-ic {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--brand, var(--ind)), var(--brand2, var(--violet, #7c3aff)));
  color: #fff;
  font-size: 30px;
  font-weight: 300;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand, var(--ind)) 35%, transparent);
}
.bigvid-t {
  font-size: 15px;
  font-weight: 800;
}
.bigvid-s {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

/* 停留健康度高亮盒在 common 中的美化适配 */
.mcell.mc-hl {
  border: 1px solid var(--line2) !important;
  color: var(--ink);
}
.mcell.mc-hl.good {
  background: var(--greenb, #e6f8ef) !important;
  border-color: color-mix(in srgb, var(--green, #19c77a) 40%, transparent) !important;
}
.mcell.mc-hl.good .mc-hlv {
  color: var(--green, #19c77a) !important;
}
.mcell.mc-hl.mid {
  background: var(--goldb, #fff7e8) !important;
  border-color: color-mix(in srgb, var(--gold, #f5a623) 40%, transparent) !important;
}
.mcell.mc-hl.mid .mc-hlv {
  color: var(--gold, #f5a623) !important;
}
.mcell.mc-hl.bad {
  background: var(--pinkb, var(--roseb, #ffe9f1)) !important;
  border-color: color-mix(in srgb, var(--pink, var(--rose, #ff4d8d)) 40%, transparent) !important;
}
.mcell.mc-hl.bad .mc-hlv {
  color: var(--pink, var(--rose, #ff4d8d)) !important;
}
.mcell.mc-hlv, .mcell .mc-hlv {
  font-size: 19px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* 收益横幅/涨粉/GMV通栏（年轻化设计） */
.fansbar {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-top: 10px !important;
  border-radius: 14px !important;
  padding: 13px 16px !important;
  background: linear-gradient(95deg, var(--brand, #ff4d8d), var(--brand2, #ff7d3c)) !important;
  box-shadow: 0 4px 15px color-mix(in srgb, var(--brand, #ff4d8d) 25%, rgba(0,0,0,0.06)) !important;
}
.fansbar .fb-k {
  color: #fff !important;
  font-weight: 850 !important;
  font-size: 14.5px !important;
  letter-spacing: 0.5px !important;
}
.fansbar .fb-in {
  margin-left: auto !important;
  border: none !important;
  background: rgba(255, 255, 255, 0.22) !important;
  color: #fff !important;
  font-weight: 900 !important;
  font-size: 18px !important;
  text-align: right !important;
  border-radius: 9px !important;
  padding: 6px 12px !important;
  outline: none !important;
}

/* ==================== 4. 移动端弹窗与表单排版优化 (仅针对溢出/挤压元素) ==================== */
@media (max-width: 600px) {
  /* 统一所有输入框、文本域、下拉选择框的边界计算，防止水平溢出 */
  input, textarea, select {
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  /* 仅在编辑弹窗/表单组内，将横向多列堆叠为单列，防止极度挤压 */
  .modal .row2, 
  .modal .row3, 
  .modal .row4, 
  .modal .frow,
  .addbody .row2, 
  .addbody .row3, 
  .addbody .row4,
  .fgroup .row2,
  .fgroup .row3,
  .fgroup .row4,
  .pr-row2 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }

  .modal .row2 > *, 
  .modal .row3 > *, 
  .modal .row4 > *, 
  .modal .frow > *,
  .addbody .row2 > *, 
  .addbody .row3 > *, 
  .addbody .row4 > *,
  .fgroup .row2 > *,
  .fgroup .row3 > *,
  .fgroup .row4 > *,
  .pr-row2 > * {
    width: 100% !important;
    flex: 1 1 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* 移动端弹窗大小自适应，防止卡片被截断 */
  .modal {
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom)) !important;
  }
}



