/* ============ GENERATOR PAGE ============ */
body {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
  padding: 28px 24px 60px;
}

.gen-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
}

.gen-sidebar-title {
  margin-bottom: 16px;
  font-size: 22px;
  font-weight: 900;
}

.template-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1.5px solid var(--border);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 4px;
}

.template-card:hover {
  border-color: var(--accent);
}

.template-card.active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.template-card .tc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--ink);
  border-radius: 50%;
  font-size: 18px;
  color: var(--paper);
}

.template-card .tc-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.template-card .tc-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.5;
}

.gen-form {
  background: white;
  border: 1px solid var(--border);
  border-top: 3px solid var(--ink);
  padding: 24px;
  margin-bottom: 20px;
}

.gen-form h3 {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  background: var(--accent2);
  color: white;
  padding: 3px 8px;
  border-radius: 2px;
  letter-spacing: 0.06em;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
  border: 1.5px solid var(--border);
  border-radius: 2px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent2);
  background: white;
}

.form-group textarea {
  resize: vertical;
  min-height: 70px;
}

.gen-btn-wrapper {
  display: flex;
  justify-content: center;
}

.gen-btn {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent2);
  color: white;
  border: none;
  padding: 13px 26px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 24px;
  transition: all 0.15s;
}

.gen-btn:hover {
  background: #1e4f75;
  transform: translateY(-1px);
}

.gen-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.gen-output {
  background: white;
  border: 1px solid var(--border);
  border-top: 3px solid var(--ink);
  padding: 26px 28px;
  display: none;
  animation: fadeUp 0.3s ease;
}

.gen-output.show {
  display: block;
}

.gen-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.gen-output-header h4 {
  font-size: 15px;
  font-weight: 900;
}

.output-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  font-size: 14px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 2px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--ink);
  transition: all 0.15s;
}

.action-btn:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.action-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.action-btn.primary:hover {
  background: #a33415;
}

.article-box {
  font-size: 14px;
  line-height: 2;
  color: var(--ink);
  white-space: pre-wrap;
  background: #f9f7f2;
  border: 1px solid var(--border);
  padding: 20px 22px;
  min-height: 200px;
}

.article-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 40px 0;
  color: var(--muted);
  font-size: 14px;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dot {
  width: 5px;
  height: 5px;
  background: var(--muted);
  border-radius: 50%;
  animation: blink 1.2s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@media(max-width:720px) {
  .generator-arrow {
    transform: rotate(90deg);
  }

  .gen-layout {
    display: block;
  }

  .template-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 8px;
    height: auto;
    -webkit-overflow-scrolling: touch;
  }

  .template-grid::-webkit-scrollbar {
    display: none;
  }

  .template-card {
    min-width: 140px;
    flex-shrink: 0;
  }

  .gen-sidebar-title {
    margin-bottom: 10px;
  }
}

@media(max-width:500px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes blink {

  0%,
  80%,
  100% {
    opacity: 0.2
  }

  40% {
    opacity: 1
  }
}
