:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e2e5e9;
  --primary: #2563eb;
  --primary-text: #ffffff;
  --danger: #dc2626;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --surface: #1c1f24;
    --text: #f0f1f3;
    --text-muted: #9aa1ab;
    --border: #2c3038;
    --primary: #3b82f6;
    --primary-text: #ffffff;
    --danger: #f87171;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  padding: 1.25rem 1rem 0.75rem;
  text-align: center;
}

.site-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

main {
  flex: 1;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem 5rem;
}

.toolbar {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--card-color, var(--border));
  border-radius: 12px;
  padding: 1rem 1rem 1rem 1.1rem;
  box-shadow: var(--shadow);
  transition: border-color 0.3s ease;
}

.card-time {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.card-details {
  display: grid;
  grid-template-columns: 5.2rem 1fr;
  row-gap: 0.55rem;
  column-gap: 0.75rem;
  margin: 0 3.5rem 0 0;
  padding: 0;
}

.detail-row {
  display: contents;
}

.detail-row dt {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding-top: 0.15rem;
}

.detail-row dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  word-wrap: break-word;
}

.card-location {
  font-weight: 600;
  font-size: 1.02rem;
}

.card-type {
  display: inline-block;
  background: rgba(37, 99, 235, 0.16);
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  width: fit-content;
}

.detail-comment dd {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.card-votes {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.vote-btn {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease;
}

.vote-btn:active {
  transform: scale(0.96);
}

.vote-btn.active-up {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
}

.vote-btn.active-down {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

.empty-state,
.loading-state {
  text-align: center;
  color: var(--text-muted);
  margin-top: 2rem;
}

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 0.75rem;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 500;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.modal {
  border: none;
  border-radius: 14px;
  padding: 1.5rem;
  background: var(--surface);
  color: var(--text);
  width: 90%;
  max-width: 420px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.modal h2 {
  margin-top: 0;
}

.modal-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: -0.5rem;
}

.modal label {
  display: block;
  margin: 0.75rem 0 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal input,
.modal textarea {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.form-success {
  color: #22c55e;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

@media (max-width: 480px) {
  .site-header h1 {
    font-size: 1.25rem;
  }

  .card-details {
    grid-template-columns: 4.4rem 1fr;
    margin-right: 3rem;
  }

  .modal {
    width: 94%;
    padding: 1.1rem;
  }
}
