/* ===== 触屏优化 + 水滴下拉刷新 ===== */
html,body{overflow-x:hidden;width:100%;max-width:100vw}
.app{width:100%;max-width:100vw;overflow-x:hidden}
.main{overflow-x:hidden;overscroll-behavior-x:contain;touch-action:pan-y}
@media(hover:none){
  .glass-card:hover,.btn:hover,.date-preset:hover,.stat-card:hover{transform:none!important}
  .stat-card:hover::after{animation:none!important}
}
@media(hover:hover){.glass-card:hover{transform:translateY(-2px)}}

/* ===== 环形进度下拉刷新（圆形不变形） ===== */
.pr-wrap{
  position:fixed;left:0;right:0;top:0;z-index:60;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
  pointer-events:none;opacity:0;
  transition:opacity .18s ease, top .25s cubic-bezier(.34,1.4,.64,1);
}
.pr-ring{
  width:36px;height:36px;position:relative;flex:none;
  filter:drop-shadow(0 3px 8px rgba(99,102,241,.3));
}
.pr-ring svg{width:100%;height:100%;display:block}
.pr-track{stroke:rgba(99,102,241,.16)}
.pr-progress{
  stroke:#6366f1;
  transition:stroke .2s;
}
.pr-arrow{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  color:#6366f1;font-size:17px;font-weight:700;line-height:1;
  transition:color .2s;
}
.pr-label{font-size:12px;color:#6366f1;font-weight:600;text-shadow:0 1px 3px rgba(255,255,255,.9)}

/* 达到阈值：变绿 */
.pr-wrap.ready .pr-progress{stroke:#10b981}
.pr-wrap.ready .pr-arrow{color:#10b981}
.pr-wrap.ready .pr-label{color:#059669}

/* 刷新中：环旋转 */
.pr-wrap.loading .pr-ring{animation:prSpin .9s linear infinite}
.pr-wrap.loading .pr-progress{stroke:#6366f1}
@keyframes prSpin{to{transform:rotate(360deg)}}
/* ===== 手机浏览器适配 ===== */
@media(max-width:768px){
  /* 顶部栏 */
  .topbar{height:52px;font-size:16px;margin-bottom:14px;position:sticky;top:0}
  .page-header{flex-direction:column;align-items:flex-start;gap:10px}
  .page-header h2{font-size:19px}

  /* 卡片间距收紧 */
  .glass-card{padding:14px;border-radius:14px}
  .stats-grid{grid-template-columns:repeat(2,1fr);gap:10px}
  .stat-card{padding:14px 8px}
  .stat-icon{font-size:22px;margin-bottom:5px}
  .stat-value{font-size:19px}
  .stat-label{font-size:11px}

  /* 时间筛选按钮横向滚动，不换行 */
  .date-filter{display:block;overflow-x:auto;white-space:nowrap;-webkit-overflow-scrolling:touch;padding-bottom:4px}
  .date-presets{flex-wrap:nowrap;display:inline-flex}
  .date-preset{padding:6px 11px;font-size:12px;flex:none}

  /* 表格横向滚动 */
  .glass-card:has(.data-table){overflow-x:auto;-webkit-overflow-scrolling:touch}
  .data-table{min-width:600px;font-size:12px}
  .data-table th,.data-table td{padding:9px 10px}

  /* 图表高度自适应 */
  .chart-container{height:220px}

  /* 表单行stack */
  .form-row .input{font-size:16px} /* 防iOS缩放 */
  .modal{padding:18px;width:94vw}

  /* toast */
  .toast-container{top:10px;right:10px;left:10px}
  .toast{min-width:0;font-size:12px}
}

/* 超窄屏 */
@media(max-width:420px){
  .main{padding:0 10px 24px}
  .stats-grid{grid-template-columns:repeat(2,1fr);gap:8px}
  .stat-value{font-size:17px}
  .page-header h2{font-size:17px}
}
