:root {
  --bg-page: #f7f7f7;
  --bg-surface: #ffffff;
  --bg-hover: #f2f2f2;
  --border-hairline: #eaeaea;
  --text-primary: #181818;
  --text-secondary: #6a6a6a;
  --accent: #0071e3;
  --accent-hover: #005bb5;
  --accent-ink: #ffffff;
  --accent-tint: #eef6ff;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

.icon-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-hairline);
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.icon-btn:hover {
  background: var(--bg-hover);
}

/* Search */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
}

.search-box:focus-within {
  border-color: var(--accent);
  background: var(--bg-surface);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 16px;
}

.search-box input::placeholder {
  color: var(--text-secondary);
}

.clear-btn {
  width: 28px;
  height: 28px;
  border-radius: 12px;
  font-size: 18px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Region Tabs */
.region-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}

.region-tabs::-webkit-scrollbar {
  display: none;
}

.region-tab {
  flex-shrink: 0;
  height: 36px;
  padding: 0 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-page);
  color: var(--text-secondary);
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.region-tab[aria-pressed="true"] {
  background: var(--text-primary);
  color: var(--bg-surface);
}

/* Filter Chips */
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), color 0.16s var(--ease);
}

.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}

.result-count {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 8px;
}

/* Main Grid */
.main-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(48px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}

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

@media (min-width: 680px) {
  .hotel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

/* Card — flat, zero nested boxes */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease);
}

@media (hover: hover) {
  .card:hover {
    border-color: #d0d0d0;
  }
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.cap-tag {
  font-weight: 600;
  color: var(--accent);
}

.cap-tag.warn {
  color: var(--text-secondary);
}

.star-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.star-btn[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-tint);
}

.card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

.card-sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.card-summary {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.card-links-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--bg-page);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.mini-link:hover {
  background: var(--bg-hover);
}

.detail-trigger {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.detail-trigger:hover {
  background: var(--accent-tint);
}

/* Empty */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.primary-btn {
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 16px;
  font-weight: 600;
}

/* Bottom Sheet / Modal */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(24, 24, 24, 0.42);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 680px) {
  .sheet-backdrop {
    align-items: center;
    padding: 24px;
  }
}

.sheet {
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  background: var(--bg-surface);
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: sheet-in 0.24s var(--ease);
}

@media (min-width: 680px) {
  .sheet {
    border-radius: 24px;
    max-height: 84vh;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sheet {
    animation: fade-in 0.15s ease-out;
  }
  @keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: #dcdcdc;
  margin: 8px auto 0;
  flex-shrink: 0;
}

@media (min-width: 680px) {
  .sheet-handle {
    display: none;
  }
}

.sheet-head {
  position: relative;
  padding: 20px 56px 16px 20px;
  border-bottom: 1px solid var(--border-hairline);
}

.sheet-meta-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.sheet-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.sheet-orig {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--bg-page);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sheet-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-block h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-block p,
.detail-block li {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
}

.detail-block ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.book-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--bg-page);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.book-btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}
