/* 房源台账 —— 视觉样式（Apple HIG 风格 v2，令牌与规范见 设计指南-Apple风格-v2.md） */

:root {
  /* 环境层：背景渐变 */
  --bg-top: #FBFCFE;
  --bg-mid: #F0F3F8;
  --bg-bottom: #E7EEF6;

  /* 玻璃层 */
  --glass: rgba(255, 255, 255, .66);
  --glass-soft: rgba(255, 255, 255, .62);
  --glass-line: rgba(255, 255, 255, .9);

  /* 纸张层 */
  --card: rgba(255, 255, 255, .96);
  --field: rgba(118, 118, 128, .06);
  --track: rgba(118, 118, 128, .12);
  --hairline: rgba(15, 23, 42, .05);

  /* 文本 */
  --text: #1D1D1F;
  --text-2: #6E6E73;
  --text-3: #8A9099;

  /* 语义色 */
  --green: #34C759;
  --green-hi: #4ADE6E;
  --green-lo: #1FB04A;
  --blue: #007AFF;
  --orange: #C2410C;
  --red: #FF3B30;
  --red-hi: #FF6155;
  --red-lo: #E02D22;
  --danger: #D2594D;
  --danger-bg: rgba(255, 59, 48, .08);
  --blue-soft: rgba(0, 122, 255, .07);
  /* 房号标签：石墨灰只做标识，和蓝色操作、绿色状态、橙色租金分开 */
  --room-tag-bg: #EDEFF2;
  --room-tag-line: #E1E4E8;
  --room-tag-text: #000000;
  --room-tag-dot: #9CA3AF;
  --green-soft: rgba(52, 199, 89, .08);
  --red-soft: rgba(255, 59, 48, .07);
  /* 不可用：删除在用选项、0 套在用的空态文字 */
  --disabled: #C7CBD1;

  /* 状态标签（三级编码） */
  --status-vacant-bg: #1FA84A;
  --status-vacant-text: #FFFFFF;
  --status-rented-bg: #4B5158;
  --status-rented-text: #FFFFFF;
  --status-blank-text: #6B7280;
  --status-blank-line: #C6CCD5;

  /* 拍摄标记（纯文字，必须弱于状态标签） */
  --photo-shot: #2F9E5B;
  --photo-unshot: #8A9099;

  /* 圆角 */
  --r-bar: 20px;
  --r-filters: 18px;
  --r-card: 20px;
  --r-dialog: 24px;
  --r-control: 10px;
  --r-pill: 999px;

  /* 阴影 */
  --shadow-bar: inset 0 1px 0 var(--glass-line),
    0 1px 2px rgba(15, 23, 42, .04),
    0 12px 32px -12px rgba(15, 23, 42, .14);
  --shadow-card: inset 0 0 0 1px rgba(255, 255, 255, .9),
    0 1px 2px rgba(15, 23, 42, .05),
    0 10px 24px -12px rgba(15, 23, 42, .14),
    0 26px 60px -28px rgba(15, 23, 42, .18);
  --shadow-dialog: inset 0 1px 0 rgba(255, 255, 255, .85),
    0 30px 80px -20px rgba(11, 17, 28, .35);
  --shadow-green: inset 0 1px 0 rgba(255, 255, 255, .45),
    0 1px 2px rgba(31, 176, 74, .24),
    0 8px 20px -8px rgba(31, 176, 74, .55);
  --shadow-red: inset 0 1px 0 rgba(255, 255, 255, .35),
    0 1px 2px rgba(224, 45, 34, .24),
    0 8px 20px -8px rgba(224, 45, 34, .5);

  /* 动效 */
  --ease-out: cubic-bezier(.32, .72, 0, 1);
  --ease-spring: cubic-bezier(.22, 1.2, .36, 1);

  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(1100px 620px at 10% -12%, rgba(52, 199, 89, .10), transparent 62%),
    radial-gradient(900px 540px at 92% 0%, rgba(0, 122, 255, .07), transparent 64%),
    radial-gradient(760px 520px at 52% 108%, rgba(255, 159, 10, .05), transparent 60%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 52%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid rgba(52, 199, 89, .45);
  outline-offset: 2px;
}

/* ---------- 页面骨架 ---------- */

.page {
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px 48px 64px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
  border-radius: var(--r-bar);
  background: var(--glass);
  backdrop-filter: blur(34px) saturate(180%);
  -webkit-backdrop-filter: blur(34px) saturate(180%);
  box-shadow: var(--shadow-bar);
}

h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* 品牌图标：纯装饰，用伪元素补上，不新增 DOM */
h1::before {
  content: "";
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 10.5 12 3l9 7.5'/><path d='M5.5 9.5V20h13V9.5'/></svg>") center / 20px 20px no-repeat,
    linear-gradient(150deg, var(--green-hi), var(--green-lo));
  box-shadow: 0 6px 16px -4px rgba(31, 176, 74, .5);
}

.stats {
  margin: 3px 0 0;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 500;
}

.head-actions {
  display: flex;
  gap: 10px;
}

.banner {
  padding: 10px 48px;
  background: rgba(255, 59, 48, .1);
  color: var(--danger);
  font-size: 14px;
}

/* ---------- 按钮 ---------- */

.btn {
  height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, .85);
  color: #3A3F47;
  font-size: 14px;
  font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .06);
  cursor: pointer;
  transition: background .15s var(--ease-out), transform .12s var(--ease-out), filter .12s var(--ease-out);
}

.btn:hover {
  background: #FFFFFF;
}

.btn:active {
  transform: scale(.985);
  filter: brightness(.97);
}

.btn-primary {
  background: linear-gradient(180deg, var(--green-hi), var(--green-lo));
  color: #FFFFFF;
  box-shadow: var(--shadow-green);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #57E37A, #22B852);
}

/* 新增按钮的「＋」和文字分成两段：手机上只留「＋」，做成圆形图标按钮 */
.btn-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-add .add-plus {
  font-size: 15px;
  line-height: 1;
}

.btn-danger {
  background: linear-gradient(180deg, var(--red-hi), var(--red-lo));
  color: #FFFFFF;
  box-shadow: var(--shadow-red);
}

.btn-danger:hover {
  background: linear-gradient(180deg, #FF7166, #E63A2F);
}

.btn-soft {
  background: rgba(255, 255, 255, .4);
  color: var(--text-2);
}

.btn-soft:hover {
  background: rgba(255, 255, 255, .75);
}

.btn-block {
  width: 100%;
}

/* ---------- 筛选栏 ---------- */

.filters {
  position: relative;
  /* 「更多」面板要压在下面的房源卡片上，整条筛选栏得先抬起一层 */
  z-index: 10;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: var(--r-filters);
  background: var(--glass-soft);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: var(--shadow-bar);
}

.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: var(--track);
}

.seg-item {
  height: 30px;
  padding: 0 16px;
  border: none;
  border-radius: 8.5px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: color 180ms var(--ease-out);
}

.seg-item.is-active {
  background: #FFFFFF;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 1px rgba(15, 23, 42, .06), 0 3px 8px rgba(15, 23, 42, .12);
}

.select-wrap {
  position: relative;
  display: inline-flex;
}

