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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.header {
  text-align: center;
  color: #fff;
  margin-bottom: 24px;
}

.header h1 {
  font-size: 36px;
  letter-spacing: 2px;
}

.subtitle {
  opacity: 0.85;
  margin-top: 6px;
}

.composer {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  margin-bottom: 24px;
}

.nickname {
  width: 180px;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.nickname:focus,
.idea-input:focus {
  border-color: #764ba2;
}

.input-row {
  display: flex;
  gap: 10px;
}

.idea-input {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
  min-height: 46px;
  max-height: 120px;
  overflow-y: auto;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
  white-space: nowrap;
}

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

.btn-primary:active {
  transform: scale(0.96);
}

.toolbar {
  display: flex;
  align-items: center;
  margin-top: 16px;
}

.spacer {
  flex: 1;
}

.btn-ghost,
.btn-danger {
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
  margin-right: 8px;
}

.btn-ghost {
  background: #f1f5f9;
  color: #475569;
}

.btn-ghost:hover {
  background: #e2e8f0;
}

.btn-danger {
  background: #fef2f2;
  color: #ef4444;
}

.btn-danger:hover {
  background: #fee2e2;
}

.online {
  font-size: 13px;
  color: #22c55e;
}

.sort-label select {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  background: #f8fafc;
  cursor: pointer;
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.3s ease;
  position: relative;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-text {
  font-size: 16px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-vote {
  border: none;
  background: #f1f5f9;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-vote:hover {
  background: #e2e8f0;
}

.btn-vote.voted {
  background: #764ba2;
  color: #fff;
}

.btn-vote:active {
  transform: scale(0.95);
}

.vote-count {
  font-weight: 700;
  color: #764ba2;
  min-width: 24px;
  text-align: center;
}

.btn-delete {
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.btn-delete:hover {
  color: #ef4444;
  background: #fef2f2;
}

.btn-edit {
  margin-left: auto;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.btn-edit:hover {
  color: #6d28d9;
  background: #ede9fe;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.edit-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  border: 2px solid #764ba2;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

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

.badge {
  background: #ede9fe;
  color: #6d28d9;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

.empty {
  text-align: center;
  color: #fff;
  padding: 48px 0;
  font-size: 16px;
  opacity: 0.9;
}

.empty p:first-child {
  font-size: 48px;
  margin-bottom: 8px;
}

.hidden {
  display: none;
}

@media (max-width: 560px) {
  .input-row {
    flex-direction: column;
  }
  .btn-primary {
    width: 100%;
  }
  .nickname {
    width: 100%;
  }
}
