/* ============================================================================
   mobile-vi.css · index.html 手机端 VI 深度优化层
   ----------------------------------------------------------------------------
   定位：只服务 ≤768px 的移动端视觉精修，桌面端零影响。
   原则：
   · 全部规则包在媒体查询里，删除 index.html 中本文件的 <link> 即整体回滚；
   · 排在所有样式表之后加载（head 最后一行），同权重下天然胜出；
   · 颜色沿用全站令牌（品牌蓝 #2563eb / 浅蓝底 #eff6ff / 线 #e5e7eb）。
   优化点：
   A 画布与卡片 —— 页面留白节奏、卡片圆角 14 + 双层柔和阴影
   B 顶栏两行式 —— 品牌与用户区同行、导航胶囊独立成行（display:contents 重排）
   C 行情空态条 —— 居中、弱化
   D 图表头 —— 标题蓝色饰条 + 周期分段控件满宽等分、触控 32px+
   E 空状态 hero —— 图标蓝砖、标题/提示层级、搜索框 46px 圆角、热股胶囊
   F 缠论结构明细条 —— 高度、字重、折叠按钮
   ========================================================================== */

@media (max-width: 768px) {

  /* ---- A 画布与卡片 ------------------------------------------------------ */
  .main{
    padding: 10px 10px calc(16px + env(safe-area-inset-bottom));
    gap: 10px;
  }
  .chart-card{
    border-radius: 14px;
    border-color: #eef0f4;
    box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 18px rgba(15,23,42,.05);
  }
  .bottom-panel{
    border-radius: 14px;
    border-color: #eef0f4;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    overflow: hidden;
  }

  /* ---- B 顶栏两行式 ------------------------------------------------------
     .appbar-left / .appbar-right 在窄屏放弃盒子（display:contents），
     让「品牌」与「用户区」同排第一行，「导航胶囊」独占第二行。 */
  .appbar{
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 8px;
    border-bottom-color: #eef0f4;
    box-shadow: 0 1px 2px rgba(15,23,42,.03), 0 6px 16px rgba(15,23,42,.05);
  }
  .appbar-left,
  .appbar-right{ display: contents; }
  .appbar-brand{ order: 1; gap: 8px; }
  .appbar-logo{ width: 30px; height: 30px; flex: 0 0 30px; }
  .appbar-title{ font-size: 16px; }
  .user-area{ order: 2; margin-left: 0; gap: 6px; }
  .appbar-nav{
    order: 3;
    flex: 1 1 100%;
    gap: 6px;
    padding-bottom: 0;
    scrollbar-width: none;
  }
  .appbar-nav::-webkit-scrollbar{ display: none; }
  .appbar-navitem{
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e5e7eb;
    font-size: 13px;
    color: #4b5563;
  }
  .appbar-navitem.active{
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
    font-weight: 600;
  }
  .user-btn{
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eff6ff;
    border: none;
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
  }
  .logout-link{ font-size: 13px; color: #9ca3af; height: 32px; }

  /* ---- C 行情空态条 ------------------------------------------------------ */
  .stockhead-empty{ justify-content: center; gap: 8px; font-size: 12.5px; color: #9ca3af; }
  .she-dot{ width: 6px; height: 6px; }

  /* ---- D 图表头 + 周期分段控件 ------------------------------------------- */
  .chart-head{
    height: auto;
    flex-wrap: wrap;
    padding: 12px 12px 10px;
    gap: 10px;
  }
  .chart-title{
    flex: 1 1 auto;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .chart-title::before{
    content: '';
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
  }
  .period-group{
    flex: 1 1 100%;
    padding: 3px;
    gap: 2px;
    background: #f3f4f6;
    border: none;
    border-radius: 10px;
  }
  .period-btn{ flex: 1; height: 32px; font-size: 13px; border-radius: 8px; }
  .period-btn.active{ background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.12); }

  /* ---- E 空状态 hero ------------------------------------------------------ */
  .empty-state{ gap: 12px; padding: 28px 20px 24px; }
  .empty-state .icon{
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-radius: 20px;
    box-shadow: inset 0 0 0 1px rgba(37,99,235,.10);
  }
  .empty-state .icon svg{ width: 34px; height: 34px; }
  .empty-state .icon svg rect{ display: none; }
  .empty-state .icon svg path{ stroke: #3b82f6; stroke-width: 2.4; }
  .empty-state .text{ font-size: 17px; font-weight: 600; color: #111827; letter-spacing: .2px; }
  .empty-state .hint{ font-size: 13px; color: #9ca3af; margin-top: -6px; }
  .empty-search{ gap: 8px; margin-top: 10px; }
  .empty-search-input{
    height: 46px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 0 14px;
  }
  .empty-search-input:focus{
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  }
  .empty-search-btn{
    height: 46px;
    border-radius: 12px;
    padding: 0 22px;
    font-size: 15px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 12px rgba(37,99,235,.25);
  }
  .empty-search-btn:active{ transform: scale(.97); }
  .empty-tags{ flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
  .empty-tag{
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e5e7eb;
    font-size: 13px;
    color: #4b5563;
  }
  .empty-tag:active{ background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }

  /* ---- F 缠论结构明细条 ---------------------------------------------------- */
  .bottom-panel-head{ height: 48px; padding: 0 16px; }
  .bottom-panel-head h4{ font-size: 14px; font-weight: 600; color: #111827; }
  .bottom-toggle-btn{
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f3f4f6;
    border: none;
  }
}


/* ===== 第二轮统一更新（09-16）：顶栏顺序 / 徽标位置 / 自选股面板名称列 ===== */
@media (max-width: 768px) {
  /* 右区散置导航项（如股东导入页的「自选股」）排到品牌之后，不再顶到最左 */
  .appbar-right > .appbar-navitem{ order: 2; }

  /* 缓存耗时徽标（如 0.7s）移到右下角，不再压住第二行导航胶囊 */
  .cache-badge{
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom));
    right: 12px;
    z-index: 900;
  }

  /* 自选股面板手机全屏宽度兜底 */
  .wl-panel{ width: 100%; max-width: 100vw; }

  /* 名称列永不塌缩：保证股票名至少 96px，代码不再溢出叠到价格上 */
  .wl-item-left{ flex: 1 1 auto; min-width: 96px; }
  .wl-item-code{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
