@layer utilities {
  .content-auto {
    content-visibility: auto;
  }
  .text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  .card-shadow {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  }
  .hover-scale {
    transition: transform 0.3s ease;
  }
  .hover-scale:hover {
    transform: scale(1.02);
  }
  /* 移除旧的gradient-border样式 */
  .gradient-bg {
      background: linear-gradient(135deg, #1a237e 0%, #1976d2 100%);
  }
  
  /* 添加新的简约风格gradient-border样式 */
  .gradient-border {
      position: relative;
      border-radius: 0.75rem;
      border: 1px solid #e2e8f0;
      background-color: #ffffff;
  }
  
  .gradient-border::before {
      display: none;
  }
  .glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
  }
  .scrollbar-hide::-webkit-scrollbar {
    display: none;
  }
  .scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
}

/* K线图容器样式 */
#stock-kline-chart {
  width: 100% !important;
  height: 100% !important;
}

/* 技术指标卡片样式优化 */
.bg-gray-50 .grid.grid-cols-3.gap-3 {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

/* 新闻条目样式 */
.hot-news-list .line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hot-news-list .hover\:shadow-md:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* AI分析结果容器样式 */
.analysis-results-container {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
  border: 1px solid #f0f2f5;
  margin-bottom: 24px;
  /* 保留必要的布局约束 */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  /* 移除可能影响渲染的严格隔离属性 */
  position: relative;
  z-index: 1;
}

/* 调整内容约束，只针对可能破坏布局的元素 */
.analysis-results-container table,
.analysis-results-container img,
.analysis-results-container pre {
  max-width: 100%;
  box-sizing: border-box;
}

/* 特别针对表格的处理 */
.analysis-results-container table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

/* 针对图片的处理 */
.analysis-results-container img {
  height: auto;
}

/* 针对块级元素的处理 */
.analysis-results-container div,
.analysis-results-container p,
.analysis-results-container ul,
.analysis-results-container ol,
.analysis-results-container blockquote {
  max-width: 100%;
  box-sizing: border-box;
}

/* 增强Markdown渲染样式 */
.analysis-results-container h1, .analysis-results-container h2, .analysis-results-container h3 {
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  color: #1a237e;
}

/* 自定义渲染样式 */
.custom-heading-1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a237e;
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.custom-heading-2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a237e;
  margin: 1.25rem 0 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid #e2e8f0;
}

.custom-heading-3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a237e;
  margin: 1rem 0 0.5rem;
}

.custom-paragraph {
  color: #334155;
  line-height: 1.8;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.custom-list {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.custom-list-item {
  color: #475569;
  line-height: 1.8;
  margin-bottom: 0.5rem;
  position: relative;
}

.custom-list-item::before {
  content: '•';
  color: #3b82f6;
  font-weight: bold;
  position: absolute;
  left: -1rem;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
}

.custom-table th {
  background-color: #f8fafc;
  color: #1e293b;
  font-weight: 600;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
}

.custom-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.custom-table tr:hover {
  background-color: #f8fafc;
}

.custom-strong {
  color: #1e293b;
  font-weight: 600;
}

.custom-em {
  color: #64748b;
  font-style: italic;
}
.analysis-results-container strong { color: #1e293b; font-weight: 600; }
.analysis-results-container em { color: #475569; font-style: italic; }
.analysis-results-container a { color: #3b82f6; text-decoration: none; }
.analysis-results-container a:hover { text-decoration: underline; }

.analysis-results-container blockquote {
  border-left: 4px solid #94a3b8;
  padding-left: 1rem;
  color: #64748b;
  margin: 1rem 0;
  font-style: italic;
}

.analysis-results-container pre {
  background-color: #f8fafc;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.analysis-results-container code {
  background-color: #f1f5f9;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-family: monospace;
  font-size: 0.9em;
}

.analysis-results-container pre code {
  background-color: transparent;
  padding: 0;
}

/* 分析结果列表样式 */
.analysis-results-container ul, 
.analysis-results-container ol {
  padding-left: 24px;
  margin-bottom: 18px;
}

.analysis-results-container li {
  color: #475569;
  line-height: 1.8;
  margin-bottom: 10px;
}

/* 分析结果表格样式 */
.analysis-results-container table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.analysis-results-container th, 
.analysis-results-container td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.analysis-results-container th {
  background-color: #f8fafc;
  font-weight: 600;
  color: #1e293b;
}

.analysis-results-container tr:hover {
  background-color: #f8fafc;
}

/* 强调区块样式 */
.analysis-highlight {
  background-color: #f0f9ff;
  border-left: 4px solid #3b82f6;
  padding: 16px;
  margin-bottom: 20px;
  border-radius: 0 8px 8px 0;
}

/* 数据指标样式 */
.analysis-metric {
  font-weight: 600;
  color: #1a237e;
}

/* 加载动画优化 */
#loading-indicator .animate-spin,
#iframe-loading .animate-spin {
  border-color: #3b82f6 #e2e8f0 #e2e8f0;
}

/* 响应式加载指示器调整 */
@media (max-width: 640px) {
  #iframe-loading {
    top: 1/4;
    padding: 1rem;
  }
  
  #iframe-loading .animate-spin {
    height: 16px;
    width: 16px;
  }
}


/* 导航菜单响应式间距调整 */
@media (max-width: 1024px) {
  .md\:flex.space-x-10 {
    --tw-space-x-reverse: 0;
    margin-right: calc(2rem * var(--tw-space-x-reverse)) !important;
    margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse))) !important;
  }
}

@media (max-width: 768px) {
  /* 移动端菜单样式 */
  .mobile-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 40;
  }
}

