/* ==================== 后台移动端样式 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; min-height: 100vh; background: #f0f7ff; color: #1A6FDB; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; overflow-x: hidden; -webkit-font-smoothing: antialiased; }

/* 顶部栏 */
.m-admin-header { position: fixed; top: 0; left: 0; right: 0; height: 50px; background: linear-gradient(135deg, #3B9DFE 0%, #1A6FDB 100%); border-bottom: 1px solid #3B9DFE; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; z-index: 1000; backdrop-filter: blur(20px); }
.m-admin-header .logo { font-size: 16px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 6px; }
.m-admin-header .time { font-family: 'Courier New', monospace; font-size: 13px; color: #fff; font-weight: 600; }
.m-menu-toggle { width: 40px; height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: none; border: none; cursor: pointer; }
.m-menu-toggle span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: all 0.3s; }
.m-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.m-menu-toggle.active span:nth-child(2) { opacity: 0; }
.m-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* 菜单 */
.m-menu-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); z-index: 998; opacity: 0; visibility: hidden; transition: all 0.3s; }
.m-menu-overlay.active { opacity: 1; visibility: visible; }
.m-admin-sidebar { position: fixed; top: 0; left: -80%; width: 80%; max-width: 300px; height: 100vh; background: linear-gradient(180deg, #fff 0%, #E8F4FF 100%); z-index: 999; transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1); overflow-y: auto; border-right: 1px solid #B8D9FF; padding-bottom: 30px; }
.m-admin-sidebar.active { left: 0; }
.m-sidebar-user { padding: 20px 16px; border-bottom: 1px solid #B8D9FF; background: linear-gradient(135deg, #E8F4FF 0%, #fff 100%); }
.m-sidebar-user .info { display: flex; align-items: center; gap: 12px; }
.m-sidebar-user img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #3B9DFE; object-fit: cover; }
.m-sidebar-user .name { font-size: 15px; font-weight: 600; color: #1A6FDB; }
.m-sidebar-user .role { font-size: 12px; color: #3B9DFE; margin-top: 2px; }
.m-nav-menu { padding: 8px 0; }
.m-nav-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: #1A6FDB; text-decoration: none; font-size: 14px; transition: all 0.2s; border-left: 3px solid transparent; position: relative; }
.m-nav-item:active, .m-nav-item.active { background: rgba(96, 165, 250, 0.1); color: #3B9DFE; border-left-color: #3B9DFE; }
.m-nav-item .icon { font-size: 18px; width: 24px; text-align: center; }
.m-nav-badge { position: absolute; right: 16px; background: #ef4444; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; min-width: 20px; text-align: center; }
.m-nav-divider { height: 1px; background: #B8D9FF; margin: 8px 16px; }

/* 主体 */
.m-admin-main { padding-top: 50px; padding-bottom: 70px; min-height: 100vh; }
.m-page-header { padding: 16px; display: flex; justify-content: space-between; align-items: center; }
.m-page-title { font-size: 20px; font-weight: 700; color: #1A6FDB; }

/* 统计卡片 */
.m-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 16px; margin-bottom: 16px; }
.m-stat-card { background: linear-gradient(135deg, #3B9DFE 0%, #1A6FDB 100%); border: 1px solid #3B9DFE; border-radius: 12px; padding: 16px; }
.m-stat-card .label { font-size: 12px; color: rgba(255,255,255,0.8); margin-bottom: 8px; display: flex; align-items: center; gap: 4px; }
.m-stat-card .value { font-size: 24px; font-weight: 700; color: #1A6FDB; }
.m-stat-card .change { font-size: 11px; color: rgba(255,255,255,0.8); margin-top: 4px; }

/* 卡片 */
.m-card { background: #fff; border: 1px solid #B8D9FF; border-radius: 12px; margin: 0 16px 16px; overflow: hidden; }
.m-card-header { padding: 14px 16px; border-bottom: 1px solid #E8F4FF; display: flex; justify-content: space-between; align-items: center; }
.m-card-header h3 { font-size: 15px; font-weight: 600; color: #fff; }
.m-card-header .more { font-size: 13px; color: #3B9DFE; text-decoration: none; }
.m-card-body { padding: 12px; }

/* 列表 */
.m-list-item { padding: 12px; border-bottom: 1px solid #E8F4FF; display: flex; align-items: center; gap: 10px; }
.m-list-item:last-child { border-bottom: none; }
.m-list-rank { width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.m-list-item:nth-child(1) .m-list-rank { background: #ef4444; color: #fff; }
.m-list-item:nth-child(2) .m-list-rank { background: #f97316; color: #fff; }
.m-list-item:nth-child(3) .m-list-rank { background: #eab308; color: #fff; }
.m-list-item .m-list-rank { background: #B8D9FF; color: rgba(255,255,255,0.8); }
.m-list-info { flex: 1; min-width: 0; }
.m-list-name { font-size: 14px; color: #1A6FDB; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-list-meta { font-size: 12px; color: #3B9DFE; margin-top: 2px; }

/* 表格 */
.m-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.m-table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 13px; }
.m-table th, .m-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #E8F4FF; white-space: nowrap; }
.m-table th { background: #E8F4FF; color: #1A6FDB; font-weight: 600; position: sticky; top: 0; }
.m-table td { color: #1A6FDB; }

/* 按钮 */
.m-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 8px 16px; border-radius: 8px; border: none; font-size: 13px; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.m-btn:active { transform: scale(0.96); }
.m-btn-primary { background: #3B9DFE; color: #fff; }
.m-btn-success { background: #1A6FDB; color: #fff; }
.m-btn-danger { background: #ef4444; color: #fff; }
.m-btn-warning { background: #3B9DFE; color: #fff; }
.m-btn-secondary { background: #E8F4FF; color: #1A6FDB; }
.m-btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.m-btn-block { width: 100%; padding: 12px; font-size: 15px; }

/* 表单 */
.m-form-group { margin-bottom: 16px; }
.m-form-group label { display: block; font-size: 13px; color: #3B9DFE; margin-bottom: 6px; }
.m-form-group input, .m-form-group select, .m-form-group textarea { width: 100%; padding: 12px 14px; border: 1px solid #B8D9FF; border-radius: 8px; background: #f0f7ff; color: #1A6FDB; font-size: 14px; outline: none; -webkit-appearance: none; }
.m-form-group input:focus, .m-form-group select:focus, .m-form-group textarea:focus { border-color: #3B9DFE; }
.m-form-group textarea { min-height: 100px; resize: vertical; }

/* 开关 */
.m-switch-label { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.m-switch { position: relative; width: 48px; height: 26px; background: #B8D9FF; border-radius: 13px; transition: all 0.3s; flex-shrink: 0; }
.m-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: all 0.3s; }
input[type="checkbox"]:checked + .m-switch { background: #3B9DFE; }
input[type="checkbox"]:checked + .m-switch::after { left: 25px; }
input[type="checkbox"] { display: none; }

/* 底部导航 */
.m-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 56px; background: linear-gradient(180deg, #fff 0%, #E8F4FF 100%); border-top: 1px solid #B8D9FF; display: flex; justify-content: space-around; align-items: center; z-index: 1000; padding-bottom: env(safe-area-inset-bottom); }
.m-bottom-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: #3B9DFE; font-size: 10px; flex: 1; height: 100%; transition: all 0.2s; }
.m-bottom-nav-item.active { color: #3B9DFE; }
.m-bottom-nav-item .icon { font-size: 20px; line-height: 1; }

/* 弹窗 */
.m-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); z-index: 2000; align-items: center; justify-content: center; padding: 20px; }
.m-modal.active { display: flex; }
.m-modal-box { background: #fff; border: 1px solid #B8D9FF; border-radius: 16px; width: 100%; max-width: 400px; max-height: 85vh; overflow-y: auto; padding: 20px; }
.m-modal-title { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 16px; }
.m-modal-btns { display: flex; gap: 10px; margin-top: 20px; }
.m-modal-btns .m-btn { flex: 1; }

/* 提示 */
.m-toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%) translateY(-100px); background: #1A6FDB; color: #fff; padding: 12px 24px; border-radius: 8px; font-size: 14px; z-index: 3000; opacity: 0; transition: all 0.3s; white-space: nowrap; }
.m-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.m-toast.error { background: #ef4444; }

/* 标签 */
.m-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.m-tag-green { background: rgba(59, 157, 254, 0.2); color: #3B9DFE; }
.m-tag-red { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.m-tag-yellow { background: rgba(59, 157, 254, 0.2); color: #3B9DFE; }
.m-tag-blue { background: rgba(59, 130, 246, 0.2); color: #3B9DFE; }
.m-tag-gray { background: rgba(184, 217, 255, 0.2); color: #3B9DFE; }

/* 空状态 */
.m-empty { text-align: center; padding: 40px 20px; color: #3B9DFE; }
.m-empty .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

/* 分页 */
.m-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 16px; }
.m-pagination a, .m-pagination span { padding: 8px 14px; border-radius: 8px; font-size: 13px; text-decoration: none; color: #3B9DFE; background: #fff; border: 1px solid #B8D9FF; }
.m-pagination a.active, .m-pagination span.active { background: #3B9DFE; color: #fff; border-color: #3B9DFE; }

/* 安全区域 */
@supports (padding-top: env(safe-area-inset-top)) {
    .m-admin-header { padding-top: env(safe-area-inset-top); height: calc(50px + env(safe-area-inset-top)); }
    .m-admin-main { padding-top: calc(50px + env(safe-area-inset-top)); }
}

/* 横屏 */
@media (orientation: landscape) and (max-height: 500px) {
    .m-bottom-nav { display: none; }
    .m-admin-main { padding-bottom: 20px; }
}
