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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
  color: #333;
  font-size: 16px;
  line-height: 1.5;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 16px;
  color: #1565C0;
  text-align: center;
}

h2 {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 12px;
  color: #555;
}

.form-section,
.filter-section,
.list-section {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 4px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: #2196F3;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: #2196F3;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #1976D2;
}

.product-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.product-header {
  background: #E3F2FD;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.product-name {
  font-weight: bold;
  font-size: 1rem;
  color: #1565C0;
}

.price-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-item {
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: bold;
}

.stat-min {
  background: #E8F5E9;
  color: #2E7D32;
}

.stat-max {
  background: #FFEBEE;
  color: #C62828;
}

.stat-avg {
  background: #FFF3E0;
  color: #E65100;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

.history-table th {
  background: #fafafa;
  color: #888;
  font-size: 0.8rem;
  font-weight: bold;
}

.history-table tr:last-child td {
  border-bottom: none;
}

.price-cell {
  font-weight: bold;
  color: #333;
}

.price-min-row td {
  background: #F1F8E9;
}

.price-max-row td {
  background: #FFF8F8;
}

.delete-btn {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s;
}

.delete-btn:hover {
  color: #e53935;
}

.empty-msg {
  text-align: center;
  color: #aaa;
  padding: 24px 0;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .product-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-table th:nth-child(3),
  .history-table td:nth-child(3) {
    display: none;
  }
}
