:root {
  --ink: #33231e;
  --muted: #806d65;
  --paper: #fffefd;
  --bg: #fff8f3;
  --rose: #b85c5c;
  --shadow: 0 18px 46px rgba(90, 48, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

.app-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 18px 14px 106px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 4px 18px;
}

.brand {
  display: block;
  color: var(--rose);
  font-size: 12px;
  font-weight: 900;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1.06;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

.pill-btn,
.primary-btn,
.bottom-tab {
  border: 0;
  cursor: pointer;
}

.pill-btn {
  min-width: 64px;
  height: 36px;
  border-radius: 999px;
  color: var(--rose);
  background: #fff;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.calendar-card,
.section-card,
.login-card,
.mine-card,
.review-item,
.booking-item {
  border: 1px solid rgba(55, 35, 30, 0.08);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.calendar-card,
.section-card,
.login-card,
.mine-card {
  padding: 18px;
  margin-bottom: 16px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head span {
  flex: none;
  color: var(--rose);
  font-weight: 900;
}

.section-head.left {
  align-items: flex-start;
}

.calendar-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.day-card {
  width: 74px;
  min-width: 74px;
  height: 92px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(51, 35, 30, 0.08);
  border-radius: 15px;
  background: #f8eee8;
}

.day-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.day-card span {
  display: block;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.78;
  text-align: center;
}

.day-card.busy {
  color: #fff;
  border-color: #d25656;
  background: #d25656;
}

.day-card.locked {
  color: #fff;
  border-color: #7a665f;
  background: #7a665f;
}

.day-card.selected {
  border: 2px solid var(--ink);
}

.busy-panel {
  margin-top: 16px;
  padding: 14px;
  border-radius: 15px;
  background: #fff5f1;
}

.busy-slot {
  display: inline-flex;
  margin: 10px 8px 0 0;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  background: #d25656;
  font-size: 13px;
  font-weight: 900;
}

.poster-section {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.gallery-section {
  width: 100%;
  min-width: 0;
  margin-top: 16px;
}

.gallery-list {
  display: grid;
  gap: 14px;
}

.gallery-card {
  overflow: hidden;
  border: 1px solid rgba(55, 35, 30, 0.08);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.gallery-info {
  padding: 16px;
}

.gallery-info strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
}

.gallery-info p {
  margin-top: 6px;
}

.gallery-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0 12px 12px;
}

.gallery-photos img,
.gallery-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  object-fit: cover;
  background: #f3e6df;
}

.gallery-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.poster-slider {
  display: grid;
  gap: 16px;
}

.poster {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-radius: 24px;
  color: #fffaf7;
  background: linear-gradient(145deg, #7f4248 0%, #3a2226 100%);
}

.poster:nth-child(2) {
  background: linear-gradient(145deg, #2f6f6a 0%, #183c45 100%);
}

.poster:nth-child(3) {
  background: linear-gradient(145deg, #69517b 0%, #34253e 100%);
}

.poster::before {
  content: "";
  position: absolute;
  right: -90px;
  top: -70px;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(255, 250, 247, 0.2);
  border-radius: 50%;
}

.poster-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.poster-kicker {
  color: rgba(255, 250, 247, 0.72);
  font-size: 13px;
  font-weight: 900;
}

.poster-highlight {
  padding: 11px 14px;
  border: 1px solid rgba(255, 250, 247, 0.28);
  border-radius: 999px;
  background: rgba(255, 250, 247, 0.12);
  font-size: 20px;
  font-weight: 900;
}

.poster-title {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 58px;
  font-size: clamp(54px, 14vw, 84px);
  line-height: 0.96;
  font-weight: 900;
}

.poster-subtitle {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 20px;
  color: rgba(255, 250, 247, 0.76);
  font-size: 17px;
  line-height: 1.65;
}

.poster-lines {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 42px;
}

.poster-line {
  padding: 10px 13px;
  border-radius: 999px;
  color: rgba(255, 250, 247, 0.92);
  background: rgba(255, 250, 247, 0.13);
  font-size: 14px;
  font-weight: 800;
}

.poster-note {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 28px;
  color: rgba(255, 250, 247, 0.68);
}

.form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 18px;
}

input[readonly] {
  color: var(--muted);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

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

.booking-tip {
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--rose);
  background: #fff1ed;
  font-weight: 900;
}

.primary-btn {
  height: 52px;
  border-radius: 15px;
  color: #fff;
  background: var(--ink);
  font-weight: 900;
}

.review-list,
.booking-list {
  display: grid;
  gap: 14px;
}

.review-item,
.booking-item {
  padding: 16px;
}

.review-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-avatar,
.mine-card img,
.avatar-picker img {
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: #f0e2db;
}

.review-main {
  min-width: 0;
  flex: 1;
}

.review-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--rose);
  background: #f8e3df;
  font-size: 12px;
  font-weight: 900;
}

.review-stars {
  color: #c6812d;
  font-weight: 900;
}

.review-content {
  margin-top: 12px;
}

.review-actions,
.comment-actions,
.comment-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.review-actions {
  margin-top: 12px;
}

.review-actions button,
.comment-actions button,
.comment-toggle,
.ghost-btn,
.small-primary-btn {
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  background: #fff8f5;
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.review-actions button:hover,
.comment-actions button:hover,
.comment-toggle:hover,
.ghost-btn:hover,
.small-primary-btn:hover {
  transform: translateY(-1px);
  color: var(--ink);
  background: #f8e3df;
}

.review-comments {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(55, 35, 30, 0.08);
}

.comment-list {
  display: grid;
  gap: 10px;
}

.comment-item {
  display: flex;
  gap: 10px;
  margin-left: calc(var(--depth, 0) * 18px);
}

.comment-avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: #f0e2db;
}

.comment-body {
  min-width: 0;
  flex: 1;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fffaf7;
}

.owner-comment > .comment-body {
  border: 1px solid rgba(187, 92, 93, 0.18);
  background: #fff3f1;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.comment-meta strong {
  font-size: 14px;
}

.comment-body p {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
}

.comment-actions {
  margin-top: 6px;
}

.comment-actions button,
.danger-link {
  min-height: 26px;
  padding: 0 8px;
  background: transparent;
}

.danger-link {
  color: var(--rose);
}

.comment-children {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.comment-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.comment-form textarea {
  width: 100%;
  resize: vertical;
  border: 0;
  border-radius: 14px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(55, 35, 30, 0.08);
}

.comment-form input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--muted);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(55, 35, 30, 0.08);
}

.comment-photo-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.comment-photo-grid img {
  border-radius: 10px;
}

.small-primary-btn {
  color: #fff;
  background: var(--ink);
}

.small-primary-btn:hover {
  color: #fff;
  background: var(--rose);
}

.comment-toggle,
.muted-small {
  margin-top: 10px;
}

.muted-small {
  color: var(--muted);
  font-size: 14px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  object-fit: cover;
  cursor: zoom-in;
}

.gallery-photos img {
  cursor: zoom-in;
}

.stars {
  display: flex;
  gap: 8px;
  color: #c6812d;
  font-size: 34px;
  line-height: 1;
}

.stars button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  color: #c6812d;
  background: transparent;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.floating-review-btn {
  position: sticky;
  bottom: 88px;
  z-index: 12;
  width: 100%;
  height: 52px;
  margin-top: 16px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: var(--ink);
  font-weight: 900;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.review-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.review-sheet.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(51, 35, 30, 0.34);
}

.sheet-panel {
  position: relative;
  width: min(760px, calc(100% - 18px));
  max-height: min(82vh, 760px);
  overflow: auto;
  margin: 0 auto 9px;
  padding: 18px;
  border-radius: 22px 22px 18px 18px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(51, 35, 30, 0.2);
  transform: translateY(28px);
  transition: transform 0.22s ease;
}

.review-sheet.open .sheet-panel {
  transform: translateY(0);
}

.sheet-close {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: var(--rose);
  background: #f8e3df;
  font-weight: 900;
  cursor: pointer;
}

.login-card {
  display: grid;
  gap: 18px;
}

.avatar-picker {
  width: 94px;
  height: 94px;
  margin: 8px auto 0;
  display: block;
  overflow: hidden;
  border-radius: 50%;
  background: #f0e2db;
  cursor: pointer;
}

.avatar-picker img {
  width: 100%;
  height: 100%;
}

.avatar-picker input {
  display: none;
}

.login-input {
  height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  background: #f8eee8;
}

.mine-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mine-card > div {
  min-width: 0;
  flex: 1;
}

#mineAvatar,
#mineName {
  cursor: pointer;
}

#mineAvatar:hover {
  transform: scale(1.03);
}

#mineName:hover {
  color: var(--rose);
}

