/* =========================================
   公共样式 - 全站共用
   ========================================= */

/* CSS 变量 */
:root {
  /* 主色调 */
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-bg: rgba(37, 99, 235, 0.13);

  /* 强调色 */
  --accent: #f59e0b;
  --accent-light: #fbbf24;

  /* 成功/信息 */
  --success: #10b981;
  --info: #06b6d4;

  /* 中性色 — 淡蓝基调、适度加深 */
  --bg: #e8eef6;
  --bg-white: #eef3fa;
  --surface: #f0f4fb;
  --surface-alt: #dde5f1;
  --text: #162544;
  --text-secondary: #384e6a;
  --text-muted: #7486a0;
  --border: #bfccdb;
  --border-dark: #a4b5ca;

  /* 深色面板（用于页脚等） */
  --dark-bg: #0d1526;
  --dark-surface: #182035;
  --dark-surface2: #273450;
  --dark-text: #d8e0ec;
  --dark-border: #3a4d68;

  /* 间距 */
  --nav-height: 72px;
  --section-padding: 80px;
  --container-width: 1200px;

  /* 圆角与阴影 */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 4px rgba(12,28,60,0.10);
  --shadow: 0 4px 18px rgba(12,28,60,0.10);
  --shadow-lg: 0 12px 42px rgba(12,28,60,0.15);

  /* 过渡 */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================================
   容器
   ========================================= */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================
   导航栏
   ========================================= */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(224, 233, 246, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow var(--transition);
}

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

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.nav-brand img {
  height: 36px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: var(--primary-bg);
}

/* 移动端汉堡菜单 */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

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

/* =========================================
   页脚
   ========================================= */
.site-footer {
  background: var(--dark-bg);
  color: var(--dark-text);
  padding: 60px 0 32px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #fff;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #fff;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid var(--dark-border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* =========================================
   通用组件
   ========================================= */

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

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

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-light);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}

/* 区块标题 */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.section-header p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* 子页面通用头部 (page-hero) */
.page-hero {
  padding: 130px 0 60px;
  text-align: center;
  background: linear-gradient(135deg, #d4e2f5 0%, #e2eaf6 100%);
}

.page-hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}

.page-hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* 卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all var(--transition);
}

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

/* =========================================
   浮动联系 / 留言对话框
   ========================================= */

/* 浮动按钮 */
.contact-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  z-index: 9000;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.contact-fab:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37, 99, 235, 0.5);
}

.contact-fab.open {
  background: #ef4444;
  transform: rotate(45deg);
}

.contact-fab.open:hover {
  background: #dc2626;
}

/* 对话框面板 */
.contact-panel {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 360px;
  max-height: calc(100vh - 140px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 8999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpPanel 0.3s ease;
}

.contact-panel.open {
  display: flex;
}

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

/* 对话框头部 */
.contact-panel-header {
  background: var(--primary);
  color: #fff;
  padding: 18px 20px;
  flex-shrink: 0;
}

.contact-panel-header h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.contact-panel-header p {
  font-size: 0.8rem;
  opacity: 0.85;
  line-height: 1.5;
}

/* 公司信息区 */
.contact-info-list {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 2;
  flex-shrink: 0;
}

.contact-info-list a {
  color: var(--primary);
}

.contact-info-list a:hover {
  text-decoration: underline;
}

/* 留言表单区 */
.contact-form-area {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.contact-form-area h5 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.contact-form-area input,
.contact-form-area textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg);
  margin-bottom: 10px;
  outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
  resize: vertical;
}

.contact-form-area input:focus,
.contact-form-area textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.contact-form-area textarea {
  min-height: 80px;
}

.contact-form-area .contact-submit-btn {
  width: 100%;
  padding: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.contact-form-area .contact-submit-btn:hover {
  background: var(--primary-dark);
}

.contact-form-area .contact-submit-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}

.contact-success-msg {
  background: #d4e2f5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #065f46;
  font-size: 0.88rem;
  text-align: center;
  display: none;
  margin-top: 8px;
}

/* =========================================
   响应式
   ========================================= */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 48px;
    --nav-height: 60px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .section-header h2 {
    font-size: 1.6rem;
  }

  .page-hero {
    padding: 100px 0 36px;
  }
  .page-hero h1 {
    font-size: 1.8rem;
  }

  /* 浮动对话框移动端适配 */
  .contact-panel {
    right: 12px;
    left: 12px;
    bottom: 90px;
    width: auto;
    max-height: calc(100vh - 120px);
  }
  .contact-fab {
    bottom: 18px;
    right: 18px;
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }
}
