/**
 * SVTR.AI 深色主题
 * 参考数据榜单页面的深色风格
 * 只在 [data-theme="dark"] 时应用
 */

/* ========== 深色模式样式 ========== */
html[data-theme="dark"],
html[data-theme="dark"] body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
  color: #e2e8f0 !important;
}

/* Banner 区域 */
html[data-theme="dark"] .banner-header {
  background: #1a202c !important;
  border-bottom-color: #fa8c32 !important;
}

html[data-theme="dark"] .banner-title {
  color: #e2e8f0 !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .banner-tagline,
html[data-theme="dark"] .banner-tagline div {
  color: #cbd5e0 !important;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4) !important;
}

/* 业务标签 */
html[data-theme="dark"] .business-tag {
  background: #374151 !important;
  color: #ffffff !important;
  border: 2px solid rgba(250, 140, 50, 0.3) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .business-tag:hover {
  background: linear-gradient(135deg, #fa8c32, #ff9f40) !important;
  color: white !important;
  border-color: transparent !important;
  transform: scale(1.05) !important;
}

/* 侧边栏 */
html[data-theme="dark"] .sidebar {
  background: linear-gradient(135deg, rgba(26, 32, 44, 0.98), rgba(45, 55, 72, 0.95)) !important;
  backdrop-filter: blur(10px) !important;
  border-right-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .sidebar-header {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .sidebar-logo img {
  border-color: rgba(250, 140, 50, 0.3) !important;
}

html[data-theme="dark"] .nav-list a {
  color: #cbd5e0 !important;
}

html[data-theme="dark"] .nav-list a:hover,
html[data-theme="dark"] .nav-list a.active {
  color: #fa8c32 !important;
  background: rgba(250, 140, 50, 0.1) !important;
}

html[data-theme="dark"] .group-header {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .group-header.collapsible {
  background: rgba(55, 65, 81, 0.5) !important;
}

html[data-theme="dark"] .sub-list a {
  color: #a0aec0 !important;
}

html[data-theme="dark"] .sub-list a:hover {
  color: #fa8c32 !important;
}

/* 侧边栏底部 */
html[data-theme="dark"] .sidebar-bottom-actions {
  background: linear-gradient(135deg, rgba(26, 32, 44, 0.98), rgba(45, 55, 72, 0.95)) !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .btn-member-login {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: #60A5FA !important;
  color: #60A5FA !important;
}

html[data-theme="dark"] .social-media-icons {
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .social-media-icons a {
  color: #cbd5e0 !important;
  background: rgba(55, 65, 81, 0.5) !important;
}

/* 用户操作区域（订阅） */
html[data-theme="dark"] .user-actions {
  background: linear-gradient(135deg, rgba(55, 65, 81, 0.9), rgba(75, 85, 99, 0.7)) !important;
  border-color: rgba(156, 163, 175, 0.2) !important;
}

html[data-theme="dark"] .subscribe-form-inline input {
  background: #374151 !important;
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .subscribe-form-inline input::placeholder {
  color: #718096 !important;
}

html[data-theme="dark"] .btn-subscribe-submit {
  background: #059669 !important;
}

/* Wrapper / 卡片 */
html[data-theme="dark"] .wrapper {
  background: #1a202c !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* 统计卡片 Widget */
html[data-theme="dark"] .stats-wrapper {
  background: #1a202c !important;
  border-left-color: rgba(255, 255, 255, 0.1) !important;
  border-right-color: rgba(255, 255, 255, 0.1) !important;
}

/* Stats Widget iframe 内容 - 需要通过postMessage通知iframe切换主题 */
html[data-theme="dark"] .stats-widget-iframe {
  background: #1a202c !important;
  border-radius: 12px !important;
}

/* 融资日报 - 统一容器 */
html[data-theme="dark"] .funding-unified-container {
  background: #1a202c !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .funding-main-title .title-text {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .funding-subtitle {
  color: #cbd5e0 !important;
}

html[data-theme="dark"] .funding-stat-card {
  background: #2d3748 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .stat-label {
  color: #a0aec0 !important;
}

html[data-theme="dark"] .stat-value {
  color: #fa8c32 !important;
}

/* 图表区域 */
html[data-theme="dark"] .chart-container {
  background: #2d3748 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .chart-title {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .chart-bar-label {
  color: #f3f4f6 !important;
}

/* 筛选栏 */
html[data-theme="dark"] .filter-label {
  color: #ffffff !important;
}

html[data-theme="dark"] .filter-option {
  background: #4b5563 !important;
  color: #ffffff !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

html[data-theme="dark"] .filter-option.active {
  background: linear-gradient(135deg, #fa8c32, #ff9f40) !important;
  color: white !important;
  border-color: transparent !important;
}

html[data-theme="dark"] .filter-reset-btn {
  background: #4b5563 !important;
  color: #ffffff !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

/* 融资卡片 - 完整样式 */
html[data-theme="dark"] .funding-highlights {
  background: transparent !important;
}

/* 卡片容器 - 支持两种类名 */
html[data-theme="dark"] .funding-item,
html[data-theme="dark"] .funding-card {
  background: #2d3748 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .funding-item:hover,
html[data-theme="dark"] .funding-card:hover {
  background: #334155 !important;
  border-color: rgba(250, 140, 50, 0.3) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

/* 卡片内部容器 */
html[data-theme="dark"] .card-inner {
  background: transparent !important;
}

html[data-theme="dark"] .card-front,
html[data-theme="dark"] .card-back {
  background: #2d3748 !important;
}

html[data-theme="dark"] .company-name {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .company-stage {
  background: rgba(250, 140, 50, 0.2) !important;
  color: #ffa64d !important;
}

html[data-theme="dark"] .funding-amount {
  color: #48bb78 !important;
}

html[data-theme="dark"] .funding-round {
  color: #cbd5e0 !important;
}

html[data-theme="dark"] .funding-date {
  color: #9ca3af !important;
}

html[data-theme="dark"] .funding-description {
  color: #a0aec0 !important;
}

html[data-theme="dark"] .funding-tag {
  background: #374151 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

html[data-theme="dark"] .funding-tag:hover {
  background: rgba(250, 140, 50, 0.3) !important;
  border-color: rgba(250, 140, 50, 0.5) !important;
}

html[data-theme="dark"] .funding-time {
  color: #718096 !important;
}

html[data-theme="dark"] .funding-loading {
  color: #cbd5e0 !important;
}

html[data-theme="dark"] .load-more-btn {
  background: #374151 !important;
  color: #cbd5e0 !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
}

html[data-theme="dark"] .load-more-btn:hover {
  background: linear-gradient(135deg, #fa8c32, #ff9f40) !important;
  color: white !important;
  border-color: transparent !important;
}

/* 聊天组件 - 完整深色样式 */
html[data-theme="dark"] .chatbox {
  background: #1a202c !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .chat-header {
  color: #ffffff !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .chat-header a {
  color: #60a5fa !important;
}

html[data-theme="dark"] .chat-header a:hover {
  color: #3b82f6 !important;
}

/* SVTR Chat 原生容器 */
html[data-theme="dark"] #svtr-chat-container,
html[data-theme="dark"] .native-chat-container,
html[data-theme="dark"] .svtr-chat-container {
  background: #1a202c !important;
}

html[data-theme="dark"] .svtr-chat-wrapper,
html[data-theme="dark"] .chat-wrapper {
  background: #1a202c !important;
}

html[data-theme="dark"] .svtr-chat-messages,
html[data-theme="dark"] .chat-messages,
html[data-theme="dark"] .messages-container,
html[data-theme="dark"] #svtr-chat-messages {
  background: #2d3748 !important;
}

/* 聊天消息 */
html[data-theme="dark"] .svtr-message,
html[data-theme="dark"] .message,
html[data-theme="dark"] .chat-message {
  background: #374151 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

html[data-theme="dark"] .svtr-message.user,
html[data-theme="dark"] .message.user,
html[data-theme="dark"] .chat-message.user,
html[data-theme="dark"] .user-message {
  background: linear-gradient(135deg, #fa8c32, #ff9f40) !important;
  color: white !important;
  border: none !important;
}

html[data-theme="dark"] .svtr-message.assistant,
html[data-theme="dark"] .svtr-message.bot,
html[data-theme="dark"] .message.assistant,
html[data-theme="dark"] .message.bot,
html[data-theme="dark"] .bot-message {
  background: #374151 !important;
  color: #ffffff !important;
}

/* 消息内容 - 必须覆盖白色背景 */
html[data-theme="dark"] .message-content {
  background: #374151 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

html[data-theme="dark"] .svtr-message.user .message-content {
  background: linear-gradient(135deg, #fa8c32, #ff9f40) !important;
  color: white !important;
  border: none !important;
}

html[data-theme="dark"] .svtr-message.assistant .message-content {
  background: #374151 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .message-header {
  color: #f3f4f6 !important;
}

html[data-theme="dark"] .message-name {
  color: #f3f4f6 !important;
}

html[data-theme="dark"] .message-time {
  color: #9ca3af !important;
}

html[data-theme="dark"] .message-avatar {
  background: #4a5568 !important;
  color: #fbbf24 !important;
}

/* 输入区域 */
html[data-theme="dark"] .svtr-chat-input-area,
html[data-theme="dark"] .chat-input-area,
html[data-theme="dark"] .chat-input-container,
html[data-theme="dark"] .input-container {
  background: #2d3748 !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] #svtr-chat-input,
html[data-theme="dark"] .svtr-chat-input,
html[data-theme="dark"] .chat-input,
html[data-theme="dark"] .message-input,
html[data-theme="dark"] textarea.chat-input {
  background: #374151 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

html[data-theme="dark"] #svtr-chat-input:focus,
html[data-theme="dark"] .svtr-chat-input:focus,
html[data-theme="dark"] .chat-input:focus {
  border-color: #fa8c32 !important;
  box-shadow: 0 0 0 3px rgba(250, 140, 50, 0.2) !important;
}

html[data-theme="dark"] #svtr-chat-input::placeholder,
html[data-theme="dark"] .svtr-chat-input::placeholder,
html[data-theme="dark"] .chat-input::placeholder {
  color: #9ca3af !important;
}

/* 发送按钮 */
html[data-theme="dark"] .svtr-chat-send-btn,
html[data-theme="dark"] #svtr-chat-send,
html[data-theme="dark"] .chat-send-btn,
html[data-theme="dark"] .send-button,
html[data-theme="dark"] .btn-send {
  background: linear-gradient(135deg, #fa8c32, #ff9f40) !important;
  color: white !important;
  border: none !important;
}

html[data-theme="dark"] .svtr-chat-send-btn:hover,
html[data-theme="dark"] .chat-send-btn:hover,
html[data-theme="dark"] .send-button:hover {
  background: linear-gradient(135deg, #ff9f40, #ffb366) !important;
  box-shadow: 0 4px 12px rgba(250, 140, 50, 0.4) !important;
}

html[data-theme="dark"] .svtr-chat-send-btn:disabled,
html[data-theme="dark"] .chat-send-btn:disabled {
  background: #4a5568 !important;
  color: #718096 !important;
}

/* 加载状态 */
html[data-theme="dark"] .chat-loading,
html[data-theme="dark"] .typing-indicator,
html[data-theme="dark"] .loading-dots {
  background: #374151 !important;
  color: #cbd5e0 !important;
}

/* 系统消息 */
html[data-theme="dark"] .system-message,
html[data-theme="dark"] .chat-system {
  background: rgba(59, 130, 246, 0.1) !important;
  color: #60A5FA !important;
  border: 1px solid rgba(59, 130, 246, 0.2) !important;
}

/* 语言切换 */
html[data-theme="dark"] .lang-dropdown-trigger {
  background: #374151 !important;
  border-color: rgba(250, 140, 50, 0.4) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .lang-dropdown-menu {
  background: #374151 !important;
  border-color: rgba(250, 140, 50, 0.4) !important;
}

html[data-theme="dark"] .lang-option {
  background: #374151 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .lang-option:hover {
  background: rgba(250, 140, 50, 0.3) !important;
}

html[data-theme="dark"] .lang-option.active {
  background: linear-gradient(135deg, #fa8c32, #ff9f40) !important;
  color: white !important;
}

/* 文本通用 */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] p {
  color: #cbd5e0 !important;
}

html[data-theme="dark"] a {
  color: #60a5fa !important;
}

html[data-theme="dark"] a:hover {
  color: #3b82f6 !important;
}

/* 滚动条 */
html[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #1a202c !important;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #4a5568 !important;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #718096 !important;
}

/* 遮罩层 */
html[data-theme="dark"] .overlay.active {
  background: rgba(0, 0, 0, 0.7) !important;
}

/* 平滑过渡 */
* {
  transition: background-color 0.3s ease,
              color 0.3s ease,
              border-color 0.3s ease !important;
}