.select-wrap select {
  appearance: none;
  height: 36px;
  padding: 0 34px 0 14px;
  border: none;
  border-radius: var(--r-control);
  background: rgba(255, 255, 255, .6);
  color: var(--text-2);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 1px 2px rgba(15, 23, 42, .04);
  cursor: pointer;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.rent-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rent-range input {
  width: 78px;
  height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: var(--r-control);
  background: rgba(255, 255, 255, .6);
  color: var(--text);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 1px 2px rgba(15, 23, 42, .04);
}

.rent-dash {
  color: var(--text-3);
}

.search {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search input {
  width: 220px;
  height: 36px;
  padding: 0 14px 0 38px;
  border: none;
  border-radius: var(--r-control);
  background: rgba(255, 255, 255, .6);
  color: var(--text);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 1px 2px rgba(15, 23, 42, .04);
}

.search-icon {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-3);
  stroke-width: 1.6;
}

.f-room input {
  width: 170px;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: var(--r-control);
  background: rgba(255, 255, 255, .6);
  color: var(--text);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 1px 2px rgba(15, 23, 42, .04);
}

.f-code input {
  width: 170px;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: var(--r-control);
  background: rgba(255, 255, 255, .6);
  color: var(--text);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 1px 2px rgba(15, 23, 42, .04);
}

/* ---------- 更多筛选：排序、分组、管理员收进一个按钮 ---------- */

.extra-wrap {
  position: relative;
  display: inline-flex;
}

.extra-btn {
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: var(--r-control);
  background: rgba(255, 255, 255, .6);
  color: var(--text-2);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 1px 2px rgba(15, 23, 42, .04);
  cursor: pointer;
}

.extra-btn::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3);
  transform: translateY(-2px) rotate(45deg);
}

.extra-btn[aria-expanded="true"] {
  color: var(--text);
}

.extra-btn[aria-expanded="true"]::after {
  transform: translateY(2px) rotate(-135deg);
}

.extra-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 280px;
  padding: 16px;
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: 0 18px 48px -16px rgba(15, 23, 42, .28), 0 2px 8px rgba(15, 23, 42, .06);
}

.extra-panel[hidden] {
  display: none;
}

.extra-panel .sort {
  position: relative;
  width: 100%;
  margin-left: 0;
  justify-content: space-between;
  gap: 12px;
}

.extra-panel .sort select {
  appearance: none;
  height: 36px;
  padding: 0 34px 0 12px;
  border: none;
  border-radius: var(--r-control);
  background: rgba(255, 255, 255, .6);
  color: var(--text-2);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 1px 2px rgba(15, 23, 42, .04);
  cursor: pointer;
}

.extra-panel .sort::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 13px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.extra-panel .select-wrap {
  width: 100%;
}

.extra-panel .select-wrap select {
  width: 100%;
}

/* 房号框进了面板，跟着面板宽度走，别留一截空 */
.extra-panel .f-room {
  width: 100%;
}

.extra-panel .f-room input {
  width: 100%;
}

.clear-btn {
  padding: 0 6px;
  border: none;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
}

.clear-btn:hover {
  color: var(--text);
}

.sort {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  color: var(--text-3);
  font-size: 13px;
}

.sort select {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
}

/* 分组套用排序的样式，但不参与向右撑开：两个都撑会在行中间空出一段 */
.f-group {
  margin-left: 0;
}

/* ---------- 结果行 ---------- */

.result-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 22px 4px 14px;
  color: var(--text-2);
  font-size: 13.5px;
}

.sort-hint {
  color: var(--text-3);
  font-size: 12.5px;
}

/* ---------- 房源网格 ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

/* 位置分组标题：横跨整行，下一组的卡片自然从新的一行开始 */
.group-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 2px -4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
}

.group-head:first-child {
  margin-top: 0;
}

.group-title {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.group-count {
  color: var(--text-3);
  font-size: 12.5px;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: box-shadow .18s var(--ease-out), transform .18s var(--ease-out);
}

/* 卡片可点进详情：有鼠标时悬停轻抬；触屏不跟 hover，避免点完卡片一直浮着 */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9),
      0 2px 4px rgba(15, 23, 42, .06),
      0 16px 32px -12px rgba(15, 23, 42, .18),
      0 34px 72px -28px rgba(15, 23, 42, .22);
  }
}

.card:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.card-media {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 140px;
  overflow: hidden;
  background: linear-gradient(160deg, #F6F7F9, #E7EBF1);
  color: #98A0AB;
  font-size: 11.5px;
  font-weight: 500;
}

/* 左上角环境高光，避免大面积死灰 */
.card-media::before {
  content: "";
  position: absolute;
  top: -60px;
  left: -30px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .8), transparent);
  pointer-events: none;
}

.card-media svg {
  position: relative;
  width: 38px;
  height: 38px;
  padding: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .7);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  fill: none;
  stroke: #B3BAC5;
  stroke-width: 1.5;
}

.card-media span {
  position: relative;
}

/* 有实拍照片时整块换成封面图 */
.card-media.has-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 占位图的左上角高光是画在照片上方的一层，有照片时必须关掉，否则原图被蒙一层白圈 */
.card-media.has-photo::before {
  display: none;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 7px;
  padding: 14px 15px 0;
}

.card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.01em;
  word-break: break-word;
}

/* 位置可以折行，房号标签整体跟着走，不会被拆开 */
.title-location {
  min-width: 0;
  word-break: break-word;
}

/* 点和房号作为一个整体换行，不会拆成两段 */
.title-room {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
}

/* 分隔点只负责断句，颜色压到最淡，房号仍是视觉重点 */
.title-dot {
  color: var(--room-tag-dot);
  font-weight: 400;
  line-height: 1.1;
}

