/* PC AI Tools — premium commercial layout (embedded in Nuxt) */
.ld-ai-embedded-root,
.ld-ai-embedded-wrap {
  width: 100%;
  max-width: 100%;
  min-height: 520px;
  position: relative;
  color: #64748b;
  font-size: 14px;
  box-sizing: border-box;
}

.ld-ai-page-content,
.ld-ai-copywriting,
.ld-ai-hot-page,
.ld-ai-topic-page {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.ld-ai-page-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  color: #475569;
  font-size: 14px;
}

.ld-ai-pro {
  --ld-bg: #0f111a;
  --ld-card: rgba(22, 25, 38, 0.92);
  --ld-border: rgba(99, 102, 241, 0.22);
  --ld-accent: #6366f1;
  --ld-accent2: #22d3ee;
  --ld-text: #e2e8f0;
  --ld-muted: #94a3b8;
  color: var(--ld-text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  padding-bottom: 24px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ld-ai-embedded .ld-ai-pro,
.ld-ai-embedded-wrap .ld-ai-pro {
  width: 100%;
  max-width: none;
}

/* Boot skeleton */
.ld-ai-boot-skeleton {
  position: relative;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  overflow: hidden;
  min-height: 360px;
}
.ld-ai-boot-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 60%
  );
  animation: ld-shimmer 1.6s infinite;
}
.ld-ai-boot-bar {
  height: 48px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.12);
  margin-bottom: 16px;
}
.ld-ai-boot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ld-ai-boot-block {
  height: 220px;
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.08);
}
.ld-ai-boot-fail {
  padding: 24px;
  border-radius: 12px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

@keyframes ld-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Hero */
.ld-ai-hero {
  position: relative;
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #0f172a 100%);
  border: 1px solid var(--ld-border);
  overflow: hidden;
}
.ld-ai-hero-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  right: -60px;
  top: -80px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.35), transparent 70%);
  pointer-events: none;
}
.ld-ai-hero-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ld-ai-hero-text h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ld-ai-sub {
  margin: 0;
  font-size: 13px;
  color: #c7d2fe;
  opacity: 0.9;
}
.ld-ai-hero-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.ld-ai-control label {
  display: block;
  font-size: 11px;
  color: #a5b4fc;
  margin-bottom: 4px;
}
.ld-ai-control select,
.ld-ai-hero select {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(165, 180, 252, 0.35);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  min-width: 140px;
}
.ld-ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(34, 211, 238, 0.15);
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.35);
}

/* Tabs */
.ld-ai-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.ld-ai-tab {
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: rgba(30, 27, 75, 0.35);
  color: #c7d2fe;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.ld-ai-tab:hover,
.ld-ai-tab.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

/* Split layout — left params, right preview; both columns grow on wide screens */
.ld-ai-split {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  width: 100%;
}
/* AI 文案：左参数紧凑，右预览+历史纵向堆叠 */
.ld-copy-split {
  align-items: start;
  gap: 14px;
  margin-bottom: 12px;
}
.ld-copy-split .ld-ai-params {
  align-self: start;
  height: auto;
}
.ld-ai-preview-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.ld-ai-preview-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-height: min(680px, calc(100vh - 280px));
}
.ld-preview-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 0 0 auto;
}
.ld-ai-result-wrap {
  flex: 1 1 auto;
  min-height: 160px;
  max-height: min(340px, calc(100vh - 520px));
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.45) transparent;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.ld-ai-result-wrap::-webkit-scrollbar {
  width: 6px;
}
.ld-ai-result-wrap::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.45);
  border-radius: 6px;
}
.ld-copy-split .ld-ai-result {
  min-height: 140px;
  max-height: none;
  overflow: visible;
}
.ld-copy-split .ld-ai-actions {
  margin-top: 0;
  flex-shrink: 0;
}
.ld-ai-history-section {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  margin-top: 4px;
}
.ld-ai-history-section h3 {
  flex-shrink: 0;
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ld-muted);
  font-weight: 600;
}
.ld-history-scroll {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: min(360px, calc(100vh - 560px));
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.45) transparent;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  align-content: flex-start;
}
.ld-history-scroll::-webkit-scrollbar {
  width: 6px;
}
.ld-history-scroll::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.45);
  border-radius: 6px;
}
@media (max-width: 900px) {
  .ld-ai-preview-stack {
    min-height: 0;
  }
  .ld-ai-result-wrap,
  .ld-history-scroll {
    max-height: none;
  }
}
.ld-hot-split {
  --ld-hot-panel-h: min(480px, calc(100vh - 340px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  align-items: stretch;
  margin-bottom: 12px;
}
.ld-hot-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
}
.ld-hot-panel h3 {
  flex-shrink: 0;
  margin-bottom: 10px;
}
.ld-hot-panel-body {
  flex: 1 1 auto;
  width: 100%;
  height: var(--ld-hot-panel-h);
  min-height: 280px;
  max-height: var(--ld-hot-panel-h);
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.45) transparent;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.ld-hot-panel-body::-webkit-scrollbar {
  width: 6px;
}
.ld-hot-panel-body::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.45);
  border-radius: 6px;
}
.ld-hot-panel-body::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.65);
}
/* 与 .ld-hot-panel-body 同元素，不可覆盖高度/滚动 */
.ld-hot-cloud-wrap,
.ld-hot-list-wrap {
  min-height: 0;
}
.ld-hot-fade-in {
  animation: ld-hot-fade 0.28s ease;
}
@keyframes ld-hot-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (min-width: 1400px) {
  .ld-ai-split {
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 20px;
  }
}
@media (max-width: 900px) {
  .ld-ai-split,
  .ld-hot-split {
    grid-template-columns: 1fr;
  }
  .ld-ai-boot-grid {
    grid-template-columns: 1fr;
  }
}

