

.aip-section {
  padding: 80px 24px;
  position: relative;
  overflow: hidden;
}
.aip-section::before {
  content: '';
  position: absolute;
  top: 20%; left: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(var(--brand-primary-rgb), 0.18) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  animation: aip-orb-float 12s ease-in-out infinite;
}
.aip-section::after {
  content: '';
  position: absolute;
  bottom: 10%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(var(--brand-accent-rgb), 0.14) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  animation: aip-orb-float 15s ease-in-out infinite reverse;
}
@keyframes aip-orb-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, -30px); }
}

.aip-head {
  max-width: 760px;
  margin: 0 auto 50px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.aip-head h2 {
  font-size: 2.6rem;
  font-weight: 900;
  margin: 14px 0;
  line-height: 1.3;
  color: var(--text);
}
.aip-head p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}

.aip-shell {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  position: relative;
  z-index: 1;
}

.aip-input {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--gborder);
  border-radius: 22px;
  padding: 22px;
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
body.light .aip-input {
  background: rgba(255,255,255,0.85);
}
.aip-input::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent), var(--brand-secondary));
  border-radius: 22px 22px 0 0;
}

.aip-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.aip-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}
.aip-step-head strong {
  color: var(--text);
  font-weight: 700;
}
.aip-step-head em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.aip-step-num {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(var(--brand-primary-rgb), 0.2);
  color: var(--brand-primary);
  font-weight: 800;
  font-size: 0.85rem;
}

.aip-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.aip-type {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--gborder);
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  color: var(--text);
  transition: all 0.2s;
}
.aip-type i { font-size: 1.1rem; color: var(--muted); transition: color 0.2s; }
.aip-type:hover {
  background: rgba(var(--brand-primary-rgb), 0.08);
  border-color: rgba(var(--brand-primary-rgb), 0.3);
}
.aip-type:hover i { color: var(--brand-primary); }
.aip-type.active {
  background-color: rgba(var(--brand-primary-rgb), 0.18);
  border-color: var(--brand-primary);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(var(--brand-primary-rgb), 0.25);
}
.aip-type.active i {
  color: var(--brand-primary);
}
body.light .aip-type { background: rgba(0,0,0,0.03); }

.aip-field {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--gborder);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  transition: all 0.2s;
  outline: none;
  box-sizing: border-box;
}
body.light .aip-field { background: rgba(0,0,0,0.03); }
.aip-field::placeholder { color: var(--muted); opacity: 0.8; }
.aip-field:focus {
  border-color: var(--brand-primary);
  background: rgba(var(--brand-primary-rgb), 0.05);
  box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.15);
}

.aip-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.aip-quick {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--gborder);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  transition: all 0.15s;
}
body.light .aip-quick { background: rgba(0,0,0,0.03); }
.aip-quick:hover {
  background-color: rgba(var(--brand-primary-rgb), 0.15);
  border-color: var(--brand-primary);
}

.aip-generate {
  width: 100%;
  background-image: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  background-color: transparent;
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 14px;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
  box-shadow: 0 8px 28px rgba(var(--brand-primary-rgb), 0.4);
}
.aip-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(var(--brand-primary-rgb), 0.55);
}
.aip-generate:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
.aip-generate::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.6s;
}
.aip-generate:hover::before { left: 140%; }
.aip-cd {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.8;
  margin-inline-start: auto;
}

.aip-note {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
  line-height: 1.6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.aip-note a {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 700;
}
.aip-note a:hover { text-decoration: underline; }

.aip-output {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--gborder);
  border-radius: 22px;
  padding: 24px;
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 500px;
  position: relative;
  overflow: hidden;
}
body.light .aip-output { background: rgba(255,255,255,0.85); }

.aip-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gborder);
}
.aip-result-head-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.aip-result-avatar {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background-image: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: white;
  font-size: 1.1rem;
  position: relative;
  box-shadow: 0 6px 18px rgba(var(--brand-primary-rgb), 0.4);
}
.aip-result-avatar::after {
  content: '';
  position: absolute;
  bottom: 2px;
  inset-inline-end: 2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--bg, #030610);
  animation: aip-blink 2s infinite;
}
body.light .aip-result-avatar::after { border-color: #fff; }
@keyframes aip-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.aip-result-head-info strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
}
.aip-result-head-info small {
  font-size: 0.75rem;
  color: var(--muted);
}

.aip-result-actions { display: flex; gap: 6px; }
.aip-icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--gborder);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}
body.light .aip-icon-btn { background: rgba(0,0,0,0.04); }
.aip-icon-btn:hover {
  background-color: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}

.aip-result-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 20px;
}
.aip-floating-emoji {
  font-size: 4rem;
  margin-bottom: 14px;
  animation: aip-float 3s ease-in-out infinite;
}
@keyframes aip-float {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}
.aip-result-empty h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--text);
}
.aip-result-empty p {
  color: var(--muted);
  margin: 0 0 24px;
  max-width: 320px;
  line-height: 1.7;
}

.aip-features {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.aip-feat {
  background: rgba(var(--brand-primary-rgb), 0.1);
  color: var(--brand-primary);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.aip-typing {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: rgba(var(--brand-primary-rgb), 0.08);
  border-radius: 14px;
}
.aip-typing span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand-primary);
  animation: aip-bounce 1.4s infinite;
}
.aip-typing span:nth-child(2) { animation-delay: 0.2s; }
.aip-typing span:nth-child(3) { animation-delay: 0.4s; }
.aip-typing em {
  font-style: normal;
  color: var(--brand-primary);
  font-weight: 600;
  font-size: 0.9rem;
}
@keyframes aip-bounce {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-6px); }
}

