:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1c2030;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --border: #e5e7eb;
  --shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

main { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin: 24px auto;
  max-width: 480px;
}
.record-page .card { max-width: none; }

h1 { font-size: 1.5rem; margin: 0 0 16px; }
h2 { font-size: 1.15rem; margin: 0 0 16px; }

form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; font-size: 0.9rem; color: var(--muted); gap: 4px; }

input[type="text"],
input[type="password"],
input[type="number"] {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

button {
  font: inherit;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
button:hover { background: var(--primary-hover); }
button.secondary { background: transparent; color: var(--primary); border: 1px solid var(--border); }
button.danger { background: var(--danger); }
button.small { padding: 4px 10px; font-size: 0.85rem; }

.msg { min-height: 1.25em; margin: 4px 0 0; font-size: 0.9rem; color: var(--danger); }
.msg.ok { color: #047857; }

.hint { margin-top: 16px; color: var(--muted); font-size: 0.9rem; text-align: center; }
.hint a { color: var(--primary); text-decoration: none; }
.hint a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 1.1rem; margin: 0; }
.user-info { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 0.9rem; }

.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 480px) { .row { grid-template-columns: 1fr; } }

.equipment-list { display: flex; flex-direction: column; gap: 12px; }
.equipment-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  background: #fbfcfe;
}
.equipment-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  cursor: pointer;
}
.equipment-name { font-weight: 600; }
.equipment-current { color: var(--primary); font-variant-numeric: tabular-nums; }
.equipment-meta { color: var(--muted); font-size: 0.85rem; }

.history { margin: 12px 0 0; padding: 0; list-style: none; display: none; }
.equipment-group.open .history { display: block; }
.history li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
  font-size: 0.9rem;
}
.history .when { color: var(--muted); }

.empty { color: var(--muted); margin: 0; }
