/* 自定义样式 - 补充Tailwind */

/* 基础工具类（替换Tailwind） */
/* 注意：不使用 !important 以便响应式类可以覆盖 */
.hidden {
  display: none;
}

.text-center {
  text-align: center;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 全局样式 */
html {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Microsoft Yahei", "微软雅黑", "Hiragino Sans GB", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

body > main {
  flex: 1;
}

/* 主色调变量 */
:root {
  --primary-color: #0033CC;
  --primary-hover: #0029A3;
  --bg-gray: #F5F7FA;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 链接默认样式 */
a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

/* 按钮样式 */
.btn-primary {
  background-color: var(--primary-color);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

/* Swiper轮播样式优化 */
.swiper-button-next,
.swiper-button-prev {
  color: white !important;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 1.5rem;
  border-radius: 50%;
  width: 40px !important;
  height: 40px !important;
}

.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 18px !important;
}

.swiper-pagination-bullet {
  background-color: white !important;
  opacity: 0.7;
}

.swiper-pagination-bullet-active {
  background-color: var(--primary-color) !important;
  opacity: 1;
}

/* 产品表格样式 */
.product-table {
  width: 100%;
  border-collapse: collapse;
}

.product-table th {
  background-color: var(--bg-gray);
  font-weight: 600;
  color: #333;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e5e7eb;
}

.product-table td {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.875rem;
}

.product-table tbody tr:hover {
  background-color: #f9fafb;
}

/* DataTables样式覆盖 */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background-color: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  color: white !important;
}

/* Mega Menu过渡动画 */
#mega-menu {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* 面包屑样式 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

/* 新闻卡片样式 */
.news-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 产品卡片样式 */
.product-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 响应式表格 */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .product-table {
    font-size: 0.75rem;
  }

  .product-table th,
  .product-table td {
    padding: 0.5rem;
  }
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 51, 204, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 文本截断 */
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* 打印样式 */
@media print {
  header, footer, .no-print {
    display: none !important;
  }
}

/* 无障碍优化 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus样式 */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 滚动条样式（webkit浏览器） */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 应用领域Tab样式 */
.app-tab {
  position: relative;
  transition: all 0.3s ease;
}

.app-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  margin-bottom: -2px;
}

.tab-content {
  display: none !important;
  animation: fadeIn 0.4s ease-in-out;
}

.tab-content.active {
  display: block !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式Tab */
@media (max-width: 768px) {
  .app-tab {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
}

/* 新闻详情页内容样式 */
.news-content p {
  margin-bottom: 1.5rem;
  line-height: 1.75;
}

.news-content h2,
.news-content h3 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #111827;
  font-weight: 700;
}

.news-content h2 {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.news-content h3 {
  font-size: 1.5rem;
  line-height: 2rem;
}

.news-content ul {
  list-style-type: disc;
  padding-left: 1.25rem;
  margin-bottom: 1.5rem;
}

.news-content li {
  margin-bottom: 0.5rem;
  line-height: 1.75;
}

.news-content img {
  border-radius: 0.75rem;
  margin: 2rem 0;
  width: 100%;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.news-content strong {
  font-weight: 600;
  color: #111827;
}

.news-content .prose {
  max-width: none;
}

.news-content hr {
  margin: 2rem 0;
  border-color: #e5e7eb;
}

/* 响应式标题 */
@media (max-width: 768px) {
  .news-content h2 {
    font-size: 1.5rem;
    line-height: 2rem;
  }

  .news-content h3 {
    font-size: 1.25rem;
    line-height: 1.75rem;
  }
}

