* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f3f4f6;
  color: #111827;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px;
}

.card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.header {
  background: #111827;
  color: white;
  padding: 18px 24px;
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.logo {
  font-size: 22px;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

.nav a {
  color: white;
  margin-left: 16px;
}

h1 {
  margin-top: 0;
  font-size: 34px;
}

h2 {
  margin-top: 0;
}

input,
textarea,
select {
  width: 100%;
  max-width: 520px;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 16px;
}

button,
.button {
  display: inline-block;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 15px;
  cursor: pointer;
  margin: 0;
}

.button {
  text-decoration: none;
}

button:hover,
.button:hover {
  text-decoration: none;
}

button,
.button {
  transition: background-color 0.2s ease;
}

button:hover,
.button:hover {
  background: #1d4ed8;
}

.button-secondary:hover {
  background: #4b5563;
}

.button-danger:hover {
  background: #b91c1c;
}

.button-secondary {
  background: #6b7280;
}

.button-danger {
  background: #dc2626;
}

.badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 13px;
}

.badge-live {
  background: #dcfce7;
  color: #166534;
}

.badge-closed {
  background: #fee2e2;
  color: #991b1b;
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.qr {
  width: 220px;
  background: white;
  padding: 10px;
  border-radius: 12px;
}

.notice {
  padding: 14px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e40af;
}

.error {
  padding: 14px;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
}

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

.actions form {
  margin: 0;
}

.question-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  background: white;
}

@media (max-width: 700px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav a {
    margin-left: 0;
    margin-right: 12px;
  }

  h1 {
    font-size: 28px;
  }
}

.option-list {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.option-card:hover {
  border-color: #2563eb;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12);
}

.option-card input {
  width: auto;
  max-width: none;
}

.option-card span {
  font-size: 18px;
}

.word-cloud {
  padding: 20px;
  line-height: 2.5;
}

.word-cloud span {
  display: inline-block;
  margin: 10px;
}

@media (max-width: 768px) {

  .container {
    padding: 16px;
  }

  .card {
    padding: 18px;
    border-radius: 14px;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 22px;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  button,
  .button {
    width: 100%;
    box-sizing: border-box;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions form {
    width: 100%;
  }

  .option-card {
    padding: 18px;
  }

  .option-card span {
    font-size: 20px;
  }

  textarea,
  input,
  select {
    font-size: 16px;
  }
}

.chart-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  overflow-x: auto;
}

.chart-card canvas {
  min-height: 320px;
}

#qaList {
  display: grid;
  gap: 14px;
}

#wordCloud {
  min-height: 220px;
}

.copy-button {
  margin-top: 6px;
  padding: 6px 10px;
  font-size: 12px;
  width: auto !important;
  display: inline-block;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
}

.copy-button:hover {
  background: #e5e7eb;
}

.copy-icon {
  cursor: pointer;
  margin-left: 8px;
  text-decoration: none;
  font-size: 16px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.copy-icon:hover {
  opacity: 1;
}

.copy-feedback {
  margin-left: 6px;
  color: #16a34a;
  font-size: 12px;
  font-weight: 600;
}
