/* 凯亚环境 KAIA CARE 官网 V1.2.1 */
/* 品牌色: 凯亚蓝 #0047AB + 薄荷青 #00D4AA */
/* 补丁: V1.2.1 — 修复 P0 阻塞项 */

:root {
  --primary: #0047AB;
  --primary-dark: #003380;
  --accent: #00D4AA;
  --accent-dark: #00b894;
  --text: #1a1a2e;
  --text-light: #4a4a5a;
  --bg: #ffffff;
  --bg-light: #f8f9fa;
  --bg-dark: #0f172a;
  --border: #e2e8f0;
  --shadow: 0 4px 20px rgba(0,71,171,0.08);
  --shadow-hover: 0 8px 30px rgba(0,71,171,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* 修复 P0-1: 防止任何子元素撑出导致整页横向滚动 */
  overflow-x: hidden;
}

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

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

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

/* ===== Header ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 40px; width: auto; }
.logo-text {
  font-size: 20px; font-weight: 700; color: var(--primary);
  letter-spacing: 1px;
}
.logo-text span { color: var(--accent); }

/* 修复 P0-7: 导航栏在 1440px 拥挤
   - 桌面端 gap 由 32px → 24px 减少拥挤
   - 桌面端菜单字号 15px → 14px
   - 「立即预约」紧凑化
   - 1200px 以下提前切换为汉堡菜单（与 .nav{display:none} 对齐）
*/
.nav { display: flex; align-items: center; gap: 24px; flex-wrap: nowrap; }
.nav a {
  font-size: 14px; font-weight: 500; color: var(--text);
  position: relative; padding: 4px 0; white-space: nowrap;
}
.nav a::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
  background: var(--accent); transition: var(--transition);
}
.nav a:hover::after, .nav a.active::after { width: 100%; }
.nav a:hover { color: var(--primary); }

.nav .btn-primary {
  background: var(--primary); color: #fff; padding: 8px 18px;
  border-radius: var(--radius-sm); font-size: 13px;
  white-space: nowrap;
}
.nav .btn-primary:hover { background: var(--primary-dark); color: #fff; }

.mobile-toggle {
  display: none; flex-direction: column; gap: 5px; cursor: pointer;
  padding: 8px;
}
.mobile-toggle span {
  display: block; width: 24px; height: 2px; background: var(--text);
  transition: var(--transition);
}

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 700px;
  background: linear-gradient(135deg, var(--primary) 0%, #0066cc 50%, var(--accent-dark) 100%);
  display: flex; align-items: center; overflow: hidden;
  padding-top: 72px;
}

.hero::before {
  content: ''; position: absolute; inset: 0;
  background: 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.05'%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");
}

.hero-inner { position: relative; z-index: 2; width: 100%; }
.hero-content { max-width: 640px; }
.hero h1 {
  font-size: 48px; font-weight: 800; color: #fff; line-height: 1.2;
  margin-bottom: 20px;
}
.hero h1 span { color: var(--accent); }
.hero p {
  font-size: 18px; color: rgba(255,255,255,0.85); margin-bottom: 32px;
  line-height: 1.8;
}

.btn-group { display: flex; gap: 16px; 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; border: none; transition: var(--transition);
}
.btn-white {
  background: #fff; color: var(--primary);
}
.btn-white:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.btn-outline {
  background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.5);
}
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,0.1); }

.hero-stats {
  display: flex; gap: 48px; margin-top: 48px; padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.hero-stats .stat h3 {
  font-size: 36px; font-weight: 800; color: var(--accent);
}
.hero-stats .stat p { font-size: 14px; color: rgba(255,255,255,0.7); margin: 0; }

/* ===== Section ===== */
.section { padding: 100px 0; }
.section-title {
  text-align: center; margin-bottom: 60px;
}
.section-title h2 {
  font-size: 36px; font-weight: 700; color: var(--text); margin-bottom: 12px;
}
.section-title p {
  font-size: 16px; color: var(--text-light); max-width: 600px; margin: 0 auto;
}
.section-title .tag {
  display: inline-block; font-size: 13px; font-weight: 600;
  color: var(--accent); text-transform: uppercase; letter-spacing: 2px;
  margin-bottom: 12px;
}

/* ===== About ===== */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}
.about-content h3 {
  font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 20px;
}
.about-content p { color: var(--text-light); margin-bottom: 16px; }
.about-content .highlight {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.about-image {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-hover);
}
.about-image img { width: 100%; height: 400px; object-fit: cover; }

