* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #ff385c;
  --primary-dark: #e31c5f;
  --bg: #ffffff;
  --surface: #f7f7f7;
  --border: #dddddd;
  --text: #222222;
  --text-muted: #717171;
  --text-light: #b0b0b0;
  --shadow: 0 2px 16px rgba(0,0,0,0.1);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.navbar .logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  cursor: pointer;
}

.navbar .nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.navbar .nav-links a {
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 20px;
  transition: background 0.2s;
}

.navbar .nav-links a:hover { background: var(--surface); }
.navbar .nav-links a.active { color: var(--primary); font-weight: 600; }

.btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--surface); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* Hero */
.hero {
  background: linear-gradient(135deg, #ff385c 0%, #e61e4d 50%, #bd1e59 100%);
  padding: 60px 24px;
  text-align: center;
  color: white;
}

.hero h1 { font-size: 2.2rem; margin-bottom: 12px; }
.hero p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 24px; }

/* Search Bar */
.search-bar {
  max-width: 700px;
  margin: 0 auto;
  background: white;
  border-radius: 40px;
  display: flex;
  align-items: center;
  padding: 6px;
  box-shadow: var(--shadow);
}

.search-bar input {
  flex: 1;
  border: none;
  padding: 12px 20px;
  font-size: 0.95rem;
  outline: none;
  background: transparent;
  color: var(--text);
}

.search-bar .search-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Filter bar */
.filter-bar {
  padding: 16px 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.filter-bar select, .filter-bar input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  background: white;
  color: var(--text);
  outline: none;
}

/* Grid */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Card */
.listing-card {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.listing-card .card-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  position: relative;
}

.listing-card .card-image .fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.listing-card .card-body { padding: 12px; }
.listing-card .card-body h3 { font-size: 0.95rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-card .card-body .location { color: var(--text-muted); font-size: 0.85rem; }
.listing-card .card-body .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.listing-card .card-body .price { font-weight: 700; }
.listing-card .card-body .price span { font-weight: 400; color: var(--text-muted); font-size: 0.8rem; }
.listing-card .card-body .rating { font-size: 0.85rem; color: var(--text-muted); }

/* Detail page */
.detail-page { max-width: 900px; margin: 0 auto; padding: 24px; }
.detail-page .back-link { color: var(--text-muted); font-size: 0.9rem; cursor: pointer; display: inline-block; margin-bottom: 16px; }
.detail-page h1 { font-size: 1.6rem; margin-bottom: 8px; }
.detail-page .detail-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }

.detail-image {
  width: 100%;
  height: 300px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
  margin-bottom: 24px;
}

.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

.detail-info h3 { margin: 16px 0 8px; font-size: 1.1rem; }
.detail-info p { color: var(--text-muted); line-height: 1.7; }

.amenities-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.amenity-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
}

/* Booking card */
.booking-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 80px;
  box-shadow: var(--shadow);
}

.booking-card .price-display { font-size: 1.4rem; font-weight: 700; margin-bottom: 16px; }
.booking-card .price-display span { font-size: 0.9rem; font-weight: 400; color: var(--text-muted); }

.booking-card .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

.booking-card .form-cell {
  padding: 10px 12px;
  border-right: 1px solid var(--border);
}

.booking-card .form-cell:last-child { border-right: none; }
.booking-card .form-cell label { display: block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; margin-bottom: 2px; }
.booking-card .form-cell input { border: none; width: 100%; font-size: 0.85rem; outline: none; background: transparent; }

.booking-card .total { display: flex; justify-content: space-between; font-weight: 600; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* Reviews */
.review-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.review-item .review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.review-item .review-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.review-item .review-name { font-weight: 600; font-size: 0.9rem; }
.review-item .review-date { color: var(--text-muted); font-size: 0.8rem; }
.review-item .review-stars { color: #ffc107; margin-bottom: 4px; }
.review-item .review-text { color: var(--text-muted); font-size: 0.9rem; }

/* Auth page */
.auth-page {
  max-width: 400px;
  margin: 60px auto;
  padding: 40px 24px;
  text-align: center;
}

.auth-page h1 { font-size: 1.6rem; margin-bottom: 8px; }
.auth-page .subtitle { color: var(--text-muted); margin-bottom: 24px; }

.form-group {
  margin-bottom: 14px;
  text-align: left;
}

.form-group label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { min-height: 80px; resize: vertical; font-family: inherit; }

.error-msg { color: var(--primary); font-size: 0.85rem; margin-top: 8px; }
.toggle-link { color: var(--primary); cursor: pointer; margin-top: 16px; display: inline-block; }

/* My page */
.my-page { max-width: 900px; margin: 0 auto; padding: 24px; }
.my-page h2 { margin-bottom: 16px; }

.booking-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.booking-item .booking-info h4 { font-size: 0.95rem; margin-bottom: 4px; }
.booking-item .booking-info p { font-size: 0.8rem; color: var(--text-muted); }
.booking-item .booking-status { font-size: 0.8rem; padding: 4px 10px; border-radius: 12px; font-weight: 600; }
.booking-item .status-pending { background: #fff3cd; color: #856404; }
.booking-item .status-confirmed { background: #d4edda; color: #155724; }
.booking-item .status-cancelled { background: #f8d7da; color: #721c24; }

/* Host form */
.host-form { max-width: 600px; margin: 0 auto; padding: 24px; }
.host-form h2 { margin-bottom: 20px; }

/* Empty state */
.empty { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty h3 { margin-bottom: 8px; color: var(--text); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 1000;
}

.toast.show { opacity: 1; }

/* Cities */
.cities-section { padding: 24px; max-width: 1200px; margin: 0 auto; }
.cities-section h2 { margin-bottom: 16px; }
.cities-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.city-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.city-chip:hover { background: var(--primary); color: white; border-color: var(--primary); }

@media (max-width: 768px) {
  .detail-grid { grid-template-columns: 1fr; }
  .listings-grid { grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px; }
  .hero h1 { font-size: 1.6rem; }
}

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