/* =========================================================
   决策智能舱 · 移动端样式 V2（视觉增强版）
   飞书原生视觉语言 · 3-Tab 底部导航 · 高级感卡片设计
   ── V2 新增 ──
   • 全页面动态特效（入场动画/微交互/过渡）
   • 字体层级系统（6级字阶/4种字重）
   • 丰富的图标体系（SVG内联+emoji语义）
   • 玻璃拟态 / 渐变光晕 / 脉冲动画
   • 歌尔股份品牌植入
   ========================================================= */

/* ---------- CSS 变量（飞书色板 + 扩展） ---------- */
:root {
  --blue:    #3370FF;
  --blue-hover:#245BDB;
  --blue-active:#1C46A6;
  --blue-soft:#EAF1FF;
  --blue-softer:#F2F6FF;
  --green:   #2EA121;
  --orange:  #FF8800;
  --red:     #F54A45;
  --purple:  #6F4BFF;
  --cyan:    #14C9C9;
  --pink:    #EB2F96;
  --gray:    #BBBFC4;
  --gold:    #F5A623;

  /* 文字色 */
  --t1: #1D2129;   /* 主文字 */
  --t2: #4E5969;   /* 次文字 */
  --t3: #86909C;   /* 辅助文字 */
  --t4: #C9CDD4;   /* 禁用/占位 */
  --bg: #F2F3F5;   /* 页面背景 */
  --white: #FFFFFF;
  --border: #E5E6EB;
  --ok-bg:  #E8F3E8;
  --err-bg: #FDECEC;
  --warn-bg: #FFF7E8;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* 阴影系统 */
  --shadow-card: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-elevated: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-modal: 0 16px 48px rgba(0,0,0,.14);
  --shadow-glow-blue: 0 0 20px rgba(51,112,255,.25);

  /* 布局令牌 */
  --tabbar-h: 64px;
  --topbar-h: 52px;
  --statusbar-h: 44px;
  --home-ind: 34px;
  --island-h: 56px;

  /* 字体系统 */
  --font-display: "SF Pro Display", -apple-system, "PingFang SC", "Helvetica Neue", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;

  /* 动效 */
  --ease-out: cubic-bezier(.22,1,.36,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --fast: 160ms;
  --normal: 280ms;
  --slow: 460ms;
}

/* ---------- Reset & Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-body); background: #E8EAED; color: var(--t1);
  line-height: 1.53; overflow-x: hidden;
  display: flex; justify-content: center; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; outline: none; }
a { color: var(--blue); text-decoration: none; }

/* ---------- Phone Frame ---------- */
.phone-frame {
  width: 100%; height: 100dvh; min-height: 100dvh;
  background: var(--bg); position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.device-screen {
  position: relative; width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background: var(--bg); overflow: hidden;
}
.dynamic-island, .home-indicator, .side-btn { display: none; }

@media (min-width: 480px) {
  body {
    align-items: center;
    background: radial-gradient(130% 120% at 50% 0%, #eef1f6 0%, #d8dde7 55%, #c5ccd8 100%);
  }
  .phone-frame {
    --ph-w: min(393px, calc((100vh - 56px) * 393 / 852));
    width: var(--ph-w);
    height: auto; min-height: 0;
    aspect-ratio: 393 / 852;
    max-height: calc(100vh - 48px);
    margin: 24px auto; padding: 11px;
    border-radius: 55px; overflow: visible;
    box-sizing: content-box;
    background: linear-gradient(145deg,#3a3a3c,#1c1c1e 45%,#2c2c2e 60%,#0a0a0a);
    box-shadow: 0 0 0 2px #6e6e73 inset, 0 0 0 3px #26262a inset,
                0 34px 70px rgba(0,0,0,.45), 0 10px 24px rgba(0,0,0,.25);
  }
  .device-screen { border-radius: 45px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.10); }
  .dynamic-island {
    display: block; position: absolute; top: 11px; left: 50%;
    transform: translateX(-50%); width: 122px; height: 35px;
    background: #000; border-radius: 20px; z-index: 1000; overflow: hidden;
  }
  .dynamic-island .di-cam {
    position: absolute; right: 12px; top: 11px; width: 9px; height: 9px;
    border-radius: 50%; background: #15151f; box-shadow: inset 0 0 0 2px #2b2b3a;
  }
  .dynamic-island .di-sensor {
    position: absolute; right: 30px; top: 13px; width: 5px; height: 5px;
    border-radius: 50%; background: #283848;
  }
  .home-indicator {
    display: block; position: absolute; bottom: 9px; left: 50%;
    transform: translateX(-50%); width: 134px; height: 5px;
    border-radius: 3px; background: rgba(0,0,0,.85); z-index: 1000;
  }
  .side-btn { display: block; position: absolute; background: #2a2a2c; border-radius: 2px; z-index: 5; }
  .side-action { left: -1px; top: 108px; width: 3px; height: 28px; }
  .side-vol-up { left: -1px; top: 150px; width: 3px; height: 58px; }
  .side-vol-down { left: -1px; top: 216px; width: 3px; height: 58px; }
  .side-power { right: -1px; top: 168px; width: 3px; height: 86px; }
  .statusbar { height: var(--island-h); padding: 0 28px 8px; align-items: flex-end; }
}

/* ---------- 状态栏 ---------- */
.statusbar {
  height: var(--statusbar-h); padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}
.sb-time { font-weight: 600; font-size: 15px; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.sb-right { display: flex; gap: 5px; align-items: center; }
.sb-ic { display: block; width: 17px; height: 11px; }
.sb-signal { background: linear-gradient(180deg,#000 2px,transparent 2px) 0 0 / 3px 10px,linear-gradient(180deg,#000 2px,transparent 2px) 4.5px 0 / 3px 7px,linear-gradient(180deg,#000 2px,transparent 2px) 9px 0 / 3px 4px,linear-gradient(180deg,#000 2px,transparent 2px) 13.5px 0 / 3px 1.5px; }
.sb-wifi { background: radial-gradient(circle at 50% 100%, transparent 5px, currentColor 5px, currentColor 6px, transparent 6px),radial-gradient(circle at 50% 100%, transparent 3.5px, currentColor 3.5px, currentColor 4.5px, transparent 4.5px),radial-gradient(circle at 50% 100%, transparent 2px, currentColor 2px, currentColor 3px, transparent 3px),radial-gradient(circle at 50% 100%, transparent .5px, currentColor .5px, currentColor 1.5px, transparent 1.5px); width: 16px; height: 11px; }
.sb-battery { width: 25px; height: 11px; border: 1.5px solid currentColor; border-radius: 3px; position: relative; overflow: hidden; }
.sb-battery::after { content:''; position:absolute; right:-3px; top:3px; width:2px; height:5px; background:currentColor; border-radius:0 1px 1px 0; }
.sb-battery::before { content:''; position:absolute; left:1.5px;top:1.5px;height:6px;width:70%;background:var(--green);border-radius:1px; }

/* ========== 顶栏（修复重叠：z-index 层级 + 背景） ========== */
.topbar {
  height: var(--topbar-h); padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); /* ← 必须有背景，否则内容会透过 */
  border-bottom: .5px solid var(--border);
  flex-shrink: 0; z-index: 90; position: sticky; top: var(--statusbar-h);
  /* V2: 增加微妙的玻璃效果 */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.tb-title { 
  font-family: var(--font-display); 
  font-size: 18px; 
  font-weight: 700; 
  letter-spacing: -.3px;
  /* V2: 标题渐变 */
  background: linear-gradient(135deg, var(--t1) 0%, var(--blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tb-center { flex: 1; display: flex; justify-content: center; }
.tb-right { display: flex; align-items: center; gap: 4px; }
.ic-btn { 
  width: 36px; height: 36px; 
  display: inline-flex; align-items: center; justify-content: center; 
  border-radius: 50%; 
  transition: all var(--fast) var(--ease-out);
  /* V2: 悬浮反馈增强 */
}
.ic-btn:hover { background: rgba(51,112,255,.08); transform: scale(1.05); }
.ic-btn:active { background: rgba(51,112,255,.15); transform: scale(.95); }
.dot-red { 
  width: 8px; height: 8px; background: var(--red); 
  border-radius: 50%; position: absolute; top: 6px; right: 5px; 
  border: 1.5px solid var(--white);
  /* V2: 呼吸脉冲 */
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.3);opacity:.7} }

/* 角色芯片 */
.role-chip-sm {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(135deg, #EBF2FF, #E0E9FF);
  padding: 5px 11px 5px 5px; border-radius: var(--radius-pill);
  font-size: 13px; color: var(--blue); font-weight: 600;
  border: 1px solid rgba(51,112,255,.15);
  transition: all var(--fast) var(--ease-out);
}
.role-chip-sm:active { transform: scale(.97); }
.rc-avatar {
  width: 24px; height: 24px; border-radius: 7px;
  background: linear-gradient(135deg, var(--blue), #5B93FF);
  color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
  box-shadow: 0 2px 6px rgba(51,112,255,.25);
}
.role-chip-sm svg { opacity: .6; transition: transform var(--fast); }
.role-chip-sm:hover svg { transform: rotate(180deg); }

/* ---------- 舞台 ---------- */
.stage {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
  touch-action: pan-y;
  position: relative; 
  /* 底部留白 = TabBar 总高(64+34) + 输入栏高(~56) + 缓冲(24)
     = (var(--tabbar-h) + var(--home-ind)) + 80px ≈ 178px
     - Bug 2: 使「我的」页「退出登录」按钮（含其 32px margin-bottom）远离底部 TabBar(98px)
     - Bug 1: 使 CHATBI 最后一条对话消息停在输入栏顶部（约 154px 处）之上，不被输入栏遮挡 */
  padding-bottom: calc(var(--tabbar-h) + var(--home-ind) + 80px);
  /* V2: 滚动条美化 */
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.tab-page { display: none; min-height: 100%; }
.tab-page.is-active { 
  display: block; 
  animation: pageIn var(--normal) var(--ease-out) both; 
}
@keyframes pageIn { 
  from{opacity:0;transform:translateY(12px)} 
  to{opacity:1;transform:none} 
}
.tab-page > *:first-child { padding-top: 16px; }

/* ==================== Tab 1: CHATBI ==================== */

/* 问候卡片 —— V2: 动态渐变背景 + 光晕 */
.greet-card {
  margin: 0 16px 16px; padding: 20px 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #9B59B6 100%);
  border-radius: var(--radius-lg); color: #fff;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 4px 20px rgba(102,126,234,.40), 0 1px 3px rgba(0,0,0,.06);
  position: relative; overflow: hidden;
  /* V2: 卡片入场动画 */
  animation: cardSlideIn var(--slow) var(--ease-out) both;
}
@keyframes cardSlideIn { from{opacity:0;transform:translateY(-16px) scale(.98)} to{opacity:1;transform:none} }

/* V2: 背景装饰光斑 */
.greet-card::before {
  content:''; position: absolute; right: -20px; top: -20px;
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.15), transparent 70%);
  pointer-events: none;
}
.greet-card::after {
  content:''; position: absolute; left: 30px; bottom: -15px;
  width: 60px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.08), transparent 70%);
  pointer-events: none;
}

.gc-text { display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }
.gc-text strong { 
  font-family: var(--font-display); 
  font-size: 20px; 
  font-weight: 700; 
  line-height: 1.3;
  letter-spacing: -.2px;
}
.gc-text span { font-size: 13px; opacity: .88; font-weight: 400; }
.mascot-sq { 
  flex-shrink: 0; 
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.2));
  /* V2: 吉祥物悬浮动画 */
  animation: mascotFloat 3s ease-in-out infinite;
}
@keyframes mascotFloat {
  0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)}
}

/* 快捷芯片行 —— V2: 图标前缀 + 弹跳入场 */
.chip-row {
  display: flex; gap: 8px; padding: 0 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.chip-btn {
  padding: 7px 14px; background: var(--white); border-radius: var(--radius-pill);
  font-size: 13px; color: var(--t2); border: 1px solid var(--border);
  white-space: nowrap; transition: all var(--fast) var(--ease-out);
  display: inline-flex; align-items: center; gap: 5px;
  /* V2: 交错入场 */
  animation: chipIn var(--normal) var(--ease-out) both;
}
.chip-btn:nth-child(1){animation-delay: .05s} .chip-btn:nth-child(2){animation-delay: .1s}
.chip-btn:nth-child(3){animation-delay: .15s} .chip-btn:nth-child(4){animation-delay: .2s}
@keyframes chipIn { from{opacity:0;transform:scale(.85)} to{opacity:1;transform:none} }

.chip-btn::before {
  content:'✦'; font-size: 10px; color: var(--blue); opacity: .7;
}
.chip-btn:active { 
  background: #f0f4ff; 
  border-color: var(--blue); 
  color: var(--blue); 
  transform: scale(.96);
}

/* Section 容器 */
.sec { margin: 0 16px 20px; }
.sec-head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px;
}
.sec-head h3 { 
  font-family: var(--font-display); 
  font-size: 17px; 
  font-weight: 700; 
  letter-spacing: -.2px;
  /* V2: 标题装饰 */
  position: relative;
  padding-left: 12px;
}
.sec-head h3::before {
  content:''; position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 3px; border-radius: 2px; background: linear-gradient(180deg, var(--blue), var(--purple));
}
.sec-more { 
  font-size: 13px; 
  color: var(--blue); 
  font-weight: 600;
  transition: color var(--fast);
}
.sec-more:active { color: var(--blue-active); }

/* 待办事项 —— V2: 左侧彩色指示条 */
.todo-list { display: flex; flex-direction: column; gap: 10px; }
.todo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--white);
  border-radius: var(--radius-md); 
  box-shadow: var(--shadow-card);
  transition: all var(--fast) var(--ease-out);
  position: relative; overflow: hidden;
  animation: todoIn var(--normal) var(--ease-out) both;
}
.todo-item:nth-child(1){animation-delay:.05s} .todo-item:nth-child(2){animation-delay:.12s} .todo-item:nth-child(3){animation-delay:.19s}
@keyframes todoIn { from{opacity:0;transform:translateX(-12px)} to{opacity:1;transform:none} }

.todo-item:active { transform: scale(.99); box-shadow: var(--shadow-elevated); }
.todo-dot { 
  width: 8px; height: 8px; 
  border-radius: 50%; flex-shrink: 0; 
  /* V2: 发光点 */
  box-shadow: 0 0 6px currentColor;
}
.todo-dot.err { background: var(--red); box-shadow: 0 0 6px rgba(245,74,69,.4); }
.todo-dot.warn { background: var(--orange); box-shadow: 0 0 6px rgba(255,136,0,.4); }
.todo-dot.ok { background: var(--blue); box-shadow: 0 0 6px rgba(51,112,255,.4); }
.todo-body { flex: 1; min-width: 0; }
.todo-title { font-size: 14px; font-weight: 600; }
.todo-time { font-size: 12px; color: var(--t3); margin-top: 2px; }

/* AI 数据参谋区域 —— V2: 脉冲光晕边框 */
.ai-header { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  margin-bottom: 10px;
}
.ai-avatar-sm { 
  flex-shrink: 0;
  /* V2: AI 头像呼吸光环 */
  position: relative;
}
.ai-avatar-sm::after {
  content:''; position: absolute; inset: -3px;
  border-radius: 50%; background: var(--blue);
  opacity: .15; animation: avatarPulse 2.5s ease-in-out infinite;
}
@keyframes avatarPulse { 0%,100%{transform:scale(1);opacity:.15} 50%{transform:scale(1.15);opacity:.08} }

.ai-header strong { font-size: 15px; display: block; font-weight: 700; }
.ai-status { font-size: 12px; color: var(--t3); }
.ai-greeting { 
  font-size: 14px; 
  color: var(--t2); 
  line-height: 1.65; 
  margin-bottom: 12px;
  padding: 12px 14px; 
  background: linear-gradient(135deg, #f8f9ff, #fff);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--blue);
}

.chat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chat-chip {
  padding: 6px 13px; background: #EEF2FF; border-radius: var(--radius-pill);
  font-size: 13px; color: var(--blue); font-weight: 500;
  border: 1px solid transparent; transition: all .15s;
  position: relative; overflow: hidden;
}
.chat-chip::before {
  content:''; position: absolute; inset: 0; background: linear-gradient(135deg,transparent,rgba(51,112,255,.06));
  opacity: 0; transition: opacity var(--fast);
}
.chat-chip:active { background: #dbe8ff; border-color: var(--blue); }
.chat-chip:active::before { opacity: 1; }

/* 对话线程 */
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 8px; align-items: flex-start; }
.msg.me { flex-direction: row-reverse; }
.msg-av {
  width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  /* V2: 用户头像渐变 */
  background: linear-gradient(135deg, #666, #999);
}
.av-sp { 
  background: linear-gradient(135deg, var(--blue), var(--purple)); 
  box-shadow: 0 2px 8px rgba(51,112,255,.3);
}
.av-me { background: linear-gradient(135deg, #4CAF50, #81C784); }
.bubble {
  max-width: 340px; padding: 8px 10px; border-radius: 14px;
  font-size: 12px; line-height: 1.45; word-break: break-word;
}
.msg:not(.me) .bubble { background: var(--white); border-top-left-radius: 4px; box-shadow: var(--shadow-card); }
.msg.me .bubble { background: var(--blue); color: #fff; border-top-right-radius: 4px; }
.msg-name { font-size: 11px; color: var(--t3); margin-bottom: 4px; }
.chat-meta { text-align: center; font-size: 11px; color: var(--t3); padding: 4px 0; }

/* AI 应答组件 */
.verdict { 
  display: flex; gap: 8px; padding: 12px 14px; 
  border-radius: var(--radius-md); 
  margin: 8px 0; align-items: flex-start;
  animation: verdictIn var(--normal) var(--ease-spring) both;
}
@keyframes verdictIn { from{opacity:0;transform:translateY(8px) scale(.98)} to{opacity:1;transform:none} }
.verdict.ok { background: var(--ok-bg); border-left: 3px solid var(--green); }
.verdict.warn { background: var(--warn-bg); border-left: 3px solid var(--orange); }
.v-ic { flex-shrink: 0; font-size: 18px; margin-top: 1px; }
.v-txt { font-size: 12px; line-height: 1.45; }
.dash { 
  background: var(--white); border-radius: var(--radius-lg); 
  padding: 16px; margin: 10px 0; 
  box-shadow: var(--shadow-elevated);
  animation: dashIn var(--slow) var(--ease-out) both;
  overflow: hidden;
  position: relative;
}
@keyframes dashIn { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:none} }

/* V2: 图表区域顶部渐变线 */
.dash::before {
  content:''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--purple), var(--cyan));
}
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.dash-title strong { font-size: 13px; display: block; font-weight: 700; }
.dash-title small { font-size: 12px; color: var(--t3); }
.dash-kpis { display: gap: 12px; flex-wrap: wrap; }
.kpi { text-align: center; }
.kpi strong { font-size: 15px; display: block; font-family: var(--font-mono); font-weight: 700; }
.kpi span { font-size: 11px; color: var(--t3); }
.kpi .up { color: var(--red); }
.kpi .down { color: var(--green); }
.dash-body { margin: 12px 0; overflow-x: auto; }
.dash-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--t3); }
.dash-legend i { display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:4px;vertical-align:-1px;}
.dash-drill { font-size: 12px; color: var(--blue); margin-top: 10px; font-weight: 500; }

.advice { 
  background: var(--white); border-radius: var(--radius-lg); 
  padding: 16px; margin: 10px 0; 
  box-shadow: var(--shadow-card);
  border-left: 3px solid var(--blue);
  animation: adviceIn var(--slow) var(--ease-out) .1s both;
}
@keyframes adviceIn { from{opacity:0;transform:translateX(-12px)} to{opacity:1;transform:none} }
.advice h4 { font-size: 14px; margin-bottom: 10px; color: var(--blue); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.advice ol { padding-left: 18px; }
.advice li { font-size: 12px; color: var(--t2); line-height: 1.45; margin-bottom: 6px; }
.advice li .num { 
  display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center;
  border-radius: 50%; background: #EEF2FF; color: var(--blue); font-size: 11px; font-weight: 700; 
  margin-right: 6px; font-family: var(--font-mono);
}
.btn-task {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: linear-gradient(135deg, var(--blue), #5B93FF); color: #fff; 
  border-radius: var(--radius-pill); font-size: 13px; font-weight: 500; 
  margin-top: 12px; border: none;
  box-shadow: 0 2px 8px rgba(51,112,255,.3);
  transition: all var(--fast) var(--ease-out);
}
.btn-task:active { transform: scale(.96); box-shadow: 0 1px 4px rgba(51,112,255,.3); }
.btn-task.done { background: linear-gradient(135deg, var(--green), #52C41A); pointer-events: none; }

.qnote { display: flex; gap: 10px; padding: 12px; border-radius: var(--radius-md); margin: 8px 0; font-size: 12px; }
.qnote.warn { background: var(--warn-bg); border-left: 3px solid var(--orange); }
.qnote strong { display: block; margin-bottom: 2px; }

/* 打字指示器 */
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); animation: bounce .6s infinite alternate; opacity: .5; }
.typing i:nth-child(2){animation-delay:.15s} .typing i:nth-child(3){animation-delay:.3s}
@keyframes bounce { from{transform:translateY(0)} to{transform:translateY(-6px)} }

/* ========== 输入栏 —— V2: 聚焦发光 ========== */
.input-bar {
  position: absolute; bottom: calc(var(--tabbar-h) + var(--home-ind)); left: 0; right: 0;
  padding: 8px 16px 12px; background: var(--bg);
  z-index: 200; border-top: .5px solid var(--border);
}
.ib-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border-radius: var(--radius-pill);
  padding: 4px 4px 4px 16px; 
  box-shadow: var(--shadow-elevated);
  border: 1.5px solid transparent;
  transition: all var(--fast) var(--ease-out);
}
.ib-wrap:focus-within { 
  border-color: var(--blue); 
  box-shadow: var(--shadow-elevated), 0 0 0 3px rgba(51,112,255,.1);
}
.ib-wrap input {
  flex: 1; border: none; outline: none; font-size: 14px;
  background: transparent; min-width: 0; height: 36px; color: var(--t1);
  font-family: var(--font-body);
}
.ib-wrap input::placeholder { color: var(--t4); }
.ib-send {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #5B93FF);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .15s var(--ease-out);
  box-shadow: 0 2px 8px rgba(51,112,255,.3);
}
.ib-send:active { transform: scale(.92); }

/* ========== TabBar —— V2: 弹性切换动画 ========== */
.tabbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: calc(var(--tabbar-h) + var(--home-ind));
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: transparent; padding: 0 24px var(--home-ind); gap: 0;
}
.tabbar::before {
  content: '';
  position: absolute; left: 24px; right: 24px; bottom: var(--home-ind);
  height: var(--tabbar-h);
  background: var(--white); border-radius: var(--radius-pill);
  box-shadow: 0 -2px 12px rgba(0,0,0,.06), 0 -1px 3px rgba(0,0,0,.03);
  z-index: -1;
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 0; border-radius: var(--radius-pill); 
  transition: all var(--normal) var(--ease-spring);
  position: relative; z-index: 1;
}
.tab-ic { 
  opacity: .45; 
  transition: all var(--normal) var(--ease-spring); 
  color: var(--t2);
}
.tab-item span { 
  font-size: 10px; 
  font-weight: 500; 
  color: var(--t3); 
  transition: all var(--normal) var(--ease-spring); 
  letter-spacing: .3px;
}
.tab-item.is-active .tab-ic { 
  opacity: 1; 
  color: var(--blue); 
  transform: scale(1.12) translateY(-1px);
  filter: drop-shadow(0 2px 4px rgba(51,112,255,.3));
}
.tab-item.is-active span { 
  color: var(--blue); 
  font-weight: 700; 
  font-size: 10.5px;
}
.tab-item.is-active { 
  background: rgba(51,112,255,.08); 
}

/* ========== Tab 2: 工作舱 —— V2: 宫格悬浮特效 ========== */
.grid-head { display: flex; justify-content: space-between; align-items: center; padding: 0 16px 14px; }
.grid-head h2 { 
  font-family: var(--font-display); 
  font-size: 21px; 
  font-weight: 800; 
  letter-spacing: -.3px;
}
.txt-btn { 
  font-size: 14px; 
  color: var(--blue); 
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  transition: all var(--fast);
}
.txt-btn:active { background: var(--blue-soft); }

.func-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  padding: 0 16px 20px;
}
.grid-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  /* V2: 点击波纹 */
  position: relative; overflow: hidden;
}
.grid-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; 
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  transition: all var(--normal) var(--ease-spring);
  /* V2: 入场弹跳 */
  animation: gridIconIn var(--normal) var(--ease-spring) both;
}
.grid-item:nth-child(1) .grid-icon{animation-delay:.02s}
.grid-item:nth-child(2) .grid-icon{animation-delay:.04s}
.grid-item:nth-child(3) .grid-icon{animation-delay:.06s}
.grid-item:nth-child(4) .grid-icon{animation-delay:.08s}
.grid-item:nth-child(5) .grid-icon{animation-delay:.1s}
.grid-item:nth-child(6) .grid-icon{animation-delay:.12s}
.grid-item:nth-child(7) .grid-icon{animation-delay:.14s}
.grid-item:nth-child(8) .grid-icon{animation-delay:.16s}
.grid-item:nth-child(9) .grid-icon{animation-delay:.18s}
.grid-item:nth-child(10) .grid-icon{animation-delay:.2s}
.grid-item:nth-child(11) .grid-icon{animation-delay:.22s}
.grid-item:nth-child(12) .grid-icon{animation-delay:.24s}