.room-tag {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border: 1px solid var(--room-tag-line);
  border-radius: 7px;
  background: var(--room-tag-bg);
  color: var(--room-tag-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: nowrap;
}

.rent {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

/* 只有真实金额用橙色大字；「未填」降级为辅助文字，避免缺失值比价格还抢眼 */
.rent.is-filled {
  color: var(--orange);
}

.rent:not(.is-filled) {
  color: var(--text-3);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: normal;
}

.rent-unit {
  margin-left: 2px;
  color: rgba(194, 65, 12, .6);
  font-size: 11.5px;
  font-weight: 500;
}

/* 状态标签：三级编码（空房实心绿 / 已租实心深灰 / 未填空心描边） */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}

.badge-vacant {
  background: var(--status-vacant-bg);
  color: var(--status-vacant-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 8px rgba(31, 168, 74, .25);
}

.badge-rented {
  background: var(--status-rented-bg);
  color: var(--status-rented-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.badge-unknown {
  background: transparent;
  color: var(--status-blank-text);
  box-shadow: inset 0 0 0 1px var(--status-blank-line);
}

/* 拍摄标记：降级为纯文字，一张卡只允许存在一个胶囊 */
.badge-shot {
  height: auto;
  padding: 0;
  background: transparent;
  color: var(--photo-shot);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.badge-unshot {
  height: auto;
  padding: 0;
  background: transparent;
  color: var(--photo-unshot);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.card-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-2);
  font-size: 12.5px;
}

.card-fees {
  margin: 0;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.5;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 19px 15px 15px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.link {
  padding: 2px 0;
  border: none;
  background: none;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.link:hover {
  text-decoration: underline;
}

.link.is-empty {
  min-width: 48px;
}

.link-danger {
  color: var(--danger);
  font-weight: 500;
}

.actions .link[data-action="edit"] {
  color: var(--text-2);
  font-weight: 500;
}

/* ---------- 空状态 ---------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px;
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(160deg, #F6F7F9, #E7EBF1);
}

.empty-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #B3BAC5;
  stroke-width: 1.5;
}

.empty h2 {
  margin: 18px 0 6px;
  font-size: 18px;
}

.empty p {
  margin: 0 0 18px;
  color: var(--text-3);
  font-size: 14px;
}

/* ---------- 提示 ---------- */

.toast {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 60;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(29, 29, 31, .92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: #FFFFFF;
  font-size: 13.5px;
  box-shadow: 0 12px 32px -8px rgba(11, 17, 28, .45);
}

.toast.is-error {
  background: rgba(224, 45, 34, .94);
}

/* ---------- 弹窗通用 ---------- */

.dialog {
  width: 640px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  padding: 0;
  border: none;
  border-radius: var(--r-dialog);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  color: var(--text);
  font-family: var(--font);
  box-shadow: var(--shadow-dialog);
}

.dialog[open] {
  animation: dialog-in 320ms var(--ease-spring);
}

.dialog::backdrop {
  background: rgba(11, 17, 28, .42);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  animation: backdrop-in 220ms ease-out;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dialog-sm {
  width: 440px;
}

.dialog-wide {
  width: 780px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px 0;
}

.dialog-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.01em;
}

.dialog-body {
  padding: 20px 28px 8px;
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 28px 24px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(118, 118, 128, .14);
  color: var(--text-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s var(--ease-out);
}

.icon-btn:hover {
  background: rgba(118, 118, 128, .22);
}

/* ---------- 房源详情 ---------- */

.dialog-detail {
  width: 520px;
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.detail-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: none;
  width: 92px;
  height: 92px;
  border-radius: 14px;
  background: linear-gradient(160deg, #F6F7F9, #E7EBF1);
  color: #98A0AB;
  font-size: 11px;
  font-weight: 500;
}

.detail-media svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: #B3BAC5;
  stroke-width: 1.5;
}

.detail-headings {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.detail-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.01em;
  word-break: break-word;
}

/* 详情标题更大，房号标签同步放大一档，和卡片保持同一识别方式 */
.detail-name .title-room {
  gap: 5px;
}

.detail-name .room-tag {
  padding: 3px 9px;
  font-size: 16.5px;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-media.has-photo {
  overflow: hidden;
  padding: 0;
  cursor: zoom-in;
  background: var(--field);
}

.detail-media.has-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 详情里的媒体分两块：封面单独在上面，其余照片一栏、视频一栏 */
.detail-media-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.detail-media-title {
  margin: 0 0 10px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.detail-videos {
  display: grid;
  gap: 8px;
}

/* 视频和下载按钮算一组：点播放后播放器替换封面，按钮仍留在下面 */
.detail-video-item {
  display: grid;
  gap: 8px;
}

.detail-video-download {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  text-decoration: none;
}

.detail-video-download::before {
  content: "↓";
  margin-right: 6px;
  font-size: 14px;
  line-height: 1;
}

.detail-photo {
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--field);
  cursor: zoom-in;
}

.detail-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-video {
  width: 100%;
  max-height: 320px;
  border-radius: 12px;
  background: #000;
}

/* 后台压缩中的视频占位：与播放器同尺寸同圆角，压完替换时页面不跳 */
.detail-video-processing {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background: var(--field);
  color: var(--text-2);
  font-size: 13px;
}

/* 视频封面：原视频第一帧铺底 + 播放键，点了才换成播放器 */
.detail-video-cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  overflow: hidden;
  cursor: pointer;
}

.detail-video-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* 压暗一层，播放键压在任何画面上都看得清 */
.detail-video-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .28);
}

.detail-video-play {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .55);
  transition: background .15s ease, box-shadow .15s ease;
}

.detail-video-cover:hover .detail-video-play {
  background: rgba(0, 0, 0, .6);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .8);
}

.detail-video-play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-35%, -50%);
  border-left: 18px solid #fff;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
}

/* ---------- 照片查看器 ---------- */

.viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0B0B0C;
  color: #FFFFFF;
}

.viewer::backdrop {
  background: #000000;
}

.viewer[open] {
  display: flex;
  align-items: stretch;
}

.viewer-head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px calc(14px + env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent);
  pointer-events: none;
}

.viewer-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.viewer-count {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .9);
}

/* 缩放只有鼠标设备才有，提示也只在这些设备上显示 */
.viewer-tip {
  display: none;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .45);
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .viewer-tip {
    display: inline;
  }
}

.viewer-close {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #FFFFFF;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

/* 看图时把当前这张设为卡片封面；靠右和关闭键挨在一起 */
.viewer-cover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #FFFFFF;
  font-size: 13px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
  transition: background .15s ease, color .15s ease;
}

/* 下载和设封面并排时，只让下载把两个按钮一起推到右边 */
.viewer-download {
  margin-left: auto;
}

.viewer-download + .viewer-cover {
  margin-left: 0;
}

.viewer-cover:hover:not(:disabled) {
  background: rgba(255, 255, 255, .16);
}

.viewer-cover:disabled {
  color: rgba(255, 255, 255, .5);
  border-color: rgba(255, 255, 255, .16);
  cursor: default;
}

.viewer-track {
  display: flex;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  list-style: none;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.viewer-track::-webkit-scrollbar {
  display: none;
}

.viewer-slide {
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  justify-content: center;
  height: 100%;
  overflow: hidden; /* 放大后只在本屏里平移，不压到相邻照片上 */
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.viewer-slide img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

/* 放大后光标提示可以拖动查看 */
.viewer-track.is-zoomed {
  cursor: grab;
}

.viewer-track.is-zoomed.is-dragging {
  cursor: grabbing;
}

.viewer-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #FFFFFF;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.viewer-prev {
  left: 16px;
}

.viewer-next {
  right: 16px;
}

.viewer-arrow:disabled {
  opacity: .25;
  cursor: default;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(68px, max-content) minmax(0, 1fr);
  gap: 12px 16px;
  margin: 20px 0 8px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}

.detail-list dt {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.detail-list dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

/* ---------- 表单 ---------- */

.field {
  margin-bottom: 16px;
}

.field > label,
.field-row label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-2);
  font-size: 13px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: none;
  border-radius: var(--r-control);
  background: var(--field);
  color: var(--text);
  font-size: 14px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
  transition: background .15s var(--ease-out), box-shadow .15s var(--ease-out);
}

.field input,
.field select {
  height: 42px;
  padding: 0 13px;
}

.field select {
  appearance: none;
}

.field textarea {
  padding: 11px 13px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, .18), inset 0 1px 2px rgba(15, 23, 42, .04);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* 位置输入框的联想下拉：覆盖在输入框下方，不撑开布局 */
