:root {
  --confirmed-color: #2e7d32;
  --idea-color: #9e9e9e;
  --transport-color: #1565c0;
  --bg: #fafafa;
  --card-bg: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif;
  background: var(--bg);
  color: #212121;
  padding-bottom: 80px;
}

header {
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}
header h1 { font-size: 1.1rem; margin: 0; }

.day-tabs {
  display: flex;
  overflow-x: auto;
  gap: 4px;
  padding: 8px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid #e0e0e0;
}

.day-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid #ccc;
  border-radius: 20px;
  background: #f0f0f0;
  font-size: 0.9rem;
}
.day-tab.active { background: #1565c0; color: #fff; border-color: #1565c0; }
.day-tab.drop-target { background: #ffca28; border-color: #f9a825; }

.card-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.area-filter {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 16px;
  background: #fff;
  font-size: 0.85rem;
}
.category-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.category-chip {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 16px;
  background: #f0f0f0;
  font-size: 0.85rem;
}
.category-chip.active { background: #1565c0; color: #fff; border-color: #1565c0; }

.card {
  background: var(--card-bg);
  border-left: 4px solid var(--idea-color);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 10px 12px;
  touch-action: pan-y;
}
.card.confirmed { border-left-style: solid; border-left-color: var(--confirmed-color); }
.card.idea { border-left-style: dashed; border-left-color: var(--idea-color); }
.card.transport.confirmed { border-left-color: var(--transport-color); }

.card-summary { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.card-summary .time { font-weight: 600; color: #555; min-width: 42px; }
.card-summary .title { font-weight: 600; }
.card-note { font-size: 0.85rem; color: #757575; margin-left: 30px; margin-top: 2px; }
.card-detail { margin-top: 8px; padding-top: 8px; border-top: 1px solid #eee; font-size: 0.9rem; }
.card-detail p { margin: 4px 0; }
.map-link { display: inline-block; margin: 4px 0; color: #1565c0; }

.card-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.card-actions button {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f5f5f5;
  font-size: 0.85rem;
}
.delete-btn { color: #c62828; border-color: #c62828; }

.empty-state { text-align: center; color: #999; padding: 40px 0; }

.add-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1565c0;
  color: #fff;
  font-size: 1.8rem;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 20;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  z-index: 30;
}
.modal[hidden] { display: none; }
.modal-content {
  background: #fff;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  padding: 16px;
}
.modal-content label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
}
.modal-content input[type=text],
.modal-content input[type=time],
.modal-content input[type=url],
.modal-content textarea,
.modal-content select {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.form-actions button { padding: 10px 16px; border-radius: 6px; border: 1px solid #ccc; }
.form-actions button[type=submit] { background: #1565c0; color: #fff; border-color: #1565c0; }

.drag-ghost {
  position: fixed;
  opacity: 0.85;
  pointer-events: none;
  z-index: 40;
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
