:root {
  color-scheme: light;
  /* 宁嘉迪红黄品牌体系：米白打底 + 红色主品牌 + 黄色辅助 + 白卡片 */
  --brand-red: #e71d18;
  --brand-red-deep: #ba1714;
  --brand-red-soft: #fde7e6;
  --brand-yellow: #ffdb49;
  --brand-yellow-soft: #fff6cc;
  --brand-yellow-deep: #d69b00;

  /* 基础色：暖色系，替代原墨青大面积 */
  --paper: #f7f0e5;        /* 全局米白背景 */
  --surface: #fffdf8;      /* 卡片/输入框暖白 */
  --ink: #30231e;          /* 正文暖棕深字 */
  --ink-soft: #4a3830;
  --muted: #78675d;        /* 辅助棕灰 */
  --border: #ead7b9;       /* 暖金边框 */
  --border-strong: #d9bf94;

  --success: #2f7d5b;
  --success-soft: #e2f1ea;
  --danger: #c4151a;       /* 危险操作红，略深以区别品牌红主按钮 */
  --danger-soft: #f7e6e4;
  --row-disabled: #efe9dd;

  --brass: #b07d2a;
  --brass-soft: #e7d4a8;

  --radius: 4px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(122,90,40,.06), 0 8px 24px rgba(122,90,40,.08);
  --maxw: 480px;
  --pad: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body { min-height: 100vh; }

a { color: var(--brass); text-decoration: none; }

/* 顶部品牌条 */
.topbar {
  background: var(--brand-red);
  color: #fff;
  padding: 12px var(--pad);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 3px solid var(--brand-yellow);
  flex-wrap: nowrap;
}
.topbar .brand {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .5px;
  white-space: nowrap;
  min-width: 0;
}
.topbar .brand .accent { color: var(--brand-yellow); }
.topbar .sub { font-size: 12px; color: #ffe9b8; margin-top: 2px; white-space: nowrap; }
.topbar .spacer { flex: 1; min-width: 0; }
/* 首页顶栏：品牌左 + 操作区右，单行紧凑 */
.topbar-home { gap: 8px; }
.topbar-home .topbar-brand { min-width: 0; flex: 0 1 auto; display: flex; align-items: center; }
.topbar-home .topbar-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}
/* 顶栏 Logo：白底座，object-fit:contain 不拉伸 */
.topbar-logo {
  height: 32px;
  width: auto;
  max-width: 72px;
  object-fit: contain;
  background: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  flex: none;
}
.topbar .brand {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .5px;
}
.topbar .brand .accent { color: var(--brass-soft); }
.topbar .sub {
  font-size: 12px;
  color: #b9c0c9;
  margin-top: 2px;
}
/* 右上角“后台”入口：黄底深红字，在红顶栏上高辨识 */
.topbar .badge {
  font-size: 13px;
  line-height: 1;
  color: var(--brand-red-deep);
  background: var(--brand-yellow);
  border: 1px solid var(--brand-yellow-deep);
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.topbar .badge:hover {
  background: #ffe884;
  border-color: var(--brand-red);
  color: var(--brand-red-deep);
}
.topbar .badge:active { transform: translateY(1px); }
/* 桌面显示“管理后台”，手机显示“后台” */
.topbar .badge .full { display: inline; }
.topbar .badge .short { display: none; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--pad);
}

/* 卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* 首页：入口大按钮 */
.entry-list { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.entry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--brand-red);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.entry:active { transform: scale(.99); }
.entry .icon {
  width: 44px; height: 44px; flex: none;
  border-radius: 10px;
  background: var(--brand-yellow);
  color: var(--brand-red);
  display: grid; place-items: center;
  font-size: 20px;
  font-weight: 700;
}
.entry .title { font-size: 16px; font-weight: 600; }
.entry .desc { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* 表单 */
.form-section { padding: 18px var(--pad); }
.form-section + .form-section { border-top: 1px solid var(--border); }
.section-title {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: none;
  margin: 0 0 12px;
}

/* 展厅/会议室表单顶部居中黑体标题 */
.form-page-title-wrap {
  padding: 24px var(--pad) 18px;
  text-align: center;
}
.form-page-title {
  margin: 0;
  font-family: "SimHei", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}
/* 标题下红色短横线点缀 */
.form-page-title-wrap::after {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  margin: 10px auto 0;
  background: var(--brand-red);
  border-radius: 2px;
}

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field .req { color: var(--brand-red); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 6px; display: none; }
.field.has-error .err { display: block; }
.field.has-error .control { border-color: var(--danger); }

.control {
  width: 100%;
  font-size: 16px; /* >=16 防止 iOS 缩放 */
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
  font-family: inherit;
}
.control:focus { border-color: var(--brand-yellow-deep); box-shadow: 0 0 0 3px rgba(255,219,73,.28); }
.control::placeholder { color: #b6a98c; }
textarea.control { resize: vertical; min-height: 80px; }

/* 时间段网格 */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.slot {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  font-size: 15px;
  cursor: pointer;
  background: #fff;
  transition: all .12s ease;
  user-select: none;
}
.slot .slot-time { font-weight: 600; }
.slot .slot-state { font-size: 11px; color: var(--muted); margin-top: 4px; }
.slot:not(.disabled):hover { border-color: var(--brand-yellow-deep); }
.slot.selected {
  border-color: var(--brand-yellow);
  background: var(--brand-red);
  color: #fff;
  box-shadow: 0 0 0 2px var(--brand-yellow) inset;
}
.slot.selected .slot-state { color: #ffe9b8; }
.slot.disabled {
  background: var(--row-disabled);
  color: #9a958a;
  cursor: not-allowed;
  text-decoration: line-through;
}
.slot.empty { border-style: dashed; color: var(--muted); cursor: default; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius);
  padding: 13px 18px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .12s ease, transform .1s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand-red); color: #fff; width: 100%; }
.btn-primary:not([disabled]):hover { background: var(--brand-red-deep); }
.btn-brass { background: var(--brass); color: #fff; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--ink-soft);
}
.btn-sm { padding: 8px 12px; font-size: 13px; font-weight: 500; }
.btn-danger { background: var(--danger); color: #fff; }
/* 删除按钮：红色描边，区别于普通操作 */
.btn-danger-ghost {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}
.btn-danger-ghost:hover { background: var(--danger-soft); }

.btn-row { display: flex; gap: 10px; margin-top: 18px; }

/* 成功结果 */
.result {
  text-align: center;
  padding: 30px var(--pad) 8px;
}
.result .check {
  width: 64px; height: 64px; margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: grid; place-items: center;
  font-size: 30px;
}
.result h2 { margin: 0 0 6px; font-size: 19px; }
.result p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }

.summary {
  text-align: left;
  margin: 8px 0 18px;
}
.summary dt {
  font-size: 12px; color: var(--muted); margin-top: 12px;
}
.summary dt:first-child { margin-top: 0; }
.summary dd {
  margin: 2px 0 0; font-size: 15px; font-weight: 600; color: var(--ink);
  word-break: break-all;
}

/* 预约成功页：统一内边距，信息区不再顶到两边 */
.result-card { padding: 30px 20px 24px; }
.result-card .result { padding: 0 0 4px; }
.result-card .summary {
  margin: 18px 0 0;
  padding: 16px 0 4px;
  border-top: 1px solid var(--border);
}
.result-card .summary dt {
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
  font-weight: 500;
}
.result-card .summary dt:first-child { margin-top: 0; }
.result-card .summary dd {
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
}
.result-actions {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-actions .btn-ghost { align-self: center; }

/* 顶部信息条 */
.notice {
  background: #fbf4e6;
  border-bottom: 1px solid #ecdcb4;
  color: #7a5a1d;
  font-size: 13px;
  padding: 8px var(--pad);
  text-align: center;
}

/* loading / 轻提示 */
.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translateX(-50%);
  background: rgba(31,42,54,.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 100;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
  max-width: 88vw;
}
.toast.show { opacity: 1; }

.loading { text-align: center; color: var(--muted); padding: 16px; font-size: 13px; }

/* ============ 后台（桌面优先） ============ */
.admin-body { background: #f0eee8; max-width: 100%; }
.admin-shell { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }

.admin-topbar {
  background: var(--brand-red);
  color: #fff;
  padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 3px solid var(--brand-yellow);
}
.admin-topbar .brand { font-weight: 700; letter-spacing: .5px; }
.admin-topbar .spacer { flex: 1; }
.admin-topbar .me { font-size: 13px; color: #ffe9b8; }
.admin-topbar .me b { color: var(--brand-yellow); }
/* 后台 Logo 略大，白底座 */
.admin-topbar .topbar-logo { height: 38px; max-width: 96px; }

.filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  margin-bottom: 16px;
}
.filters .field { margin: 0; min-width: 140px; flex: 1; }
.filters .field label { font-size: 12px; }
.filters .control { padding: 8px 10px; font-size: 14px; }

.table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
}
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
table.data th, table.data td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data th {
  background: var(--brand-yellow-soft); color: var(--ink); font-weight: 700;
  position: sticky; top: 0;
}
table.data tr:hover td { background: #fdf6e8; }
.status-tag {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 12px;
}
.status-submitted { background: #eef1f5; color: #51607a; }
.status-confirmed { background: var(--success-soft); color: var(--success); }
.status-cancelled { background: var(--danger-soft); color: var(--danger); }

.pager { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 13px; color: var(--muted); }
.empty-row { text-align: center; color: var(--muted); padding: 30px; }

/* 登录卡 */
.login-card { max-width: 360px; margin: 60px auto; }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card .lead { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

/* 模态 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(31,42,54,.45);
  display: none; align-items: center; justify-content: center; z-index: 50;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg);
  max-width: 360px; width: 100%; padding: 22px;
  box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 6px; font-size: 17px; }
.modal p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
  .filters { display: block; }
  .filters .field { margin-bottom: 10px; }
}

/* 首页顶栏手机端单行紧凑：隐藏手机号与“我的”，后台缩短为“后台”，Logo 缩小 */
@media (max-width: 560px) {
  .topbar { padding: 10px var(--pad); gap: 8px; }
  .topbar .brand { font-size: 20px; }
  .topbar-home .user-bar .phone { display: none; }
  .topbar-home .user-bar .my-link { display: none; }
  .topbar .badge { padding: 7px 11px; font-size: 12px; }
  .topbar .badge .full { display: none; }
  .topbar .badge .short { display: inline; }
  .topbar-logo { height: 30px; max-width: 56px; padding: 2px 4px; }
}

/* ===== 用户登录 / 我的 页 ===== */
.login-card { padding: 26px 20px 22px; }
.login-head { margin-bottom: 20px; }
.login-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .5px;
}
.login-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.login-card .field { margin-bottom: 18px; }
.login-card .control { padding: 12px 14px; }
/* 验证码输入框与按钮等高对齐 */
.login-card .code-row .btn-code {
  padding: 12px 0;
  font-size: 14px;
  font-weight: 600;
}
.login-card .btn-primary { margin-top: 4px; }
.login-card .login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; line-height: 1.5; }

/* 验证码行：输入框 + 获取按钮并排 */
.code-row { display: flex; gap: 10px; align-items: stretch; }
.code-row .control { flex: 1; min-width: 0; }
.code-row .btn-code { flex: 0 0 122px; white-space: nowrap; }

/* 顶栏用户登录态 */
.user-bar { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--paper); }
.user-bar .phone { font-weight: 600; }
.user-bar .link { color: var(--paper); opacity: .85; text-decoration: none; cursor: pointer; background: none; border: none; padding: 0; font-size: 13px; }
.user-bar .link:hover { opacity: 1; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

.my-list { display: flex; flex-direction: column; gap: 10px; }
.my-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; }
.my-card .row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin: 2px 0; }
.my-card .row .k { color: var(--muted); }
.my-card .row .v { color: var(--ink); font-weight: 500; text-align: right; }
.my-card .head { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11px; }
.tag.submitted { background: var(--brass-soft); color: #6b4a12; }
.tag.confirmed { background: var(--success-soft); color: var(--success); }
.tag.cancelled { background: var(--danger-soft); color: var(--danger); }
.empty-state { text-align: center; color: var(--muted); padding: 30px 0; font-size: 13px; }