.about-badges {
  display: flex; gap: 24px; margin-top: 32px;
}
.about-badge {
  text-align: center; padding: 20px; background: var(--bg-light);
  border-radius: var(--radius-sm); flex: 1;
}
.about-badge h4 { font-size: 28px; font-weight: 800; color: var(--primary); }
.about-badge p { font-size: 13px; color: var(--text-light); margin: 0; }

/* ===== Services ===== */
.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.service-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px 32px;
  transition: var(--transition); position: relative; overflow: hidden;
  /* 修复 P0-2: 默认 opacity:1（防止 JS 失败/慢加载整版空白 + 改善 SEO/截图）
     JS 在确认 IntersectionObserver 可用后才追加 .anim-on-scroll 类把 opacity 设为 0，再触发淡入
  */
  opacity: 1;
  transform: translateY(0);
}
.service-card.anim-on-scroll { opacity: 0; transform: translateY(30px); }
.service-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: 0; transition: var(--transition);
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: transparent; }
.service-card:hover::before { opacity: 1; }
.service-card.fade-in-up { opacity: 1; transform: translateY(0); }

.service-icon {
  width: 56px; height: 56px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; font-size: 24px; color: #fff;
}
.service-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.service-card p { font-size: 14px; color: var(--text-light); margin-bottom: 16px; }
.service-card .link {
  font-size: 14px; font-weight: 600; color: var(--primary);
  display: inline-flex; align-items: center; gap: 6px;
}

/* ===== Products ===== */
.products-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}
.product-card {
  background: var(--bg); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
  transition: var(--transition);
  opacity: 1;
  transform: translateY(0);
}
.product-card.anim-on-scroll { opacity: 0; transform: translateY(30px); }
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.product-card.fade-in-up { opacity: 1; transform: translateY(0); }

.product-image {
  position: relative; height: 240px; background: var(--bg-light);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }

.product-tag {
  position: absolute; top: 16px; left: 16px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 20px;
}

.product-info { padding: 24px; }
.product-info h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.product-info .brand {
  font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 8px;
}
.product-info p { font-size: 14px; color: var(--text-light); margin-bottom: 12px; }
.product-info .spec {
  font-size: 13px; color: var(--text-light); background: var(--bg-light);
  padding: 6px 12px; border-radius: var(--radius-sm); display: inline-block;
}

/* ===== Cases ===== */
.cases-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.case-card {
  border-radius: var(--radius); overflow: hidden; position: relative;
  height: 320px; cursor: pointer;
  opacity: 1;
  transform: translateY(0);
}
.case-card.anim-on-scroll { opacity: 0; transform: translateY(30px); }
.case-card img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.case-card:hover img { transform: scale(1.05); }
.case-card.fade-in-up { opacity: 1; transform: translateY(0); }

.case-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 24px; color: #fff;
}
.case-overlay .tag {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 4px;
  margin-bottom: 8px; width: fit-content;
}
.case-overlay h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.case-overlay p { font-size: 13px; color: rgba(255,255,255,0.8); margin: 0; }

/* ===== News ===== */
.news-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.news-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: var(--transition);
  opacity: 1;
  transform: translateY(0);
}
.news-card.anim-on-scroll { opacity: 0; transform: translateY(30px); }
.news-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); }
.news-card.fade-in-up { opacity: 1; transform: translateY(0); }

.news-image { height: 180px; background: var(--bg-light); overflow: hidden; }
.news-image img { width: 100%; height: 100%; object-fit: cover; }

.news-body { padding: 24px; }
.news-meta {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.news-meta .date { font-size: 13px; color: var(--text-light); }
.news-meta .cat {
  font-size: 12px; font-weight: 600; color: var(--primary);
  background: rgba(0,71,171,0.08); padding: 2px 10px; border-radius: 4px;
}
.news-body h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; line-height: 1.5; }
.news-body p { font-size: 14px; color: var(--text-light); }

/* ===== Contact ===== */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
}
.contact-info h3 { font-size: 28px; font-weight: 700; margin-bottom: 24px; }
.contact-item {
  display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px;
}
.contact-item .icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; flex-shrink: 0;
}
.contact-item h4 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.contact-item p { font-size: 14px; color: var(--text-light); margin: 0; }

/* 修复 P0-3: 联系方式一键拨打/发邮件 */
.contact-link {
  color: var(--text-light);
  font-size: 14px;
  transition: var(--transition);
  word-break: break-all;
}
.contact-link:hover { color: var(--primary); }

