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

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  background-color: #f4f4f4;
}

header {
  background: #333;
  color: #fff;
  padding: 1rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.5rem;
}

#auth-section button {
  background: #555;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
  cursor: pointer;
}

#auth-section button:hover {
  background: #777;
}

/* モーダル */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 2rem;
  width: 80%;
  max-width: 400px;
  border-radius: 5px;
}

.close {
  float: right;
  font-size: 1.5rem;
  cursor: pointer;
}

.close:hover {
  color: #f00;
}

#auth-form input {
  display: block;
  width: 100%;
  padding: 0.5rem;
  margin: 1rem 0;
  border: 1px solid #ccc;
}

#auth-form button {
  width: 100%;
  padding: 0.75rem;
  background: #333;
  color: #fff;
  border: none;
  cursor: pointer;
}

#auth-form button:hover {
  background: #555;
}

.error {
  color: #f00;
  margin-top: 1rem;
}

/* 投稿関連 */
#new-heading-section {
  margin-bottom: 1rem;
}

#new-heading-section button {
  padding: 0.75rem 1.5rem;
  background: #007bff;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

#new-heading-section button:hover {
  background: #0056b3;
}

#new-heading-form {
  background: #fff;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-radius: 5px;
}

#new-heading-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
}

#new-heading-form button {
  padding: 0.5rem 1rem;
  margin-right: 0.5rem;
  border: none;
  cursor: pointer;
}

#new-heading-form button:first-of-type {
  background: #28a745;
  color: #fff;
}

#new-heading-form button:first-of-type:hover {
  background: #218838;
}

.post-heading {
  background: #fff;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.post-heading h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.post-meta {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1rem;
}

.post-actions {
  margin-top: 1rem;
}

.post-actions button {
  padding: 0.5rem 1rem;
  margin-right: 0.5rem;
  border: none;
  cursor: pointer;
  background: #007bff;
  color: #fff;
}

.post-actions button:hover {
  background: #0056b3;
}

.post-actions .delete-btn {
  background: #dc3545;
}

.post-actions .delete-btn:hover {
  background: #c82333;
}

.child-posts {
  margin-top: 1rem;
  margin-left: 2rem;
  border-left: 2px solid #ddd;
  padding-left: 1rem;
}

.child-post {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f9f9f9;
  border-radius: 3px;
}

.child-post.deleted {
  color: #999;
  font-style: italic;
}

.reply-form {
  margin-top: 1rem;
  padding: 1rem;
  background: #f0f0f0;
  border-radius: 3px;
}

.reply-form textarea {
  width: 100%;
  min-height: 60px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid #ccc;
}

.reply-form button {
  padding: 0.5rem 1rem;
  margin-right: 0.5rem;
  border: none;
  cursor: pointer;
}

.reply-form button:first-of-type {
  background: #28a745;
  color: #fff;
}

/* ページネーション */
#pagination {
  text-align: center;
  margin-top: 2rem;
}

#pagination button {
  padding: 0.5rem 1rem;
  margin: 0 0.5rem;
  background: #333;
  color: #fff;
  border: none;
  cursor: pointer;
}

#pagination button:hover:not(:disabled) {
  background: #555;
}

#pagination button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

#page-info {
  margin: 0 1rem;
}
