﻿/* ========================================
   Dongxu Electronic - 全局样式
   颜色：主红 #C8102E / 主蓝 #1F4E9A
======================================== */
:root {
  --red: #C8102E;
  --red-dark: #A00D24;
  --blue: #1F4E9A;
  --blue-dark: #163C7A;
  --dark: #1a1a1a;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-500: #adb5bd;
  --gray-700: #495057;
  --gray-900: #212529;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 4px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-900);
  background: var(--white);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; }
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}
/* ============ 顶部黑色信息条（TOPWIN 风格）============ */
.topbar-info {
  background: #1a1a1a;
  color: #d0d0d0;
  font-size: 13px;
  line-height: 1;
}
.topbar-info-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  gap: 24px;
}
.topbar-info ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 24px;
  align-items: center;
}
.topbar-info li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #d0d0d0;
  white-space: nowrap;
}
.topbar-info li:hover { color: #fff; }
.topbar-info a {
  color: #d0d0d0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .15s;
}
.topbar-info a:hover { color: #fff; }
.topbar-info svg {
  flex-shrink: 0;
  opacity: 0.9;
}
@media (max-width: 1024px) {
  .topbar-info .info-center { display: none; }
}
@media (max-width: 640px) {
  .topbar-info { font-size: 12px; }
  .topbar-info-inner { height: 36px; gap: 12px; }
  .topbar-info ul { gap: 12px; }
  .topbar-info .info-left li:nth-child(2),
  .topbar-info .info-left li:nth-child(3) { display: none; }
  .topbar-info .info-right li:first-child { display: none; }
}
/* ============ 主区域 ============ */
.mainbar { background: var(--white); padding: 20px 0; }
.mainbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo { display: flex; align-items: center; gap: 6px; }
.logo-text {
  font-size: 20px;
  font-weight: 900;
  color: var(--blue);
  font-style: italic;
  letter-spacing: -1px;
}
/* 搜索框 */
.search-box {
  max-width: 560px;   /* 450 input + 110 button */
  margin-left: auto;  /* 靠右：flex 布局下把元素推到主轴末端 */
  display: flex;
  align-items: stretch;
  border: 2px solid var(--red);
  border-radius: var(--radius);
  overflow: hidden;
}
.search-box input {
  width: 450px;       /* 输入框固定 450px */
  max-width: 100%;    /* 窗口变小时跟着缩 */
  padding: 10px 14px;
  border: none;
  outline: none;
  font-size: 14px;
}
.btn-search {
  background: var(--red);
  color: white;
  padding: 0 28px;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}
.btn-search:hover { background: var(--red-dark); }
.link-history {
  display: inline-flex;
  align-items: center;
  margin-left: 12px;
  color: var(--gray-700);
  text-decoration: underline;
  font-size: 13px;
}
/* 快捷图标 */
.quick-icons { display: flex; gap: 8px; }
.qi-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  color: var(--gray-700);
  font-size: 12px;
  border-radius: var(--radius);
  transition: all 0.2s;
}
.qi-item:hover { color: var(--red); background: var(--gray-50); }
/* ============ 汉堡按钮全局默认样式，桌面端隐藏 ============ */
.menu-toggle {
  display: none; /*默认PC隐藏，媒体查询里改成flex*/
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 9999;
}
.menu-toggle span {
  width: 24px;
  height: 2px;
  background: #fff;
  display:block;
}
/* ============ 红色导航 ============ */
.navbar {
  background: var(--red);
  position: relative;
  z-index: 100;
}
.navbar-inner {
  padding: 0 1rem;
  display:flex;
  align-items:center;
  justify-content: space-between;
  min-height: 38px;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 0;
  height: 100%;
}

.nav-menu > li {
  display: flex;
}

.nav-menu > li > a {
  display: inline-flex;
  align-items: center;
  padding: 0 24px 0 5px;
  color: white;
  font-weight: 500;
  font-size: 15px;
  height: 100%;
  transition: background 0.2s;
}

.nav-menu > li > a:hover,
.nav-menu > li:hover > a {
  background: var(--red-dark);
}
.nav-menu .caret { font-size: 10px; margin-left: 4px; }
/* Mega Menu */
.has-mega { position: relative; }
.mega-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  box-shadow: var(--shadow-lg);
  border-top: 2px solid var(--red);
  min-width: 720px;
  padding: 24px;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  z-index: 9999;
}
.has-mega:hover .mega-menu,
.has-mega:focus-within .mega-menu { display: grid; }
.mega-menu h3 {
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.mega-menu a {
  display: block;
  padding: 4px 0;
  color: var(--gray-700);
  font-size: 13px;
  transition: color 0.2s;
}
.mega-menu a:hover { color: var(--red); }
/* 二级导航菜单【重点修复】增加position:absolute，桌面脱离文档流！！ */
.about-submenu {
  display: none;
  position: absolute;
  top:100%;
  left:0;
  min-width: 280px;
  padding: 24px;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index:9999;
}
.about-submenu a {
  display: block;
  padding: 10px 20px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 400;
  color: #333;
  line-height: 1.4;
  background: white;
  border: 1px solid #999;
  border-radius: 4px;
  transition: color 0.2s, background 0.15s, border-color 0.15s;
}
.about-submenu a:last-child { margin-bottom: 0; }
.about-submenu a:hover {
  color: var(--red);
  border-color: var(--red);
  background: var(--gray-50);
}
.about-submenu a.active {
  color: var(--red);
  border-color: var(--red);
  background: white;
}
/* hover 显示 */
.has-mega:hover .about-submenu,
.has-mega:focus-within .about-submenu {
  display: block;
}
/* ============ 黑色 slogan 条 ============ */
.slogan-bar {
  background: #2b2b2b;
  color: white;
  height: 38px;
  line-height: 38px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slogan {
  display: inline-block;
  animation: fadeIn 0.5s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* ============ Hero ============ */
/* ============ 固定在右侧中间的快速联系栏 ============ */
.quick-contact {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 9999;
  background: transparent;
}
.qc-item {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  text-decoration: none;
  position: relative;
}
.qc-item:hover {
  transform: translateX(-3px) scale(1.06);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  filter: brightness(1.05);
}
.qc-item:active { transform: translateX(-1px) scale(0.98); }
.qc-whatsapp { background: #25D366; }
.qc-email    { background: var(--red); }
.qc-top      { background: #4a4a4a; }
/* 悬停时弹出文字提示 */
.qc-label {
  position: absolute;
  right: 54px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, right 0.2s ease;
}
.qc-label::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: rgba(0, 0, 0, 0.82);
}
.qc-item:hover .qc-label {
  opacity: 1;
  right: 58px;
}
@media (max-width: 768px) {
  .quick-contact { right: 6px; gap: 4px; }
  .qc-item { width: 38px; height: 38px; }
  .qc-item svg { width: 18px; height: 18px; }
}
.hero {
  position: relative;
  min-height: 720px;
  background: url('../images/banner-hero.png') no-repeat;
  background-size: cover;
  background-position-x: calc(100% - 14%);
  background-position-y: -2.24cm;
  overflow: hidden;
}
.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 600px;
  padding: 60px 1rem;
}
.hero-content {
  max-width: 660px;
  align-self: flex-start;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.hero-content h1 {
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
  margin-top: calc(150px - 1.5cm);
  margin-bottom: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.hero-highlight {
  color: inherit;
  font-weight: inherit;
}
/* ===== Hero 轮播 ===== */
.hero-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  max-width: 460px;
  margin: 30px 0 0;
  display: flex;
  flex-direction: column;
}
.hero-carousel-track {
  display: flex;
  transition: transform 0.55s ease;
  will-change: transform;
}
.hero-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
}
.hero-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.hero-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s ease, transform 0.25s ease;
}
.hero-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}
.hero-dot.active {
  background: var(--red);
  transform: scale(1.25);
}
.hero-col {
  background: white;
  border-radius: 6px;
  padding: 24px 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-top: 3px solid var(--red);
}
.hero-col h3 {
  color: var(--gray-900);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}
.hero-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.hero-col li {
  position: relative;
  padding: 4px 0 4px 16px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--gray-700);
}
.hero-col li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  width: 5px;
  height: 5px;
  background: var(--red);
  border-radius: 50%;
}
.hero-search {
  display: flex;
  width: 560px;
  max-width: 100%;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  align-self: flex-start;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.hero-search input {
  flex: 1;
  padding: 14px 18px;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--gray-900);
}
.hero-search button {
  background: var(--red);
  color: white;
  padding: 0 36px;
  font-weight: 600;
  font-size: 15px;
}
.hero-search button:hover { background: var(--red-dark); }
.hero-review {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 20px;
  font-size: 14px;
  line-height: 1.7;
  position: relative;
}
.hero-review::before {
  content: "“";
  position: absolute;
  top: -10px;
  left: 8px;
  font-size: 48px;
  color: var(--red);
  font-family: Georgia, serif;
}
/* ============ 通用区块 ============ */
.section { padding: 60px 0; }
.section-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--red);
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 16px;
  margin-bottom: 32px;
}
/* Partners */
.partners {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  align-items: center;
  justify-items: center;
}
.partner-logo {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  filter: grayscale(20%);
  transition: filter 0.3s;
}
.partner-logo:hover { filter: grayscale(0%); }
/* Categories */
.categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.category-col h3 {
  color: var(--gray-900);
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid var(--gray-300);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.category-col a {
  display: block;
  padding: 5px 0;
  color: var(--red);
  font-size: 13px;
  text-decoration: underline;
}
.category-col a:hover { color: var(--red-dark); }
/* ============ Footer ============ */
.site-footer { background: #1a1a1a; color: #c0c0c0; margin-top: 60px; }
.footer-subscribe {
  background: #2b2b2b;
  padding: 30px 0;
}
.subscribe-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.subscribe-inner h3 { color: white; font-size: 20px; margin-bottom: 4px; }
.subscribe-inner p { font-size: 13px; }
.subscribe-form { display: flex; gap: 0; min-width: 360px; }
.subscribe-form input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 4px 0 0 4px;
  font-size: 14px;
  outline: none;
}
.subscribe-form button {
  background: var(--red);
  color: white;
  padding: 10px 24px;
  border-radius: 0 4px 4px 0;
  font-weight: 600;
}
.subscribe-form button:hover { background: var(--red-dark); }
.footer-main { padding: 50px 0 30px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1.1fr;
  gap: 28px;
}
.footer-col-brand { padding-right: 8px; }
.mt-24 { margin-top: 24px; }
.footer-logo {
  display: inline-block;
  margin-bottom: 14px;
}
.footer-desc { font-size: 13px; line-height: 1.7; margin-bottom: 16px; color: #b0b0b0; }
.social-links { display: flex; gap: 8px; align-items: center; }
.footer-col .social-links a.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
}
.footer-col .social-links a.social-icon:hover { opacity: 0.85; transform: translateY(-1px); }
.footer-col .social-links a.social-icon img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.footer-contact-line {
  display: block;
  font-size: 13px;
  color: #b0b0b0;
  padding: 4px 0;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.footer-contact-label {
  color: #fff;
  font-weight: 600;
  margin-right: 4px;
}
.footer-col .footer-contact-line a {
  color: #b0b0b0;
  padding: 0;
  font-size: 13px;
  display: inline !important;
}
.footer-col .footer-contact-line a:hover { color: white; }
.footer-col h4 {
  color: white;
  font-size: 14px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.footer-col a, .footer-col p {
  display: block;
  padding: 4px 0;
  font-size: 13px;
  color: #aaa;
  transition: color 0.2s;
}
.footer-col a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid #333;
  padding: 20px 0;
  font-size: 12px;
}
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { color: #aaa; }
.footer-legal a:hover { color: white; }
/* ============ Web Components 占位（fetch 加载中） ============ */
site-header, site-footer {
  display: block;
}
.header-placeholder {
  min-height: 180px;
  padding: 60px 20px;
  text-align: center;
  color: #999;
  font-size: 13px;
  background: #f8f9fa;
}
.footer-placeholder {
  min-height: 200px;
  padding: 80px 20px;
  text-align: center;
  color: #888;
  font-size: 13px;
  background: #1a1a1a;
}
.header-error, .footer-error {
  padding: 16px 20px;
  background: #fee;
  color: #900;
  font-size: 13px;
  border: 1px solid #fcc;
  border-radius: 4px;
  margin: 10px 0;
}
/* ============ 响应式 ============ */
@media (max-width: 720px) {
  .quick-icons { display: none; }
  .link-history { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* 断点修改为992px：手机+小平板全部启用汉堡菜单 */
@media (max-width: 992px) {

  .menu-toggle {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 4px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 8px !important;
    z-index: 100000 !important;
    margin-left: auto !important; /* 靠右对齐 */
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    width: 44px !important;
    height: 38px !important;
    min-width: 44px !important;
  }

  .menu-toggle span {
    width: 24px;
    height: 2px;
    background: #ffffff;
    display: block;
  }
  .search-box { max-width: none; }
  .mainbar-inner { flex-wrap: wrap; }
  .logo img{
    max-height:44px;
  }
  .logo-text{
    font-size:16px;
  }
  .hero-search{
    width:100%;
    margin-top:12px;
  }
  .quick-icons { display: none; }
  .navbar {
    min-height: 44px !important;
  }
  .navbar-inner{
    height: 44px !important;
    min-height: 44px !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
  }
 .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 82%;
    max-width: 340px;
    height: 100vh;
    background: var(--red-dark);
    padding: 60px 0 30px;
    z-index: 99999;
    transition: right 0.3s ease;
    overflow-y: auto;
    display: block !important;
  }
  .nav-menu.open {
    right: 0 !important;
  }

  /* 移动端菜单内部布局 */
  .nav-menu > li {
    display: block;
    width: 100%;
  }
  .nav-menu > li > a {
    width: 100%;
    height: auto;
    padding:14px 20px;
    justify-content:space-between;
  }
  /* 移动端禁止hover下拉，但.open状态除外 */
  .has-mega:not(.open):hover .mega-menu,
  .has-mega:not(.open):hover .about-submenu{
    display:none !important;
  }
  /* Products子菜单 */
  .has-mega .mega-menu {
    position: static;
    display: none;
    grid-template-columns: 1fr;
    min-width: 0;
    padding:0;
    background:#8b0a1f;
    border:none;
    box-shadow: none;
  }
  .has-mega.open .mega-menu { display: grid !important; }
  .has-mega .mega-menu a{
    color:#fff;
    padding:12px 20px 12px 32px;
    border-bottom:1px solid rgba(255,255,255,0.08);
  }
  /* About / Support子菜单 */
  .has-mega .about-submenu{
    position:static;
    display:none;
    min-width:0;
    width:100%;
    padding:0;
    background:#8b0a1f;
    box-shadow:none;
  }
  .has-mega.open .about-submenu{
    display:block !important;
  }
  .has-mega .about-submenu a{
    background:transparent;
    color:#fff;
    border:none;
    padding:12px 20px 12px 32px;
    border-bottom:1px solid rgba(255,255,255,0.08);
    border-radius:0;
  }
  /* 快速联系栏移到底部 */
  .quick-contact{
    right:0;
    bottom:0;
    top:auto;
    transform:none;
    flex-direction:row;
    width:100%;
    justify-content:center;
    background:#fff;
    padding:8px 0;
    gap:12px;
    box-shadow:0 -2px 10px rgba(0,0,0,0.12);
  }
  .qc-label{
    display:none;
  }
  .hero-inner { grid-template-columns: 1fr; padding: 40px 1rem; }
  .hero-content h1 { font-size: 28px; }
  .partners { grid-template-columns: 1fr; gap: 24px; }
  .categories { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .subscribe-inner { flex-direction: column; align-items: stretch; }
  .subscribe-form { min-width: 0; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
}


/* 桌面大屏：>=993px，隐藏汉堡 */
@media (min-width: 993px) {
  .menu-toggle {
    display: none !important;
  }
}


@media (max-width: 480px) {
  .categories { grid-template-columns: 1fr; }
  .topbar-right { font-size: 11px; }
  .hero-columns { grid-template-columns: 1fr; gap: 20px; padding: 20px; }
}