.ld-ai-panel {
  background: var(--ld-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 18px;
  backdrop-filter: blur(8px);
}
.ld-ai-panel h3 {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--ld-muted);
  font-weight: 600;
}

.ld-ai-field {
  margin-bottom: 12px;
}
.ld-ai-field label {
  display: block;
  font-size: 12px;
  color: var(--ld-muted);
  margin-bottom: 6px;
}
.ld-ai-field input,
.ld-ai-field select,
.ld-ai-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(11, 15, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--ld-text);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.ld-ai-field textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}
.ld-ai-field input:focus,
.ld-ai-field select:focus,
.ld-ai-field textarea:focus {
  border-color: var(--ld-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Buttons */
.ld-ai-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.ld-ai-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ld-ai-btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  width: 100%;
  margin-top: 4px;
}
.ld-ai-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}
.ld-ai-btn-glow {
  position: relative;
  overflow: hidden;
}
.ld-ai-btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ld-text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ld-ai-btn-ghost:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
}
.ld-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* Result card */
.ld-glow-card {
  position: relative;
  border-radius: 14px;
  padding: 16px;
  background: rgba(11, 15, 25, 0.9);
  border: 1px solid transparent;
  background-clip: padding-box;
}
.ld-glow-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 15px;
  background: linear-gradient(135deg, #6366f1, #22d3ee, #a855f7);
  z-index: -1;
  opacity: 0.55;
}
.ld-result-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ld-muted);
  margin-bottom: 10px;
}
.ld-ai-result {
  white-space: pre-wrap;
  line-height: 1.75;
  font-size: 14px;
  min-height: 200px;
}
.ld-ai-result.ld-typing::after {
  content: '▋';
  animation: ld-blink 0.8s step-end infinite;
  color: var(--ld-accent2);
}
@keyframes ld-blink {
  50% { opacity: 0; }
}

/* History masonry */
.ld-ai-section h3 {
  font-size: 14px;
  color: var(--ld-muted);
  margin: 0 0 12px;
}
.ld-ai-section {
  width: 100%;
}
.ld-ai-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  width: 100%;
}
.ld-hist-card {
  background: var(--ld-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px;
  animation: ld-fade-up 0.4s ease both;
  animation-delay: calc(var(--delay, 0) * 0.05s);
  transition: transform 0.2s, box-shadow 0.2s;
}
.ld-hist-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}
.ld-hist-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ld-muted);
  margin-bottom: 8px;
}
.ld-hist-card p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #cbd5e1;
}

