/* ============================================================
   前台网站通用样式 - 现代企业站
   配色由 JS 动态设置 CSS 变量（根据行业）
   ============================================================ */

/* CSS 变量 - 默认配色（JS 会覆盖） */
:root {
  --primary: #2563eb;
  --secondary: #1d4ed8;
  --accent: #60a5fa;
  --bg-light: #eff6ff;
  --text-dark: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --white: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 30px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text-body);
  background: var(--white);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   导航栏
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-dark);
}

.nav-logo {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.nav-company {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-menu {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-body);
  position: relative;
  padding: 8px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: var(--primary);
  transition: var(--transition);
  transform: translateX(-50%);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: var(--transition);
}

/* ============================================================
   Hero Banner
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  overflow: hidden;
  padding-top: 70px;
}

/* AI 生成的 Hero 背景图 */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.hero-bg.has-image {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="2"/></g></g></svg>');
}
/* 有背景图时，overlay 加深以保证文字可读 */
.hero-bg.has-image ~ .hero-overlay {
  background: linear-gradient(135deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.35) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--white);
  max-width: 800px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 20px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
  letter-spacing: 1px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
  text-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

.hero-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.hero-keywords .kw-tag {
  padding: 6px 16px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  font-size: 13px;
  backdrop-filter: blur(4px);
}

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.8;
  margin-bottom: 36px;
  opacity: 0.92;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.4);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--white);
}

.hero-scroll {
  position: absolute;
  bottom: 30px; left: 50%;
  transform: translateX(-50%);
  color: var(--white);
  font-size: 12px;
  text-align: center;
  opacity: 0.7;
  z-index: 2;
}

.scroll-arrow {
  width: 2px; height: 30px;
  margin: 8px auto 0;
  background: rgba(255,255,255,0.5);
  position: relative;
  overflow: hidden;
}

.scroll-arrow::after {
  content: '';
  position: absolute;
  top: -30px; left: 0;
  width: 100%; height: 30px;
  background: var(--white);
  animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
  0% { top: -30px; }
  100% { top: 30px; }
}

/* ============================================================
   通用 Section
   ============================================================ */
.section {
  padding: 90px 0;
}

.section-alt {
  background: var(--bg-light);
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--primary);
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.section-line {
  width: 60px; height: 3px;
  background: var(--primary);
  margin: 0 auto;
  border-radius: 2px;
}

/* ============================================================
   关于我们
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

/* 关于我们配图 */
.about-image {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0,0,0,0.12);
  aspect-ratio: 4 / 3;
}
.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 业务范围板块 */
.services-showcase { margin-top: 8px; }
.services-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}
.service-image {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0,0,0,0.12);
  aspect-ratio: 4 / 3;
}
.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.service-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.service-card {
  background: var(--white);
  padding: 24px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.service-card .service-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}
.service-card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}
.service-card p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}
.services-loading {
  text-align: center;
  color: var(--text-light);
  padding: 40px 0;
}

.about-company {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
}

.about-desc {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-body);
  margin-bottom: 28px;
}

.about-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: left;
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.feature-icon {
  width: 48px; height: 48px;
  background: var(--bg-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.feature-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================================
   资讯动态
   ============================================================ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.news-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid var(--border);
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.news-card-image {
  height: 180px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.news-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="1" fill="%23ffffff" fill-opacity="0.1"/></svg>');
}

.news-card-body {
  padding: 24px;
}

.news-card-date {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 8px;
}

.news-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-summary {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card:hover .news-card-title {
  color: var(--primary);
}

.news-loading, .news-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
  font-size: 15px;
}

/* ============================================================
   联系我们
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: var(--transition);
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.contact-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  background: var(--bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.contact-card h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.contact-card p {
  font-size: 14px;
  color: var(--text-muted);
  word-break: break-all;
}

/* ============================================================
   页脚
   ============================================================ */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 40px 0;
}

.footer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
}

.footer-logo {
  width: 48px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.footer-nav {
  display: flex;
  gap: 24px;
}

.footer-nav a {
  font-size: 14px;
  color: #94a3b8;
}

.footer-nav a:hover {
  color: var(--white);
}

.footer-info {
  text-align: right;
  font-size: 13px;
  line-height: 1.8;
}

.footer-info a {
  color: #94a3b8;
}

.footer-info a:hover {
  color: var(--white);
}

/* ============================================================
   文章详情弹窗
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border: none;
  background: var(--bg-light);
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--primary);
  color: var(--white);
}

.modal-content h2 {
  font-size: 1.5rem;
  color: var(--text-dark);
  margin-bottom: 12px;
  padding-right: 40px;
  line-height: 1.4;
}

.modal-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-body {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-body);
}

.modal-body h1, .modal-body h2, .modal-body h3 {
  color: var(--text-dark);
  margin: 20px 0 12px;
}

.modal-body p { margin-bottom: 14px; }

.modal-body img {
  border-radius: var(--radius-sm);
  margin: 16px 0;
}

.modal-body a {
  color: var(--primary);
  text-decoration: underline;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 968px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-container { flex-direction: column; text-align: center; }
  .footer-info { text-align: center; }
  .services-layout { grid-template-columns: 1fr; gap: 24px; }
  .service-cards-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 70px; left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 20px;
    gap: 0;
    box-shadow: var(--shadow-lg);
    transform: translateY(-150%);
    transition: var(--transition);
  }

  .nav-menu.active {
    transform: translateY(0);
  }

  .nav-link {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    width: 100%;
    text-align: center;
  }

  .nav-link::after { display: none; }

  .nav-toggle { display: flex; }

  .nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .nav-toggle.active span:nth-child(2) { opacity: 0; }
  .nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

  .section { padding: 60px 0; }
  .section-header { margin-bottom: 40px; }
  .news-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .about-features { grid-template-columns: 1fr; }
  .about-stats { gap: 20px; }
  .modal-content { padding: 24px; }
  .hero-actions { flex-direction: column; width: 100%; }
  .btn { width: 100%; }
  .footer-nav { flex-wrap: wrap; justify-content: center; }
}

/* ============================================================
   友情链接
   ============================================================ */
.links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.link-item {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: var(--white);
  color: var(--text-body);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  box-shadow: var(--shadow);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-item:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.link-item::before {
  content: '🔗';
  margin-right: 8px;
  font-size: 14px;
  opacity: 0.7;
}

.links-loading, .links-empty {
  width: 100%;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

@media (max-width: 768px) {
  .links-grid { gap: 8px; }
  .link-item { padding: 8px 14px; font-size: 13px; }
}
