/* ═══════════════════════════════════════════════════════════════
   安芯半导体 - 全局样式表
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1. 基础重置与通用样式 ─── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans SC', 'DM Sans', sans-serif;
  background: #F5F5F0;
  color: #1a1a1a;
  overflow-x: hidden;
}

.font-display {
  font-family: 'DM Serif Display', 'Noto Serif SC', serif;
}

/* ─── 2. 自定义滚动条 ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #F5F5F0; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #C9A227; }

/* ─── 3. 导航栏组件 ─── */
#navbar {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#navbar.scrolled {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

#navbar.scrolled .nav-link { color: #1a1a1a !important; }
#navbar.scrolled .nav-link:hover { color: #C9A227 !important; }
#navbar.scrolled #lang-btn { color: #1a1a1a !important; }
#navbar.scrolled #lang-btn:hover { color: #C9A227 !important; }
#navbar.scrolled #current-lang { color: #1a1a1a !important; }
#navbar.scrolled .lang-dropdown a { color: #555 !important; }

/* ─── 4. 移动端菜单 ─── */
#mobile-menu {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

/* ─── 5. 语言切换 ─── */
.lang-switch { position: relative; }

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  padding: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.2s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  z-index: 100;
}

.lang-switch:hover .lang-dropdown,
.lang-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown a {
  display: block;
  padding: 6px 16px;
  font-size: 13px;
  color: #555;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.15s;
}

.lang-dropdown a:hover {
  background: #f5f5f0;
  color: #C9A227;
}

/* ─── 6. 金色装饰线 ─── */
.gold-line {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, #C9A227, #D4AF37);
}

/* ─── 7. 滚动动画 ─── */
[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal="left"] { transform: translateX(-60px); }
[data-reveal="right"] { transform: translateX(60px); }
[data-reveal="scale"] { transform: scale(0.92); }

[data-reveal].visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* ─── 8. 图片遮罩 ─── */
.img-overlay {
  position: relative;
  overflow: hidden;
}

.img-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
}

.img-overlay img {
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.img-overlay:hover img {
  transform: scale(1.04);
}

/* ─── 9. 表单字段 ─── */
.form-field {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.3s ease;
  width: 100%;
  padding: 12px 0;
  font-size: 14px;
  font-family: 'Noto Sans SC', 'DM Sans', sans-serif;
}

.form-field::placeholder { color: #aaa; }
.form-field:focus { border-bottom-color: #C9A227; }

/* ─── 10. 抖动动画 ─── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake { animation: shake 0.5s ease-in-out; }

/* ─── 11. 统计卡片 ─── */
.stat-card {
  position: relative;
  border: 1px solid rgba(0,0,0,0.03);
  padding: 1.5rem 0.5rem;
  text-align: center;
}

.stat-card .corner {
  position: absolute;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card .corner::before,
.stat-card .corner::after {
  content: '';
  position: absolute;
  background: #C9A227;
}

.stat-card .corner::before { width: 100%; height: 1px; }
.stat-card .corner::after { width: 1px; height: 100%; }

.stat-card .corner-tl { top: 0; left: 0; transform: translate(-50%, -50%); }
.stat-card .corner-tr { top: 0; right: 0; transform: translate(50%, -50%); }
.stat-card .corner-bl { bottom: 0; left: 0; transform: translate(-50%, 50%); }
.stat-card .corner-br { bottom: 0; right: 0; transform: translate(50%, 50%); }

.stat-card:hover { border-color: rgba(201,162,39,0.25); }
.stat-card:hover .corner::before,
.stat-card:hover .corner::after { background: #D4AF37; }

.stat-num { font-variant-numeric: tabular-nums; }

/* ─── 12. 业务卡片 ─── */
.biz-card { position: relative; overflow: hidden; }

.biz-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, #C9A227, #D4AF37);
  transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.biz-card:hover::before { height: 100%; }
.biz-card .biz-num { transition: color 0.4s ease; }
.biz-card:hover .biz-num { color: #C9A227; }

/* ─── 13. 品牌网格 ─── */
.brand-item {
  border: 1px solid rgba(0,0,0,0.06);
  transition: all 0.4s ease;
}

.brand-item:hover {
  border-color: rgba(201,162,39,0.4);
  background: rgba(201,162,39,0.03);
}

.brand-item:hover span { color: #C9A227; }

/* ─── 14. FAQ 手风琴 ─── */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-icon {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── 15. Hero 装饰线 ─── */
.hero-line {
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #C9A227, #D4AF37);
  animation: lineExpand 1.2s 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes lineExpand { to { width: 120px; } }

/* ─── 16. 轮播图 ─── */
.about-slide {
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-slide.active {
  opacity: 1;
  transform: scale(1);
}

.about-slide:not(.active) {
  opacity: 0;
  transform: scale(1.02);
}

.about-slide img {
  transition: transform 6s ease-out;
}

.about-slide.active img {
  transform: scale(1.05);
}

.about-dot {
  width: 32px;
  height: 3px;
  background: rgba(0,0,0,0.2);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-dot:hover { background: rgba(0,0,0,0.4); }
.about-dot.active { width: 48px; background: #C9A227; }

.about-caption {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  position: absolute;
  top: 0;
  left: 0;
}

.about-caption.active {
  opacity: 1;
  transform: translateY(0);
}

/* ─── 17. 核心业务栏 ─── */
.service-col {
  background: rgba(10, 15, 26, 0.4);
  transition: background 0.5s ease;
}

.service-col.active {
  background: rgba(30, 41, 59, 0.8);
}

.service-desc {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(8px);
  transition: grid-template-rows 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s ease 0.05s,
              transform 0.4s ease 0.05s;
}

.service-desc > span { overflow: hidden; }

.service-col.active .service-desc {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 767px) {
  .service-desc {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: translateY(0);
  }
  .service-col.active {
    background: rgba(10, 15, 26, 0.4);
  }
  .service-col:nth-child(2) {
    background: rgba(30, 41, 59, 0.8);
  }
}

/* ─── 18. 品牌 Logo 卡片 ─── */
.brand-logo-item img {
  filter: grayscale(100%);
  transition: all 0.4s ease;
}

.brand-logo-item:hover img,
.brand-logo-item.active img {
  filter: grayscale(0%);
}

/* ─── 19. 产品详情页 - 缩略图 ─── */
.thumb-item {
  border: 2px solid transparent;
  transition: all 0.3s ease;
  cursor: pointer;
}

.thumb-item.active { border-color: #C9A227; }
.thumb-item:hover { border-color: rgba(201,162,39,0.5); }

/* ─── 20. 产品详情页 - 弹窗动画 ─── */
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── 21. 产品详情页 - 规格表 ─── */
.spec-row {
  transition: background 0.2s ease;
}

.spec-row:hover {
  background: rgba(201,162,39,0.04);
}

/* ─── 22. 产品详情页 - 相关产品卡片 ─── */
.related-card {
  transition: all 0.3s ease;
}

.related-card:hover {
  border-color: rgba(201,162,39,0.3);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.related-card:hover .related-img {
  transform: scale(1.05);
}

/* ─── 23. 首页轮播 ─── */
.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide.active { opacity: 1; }

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-progress-bar {
  width: 0;
  height: 100%;
  background: #C9A227;
  transition: width 5s linear;
}

.carousel-progress-bar.running { width: 100%; }

.slide-caption {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 6%;
  pointer-events: none;
}

.slide-title,
.slide-subtitle {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-title { transform: translateY(40px); }
.slide-subtitle { transform: translateY(-30px); }

.carousel-slide.active .slide-title {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

.carousel-slide.active .slide-subtitle {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.6s;
}