@keyframes ld-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hot topic */
.ld-hot-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  min-height: 36px;
}
.ld-hot-cat {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(30, 27, 75, 0.4);
  color: #c7d2fe;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.ld-hot-cat.active {
  background: linear-gradient(135deg, #f97316, #ef4444);
  border-color: transparent;
  color: #fff;
}

.ld-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 0;
  box-sizing: border-box;
}
.ld-cloud-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #e0e7ff;
  font-size: calc(12px * var(--s, 1));
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ld-cloud-tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.ld-ai-hot-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-height: 0;
  overflow: visible;
  padding-bottom: 4px;
}
.ld-hot-list-wrap .ld-ai-hot-list {
  max-height: none;
  overflow: visible;
  padding-right: 2px;
}
.ld-rank-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(11, 15, 25, 0.75);
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}
.ld-rank-item:hover {
  transform: translateX(4px);
  background: rgba(99, 102, 241, 0.12);
}
.ld-rank-item .rank {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.ld-rank-body { flex: 1; min-width: 0; }
.ld-rank-title {
  font-size: 14px;
  margin-bottom: 6px;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ld-heat-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}
.ld-heat-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f97316, #ef4444);
  border-radius: 4px;
}
.ld-heat-num {
  font-size: 12px;
  color: #fb923c;
  font-weight: 600;
}

.ld-detail-card h4 {
  margin: 0 0 8px;
  font-size: 16px;
}
.ld-detail-card p {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--ld-muted);
  line-height: 1.6;
}

/* Topic recommend */
.ld-ai-history {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ld-ai-tag {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(11, 15, 25, 0.75);
  border-radius: 999px;
  font-size: 12px;
  color: #cbd5e1;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.15s, color 0.15s;
}
.ld-ai-tag:hover {
  border-color: rgba(34, 211, 238, 0.5);
  color: #67e8f9;
}

.ld-topic-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.ld-topic-card {
  position: relative;
  background: rgba(11, 15, 25, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  padding: 16px;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  animation: ld-fade-up 0.45s ease both;
  animation-delay: calc(var(--i, 0) * 0.06s);
}
.ld-topic-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.08), transparent 55%);
  pointer-events: none;
}
.ld-topic-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.2);
}
.ld-ai-filter {
  overflow: visible;
  z-index: 3;
}
.ld-track-field {
  overflow: visible;
  position: relative;
  z-index: 4;
}
.ld-track-wrap {
  width: 100%;
  overflow: visible;
}
.ld-track-select,
.ld-ai-filter select.ld-track {
  width: 100%;
  min-height: 40px;
  padding: 10px 36px 10px 12px;
  line-height: 1.45;
  cursor: pointer;
  background-color: rgba(11, 15, 25, 0.92);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 10px;
  color: var(--ld-text);
  font-size: 13px;
  box-sizing: border-box;
}
.ld-track-select:focus,
.ld-ai-filter select.ld-track:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.ld-track-select optgroup {
  font-weight: 600;
  color: #a5b4fc;
  background: #1e1b4b;
}
.ld-track-select option {
  padding: 8px 10px;
  color: #e2e8f0;
  background: #151a2e;
}
.ld-topic-track-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.28);
}
.ld-topic-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.ld-topic-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.4;
}
.ld-topic-opening {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--ld-muted);
  line-height: 1.5;
}
.ld-rec-list.ld-refreshing {
  animation: ld-sparkle 0.5s ease;
}
@keyframes ld-sparkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.ld-ai-tip {
  font-size: 13px;
  color: var(--ld-muted);
  margin: 8px 0;
}

.ld-ai-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ld-spin 0.7s linear infinite;
}
@keyframes ld-spin {
  to { transform: rotate(360deg); }
}

.ld-ai-toast-wrap {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
}
.ld-ai-toast {
  min-width: 240px;
  max-width: 360px;
  background: #1e293b;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-left: 4px solid #ef4444;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #f1f5f9;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.ld-ai-toast.ok {
  border-color: rgba(34, 197, 94, 0.4);
  border-left-color: #22c55e;
}

/* Standalone dark shell */
body.ld-ai-dark {
  background: #0b0b0f;
  color: #e5e7eb;
}
.ld-ai-layout {
  display: flex;
  min-height: 100vh;
}
.ld-ai-main {
  flex: 1;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  padding: 24px 28px;
  box-sizing: border-box;
}
