/* 拍摄间资源预约系统 —— 移动优先样式 */
:root {
  --bg: #f5f2ec;
  --card: #ffffff;
  --ink: #2b2b2b;
  --sub: #8a8579;
  --line: #e8e3d8;
  --gold: #b98a2f;
  --gold-dark: #9c7425;
  --danger: #d64541;
  --ok: #3c8d5e;
  --radius: 14px;
  --shadow: 0 1px 4px rgba(60, 50, 20, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  line-height: 1.5;
}

.app { max-width: 560px; margin: 0 auto; padding: 16px 14px 40px; }
.admin-app { max-width: 900px; margin: 0 auto; padding: 16px 14px 40px; }

.hidden { display: none !important; }

/* ---- 顶栏 ---- */
.top { display: flex; align-items: baseline; gap: 10px; padding: 6px 2px 14px; }
.top h1 { font-size: 22px; margin: 0; }
.top .sub { margin: 0; color: var(--sub); font-size: 13px; }

/* ---- 通用按钮 ---- */
.btn {
  border: none; cursor: pointer; font-size: 15px; font-family: inherit;
  border-radius: 10px; padding: 10px 16px; background: #f0ece3; color: var(--ink);
  transition: opacity .15s;
}
.btn:active { opacity: .75; }
.btn.primary { background: var(--gold); color: #fff; }
.btn.primary:disabled { background: #d8c9a3; cursor: not-allowed; }
.btn.big { width: 100%; padding: 14px; font-size: 16px; border-radius: 12px; }
.btn.danger { background: #fbeee6; color: var(--danger); }
.btn.ghost { background: transparent; color: var(--sub); font-size: 13px; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }

/* ---- 分类页签 ---- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; }
.tab {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 8px 18px; font-size: 14px; color: var(--sub); cursor: pointer;
}
.tab.active { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }

/* ---- 资源卡片 ---- */
.res-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 4px; }
@media (min-width: 480px) { .res-list { grid-template-columns: repeat(3, 1fr); } }
.res-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 12px 10px; cursor: pointer; position: relative; box-shadow: var(--shadow);
}
.res-card:active { background: #faf7f0; }
.res-name { font-size: 15px; font-weight: 600; }
.res-model { font-size: 12px; color: var(--sub); margin-top: 2px; }
.res-card .total { position: absolute; top: 10px; right: 10px; font-size: 11px; color: var(--gold); }

/* ---- 区块标题 ---- */
.h2 { font-size: 16px; margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
.h2 .back { color: var(--sub); font-size: 13px; cursor: pointer; }
.picked-res { font-size: 18px; font-weight: 700; margin: 0; }

/* ---- 日期 chips ---- */
.date-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 7px 12px; cursor: pointer; text-align: center; min-width: 58px;
}
.chip b { display: block; font-size: 14px; font-weight: 600; }
.chip i { display: block; font-size: 11px; font-style: normal; color: var(--sub); margin-top: 2px; }
.chip.active { border-color: var(--gold); background: #fbf6ea; }
.chip.active b { color: var(--gold-dark); }

/* ---- 小时网格 ---- */
.hour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.hour-cell {
  border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 8px 4px; cursor: pointer; text-align: center; font-size: 14px;
}
.hour-cell i { display: block; font-style: normal; font-size: 11px; color: var(--sub); margin-top: 2px; }
.hour-cell.full { background: #f1efea; color: #b5b0a4; cursor: not-allowed; }
.hour-cell.full i { color: #c4bfb2; }
.hour-cell.active { border-color: var(--gold); background: var(--gold); color: #fff; }
.hour-cell.active i { color: #fff7e6; }
.hour-cell.in-range { border-color: #e3cf9f; background: #fdf6e3; }
.hour-cell.in-range i { color: var(--gold-dark); }

.sel-range { margin-top: 12px; font-size: 15px; font-weight: 600; color: var(--gold-dark); text-align: center; }

/* ---- 表单 ---- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 6px; }
.field input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px;
  font-size: 16px; font-family: inherit; background: var(--card);
}
.field input:focus { outline: none; border-color: var(--gold); }

.summary-card {
  background: #fbf6ea; border: 1px solid #ecdcb0; border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 14px;
}
.sum-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; }
.sum-row span { color: var(--sub); font-size: 14px; }
.sum-row b { font-size: 14px; }

/* ---- 数量步进 ---- */
.qty-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.qty-row label { font-size: 14px; color: var(--sub); }
.qty-stepper { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.qty-stepper button {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); font-size: 18px; cursor: pointer; line-height: 1;
}
.qty-stepper button:disabled { color: #ccc; cursor: not-allowed; }
.qty-stepper .val { font-size: 18px; font-weight: 600; min-width: 24px; text-align: center; }

/* ---- 成功弹层 ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(30, 26, 16, 0.55); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.overlay .card {
  background: var(--card); border-radius: 16px; padding: 28px 24px; width: 100%; max-width: 360px;
  text-align: center;
}
.overlay .ok {
  width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--ok); color: #fff; font-size: 26px; line-height: 54px;
}
.overlay h2 { margin: 0 0 6px; font-size: 20px; }
.overlay p { color: var(--sub); margin: 0 0 18px; font-size: 14px; }

/* ---- 管理员入口 ---- */
.admin-link { display: block; text-align: center; margin-top: 28px; color: #bbb5a8; font-size: 12px; text-decoration: none; }

/* ================= 后台管理 ================= */
.tabs2 { display: flex; gap: 6px; margin: 8px 0 16px; }
.tabs2 button {
  flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 10px; font-size: 14px; cursor: pointer; color: var(--sub);
}
.tabs2 button.active { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input, .toolbar select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px;
  background: var(--card); font-family: inherit;
}

table.bk { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; font-size: 13px; }
table.bk th, table.bk td { padding: 9px 10px; border-bottom: 1px solid #f0ede4; text-align: left; }
table.bk th { background: #faf7f0; color: var(--sub); font-weight: 600; white-space: nowrap; }
table.bk .tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px;
}
table.bk .tag.confirmed { background: #e8f5ec; color: var(--ok); }
table.bk .tag.cancelled { background: #f2eeee; color: #999; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }

.res-edit { display: grid; grid-template-columns: 90px 1fr 120px 60px 70px; gap: 8px; align-items: center; margin-bottom: 8px; }
.res-edit input, .res-edit select {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; font-size: 13px; font-family: inherit; background: #fff;
}
.res-edit input[type="checkbox"] { width: 18px; height: 18px; justify-self: center; }
.res-edit .save { justify-self: end; }
.res-edit .off { opacity: .5; }

.muted { color: var(--sub); font-size: 13px; }