/* 确保导航项文本不换行 */
.nav-item {
  white-space: nowrap;
}

/* 热门搜索页面样式 */
.hot-search-container {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.hot-search-title {
  color: #1a237e;
  margin-bottom: 1.5rem;
}

.search-table-container {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.search-table {
  width: 100%;
  border-collapse: collapse;
}

.search-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 600;
  text-align: left;
  padding: 1rem;
  border-bottom: 2px solid #e2e8f0;
}

.search-table td {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}

.search-table tr:last-child td {
  border-bottom: none;
}

.search-table tr:hover {
  background-color: #f8fafc;
}

.sort-button {
  background-color: #e2e8f0;
  color: #475569;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sort-button:hover {
  background-color: #cbd5e1;
}

.action-button {
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.action-button:hover {
  background-color: #2563eb;
}

/* 基础颜色定义 */
:root {
  --primary-color: #1976d2;
  --primary-light: #e3f2fd;
  --secondary-color: #f5f5f5;
  --text-color: #333333;
  --text-secondary: #666666;
  --border-color: #e0e0e0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 确保header和footer的样式正确 */
header {
  background-color: white;
  box-shadow: var(--shadow);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

footer {
  background-color: var(--primary-color);
  color: white;
  padding: 32px 0;
  margin-top: 48px;
}

/* 为导航链接添加样式 */
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

/* 页面内容样式 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.main-content {
  padding: 32px 0;
}

/* 搜索卡片样式 */
.search-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 32px;
}

/* 表格样式 */
.search-table {
  width: 100%;
  border-collapse: collapse;
}

.search-table th {
  background-color: var(--secondary-color);
  text-align: left;
  padding: 12px 16px;
  font-weight: bold;
  color: var(--text-secondary);
  font-size: 14px;
}

.search-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.search-table tbody tr:hover {
  background-color: var(--primary-light);
}

/* 按钮样式 */
.sort-button {
  background-color: var(--secondary-color);
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.sort-button:hover,
.sort-button.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.view-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 14px;
}

.view-button:hover {
  background-color: #1565c0;
}

/* 排名徽章样式 */
.rank-badge {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  line-height: 24px;
  font-size: 12px;
  font-weight: bold;
}

.rank-badge.top3 {
  background-color: #ff9800;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .sort-buttons {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .search-table-wrapper {
    overflow-x: auto;
  }
}

/* 一键分析按钮响应式调整 */
@media (max-width: 640px) {
  #search-btn {
    padding-left: 0.75rem; /* 减少左内边距 */
    padding-right: 0.75rem; /* 减少右内边距 */
  }
  
  #search-btn span {
    font-size: 0.875rem; /* 缩小文字大小 */
  }
  
  #search-btn i {
    margin-left: 0.5rem; /* 减少图标与文字间距 */
  }
}

/* 优化移动端搜索框与按钮布局 */
@media (max-width: 640px) {
  #stock-code-input {
    padding-right: 24px; /* 为按钮腾出空间 */
  }
}

/* 添加跑马灯样式到custom.css */
.announcement-marquee {
  height: 36px;
  line-height: 36px;
  font-size: 14px;
  color: #333;
  margin-bottom: 16px;
  border: 1px solid #e0e7ff;
  background: linear-gradient(to right, #e6f7ff, #f0f7ff);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}

.marquee-content {
  display: inline-block;
  white-space: nowrap;
  position: absolute;
  left: 100%;
  animation: marquee 20s linear infinite;
}

.announcement-item {
  display: inline-flex; /* 改为flex布局 */
  align-items: center; /* 垂直居中 */
  margin-right: 50px; /* 公告之间的间距 */
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-100% - 50px)); /* 减去一个公告间距 */
  }
}

/* 鼠标悬停时暂停滚动 */
.announcement-marquee:hover .marquee-content {
  animation-play-state: paused;
}

/* 优化移动设备显示 */
@media (max-width: 768px) {
  .announcement-marquee {
    height: 32px;
    line-height: 32px;
    font-size: 12px;
  }
  .marquee-content {
    animation-duration: 25s;
  }
  .announcement-item {
    margin-right: 30px;
  }
}

/* 在文件末尾添加或修改以下样式 */

/* 移动设备响应式字体大小调整 - 增强版 */
@media (max-width: 768px) {
  /* 更具体的选择器，确保样式生效 */
  #analysis-iframe {
    font-size: 0.7rem !important;
    transform-origin: 0 0 !important;
  }
  
  /* 强制重置iframe内部所有内容的字体大小 */
  #analysis-iframe body,
  #analysis-iframe div,
  #analysis-iframe p,
  #analysis-iframe span,
  #analysis-iframe h1,
  #analysis-iframe h2,
  #analysis-iframe h3,
  #analysis-iframe h4,
  #analysis-iframe h5,
  #analysis-iframe h6,
  #analysis-iframe li,
  #analysis-iframe td,
  #analysis-iframe th,
  #analysis-iframe pre,
  #analysis-iframe code {
    font-size: 0.8rem !important;
    line-height: 1.5 !important;
  }
  
  /* 特别针对标题的调整 */
  #analysis-iframe h1 {
    font-size: 1rem !important;
  }
  
  #analysis-iframe h2 {
    font-size: 0.9rem !important;
  }
  
  #analysis-iframe h3 {
    font-size: 0.8rem !important;
  }
  
  /* 特别针对表格和代码的调整 */
  #analysis-iframe table,
  #analysis-iframe pre,
  #analysis-iframe code {
    font-size: 0.7rem !important;
  }
}