.aip-result-content {
  flex: 1;
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--gborder);
  border-radius: 14px;
  padding: 20px;
  font-size: 0.95rem;
  line-height: 1.95;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  overflow-y: auto;
  max-height: 500px;
  position: relative;
  animation: aip-fade-in 0.4s ease;
}
body.light .aip-result-content { background: rgba(0,0,0,0.03); }
@keyframes aip-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.aip-result-content.typing::after {
  content: '▎';
  color: var(--brand-primary);
  animation: aip-cursor 0.8s infinite;
  margin-inline-start: 2px;
}
@keyframes aip-cursor {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.aip-cta {
  background-image: linear-gradient(135deg, rgba(var(--brand-primary-rgb), 0.15), rgba(var(--brand-accent-rgb), 0.1));
  border: 1px solid rgba(var(--brand-primary-rgb), 0.3);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: aip-fade-in 0.5s 0.3s both;
}
.aip-cta-icon { font-size: 2rem; flex-shrink: 0; }
.aip-cta-text { flex: 1; min-width: 0; }
.aip-cta-text strong {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 0.95rem;
}
.aip-cta-text small {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}
.aip-cta-btn {
  background-image: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: white !important;
  padding: 10px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: transform 0.2s;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(var(--brand-primary-rgb), 0.4);
}
.aip-cta-btn:hover { transform: translateY(-2px) scale(1.04); }

@media (max-width: 1000px) {
  .aip-shell { grid-template-columns: 1fr; gap: 16px; }
  .aip-input { order: 1; }
  .aip-output { order: 2; min-height: 380px; }
  .aip-head h2 { font-size: 2rem; }
  .aip-section { padding: 60px 16px; }
}

@media (max-width: 640px) {
  .aip-section { padding: 40px 12px 60px; }
  .aip-head { margin-bottom: 24px; }
  .aip-head h2 { font-size: 1.5rem; line-height: 1.4; }
  .aip-head p  { font-size: 0.9rem; line-height: 1.7; max-width: 100%; }


  .aip-input, .aip-output {
    padding: 16px;
    border-radius: 18px;
    gap: 16px;
  }
  .aip-input { gap: 14px; }


  .aip-types {
    display: flex;
    flex-direction: row;
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    margin: 0 -16px;
    padding-inline: 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .aip-types::-webkit-scrollbar { display: none; }
  .aip-type {
    flex: 0 0 auto;
    min-width: 92px;
    padding: 12px 14px;
    flex-direction: column;
    gap: 6px;
    scroll-snap-align: start;
  }
  .aip-type i { font-size: 1.2rem; }
  .aip-type span { font-size: 0.72rem; white-space: nowrap; }


  .aip-step-head { font-size: 0.85rem; gap: 8px; }
  .aip-step-head strong { font-size: 0.9rem; }
  .aip-step-num {
    width: 22px; height: 22px;
    font-size: 0.78rem;
  }


  .aip-field {
    padding: 11px 13px;
    font-size: 0.9rem;
    border-radius: 11px;
  }


  .aip-quick-chips {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 6px;
    margin: 0 -16px;
    padding-inline: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .aip-quick-chips::-webkit-scrollbar { display: none; }
  .aip-quick {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 6px 13px;
    font-size: 0.78rem;
  }


  .aip-generate {
    padding: 15px;
    font-size: 0.98rem;
    border-radius: 13px;
  }


  .aip-output { min-height: auto; padding: 14px; }
  .aip-result-head { padding-bottom: 12px; }
  .aip-result-avatar { width: 38px; height: 38px; font-size: 0.95rem; border-radius: 12px; }
  .aip-result-head-info strong { font-size: 0.88rem; }
  .aip-result-head-info small { font-size: 0.7rem; }
  .aip-icon-btn { width: 32px; height: 32px; font-size: 0.78rem; }


  .aip-result-empty { padding: 24px 16px; }
  .aip-floating-emoji { font-size: 3rem; margin-bottom: 10px; }
  .aip-result-empty h3 { font-size: 1.05rem; margin-bottom: 6px; }
  .aip-result-empty p { font-size: 0.85rem; max-width: 100%; margin-bottom: 18px; }
  .aip-features { gap: 6px; }
  .aip-feat {
    padding: 5px 12px;
    font-size: 0.72rem;
  }


  .aip-result-content {
    padding: 14px;
    font-size: 0.88rem;
    line-height: 1.85;
    border-radius: 12px;
    max-height: 420px;
  }


  .aip-typing {
    padding: 14px;
    border-radius: 12px;
    gap: 10px;
  }
  .aip-typing span { width: 8px; height: 8px; }
  .aip-typing em { font-size: 0.82rem; }


  .aip-cta {
    flex-direction: column;
    text-align: center;
    padding: 16px;
    gap: 10px;
    border-radius: 14px;
  }
  .aip-cta-icon { font-size: 1.6rem; }
  .aip-cta-text strong { font-size: 0.88rem; }
  .aip-cta-text small  { font-size: 0.73rem; }
  .aip-cta-btn {
    width: 100%;
    padding: 11px;
    font-size: 0.85rem;
    text-align: center;
    justify-content: center;
  }


  .aip-note { font-size: 0.72rem; line-height: 1.6; }
}

@media (max-width: 380px) {
  .aip-head h2 { font-size: 1.3rem; }
  .aip-section { padding: 32px 10px 50px; }
  .aip-input, .aip-output { padding: 14px; border-radius: 16px; }
  .aip-type { min-width: 86px; padding: 10px 12px; }
  .aip-type span { font-size: 0.68rem; }
  .aip-result-content { max-height: 360px; font-size: 0.84rem; }
}
