:root {
  --primary: #006ff7;
  --primary-dark: #0056c7;
  --accent: #ff6600;
  --bg: #f5f7fa;
  --card: #fff;
  --text: #222;
  --muted: #888;
  --line: #e8ecf0;
  --radius: 10px;
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(12px + var(--safe-bottom));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 10px 12px calc(10px + env(safe-area-inset-top, 0));
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto;
}
.header-title {
  font-weight: 600;
  font-size: 1rem;
  flex: 1;
  text-align: center;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.back-link, .home-link {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  min-width: 44px;
}
.back-link.placeholder { visibility: hidden; }

.app-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px;
}

.hero {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary) 48%, var(--bg) 48%);
  padding: 8px 12px 20px;
  margin: -12px -12px 0;
}
.hero-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0,111,247,.12);
}
.hero-card h1 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}
.hero-sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 14px; }

.form-row { margin-bottom: 12px; }
.form-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.form-row input[type="text"],
.form-row input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
}
.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.btn-primary {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 4px;
  cursor: pointer;
}

.alert {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.alert-error {
  background: #fde8e8;
  border-color: #f5c2c7;
  color: #842029;
}

.hotel-list { display: flex; flex-direction: column; gap: 10px; }
.hotel-card {
  display: flex;
  gap: 10px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  padding: 10px;
}
.hotel-card:active { opacity: .92; }
.hotel-thumb {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
}
.hotel-card-body { flex: 1; min-width: 0; }
.hotel-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  margin: 0 0 4px;
}
.hotel-meta {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.hotel-price {
  text-align: right;
  flex-shrink: 0;
  align-self: flex-end;
}
.price-label { font-size: 0.7rem; color: var(--muted); }
.price-num {
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 700;
}
.price-num small { font-size: 0.75rem; font-weight: 500; }

.detail-hero {
  margin: -12px -12px 12px;
  position: relative;
}
.detail-hero img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: #ddd;
}
.detail-hero-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 12px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  color: #fff;
}
.detail-hero-overlay h1 {
  margin: 0;
  font-size: 1.2rem;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.detail-hero-overlay .sub { font-size: 0.82rem; opacity: .95; margin-top: 4px; }

.section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.kv-table { width: 100%; font-size: 0.82rem; border-collapse: collapse; }
.kv-table th, .kv-table td {
  text-align: left;
  vertical-align: top;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
}
.kv-table th {
  color: var(--muted);
  font-weight: 500;
  width: 38%;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: #eef4ff;
  color: var(--primary);
}

.room-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 10px;
}
.room-title { font-weight: 600; font-size: 0.95rem; margin: 0 0 6px; }
.product-card {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  margin-top: 10px;
}
.product-card:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.product-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.product-name { font-size: 0.88rem; font-weight: 500; flex: 1; }
.product-price { color: var(--accent); font-weight: 700; white-space: nowrap; }
.btn-outline {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 20px;
  text-decoration: none;
}

details.field-block {
  margin-top: 8px;
  font-size: 0.78rem;
}
details.field-block summary {
  cursor: pointer;
  color: var(--primary);
  user-select: none;
}
.muted { color: var(--muted); }
.json-pre {
  margin: 6px 0 0;
  padding: 8px;
  background: #f8f9fb;
  border-radius: 6px;
  overflow: auto;
  font-size: 0.72rem;
  max-height: 280px;
}

.price-night-table {
  width: 100%;
  font-size: 0.75rem;
  border-collapse: collapse;
  margin-top: 8px;
}
.price-night-table th, .price-night-table td {
  border: 1px solid var(--line);
  padding: 4px 6px;
  text-align: center;
}
.price-night-table th { background: #f8f9fb; }

.app-footer { height: 8px; }

.facility-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.facility-chips span {
  font-size: 0.72rem;
  background: #f0f2f5;
  padding: 4px 8px;
  border-radius: 4px;
}