.combo {
  position: relative;
}

.combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 220px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, .98);
  box-shadow: inset 0 0 0 1px var(--hairline), 0 16px 40px -12px rgba(11, 17, 28, .28);
}

.combo-item {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.combo-item:hover,
.combo-item.is-active {
  background: var(--field);
}

.field-hint {
  margin: 6px 0 0;
  color: var(--text-3);
  font-size: 12px;
}

.field-error {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.field-error:empty {
  display: none;
}

/* 字段标题右侧的「管理 ›」：点开该字段的选项管理 */
.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.field-label label {
  color: var(--text-2);
  font-size: 13px;
}

.field-manage {
  padding: 0;
  border: none;
  background: none;
  color: var(--blue);
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
}

.field-manage:hover {
  color: #0062CC;
}

/* 位置输入框右侧的展开箭头：点整框就展开全部候选 */
.combo-caret input {
  padding-right: 36px;
}

.combo-mark {
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
}

.select-wrap-field {
  position: relative;
}

.select-wrap-field::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
}

.input-suffix {
  position: relative;
}

.input-suffix input {
  padding-right: 56px;
}

.input-suffix span {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 12px;
}

/* 照片 / 视频：缩略图网格 + 两个添加按钮 */
.media-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.media-grid:empty {
  display: none;
}

.media-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  background: var(--field);
}

.media-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-video {
  padding: 6px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  word-break: break-all;
}

.media-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(11, 17, 28, .62);
  color: #FFFFFF;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.media-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.btn-media {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
}

.btn-media:disabled {
  opacity: .45;
  cursor: default;
}

.seg-block {
  display: flex;
  padding: 3px;
  border-radius: 11px;
  background: var(--track);
}

.seg-block .seg-item {
  flex: 1;
  height: 30px;
}

/* ---------- 选项管理：位置 / 户型 / 管理员 ---------- */

.dialog-options {
  width: 720px;
}

.dialog-options[open] {
  display: flex;
  flex-direction: column;
  height: 520px;
}

.options-summary {
  display: flex;
  justify-content: space-between;
  padding: 4px 28px 0;
  color: var(--text-3);
  font-size: 12.5px;
}

.options-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: none;
  margin: 12px 28px 0;
}

.options-search[hidden] {
  display: none;
}

.options-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  border: none;
  border-radius: var(--r-control);
  background: var(--field);
  color: var(--text);
  font-size: 14px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
}

.options-search input:focus {
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, .18), inset 0 1px 2px rgba(15, 23, 42, .04);
}

.options-list-head,
.option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 140px;
  align-items: center;
  gap: 12px;
}

.options-list-head {
  padding: 16px 28px 8px;
  color: var(--text-3);
  font-size: 12px;
}

.options-list-head span:nth-child(2) {
  text-align: right;
}

.options-list-head span:last-child {
  text-align: right;
}

.options-scroll {
  flex: 1;
  min-height: 0;
  padding: 0 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.options-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.option-row {
  min-height: 52px;
  padding: 6px 12px;
}

.option-row + .option-row {
  box-shadow: inset 0 1px 0 var(--hairline);
}

.option-main {
  min-width: 0;
}

.option-name {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 位置行的副标题：这个位置固定归谁管 */
.option-binding {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-usage {
  color: var(--text-3);
  font-size: 12.5px;
  text-align: right;
  white-space: nowrap;
}

.option-usage.is-zero {
  color: var(--disabled);
}

.option-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.option-action {
  padding: 6px 8px;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--blue);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s var(--ease-out);
}

.option-action:hover {
  background: var(--blue-soft);
}

.option-action.is-danger {
  color: var(--red);
}

.option-action.is-danger:hover {
  background: var(--red-soft);
}

/* 在用选项：文字置灰，但仍可点击，点了给原因 */
.option-action.is-locked {
  color: var(--disabled);
}

.option-action.is-locked:hover {
  background: var(--field);
}

.option-empty {
  padding: 44px 12px;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}

.options-add {
  flex: none;
  padding: 14px 28px 18px;
  border-top: 1px solid var(--hairline);
  background: #FCFCFD;
}

.options-add label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-2);
  font-size: 12.5px;
}

.options-add-row {
  display: flex;
  gap: 10px;
}

.options-add-row input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: none;
  border-radius: var(--r-control);
  background: var(--field);
  color: var(--text);
  font-size: 14px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
}

.options-add-row input:focus {
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, .18), inset 0 1px 2px rgba(15, 23, 42, .04);
}

.options-add-row .btn {
  flex: none;
  height: 42px;
  padding: 0 22px;
}

.option-hint {
  margin: 8px 0 0;
  color: var(--text-3);
  font-size: 12px;
}

/* ---------- 选项改名 ---------- */

.dialog-rename {
  width: 440px;
}

.dialog-rename[open] {
  display: flex;
  flex-direction: column;
}

.dialog-rename .dialog-body {
  overflow-y: auto;
}

.rename-impact {
  margin: 4px 0 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--green-soft);
}

.rename-impact-title {
  margin: 0;
  color: var(--green-lo);
  font-size: 13px;
  font-weight: 600;
}

.rename-impact-text {
  margin: 3px 0 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
}

.rename-affected {
  margin-top: 18px;
}

.rename-affected-title {
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: 12.5px;
}

.rename-affected-list {
  max-height: 168px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.rename-affected-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 2px;
  color: var(--text-2);
  font-size: 12.5px;
}

.rename-affected-list li + li {
  box-shadow: inset 0 1px 0 var(--hairline);
}

.rename-affected-room {
  margin-right: auto;
  color: var(--text);
  font-weight: 500;
}

.rename-affected-arrow {
  color: var(--text-3);
}

.rename-affected-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rename-more {
  margin: 8px 0 0;
  color: var(--text-3);
  font-size: 12px;
}

/* ---------- 选项在用：不能删除 ---------- */

.option-blocked[open] {
  display: flex;
  flex-direction: column;
}

.option-blocked .dialog-body {
  padding: 24px 28px 4px;
  text-align: center;
}

.blocked-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}

.option-blocked h2 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -.01em;
}

.blocked-text {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}

.blocked-foot {
  flex-direction: column;
  align-items: stretch;
  padding-top: 18px;
}

.blocked-foot .btn {
  height: 44px;
}

#blockedOk {
  background: linear-gradient(180deg, #3D95FF, var(--blue));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 8px 20px -8px rgba(0, 122, 255, .55);
}

#blockedOk:hover {
  background: linear-gradient(180deg, #55A5FF, #0071EB);
}

.blocked-link {
  padding: 2px 0;
  border: none;
  background: none;
  color: var(--blue);
  font-size: 13px;
  cursor: pointer;
}

.blocked-link:empty {
  display: none;
}

/* ---------- 删除确认 ---------- */

.danger-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: rgba(255, 59, 48, .1);
}

.danger-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--red-lo);
  stroke-width: 1.5;
}

.dialog-sm h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.delete-question {
  margin: 0 0 8px;
  font-size: 15px;
}

.delete-hint {
  margin: 0;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- 导入向导 ---------- */

.steps {
  display: flex;
  gap: 18px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  color: var(--text-3);
  font-size: 13px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step.is-active {
  color: var(--text);
}

.step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--track);
  font-size: 12px;
}

