/* ========================================================
   【文件分类】assets/css/ 静态资源
   【文件路径】/assets/css/style.css
   【文件用途】全站样式
   ======================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "Microsoft YaHei", sans-serif; background: #f5f6fa; color: #333; font-size: 14px; }
a { color: #3498db; text-decoration: none; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea, #764ba2); }
.login-box { background: #fff; padding: 40px; border-radius: 10px; width: 360px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.login-box h2 { text-align: center; margin-bottom: 25px; color: #333; }
.login-box input { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 5px; font-size: 14px; }
.login-box button { width: 100%; padding: 12px; background: #667eea; color: #fff; border: none; border-radius: 5px; font-size: 16px; cursor: pointer; }
.login-box button:hover { background: #5568d3; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #2c3e50; color: #fff; min-height: 100vh; position: fixed; left: 0; top: 0; }
.sidebar .logo { padding: 20px; text-align: center; font-size: 18px; font-weight: bold; background: #1a252f; }
.sidebar a { display: block; padding: 12px 20px; color: #bdc3c7; border-left: 3px solid transparent; }
.sidebar a:hover, .sidebar a.active { background: #34495e; color: #fff; border-left-color: #3498db; }
.main { margin-left: 200px; flex: 1; padding: 20px; }
.topbar { background: #fff; padding: 12px 20px; margin: -20px -20px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,.05); }

/* 卡片 */
.card { background: #fff; border-radius: 6px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card h3 { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #eee; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f8f9fa; font-weight: 600; }
tr:hover { background: #f5f6fa; }

/* 按钮 */
.btn { display: inline-block; padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; }
.btn-primary { background: #3498db; color: #fff; }
.btn-success { background: #27ae60; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-warning { background: #f39c12; color: #fff; }
.btn-default { background: #ecf0f1; color: #333; }
.btn:hover { opacity: .85; }

/* 表单 */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; color: #555; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.form-row { display: flex; gap: 15px; }
.form-row .form-group { flex: 1; }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-box { background: #fff; padding: 20px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.stat-box .num { font-size: 28px; font-weight: bold; color: #3498db; }
.stat-box .label { color: #999; margin-top: 5px; }

/* POS 收银 */
.pos-layout { display: flex; gap: 15px; }
.pos-left { flex: 1; }
.pos-right { width: 360px; }
.cart-items { max-height: 380px; overflow-y: auto; }
.cart-total { background: #fff8e1; padding: 15px; border-radius: 6px; margin-top: 10px; }
.cart-total .row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.cart-total .pay { font-size: 24px; color: #e74c3c; font-weight: bold; }
.scan-input { width: 100%; padding: 12px; font-size: 16px; border: 2px solid #3498db; border-radius: 4px; margin-bottom: 10px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 999; }
.modal { background: #fff; border-radius: 8px; padding: 25px; width: 500px; max-width: 90%; max-height: 85vh; overflow-y: auto; }
.modal h3 { margin-bottom: 15px; }
.modal-footer { margin-top: 20px; text-align: right; }

/* 58mm 小票打印 */
@media print {
    body * { visibility: hidden; }
    .receipt, .receipt * { visibility: visible; }
    .receipt { position: absolute; left: 0; top: 0; width: 58mm; }
    .no-print { display: none !important; }
}
.receipt { width: 58mm; padding: 4px; font-family: monospace; font-size: 12px; line-height: 1.5; }
.receipt .center { text-align: center; }
.receipt .title { font-size: 14px; font-weight: bold; }
.receipt .line { border-top: 1px dashed #000; margin: 4px 0; }
.receipt .row { display: flex; justify-content: space-between; }
.receipt table { width: 100%; font-size: 11px; }
.receipt th, .receipt td { padding: 2px 0; border: none; }