/* ===== 米达尔国际物流 - 公共样式 ===== */
/* 跨浏览器兼容性增强版 */

/* 整站默认缩放 90%（在当前基础上缩小 10%） */
html { zoom: 0.9; }

:root {
  --primary: #0B3D91;
  --primary-dark: #082A66;
  --primary-light: #0F4DB8;
  --accent: #FF7A00;
  --accent-dark: #E06A00;
  --dark: #333333;
  --medium: #666666;
  --light: #EEEEEE;
  --white: #FFFFFF;
  --bg: #F8F9FA;
  --shadow: 0 2px 15px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
  --radius: 12px;
  /* 增强字体栈：Noto Sans SC → 系统苹方 → 微软雅黑 → 兜底 */
  --font: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'WenQuanYi Micro Hei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* 安全区域适配（iPhone 刘海屏） */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%; /* 防止 iOS 横屏字体放大 */
  -webkit-tap-highlight-color: transparent; /* 移除 iOS 点击高亮 */
  touch-action: manipulation; /* 消除移动端 300ms 点击延迟 */
}
body {
  font-family: var(--font);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
  /* improve font rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }
/* 防止 iOS 输入框聚焦时自动放大（仅移动端） */
@media (max-width: 768px) {
  input, textarea, select { font-size: 16px !important; }
}

/* ===== Container ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 900px; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px; border-radius: 50px;
  font-weight: 500; font-size: 16px; cursor: pointer; transition: var(--transition); border: none; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(11,61,145,0.4); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(255,122,0,0.4); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-white { background: var(--white); color: var(--primary); }
.btn-white:hover { background: #f0f0f0; transform: translateY(-2px); }
@media (max-width: 768px) {
  .btn { min-height: 44px; font-size: 15px; }
}

/* ===== Navbar ===== */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: var(--white);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08); transition: var(--transition); }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; max-width: 1200px; margin: 0 auto; }
.nav-logo { font-size: 22px; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.nav-logo img { height: 48px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { font-size: 15px; font-weight: 500; color: var(--dark); position: relative; padding: 4px 0; transition: var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-links a::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px;
  background: var(--accent); transition: width 0.3s; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; background: none; border: none; }
.nav-toggle span { width: 25px; height: 2px; background: var(--primary); transition: var(--transition); }
.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(5px,-5px); }
@media (max-width: 768px) {
  .nav-links { position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: var(--white);
    flex-direction: column; padding: 30px; gap: 20px; transform: translateX(100%); transition: transform 0.3s; }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: flex; }
}

/* ===== Page Banner ===== */
.page-banner { background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 120px 0 60px; text-align: center; color: var(--white); position: relative; overflow: hidden; }
.page-banner::before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" d="M0,160L48,144C96,128,192,96,288,112C384,128,480,192,576,213.3C672,235,768,213,864,181.3C960,149,1056,107,1152,106.7C1248,107,1344,149,1392,170.7L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"/></svg>') no-repeat bottom; background-size: cover; }
.page-banner h1 { font-size: 42px; font-weight: 700; margin-bottom: 12px; position: relative; }
.page-banner p { font-size: 18px; opacity: 0.9; position: relative; }
@media (max-width: 768px) {
  .page-banner { padding: 100px 0 40px; }
  .page-banner h1 { font-size: 26px; }
  .page-banner p { font-size: 14px; }
}

/* ===== Section ===== */
.section { padding: 80px 0; }
@media (max-width: 768px) {
  .section { padding: 50px 0; }
  .section-title { margin-bottom: 36px; }
  .section-title h2 { font-size: 24px; }
  .section-title p { font-size: 14px; }
}
.section-title { text-align: center; margin-bottom: 50px; }
.section-title h2 { font-size: 32px; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
.section-title p { font-size: 16px; color: var(--medium); max-width: 600px; margin: 0 auto; }
.section-title .divider { width: 60px; height: 3px; background: var(--accent); margin: 15px auto 0; border-radius: 3px; }

/* ===== Cards ===== */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: var(--transition); }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.12); }
.card-body { padding: 24px; }

