:root {
  --pink-main: #0f6f86;
  --pink-soft: #8ed2c6;
  --white: #ffffff;
  --text-main: #0f2e38;
  --text-sub: #466672;
  --danger: #d64040;
  --shadow: 0 8px 28px rgba(8, 92, 113, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text-main);
  background: #9ed8fb;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-shell {
  width: min(100vw, 430px);
  height: min(100vh, 920px);
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.screen {
  width: 100%;
  height: 100%;
}

.hidden {
  display: none !important;
}

.login-screen {
  background: linear-gradient(180deg, #67b9f0 0%, #7ec8f3 52%, #92d4f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 330px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 8px 28px rgba(24, 121, 150, 0.2);
  backdrop-filter: blur(3px);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 24px;
}

.sub,
.hint {
  color: var(--text-sub);
  text-align: center;
}

.sub {
  margin-bottom: 18px;
}

.premium-text {
  font-weight: 700;
  letter-spacing: 1px;
  color: #ff4a4a;
  text-shadow:
    0 0 6px rgba(255, 110, 110, 0.95),
    0 0 14px rgba(255, 66, 66, 0.82),
    0 0 22px rgba(230, 24, 24, 0.6);
}

.hint {
  font-size: 12px;
  margin-top: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 14px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  border: 1px solid #4f8ea0;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--pink-main);
  box-shadow: 0 0 0 3px rgba(247, 134, 170, 0.22);
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.primary-btn {
  width: 100%;
  color: var(--white);
  background: linear-gradient(120deg, rgba(15, 111, 134, 0.88), rgba(245, 154, 200, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 18px rgba(28, 110, 145, 0.24), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.16s ease;
}

.primary-btn:active {
  transform: scale(0.98);
}

.error {
  margin-top: 10px;
  min-height: 18px;
  color: var(--danger);
  text-align: center;
  font-size: 13px;
}

.app-screen {
  display: flex;
  flex-direction: column;
  background: #e8f4ff;
}

.app-header {
  height: 78px;
  padding: 14px 14px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #77abc7;
  background: linear-gradient(180deg, #9dc9e6 0%, #e8f4ff 100%);
}

.app-header h2 {
  font-size: 18px;
}

.app-header p {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-sub);
}

.ghost-btn {
  background: rgba(128, 192, 226, 0.45);
  color: #0f4b6b;
  padding-inline: 14px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.tab-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: #ffffff;
  border: 1px solid #6fabb9;
  border-radius: 14px;
  padding: 14px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

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

.grid-buttons button {
  background: rgba(152, 205, 236, 0.62);
  color: #134d5d;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
}

.grid-buttons button:disabled,
.tab-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.result-item {
  border: 1px solid #7aafbe;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  background: #fff;
}

.remove-item {
  user-select: none;
}

.remove-actions {
  margin-top: 8px;
}

.remove-actions button {
  width: 100%;
  background: #f3c4c4;
  color: #682727;
}

.selectable-item {
  user-select: none;
}

.selectable-item.selected {
  border-color: #4d8d9e;
  background: #e0f0f4;
}

.tab-bar {
  height: 64px;
  border-top: 1px solid #6fa8b7;
  background: #fff;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.tab-btn {
  border-radius: 0;
  background: #e9f4f7;
  color: #365862;
}

.tab-btn.active {
  background: linear-gradient(120deg, rgba(110, 179, 225, 0.82), rgba(240, 163, 208, 0.72));
  color: #0f3f63;
  font-weight: 600;
}

.inline-row {
  display: flex;
  gap: 8px;
}

.inline-row > * {
  flex: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.form-grid .field {
  margin-bottom: 0;
}

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

.building-plan {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.floor-buttons button {
  background: rgba(148, 199, 231, 0.62);
  color: #134e5e;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.floor-buttons .active-floor {
  background: linear-gradient(120deg, rgba(100, 170, 214, 0.88), rgba(237, 160, 203, 0.72));
  color: #0a3e60;
  font-weight: 600;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 340px;
  overflow: auto;
  padding-right: 2px;
}

.room-card {
  border: 1px solid #6ba2b1;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.room-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.room-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #b8dce8;
  color: #104f61;
}

.room-tag.special {
  background: #69c9a8;
  color: #103b2f;
}

.bed-tags {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bed-tag {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.bed-tag.occupied {
  background: #33b763;
}

.bed-tag.empty {
  background: #eb4b4b;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 99;
}

.modal-card {
  width: min(100%, 360px);
  background: #fff;
  border: 1px solid #6fabb9;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-content {
  max-height: 55vh;
  overflow: auto;
  border: 1px solid #7aafbe;
  border-radius: 10px;
  padding: 10px;
  background: #f8fcff;
}

.info-line {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

/* 手机端：除链接、表单外禁止长按系统菜单与文本选择（减少误触） */
@media (max-width: 768px) {
  html,
  body {
    -webkit-touch-callout: none;
  }

  body a[href] {
    -webkit-touch-callout: default;
  }

  .app-shell {
    -webkit-touch-callout: none;
  }

  .app-shell :not(a[href]):not(input):not(textarea):not(select) {
    -webkit-user-select: none;
    user-select: none;
  }

  .app-shell a[href] {
    -webkit-touch-callout: default;
    -webkit-user-select: auto;
    user-select: auto;
  }

  input,
  textarea,
  select {
    -webkit-user-select: text;
    user-select: text;
  }
}

.modal-body-split {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
}

.modal-text-col {
  flex: 1;
  min-width: 0;
}

.modal-photo-col {
  flex: 0 0 108px;
  width: 108px;
}

.bed-photo-thumb {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #7aafbe;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.bed-tags-line {
  margin-top: 6px;
  color: #0f4b6b;
  font-weight: 600;
}

.bed-slot-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bed-slot-actions .tag-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bed-slot-actions .tag-row input {
  flex: 1;
}

.bed-slot-actions .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bed-slot-actions .tag-chip {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #d8eef6;
  color: #104f61;
  border: 1px solid #7aafbe;
}

.bed-slot-actions .tag-chip button {
  margin-left: 6px;
  padding: 0 6px;
  min-height: auto;
  font-size: 11px;
  background: transparent;
  color: #682727;
}

.bed-action-preview {
  margin-top: 8px;
}

.bed-action-preview .bed-photo-thumb {
  max-height: 120px;
}

.hold-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.hold-action-buttons .primary-btn,
.hold-action-buttons .ghost-btn {
  width: 100%;
}

@media (max-width: 420px) {
  .app-shell {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}
