:root {
  --bg: #f9f9f9;
  --card-bg: #fff;
  --accent: #007aff;
  --text-main: #1c1c1e;
  --text-sub: #8e8e93;
  --radius: 10px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-main);
}

h1 {
  text-align: center;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  font-size: 1.6rem;
}

.form-links,
.filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem auto 1rem;
  padding: 0 0.5rem;
  max-width: 1000px;
}

select,
input[type="text"],
.form-links a {
  padding: 0.4rem 0.8rem;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  background: white;
  color: var(--text-main);
  flex: 1;
  min-width: 140px;
  max-width: 220px;
}

.form-links a {
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 500;
  text-align: center;
}

#post-table {
  width: 95%;
  margin: 1rem auto;
  border-collapse: collapse;
}

#post-table th,
#post-table td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
}

#post-table th {
  background-color: #f1f1f1;
  cursor: pointer;
  user-select: none;
}

#post-table tbody tr {
  transition: background-color 0.2s ease;
}

#post-table tbody tr:hover {
  background-color: #f0f8ff;
  cursor: pointer;
}

#post-table tbody tr:active {
  background-color: #e0f0ff;
}

.pagination {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
  gap: 0.3rem;
}

.pagination button {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  border: none;
  border-radius: var(--radius);
  background: #e5e5ea;
  cursor: pointer;
}

.pagination button.active {
  background: var(--accent);
  color: white;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 90%;
  overflow-y: auto;
  position: relative;
}

.modal-content p {
  margin: 0.5rem 0;
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
}

@media (max-width: 600px) {
  #post-table th,
  #post-table td {
    font-size: 0.85rem;
    padding: 0.6rem;
  }
}
