:root {
  /* 配色对齐清华大学 ASE 网站（主色 #00997f 清华绿 / 深绿字 #00332b / 浅灰底 #f2f2f2） */
  --bg: #f2f2f2;
  --panel: #ffffff;
  --ink: #16241f;
  --ink-soft: #5b6b67;
  --line: #e6e6e6;
  --brand: #00997f;
  --brand-soft: #e6f5f1;
  --brand-deep: #00594b;
  --teal: #007081;
  --green: #00806a;
  --green-soft: #e8f5f0;
  --red: #d2483b;
  --red-soft: #fbeae8;
  --amber: #c77700;
  --amber-soft: #fbf3e3;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(0, 51, 43, 0.10);
  --shadow-sm: 0 2px 10px rgba(0, 51, 43, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f2f2f2; background: var(--bg);
  color: #16241f; color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- 布局 ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px 40px; }

.topbar {
  position: -webkit-sticky; /* 旧版 iOS Safari 需要前缀 */
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,0.92); /* 不支持 backdrop-filter 时仍是不透明底 */
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid #e6e6e6; border-bottom: 1px solid var(--line);
}
.topbar .inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #00997f, #007081); background: linear-gradient(135deg, var(--brand), var(--teal));
  color: #fff; display: grid; place-items: center; font-size: 16px; overflow: hidden; flex: none;
}
.brand .logo.has-img { background: none; padding: 0; }
.brand .logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; display: block; }
.brand .brand-txt { display: flex; flex-direction: column; justify-content: center; line-height: 1.2; }
.brand .brand-name { font-weight: 800; font-size: 17px; line-height: 1.15; }
.brand small { font-weight: 500; color: #5b6b67; color: var(--ink-soft); font-size: 12px; }
.brand small { font-weight: 500; color: #5b6b67; color: var(--ink-soft); font-size: 12px; }
.topnav { margin-left: auto; display: flex; gap: 4px; }
.topnav a {
  padding: 7px 13px; border-radius: 10px; color: #5b6b67; color: var(--ink-soft); font-weight: 600; font-size: 14px;
}
.topnav a.active, .topnav a:hover { background: #e6f5f1; background: var(--brand-soft); color: #00997f; color: var(--brand); }

/* ---------- 通用 ---------- */
.card { background: #ffffff; background: var(--panel); border: 1px solid #e6e6e6; border: 1px solid var(--line); border-radius: 16px; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0, 51, 43, 0.06); box-shadow: var(--shadow-sm); }
.section-title { font-size: 18px; font-weight: 800; margin: 26px 0 14px; display: flex; align-items: center; gap: 8px; }
.section-title .sub { font-weight: 500; color: #5b6b67; color: var(--ink-soft); font-size: 13px; }
.muted { color: #5b6b67; color: var(--ink-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; font-weight: 700; font-size: 14px;
  padding: 10px 16px; border-radius: 11px; background: #00997f; background: var(--brand); color: #fff;
  transition: transform .05s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #e6f5f1; background: var(--brand-soft); color: #00997f; color: var(--brand); }
.btn.teal { background: #007081; background: var(--teal); }
.btn.line { background: #fff; color: #16241f; color: var(--ink); border: 1px solid #e6e6e6; border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; background: #eef2f7; color: #5b6b67; color: var(--ink-soft);
}
.chip.green { background: #e8f5f0; background: var(--green-soft); color: #00806a; color: var(--green); }
.chip.red { background: #fbeae8; background: var(--red-soft); color: #d2483b; color: var(--red); }
.chip.amber { background: #fbf3e3; background: var(--amber-soft); color: #c77700; color: var(--amber); }
.chip.blue { background: #e6f5f1; background: var(--brand-soft); color: #00997f; color: var(--brand); }

/* ---------- Hero ---------- */
.hero {
  margin-top: 18px; padding: 26px; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, #00997f 0%, #007081 100%);
  box-shadow: 0 6px 24px rgba(0, 51, 43, 0.10); box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 6px; font-size: 24px; }
.hero p { margin: 0 0 18px; opacity: .92; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn.line { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.4); }

/* ---------- 会议室网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.room-card { overflow: hidden; display: flex; flex-direction: column; }
/* 用 padding-top 百分比撑出 16:10，替代 aspect-ratio（Safari 15 以下不支持，
   会导致卡片高度塌陷、图片不可见）；img 绝对定位铺满，所有浏览器表现一致。 */
.room-card .thumb { position: relative; height: 0; padding-top: 62.5%; background: #eef2f7; overflow: hidden; }
.room-card .thumb img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.room-card .cap-badge {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(17,24,39,.72); color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
}
.room-card .body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.room-card .name { font-size: 16px; font-weight: 800; }
.room-card .meta { color: #5b6b67; color: var(--ink-soft); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; }
.room-card .eq { display: flex; gap: 5px; flex-wrap: wrap; }
.room-card .foot { margin-top: auto; padding-top: 6px; }

/* ---------- 会议室数量自适应版式 ----------
   2 间：两张横向大卡（图左/信息右），一眼看全；
   3 间：三等分卡片，宽度更充裕；
   4 间及以上：沿用默认 auto-fill 网格（4 间时观感最佳）。 */
.grid.count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.count-2 .room-card { flex-direction: row; min-height: 210px; }
.grid.count-2 .room-card .thumb { width: 44%; flex: 0 0 44%; height: auto; padding-top: 0; }
.grid.count-2 .room-card .thumb img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.grid.count-2 .room-card .cap-badge { left: 8px; bottom: 8px; }
.grid.count-2 .room-card .body { padding: 16px 18px; gap: 9px; justify-content: center; }
.grid.count-2 .room-card .foot .btn { font-size: 13px; }
.grid.count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px), (max-width: 380px) {
  .grid.count-2 { grid-template-columns: 1fr; }
  .grid.count-2 .room-card { flex-direction: column; min-height: 0; }
  .grid.count-2 .room-card .thumb { width: 100%; flex: none; padding-top: 62.5%; height: 0; }
  .grid.count-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) { .grid.count-3 { grid-template-columns: 1fr; } }

/* ---------- 详情 ---------- */
.kv { display: flex; gap: 8px; color: #5b6b67; color: var(--ink-soft); font-size: 13px; line-height: 1.35; }
.kv b { color: #16241f; color: var(--ink); font-weight: 700; }

/* 详情页新版式：左=合并卡片(名称 | 信息) / 右=图片(无文字)，行距紧凑，整体高度压缩约一半 */
.detail-hero-band { display: flex; gap: 12px; align-items: stretch; margin-top: 12px; }
.dh-card { flex: 1 1 50%; min-width: 0; display: flex; gap: 12px; align-items: stretch; background: #ffffff; background: var(--panel); border: 1px solid #e6e6e6; border: 1px solid var(--line); border-radius: 16px; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0, 51, 43, 0.06); box-shadow: var(--shadow-sm); padding: 10px 14px; }
.dh-name-col { flex: 0 0 22%; min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding-right: 10px; border-right: 1px solid #e6e6e6; border-right: 1px solid var(--line); }
.dh-name { font-size: 20px; font-weight: 800; line-height: 1.15; word-break: break-word; color: #16241f; color: var(--ink); }
.dh-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.dh-img { flex: 1 1 50%; min-width: 0; position: relative; border-radius: 16px; border-radius: var(--radius); overflow: hidden; box-shadow: 0 6px 24px rgba(0, 51, 43, 0.10); box-shadow: var(--shadow); min-height: 96px; max-height: 118px; background: #eef2f7; }
.dh-img img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 760px) {
  .detail-hero-band { flex-direction: column; }
  .dh-card { flex-direction: column; }
  .dh-name-col { border-right: none; border-bottom: 1px solid #e6e6e6; border-bottom: 1px solid var(--line); padding: 6px 2px; }
  .dh-img { min-height: 120px; max-height: 140px; }
}
/* 设置页 */
.set-wrap { display: grid; gap: 16px; }
.set-section .set-title { font-weight: 800; font-size: 15px; margin: 0 0 8px 2px; color: #16241f; color: var(--ink); }
.set-section .card { padding: 14px; display: grid; gap: 12px; }
.set-section .save-row { margin-top: 4px; }
.ta { border: 1px solid #e6e6e6; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 14px; font-family: inherit; color: #16241f; color: var(--ink); width: 100%; resize: vertical; }
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.switch-row input { width: 18px; height: 18px; accent-color: #00997f; accent-color: var(--brand); }

@media (max-width: 860px) {
  .detail-layout { flex-direction: column; }
  .detail-left { position: static; flex: 1 1 auto; max-width: 100%; width: 100%; }
}

/* ---------- 筛选条 ---------- */
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: #5b6b67; color: var(--ink-soft); font-weight: 600; }
.field input, .field select {
  border: 1px solid #e6e6e6; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 14px;
  background: #fff; color: #16241f; color: var(--ink); min-width: 130px;
}
.field input:focus, .field select:focus { outline: 2px solid #e6f5f1; outline: 2px solid var(--brand-soft); border-color: #00997f; border-color: var(--brand); }

/* 密码输入框 + 显示/隐藏眼睛开关 */
.pwd-wrap { position: relative; display: flex; flex: 1 1 auto; min-width: 0; }
.pwd-wrap input { flex: 1 1 auto; min-width: 0; padding-right: 42px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; cursor: pointer; padding: 0; border-radius: 8px;
  color: #7a8a86; color: var(--ink-soft); -webkit-tap-highlight-color: transparent;
}
.pwd-eye:hover { background: #f0f6f4; background: var(--brand-soft); }
.pwd-eye svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pwd-eye .pe-dot { fill: currentColor; stroke: none; }
.pwd-eye .pe-slash { display: none; }
.pwd-eye.off .pe-slash { display: block; }

/* 后台权限人员：当前密码列 */
.pwd-cell { white-space: nowrap; }
.pwd-plain { display: inline-block; min-width: 62px; font: 13px/1.4 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .5px; color: var(--ink); vertical-align: middle; }
.pwd-eye.mini { position: static; transform: none; display: inline-flex; width: 26px; height: 26px; vertical-align: middle; margin-left: 2px; }
.pwd-copy { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 0; background: transparent; cursor: pointer; font-size: 14px; border-radius: 8px; vertical-align: middle; -webkit-tap-highlight-color: transparent; }
.pwd-copy:hover { background: var(--brand-soft); }

/* ---------- 空挡结果 ---------- */
.result { display: flex; flex-direction: column; gap: 12px; }
.res-item { display: flex; gap: 14px; padding: 13px; align-items: center; }
.res-item .mini { width: 96px; height: 64px; border-radius: 11px; object-fit: cover; flex: none; background: #eef2f7; }
.res-item .info { flex: 1; min-width: 0; }
.res-item .info .t { font-weight: 800; font-size: 15px; }
.res-item .info .m { color: #5b6b67; color: var(--ink-soft); font-size: 13px; }
.res-item .act { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.booking-line {
  border-left: 3px solid #e6e6e6; border-left: 3px solid var(--line); padding: 6px 0 6px 12px; margin: 6px 0;
  font-size: 13px;
}
.booking-line .t { font-weight: 700; }
.booking-line .c { color: #5b6b67; color: var(--ink-soft); }
.empty { text-align: center; color: #5b6b67; color: var(--ink-soft); padding: 26px; }

/* ---------- 表单 ---------- */
.form { padding: 18px; display: grid; gap: 14px; }
.form .field input, .form .field select { min-width: 0; width: 100%; }
.form .hint { font-size: 12px; color: #5b6b67; color: var(--ink-soft); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Modal ---------- */
.overlay {
  /* 不用 inset（Safari 14.1 / Chrome 87 以下不认识，会导致弹窗不覆盖屏幕） */
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(15,23,42,.45);
  display: grid; place-items: center; padding: 18px; z-index: 50;
}
.modal { width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; padding: 0; }
.modal .head { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid #e6e6e6; border-bottom: 1px solid var(--line); font-weight: 800; }
.modal .head .x { margin-left: auto; cursor: pointer; color: #5b6b67; color: var(--ink-soft); font-size: 20px; line-height: 1; }
.modal .body { padding: 18px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px;
  z-index: 80; box-shadow: 0 6px 24px rgba(0, 51, 43, 0.10); box-shadow: var(--shadow); opacity: 0; transition: opacity .2s, transform .2s; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }

/* ---------- 申请记录 ---------- */
.app-row { padding: 13px 14px; display: grid; gap: 4px; }
.app-row .top { display: flex; align-items: center; gap: 8px; }
.app-row .top .nm { font-weight: 800; }
.app-row .kv2 { color: #5b6b67; color: var(--ink-soft); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.app-row .acts { margin-top: 6px; display: flex; gap: 8px; }

/* ---------- 权限人员表格 ---------- */
.perm-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #e6e6e6; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ptable { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 13px; }
.ptable th, .ptable td { border-bottom: 1px solid #e6e6e6; border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: middle; }
.ptable thead th { background: #f3f7f4; color: #16241f; color: var(--ink); font-weight: 700; position: -webkit-sticky; position: sticky; top: 0; white-space: nowrap; }
.ptable tbody tr:hover { background: #f7faf9; }
.ptable td.acts { white-space: nowrap; display: flex; gap: 8px; flex-wrap: wrap; }

/* 全部预订列表：筛选条 + 表格 */
.ab-filter { align-items: flex-end; }
.ab-filter .field input, .ab-filter .field select { min-width: 150px; }
.abtable { min-width: 860px; }
.abtable td.acts { display: table-cell; white-space: nowrap; }
.book-hint { line-height: 1.5; }
footer.foot { text-align: center; color: #5b6b67; color: var(--ink-soft); font-size: 12px; padding: 22px 0 6px; }

@media (max-width: 560px) {
  .two { grid-template-columns: 1fr; }
  .res-item .mini { width: 76px; height: 56px; }
  .hero h1 { font-size: 21px; }
}

/* ---------- 周视图网格 ---------- */
.room-weeks { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.room-week { padding: 14px; overflow: hidden; }
.rw-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.rw-head .rthumb { width: 62px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; background: #eef2f7; }
.rw-info { flex: 1; min-width: 0; }
.rw-name { font-weight: 800; font-size: 16px; }
.rw-cap { color: #5b6b67; color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.btn.xs { padding: 6px 12px; font-size: 12px; border-radius: 9px; }

.week-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wtable { border-collapse: collapse; min-width: 720px; width: 100%; font-size: 13px; }
.wtable th, .wtable td { border: 1px solid #e6e6e6; border: 1px solid var(--line); vertical-align: middle; }
.wtable thead th { background: #f8fafc; position: -webkit-sticky; position: sticky; top: 0; z-index: 1; text-align: center; padding: 6px 4px; font-size: 13px; }
.wtable thead th .dt { color: #5b6b67; color: var(--ink-soft); font-weight: 500; font-size: 12px; margin-top: 1px; }
.wtable th.corner { position: -webkit-sticky; position: sticky; left: 0; z-index: 4; background: #f8fafc; width: 92px; min-width: 92px; }
.wtable td.time-cell { position: -webkit-sticky; position: sticky; left: 0; z-index: 2; background: #fff; font-weight: 700; font-size: 12.5px; text-align: center; width: 92px; min-width: 92px; padding: 5px; color: #16241f; color: var(--ink); }
.wtable td.day-cell { text-align: center; padding: 4px; width: 110px; min-width: 100px; height: 40px; }
.slot { border-radius: 7px; padding: 5px 6px; font-size: 12.5px; min-height: 36px; cursor: pointer; }
.slot.free { background: #f3f7ff; border: 1px dashed #bcd0ff; color: #5b6b67; color: var(--ink-soft); display: flex; flex-direction: column; justify-content: center; align-items: center; }
.slot.free .add { color: #00997f; color: var(--brand); font-weight: 700; margin-top: 1px; }
.slot.free:hover { background: #e6efff; }
.slot.booked { background: #f1f3f5; color: #6b7280; border: 1px solid #e2e6ec; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 5px; padding: 0 7px; height: 100%; overflow: hidden; box-sizing: border-box; }
.slot.booked:hover { background: #e9ecef; }
.slot.booked .bk-tag { flex: none; font-size: 10px; font-weight: 700; color: #fff; background: #9ca3af; border-radius: 5px; padding: 1px 5px; }
.slot.booked .bk-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: #4b5563; font-size: 12.5px; }

/* 2~3 间会议室：周视图「切换卡 + 大周表」版式 */
.rw-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.rw-tab {
  border: 1px solid #e6e6e6; border: 1px solid var(--line); background: #fff;
  color: #5b6b67; color: var(--ink-soft); font-weight: 700; font-size: 14px;
  padding: 10px 20px; border-radius: 12px; cursor: pointer;
}
.rw-tab.active { background: #00997f; background: var(--brand); border-color: #00997f; border-color: var(--brand); color: #fff; }
.rw-feature { padding: 16px; }
.rw-banner { display: flex; gap: 14px; align-items: center; margin-bottom: 14px;
  padding-bottom: 14px; border-bottom: 1px solid #e6e6e6; border-bottom: 1px solid var(--line); }
.rw-banner-img { width: 150px; height: 104px; border-radius: 12px; object-fit: cover; flex: none; background: #eef2f7; }
.rw-banner-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.rw-banner-body .rw-name { font-size: 19px; }
.rw-banner-body .rw-eq { display: flex; gap: 5px; flex-wrap: wrap; }
.rw-banner-body .rw-desc { color: #5b6b67; color: var(--ink-soft); font-size: 13px; }
@media (max-width: 560px) {
  .rw-banner-img { width: 100px; height: 76px; }
  .rw-banner-body .rw-name { font-size: 16px; }
  .rw-tab { padding: 9px 14px; font-size: 13px; }
}

/* ---------- 顶部身份按钮 ---------- */
.topnav .ident { margin-left: 2px; padding: 7px 12px; border-radius: 10px; color: #00997f; color: var(--brand); font-weight: 700; font-size: 13px; border: 1px solid #e6f5f1; border: 1px solid var(--brand-soft); background: #e6f5f1; background: var(--brand-soft); }
.topnav .ident.on { color: #fff; background: #00997f; background: var(--brand); border-color: #00997f; border-color: var(--brand); }
.topnav a.logout-link { color: #d2483b; color: var(--red); }
.topnav a.logout-link:hover { background: #fbeae8; background: var(--red-soft); color: #d2483b; color: var(--red); }

/* ---------- 首页访客锁定卡 ---------- */
.room-card.locked { cursor: default; }
.room-card.locked .foot .btn { opacity: .7; }

/* ---------- 预订确认单（可打印） ---------- */
.confirm { padding: 20px; background: #fff; border-radius: 14px; }
.confirm .ctop { text-align: center; color: #00997f; color: var(--brand); font-weight: 800; letter-spacing: 2px; font-size: 13px; }
.confirm .croom { text-align: center; margin: 6px 0 16px; font-size: 22px; color: #16241f; color: var(--ink); }
.confirm .crow { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #e6e6e6; border-bottom: 1px dashed var(--line); font-size: 14px; }
.confirm .crow span { color: #5b6b67; color: var(--ink-soft); }
.confirm .crow b { color: #16241f; color: var(--ink); text-align: right; }
.confirm .ccode { margin-top: 12px; font-size: 12px; color: #5b6b67; color: var(--ink-soft); text-align: center; }
.confirm .cnote { margin-top: 10px; padding: 10px 12px; background: #f5f8ff; border: 1px dashed #e6f5f1; border: 1px dashed var(--brand-soft); border-radius: 10px; font-size: 13px; color: #16241f; color: var(--ink); line-height: 1.6; text-align: left; white-space: pre-wrap; }
.confirm .ctip { margin-top: 8px; font-size: 12px; color: #5b6b67; color: var(--ink-soft); text-align: center; }
/* 表单字段级错误提示（如手机号格式校验） */
.fielderr { color: #d23f3f; font-size: 12px; margin-top: 4px; }

/* ---------- 打印：仅保留确认单 ---------- */
@media print {
  body * { visibility: hidden !important; }
  #printCard, #printCard * { visibility: visible !important; }
  #printCard { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none !important; }
  .no-print { display: none !important; }
  .overlay { position: static !important; background: #fff !important; padding: 0 !important; }
}

/* ---------- 后台标签页 ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid #e6e6e6; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { padding: 10px 16px; border: none; background: none; cursor: pointer; font-weight: 700; color: #5b6b67; color: var(--ink-soft); border-bottom: 2px solid transparent; font-size: 14px; }
.tab.active { color: #00997f; color: var(--brand); border-bottom-color: #00997f; border-bottom-color: var(--brand); }
.me-topbar { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.me-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 16px; align-items: stretch; position: relative; }
.me-grid::before { content: ""; position: absolute; top: 46px; bottom: 0; left: 50%; border-left: 1px dashed #e6e6e6; border-left: 1px dashed var(--line); }
.me-col { min-width: 0; display: flex; flex-direction: column; }
.me-tab { width: 100%; text-align: center; padding: 9px 10px; border: 1px solid #e6e6e6; border: 1px solid var(--line); border-radius: 12px 12px 0 0; background: #fff; color: #5b6b67; color: var(--ink-soft); font-weight: 700; font-size: 15px; cursor: pointer; box-sizing: border-box; }
.me-tab.active { color: #16241f; color: var(--ink); background: #fff; border-color: #e6e6e6; border-color: var(--line); font-weight: 800; }
.me-box { border: 1px solid #e6e6e6; border: 1px solid var(--line); border-radius: 0 0 14px 14px; background: #fff; padding: 12px 16px 14px; box-shadow: 0 2px 10px rgba(0, 51, 43, 0.06); box-shadow: var(--shadow-sm); flex: 1 1 auto; }
.me-name-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; flex-wrap: wrap; }
.me-name { font-size: 21px; font-weight: 800; color: #16241f; color: var(--ink); }
.me-line { display: flex; gap: 10px; padding: 5px 0; font-size: 14px; }
.me-line .ml { color: #5b6b67; color: var(--ink-soft); min-width: 84px; flex: none; }
.me-line .mv { color: #16241f; color: var(--ink); font-weight: 600; }
.field.row { flex-direction: row; align-items: center; }
.field.row label { width: 128px; flex: none; }
.field.row input { flex: 1 1 auto; }
#myApps { max-height: 240px; overflow-y: auto; padding-right: 4px; }
@media (max-width: 720px) {
  .me-grid { grid-template-columns: 1fr; gap: 18px; }
  .me-grid::before { display: none; }
}
.field select { border: 1px solid #e6e6e6; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 14px; background: #fff; color: #16241f; color: var(--ink); min-width: 220px; }

/* ============================================================
   终版：旧内核兼容 + 手机端适配
   ============================================================ */

/* 1) Chrome 57–83 / Safari 10.1–14 只认 grid-gap，不认 grid 容器上的 gap */
.grid { grid-gap: 16px; }
.two, .form { grid-gap: 14px; }
.set-wrap { grid-gap: 16px; }
.set-section .card { grid-gap: 12px; }
.me-grid { grid-gap: 24px; }
.app-row { grid-gap: 4px; }

/* 2) 完全不支持 gap 属性的内核：用 margin 补齐主要间距（布局不塌、可读） */
@supports not (gap: 1px) {
  .topbar .inner > * + *, .topnav > * + *, .hero .cta > * + *, .rw-head > * + *,
  .perm-toolbar > * + *, .me-name-row > * + *, .tabs > * + *, .head > * + * { margin-left: 8px; }
  .form > * + *, .set-wrap > * + *, .room-weeks > * + *, .app-row > * + *,
  .result > * + *, .kv2 > * + * { margin-top: 10px; }
}

/* 3) 手机 / 窄屏：顶部导航改为可横向滑动，避免 375px 屏被挤出屏幕 */
@media (max-width: 720px) {
  .topbar .inner { flex-wrap: wrap; padding: 8px 12px; }
  .brand { font-size: 15px; }
  .brand small { display: none; }
  .topnav {
    width: 100%; margin-left: 0; flex-wrap: nowrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { flex: none; padding: 8px 10px; font-size: 13px; white-space: nowrap; }
  .wrap { padding: 0 12px 32px; }
  .hero { padding: 20px; border-radius: 16px; }
  .hero .cta > * { margin: 4px 6px 4px 0; }
  /* 触摸目标不低于 40px，避免「预订」小按钮点不中 */
  .btn.xs { padding: 9px 12px; font-size: 13px; min-height: 40px; }
  .wtable { min-width: 620px; }
  .wtable td.day-cell { width: 96px; min-width: 92px; }
  .ptable { min-width: 680px; }
  .modal { max-height: 86vh; }
  .field select, .field input { min-width: 0; width: 100%; }
  .field.row { flex-direction: column; align-items: stretch; }
  .field.row label { width: auto; }
  .perm-toolbar { flex-direction: column; align-items: stretch; }
  .confirm .crow { flex-direction: column; gap: 2px; }
  .toast { bottom: 16px; max-width: 94vw; }
}
@media (max-width: 380px) {
  .wtable { min-width: 560px; }
  .grid { grid-template-columns: 1fr; }
}

