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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  padding: 30px 0 20px;
}

.logo {
  height: 48px;
  margin-bottom: 12px;
}

header h1 {
  font-size: 28px;
  color: #3C4650;
  margin-bottom: 8px;
}

.subtitle {
  color: #666;
  font-size: 14px;
}

/* Form */
form {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.form-section {
  margin-bottom: 24px;
}

.form-section h2 {
  font-size: 16px;
  color: #1a1a2e;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e8e8e8;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #2D8FD2;
  box-shadow: 0 0 0 3px rgba(45,143,210,0.1);
}

.checkbox-group {
  flex-direction: row !important;
  align-items: center;
  gap: 20px;
  padding-top: 26px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

button[type="submit"] {
  width: 100%;
  padding: 14px;
  background: #2D8FD2;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

button[type="submit"]:hover {
  background: #2578B5;
}

button[type="submit"]:disabled {
  background: #999;
  cursor: not-allowed;
}

/* Decoration Cards */
.decoration-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.deco-card {
  cursor: pointer;
}

.deco-card input[type="radio"] {
  display: none;
}

.deco-card-inner {
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  transition: all 0.2s;
  background: #fff;
}

.deco-card-inner:hover {
  border-color: #2D8FD2;
  background: #f5faff;
}

.deco-card.selected .deco-card-inner,
.deco-card input:checked + .deco-card-inner {
  border-color: #2D8FD2;
  background: #eef6fd;
  box-shadow: 0 0 0 3px rgba(45,143,210,0.15);
}

.deco-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.deco-name {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.deco-desc {
  font-size: 11px;
  color: #888;
  line-height: 1.4;
}

/* Result */
.result-section {
  margin-top: 24px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.result-header h2 {
  font-size: 20px;
  color: #1a1a2e;
}

.sample-count {
  font-size: 13px;
  color: #888;
  background: #f0f2f5;
  padding: 4px 12px;
  border-radius: 20px;
}

.price-range-card {
  background: linear-gradient(135deg, #2D8FD2 0%, #1a6bab 100%);
  color: #fff;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  margin-bottom: 20px;
}

.price-label {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 12px;
}

.price-display {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

.price-sep {
  margin: 0 12px;
  opacity: 0.7;
}

.price-mid {
  font-size: 15px;
  opacity: 0.9;
}

.price-mid strong {
  font-size: 18px;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.stat-label {
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
}

/* Chart */
.chart-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.chart-section h3 {
  font-size: 15px;
  color: #333;
  margin-bottom: 12px;
}

/* Listings */
.listings-section {
  margin-bottom: 24px;
}

.listings-section h3 {
  font-size: 15px;
  color: #333;
  margin-bottom: 12px;
}

.listings-grid {
  display: grid;
  gap: 10px;
}

.listing-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.15s;
}

.listing-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.listing-info {
  flex: 1;
}

.listing-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.listing-detail {
  font-size: 12px;
  color: #888;
}

.listing-price {
  font-size: 20px;
  font-weight: 700;
  color: #e74c3c;
  white-space: nowrap;
  margin-left: 16px;
}

.listing-link {
  text-decoration: none;
  color: inherit;
  position: relative;
  z-index: 1;
}

.listing-link:hover {
  z-index: 1000;
}

/* 591 hover 照片預覽 */
.listing-card-591 {
  position: relative;
  z-index: 1;
}

.listing-card-591:hover {
  z-index: 1000;
}

.listing-preview {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  background: #fff;
  padding: 4px;
  pointer-events: none;
}

.listing-preview img {
  display: block;
  width: 280px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}

.listing-card-591:hover .listing-preview {
  display: block;
}

.no-data {
  text-align: center;
  color: #999;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .form-row.three-col {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .price-display {
    font-size: 24px;
  }
  .checkbox-group {
    padding-top: 8px;
  }
  .decoration-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
