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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f0f2f5;
  color: #333;
  line-height: 1.6;
}

.page-wrapper {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 16px;
}

.page-body {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* 導覽列 */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.auth {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-sm {
  width: 28px;
  height: 28px;
}

.username {
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #444;
  border: 1.5px solid #ddd;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: box-shadow 0.2s;
}

.btn-google:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.btn-outline {
  background: transparent;
  color: #888;
  border: 1.5px solid #ddd;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-outline:hover {
  background: #f5f5f5;
}

.login-hint {
  text-align: center;
  color: #aaa;
  font-size: 0.95rem;
  margin-bottom: 32px;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

h1 {
  font-size: 2rem;
  color: #1a1a2e;
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: #444;
}

/* 表單區塊 */
.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #555;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #5c7cfa;
}

/* 按鈕 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #5c7cfa;
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-danger {
  background: #ff6b6b;
  color: #fff;
  font-size: 0.82rem;
  padding: 6px 14px;
}

.btn-danger:hover {
  opacity: 0.85;
}

/* 提議列表 */
.messages-section .count {
  font-size: 1rem;
  color: #888;
  font-weight: 400;
}

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

.message-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  position: relative;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.message-author {
  font-weight: 700;
  color: #5c7cfa;
  font-size: 0.95rem;
}

.message-time {
  font-size: 0.78rem;
  color: #aaa;
}

.message-content {
  color: #444;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 12px;
}

.delete-form {
  text-align: right;
  margin-top: 8px;
}

.edit-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #5c7cfa;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

.edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* 留言補充 */
.comments-section {
  margin-top: 16px;
  border-top: 1px solid #f0f0f0;
  padding-top: 12px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.comment {
  background: #f7f8fc;
  border-radius: 8px;
  padding: 10px 14px;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-content {
  color: #555;
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 4px 0;
}

.comment-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 6px;
}

.comment-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.comment-input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.comment-input:focus {
  outline: none;
  border-color: #5c7cfa;
}

/* 側邊欄 */
.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 20px 16px;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-title {
  font-size: 1rem;
  color: #444;
  margin-bottom: 0;
}

.chat-form {
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.chat-input:focus {
  outline: none;
  border-color: #5c7cfa;
}

.chat-messages {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-item {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 10px;
}

.chat-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.chat-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.chat-author {
  font-weight: 600;
  font-size: 0.82rem;
  color: #5c7cfa;
}

.chat-content {
  font-size: 0.88rem;
  color: #444;
  word-break: break-word;
  white-space: pre-wrap;
}

/* 使用者列表 */
.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.user-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid #eee;
  color: #888;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.user-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.user-table tr:last-child td {
  border-bottom: none;
}

.text-muted { color: #999; }
.text-sm { font-size: 0.82rem; }
.center { text-align: center; }

.actions {
  text-align: right;
  white-space: nowrap;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 0.8rem;
}

.btn-outline-action {
  background: transparent;
  color: #5c7cfa;
  border: 1.5px solid #5c7cfa;
}

.btn-outline-action:hover {
  background: #eef1ff;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eee;
  color: #888;
  margin-left: 6px;
  vertical-align: middle;
}

.badge-admin {
  background: #e8f0fe;
  color: #3b5bdb;
}

.row-self {
  background: #fafafa;
}
