/* 食堂用餐登记系统 · 全局样式（手机优先） */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f4f8; color: #1f2329;
}
.hidden { display: none !important; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1677ff 0%, #0958d9 100%);
  padding: 20px;
}
.login-box {
  width: 100%; max-width: 360px; background: #fff; border-radius: 16px;
  padding: 36px 28px; box-shadow: 0 12px 40px rgba(0,0,0,.18); text-align: center;
}
.login-logo { font-size: 52px; }
.login-box h1 { font-size: 20px; margin: 8px 0 4px; }
.login-sub { color: #8a919c; font-size: 13px; margin-bottom: 24px; }
.login-box input {
  width: 100%; height: 46px; border: 1px solid #dcdfe6; border-radius: 10px;
  padding: 0 14px; font-size: 15px; margin-bottom: 14px; outline: none;
}
.login-box input:focus { border-color: #1677ff; }
.login-error { color: #e5484d; font-size: 13px; margin-top: 10px; }

/* ---------- 按钮 ---------- */
.btn-primary {
  background: #1677ff; color: #fff; border: none; border-radius: 10px;
  height: 46px; font-size: 16px; cursor: pointer;
}
.btn-primary:active { background: #0958d9; }
.btn-block { width: 100%; }
.btn-logout {
  background: rgba(255,255,255,.2); color: #fff; border: none; border-radius: 8px;
  padding: 6px 12px; font-size: 13px; cursor: pointer;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 52px; z-index: 100;
  background: #1677ff; color: #fff; display: flex; align-items: center;
  padding: 0 12px; gap: 10px;
}
.menu-toggle { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; padding: 4px 8px; }
.topbar-title { font-size: 16px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user { font-size: 13px; opacity: .9; }

/* ---------- 布局 ---------- */
.main { padding-top: 52px; }
.sidebar {
  position: fixed; top: 52px; left: -260px; bottom: 0; width: 240px; z-index: 90;
  background: #fff; box-shadow: 2px 0 12px rgba(0,0,0,.08);
  transition: left .25s; overflow-y: auto;
}
.sidebar.open { left: 0; }
.sidebar-mask {
  position: fixed; top: 52px; left: 0; right: 0; bottom: 0; z-index: 80;
  background: rgba(0,0,0,.35);
}
.menu-item {
  display: block; width: 100%; text-align: left; padding: 14px 20px;
  background: none; border: none; border-bottom: 1px solid #f2f4f8;
  font-size: 15px; color: #1f2329; cursor: pointer;
}
.menu-item.active { background: #e8f1ff; color: #1677ff; border-left: 3px solid #1677ff; font-weight: 600; }
.content { padding: 16px; min-height: calc(100vh - 52px); }

/* ---------- 占位页 ---------- */
.page-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.page-desc { color: #8a919c; font-size: 13px; margin-bottom: 20px; }
.placeholder-card {
  background: #fff; border-radius: 12px; padding: 40px 20px; text-align: center;
  color: #8a919c; font-size: 14px; line-height: 2;
}
.placeholder-card .wave-badge {
  display: inline-block; background: #fff7e6; color: #d48806;
  border-radius: 20px; padding: 4px 14px; font-size: 13px; margin-bottom: 10px;
}

/* ---------- 电脑端 ---------- */
@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .sidebar { left: 0; }
  .content { margin-left: 240px; padding: 24px; }
  .sidebar-mask { display: none !important; }
}

/* ---------- 第2波：卡片 / 表格 / 弹窗 / 日历 ---------- */
.btn-secondary { background: #f2f4f8; color: #1f2329; border: none; border-radius: 10px; height: 42px; padding: 0 18px; font-size: 15px; cursor: pointer; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; }
.btn-mini { background: #e8f1ff; color: #1677ff; border: none; border-radius: 6px; padding: 5px 10px; font-size: 13px; cursor: pointer; }
.btn-danger { background: #fff1f0; color: #e5484d; }
.text-ok { color: #00a870; } .text-warn { color: #d48806; }

/* 轻提示 */
.ui-toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%) translateY(-16px);
  padding: 10px 20px; border-radius: 10px; font-size: 14px; z-index: 999; opacity: 0; transition: all .25s; }
.ui-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-ok { background: #00a870; color: #fff; } .toast-error { background: #e5484d; color: #fff; }

/* 弹窗 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 420px; max-height: 85vh; overflow-y: auto; }
.modal-title { font-size: 16px; font-weight: 600; padding: 16px 18px 8px; }
.modal-body { padding: 6px 18px 14px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 0 18px 16px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 13px; color: #8a919c; margin-bottom: 5px; }
.form-row input, .form-row select { width: 100%; height: 42px; border: 1px solid #dcdfe6; border-radius: 8px; padding: 0 12px; font-size: 15px; outline: none; }
.form-row input:focus { border-color: #1677ff; }

/* 卡片 */
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
.card { background: #fff; border-radius: 12px; padding: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.card-kv { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; color: #4e5969; }
.card-kv b { color: #1f2329; }
.card-empty { color: #8a919c; font-size: 14px; text-align: center; padding: 18px 0; line-height: 1.8; }
.today-wrap { display: flex; justify-content: center; padding: 4px 0; }
.today-btn { width: 100%; max-width: 300px; border: none; border-radius: 14px; padding: 18px;
  font-size: 18px; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.today-btn span { font-size: 12px; font-weight: 400; opacity: .85; }
.today-open { background: #e6f9f0; color: #00a870; border: 2px solid #00a870; }
.today-closed { background: #fff1f0; color: #e5484d; border: 2px solid #e5484d; }
.today-none { background: #f2f4f8; color: #8a919c; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card { background: #fff; border-radius: 12px; padding: 16px 10px; text-align: center; }
.stat-num { font-size: 26px; font-weight: 700; }
.stat-label { font-size: 12px; color: #8a919c; margin-top: 4px; }
.dash-note { color: #b0b8c4; font-size: 12px; text-align: center; margin-top: 14px; }

/* 表格 */
.table-wrap { background: #fff; border-radius: 12px; overflow-x: auto; margin-top: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table th { background: #f7f8fa; padding: 11px 10px; text-align: left; color: #4e5969; font-weight: 600; white-space: nowrap; }
.table td { padding: 11px 10px; border-top: 1px solid #f2f4f8; white-space: nowrap; }
.table-empty { text-align: center; color: #8a919c; padding: 26px !important; }
.table .ops button { margin-right: 6px; }
.badge { display: inline-block; border-radius: 12px; padding: 2px 10px; font-size: 12px; }
.badge-1 { background: #e8f1ff; color: #1677ff; }
.badge-2 { background: #f2f4f8; color: #8a919c; }
.badge-0 { background: #fff7e6; color: #d48806; }

/* 日历 */
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cal-toolbar select { height: 40px; border: 1px solid #dcdfe6; border-radius: 8px; padding: 0 10px; font-size: 14px; max-width: 55vw; }
.cal-month-nav { display: flex; align-items: center; gap: 8px; }
.cal-banner { border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.banner-ok { background: #e6f9f0; color: #007a5a; }
.banner-warn { background: #fff7e6; color: #ad6800; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { text-align: center; font-size: 13px; color: #8a919c; padding: 6px 0; }
.cal-cell { min-height: 58px; border-radius: 10px; background: #fff; border: 1px solid #eef0f4;
  padding: 6px; font-size: 14px; cursor: pointer; position: relative; }
.cal-cell b { font-weight: 600; }
.cal-cell i { display: block; font-size: 11px; font-style: normal; color: inherit; opacity: .85; margin-top: 2px; word-break: break-all; }
.cal-empty { background: transparent; border: none; cursor: default; }
.cal-none { color: #8a919c; }
.cal-served { background: #e8f1ff; border-color: #1677ff; color: #0958d9; font-weight: 600; }
.cal-closed { background: #fff1f0; border-color: #e5484d; color: #cf1322; }
.cal-today { box-shadow: 0 0 0 2px #1677ff inset; }
@media (max-width: 480px) { .cal-cell { min-height: 46px; font-size: 13px; } .cal-cell i { font-size: 10px; } }

/* 批量面板 */
.batch-panel { background: #fff; border-radius: 12px; padding: 14px; margin-top: 14px; }
.batch-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.batch-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; font-size: 14px; }
.batch-row input[type="date"] { height: 38px; border: 1px solid #dcdfe6; border-radius: 8px; padding: 0 8px; }
.batch-row select { height: 38px; border: 1px solid #dcdfe6; border-radius: 8px; padding: 0 8px; }
.batch-row input#b-reason { flex: 1; min-width: 130px; height: 38px; border: 1px solid #dcdfe6; border-radius: 8px; padding: 0 10px; }
.chk { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; }

/* 底部备案号 */
.site-footer { position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; text-align: center; padding: 8px 0; font-size: 12px; color: #b0b8c4; background: transparent; pointer-events: auto; }
.site-footer a { color: inherit; text-decoration: none; }
body.is-login .site-footer { color: rgba(255,255,255,.8); }

/* 第2波B：双学段每餐价 */
.price-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.price-row input { flex: 1; height: 42px; border: 1px solid #dcdfe6; border-radius: 8px; padding: 0 12px; font-size: 15px; outline: none; }
.price-row input:focus { border-color: #1677ff; }
.price-tag { min-width: 40px; font-size: 14px; color: #4e5969; }
.subtotal-box { background: #f7f8fa; border-radius: 10px; padding: 10px 14px; margin: 4px 0 12px; }
.subtotal-row { font-size: 14px; color: #4e5969; padding: 3px 0; }
.subtotal-row b { color: #1677ff; }
.cell-sub { font-size: 12px; color: #8a919c; }

/* 第2波C：学期餐费标准卡片 */
.std-card { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fff; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; flex-wrap: wrap; }
.std-info { font-size: 14px; color: #4e5969; }
.std-info b { color: #1677ff; font-size: 16px; }
.std-tip { font-size: 12px; color: #8a919c; margin-top: 4px; }

/* 第2波D */
.sub-eq { font-size: 12px; color: #8a919c; margin-left: 6px; }
.cal-served i { color: #0958d9; }
