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

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

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #4a90d9;
  text-align: center;
}

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

/* フォームセクション */
.form-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.82rem;
  color: #666;
  font-weight: 500;
}

input[type="date"],
select,
textarea {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.95rem;
  width: 100%;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: #4a90d9;
}

textarea {
  resize: vertical;
  min-height: 70px;
}

.btn-primary {
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #357abd;
}

/* カレンダーセクション */
.calendar-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

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

.calendar-header h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.btn-nav {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 1rem;
  color: #555;
  transition: background 0.2s;
}

.btn-nav:hover {
  background: #f0f4ff;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
  padding: 4px 0;
}

.cal-day-header:first-child { color: #e74c3c; }
.cal-day-header:last-child { color: #4a90d9; }

.cal-day {
  min-height: 60px;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 4px;
  background: #fafafa;
  vertical-align: top;
  cursor: default;
}

.cal-day.empty {
  background: #f9f9f9;
  border-color: transparent;
}

.cal-day.today {
  background: #e8f0fe;
  border-color: #4a90d9;
}

.cal-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 2px;
}

.cal-day.sun .cal-date { color: #e74c3c; }
.cal-day.sat .cal-date { color: #4a90d9; }

.cal-badge {
  font-size: 0.65rem;
  border-radius: 3px;
  padding: 1px 4px;
  margin-top: 2px;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}

.cal-badge.pending {
  background: #fff3cd;
  color: #856404;
}

.cal-badge.done {
  background: #e2e3e5;
  color: #888;
  text-decoration: line-through;
}

/* 一覧セクション */
.list-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-filter {
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  background: #fff;
  color: #666;
  transition: all 0.2s;
}

.btn-filter.active {
  background: #4a90d9;
  border-color: #4a90d9;
  color: #fff;
}

.post-item {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: box-shadow 0.2s;
}

.post-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.post-item.done {
  background: #f9f9f9;
  opacity: 0.75;
}

.post-item.done .post-content {
  text-decoration: line-through;
  color: #aaa;
}

.post-checkbox {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #4a90d9;
  flex-shrink: 0;
}

.post-info {
  flex: 1;
  min-width: 0;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.post-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
}

.post-platform {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e8f0fe;
  color: #4a90d9;
  font-weight: 600;
}

.post-content {
  font-size: 0.9rem;
  color: #333;
  word-break: break-word;
  white-space: pre-wrap;
}

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

.btn-delete:hover {
  color: #e74c3c;
}

.empty-msg {
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
  padding: 24px 0;
}

/* レスポンシブ */
@media (max-width: 540px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full-width {
    grid-column: 1;
  }

  .cal-day {
    min-height: 44px;
  }

  .cal-badge {
    display: none;
  }

  .cal-day[data-count]::after {
    content: attr(data-count);
    display: block;
    font-size: 0.65rem;
    text-align: center;
    color: #4a90d9;
    font-weight: 600;
  }
}
