* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f6fa; color: #2c2c2c; }
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 14px; }

/* ===== 登录 ===== */
.login-view { height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#5b7cfa,#8e54e9); }
.login-card { background: #fff; padding: 40px 36px; border-radius: 14px; width: 340px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.login-card h1 { font-size: 22px; text-align: center; }
.login-sub { text-align: center; color: #888; margin: 8px 0 24px; font-size: 13px; }
.login-card input { width: 100%; padding: 12px 14px; margin-bottom: 14px; border: 1px solid #dcdfe6; border-radius: 8px; outline: none; }
.login-card input:focus { border-color: #5b7cfa; }
.login-card button { width: 100%; padding: 12px; background: #5b7cfa; color: #fff; border: none; border-radius: 8px; font-size: 16px; }
.login-card button:hover { background: #4a6cf0; }
.login-err { color: #e64340; font-size: 13px; text-align: center; margin-top: 12px; min-height: 18px; }

/* ===== 布局 ===== */
.app-view { display: flex; height: 100vh; }
.sidebar { width: 220px; background: #1f2533; color: #cfd3dc; display: flex; flex-direction: column; }
.sidebar .logo { padding: 22px 20px; font-size: 18px; font-weight: 700; color: #fff; border-bottom: 1px solid #2c3344; }
.sidebar nav { flex: 1; padding: 12px 0; }
.sidebar nav a { display: block; padding: 13px 22px; color: #cfd3dc; text-decoration: none; font-size: 15px; border-left: 3px solid transparent; }
.sidebar nav a:hover { background: #2a3142; }
.sidebar nav a.active { background: #2a3142; border-left-color: #5b7cfa; color: #fff; }
.side-foot { padding: 16px 22px; border-top: 1px solid #2c3344; font-size: 13px; }
.side-foot #admin-name { display: block; color: #9aa0ad; margin-bottom: 6px; }
.side-foot a { color: #e64340; cursor: pointer; }

.content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { padding: 18px 28px; background: #fff; border-bottom: 1px solid #eceef2; }
.topbar h2 { font-size: 18px; }
.page-body { flex: 1; overflow: auto; padding: 24px 28px; }

/* ===== 数据卡片 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 18px; }
.stat-card { background: #fff; border-radius: 12px; padding: 22px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.stat-card .num { font-size: 28px; font-weight: 700; color: #5b7cfa; }
.stat-card .label { color: #888; margin-top: 6px; font-size: 14px; }

/* ===== 工具栏 ===== */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { padding: 9px 12px; border: 1px solid #dcdfe6; border-radius: 8px; outline: none; }
.toolbar input:focus, .toolbar select:focus { border-color: #5b7cfa; }
.btn { padding: 9px 16px; border: none; border-radius: 8px; background: #5b7cfa; color: #fff; font-size: 14px; }
.btn:hover { background: #4a6cf0; }
.btn.green { background: #2ea043; }
.btn.green:hover { background: #288c3a; }
.btn.danger { background: #e64340; }
.btn.danger:hover { background: #cf3a37; }
.btn.ghost { background: #fff; color: #5b7cfa; border: 1px solid #5b7cfa; }
.btn.sm { padding: 5px 10px; font-size: 13px; }

/* ===== 表格 ===== */
.table { width: 100%; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.table table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid #f0f1f4; }
.table th { background: #fafbfc; color: #666; font-weight: 600; }
.table tr:hover td { background: #fafbff; }
.thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; background: #eee; }
.price { color: #e64340; font-weight: 600; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; }
.badge.on { background: #e6f7ec; color: #2ea043; }
.badge.off { background: #f1f1f1; color: #999; }
.badge.s0 { background: #fff4e5; color: #e6900a; }
.badge.s1 { background: #e6f0ff; color: #2f6bff; }
.badge.s2 { background: #ede7ff; color: #7b4dff; }
.badge.s3 { background: #e6f7ec; color: #2ea043; }
.badge.s4 { background: #f1f1f1; color: #999; }

/* ===== 弹窗 ===== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: #fff; border-radius: 12px; width: 560px; max-width: 94vw; max-height: 90vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #eee; font-size: 16px; font-weight: 600; }
.modal-head button { background: none; border: none; font-size: 18px; color: #999; }
.modal-body { padding: 20px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-row input, .form-row textarea, .form-row select { width: 100%; padding: 10px 12px; border: 1px solid #dcdfe6; border-radius: 8px; outline: none; }
.form-row textarea { resize: vertical; min-height: 70px; }
.form-row input:focus, .form-row textarea:focus { border-color: #5b7cfa; }
.radio-group { display: flex; gap: 18px; }
.img-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.img-item { position: relative; width: 72px; height: 72px; }
.img-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid #eee; }
.img-item .del { position: absolute; top: -6px; right: -6px; background: #e64340; color: #fff; border: none; border-radius: 50%; width: 20px; height: 20px; line-height: 18px; font-size: 12px; }
.detail-row { display: flex; padding: 8px 0; border-bottom: 1px solid #f3f3f3; font-size: 14px; }
.detail-row .k { width: 90px; color: #888; }
.order-items { margin-top: 10px; }
.order-items .oi { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed #eee; }
.order-items .oi img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.empty { text-align: center; color: #aaa; padding: 50px 0; }
