/* ============================================================
   校内配送登记系统 - 公共样式
   设计原则：手机优先（扫码打开的页面），浅色主题，简洁清爽
   ============================================================ */

/* ---------- 基础重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* 去掉 iOS 点击高亮 */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f5f6fa;          /* 浅灰背景 */
  color: #2d3436;               /* 深灰文字 */
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
}

/* ---------- 顶部导航 ---------- */
.header {
  background: linear-gradient(135deg, #0984e3, #74b9ff);
  color: #fff;
  padding: 24px 20px 20px;
}
.header h1 {
  font-size: 22px;
  font-weight: 600;
}
.header p {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 4px;
}

/* ---------- 主容器（手机端限宽） ---------- */
.container {
  max-width: 480px;    /* 手机上占满，桌面上居中限宽 */
  margin: 0 auto;
  padding: 16px;
}

/* ---------- Tab 切换 ---------- */
.tabs {
  display: flex;
  background: #fff;
  border-radius: 12px;
  padding: 4px;
  margin-top: -28px;   /* 压在 header 上，卡片浮层效果 */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 0;
  font-size: 15px;
  color: #636e72;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn.active {
  background: #0984e3;
  color: #fff;
  font-weight: 600;
}

/* ---------- 表单 ---------- */
.form-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 16px;
  margin-top: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 14px;
  color: #636e72;
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group label .required {
  color: #d63031;      /* 必填标红 */
  margin-left: 2px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1.5px solid #dfe6e9;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;     /* >=16px 防止 iOS 自动放大 */
  background: #fafbfc;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #0984e3;
  background: #fff;
}
.form-group textarea {
  resize: vertical;
  min-height: 72px;
}
.form-hint {
  font-size: 12px;
  color: #b2bec3;
  margin-top: 4px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 0;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn:active {
  opacity: 0.8;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(135deg, #0984e3, #74b9ff);
  color: #fff;
}
.btn-success {
  background: #00b894;
  color: #fff;
}
.btn-outline {
  background: #fff;
  color: #0984e3;
  border: 1.5px solid #0984e3;
}
.btn-danger {
  background: #ff7675;
  color: #fff;
}

/* ---------- 订单卡片（客户查单） ---------- */
.order-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.order-card .order-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.order-card .order-no {
  font-size: 13px;
  color: #b2bec3;
}
.order-card .item-name {
  font-size: 16px;
  font-weight: 600;
}
.order-card .order-row {
  display: flex;
  font-size: 14px;
  margin-top: 6px;
}
.order-card .order-row .k {
  color: #b2bec3;
  min-width: 70px;
}
.order-card .note-tag {
  display: inline-block;
  background: #ffeaa7;
  color: #d35400;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 8px;
}

/* ---------- 状态徽章 ---------- */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-pending {
  background: #ffeaa7;   /* 待配送：黄色 */
  color: #b7791f;
}
.badge-delivered {
  background: #dfe6e9;   /* 已送达：灰色 */
  color: #2d3436;
}
.badge-received {
  background: #55efc4;   /* 已拿到：绿色 */
  color: #00875a;
}

/* ---------- 提示弹层 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 20%;
  transform: translateX(-50%);
  background: rgba(45, 52, 54, 0.9);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  max-width: 80vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
}

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  color: #b2bec3;
  padding: 40px 0;
  font-size: 14px;
}

/* ============================================================
   以下为后台页（admin.html）专用样式
   ============================================================ */

/* 登录页 */
.login-wrap {
  max-width: 400px;
  margin: 80px auto 0;
  padding: 0 16px;
}

/* 统计卡片行 */
.stats-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.stat-card {
  flex: 1;
  background: #fff;
  border-radius: 10px;
  padding: 10px 4px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.stat-card .num {
  font-size: 20px;
  font-weight: 700;
}
.stat-card .label {
  font-size: 12px;
  color: #636e72;
}
.stat-card.total .num { color: #0984e3; }
.stat-card.pending .num { color: #e17055; }
.stat-card.delivered .num { color: #636e72; }
.stat-card.received .num { color: #00b894; }

/* 宿舍分组折叠面板 */
.group-card {
  background: #fff;
  border-radius: 12px;
  margin-top: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}
.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
.group-header .group-title {
  font-size: 16px;
  font-weight: 600;
}
.group-header .group-count {
  font-size: 13px;
  color: #636e72;
}
.group-header .arrow {
  transition: transform 0.2s;
  color: #b2bec3;
  font-size: 14px;
}
.group-card.open .arrow {
  transform: rotate(90deg);
}
.group-body {
  display: none;         /* 默认折叠 */
  border-top: 1px solid #f1f2f6;
}
.group-card.open .group-body {
  display: block;
}

/* 后台订单行 */
.admin-order {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f2f6;
}
.admin-order:last-child {
  border-bottom: none;
}
.admin-order .row-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-order .chk {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.admin-order .who {
  font-weight: 600;
  font-size: 15px;
}
.admin-order .what {
  font-size: 14px;
  color: #2d3436;
  margin-top: 4px;
  padding-left: 26px;
}
.admin-order .meta {
  font-size: 12px;
  color: #b2bec3;
  margin-top: 4px;
  padding-left: 26px;
}
.admin-order .note-line {
  font-size: 13px;
  color: #d35400;
  background: #ffeaa7;
  border-radius: 6px;
  padding: 4px 8px;
  margin: 6px 0 0 26px;
  display: inline-block;
}
.admin-order .photo-thumb {
  max-width: 100%;
  max-height: 120px;
  border-radius: 8px;
  margin: 8px 0 0 26px;
  display: block;
}

/* 批量操作栏（吸底） */
.batch-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  padding: 12px 16px;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
  display: none;            /* 未勾选时隐藏 */
  align-items: center;
  gap: 10px;
  z-index: 100;
}
.batch-bar.show {
  display: flex;
}
.batch-bar .sel-info {
  flex: 1;
  font-size: 14px;
  color: #636e72;
}
.batch-bar .btn {
  width: auto;
  padding: 10px 20px;
  font-size: 15px;
}

/* 上传照片的小预览 */
.photo-preview {
  display: none;
  margin: 8px 0 0 26px;
  max-width: 120px;
  border-radius: 8px;
}