.step.is-active .step-dot,
.step.is-done .step-dot {
  background: linear-gradient(180deg, var(--green-hi), var(--green-lo));
  color: #FFFFFF;
}

.step.is-done .step-dot {
  font-size: 0;
}

.step.is-done .step-dot::after {
  content: "✓";
  font-size: 12px;
}

.import-pick {
  padding: 40px 20px;
  border: 1.5px dashed rgba(15, 23, 42, .12);
  border-radius: 14px;
  color: var(--text-3);
  text-align: center;
}

.import-pick input {
  max-width: 100%;
}

.import-pick p {
  margin: 12px 0 0;
  font-size: 13px;
}

.stats-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stat-card {
  padding: 18px;
  border-radius: 14px;
  background: var(--field);
}

.stat-card strong {
  display: block;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.stat-card span {
  color: var(--text-3);
  font-size: 13px;
}

.import-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--field);
  color: var(--text-2);
  font-size: 13px;
}

.import-note p {
  margin: 0;
}

.import-note p:first-child {
  color: var(--photo-unshot);
}

.import-note p + p {
  margin-top: 6px;
  color: var(--text-3);
}

.recognized {
  margin: 12px 0 0;
  color: var(--text-3);
  font-size: 12px;
}

.dup-box {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 13px;
}

.dup-box summary {
  cursor: pointer;
}

.dup-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-3);
  font-size: 12px;
}

/* ---------- 账号 ---------- */

.btn-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.account-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: linear-gradient(160deg, var(--green-hi), var(--green-lo));
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 700;
  box-shadow: var(--shadow-green);
}

.account-identity-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.account-name {
  font-size: 18px;
  line-height: 1.25;
}

.account-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 12.5px;
}

.account-role {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.account-role.is-admin {
  background: #EAF8EE;
  color: var(--green-lo);
}

.account-role.is-readonly {
  background: var(--field);
  color: var(--text-2);
}

.account-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--field);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}

.account-buttons {
  display: grid;
  gap: 10px;
}

.account-buttons .btn {
  width: 100%;
}

.dialog-accounts {
  width: 560px;
}

.accounts-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(52vh, 440px);
  overflow-y: auto;
}

.accounts-hint {
  margin: 0;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.55;
}

.account-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}

.account-row:first-child {
  border-top: 1px solid var(--hairline);
}

.account-row.is-disabled {
  opacity: .58;
}

.account-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.account-row-main strong {
  font-size: 14.5px;
  line-height: 1.3;
  word-break: break-word;
}

.account-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 12px;
}

.account-state {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.account-state.is-on {
  background: #EAF8EE;
  color: var(--green-lo);
}

.account-state.is-off {
  background: var(--field);
  color: var(--text-3);
}

.account-row-actions {
  display: flex;
  flex: none;
  gap: 12px;
}

.accounts-empty {
  margin: 0;
  padding: 24px 0;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}

.account-form-error:empty {
  display: none;
}

/* ---------- 手机端专属元素：桌面一律不占位 ---------- */

.btn-more,
.filter-btn,
.sheet-handle,
.filter-more-head,
.filter-apply,
.pick-sheet,
.pick-backdrop,
.head-cancel,
.head-done,
.form-delete {
  display: none;
}

/* 手机端抽屉外壳：桌面不显示，手机端才展开 */
.filter-more {
  display: none;
}

/* ---------- 降级与无障碍 ---------- */

/* 不支持 backdrop-filter 时退回不透明浅色，保持可读 */
@supports not (backdrop-filter: blur(1px)) {
  .page-head,
  .filters {
    background: rgba(255, 255, 255, .94);
  }

  .dialog {
    background: #FFFFFF;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dialog[open],
  .dialog::backdrop {
    animation: none;
  }

  .btn:active {
    transform: none;
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 1279px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 959px) {
  .page {
    padding: 20px 20px 48px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sort {
    margin-left: 0;
  }
}

@media (max-width: 639px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .search input {
    width: 100%;
  }

  .search {
    flex: 1;
  }
}

/* ---------- 手机端：列表主页（≤767） ---------- */

@media (max-width: 767px) {
  /* 页面骨架：左右 20，底部让开 Home 指示条 */
  .page {
    padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
  }

  .banner {
    padding: 10px 20px;
  }

  /* 页头：标题与统计在左，新增与「更多」两个圆按钮在右 */
  .page-head {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 0 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }

  h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.5px;
  }

  /* 手机上不放品牌图标，标题直接当页首 */
  h1::before {
    display: none;
  }

  /* 右上角有了两个圆按钮，统计那行变窄；房源多时会换行，
     balance 让两行长度接近，不出现第二行只剩一个数字 */
  .stats {
    margin-top: 6px;
    font-size: 13px;
    text-wrap: balance;
  }

  /* 换行只能落在项与项之间，不把「已租」拆成两行 */
  .stats .stat {
    white-space: nowrap;
  }

  .head-actions {
    margin-left: auto;
  }

  /* 页头只留新增与「⋯」：导入 / 导出 / 账号都进更多菜单 */
  #btnImport,
  #btnExport,
  #btnAccount {
    display: none;
  }

  .btn-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: var(--glass);
    color: var(--text-2);
    font-size: 20px;
    line-height: 1;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: var(--shadow-bar);
  }

  /* 筛选：搜索 + 筛选按钮一行，状态分段一行；抽屉另开 */
  .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    grid-template-areas:
      "search filter"
      "status status";
    gap: 12px;
    margin-top: 18px;
    padding: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }

  #statusSeg {
    grid-area: status;
    width: 100%;
    height: 40px;
    padding: 3px;
    border-radius: 12px;
  }

  #statusSeg .seg-item {
    flex: 1;
    height: 34px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
  }

  .search {
    grid-area: search;
  }

  .search input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 40px;
    border-radius: 13px;
    background: rgba(255, 255, 255, .85);
    font-size: 16px; /* 小于 16px 时 iOS 聚焦会自动放大页面 */
  }

  .search-icon {
    left: 14px;
    width: 18px;
    height: 18px;
  }

  .filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-area: filter;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 13px;
    background: rgba(255, 255, 255, .85);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
    cursor: pointer;
  }

  .filter-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--text-2);
    stroke-width: 1.7;
    stroke-linecap: round;
  }

  .result-line {
    margin: 18px 2px 12px;
    font-size: 13px;
  }

  /* 卡片：图在左、信息在右，底栏通栏 */
  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    grid-template-areas:
      "media body"
      "foot foot";
    column-gap: 12px;
    padding: 12px;
    border-radius: 18px;
  }

  .card-media {
    grid-area: media;
    align-self: start;
    height: 84px;
    gap: 4px;
    border-radius: 12px;
  }

  .card-media::before {
    top: -40px;
    left: -20px;
    width: 140px;
    height: 140px;
  }

  .card-media svg {
    width: 26px;
    height: 26px;
    padding: 6px;
  }

  /* 84 见方放不下「实拍占位」四个字，图标本身已表达 */
  .card-media span {
    display: none;
  }

  .card-body {
    grid-area: body;
    gap: 5px;
    padding: 0;
  }

  .card-title {
    gap: 5px;
    font-size: 15.5px;
    line-height: 1.35;
  }

  .card-title .title-room {
    gap: 5px;
  }

  .card-title .room-tag {
    font-size: 15px;
  }

  .card-sub {
    gap: 8px;
    font-size: 13px;
  }

  .rent {
    font-size: 19px;
    letter-spacing: -.4px;
  }

  .card-fees {
    overflow: hidden;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .card-foot {
    grid-area: foot;
    margin-top: 12px;
    padding: 10px 0 0;
    border-top: 1px solid var(--hairline);
  }

  .card-foot .actions {
    gap: 14px;
  }

  .card-foot .link {
    padding: 8px 0;
    font-size: 13px;
  }

  /* 删除移到编辑页，卡片上只留两个动作 */
  .card-foot .link-danger {
    display: none;
  }

  /* 主操作收到页头右上角：与「⋯」并排的绿色圆形按钮，只留「＋」 */
  #btnAdd {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 5px 14px -3px rgba(31, 176, 74, .5), var(--shadow-green);
  }

  #btnAdd .add-plus {
    font-size: 22px;
  }

  #btnAdd .add-text {
    display: none;
  }

  /* 空状态：不再套白卡，直接落在底色上 */
  .empty {
    padding: 48px 16px;
    background: none;
    box-shadow: none;
  }

  .empty-icon {
    width: 84px;
    height: 84px;
  }

  .empty-icon svg {
    width: 32px;
    height: 32px;
  }

  .toast {
    left: 20px;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    text-align: center;
  }
}

