/* 手机端界面：沿用桌面端深蓝导航、白色卡片和亮蓝主操作色。 */
.mobile-menu-toggle,.mobile-bottom-nav,.mobile-nav-backdrop{display:none}
@media (max-width: 767px){
  html,body{width:100%;height:100%;overflow:hidden;background:var(--bg)}
  .app.active{height:100dvh;min-height:100dvh;width:100%;overflow:hidden}
  .sidebar{position:fixed!important;z-index:1300;inset:0 auto 0 0;width:min(82vw,292px)!important;height:100dvh;transform:translateX(-105%);transition:transform .24s ease;box-shadow:0 0 0 rgba(0,21,41,0);padding-bottom:env(safe-area-inset-bottom)!important}
  .sidebar.mobile-open{transform:translateX(0);box-shadow:14px 0 34px rgba(0,21,41,.28)}
  .sidebar .logo{height:68px;padding:0 18px!important;gap:12px!important}
  .sidebar .logo p,.sidebar .footer{display:block!important}
  .sidebar .logo h2{font-size:17px!important}.sidebar .logo p{font-size:11px!important}
  .sidebar nav{padding:8px 0 18px!important}.nav-section-title{padding:15px 18px 7px!important}.nav-item{height:46px!important;padding:0 18px!important;font-size:15px!important;gap:12px!important}.nav-item span:not(.icon){display:inline!important}.nav-item .icon{width:20px!important;height:20px!important}
  .mobile-nav-backdrop{display:block;position:fixed;z-index:1250;inset:0;background:rgba(0,21,41,.42);opacity:0;pointer-events:none;transition:opacity .22s ease}.mobile-nav-backdrop.show{opacity:1;pointer-events:auto}
  .main{width:100%;min-width:0;overflow:hidden}.header{height:60px!important;min-height:60px!important;padding:0 14px!important;gap:8px;position:relative;z-index:3}.mobile-header-title{display:flex;align-items:center;gap:8px;min-width:0}.header h1{font-size:17px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-menu-toggle{display:grid;place-items:center;width:36px!important;height:36px!important;min-width:36px;padding:0!important;border:0!important;background:var(--primary-lighter)!important;color:var(--primary)!important;border-radius:10px!important}.mobile-menu-toggle .icon-svg{width:20px;height:20px}.header .actions{margin-left:auto;gap:0!important}.header .actions>button{display:none!important}.header .actions #roleBadge{display:inline-block!important;max-width:74px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0!important;padding:5px 9px!important;font-size:11px!important}
  .content{padding:12px 12px calc(82px + env(safe-area-inset-bottom))!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch;background:var(--bg)}
  .card{border-radius:14px!important;margin-bottom:12px!important}.card-title{padding:13px 14px!important;font-size:15px!important}.card>*:not(.card-title){padding:13px 14px!important}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;margin-bottom:12px!important}.stat-card{min-width:0;padding:14px!important;border-radius:13px!important;display:block!important}.stat-card .label{font-size:12px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.stat-card .value{font-size:22px!important;overflow:hidden;text-overflow:ellipsis}.stat-card .sub{font-size:11px!important}
  .todo-grid{grid-template-columns:1fr!important;gap:10px!important}.todo-card{padding:14px!important;border-radius:12px!important}.quick-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important}.quick-item{min-width:0!important;padding:10px 4px!important}.quick-item span,.quick-item div{font-size:11px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.charts-row,.bottom-row,.grid-2{grid-template-columns:1fr!important;gap:12px!important}
  .table-toolbar{display:grid!important;grid-template-columns:1fr auto;gap:8px!important;align-items:center!important}.table-toolbar input{grid-column:1/-1;width:100%!important;height:40px!important;font-size:14px!important}.table-toolbar select{width:100%!important;min-width:0;height:40px!important}.table-toolbar .spacer{display:none!important}.table-toolbar button{min-height:38px!important;margin:0!important;white-space:nowrap}
  .card{max-width:100%;overflow-x:auto!important;-webkit-overflow-scrolling:touch}.card>table,#content>table{min-width:680px}.card table{min-width:680px}.card table th,.card table td{padding:10px 12px!important;white-space:nowrap}.card table td .btn{margin-bottom:4px}
  .form-row{grid-template-columns:1fr!important;gap:0!important}.form-group{margin-bottom:13px!important}.form-group input,.form-group select,.form-group textarea{min-height:42px!important;font-size:16px!important}.form-group textarea{min-height:96px!important}.modal-overlay{padding:12px;align-items:flex-end!important}.modal{width:100%!important;max-width:100%!important;max-height:88dvh!important;border-radius:18px 18px 12px 12px!important;padding:18px 16px calc(18px + env(safe-area-inset-bottom))!important}.modal h3{font-size:18px!important;margin-bottom:15px!important}.modal-actions{position:sticky;bottom:-18px;background:#fff;padding:14px 0 0;margin-top:18px!important;gap:8px!important}.modal-actions button{flex:1;min-height:44px!important;padding:10px!important}.detail-grid{grid-template-columns:1fr!important}.tabs{overflow-x:auto!important;white-space:nowrap;gap:0!important;margin:0 -14px 14px!important;padding:0 10px}.tab{padding:10px 12px!important;font-size:13px!important}
  .toast{top:auto!important;right:12px!important;left:12px!important;bottom:calc(76px + env(safe-area-inset-bottom))!important;text-align:center;padding:12px 16px!important;transform:translateY(150%)!important}.toast.show{transform:translateY(0)!important}
  .mobile-bottom-nav{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;z-index:1200;left:0;right:0;bottom:0;height:68px;padding:6px 8px calc(6px + env(safe-area-inset-bottom));background:rgba(255,255,255,.98);border-top:1px solid var(--border);box-shadow:0 -6px 18px rgba(0,21,41,.08)}.mobile-bottom-nav button{display:grid;justify-items:center;align-content:center;gap:3px;border:0;background:transparent;color:var(--text-3);font-size:10px;min-width:0}.mobile-bottom-nav button .icon-svg{width:20px;height:20px}.mobile-bottom-nav button.active{color:var(--primary);font-weight:600}.mobile-bottom-nav button.active .icon-svg{filter:drop-shadow(0 2px 3px rgba(22,93,255,.2))}
  .pagination{gap:4px!important}.pagination button{min-width:34px;min-height:34px;padding:6px!important}.page-header{gap:10px!important;align-items:flex-start!important;flex-wrap:wrap}.page-header h2{font-size:18px!important}.page-header .actions,.page-header>div:last-child{width:100%!important}.page-header .btn{min-height:38px!important}
}
@media (max-width: 380px){.quick-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}.stats-grid{gap:8px!important}.stat-card{padding:12px!important}.header .actions #roleBadge{display:none!important}}
@media (max-width: 767px){
  table[data-mobile-summary].mobile-summary-source{display:none!important}
  .mobile-summary-list{display:grid;gap:10px;padding:12px 0 2px}
  .mobile-summary-card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:13px;box-shadow:0 2px 8px rgba(0,21,41,.04)}
  .mobile-summary-main{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.mobile-summary-main strong{font-size:15px;color:var(--text-1);line-height:1.4}.mobile-summary-main small{display:block;color:var(--text-2);font-size:12px;line-height:1.5;margin-top:2px}.mobile-summary-amount{font-weight:700;color:var(--primary);font-size:15px;white-space:nowrap}.mobile-summary-meta{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px;color:var(--text-2);font-size:12px}.mobile-summary-meta span{padding:4px 7px;background:var(--bg);border-radius:6px}.mobile-summary-actions{display:flex;flex-wrap:wrap;gap:7px;padding-top:11px;margin-top:11px;border-top:1px solid var(--border-light)}.mobile-summary-actions .btn{margin:0!important;min-height:34px!important;padding:7px 11px!important}
}
@media (max-width: 767px){
  .mobile-quick-actions{display:grid;gap:9px;margin:0 0 12px;padding:12px;border:1px solid #dbe7ff;border-radius:14px;background:linear-gradient(135deg,#f7faff,#fff)}
  .mobile-quick-actions>span{font-size:12px;font-weight:700;color:#526681}.mobile-quick-actions>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .mobile-quick-actions button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:40px;border:1px solid #dbe7ff;border-radius:10px;background:#fff;color:#165dff;font-size:13px;font-weight:600;white-space:nowrap}.mobile-quick-actions button:active{background:#edf4ff}.mobile-quick-actions .icon-svg{width:16px;height:16px}
}
/* 未登录时不显示手机端导航或菜单遮罩；仅系统主页激活后才显示。 */
@media (max-width: 767px){
  .app:not(.active)~.mobile-bottom-nav,.app:not(.active)~.mobile-nav-backdrop{display:none!important}
}
