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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f0e8;
  color: #333;
  min-height: 100vh;
  padding: 16px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

h1 {
  font-size: 1.5rem;
  color: #c0392b;
  text-align: center;
  margin-bottom: 4px;
}

.subtitle {
  text-align: center;
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

h2 {
  font-size: 1rem;
  color: #c0392b;
  margin-bottom: 16px;
  border-left: 3px solid #e74c3c;
  padding-left: 8px;
}

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

label {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 6px;
  font-weight: 600;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  color: #333;
  background: #fafafa;
  transition: border-color 0.2s;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: #e74c3c;
  background: #fff;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.btn-primary:hover {
  background: #c0392b;
}

.btn-secondary {
  padding: 9px 14px;
  background: #e8f4fd;
  color: #2980b9;
  border: 1.5px solid #2980b9;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #2980b9;
  color: #fff;
}

.result-card {
  border-top: 4px solid #e74c3c;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.result-row:last-of-type {
  border-bottom: none;
}

.result-label {
  font-size: 0.9rem;
  color: #555;
}

.result-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
}

.result-row.highlight .result-label {
  color: #c0392b;
  font-weight: 700;
}

.result-row.highlight .result-value {
  color: #c0392b;
  font-size: 1.3rem;
}

.result-row.recommend .result-label {
  color: #27ae60;
  font-weight: 700;
}

.result-row.recommend .result-value {
  color: #27ae60;
  font-size: 1.2rem;
}

.note {
  font-size: 0.8rem;
  color: #888;
  margin-top: 12px;
  line-height: 1.5;
}

.history-input {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.history-input input[type="text"] {
  flex: 2;
  min-width: 120px;
}

.history-input input[type="number"] {
  flex: 1;
  min-width: 90px;
}

.history-list {
  list-style: none;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 8px;
}

.history-item-info {
  flex: 1;
}

.history-item-name {
  font-size: 0.95rem;
  color: #333;
}

.history-item-amount {
  font-size: 0.85rem;
  color: #888;
  margin-top: 2px;
}

.history-item-delete {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.history-item-delete:hover {
  color: #e74c3c;
}

.history-footer {
  padding-top: 10px;
  font-size: 0.9rem;
  color: #555;
  font-weight: 600;
  text-align: right;
}

.disclaimer {
  font-size: 0.75rem;
  color: #aaa;
  text-align: center;
  margin-top: 8px;
  margin-bottom: 24px;
  line-height: 1.6;
}

@media (max-width: 400px) {
  h1 {
    font-size: 1.25rem;
  }

  .history-input {
    flex-direction: column;
  }

  .history-input input,
  .history-input .btn-secondary {
    width: 100%;
  }
}
