/* 骑安管理后台样式：移动端优先，主色 #155EEF */
:root {
	--primary: #155EEF;
	--primary-dark: #0B1F3A;
	--bg: #F7F8FA;
	--card: #FFFFFF;
	--text: #1D2939;
	--muted: #667085;
	--border: #E4E7EC;
	--success: #12B76A;
	--warning: #F79009;
	--danger: #F04438;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
	font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
	background: var(--bg);
	color: var(--text);
	font-size: 14px;
	line-height: 1.5;
}
a { color: var(--primary); cursor: pointer; text-decoration: none; }
.muted { color: var(--muted); }
.text-primary { color: var(--primary); }
.text-warning { color: var(--warning); }
.price { color: var(--primary); font-weight: 700; }
small { font-size: 12px; color: var(--muted); font-weight: 400; }

/* 按钮 */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	border: none; cursor: pointer; font-size: 14px; border-radius: 10px;
	padding: 10px 18px; font-weight: 500; font-family: inherit; transition: opacity .15s;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.ghost { background: #fff; color: var(--muted); border: 1px solid var(--border); }
.btn.danger { background: #FEF3F2; color: var(--danger); }
.btn.small { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* Toast */
.toast {
	position: fixed; top: 18%; left: 50%; transform: translateX(-50%);
	background: rgba(29, 41, 57, .94); color: #fff; padding: 10px 18px;
	border-radius: 10px; font-size: 13px; z-index: 999; max-width: 80vw;
	text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

/* ===== 登录页 ===== */
.login-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.login-hero {
	background: linear-gradient(135deg, #155EEF 0%, #0B1F3A 100%);
	border-radius: 0 0 32px 32px;
	padding: 72px 24px 88px;
	text-align: center;
	color: #fff;
}
.login-logo {
	width: 64px; height: 64px; margin: 0 auto 16px;
	border-radius: 20px; background: rgba(255, 255, 255, .15);
	display: flex; align-items: center; justify-content: center; color: #fff;
}
.login-hero h1 { font-size: 24px; font-weight: 800; }
.login-hero p { margin-top: 6px; font-size: 13px; opacity: .8; }
.login-card {
	margin: -48px auto 0;
	background: #fff; border-radius: 24px; padding: 28px 24px;
	box-shadow: 0 12px 32px rgba(16, 24, 40, .08);
	max-width: 420px; width: calc(100% - 48px);
}
.login-tip { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.6; }

/* 表单 */
.form-item { margin-bottom: 16px; }
.form-item label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-item input, .form-item select, .form-item textarea {
	width: 100%; border: 1px solid var(--border); border-radius: 10px;
	padding: 10px 12px; font-size: 14px; font-family: inherit;
	background: #fff; color: var(--text); outline: none;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .span2 { grid-column: span 2; }

/* ===== 主布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
	width: 224px; flex: none; background: #fff; border-right: 1px solid var(--border);
	display: flex; flex-direction: column;
	position: sticky; top: 0; height: 100vh;
}
.brand {
	display: flex; align-items: center; gap: 10px;
	padding: 20px; font-size: 17px; font-weight: 800; color: var(--primary-dark);
	border-bottom: 1px solid var(--border);
}
.brand-logo {
	width: 34px; height: 34px; border-radius: 10px;
	background: linear-gradient(135deg, #155EEF 0%, #0B1F3A 100%);
	display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.nav { flex: 1; padding: 12px; overflow-y: auto; }
.nav-item {
	display: flex; align-items: center; gap: 10px;
	padding: 11px 14px; border-radius: 10px; color: var(--muted);
	cursor: pointer; margin-bottom: 4px; font-weight: 500;
}
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: #EEF2FF; color: var(--primary); font-weight: 600; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 28px; background: #fff; border-bottom: 1px solid var(--border);
	position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 18px; font-weight: 700; }
.topbar-user { font-size: 13px; color: var(--muted); }
.content { padding: 24px 28px; flex: 1; }

/* 统计卡片 */
.stat-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 14px; margin-bottom: 22px;
}
.stat-card {
	background: #fff; border-radius: 16px; padding: 18px;
	border: 1px solid var(--border);
	display: flex; flex-direction: column; gap: 8px;
}
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 800; }

/* 面板与列表 */
.panel { background: #fff; border-radius: 16px; border: 1px solid var(--border); overflow: hidden; }
.panel-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-size: 15px; font-weight: 700; }
.list-item {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 14px 18px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--bg); }
.list-main { min-width: 0; flex: 1; }
.list-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.list-sub { font-size: 12px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-side { text-align: right; flex: none; }
.list-side .time { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }

/* 状态徽章 */
.badge {
	display: inline-flex; align-items: center; font-size: 12px; font-weight: 600;
	border-radius: 999px; padding: 2px 10px; white-space: nowrap;
}
.badge.st-pending { background: #FEF0C7; color: #B54708; }
.badge.st-serving { background: #EEF2FF; color: #155EEF; }
.badge.st-done { background: #D1FADF; color: #067647; }
.badge.st-cancelled { background: #F2F4F7; color: var(--muted); }

/* 筛选 */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip {
	padding: 7px 16px; border-radius: 999px; font-size: 13px; cursor: pointer;
	background: #fff; border: 1px solid var(--border); color: var(--muted);
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* 订单卡片 */
.card { background: #fff; border-radius: 16px; border: 1px solid var(--border); padding: 16px; }
.order-card { margin-bottom: 12px; cursor: pointer; }
.order-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.order-no { font-weight: 700; font-size: 15px; }
.order-row { display: flex; gap: 10px; font-size: 13px; margin-top: 6px; }
.order-row .k { color: var(--muted); flex: none; width: 64px; }
.order-foot {
	display: flex; align-items: center; justify-content: space-between;
	margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}

/* 工具栏与表格 */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.table-wrap { background: #fff; border-radius: 16px; border: 1px solid var(--border); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 500; background: #FAFBFC; }
.table tr:last-child td { border-bottom: none; }
.table .ops { display: flex; gap: 6px; }
.cards-mobile { display: none; }
.card-ops { display: flex; gap: 8px; margin-top: 12px; }

/* 用户 */
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.user-card { display: flex; gap: 14px; align-items: center; }
.user-avatar-wrap { position: relative; width: 48px; height: 48px; flex: none; }
.user-avatar { position: absolute; inset: 0; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; z-index: 1; }
.user-avatar-fallback {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	background: #EEF2FF; color: var(--primary); font-weight: 700; border-radius: 50%; font-size: 18px;
}
.user-info { min-width: 0; }
.user-name { font-weight: 700; }
.user-name .muted { font-weight: 400; font-size: 12px; margin-left: 6px; }
.user-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* 弹窗 */
.modal-mask {
	position: fixed; inset: 0; background: rgba(11, 31, 58, .45); z-index: 100;
	display: flex; align-items: flex-end; justify-content: center;
}
.modal {
	background: #fff; width: 100%; max-width: 640px; max-height: 88vh;
	border-radius: 20px 20px 0 0; display: flex; flex-direction: column;
	animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.modal-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-close { border: none; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
	display: flex; justify-content: flex-end; gap: 10px;
	padding: 14px 20px; border-top: 1px solid var(--border);
}
.modal-sub { font-size: 14px; font-weight: 700; margin: 18px 0 10px; }

/* 详情 */
.detail-grid { display: flex; flex-direction: column; gap: 10px; }
.detail-row { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; }
.detail-row > span { color: var(--muted); flex: none; }
.detail-row > b { font-weight: 600; text-align: right; word-break: break-all; }

/* 时间线 */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.timeline-item::before {
	content: ''; position: absolute; left: 5px; top: 14px; bottom: 0;
	width: 2px; background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
	width: 12px; height: 12px; border-radius: 50%; background: var(--primary);
	flex: none; margin-top: 4px; z-index: 1;
}
.timeline-action { font-size: 13px; font-weight: 500; }
.timeline-time { font-size: 12px; color: var(--muted); }

/* 状态 */
.loading { text-align: center; color: var(--muted); padding: 48px 0; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; font-size: 13px; }
.error { text-align: center; color: var(--danger); padding: 32px 0; }

/* 移动端底部导航 */
.tabbar {
	display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
	background: #fff; border-top: 1px solid var(--border);
	padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tab-item {
	flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
	font-size: 11px; color: var(--muted); padding: 4px 0; cursor: pointer;
}
.tab-item.active { color: var(--primary); font-weight: 600; }

@media (max-width: 768px) {
	.sidebar { display: none; }
	.tabbar { display: flex; }
	.content { padding: 16px 14px 84px; }
	.topbar { padding: 14px 16px; }
	.table-wrap { display: none; }
	.cards-mobile { display: flex; flex-direction: column; gap: 12px; }
	.form-grid { grid-template-columns: 1fr; }
	.form-grid .span2 { grid-column: span 1; }
	.stat-grid { grid-template-columns: repeat(2, 1fr); }
	.user-grid { grid-template-columns: 1fr; }
	.modal { max-height: 92vh; }
}
