/* ===================================
   品牌词云页面专属样式
   包含: 加载弹窗、词云容器、风险卡片、平台评分、专家建议
=================================== */

/* ===================================
   1. HERO SECTION
=================================== */
.bwc-hero {
  background: linear-gradient(135deg, #eefaff 0%, #f5fbff 50%, #fff8eb 100%);
  padding: 40px 0 30px;
  position: relative;
  overflow: hidden;
}

.bwc-hero-accent {
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(5,150,105,0.12) 0%, rgba(30,144,255,0.08) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.bwc-hero-inner {
  text-align: center;
  padding: 20px 0;
}

.bwc-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #03B3FF 0%, #72D7FF 55%, #F5A623 100%);
  border-radius: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 40px rgba(5,150,105,0.25);
}

.bwc-hero-icon svg {
  color: #fff;
}

.bwc-hero-title {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, #03B3FF 0%, #72D7FF 55%, #F5A623 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.bwc-hero-sub {
  font-size: 16px;
  color: #64748b;
  font-weight: 400;
}

/* ===================================
   2. INPUT CARD & GENERATE BUTTON
=================================== */
.bwc-main-section {
  padding: 30px 0 50px;
}

.bwc-input-card {
  background: #fff;
  border: 1px solid #e5edf5;
  border-radius: 18px;
  padding: 26px 30px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.05);
  margin-bottom: 30px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.bwc-input-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.bwc-input-field {
  flex: 1;
  min-width: 0;
}

.bwc-input-label {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.bwc-input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  font-size: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  transition: all 0.3s ease;
  font-family: inherit;
}

.bwc-input:focus {
  border-color: #1E90FF;
  box-shadow: 0 0 0 4px rgba(30,144,255,0.1);
}

.bwc-input::placeholder {
  color: #a0aec0;
}

.bwc-input[aria-invalid="true"] {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.09);
}

.bwc-field-error {
  display: block;
  margin-top: 7px;
  color: #dc2626;
  font-size: 13px;
}

.bwc-field-error[hidden] {
  display: none;
}

.bwc-input.is-shaking {
  animation: bwc-field-shake 0.32s ease;
}

@keyframes bwc-field-shake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-5px); }
  60% { transform: translateX(5px); }
}

.bwc-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
  height: 56px;
  background: linear-gradient(135deg, #03B3FF 0%, #72D7FF 55%, #F5A623 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-family: inherit;
}

.bwc-generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(5,150,105,0.35);
}

.bwc-generate-btn:active {
  transform: translateY(0);
}

.bwc-generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.bwc-btn-icon {
  flex-shrink: 0;
}