/* ---------- 手机端：抽屉与弹层（≤767） ---------- */

@media (max-width: 767px) {
  /* 电脑端的「更多」收纳按钮在手机上不出现：排序、分组、管理员都搬进抽屉 */
  .extra-wrap {
    display: none;
  }

  /* 抽屉遮罩：只压暗，不抢焦点 */
  .sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(11, 17, 28, .32);
  }

  .sheet-backdrop[hidden] {
    display: none;
  }

  /* 筛选按钮打开时变绿，和抽屉里的主按钮呼应 */
  .filter-btn[aria-expanded="true"] {
    background: linear-gradient(180deg, var(--green-hi), var(--green-lo));
    box-shadow: 0 6px 16px -6px rgba(31, 176, 74, .6);
  }

  .filter-btn[aria-expanded="true"] svg {
    stroke: #FFFFFF;
  }

  /* 筛选抽屉：从底部升起，内容超出时内部滚动 */
  .filter-more {
    display: flex;
    flex-direction: column;
    /* 字段从 5 个变 7 个，行距收 4px，常见手机一屏正好放得下 */
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 51;
    /* 92vh：加上底部安全区（约 34px）后，七个字段加按钮在常见手机上仍是一屏放完 */
    max-height: 92vh;
    padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
    overflow-y: auto;
    /* 滑到抽屉尽头时不再把滑动传给背后的首页 */
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 28px 28px 0 0;
    background: #FCFCFD;
    box-shadow: 0 -16px 48px -16px rgba(11, 17, 28, .32);
    visibility: hidden;
    transform: translateY(102%);
    transition: transform .34s var(--ease-out), visibility 0s linear .34s;
  }

  .filter-more.is-open {
    visibility: visible;
    transform: none;
    transition: transform .34s var(--ease-out), visibility 0s;
  }

  /* 抽屉开着的时候把首页钉住：手指在筛选页上下滑，动的是筛选页自己 */
  html.sheet-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .sheet-handle {
    display: block;
    width: 36px;
    height: 5px;
    margin: 0 auto 2px;
    border-radius: var(--r-pill);
    background: rgba(60, 60, 67, .18);
  }

  .filter-more-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .filter-more-head h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -.3px;
  }

  .filter-more-head .link {
    font-size: 14px;
  }

  /* 抽屉分组：标题在上，控件整行铺满 */
  .filter-more .f-layout,
  .filter-more .f-location,
  .filter-more .f-room,
  .filter-more .f-code,
  .filter-more .f-manager,
  .filter-more .f-listing58,
  .filter-more .f-photo,
  .filter-more .rent-range,
  .filter-more .sort {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-left: 0;
  }

  .filter-more .f-layout::before,
  .filter-more .rent-range::before,
  .filter-more .f-location::before,
  .filter-more .f-room::before,
  .filter-more .f-code::before,
  .filter-more .f-manager::before,
  .filter-more .f-listing58::before,
  .filter-more .f-photo::before,
  .filter-more .sort::before {
    flex: 0 0 100%;
    color: var(--text-3);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .2px;
  }

  .filter-more .f-layout::before {
    content: "户型";
  }

  .filter-more .rent-range::before {
    content: "租金区间";
  }

  .filter-more .f-location::before {
    content: "位置";
  }

  .filter-more .f-room::before {
    content: "房号";
  }

  .filter-more .f-code::before {
    content: "房源编号";
  }

  .filter-more .sort::before {
    content: "排序";
  }

  .filter-more .f-group::before {
    content: "分组";
  }

  .filter-more .f-manager::before {
    content: "管理员";
  }

  .filter-more .f-listing58::before {
    content: "58上架状态";
  }

  .filter-more .f-photo::before {
    content: "实拍状态";
  }

  .filter-more .select-wrap {
    flex: 1;
  }

  .filter-more .select-wrap select,
  .filter-more .sort select,
  .filter-more .rent-range input {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    background: #F2F2F7;
    box-shadow: none;
    font-size: 16px; /* 小于 16px 时 iOS 聚焦会自动放大页面 */
  }

  /* 租金区间两个输入框并排等宽 */
  .filter-more .rent-range input {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  /* 房号和房源编号都是一行输入框，和下拉一样高 */
  .filter-more .f-room input {
    flex: 1;
    width: auto;
    min-width: 0;
    height: 46px;
    padding: 0 12px;
    border: none;
    border-radius: 12px;
    background: #F2F2F7;
    box-shadow: none;
    font-size: 16px;
  }

  .filter-more .f-code input {
    flex: 1;
    width: auto;
    min-width: 0;
    height: 46px;
    padding: 0 12px;
    border: none;
    border-radius: 12px;
    background: #F2F2F7;
    box-shadow: none;
    font-size: 16px;
  }

  .filter-more .rent-dash {
    flex: none;
  }

  .filter-more .sort select {
    padding: 0 12px;
  }

  .filter-more .sort > span {
    display: none;
  }

  /* 抽屉里已有「重置」，不再重复一个「清除筛选」 */
  .filter-more .clear-btn {
    display: none;
  }

  .filter-apply {
    display: block;
    width: 100%;
    height: 52px;
    /* 抽屉里字段变多后，默认的 flex-shrink 会把这个按钮压成一条细线 */
    flex: none;
    margin-top: auto;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
  }

  /* ---------- 手机下拉列表：自己画，点空白处就能退出去 ----------
     原生 <select> 在手机上弹的是系统选择器，不选一项关不掉，
     所以抽屉里的下拉改成点开这一层，选或不选都能随时收起。 */

  .filter-more .select-wrap select,
  .filter-more .sort select {
    pointer-events: none;
  }

  .pick-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 52;
    background: rgba(11, 17, 28, .2);
  }

  .pick-backdrop[hidden] {
    display: none;
  }

  .pick-sheet {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 53;
    max-height: 70vh;
    padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 28px 28px 0 0;
    background: #FCFCFD;
    box-shadow: 0 -16px 48px -16px rgba(11, 17, 28, .36);
    animation: pick-in .22s var(--ease-out);
  }

  .pick-sheet[hidden] {
    display: none;
  }

  @keyframes pick-in {
    from {
      opacity: .5;
      transform: translateY(28px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .pick-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .pick-head h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.3px;
  }

  .pick-head .link {
    font-size: 14px;
  }

  .pick-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .pick-item {
    padding: 13px 12px;
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
  }

  .pick-item.is-active {
    background: #EAF8EE;
    color: var(--green-lo);
    font-weight: 600;
  }

  /* 新增 / 编辑：整屏，底部保存常驻 */
  #formDialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  #formDialog > form {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  #formDialog .dialog-head {
    position: relative;
    justify-content: center;
    padding: calc(14px + env(safe-area-inset-top)) 20px 10px;
  }

  #formDialog .dialog-head h2 {
    font-size: 17px;
    font-weight: 600;
  }

  #formDialog .head-cancel {
    display: block;
    position: absolute;
    left: 20px;
    bottom: 10px;
    height: 34px;
    padding: 0;
    border: none;
    background: none;
    color: var(--blue);
    font-size: 16px;
    cursor: pointer;
  }

  #formDialog .icon-btn {
    position: absolute;
    right: 20px;
    bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #formDialog .dialog-body {
    flex: 1;
    padding: 12px 20px 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 账号相关弹窗：手机上标题居中，左边返回、右边关闭 */
  #accountsDialog .dialog-head,
  #accountFormDialog .dialog-head,
  #passwordDialog .dialog-head {
    position: relative;
    justify-content: center;
    padding: 18px 20px 6px;
  }

  #accountsDialog .head-cancel,
  #accountFormDialog .head-cancel,
  #passwordDialog .head-cancel {
    display: block;
    position: absolute;
    left: 20px;
    bottom: 6px;
    padding: 0;
    border: none;
    background: none;
    color: var(--blue);
    font-size: 16px;
    cursor: pointer;
  }

  #accountsDialog .icon-btn,
  #accountFormDialog .icon-btn,
  #passwordDialog .icon-btn {
    position: absolute;
    right: 20px;
    bottom: 6px;
  }

  #accountsDialog .dialog-body,
  #accountFormDialog .dialog-body,
  #passwordDialog .dialog-body {
    padding: 12px 20px 4px;
  }

  #accountsDialog .dialog-foot,
  #accountFormDialog .dialog-foot,
  #passwordDialog .dialog-foot {
    gap: 10px;
    padding: 10px 20px 20px;
  }

  #accountsDialog .dialog-foot .btn,
  #accountFormDialog .dialog-foot .btn,
  #passwordDialog .dialog-foot .btn {
    flex: 1;
    height: 48px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
  }

  #formDialog .field input,
  #formDialog .field select,
  #accountFormDialog .field input,
  #passwordDialog .field input {
    height: 46px;
  }

  #formDialog .field input,
  #formDialog .field select,
  #formDialog .field textarea,
  #accountFormDialog .field input,
  #passwordDialog .field input {
    font-size: 16px;
  }

  #formDialog .field > label,
  #formDialog .field-row label {
    margin-bottom: 7px;
    font-size: 12.5px;
    font-weight: 600;
  }

  #formDialog .dialog-foot {
    gap: 10px;
    padding: 10px 20px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--hairline);
  }

  #formDialog .dialog-foot .btn {
    flex: 1;
    height: 50px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
  }

  /* 手机上「取消」在顶部，底部只留保存 */
  #formDialog #formCancel {
    display: none;
  }

  /* 删除入口：只在编辑态出现，红色文字 + 淡红底 */
  #formDialog .form-delete {
    display: block;
    width: 100%;
    height: 50px;
    margin: 4px 0 8px;
    border: none;
    border-radius: 14px;
    background: rgba(255, 59, 48, .08);
    color: var(--red-lo);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
  }

  #formDialog .form-delete[hidden] {
    display: none;
  }

  /* 选项管理：整屏，新增区固定在底部 */
  #optionsDialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  #optionsDialog[open] {
    display: flex;
    flex-direction: column;
    height: 100dvh;
  }

  #optionsDialog .options-head,
  #renameOptionDialog .options-head {
    position: relative;
    flex: none;
    justify-content: center;
    padding: calc(14px + env(safe-area-inset-top)) 20px 10px;
  }

  #optionsDialog .options-head h2,
  #renameOptionDialog .options-head h2 {
    font-size: 17px;
    font-weight: 600;
  }

  #optionsDialog .head-cancel,
  #renameOptionDialog .head-cancel {
    display: block;
    position: absolute;
    left: 20px;
    bottom: 10px;
    height: 34px;
    padding: 0;
    border: none;
    background: none;
    color: var(--blue);
    font-size: 16px;
    cursor: pointer;
  }

  #optionsDialog .head-done,
  #renameOptionDialog .head-done {
    display: block;
    position: absolute;
    right: 20px;
    bottom: 10px;
    height: 34px;
    padding: 0;
    border: none;
    background: none;
    color: var(--blue);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
  }

  /* 手机顶部已有返回和完成，不再保留右上角关闭 */
  #optionsDialog .icon-btn,
  #renameOptionDialog .icon-btn {
    display: none;
  }

  #optionsDialog .options-summary {
    flex: none;
    padding: 2px 20px 0;
  }

  #optionsDialog .options-search {
    margin: 10px 20px 0;
  }

  #optionsDialog .options-search input {
    height: 46px;
    font-size: 16px;
  }

  /* 手机上不摆表头：名字一行、用量一行，操作固定在右侧 */
  #optionsDialog .options-list-head {
    display: none;
  }

  #optionsDialog .options-scroll {
    padding: 8px 12px 0;
  }

  #optionsDialog .option-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main actions"
      "usage actions";
    gap: 2px 12px;
    min-height: 62px;
    padding: 9px 8px;
  }

  #optionsDialog .option-main {
    grid-area: main;
  }

  #optionsDialog .option-usage {
    grid-area: usage;
    text-align: left;
  }

  #optionsDialog .option-usage::after {
    content: "在用";
  }

  #optionsDialog .option-usage.is-zero::after {
    content: "在用 · 可删除";
  }

  #optionsDialog .option-actions {
    grid-area: actions;
  }

  #optionsDialog .option-name {
    font-size: 16px;
  }

  #optionsDialog .option-action {
    padding: 8px 6px;
    font-size: 13.5px;
  }

  #optionsDialog .options-add {
    padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
  }

  #optionsDialog .options-add-row input,
  #optionsDialog .options-add-row .btn {
    height: 46px;
  }

  #optionsDialog .options-add-row input {
    font-size: 16px;
  }

  #formDialog .field-label {
    margin-bottom: 7px;
  }

  #formDialog .field-label label {
    font-size: 12.5px;
    font-weight: 600;
  }

  #formDialog .field-manage {
    font-size: 13px;
  }

  /* 选项改名：整屏，保存固定在底部 */
  #renameOptionDialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  #renameOptionDialog[open] {
    display: flex;
    flex-direction: column;
    height: 100dvh;
  }

  #renameOptionDialog .dialog-body {
    flex: 1;
    padding: 12px 20px 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #renameOptionDialog .field input {
    height: 46px;
    font-size: 16px;
  }

  #renameOptionDialog .dialog-foot {
    flex: none;
    padding: 10px 20px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--hairline);
  }

  #renameOptionDialog .dialog-foot .btn {
    flex: 1;
    height: 50px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
  }

  /* 手机上「取消」在顶部，底部只留保存 */
  #renameOptionDialog #renameCancel {
    display: none;
  }

  /* 在用拦截：底部抽屉，按钮通栏 */
  #optionBlockedDialog {
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 28px 28px 0 0;
    background: #FCFCFD;
  }

  #optionBlockedDialog[open] {
    display: flex;
    flex-direction: column;
    animation: sheet-in 340ms var(--ease-out);
  }

  #optionBlockedDialog .dialog-body {
    padding: 8px 20px 4px;
    text-align: center;
  }

  #optionBlockedDialog .sheet-handle {
    display: block;
    width: 36px;
    height: 5px;
    margin: 0 auto 18px;
    border-radius: var(--r-pill);
    background: rgba(60, 60, 67, .18);
  }

  #optionBlockedDialog .blocked-icon {
    margin: 0 auto 14px;
  }

  #optionBlockedDialog h2 {
    font-size: 20px;
  }

  #optionBlockedDialog .dialog-foot {
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  }

  #optionBlockedDialog .dialog-foot .btn {
    height: 50px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
  }

  #optionBlockedDialog .blocked-link {
    padding: 4px 0;
    font-size: 14px;
  }

  /* 房源详情：整屏，底部编辑常驻 */
  #detailDialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  #detailDialog[open] {
    display: flex;
    flex-direction: column;
  }

  #detailDialog .dialog-head {
    position: relative;
    justify-content: center;
    padding: calc(14px + env(safe-area-inset-top)) 20px 10px;
  }

  #detailDialog .dialog-head h2 {
    font-size: 17px;
    font-weight: 600;
  }

  #detailDialog .head-cancel {
    display: block;
    position: absolute;
    left: 20px;
    bottom: 10px;
    height: 34px;
    padding: 0;
    border: none;
    background: none;
    color: var(--blue);
    font-size: 16px;
    cursor: pointer;
  }

  /* 顶部已有「返回」，不再保留右上角关闭 */
  #detailDialog .icon-btn {
    display: none;
  }

  #detailDialog .dialog-body {
    flex: 1;
    padding: 16px 20px 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #detailDialog .detail-media {
    width: 84px;
    height: 84px;
  }

  #detailDialog .detail-name {
    font-size: 18px;
  }

  #detailDialog .dialog-foot {
    gap: 10px;
    padding: 10px 20px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--hairline);
  }

  #detailDialog .dialog-foot .btn {
    flex: 1;
    height: 50px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
  }

  /* 手机上「返回」在顶部，底部只留编辑 */
  #detailDialog #detailCancel {
    display: none;
  }

  #detailDialog .detail-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #detailDialog .detail-video {
    max-height: 220px;
  }

  /* 手机上靠滑动翻图，两侧箭头不占画面 */
  .viewer-arrow {
    display: none;
  }

  /* 照片 / 视频：手机上按钮等高、热区放大 */
  #formDialog .media-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #formDialog .btn-media {
    flex: 1;
    height: 44px;
    font-size: 14px;
  }

  #formDialog .media-remove {
    width: 26px;
    height: 26px;
    font-size: 16px;
  }

  /* 删除确认 / 更多操作：底部 sheet */
  #deleteDialog,
  #moreDialog {
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 28px 28px 0 0;
    background: #FCFCFD;
  }

  #deleteDialog[open],
  #moreDialog[open] {
    animation: sheet-in 340ms var(--ease-out);
  }

  @keyframes sheet-in {
    from {
      transform: translateY(100%);
    }
    to {
      transform: none;
    }
  }

  #deleteDialog .dialog-body {
    padding: 8px 20px 4px;
    text-align: center;
  }

  #deleteDialog .sheet-handle,
  #moreDialog .sheet-handle {
    display: block;
    width: 36px;
    height: 5px;
    margin: 0 auto 14px;
    border-radius: var(--r-pill);
    background: rgba(60, 60, 67, .18);
  }

  #deleteDialog .danger-icon {
    margin: 0 auto 14px;
  }

  /* 房源名单独成胶囊，避免误删时看错对象 */
  #deleteDialog .delete-question {
    display: inline-block;
    margin: 0 0 10px;
    padding: 5px 14px;
    border-radius: var(--r-pill);
    background: var(--field);
  }

  #deleteDialog .dialog-foot {
    gap: 10px;
    padding: 8px 20px calc(16px + env(safe-area-inset-bottom));
  }

  #deleteDialog .dialog-foot .btn {
    flex: 1;
    height: 50px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
  }

  #moreDialog .dialog-body {
    padding: 8px 20px 4px;
  }

  .sheet-title {
    margin: 0 0 14px;
    font-size: 20px;
    letter-spacing: -.3px;
  }

  .sheet-list {
    overflow: hidden;
    border-radius: 16px;
    background: #F2F2F7;
  }

  .sheet-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
  }

  .sheet-row + .sheet-row {
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, .06);
  }

  /* 行尾箭头：告诉用户这一步还会打开下一层 */
  .sheet-row::after {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-right: 1.5px solid var(--text-3);
    border-bottom: 1.5px solid var(--text-3);
    transform: rotate(-45deg);
  }

  .sheet-row-icon {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #FFFFFF;
  }

  .sheet-row-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--text);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .sheet-row-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .sheet-row-text strong {
    font-size: 15px;
    font-weight: 600;
  }

  .sheet-row-text small {
    color: var(--text-3);
    font-size: 12.5px;
  }

  .sheet-foot {
    padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  }

  .sheet-foot .btn-block {
    flex: 1;
    height: 50px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
  }

  /* 导入向导：同样整屏，步骤条固定、内容区滚动 */
  #importDialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  /* display 只在打开时给，否则关闭的弹窗会占满屏幕挡住点击 */
  #importDialog[open] {
    display: flex;
    flex-direction: column;
  }

  #importDialog .dialog-body {
    flex: 1;
    padding: 12px 20px 8px;
    overflow-y: auto;
  }

  #importDialog .dialog-foot {
    padding: 10px 20px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--hairline);
  }

  #importDialog .dialog-foot .btn {
    flex: 1;
    height: 50px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
  }
}

.load-more {
  display: block;
  margin: 26px auto 10px;
  padding: 11px 24px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--text, #1d1d1f);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.load-more:hover {
  background: var(--soft, #f5f5f7);
}

.load-more[hidden] {
  display: none;
}
