/* ============================================================
   desktop.z02.css — 桌面端视觉精修
   z01 负责「把 560 的手机壳铺开」（宽度 / 列数 / 两栏字段），
   这一版负责「铺开之后好看」：卡片改横排、导航改 dock、补 hover。
   策略：全部规则只在 ≥900px 生效，移动端零改动。
   用法：ssmtj.html 中紧跟 desktop.z01.css 之后引入。
   ============================================================ */

@media (min-width: 900px) {

  /* ---------- 1. 首页卡片：竖排堆叠 → 横排（图标左、文字右） ----------
     原因：4 列时每张卡 306px 宽，竖排内容只占左边 150px，右边全空。 */
  .card-btn {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    align-items: center;
    column-gap: 14px;
    row-gap: 5px;
    min-height: 96px;
    padding: 20px 40px 20px 20px; /* 右边留出 › 的位置 */
    transition: transform .14s ease, box-shadow .14s ease;
  }
  .card-btn .emoji {
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    font-size: 27px;
    line-height: 1;
    border-radius: 14px;
    background: #f2f7fc;
  }
  .card-btn .t {
    grid-column: 2;
    font-size: calc(15.5px * var(--fs, 1));
  }
  .card-btn .d {
    grid-column: 2;
    font-size: calc(12.5px * var(--fs, 1));
  }
  /* 右侧箭头：有鼠标的端才有「可点」暗示 */
  .card-btn::after {
    content: '›';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    line-height: 1;
    color: #c8d3e0;
    pointer-events: none;
    transition: color .14s ease;
  }
  .card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(15, 35, 60, .13);
  }
  .card-btn:hover::after { color: #1a86d8; }
  .card-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(15, 35, 60, .08);
  }

  /* ---------- 2. 底部导航：1318 通栏 → 居中悬浮胶囊 dock ---------- */
  .tabbar {
    flex: 0 0 auto;
    align-self: center;
    width: auto;
    height: auto;
    margin: 0 auto 14px;
    padding: 6px;
    gap: 2px;
    border: 1px solid rgba(15, 35, 60, .08);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 28px rgba(15, 35, 60, .13);
  }
  .tabbar .tab {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 6px;
    padding: 9px 15px;
    border-radius: 999px;
    font-size: calc(13px * var(--fs, 1));
    transition: background .14s ease, color .14s ease;
  }
  .tabbar .tab .tab-ico {
    font-size: 16px;
    line-height: 1;
  }
  .tabbar .tab:hover { background: #f0f6fc; }
  .tabbar .tab.active { background: #e6f2ff; }

  /* ---------- 3. 顶栏：加高 + 按钮 hover ---------- */
  .topbar { height: 60px; }
  .topbar-home,
  .topbar-back,
  .topbar-tool,
  .topbar-right {
    border-radius: 10px;
    transition: background .14s ease;
  }
  .topbar-home:hover,
  .topbar-back:hover,
  .topbar-tool:hover,
  .topbar-right:hover {
    background: rgba(255, 255, 255, .18);
  }

  /* ---------- 4. 状态条：加高、字号跟上 ---------- */
  .lic-bar {
    height: 42px;
    font-size: calc(13.5px * var(--fs, 1));
    border-radius: 12px;
  }

  /* ---------- 5. 列表行：hover 给一点反馈 ---------- */
  .item { transition: background .12s ease; }
  .item:hover { background: #f7fafd; }
  /* 箭头压到最右 1266px 太远，调浅调小一点不那么抢眼 */
  .item .arrow {
    font-size: 19px;
    color: #c8d3e0;
    transition: color .12s ease, transform .12s ease;
  }
  .item:hover .arrow {
    color: #1a86d8;
    transform: translateX(2px);
  }

  /* 计算器卡片：补 hover（原来只有点击态） */
  .calc-card {
    transition: transform .14s ease, box-shadow .14s ease;
  }
  .calc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 35, 60, .12);
  }
  .calc-card:active { transform: translateY(0); }

  /* ---------- 6. 滚动条：细、圆、低干扰 ---------- */
  #view::-webkit-scrollbar { width: 12px; }
  #view::-webkit-scrollbar-track { background: transparent; }
  #view::-webkit-scrollbar-thumb {
    background: rgba(15, 35, 60, .16);
    border: 3px solid transparent;
    border-radius: 8px;
    background-clip: content-box;
  }
  #view::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 35, 60, .28);
    background-clip: content-box;
  }

  /* ---------- 7. 授权弹窗：420 → 480，宽屏下读起来不局促 ---------- */
  #mgModal > div {
    max-width: 480px !important;
    padding: 24px 22px 20px !important;
  }
}

/* ---------- 宽屏（≥1400）：列表两列，计算器四列 ----------
   原因：药品列表一项只有「名称 + 分类」，一行拉 1266px 中间空 1000px；
   两列后一屏多看一倍，和首页 4 列密度也对得上。 */
@media (min-width: 1400px) {
  .list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    align-items: stretch;
  }
  .calc-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- 暗色模式配套（新加的浅色底都要跟着变） ---------- */
@media (min-width: 900px) {
  html[data-theme="dark"] .card-btn .emoji {
    background: rgba(255, 255, 255, .07);
  }
  html[data-theme="dark"] .card-btn::after {
    color: rgba(255, 255, 255, .26);
  }
  html[data-theme="dark"] .card-btn:hover::after {
    color: #6cb6f0;
  }
  html[data-theme="dark"] .card-btn:hover {
    box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
  }
  html[data-theme="dark"] .tabbar {
    background: rgba(24, 30, 40, .94);
    border-color: rgba(255, 255, 255, .08);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  }
  html[data-theme="dark"] .tabbar .tab:hover {
    background: rgba(255, 255, 255, .07);
  }
  html[data-theme="dark"] .tabbar .tab.active {
    background: rgba(26, 134, 216, .24);
  }
  html[data-theme="dark"] .item:hover {
    background: rgba(255, 255, 255, .04);
  }
  html[data-theme="dark"] #view::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .18);
    background-clip: content-box;
  }
  html[data-theme="dark"] #view::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .3);
    background-clip: content-box;
  }
  html[data-theme="dark"] .item:hover .arrow { color: #6cb6f0; }
  html[data-theme="dark"] .calc-card:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
  }
}