.bwc-tips {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bwc-tip-label {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.bwc-tip-chip {
  padding: 6px 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.bwc-tip-chip:hover {
  background: #e2e8f0;
  color: #475569;
}

.bwc-generate-btn:focus-visible,
.bwc-tip-chip:focus-visible,
.bwc-retry-btn:focus-visible,
.bwc-cta-btn:focus-visible {
  outline: 3px solid rgba(30, 144, 255, 0.28);
  outline-offset: 3px;
}

.bwc-state-card {
  max-width: 900px;
  min-height: 270px;
  margin: 0 auto 30px;
  border: 2px dashed #bae6fd;
  border-radius: 20px;
  background: linear-gradient(145deg, #f8fdff, #fffaf1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 42px 24px;
  text-align: center;
  color: #64748b;
}

.bwc-state-card[hidden] {
  display: none;
}

.bwc-state-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  border-radius: 22px;
  background: #e0f2fe;
  display: grid;
  place-items: center;
}

.bwc-state-icon svg {
  width: 42px;
  fill: none;
  stroke: #0284c7;
  stroke-width: 2;
  stroke-linecap: round;
}

.bwc-state-card strong {
  margin-bottom: 8px;
  color: #0f172a;
  font-size: 20px;
}

.bwc-state-card.is-error {
  border-color: #fecaca;
  background: #fff7f7;
}

.bwc-state-card.is-error .bwc-state-icon {
  background: #fee2e2;
}

.bwc-state-card.is-error .bwc-state-icon svg {
  stroke: #dc2626;
}

.bwc-retry-btn {
  margin-top: 20px;
  padding: 10px 22px;
  border: 0;
  border-radius: 10px;
  background: #0284c7;
  color: #fff;
  font: 600 14px inherit;
  cursor: pointer;
}

/* ===================================
   3. LOADING MODAL WITH BLUR BACKGROUND
=================================== */
.bwc-loading-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.bwc-loading-modal.active {
  display: flex;
}

.bwc-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bwc-modal-content {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 24px;
  padding: 48px 56px;
  text-align: center;
  box-shadow: 0 25px 80px rgba(0,0,0,0.25);
  max-width: 420px;
  width: 90%;
}

.bwc-modal-icon {
  margin-bottom: 20px;
}

.bwc-modal-icon svg {
  animation: bwc-spin 2s linear infinite;
}

@keyframes bwc-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.bwc-modal-text {
  font-size: 18px;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 24px;
  min-height: 28px;
}

.bwc-modal-progress {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.bwc-modal-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #03B3FF 0%, #72D7FF 55%, #F5A623 100%);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

/* ===================================
   4. WORDCLOUD CONTAINER
=================================== */
.bwc-wordcloud-container {
  display: none;
  max-width: 1400px;
  margin: 0 auto 30px;
}

.bwc-wordcloud-container.active {
  display: block;
}

.bwc-demo-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  background: #f0f9ff;
  color: #475569;
  font-size: 13px;
}

.bwc-demo-notice strong {
  flex-shrink: 0;
  color: #0369a1;
}

.bwc-canvas-wrapper {
  background: linear-gradient(145deg, #ffffff 0%, #eefaff 50%, #fff8eb 100%);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 8px 40px rgba(5,150,105,0.12);
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.bwc-wordcloud-area {
  width: 1000px;
  height: 800px;
  position: relative;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.bwc-wordcloud-area.active {
  opacity: 1;
}

/* Responsive word cloud sizing */
@media (max-width: 900px) {
  .bwc-wordcloud-area {
    width: 800px;
    height: 650px;
  }
}

@media (max-width: 720px) {
  .bwc-wordcloud-area {
    width: 650px;
    height: 550px;
  }
}

@media (max-width: 620px) {
  .bwc-wordcloud-area {
    width: 100%;
    height: 450px;
  }
  
  .bwc-canvas-wrapper {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .bwc-wordcloud-area {
    width: 100%;
    height: 350px;
  }
  
  .bwc-canvas-wrapper {
    padding: 15px;
  }
}

.bwc-word-main {
  transition: transform 0.3s ease;
}

.bwc-word-item {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Float animations for word cloud items */
@keyframes bwc-float-0 {
  0%, 100% { transform: translate(-50%, -50%) translateY(0px); }
  50% { transform: translate(-50%, -50%) translateY(-8px); }
}

@keyframes bwc-float-1 {
  0%, 100% { transform: translate(-50%, -50%) translateX(0px); }
  50% { transform: translate(-50%, -50%) translateX(6px); }
}

@keyframes bwc-float-2 {
  0%, 100% { transform: translate(-50%, -50%) translateY(0px) rotate(0deg); }
  50% { transform: translate(-50%, -50%) translateY(-5px) rotate(2deg); }
}

@keyframes bwc-float-3 {
  0%, 100% { transform: translate(-50%, -50%) translateX(0px) rotate(0deg); }
  50% { transform: translate(-50%, -50%) translateX(-6px) rotate(-2deg); }
}

/* Orbital rotation animation for surrounding words */
@keyframes bwc-orbit {
  0% { transform: translate(-50%, -50%) rotate(0deg) translateX(20px) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg) translateX(20px) rotate(-360deg); }
}

/* Keywords Cards Row */
.bwc-keywords-cards-row {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.bwc-keywords-cards-row.active {
  display: grid;
}

@media (max-width: 768px) {
  .bwc-keywords-cards-row {
    grid-template-columns: 1fr;
  }
}

.bwc-keywords-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.bwc-positive-card {
  border: 2px solid #059669;
}

.bwc-positive-card .bwc-card-header {
  color: #059669;
}

.bwc-positive-card .bwc-card-header svg {
  stroke: #059669;
}

.bwc-positive-card .bwc-keyword-tag {
  background: rgba(5,150,105,0.1);
  color: #047857;
}

.bwc-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
}

.bwc-keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bwc-keyword-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.bwc-negative-card {
  border: 2px solid #ef4444;
}

.bwc-negative-card .bwc-card-header {
  color: #ef4444;
}

.bwc-negative-card .bwc-card-header svg {
  stroke: #ef4444;
}

.bwc-negative-card .bwc-keyword-tag {
  background: rgba(239,68,68,0.1);
  color: #dc2626;
}

.bwc-keyword-tag.score {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.8;
}

/* ===================================
   5. RISK WARNING CARD
=================================== */
.bwc-risk-card {
  display: none;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 2px solid #fecaca;
  border-radius: 20px;
  padding: 28px 32px;
  margin-bottom: 30px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.bwc-risk-card.active {
  display: block;
  animation: bwc-shake 0.5s ease-in-out;
}

@keyframes bwc-shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.bwc-risk-keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.bwc-risk-keyword-item {
  padding: 8px 16px;
  background: #fff;
  border: 2px solid #fecaca;
  border-radius: 20px;
  font-size: 14px;
  color: #dc2626;
  font-weight: 500;
}

/* ===================================
   6. PLATFORM SCORES
=================================== */
.bwc-platform-scores {
  display: none;
  background: #fff;
  border-radius: 20px;
  padding: 28px 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  margin-bottom: 30px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.bwc-platform-scores.active {
  display: block;
}

.bwc-platform-scores-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 24px;
}

.bwc-platform-scores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .bwc-platform-scores-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .bwc-platform-scores-grid {
    grid-template-columns: 1fr;
  }
}

.bwc-platform-score-card {
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}

.bwc-platform-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.bwc-platform-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.bwc-platform-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a202c;
}

.bwc-platform-eng {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
}

.bwc-platform-score-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.bwc-platform-score-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}

.bwc-platform-score-fill.high {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.bwc-platform-score-fill.medium {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.bwc-platform-score-fill.low {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.bwc-platform-score-value {
  font-size: 24px;
  font-weight: 800;
  color: #1a202c;
}

.bwc-platform-score-label {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

/* Reference Sites */
.bwc-reference-sites {
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.bwc-reference-title {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 12px;
}

.bwc-reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bwc-reference-item {
  padding: 6px 12px;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 12px;
  color: #64748b;
  transition: all 0.2s ease;
}

.bwc-reference-item:hover {
  background: #e2e8f0;
  color: #475569;
}

/* ===================================
   7. EXPERT ADVICE
=================================== */
.bwc-expert-advice {
  display: none;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #bfdbfe;
  border-radius: 20px;
  padding: 28px 32px;
  margin-bottom: 30px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.bwc-expert-advice.active {
  display: block;
}

.bwc-expert-advice-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 16px;
}

.bwc-expert-advice-content {
  font-size: 15px;
  line-height: 1.8;
  color: #1e3a8a;
}

.bwc-expert-advice-content p {
  margin-bottom: 12px;
}

.bwc-expert-advice-content p:last-child {
  margin-bottom: 0;
}

.bwc-expert-advice-content strong {
  color: #1d4ed8;
}

/* ===================================
   8. CTA SECTION
=================================== */
.bwc-cta-section {
  padding: 0 0 50px;
}

.bwc-cta-card {
  background: radial-gradient(ellipse at 50% 20%,#E0FFFE 0%,transparent 50%),radial-gradient(ellipse at 80% 80%,#fef6e8 0%,transparent 45%),#f7f8fa;
  border-radius: 24px;
  padding: 40px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .bwc-cta-card {
    flex-direction: column;
    text-align: center;
    padding: 32px 24px;
  }
}

.bwc-cta-content {
  display: flex;
  align-items: center;
  gap: 20px;
}

@media (max-width: 768px) {
  .bwc-cta-content {
    flex-direction: column;
  }
}

.bwc-cta-icon {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  background: rgba(10, 181, 228, 0.15);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bwc-cta-icon svg {
  stroke: #0891b2;
}

.bwc-cta-text h3 {
  font-size: 22px;
  font-weight: 700;
  color: #0891b2;
  margin-bottom: 8px;
}

.bwc-cta-text p {
  font-size: 15px;
  color: #64748b;
}

.bwc-cta-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 16px 32px;
  background: linear-gradient(135deg, #F5A623 0%, #e09100 100%);
  color: #fff;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.bwc-cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(245,166,35,0.4);
}

.bwc-toast {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 10000;
  max-width: min(360px, calc(100vw - 32px));
  padding: 13px 18px;
  border-radius: 12px;
  background: #0f172a;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.bwc-toast[hidden] {
  display: none;
}

.bwc-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.bwc-toast.success {
  background: #047857;
}

.bwc-toast.error {
  background: #b91c1c;
}

@media (prefers-reduced-motion: reduce) {
  .bwc-modal-icon svg,
  .bwc-input.is-shaking,
  .bwc-risk-card.active,
  .bwc-word-item,
  .bwc-word-main {
    animation: none !important;
  }

  .bwc-wordcloud-area,
  .bwc-platform-score-fill,
  .bwc-toast {
    transition: none;
  }
}

/* ===================================
   9. RESPONSIVE ADJUSTMENTS
=================================== */
@media (max-width: 768px) {
  .bwc-hero-title {
    font-size: 28px;
  }
  
  .bwc-hero-sub {
    font-size: 14px;
  }
  
  .bwc-input-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .bwc-generate-btn {
    width: 100%;
    justify-content: center;
  }
  
  .bwc-modal-content {
    padding: 32px 24px;
  }
  
  .bwc-canvas-wrapper {
    padding: 16px;
  }
  
  .bwc-risk-card,
  .bwc-platform-scores,
  .bwc-expert-advice {
    padding: 20px;
  }
}