/* ===== Hero (index) ===== */
.hero { background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 40%, #fff5eb 100%); }
/* 布局由 index.html 内联 style 控制，此处仅定义视觉样式 */
.hero-text .hero-badge { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; font-size: 14px; font-weight: 500; padding: 8px 20px; border-radius: 50px; margin-bottom: 24px;
  box-shadow: 0 4px 15px rgba(11,61,145,0.25); animation: pulse-badge 2.5s ease-in-out infinite; }
.hero-text h1 { font-size: 52px; font-weight: 700; line-height: 1.2; margin-bottom: 20px; color: var(--primary); }
.hero-text h1 span { color: var(--accent); position: relative; display: inline-block; }
.hero-text h1 span::after { content: ''; position: absolute; bottom: 6px; left: 0; right: 0; height: 10px;
  background: rgba(255,122,0,0.15); border-radius: 5px; z-index: -1; }
.hero-text p { font-size: 18px; color: var(--medium); margin-bottom: 30px; line-height: 1.8; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-bottom: 40px; }
.hero-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.hero-feature-item { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--primary); }
.hero-feature-item i { color: #10b981; font-size: 16px; }
/* Hero 浮动装饰圆 */
.hero-decoration { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 0; }
.hero-circle { position: absolute; border-radius: 50%; opacity: 0.06; }
.hero-circle-1 { width: 600px; height: 600px; background: var(--primary); top: -250px; right: -200px; }
.hero-circle-2 { width: 400px; height: 400px; background: var(--accent); bottom: -150px; left: -120px; }
.hero-circle-3 { width: 250px; height: 250px; background: var(--primary); top: 30%; left: 15%; opacity: 0.04; }
@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 4px 15px rgba(11,61,145,0.25); }
  50% { box-shadow: 0 4px 25px rgba(11,61,145,0.45); }
}
@media (max-width: 768px) {
  .hero-text h1 { font-size: 30px; }
  .hero-text p { font-size: 15px; }
  .hero-features { gap: 16px; }
  .hero-feature-item { font-size: 12px; }
  .hero-circle-1 { width: 350px; height: 350px; top: -150px; right: -120px; }
  .hero-circle-2 { width: 250px; height: 250px; bottom: -100px; left: -80px; }
}

/* ===== Stats ===== */
.stats-bar { 
  background: linear-gradient(135deg, #0B3D91 0%, #0F4DB8 40%, #0B3D91 100%); 
  padding: 70px 0; 
  color: var(--white); 
  position: relative;
  overflow: hidden;
}
.stats-bar::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.6;
}
.stats-grid { 
  display: grid; 
  grid-template-columns: repeat(4, 1fr); 
  gap: 0; 
  position: relative;
  z-index: 1;
}
.stat-item { 
  padding: 10px 20px;
  position: relative;
  transition: transform 0.3s ease;
  text-align: center;
}
.stat-item:hover {
  transform: translateY(-6px);
}
.stat-item::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 70px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.2), transparent);
}
.stat-item:last-child::after {
  display: none;
}
.stat-item .stat-icon { 
  font-size: 36px; 
  margin-bottom: 18px; 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}
