* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f1f5f9; color: #1f2937; font-size: 14px; }
.hidden { display: none !important; }
button { font-family: inherit; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e293b, #334155); }
.login-card { width: 360px; background: #fff; border-radius: 16px; padding: 36px 32px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.login-logo { font-size: 44px; text-align: center; }
.login-card h1 { font-size: 18px; text-align: center; margin: 10px 0 24px; color: #1f2937; }
.login-card label { display: block; font-size: 13px; color: #64748b; margin-bottom: 14px; }
.login-card input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 14px; }
.login-card input:focus { outline: none; border-color: #6366f1; }
.login-error { color: #dc2626; font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.login-tip { margin-top: 14px; font-size: 12px; color: #94a3b8; text-align: center; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 200px; flex-shrink: 0; background: #1e293b; color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-logo { padding: 20px 18px; font-weight: 700; color: #fff; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
#side-nav { flex: 1; padding: 12px 0; }
#side-nav a { display: block; padding: 12px 20px; color: #cbd5e1; text-decoration: none; font-size: 14px; border-left: 3px solid transparent; }
#side-nav a:hover { background: rgba(255,255,255,.06); }
#side-nav a.active { background: rgba(99,102,241,.18); border-left-color: #6366f1; color: #fff; }
.side-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.content { flex: 1; min-width: 0; padding: 24px 28px; }

/* 通用组件 */
.btn { border: none; border-radius: 8px; padding: 9px 16px; font-size: 13px; cursor: pointer; background: #e2e8f0; color: #334155; }
.btn:hover { filter: brightness(.97); }
.btn.primary { background: #6366f1; color: #fff; }
.btn.danger { background: #fee2e2; color: #dc2626; }
.btn.success { background: #dcfce7; color: #16a34a; }
.btn.ghost { background: transparent; border: 1px solid #cbd5e1; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(15,23,42,.08); margin-bottom: 20px; }
.card h2 { font-size: 16px; margin-bottom: 16px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; background: #fff; }
.toolbar input { width: 220px; }
.toolbar .grow { flex: 1; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: #94a3b8; font-weight: 500; padding: 10px 8px; border-bottom: 1px solid #e2e8f0; }
td { padding: 12px 8px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; }
tr:hover td { background: #f8fafc; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.badge.orange { background: #fff7ed; color: #ea580c; }
.badge.blue { background: #eff6ff; color: #2563eb; }
.badge.green { background: #f0fdf4; color: #16a34a; }
.badge.gray { background: #f1f5f9; color: #64748b; }
.badge.red { background: #fef2f2; color: #dc2626; }

/* 统计卡 */
.stat-grid { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-card { flex: 1; min-width: 150px; background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.stat-card .num { font-size: 28px; font-weight: 800; color: #1f2937; }
.stat-card .label { font-size: 13px; color: #94a3b8; margin-top: 4px; }
.stat-card.warn .num { color: #ea580c; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 94vw; max-height: 88vh; overflow: auto; padding: 24px; }
.modal h3 { font-size: 16px; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { font-size: 13px; color: #64748b; display: block; }
.form-grid input, .form-grid select, .form-grid textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; font-family: inherit; }
.form-grid textarea { resize: vertical; min-height: 66px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: none; border-color: #6366f1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.row-del { color: #dc2626; cursor: pointer; font-size: 16px; padding: 6px; }

/* 提示 */
.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: #1f2937; color: #fff; padding: 10px 22px; border-radius: 24px; font-size: 13px; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.err { background: #dc2626; }

/* 分页 */
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 16px; font-size: 13px; color: #64748b; }

/* 订单明细 */
.item-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #f1f5f9; font-size: 13px; }
.verify-box { display: flex; gap: 10px; margin-bottom: 16px; }
.verify-box input { flex: 1; max-width: 260px; padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 14px; letter-spacing: 2px; }

/* 设置页 */
.set-row { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.set-row .k { width: 130px; flex-shrink: 0; font-size: 13px; color: #64748b; padding-top: 9px; }
.set-row .v { flex: 1; }
.set-row input[type=text], .set-row input[type=password], .set-row textarea { width: 100%; padding: 9px 11px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; font-family: inherit; }
.set-row textarea { resize: vertical; }
.cap-row, .banner-row { display: flex; gap: 8px; margin-bottom: 8px; }
.cap-row input, .banner-row input { padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; }
.cap-row input { width: 120px; }
.banner-row input:nth-child(1) { width: 56px; }
.banner-row input:nth-child(2) { flex: 1; }
.banner-row input:nth-child(3) { width: 200px; }
.banner-row input:nth-child(4) { width: 90px; }
.banner-row input:nth-child(5) { width: 90px; }
