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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2c7be5;
  margin-bottom: 24px;
  text-align: center;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 14px;
}

/* Input section */
.input-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  margin-bottom: 20px;
}

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

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

.form-group input[type="number"],
.form-group input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #dde1e7;
  border-radius: 8px;
  font-size: 1rem;
  color: #333;
  background: #fafbfc;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.form-group input:focus {
  outline: none;
  border-color: #2c7be5;
  background: #fff;
}

/* Time inputs */
.time-inputs {
  display: flex;
  gap: 10px;
}

.time-field {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.time-field input {
  width: 100%;
  padding: 10px 8px;
  border: 1.5px solid #dde1e7;
  border-radius: 8px;
  font-size: 1rem;
  color: #333;
  background: #fafbfc;
  text-align: center;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.time-field input:focus {
  outline: none;
  border-color: #2c7be5;
  background: #fff;
}

.time-field span {
  font-size: 0.85rem;
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Pace preview */
.pace-preview {
  background: #eef4ff;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.95rem;
  color: #2c7be5;
  font-weight: 600;
  text-align: center;
}

.pace-preview.hidden {
  display: none;
}

/* Button */
.btn-primary {
  width: 100%;
  padding: 12px;
  background: #2c7be5;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: #1a68d1;
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Records section */
.records-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

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

.record-count {
  font-size: 0.8rem;
  color: #888;
  background: #f0f2f5;
  padding: 3px 10px;
  border-radius: 20px;
}

/* Stats */
.stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: #f7f9fc;
  border-radius: 8px;
}

.stats.hidden {
  display: none;
}

.stat-item {
  flex: 1;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 4px;
}

.stat-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #2c7be5;
}

/* Record list */
.record-list {
  list-style: none;
}

.empty-message {
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
  padding: 30px 0;
  line-height: 1.8;
}

.record-item {
  border-bottom: 1px solid #f0f2f5;
  padding: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.record-item:last-child {
  border-bottom: none;
}

.record-info {
  flex: 1;
}

.record-main {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
  align-items: center;
}

.record-distance {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
}

.record-time {
  font-size: 0.9rem;
  color: #666;
}

.record-pace {
  background: #eef4ff;
  color: #2c7be5;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.record-meta {
  font-size: 0.78rem;
  color: #aaa;
}

.record-memo {
  font-size: 0.82rem;
  color: #777;
  margin-top: 3px;
}

.delete-btn {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.delete-btn:hover {
  color: #e53e3e;
  background: #fff0f0;
}

/* Responsive */
@media (max-width: 375px) {
  h1 { font-size: 1.4rem; }
  .time-inputs { gap: 6px; }
  .time-field span { display: none; }
  .time-field input { padding: 10px 4px; }
  .stat-value { font-size: 0.9rem; }
}