.contact-form {
  background: var(--bg-light); border-radius: var(--radius); padding: 40px;
}
.contact-form h3 { font-size: 22px; font-weight: 700; margin-bottom: 24px; }
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 12px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
  background: var(--bg); transition: var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,71,171,0.1);
}
.form-group textarea { resize: vertical; min-height: 120px; }

.btn-submit {
  width: 100%; padding: 14px; background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.btn-submit:hover { opacity: 0.9; transform: translateY(-2px); }

/* ===== CTA ===== */
.cta {
  background: linear-gradient(135deg, var(--primary), var(--accent-dark));
  padding: 80px 0; text-align: center; color: #fff;
}
.cta h2 { font-size: 36px; font-weight: 700; margin-bottom: 16px; }
.cta p { font-size: 16px; color: rgba(255,255,255,0.85); margin-bottom: 32px; }

/* ===== Footer ===== */
.footer {
  background: var(--bg-dark); color: rgba(255,255,255,0.7); padding: 60px 0 0;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
  padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand img { height: 40px; margin-bottom: 16px; }
.footer-brand p { font-size: 14px; line-height: 1.8; margin-bottom: 16px; }
.footer-brand .slogan { color: var(--accent); font-weight: 600; }

.footer h4 { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 20px; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer ul li a { color: rgba(255,255,255,0.7); font-size: 14px; }
.footer ul li a:hover { color: var(--accent); }

.footer-bottom {
  padding: 24px 0; text-align: center; font-size: 13px;
  color: rgba(255,255,255,0.5);
}

/* ===== Brands ===== */
.brands-section {
  background: var(--bg-light); padding: 80px 0;
}
.brands-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}
.brand-card {
  background: var(--bg); border-radius: var(--radius); padding: 40px 32px;
  text-align: center; border: 1px solid var(--border); transition: var(--transition);
  opacity: 1;
  transform: translateY(0);
}
.brand-card.anim-on-scroll { opacity: 0; transform: translateY(30px); }
.brand-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.brand-card.fade-in-up { opacity: 1; transform: translateY(0); }
.brand-card .brand-logo {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; color: #fff; font-size: 28px; font-weight: 700;
}
.brand-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.brand-card .en { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.brand-card p { font-size: 14px; color: var(--text-light); }

/* ===== Page Header ===== */
.page-header {
  background: linear-gradient(135deg, var(--primary), var(--accent-dark));
  padding: 140px 0 60px; text-align: center; color: #fff;
}
.page-header h1 { font-size: 40px; font-weight: 700; margin-bottom: 12px; }
.page-header p { font-size: 16px; color: rgba(255,255,255,0.8); }

/* ===== Breadcrumb ===== */
.breadcrumb {
  background: var(--bg-light); padding: 16px 0; border-bottom: 1px solid var(--border);
}
.breadcrumb-inner { font-size: 13px; color: var(--text-light); }
.breadcrumb-inner a { color: var(--text-light); }
.breadcrumb-inner a:hover { color: var(--primary); }
.breadcrumb-inner span { color: var(--text); }

/* ===== Responsive ===== */
/* 修复 P0-7: 1440px → 1200px 提前切换汉堡菜单，缓解桌面拥挤 */
/* 1199px 以下汉堡菜单生效 */
@media (max-width: 1199px) {
  .nav { display: none; }
  .mobile-toggle { display: flex; }
}

@media (max-width: 1024px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .services-grid, .products-grid, .cases-grid, .news-grid, .brands-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .hero-stats { gap: 24px; }
  .hero-stats .stat h3 { font-size: 28px; }
  .section { padding: 60px 0; }
  .section-title h2 { font-size: 28px; }
  .services-grid, .products-grid, .cases-grid, .news-grid, .brands-grid, .about-badges {
    grid-template-columns: 1fr;
  }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .contact-form { padding: 24px; }
  .page-header h1 { font-size: 28px; }
  /* 修复 P0-1: about.html 移动端 max-width:800px 自适应 */
  .honor-block img {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* Mobile menu */
.mobile-nav {
  display: none; position: fixed; inset: 72px 0 0 0; background: var(--bg); z-index: 999;
  padding: 24px; flex-direction: column; gap: 16px;
  overflow-y: auto;
}
.mobile-nav.active { display: flex; }
.mobile-nav a {
  font-size: 16px; font-weight: 500; color: var(--text); padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.6s ease forwards; }

/* 视障用户: 关闭动画 */
@media (prefers-reduced-motion: reduce) {
  .service-card, .product-card, .case-card, .news-card, .brand-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .fade-in-up { animation: none; }
}

/* 焦点态: 键盘可访问 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 跳过链接 (Skip to content) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  font-size: 14px;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}
