:root { --card-radius: 1rem; }
[v-cloak] { display: none; }

/* 卡通化的细节 */
.card { border-radius: 1rem; }
.card-title { font-weight: 700; }
.stat-value { letter-spacing: -0.02em; }
.table-sm td, .table-sm th { padding: 0.5rem 0.6rem; }
.badge { font-weight: 600; }

/* 卡片轻微上浮 */
.card:hover { transform: translateY(-1px); transition: transform .15s ease; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d6d6e0; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ECharts 容器 */
[w-ref], canvas { border-radius: 0.5rem; }

/* 数字等宽 */
.font-mono { font-variant-numeric: tabular-nums; }

/* toast 固定在右下 */
.toast { z-index: 90; }

/* 表格横向滚动容器：避免表格把整页撑宽 */
.overflow-x-auto { max-width: 100%; overflow-x: auto; }
.card, .card-body, .grid > * { min-width: 0; }
body { overflow-x: hidden; }

/* ---------------- 手机适配 ---------------- */
html { -webkit-text-size-adjust: 100%; }

@media (max-width: 768px) {
  /* 顶栏：别挤成一排 */
  .navbar { padding: .35rem .5rem; min-height: 0; }
  .navbar .text-lg { font-size: .95rem; }

  /* 标签栏：横滑，不换行 */
  .tabs-boxed { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs-boxed::-webkit-scrollbar { display: none; }
  .tabs-boxed .tab { white-space: nowrap; flex: 0 0 auto; font-size: .78rem;
                     padding: .45rem .6rem; min-height: 0; height: auto; }

  /* 卡片与间距 */
  .card-body { padding: .7rem !important; }
  .card-title { font-size: .82rem; }
  .p-4 { padding: .6rem !important; }
  .space-y-3 > * + *, .space-y-4 > * + * { margin-top: .6rem !important; }
  .gap-3, .gap-4 { gap: .5rem !important; }

  /* 数字块 */
  .stat-value { font-size: 1.05rem !important; line-height: 1.25; }
  .stat-title { font-size: .6rem !important; }
  .stat-desc { font-size: .6rem !important; }
  .stat { padding: .45rem .5rem !important; }

  /* 表格：字号压小，允许横滑 */
  table { font-size: .72rem; }
  .table-sm td, .table-sm th, .table-xs td, .table-xs th {
    padding: .35rem .35rem; white-space: nowrap;
  }
  .overflow-x-auto { -webkit-overflow-scrolling: touch; }

  /* 触摸目标放大 */
  .btn-xs { height: 1.9rem; min-height: 1.9rem; padding: .3rem .55rem; font-size: .72rem; }
  .input-xs, .select-xs { height: 2rem; font-size: .8rem; }
  .input-sm, .select-sm { height: 2.2rem; font-size: .82rem; }
  .toggle-xs { width: 2.1rem; height: 1.15rem; }

  /* 图表高度收一点 */
  [style*="height:420px"], [style*="height: 420px"] { height: 260px !important; }
  .h-56 { height: 170px !important; }

  /* 徽章不换行 */
  .badge { white-space: nowrap; }
}

/* 超窄屏 */
@media (max-width: 420px) {
  table { font-size: .68rem; }
  .navbar .badge-lg { font-size: .7rem; padding: .2rem .4rem; }
  .dir-big { font-size: 1.6rem; }
}
