/* ============================================================
 * responsive.css
 * 三个断点的所有媒体查询集中维护：
 *   - max-width: 1024px  (平板)
 *   - max-width: 768px   (大屏手机)
 *   - max-width: 480px   (小屏手机)
 * 任何与响应式相关的样式都收在这里，避免散落在多个文件
 * ============================================================ */

@media (max-width: 1024px) {
    .app {
        grid-template-columns: 1fr;
        grid-template-rows: 56px 1fr;
        grid-template-areas: "header" "main";
    }
    .sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 95;
        transform: translateX(-100%);
        transition: transform 0.25s;
    }
    .sidebar.open { transform: translateX(0); }
    .mobile-menu-btn { display: flex; }
    .server-bar { margin: 0 8px; }
    .two-col { grid-template-columns: 1fr; }
    .main { padding: 16px; padding-bottom: 80px; }
}

@media (max-width: 768px) {
    .header { padding: 0 12px; }
    .logo span { display: none; }
    .server-info { display: none; }
    .server-pill { padding: 0 10px 0 8px; }
    .server-pill-name { max-width: 90px; }
    .mobile-tabbar { display: flex; }
    .panel-header { padding: 10px 12px; }
    .panel-body { padding: 12px; }
    .kpi-row { grid-template-columns: 1fr 1fr; }
    .category-grid { grid-template-columns: 1fr; }
    .main { padding: 12px; padding-bottom: 80px; }
    .timer-text { font-size: 32px; }
    .records-table { font-size: 11px; }
    .records-table th:nth-child(2),
    .records-table td:nth-child(2) { display: none; }
    .panel-subtitle { display: none; }
    .favorites-scroller { grid-auto-columns: 140px; gap: 8px; padding: 10px; }
    .fav-card { padding: 8px 8px 6px; gap: 4px; }
    .fav-card-icon { width: 24px; height: 24px; font-size: 12px; }
    .fav-card-name { font-size: 11px; }
    .fav-card-price { font-size: 14px; }
    .fav-card-add { height: 24px; font-size: 10px; }
}

@media (max-width: 480px) {
    .header { padding: 0 8px; }
    .logo-icon { width: 32px; height: 32px; font-size: 14px; }
    .icon-btn { width: 36px; height: 36px; }
    .server-pill { height: 30px; font-size: 12px; }
    .kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; }
    .kpi-card { padding: 10px 12px; }
    .kpi-value { font-size: 18px; }
    .kpi-value.long { font-size: 14px; }
    .kpi-trend { font-size: 10px; }
    .category-card { padding: 10px; }
    .item-row { padding: 10px 8px; min-height: 40px; }
    .input-row { grid-template-columns: 1fr; }
    .backup-notice { font-size: 11px; padding: 8px 10px; }
    .panel-title { font-size: 13px; }
    .records-table th, .records-table td { padding: 6px 4px; }
    .qty-btn { width: 32px; height: 32px; }
    .qty-value { height: 32px; width: 44px; }
    .btn { height: 36px; padding: 0 12px; }
    .fav-card-icon { width: 22px; height: 22px; font-size: 11px; }
    .fav-card-price { font-size: 13px; }
    .timer-text { font-size: 36px; }
    .tabbar-item { font-size: 10px; min-height: 50px; }
    .tabbar-icon { font-size: 20px; }

    /* 480 断点补充：模态/卡片密度提升 */
    .modal { max-width: 100%; max-height: 95vh; }
    .item-tile-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
    .toast-container { top: 60px; }
    .item-card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
    .item-card .item-card-icon { width: 40px; height: 40px; font-size: 20px; }
    .item-card-name { font-size: 12px; }
    .item-card-price-main { font-size: 15px; }
    .item-card-meta { font-size: 10px; }
    .item-card-actions { flex-direction: column; }
    .item-card-actions .btn { width: 100%; }
    .item-card-add { padding: 6px 8px; font-size: 11px; }
    .item-card-edit { padding: 4px 6px; font-size: 10px; }
    .category-summary { grid-template-columns: 1fr 1fr; gap: 8px; }
    .category-summary .kpi-card { padding: 10px 12px; }
    .category-summary .kpi-value { font-size: 16px; }
}