@keyframes gridIconIn { 
  from{opacity:0;transform:scale(.7) rotate(-5deg)} 
  to{opacity:1;transform:none} 
}

.grid-item:active .grid-icon { 
  transform: scale(.88) !important; 
  box-shadow: 0 2px 6px rgba(0,0,0,.2) !important;
}
.grid-label { 
  font-size: 12px; 
  color: var(--t2); 
  font-weight: 500; 
  text-align: center; 
  line-height: 1.3;
  letter-spacing: .2px;
}

/* 各功能图标渐变色 */
.gi-blue    { background: linear-gradient(135deg, #3370FF, #5B93FF); }
.gi-purple  { background: linear-gradient(135deg, #6F4BFF, #9B6BFF); }
.gi-cyan    { background: linear-gradient(135deg, #14C9C9, #36E0DF); }
.gi-orange  { background: linear-gradient(135deg, #FF8800, #FFAA40); }
.gi-green   { background: linear-gradient(135deg, #2EA121, #52C41A); }
.gi-pink    { background: linear-gradient(135deg, #EB2F96, #F56CA0); }
.gi-red     { background: linear-gradient(135deg, #F54A45, #FF7875); }
.gi-gray    { background: linear-gradient(135deg, #8F959E, #B0B5BD); }

/* 吉祥物横幅 */
.mascot-banner {
  margin: 0 16px 24px; padding: 18px 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: var(--radius-lg); color: #fff;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 4px 16px rgba(102,126,234,.35);
  position: relative; overflow: hidden;
  animation: bannerGlow 3s ease-in-out infinite alternate;
}
@keyframes bannerGlow { 
  from{box-shadow: 0 4px 16px rgba(102,126,234,.35)}
  to{box-shadow: 0 4px 24px rgba(102,126,234,.5), 0 0 40px rgba(102,126,234,.15)}
}
.mb-text { display: flex; flex-direction: column; gap: 3px; position: relative; z-index: 1; }
.mb-text strong { font-size: 17px; font-weight: 700; }
.mb-text span { font-size: 13px; opacity: .85; }
.mascot-banner-icon { filter: drop-shadow(0 2px 8px rgba(0,0,0,.15)); animation: mascotFloat 3s ease-in-out infinite; }

/* 子页面容器 */
.sub-page { 
  padding: 16px; 
  animation: subPageIn .25s ease both;
}
@keyframes subPageIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:none} }

/* ========== 子页面：我的看板（V2 增强） ========== */
.stats-bar {
  display: flex; background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); margin: 0 16px 16px; overflow: hidden;
  animation: statsIn var(--normal) var(--ease-spring) both;
}
@keyframes statsIn { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:none} }
.stat-item {
  flex: 1; text-align: center; padding: 16px 0;
  border-right: 1px solid var(--border);
  position: relative;
}
.stat-item:last-child { border-right: none; }
.stat-num { 
  font-size: 26px; 
  font-weight: 800; 
  color: var(--t1); 
  display: block; 
  font-family: var(--font-mono);
  /* V2: 数字弹跳 */
  animation: countJump .6s var(--ease-spring) both;
}
@keyframes countJump { 
  0%{opacity:0;transform:scale(.5)} 
  60%{transform:scale(1.15)} 
  100%{opacity:1;transform:none} 
}
.stat-label { font-size: 12px; color: var(--t3); margin-top: 2px; font-weight: 500; }

/* 增强卡片 —— V2: 悬浮提升 */
.info-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); margin: 0 16px 12px; overflow: hidden;
  position: relative; transition: all var(--normal) var(--ease-out);
  animation: infoCardIn var(--normal) var(--ease-out) both;
}
.info-card:nth-child(1){animation-delay:.05s} .info-card:nth-child(2){animation-delay:.12s} .info-card:nth-child(3){animation-delay:.19s}
@keyframes infoCardIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }

.info-card:active { transform: translateY(-2px); box-shadow: var(--shadow-elevated); }
.indicator-bar {
  position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 0 2px 2px 0;
}
.ib-blue { background: linear-gradient(180deg, var(--blue), #5B93FF); }
.ib-green { background: linear-gradient(180deg, var(--green), #52C41A); }
.ib-red { background: linear-gradient(180deg, var(--red), #FF7875); }
.card-body { padding: 16px 16px 16px 22px; }
.card-title { 
  font-size: 15px; 
  font-weight: 700; 
  display: flex; justify-content: space-between; align-items: center;
}
.card-tag { 
  font-size: 11px; 
  padding: 2px 8px; 
  border-radius: var(--radius-pill); 
  font-weight: 600;
  letter-spacing: .3px;
}
.tag-blue { background: #EEF2FF; color: var(--blue); }
.tag-green { background: var(--ok-bg); color: var(--green); }
.tag-red { background: var(--err-bg); color: var(--red); }
.card-metric { font-size: 13px; color: var(--t2); margin-top: 6px; }
.card-metric b { color: var(--t1); font-weight: 700; }
.card-detail { font-size: 12px; color: var(--t3); margin-top: 4px; }

.quick-actions {
  display: flex; gap: 10px; padding: 0 16px 20px;
}
.qa-btn {
  flex: 1; padding: 12px 0; text-align: center; font-size: 13px;
  border-radius: var(--radius-md); font-weight: 500;
  background: var(--white); border: 1px solid var(--border);
  color: var(--blue); transition: all var(--fast) var(--ease-out);
  position: relative; overflow: hidden;
}
.qa-btn::before {
  content:''; position: absolute; inset: 0; background: var(--blue);
  opacity: 0; transition: opacity var(--fast);
}
.qa-btn:active { background: #EEF2FF; border-color: var(--blue); color: var(--blue); transform: scale(.97); }
.qa-btn:active::before { opacity: .05; }
.qa-btn.primary { 
  background: linear-gradient(135deg, var(--blue), #5B93FF); 
  color: #fff; 
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(51,112,255,.3);
}
.qa-btn.primary:active { opacity: .85; transform: scale(.97); }

/* ========== 子页面：决策闭环 ========== */
.loop-stats { display: flex; margin: 0 0 16px; }
.ls-item { flex: 1; text-align: center; }
.ls-num { font-size: 26px; font-weight: 800; display: block; font-family: var(--font-mono); animation: countJump .6s var(--ease-spring) both; }
.ls-num.green { color: var(--green); }
.ls-label { font-size: 12px; color: var(--t3); font-weight: 500; }

.loop-list { display: flex; flex-direction: column; gap: 12px; }
.loop-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 16px; box-shadow: var(--shadow-card);
  transition: all var(--fast) var(--ease-out);
  animation: loopCardIn var(--normal) var(--ease-out) both;
}
.loop-card:nth-child(1){animation-delay:.05s} .loop-card:nth-child(2){animation-delay:.12s} .loop-card:nth-child(3){animation-delay:.19s}
@keyframes loopCardIn { from{opacity:0;transform:translateX(-10px)} to{opacity:1;transform:none} }
.loop-card:active { transform: scale(.99); }

.lc-top { display: flex; gap: 10px; align-items: flex-start; }
.lc-sev { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; box-shadow: 0 0 6px currentColor; }
.lc-sev.err { background: var(--red); }
.lc-sev.warn { background: var(--orange); }
.lc-body { flex: 1; min-width: 0; }
.lc-title { font-size: 15px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.lc-sub { font-size: 13px; color: var(--t2); margin-top: 4px; }
.lc-meta { font-size: 12px; color: var(--t3); margin-top: 4px; }
.lc-status { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-pill); font-weight: 600; }
.lc-status.doing { background: #EEF2FF; color: var(--blue); }
.lc-status.done { background: var(--ok-bg); color: var(--green); }
.lc-status.wait { background: var(--warn-bg); color: var(--orange); }
.lc-act { margin-left: auto; flex-shrink: 0; }
.lc-btn {
  padding: 6px 14px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600;
  transition: all var(--fast);
}
.lc-btn.start { background: var(--blue); color: #fff; }
.lc-btn.close { background: var(--ok-bg); color: var(--green); }

/* ========== 子页面：数据质检 ========== */
.quality-score { text-align: center; padding: 20px 0; }
.qs-big { font-size: 52px; font-weight: 800; color: var(--green); font-family: var(--font-mono); animation: scoreCount 1s var(--ease-spring) both; }
@keyframes scoreCount { from{opacity:0;transform:scale(.6)} to{opacity:1;transform:none} }
.qs-unit { font-size: 14px; color: var(--t3); }
.q-grid { display: flex; flex-direction: column; gap: 10px; }
.q-card {
  background: var(--white); border-radius: var(--radius-md); padding: 14px 16px;
  box-shadow: var(--shadow-card);
  transition: all var(--fast);
  animation: qCardIn var(--normal) var(--ease-out) both;
}
.q-card:nth-child(n){animation-delay:calc(var(--n,1)*.08s)}
@keyframes qCardIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
.qc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.qc-ic { 
  width: 32px; height: 32px; 
  border-radius: 9px; 
  display: flex; align-items: center; justify-content: center; 
  color: #fff; font-size: 14px; 
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.qc-name { flex: 1; font-size: 14px; font-weight: 700; }
.qc-name small { font-weight: 400; color: var(--t3); margin-left: 4px; }
.qc-status { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-pill); font-weight: 600; }
.qc-status.pass { background: var(--ok-bg); color: var(--green); }
.qc-status.fail { background: var(--err-bg); color: var(--red); }
.qc-status.fix { background: var(--warn-bg); color: var(--orange); }
.qc-note { font-size: 12px; color: var(--t3); margin-top: 6px; }

/* ========== Tab 3: 我的（V2 全面升级） ========== */

/* 统计条——V2: 渐变分隔线 */
.profile-card {
  margin: 0 16px 16px; padding: 18px; background: var(--white);
  border-radius: var(--radius-lg); 
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; gap: 14px;
  position: relative; overflow: hidden;
  animation: profileIn var(--normal) var(--ease-spring) both;
}
@keyframes profileIn { from{opacity:0;transform:translateY(10px) scale(.98)} to{opacity:1;transform:none} }

/* V2: 个人信息卡左侧装饰条 */
.profile-card::before {
  content:''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: linear-gradient(180deg, var(--blue), var(--purple));
}
.pc-avatar {
  width: 56px; height: 56px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  /* V2: 头像光环 */
  position: relative;
}
.pc-avatar::after {
  content:''; position: absolute; inset: -3px;
  border-radius: 18px; background: linear-gradient(135deg, var(--blue), var(--purple));
  opacity: .2; animation: avatarPulse 2.5s ease-in-out infinite;
  z-index: -1;
}
.pc-info { flex: 1; min-width: 0; }
.pc-name { 
  font-size: 17px; 
  font-weight: 700; 
  display: block; 
  font-family: var(--font-display);
  letter-spacing: -.2px;
}
.pc-dept { font-size: 13px; color: var(--t2); margin-top: 3px; font-weight: 500; }
.pc-id { font-size: 12px; color: var(--t3); margin-top: 3px; }
.pc-badge { 
  font-size: 11px; 
  padding: 3px 10px; 
  border-radius: var(--radius-pill); 
  background: var(--ok-bg); 
  color: var(--green); 
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  /* V2: 徽章动画 */
  animation: badgePop .4s var(--ease-spring) both;
}
@keyframes badgePop { from{opacity:0;transform:scale(.6)} to{opacity:1;transform:none} }

/* 我的部分区块 —— V2: 图标标题 + 行级交互 */
.me-section {
  margin: 0 16px 12px; background: var(--white);
  border-radius: var(--radius-lg); 
  box-shadow: var(--shadow-card); 
  overflow: hidden;
  transition: all var(--fast) var(--ease-out);
  animation: sectionIn var(--normal) var(--ease-out) both;
}
.me-section:nth-of-type(3){animation-delay:.08s}
.me-section:nth-of-type(4){animation-delay:.14s}
.me-section:nth-of-type(5){animation-delay:.2s}
.me-section:nth-of-type(6){animation-delay:.26s}
@keyframes sectionIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

.ms-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px 10px;
}
.ms-header h4 { 
  font-size: 15px; 
  font-weight: 700; 
  display: flex; 
  align-items: center; 
  gap: 8px;
  font-family: var(--font-display);
}
.ms-header h4 svg { 
  width: 18px; 
  height: 18px; 
  color: var(--blue);
  /* V2: SVG 图标颜色填充 */
  fill: var(--blue);
}
.ms-badge { 
  font-size: 10px; 
  padding: 3px 8px; 
  border-radius: var(--radius-pill); 
  font-weight: 600;
  letter-spacing: .3px;
}
.ms-badge.readonly { background: #F2F3F5; color: var(--t3); }
.ms-badge.editable { background: #EEF2FF; color: var(--blue); }
.ms-body { padding: 0 16px 14px; }

/* 部门架构树 —— V2: 连接线动画 */
.ms-org-tree { padding: 4px 0; }
.org-node {
  padding: 10px 14px;
  font-size: 14px; color: var(--t1);
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: .5px solid var(--border);
  margin-bottom: 6px;
  transition: all var(--fast) var(--ease-out);
  display: flex; align-items: center; justify-content: space-between;
}
.org-node:active { background: #f0f4ff; border-color: var(--blue); }
.org-node.root {
  font-weight: 700; color: var(--blue);
  background: linear-gradient(135deg, #EEF2FF, #DDEEFF);
  border-color: #C4D8F8;
  /* V2: 根节点高亮脉冲 */
  box-shadow: 0 0 0 0 rgba(51,112,255,0);
  animation: rootPulse 2.5s ease-in-out;
}
@keyframes rootPulse { 0%,100%{box-shadow: 0 0 0 0 rgba(51,112,255,0)} 50%{box-shadow: 0 0 0 4px rgba(51,112,255,.15)} }
.org-children { 
  margin-left: 16px; 
  margin-top: 6px; 
  border-left: 2px solid var(--border); 
  padding-left: 10px; 
  /* V2: 连接线渐进出现 */
  position: relative;
}
.org-leader { font-weight: normal; color: var(--t3); font-size: 13px; }
.ms-list { list-style: none; }
.ms-list li { 
  padding: 11px 0; 
  font-size: 14px; 
  color: var(--t2); 
  border-bottom: .5px solid var(--border); 
  display: flex; 
  align-items: center; 
  gap: 8px;
  transition: background var(--fast);
}
.ms-list li:last-child { border-bottom: none; }
.ms-list li:active { background: #fafbff; }
/* V2: 列表项圆点 */
.ms-list li::before {
  content:'●'; 
  font-size: 6px; 
  color: var(--blue); 
  opacity: .5;
  flex-shrink: 0;
}

/* 设置项 —— V2: 行级箭头动画 */
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; 
  border-bottom: .5px solid var(--border);
  font-size: 14px; color: var(--t1);
  transition: background var(--fast);
  position: relative;
}
.setting-row:last-child { border-bottom: none; }
.setting-row:active { background: #fafafa; }
.setting-row .arrow { 
  color: var(--t4); 
  font-size: 16px; 
  transition: transform var(--fast);
  display: inline-block;
}
.setting-row:active .arrow { transform: translateX(3px); }
.sr-value { font-size: 13px; color: var(--t3); font-weight: 500; }

/* Toggle 开关 —— V2: 弹簧动效 */
.toggle { 
  width: 44px; height: 26px; 
  border-radius: 13px; 
  background: var(--border); 
  position: relative; 
  transition: background var(--normal) var(--ease-out);
  flex-shrink: 0;
}
.toggle.on { background: linear-gradient(135deg, var(--blue), #5B93FF); box-shadow: 0 0 8px rgba(51,112,255,.25); }
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: transform var(--normal) var(--ease-spring);
}
.toggle.on::after { transform: translateX(18px); }

/* 退出按钮 —— V2: 渐变危险色 + 普通文档流（页面底部留 TabBar 高度空白，滚动到底仍完整可见） */
.logout-btn {
  display: block; width: calc(100% - 32px); margin: 20px auto 32px;
  padding: 14px; text-align: center; border-radius: var(--radius-md);
  color: var(--red); font-size: 15px; font-weight: 600;
  background: var(--white); border: 1px solid var(--err-bg);
  /* relative 仅用于为 ::before 提供定位上下文（普通文档流，非 sticky/固定定位） */
  position: relative;
  transition: all var(--fast) var(--ease-out);
  overflow: hidden;
}
.logout-btn::before {
  content:''; position: absolute; inset: 0; background: var(--err-bg);
  opacity: 0; transition: opacity var(--fast);
}
.logout-btn:active { 
  background: var(--err-bg); 
  color: #D8362C; 
  border-color: var(--red);
}
.logout-btn:active::before { opacity: 1; }

/* ========== 浮层（角色切换）——V2: 毛玻璃 ========== */
.overlay {
  position: absolute; inset: 0; z-index: 500;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: end; justify-content: center;
  /* V2: 淡入动画 */
  animation: overlayIn var(--fast) var(--ease-out) both;
}
.overlay[hidden] { display: none !important; animation: overlayOut .2s var(--ease-out) forwards; }
@keyframes overlayIn { from{opacity:0} to{opacity:1} }
@keyframes overlayOut { from{opacity:1} to{opacity:0} }

.sheet {
  width: 100%; max-width: 430px; max-height: 80vh;
  background: var(--white); border-radius: 20px 20px 0 0;
  padding: 20px 20px 32px; overflow-y: auto;
  animation: sheetUp .28s ease;
  box-shadow: 0 -8px 40px rgba(0,0,0,.15);
}
@keyframes sheetUp { from{transform:translateY(100%)} to{transform:none} }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sheet-head h3 { font-size: 18px; font-weight: 700; font-family: var(--font-display); }
.sheet-sub { font-size: 13px; color: var(--t3); margin-bottom: 16px; line-height: 1.5; }
.role-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; max-height: 240px; overflow-y: auto; }
.role-card-s {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: var(--radius-md); border: 1.5px solid transparent;
  transition: all var(--fast) var(--ease-out);
  cursor: pointer;
}
.role-card-s.is-active { 
  background: #EEF2FF; 
  border-color: var(--blue); 
  box-shadow: 0 2px 8px rgba(51,112,255,.12);
}
.role-card-s.is-active .rcs-avatar { box-shadow: 0 2px 8px rgba(51,112,255,.3); }
.rcs-avatar { 
  width: 38px; height: 38px; 
  border-radius: 10px; 
  display: flex; align-items: center; justify-content: center; 
  color: #fff; font-size: 14px; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  transition: box-shadow var(--fast);
}
.rcs-name { font-size: 14px; font-weight: 600; }
.rcs-focus { font-size: 12px; color: var(--t3); }

.role-detail { border-top: 1px solid var(--border); padding-top: 16px; }
.rd-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rd-avatar { 
  width: 42px; height: 42px; 
  border-radius: 12px; 
  display: flex; align-items: center; justify-content: center; 
  color: #fff; font-size: 16px; font-weight: 700; 
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.rd-formula { 
  background: #F7F8FA; 
  border-radius: var(--radius-md); 
  padding: 12px 14px; 
  font-size: 12px; 
  line-height: 1.65; 
  color: var(--t2); 
  margin-top: 12px; 
  font-family: var(--font-mono); 
  word-break: break-all;
  border-left: 3px solid var(--blue);
}
.rd-formula .hl { color: var(--blue); font-weight: 600; background: #EBF2FF; padding: 1px 4px; border-radius: 3px; }
.cm { color: var(--t3); }

/* 新增角色浮层 */
.sh-actions { display: flex; align-items: center; gap: 8px; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--blue); background: #fff; color: var(--blue);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--fast);
}
.btn-ghost:active { background: #EEF2FF; }
.ic-plus::before { content: "+"; font-size: 16px; line-height: 1; font-weight: 700; }
.form-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 6px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span { font-size: 13px; color: var(--t2); font-weight: 500; }
.fld > span i { color: var(--red); font-style: normal; }
.fld input, .fld textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  font-size: 14px; color: var(--t1); background: var(--bg);
  outline: none; transition: all var(--fast) var(--ease-out);
  font-family: var(--font-body);
  resize: none;
}
.fld input:focus, .fld textarea:focus { 
  border-color: var(--blue); 
  box-shadow: 0 0 0 3px rgba(51,112,255,.08);
  background: #fff;
}
.sheet-foot { display: flex; gap: 12px; margin-top: 18px; }
.btn-primary {
  flex: 1; padding: 12px; border: none; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue), #5B93FF); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 8px rgba(51,112,255,.3);
  transition: all var(--fast);
}
.btn-primary:active { opacity: .85; transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* ========== Toast —— V2: 滑入+摇晃 ========== */
.toast-wrap { 
  position: absolute; 
  top: calc(var(--statusbar-h) + var(--topbar-h) + 8px); 
  left: 50%; 
  transform: translateX(-50%); 
  z-index: 999; 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  pointer-events: none;
}
.toast {
  padding: 10px 20px; border-radius: var(--radius-pill);
  background: rgba(29,33,41,.92); color: #fff; font-size: 13px;
  backdrop-filter: blur(8px); box-shadow: 0 4px 16px rgba(0,0,0,.18);
  animation: toastSlideIn .25s var(--ease-out) both, toastShake 3s ease-in-out 2.5s;
  white-space: nowrap;
}
.toast.warn { background: rgba(245,74,69,.92); }
@keyframes toastSlideIn { from{opacity:0;transform:translateY(-8px) scaleX(.96)} to{opacity:1;transform:none} }
@keyframes toastShake { 0%,90%,100%{transform:translateX(0)} 92%,96%{transform:translateX(-3px)} 94%{transform:translateX(3px)} }

/* ========== Loading —— V2: 骨架屏 ========== */
.loading {
  position: absolute; inset: 0; z-index: 800;
  background: rgba(242,243,245,.94); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px;
}
.loading[hidden] { display: none !important; }
.loading-inner { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 12px;
}
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--blue); border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to{transform:rotate(360deg)} }
.loading-inner span { 
  font-size: 13px; 
  color: var(--t3); 
  font-weight: 500;
  letter-spacing: .3px;
}

/* ========== 图标字体（内联 SVG） ========== */
.ic { display: inline-block; width: 1em; height: 1em; vertical-align: -.125em; background-repeat: no-repeat; background-position: center; background-size: contain; }
.ic-home::before { content:"🏠" }
.ic-grid::before { content:"⊞" }
.ic-loop::before { content:"🔄" }
.ic-shield::before { content:"🛡️" }
.ic-bell::before { content:"🔔" }
.ic-plus::before { content:"+" }
.ic-close::before { content:"✕" }
.ic-check::before { content:"✓" }
.ic-warn::before { content:"⚠" }
.ic-bolt::before { content:"⚡" }
.ic-role::before { content:"👤" }
.ic-drill::before { content:"↓" }

/* ========== 工具类 ========== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 4px; }
.mb-8 { margin-bottom: 8px; }
.empty-state { 
  text-align: center; 
  padding: 40px 16px; 
  color: var(--t3); 
  font-size: 14px;
}
.empty-state strong { 
  display: block; 
  font-size: 16px; 
  color: var(--t2); 
  margin-bottom: 4px;
  font-weight: 600;
}
.empty-state p { color: var(--t4); margin-top: 4px; }

/* Sub-page 返回导航 */
.sub-nav {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 0 16px; margin-bottom: 4px;
}
.sub-back { 
  font-size: 14px; 
  color: var(--blue); 
  display: flex; 
  align-items: center; 
  gap: 4px; 
  font-weight: 600;
  transition: all var(--fast);
}
.sub-back:active { color: var(--blue-active); transform: translateX(-2px); }
.sub-back svg { width: 18px; height: 18px; }
.sub-nav h2 { 
  font-size: 18px; 
  font-weight: 700; 
  font-family: var(--font-display);
  letter-spacing: -.2px;
}

/* ========== 全局减少动效偏好 ========== */
@media(prefers-reduced-motion:reduce){
  *, *::before, *::after{
    animation-duration:.001ms!important;
    transition-duration:.001ms!important;
  }
}

/* =========================================================
   V2 · 歌尔股份品牌植入（移动端）
   ========================================================= */
.brand-watermark{
  display:flex; align-items:center; gap:10px;
  margin:0 16px 14px; padding:10px 14px;
  background:linear-gradient(135deg,#FFFFFF 0%,#EEF3FF 100%);
  border:1px solid rgba(51,112,255,.14);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-card);
  position:relative; overflow:hidden;
  animation:cardSlideIn var(--normal) var(--ease-out) both;
}
.brand-watermark::after{
  content:''; position:absolute; right:-18px; top:-18px;
  width:70px; height:70px; border-radius:50%;
  background:radial-gradient(circle, rgba(51,112,255,.10), transparent 70%);
  pointer-events:none;
}
.brand-watermark .bw-logo{ height:24px; width:auto; flex:0 0 auto; position:relative; z-index:1; }
.brand-watermark .bw-text{ font-size:11px; color:var(--t3); line-height:1.45; position:relative; z-index:1; }
.brand-watermark .bw-text b{ color:var(--blue); font-weight:700; }

/* =========================================================
   ChatBI 对话弹窗（底部滑出 Sheet）
   —— 覆盖层从底部滑出，主页保持干净；弹窗内自由触摸滚动
   ========================================================= */
.chat-sheet {
  position: absolute; inset: 0; z-index: 600;
  pointer-events: none;            /* 默认不拦截主页交互 */
}
.chat-sheet.is-open { pointer-events: auto; }       /* 打开后恢复交互 */

/* 蒙层：半透明 + 毛玻璃 + 淡入 */
.chat-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  opacity: 0; transition: opacity .35s var(--ease-out);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.chat-sheet.is-open .chat-sheet-backdrop { opacity: 1; }

/* 面板：从底部滑出，圆角白卡 */
.chat-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  /* 顶部留出状态栏+顶栏高度，让主页标题栏仍可见（半屏对话框效果） */
  top: calc(var(--statusbar-h) + var(--topbar-h) + 10px);
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 30px rgba(0,0,0,.15);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: translateY(110%);
  transition: transform .35s var(--ease-out);
}
.chat-sheet.is-open .chat-sheet-panel { transform: translateY(0); }

/* 拖拽指示条 */
.chat-sheet-handle {
  width: 36px; height: 5px; border-radius: 3px;
  background: var(--gray); opacity: .5;
  margin: 8px auto 4px; flex-shrink: 0;
}

/* 头部 */
.chat-sheet-header {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 10px 10px;
  background: var(--white);
  border-bottom: .5px solid var(--border);
  flex-shrink: 0;
}
.chat-sheet-avatar { flex-shrink: 0; display: flex; align-items: center; }
.chat-sheet-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-sheet-title strong { font-size: 15px; font-weight: 700; line-height: 1.3; }
.chat-sheet-status { font-size: 12px; color: var(--t3); }
.chat-sheet-close {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--t2); background: var(--bg);
  transition: background var(--fast);
}
.chat-sheet-close:active { background: #e6e8eb; }

/* 对话区：自由触摸滚动 */
.chat-sheet-body {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; touch-action: pan-y;
  padding: 12px 10px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}

/* 输入区（固定在面板底部） */
.chat-sheet-input {
  flex-shrink: 0; padding: 6px 10px 10px;
  background: var(--white);
  border-top: .5px solid var(--border);
  /* 预留底部 Home Indicator 高度，避免输入框被遮挡 */
  padding-bottom: calc(12px + var(--home-ind));
}

/* ===== 主页 AI 入口卡片（可点击进入对话） ===== */
.sec-chat { cursor: pointer; transition: box-shadow var(--fast) var(--ease-out); }
.sec-chat:active { box-shadow: var(--shadow-elevated); }
.chat-entry-hint {
  margin-top: 14px; display: flex; align-items: center; gap: 8px;
  justify-content: center;
  padding: 10px; border-radius: var(--radius-md);
  background: var(--blue-soft); color: var(--blue);
  font-size: 13px; font-weight: 600;
}
.chat-entry-hint .ce-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--blue);
  box-shadow: 0 0 0 0 rgba(51,112,255,.4);
  animation: cePulse 1.8s ease-in-out infinite;
}
@keyframes cePulse {
  0%,100%{ box-shadow: 0 0 0 0 rgba(51,112,255,.4); }
  50%{ box-shadow: 0 0 0 6px rgba(51,112,255,0); }
}

/* =========================================================
   移动端 Landing 宣传页 + 精化微交互（与网页端同源设计语言）
   ========================================================= */
.m-landing {
  position: absolute; inset: 0; z-index: 1001;
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 80% at 50% -10%, #EAF1FF 0%, #F5F8FF 38%, #FFFFFF 100%);
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  transition: opacity var(--normal) var(--ease-out), transform var(--normal) var(--ease-out);
}
.m-landing.is-out { opacity: 0; transform: translateY(-14px) scale(.985); pointer-events: none; }

.ml-glow {
  position: absolute; top: -120px; left: 50%; transform: translateX(-50%);
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(51,112,255,.22), rgba(51,112,255,0) 68%);
  pointer-events: none; filter: blur(6px);
}
.ml-inner {
  position: relative; z-index: 1;
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--statusbar-h) + 22px) 24px 28px;
  gap: 18px; text-align: center;
}

/* 品牌行 */
.ml-brand { display: inline-flex; align-items: center; gap: 7px; opacity: 0; animation: mlUp .5s var(--ease-out) .02s both; }
.ml-logo { display: inline-flex; }
.ml-brand-name { font-size: 15px; font-weight: 700; color: var(--t1); letter-spacing: .3px; }

/* 主标题区 */
.ml-hero { opacity: 0; animation: mlUp .56s var(--ease-out) .08s both; }
.ml-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: 32px; line-height: 1.22; letter-spacing: -.5px; color: var(--t1);
  background: linear-gradient(100deg, #1C46A6 0%, #3370FF 52%, #5B8CFF 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ml-dot { -webkit-text-fill-color: var(--blue); color: var(--blue); }
.ml-sub { margin-top: 10px; font-size: 14px; color: var(--t2); font-weight: 500; }
.ml-points { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ml-point {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: var(--radius-pill);
  background: var(--white); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--t2);
  box-shadow: var(--shadow-card);
}
.ml-pdot { width: 6px; height: 6px; border-radius: 50%; background: linear-gradient(135deg,#3370FF,#5B8CFF); }

/* 仪表盘 mockup */
.ml-mock { width: 100%; max-width: 320px; opacity: 0; animation: mlRise .62s var(--ease-out) .16s both; }
.ml-mock-win {
  background: #0F1B33; border-radius: var(--radius-lg);
  padding: 12px; box-shadow: var(--shadow-modal);
  border: 1px solid rgba(255,255,255,.06);
}
.ml-mock-bar { display: flex; gap: 6px; margin-bottom: 12px; }
.ml-mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.18); }
.ml-mock-bar i:first-child { background: #FF5F57; }
.ml-mock-bar i:nth-child(2) { background: #FEBC2E; }
.ml-mock-bar i:nth-child(3) { background: #28C840; }
.ml-mock-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 12px; }
.ml-kpi {
  background: rgba(255,255,255,.06); border-radius: 10px; padding: 8px 4px;
  display: flex; flex-direction: column; gap: 2px; text-align: left;
}
.ml-kpi span { font-size: 10px; color: rgba(255,255,255,.55); }
.ml-kpi b { font-size: 14px; font-weight: 700; color: #fff; font-family: var(--font-display); }
.ml-kpi b.up { color: #FF8A80; }
.ml-mock-chart { display: flex; align-items: flex-end; gap: 6px; height: 52px; margin-bottom: 12px; }
.ml-mock-chart i { flex: 1; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg,#5B8CFF,#3370FF); opacity: .9; }
.ml-mock-task {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(245,74,69,.14); color: #FFB4B0; font-size: 12px; font-weight: 600;
}
.ml-mock-task .dot { width: 7px; height: 7px; border-radius: 50%; background: #F54A45; box-shadow: 0 0 0 3px rgba(245,74,69,.25); }

/* 搜索（ChatBI 入口） */
.ml-search {
  width: 100%; max-width: 320px; display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border-radius: var(--radius-pill);
  background: var(--white); border: 1px solid var(--border);
  box-shadow: var(--shadow-card); opacity: 0; animation: mlUp .56s var(--ease-out) .24s both;
}
.ml-search-ic { font-size: 14px; opacity: .7; }
.ml-search input { flex: 1; border: none; outline: none; font-size: 14px; color: var(--t1); background: transparent; }
.ml-search input::placeholder { color: var(--t4); }
.ml-search-go {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg,#3370FF,#5B8CFF); color: #fff;
  font-size: 14px; font-weight: 700; box-shadow: var(--shadow-glow-blue);
  transition: transform var(--fast) var(--ease-spring);
}
.ml-search-go:active { transform: scale(.9); }

/* CTA */
.ml-cta { width: 100%; max-width: 320px; display: flex; gap: 10px; opacity: 0; animation: mlUp .56s var(--ease-out) .3s both; }
.ml-btn {
  flex: 1; height: 48px; border-radius: var(--radius-md); font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform var(--fast) var(--ease-spring), box-shadow var(--fast) var(--ease-out), background var(--fast);
}
.ml-btn:active { transform: scale(.97); }
.ml-btn-primary { background: linear-gradient(135deg,#3370FF,#245BDB); color: #fff; box-shadow: var(--shadow-glow-blue); }
.ml-btn-primary:active { box-shadow: 0 0 26px rgba(51,112,255,.4); }
.ml-btn-ghost { background: var(--white); color: var(--blue); border: 1px solid var(--blue-soft); }

/* 底部光带 */
.ml-band {
  position: absolute; left: 0; right: 0; bottom: 0; height: 120px; pointer-events: none;
  background: linear-gradient(180deg, rgba(51,112,255,0) 0%, rgba(51,112,255,.07) 60%, rgba(51,112,255,.12) 100%);
}

/* 返回首页按钮（进入后显示） */
.ml-home-btn { color: var(--blue); }

/* 涟漪微交互（Landing CTA / 搜索按钮） */
.ml-btn, .ml-search-go { position: relative; overflow: hidden; }
.rp { position: absolute; border-radius: 50%; background: rgba(51,112,255,.28); transform: translate(-50%,-50%) scale(0); animation: rp .6s var(--ease-out) forwards; pointer-events: none; }
@keyframes rp { to { transform: translate(-50%,-50%) scale(1); opacity: 0; } }
@keyframes mlUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mlRise { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .m-landing, .ml-brand, .ml-hero, .ml-mock, .ml-search, .ml-cta, .rp { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
}