.stat-item:hover .stat-icon {
  background: rgba(255,255,255,0.2);
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.stat-item .stat-number { 
  font-size: 44px; 
  font-weight: 800; 
  margin-bottom: 6px; 
  line-height: 1.1;
}
.stat-item .stat-suffix {
  font-size: 26px;
  font-weight: 600;
  color: var(--accent);
}
.stat-item .stat-label { 
  font-size: 15px; 
  opacity: 0.85;
  font-weight: 500;
  letter-spacing: 1px;
}
@media (max-width: 768px) { 
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-item { padding: 25px 15px; }
  .stat-item:nth-child(2)::after { display: none; }
  .stat-item .stat-number { font-size: 34px; }
  .stat-item .stat-icon { width: 62px; height: 62px; font-size: 28px; }
}

/* ===== Service Cards ===== */
.service-card { text-align: center; padding: 30px 20px; }
.service-card .service-icon { width: 70px; height: 70px; margin: 0 auto 20px; background: linear-gradient(135deg, #e8f0fe, #d4e4ff);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--primary); }
.service-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 10px; color: var(--primary); }
.service-card p { font-size: 14px; color: var(--medium); }
.service-card .tag { display: inline-block; background: var(--accent); color: #fff; font-size: 11px;
  padding: 3px 10px; border-radius: 20px; position: absolute; top: 12px; right: 12px; }

/* ===== Footer ===== */
.footer { background: #0a1628; color: #b0bec5; padding: 60px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.5fr; gap: 40px; margin-bottom: 40px; }
.footer h4 { color: var(--white); font-size: 16px; font-weight: 600; margin-bottom: 20px; position: relative; padding-bottom: 10px; }
.footer h4::after { content: ''; position: absolute; bottom: 0; left: 0; width: 30px; height: 2px; background: var(--accent); }
.footer p, .footer a { font-size: 14px; line-height: 2; color: #90a4ae; transition: var(--transition); }
.footer a:hover { color: var(--accent); padding-left: 4px; }
.footer .social-links { display: flex; gap: 12px; margin-top: 16px; }
.footer .social-links a { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center; font-size: 14px; }
.footer .social-links a:hover { background: var(--accent); color: #fff; padding-left: 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px; text-align: center; font-size: 13px; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ===== AI Chat ===== */
.ai-chat-btn { position: fixed; bottom: 30px; right: 30px; z-index: 999; width: 60px; height: 60px;
  border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
  border: none; cursor: pointer; font-size: 28px; box-shadow: 0 4px 20px rgba(255,122,0,0.4);
  transition: var(--transition); display: flex; align-items: center; justify-content: center; }
.ai-chat-btn:hover { transform: scale(1.1); }
@media (max-width: 600px) {
  .ai-chat-btn { bottom: calc(20px + var(--safe-bottom)); right: 16px; width: 50px; height: 50px; font-size: 24px; }
  .ai-chat-panel { bottom: calc(80px + var(--safe-bottom)); right: 10px; width: calc(100vw - 20px); }
}
.ai-chat-panel { position: fixed; bottom: 100px; right: 30px; z-index: 998; width: 360px; max-width: calc(100vw - 20px); max-height: 500px;
  background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  display: none; flex-direction: column; overflow: hidden; }
.ai-chat-panel.open { display: flex; }
.ai-chat-header { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff;
  padding: 16px 20px; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.ai-chat-body { flex: 1; padding: 16px; overflow-y: auto; max-height: 350px; display: flex; flex-direction: column; gap: 10px; }
.ai-chat-body .msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.6; }
.ai-chat-body .msg.bot { background: #f0f4ff; align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-chat-body .msg.user { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-chat-footer { border-top: 1px solid #eee; padding: 12px; display: flex; gap: 8px; }
.ai-chat-footer input { flex: 1; border: 1px solid #ddd; border-radius: 20px; padding: 8px 14px; font-size: 13px; outline: none; }
.ai-chat-footer button { background: var(--accent); color: #fff; border: none; border-radius: 50%;
  width: 36px; height: 36px; cursor: pointer; font-size: 16px; flex-shrink: 0; }

/* ===== Timeline (Tracking) ===== */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 13px; top: 0; bottom: 0; width: 2px; background: #e0e0e0; }
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -24px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: #e0e0e0; border: 2px solid #fff; z-index: 1; }
.timeline-item.completed .timeline-dot { background: #10b981; }
.timeline-item.active .timeline-dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(255,122,0,0.2); }
.timeline-item .time { font-size: 12px; color: var(--medium); margin-bottom: 4px; }
.timeline-item .status-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.timeline-item .location { font-size: 12px; color: var(--medium); }

/* ===== Tracking page extras ===== */
.demo-track-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.demo-track-no { display: inline-flex; align-items: center; padding: 5px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 999px; background: #fff; font-size: 12px; color: var(--text, #2c2c2a); cursor: pointer; transition: all .15s ease; }
.demo-track-no:hover { border-color: var(--primary, #2563EB); color: var(--primary, #2563EB); background: #eff6ff; }
.demo-track-no::before { content: '\f0d1'; font-family: 'Font Awesome 5 Free'; font-weight: 900; font-size: 11px; margin-right: 6px; opacity: .6; }
.track-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--medium); padding-top: 4px; border-top: 1px dashed var(--border, #e5e7eb); margin-bottom: 4px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; color: var(--dark); margin-bottom: 6px; }
.form-input { width: 100%; padding: 12px 16px; border: 2px solid #e0e0e0; border-radius: 10px;
  font-size: 15px; transition: var(--transition); font-family: var(--font); }
.form-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(11,61,145,0.1); }
.form-select { width: 100%; padding: 12px 16px; border: 2px solid #e0e0e0; border-radius: 10px;
  font-size: 15px; background: #fff; font-family: var(--font); }
.form-textarea { width: 100%; padding: 12px 16px; border: 2px solid #e0e0e0; border-radius: 10px;
  font-size: 15px; resize: vertical; min-height: 100px; font-family: var(--font); }

/* ===== Status Badges ===== */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 0; border-bottom: 2px solid #eee; margin-bottom: 30px; overflow-x: auto; }
.tab-btn { padding: 12px 24px; border: none; background: none; font-size: 15px; font-weight: 500;
  color: var(--medium); cursor: pointer; transition: var(--transition); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--accent); }
@media (max-width: 768px) {
  .tab-btn { padding: 10px 16px; font-size: 13px; min-height: 42px; }
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s; }

/* ===== Step Wizard ===== */
.step-indicator { display: flex; justify-content: center; margin-bottom: 40px; }
.step-dot { width: 36px; height: 36px; border-radius: 50%; background: #e0e0e0; color: #999;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; position: relative; z-index: 1; }
.step-dot.active { background: var(--primary); color: #fff; }
.step-dot.done { background: #10b981; color: #fff; }
.step-line { flex: 1; height: 2px; background: #e0e0e0; margin: 17px 8px 0; max-width: 80px; }
.step-line.done { background: #10b981; }
.step-form { display: none; }
.step-form.active { display: block; animation: fadeIn 0.3s; }

/* ===== Animations ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.6s ease forwards; }
.slide-up { animation: slideUp 0.6s ease forwards; }

/* ===== Utilities ===== */
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.bg-primary { background: var(--primary) !important; }
.bg-accent { background: var(--accent) !important; }
.bg-light { background: var(--bg) !important; }
.text-center { text-align: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
/* 运输流程网格（6列→3列→2列） */
.flow-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; text-align: center; }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .flow-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .flow-grid { grid-template-columns: repeat(2, 1fr); }
}
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }

/* ===== 跨浏览器兼容性增强 ===== */

/* Vendor-prefixed animations (for Safari / older WebKit browsers) */
@-webkit-keyframes fadeIn { from { opacity: 0; -webkit-transform: translateY(10px); transform: translateY(10px); } to { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0); } }
@-webkit-keyframes slideUp { from { opacity: 0; -webkit-transform: translateY(30px); transform: translateY(30px); } to { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0); } }
@-webkit-keyframes pulse-badge {
  0%, 100% { box-shadow: 0 4px 15px rgba(11,61,145,0.25); }
  50% { box-shadow: 0 4px 25px rgba(11,61,145,0.45); }
}

/* Safari / old WebKit gap fallback for flex containers */
/* Using @supports to only apply margin fallback when gap is NOT supported */
@supports not (gap: 0) {
  /* navigation */
  .nav-links > li + li { margin-left: 28px; }
  .nav-logo { gap: 0; }
  .nav-logo > * + * { margin-left: 8px; }

  /* buttons */
  .btn { gap: 0; }
  .btn > * + * { margin-left: 8px; }
  .hero-buttons { gap: 0; }
  .hero-buttons > * + * { margin-left: 16px; }

  /* AI chat */
  .ai-chat-body { gap: 0; }
  .ai-chat-body > * + * { margin-top: 10px; }
  .ai-chat-footer { gap: 0; }
  .ai-chat-footer > * + * { margin-left: 8px; }
  .ai-chat-header { gap: 0; }
  .ai-chat-header > * + * { margin-left: 10px; }

  /* footer social */
  .footer .social-links { gap: 0; }
  .footer .social-links > * + * { margin-left: 12px; }

  /* hero features (wrapping context - use margin-top too) */
  .hero-features { gap: 0; }
  .hero-feature-item { margin-right: 28px; margin-bottom: 12px; }

  /* nav toggle */
  .nav-toggle { gap: 0; }
  .nav-toggle span + span { margin-top: 5px; }

  /* result-meta in tracking pages */
  .result-meta { gap: 0; }
  .result-meta > * + * { margin-left: 20px; }
}

/* aspect-ratio fallback for Safari < 15 */
@supports not (aspect-ratio: 1/1) {
  .aspect-fallback {
    position: relative;
    height: 0;
  }
}

/* object-fit fallback for very old browsers */
@supports not (object-fit: cover) {
  img[style*="object-fit:cover"] {
    font-family: 'object-fit: cover;'; /* CSS polyfill hint */
  }
}

/* Smooth scrolling fallback */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    -webkit-animation-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    -webkit-transition-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile viewport height fix (iOS Safari / WeChat address bar) */
/* Applied via JS enhancement, CSS provides the var fallback */
:root { --vh: 1vh; }
@supports (height: 100dvh) {
  :root { --vh: 1dvh; }
}
/* Use: min-height: calc(var(--vh) * 100) as 100vh replacement */

/* ===== 按钮 & 表单跨浏览器一致化 ===== */
button, input, select, textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
/* 恢复 select 的下拉箭头 */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
/* 修复 Safari 下 input type="search" 的清除按钮样式 */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

/* ===== iPhone 刘海屏安全区域适配 ===== */
.navbar {
  padding-top: var(--safe-top);
}
.ai-chat-btn {
  bottom: calc(30px + var(--safe-bottom));
}
.ai-chat-panel {
  bottom: calc(100px + var(--safe-bottom));
}

/* ===== 图片渲染优化 ===== */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  /* 防止 iOS 下图片模糊 */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* ===== 网页在线客服浮窗（基础版 E 群机器人桥接） ===== */
.chat-widget { position: fixed; right: 24px; bottom: 24px; z-index: 9999; font-family: inherit; }

/* 居中遮罩：让客服窗口像 PC 微信一样前置 */
.chat-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.28);
  z-index: 9998; opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.chat-overlay.open { opacity: 1; pointer-events: auto; }

/* 在线客服：访客称呼输入 + 人工回复气泡 */
.chat-name-input { width: calc(100% - 24px); margin: 8px 12px 0; padding: 7px 10px; border: 1px solid #E2E8F0; border-radius: 8px; font-size: 12px; outline: none; box-sizing: border-box; }
.chat-name-input:focus { border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.chat-messages .chat-row-me { align-self: flex-end; display: flex; flex-direction: column; align-items: flex-end; max-width: 100%; width: 100%; }
.chat-messages .chat-row-other { align-self: flex-start; display: flex; flex-direction: column; align-items: flex-start; max-width: 100%; width: 100%; }
.chat-role-tag { font-size: 11px; color: #07c160; margin-bottom: 2px; }
.chat-bubble.agent { background: #07c160; color: #fff; border-bottom-left-radius: 4px; }

.chat-fab {
  position: relative;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(37, 99, 235, 0.45); }
/* 右下角未读红点 */
.chat-badge {
  position: absolute; top: -7px; right: -7px;
  min-width: 22px; height: 22px; padding: 0 6px; box-sizing: border-box;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 13px; line-height: 22px; text-align: center; font-weight: 700;
  box-shadow: 0 0 0 2px #fff; display: none; justify-content: center; align-items: center;
}
.chat-badge.dot { min-width: 14px; width: 14px; height: 14px; padding: 0; top: -5px; right: -5px; }

.chat-panel {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.98);
  width: min(460px, 94vw); height: min(640px, 86vh);
  max-width: none; max-height: none;
  background: #fff; border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  border: 1px solid #E2E8F0;
  opacity: 0; pointer-events: none; z-index: 10000;
  transition: opacity .2s ease, transform .2s ease;
}
.chat-panel.open { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }

.chat-header {
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: #fff; padding: 16px; display: flex; align-items: center; justify-content: space-between;
}
.chat-header-info { display: flex; align-items: center; gap: 10px; }
.chat-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18); display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.chat-title { font-size: 15px; font-weight: 600; }
.chat-sub { font-size: 11px; opacity: 0.82; margin-top: 2px; }
.chat-close {
  background: rgba(255, 255, 255, 0.15); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.chat-close:hover { background: rgba(255, 255, 255, 0.3); }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; background: #F8FAFC; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble { max-width: min(420px, 78%); min-width: 24px; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: normal; overflow-wrap: anywhere; }
.chat-bubble.bot { background: #fff; color: #1E293B; align-self: flex-start; border: 1px solid #E2E8F0; border-bottom-left-radius: 4px; }
.chat-bubble.me { background: #2563EB; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }

.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; background: #fff; }
.chat-quick-btn {
  font-size: 12px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid #DBEAFE; background: #EFF6FF; color: #2563EB; transition: background .15s;
}
.chat-quick-btn:hover { background: #DBEAFE; }

.chat-input-row { display: flex; gap: 6px; padding: 10px 12px; background: #fff; border-top: 1px solid #E2E8F0; align-items: center; }
.chat-tool-btn {
  width: 32px; height: 32px; border: none; border-radius: 8px; cursor: pointer; background: transparent;
  color: #64748B; font-size: 18px; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.chat-tool-btn:hover { background: #F1F5F9; color: #2563EB; }
.chat-input {
  flex: 1; border: 1px solid #E2E8F0; border-radius: 10px; padding: 9px 12px;
  font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.chat-input:focus { border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.chat-send {
  width: 36px; height: 36px; border: none; border-radius: 10px; cursor: pointer;
  background: #2563EB; color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
.chat-send:hover { background: #1D4ED8; }
.chat-emoji-panel {
  position: absolute; left: 12px; bottom: 62px; width: calc(100% - 24px); max-height: 180px; overflow-y: auto;
  background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; box-shadow: 0 8px 24px rgba(15,23,42,0.12); padding: 10px; z-index: 10;
}
.chat-emoji-list { display: flex; flex-wrap: wrap; gap: 6px; font-size: 22px; line-height: 1; cursor: pointer; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.chat-emoji-list span { padding: 3px; border-radius: 4px; transition: background .1s; }
.chat-emoji-list span:hover { background: #F1F5F9; }
.chat-emoji-list span img.twemoji { width: 24px; height: 24px; display: block; }
.chat-msg-image { max-width: 220px; max-height: 220px; border-radius: 8px; cursor: pointer; display: block; }
/* 文件卡片 */
.chat-msg-file { display: inline-flex; align-items: center; gap: 8px; max-width: 240px; padding: 10px 12px; background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; color: #1E293B; text-decoration: none; font-size: 13px; box-sizing: border-box; }
.chat-msg-file i { font-size: 20px; color: #2563EB; flex-shrink: 0; }
.chat-msg-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-msg-file em { font-style: normal; color: #2563EB; font-size: 12px; flex-shrink: 0; }
.chat-bubble.me .chat-msg-file { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.45); color: #fff; }
.chat-bubble.me .chat-msg-file i, .chat-bubble.me .chat-msg-file em { color: #fff; }

@media (max-width: 480px) {
  .chat-widget { right: 16px; bottom: 16px; }
  .chat-panel { width: calc(100vw - 32px); height: 70vh; }
}