.logout-btn {
  flex: none;
  box-shadow: none;
  background: #f8e3df;
}

.mine-card.hidden,
.login-card.hidden,
.field.hidden {
  display: none;
}

.status {
  display: inline-flex;
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--rose);
  background: #f8e3df;
  font-size: 12px;
  font-weight: 900;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.small-danger-btn {
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #b85c5c;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.bottom-tabs {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 16px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(51, 35, 30, 0.08);
  border-radius: 999px;
  background: rgba(255, 254, 253, 0.96);
  box-shadow: 0 18px 44px rgba(90, 48, 42, 0.12);
}

.bottom-tab {
  height: 44px;
  border-radius: 999px;
  color: #7f6b63;
  background: transparent;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.bottom-tab.active {
  color: #fff;
  background: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 40;
  max-width: min(360px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(51, 35, 30, 0.88);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.dialog,
.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
}

.dialog.open,
.photo-viewer.open {
  opacity: 1;
  pointer-events: auto;
}

.dialog {
  display: grid;
  place-items: center;
  padding: 18px;
  transition: opacity 0.2s ease;
}

.dialog-mask {
  position: absolute;
  inset: 0;
  background: rgba(51, 35, 30, 0.34);
}

.dialog-panel {
  position: relative;
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(51, 35, 30, 0.2);
}

.photo-viewer {
  display: grid;
  place-items: center;
  background: rgba(18, 12, 10, 0.9);
}

.photo-viewer img {
  max-width: min(92vw, 980px);
  max-height: 82vh;
  border-radius: 14px;
  object-fit: contain;
}

.viewer-close,
.viewer-nav {
  position: absolute;
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
}

.viewer-close {
  top: 18px;
  right: 18px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 900;
}

.viewer-nav {
  top: 50%;
  width: 46px;
  height: 64px;
  border-radius: 999px;
  font-size: 42px;
  line-height: 1;
  transform: translateY(-50%);
}

.viewer-nav.prev {
  left: 16px;
}

.viewer-nav.next {
  right: 16px;
}

#viewerCounter {
  position: absolute;
  left: 50%;
  bottom: 20px;
  color: #fff;
  transform: translateX(-50%);
}

@media (min-width: 820px) {
  .app-shell {
    padding-bottom: 124px;
  }

  .view.active#homeView {
    display: block;
  }

  .calendar-card {
    min-width: 0;
  }

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

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

  .poster {
    min-height: 560px;
  }

  .view.active#bookingView,
  .view.active#reviewsView,
  .view.active#mineView {
    max-width: 760px;
    margin: 0 auto;
  }

  .bottom-tabs {
    width: 620px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}
