/* Base reset */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
ul { list-style: none; padding: 0; margin: 0; }
button { font: inherit; }

:root{
  --brand-700:#0d60ff;
  --brand-600:#1f6bff;
  --brand-500:#3a7bfd;
  --brand-100:#eef4ff;
  --text:#1f2d3d;
  --muted:#f6f8fb;
  --border:#e6e9ef;
  --shadow:0 6px 18px rgba(10,30,65,.08);
}

body{ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text); line-height: 1.65; background:#fff; }
.container{ width: min(1200px, 92%); margin-inline: auto; }

/* Top bar */
.topbar{ background: linear-gradient(90deg, var(--brand-600), var(--brand-500)); color:#fff; font-size:12px; }
.topbar__inner{ display:flex; justify-content:space-between; align-items:center; padding:6px 0; opacity:.95; }
.topbar a{ color:#fff; text-decoration: underline; }

/* Header & nav */
.header{ position: sticky; top:0; z-index: 30; backdrop-filter: saturate(160%) blur(10px); background: rgba(255,255,255,.76); border-bottom:1px solid rgba(10,30,65,.06); transition: box-shadow .25s ease, background .25s ease, border-color .25s ease; }
.header__inner{ display:flex; align-items:center; justify-content:flex-start; padding:16px 0; gap: 18px; }
/* 仅影响头部的 logo：放大并在左侧区域居中（允许换行，避免被截断） */
.header .logo{
  display:block;
  font-weight: 900;
  font-size: clamp(20px, 2.2vw + 10px, 32px);
  letter-spacing:.3px;
  color: var(--brand-700);
  text-align:center;
  /* 允许多行展示，移除省略号，确保完整显示 */
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.2;
  /* 让 logo 根据可用空间自适应，不强制固定宽度 */
  flex: 0 1 auto;
  max-width: min(60vw, 680px);
  min-width: 0;
}
.logo--footer{ color:#fff; }
.nav{ display:flex; gap:28px; margin-left:auto; }
.nav a{ position:relative; padding:12px 14px; color:#1f2d3d; font-size:16px; font-weight:600; letter-spacing:.2px; opacity:.95; border-radius:10px; }
.nav a:hover{ color: var(--brand-700); background: var(--brand-100); }
.nav a.is-active{ color: var(--brand-700); background: var(--brand-100); }
.nav a::after{ content:""; position:absolute; left:14px; right:14px; bottom:6px; height:3px; background: linear-gradient(90deg, var(--brand-600), var(--brand-500)); border-radius:3px; transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav a:hover::after, .nav a.is-active::after{ transform: scaleX(1); }

/* Dropdown in nav */
.dropdown{ position:relative; }
.dropdown > a{ display:inline-flex; align-items:center; gap:6px; }
.dropdown > a::before{ content:""; }
.dropdown > a::after{ content:""; position:static; width:0; height:0; border-left:5px solid transparent; border-right:5px solid transparent; border-top:6px solid #6a7a8b; transform:none; margin-left:4px; }
.dropdown:hover > a{ background: var(--brand-100); color: var(--brand-700); }
.dropdown__menu{ position:absolute; top:100%; left:0; min-width: 180px; background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow: 0 12px 28px rgba(10,30,65,.12); padding:8px; /* remove margin to avoid hover gap */ display:flex; flex-direction:column; gap:4px; opacity:0; transform: translateY(6px); pointer-events:none; transition: .2s ease; z-index: 50; }
.dropdown__menu::before{ content:""; position:absolute; left:0; right:0; top:-8px; height:8px; /* hover bridge to avoid flicker */ }
.dropdown:hover .dropdown__menu, .dropdown.is-open .dropdown__menu{ opacity:1; transform: translateY(0); pointer-events:auto; }
.dropdown.is-open > a{ background: var(--brand-100); color: var(--brand-700); }
.dropdown__menu a{ padding:10px 12px; border-radius:8px; color:#21374d; font-weight:600; }
.dropdown__menu a:hover, .dropdown__menu a.is-active{ background: var(--brand-100); color: var(--brand-700); }

.header--scrolled{ background:#fff; border-color: rgba(10,30,65,.08); box-shadow: 0 10px 28px rgba(10,30,65,.08); }

.btn{ display:inline-block; padding:10px 16px; border-radius:10px; border:1px solid var(--border); color:#17324d; background:#fff; transition:.2s ease; }
.btn:hover{ transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--primary{ background: var(--brand-700); color:#fff; border-color: transparent; }
.btn--primary:hover{ filter: brightness(1.05); }

/* Header CTA 更显眼 */
.header .btn--primary{ padding:12px 18px; border-radius:999px; background: linear-gradient(90deg, var(--brand-600), var(--brand-500)); box-shadow: 0 8px 18px rgba(31,107,255,.25); }
.header .btn--primary:hover{ transform: translateY(-2px); filter: brightness(1.06); }

/* Hero */
.hero{ background: radial-gradient(1200px 420px at 80% -30%, #e7f0ff, transparent 60%), linear-gradient(135deg, #edf4ff 0%, #f9fbff 100%); border-bottom:1px solid var(--border); }
.hero__inner{ display:grid; grid-template-columns: 1.1fr .9fr; align-items:center; gap: 40px; padding: 40px 0 28px; }
.hero__copy h1{ margin:0 0 8px; font-size: 30px; line-height:1.28; }
.subtitle{ margin:0 0 14px; color:#5a6b7c; }
.bullets li{ position:relative; padding-left:22px; margin:8px 0; }
.bullets li::before{ content:"✔"; position:absolute; left:0; top:0; color: var(--brand-700); font-size:14px; }
.cta{ margin-top:16px; display:flex; gap:12px; }
.hero__visual{ filter: drop-shadow(0 20px 30px rgba(10,30,65,.08)); }

/* Sections */
.section{ padding: 46px 0; }
.section--muted{ background: var(--muted); }
.section__title{ text-align:center; margin:0 0 18px; font-size:22px; }
.section__title span{ position:relative; display:inline-block; padding:2px 10px; }
.section__title span::after{ content:""; position:absolute; left:0; right:0; bottom:-6px; height:3px; background: linear-gradient(90deg,var(--brand-600),var(--brand-500)); border-radius:3px; }
.section__title.left{ text-align:left; }

/* Subpage hero & breadcrumb */
.page-hero{ background: linear-gradient(135deg,#f3f7ff 0%, #ffffff 70%); border-bottom:1px solid var(--border); }
.page-hero__inner{ padding: 32px 0; }
.page-hero h1{ margin:0 0 6px; font-size:28px; }
.breadcrumb{ display:flex; gap:8px; align-items:center; color:#6b7f93; font-size:13px; }
.breadcrumb a{ color:#40608a; }
.breadcrumb .sep{ opacity:.5; }

/* Solution page */
.split{ display:grid; grid-template-columns: 1.05fr .95fr; gap:28px; align-items:center; }
.solution-intro .subtitle{ max-width: 58ch; }

.solution-grid{ display:grid; grid-template-columns: 1.1fr .9fr; gap:22px; align-items:start; }
.panel{ background:#fff; border:1px solid var(--border); border-radius:14px; padding:16px; box-shadow: 0 2px 12px rgba(0,0,0,.04); }
.panel__title{ margin:0 0 10px; font-size:18px; }

.hw-list{ display:grid; gap:12px; }
.hw-item{ display:grid; grid-template-columns: 48px 1fr; gap:12px; align-items:center; padding:10px; border:1px solid var(--border); border-radius:12px; background:#fff; }
.hw-item__icon{ width:48px; height:48px; border-radius:10px; background:#f1f5ff; border:1px solid var(--border); object-fit:cover; }
.spec{ color:#5a6b7c; font-size:13px; margin-top:2px; }

.sw-panel{ position:relative; }
.sw-shot{ width:100%; border:1px solid var(--border); border-radius:12px; background:#f4f7fc; margin-bottom:12px; box-shadow: 0 2px 10px rgba(0,0,0,.03); }
.chips{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{ display:inline-block; padding:8px 10px; background:#f3f6ff; color:#294766; border:1px solid var(--border); border-radius:999px; font-size:12px; }

@media (max-width: 1024px){
  .split, .solution-grid{ grid-template-columns: 1fr; }
}

/* Tabs */
.tabs{ display:flex; gap:10px; flex-wrap:wrap; margin: 8px 0 16px; }
.tab{ padding:8px 14px; border:1px solid var(--border); border-radius:20px; background:#fff; color:#344a5f; cursor:pointer; }
.tab.is-active{ background: var(--brand-700); color:#fff; border-color: transparent; }
.is-hidden{ display:none !important; }

/* Product cards */
.cards{ display:grid; grid-template-columns: repeat(3, 1fr); gap:16px; }
.card{ display:block; border:1px solid var(--border); border-radius:12px; overflow:hidden; background:#fff; box-shadow: 0 2px 10px rgba(0,0,0,.04); transition: transform .2s ease, box-shadow .2s ease; text-decoration:none; color:inherit; }
.card img{ width:100%; aspect-ratio: 4 / 3; object-fit:contain; object-position:center; background:#fff; }
.card h3{ font-size:16px; margin:10px 12px 2px; }
.card p{ font-size:13px; color:#5a6b7c; margin:0 12px 14px; }
.card:hover{ transform: translateY(-2px); box-shadow: var(--shadow); }

/* Features */
.features{ display:grid; grid-template-columns: repeat(3, 1fr); gap:16px; }
.feature{ background:#fff; border:1px solid var(--border); border-radius:12px; padding:18px; text-align:center; box-shadow: 0 2px 10px rgba(0,0,0,.03); }
.feature__icon{ font-size:28px; background: linear-gradient(135deg, var(--brand-600), var(--brand-500)); -webkit-background-clip:text; background-clip:text; color: transparent; margin-bottom:6px; }
.feature h3{ margin:0 0 6px; }
.feature p{ margin:0; color:#5a6b7c; font-size:14px; }

/* Cases */
.case-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:16px; }
.case{ margin:0; background:#fff; border:1px solid var(--border); border-radius:12px; overflow:hidden; box-shadow: 0 2px 10px rgba(0,0,0,.03); }
.case img{ width:100%; aspect-ratio: 16 / 9; object-fit:cover; background:#eef2f7; }
.case figcaption{ padding:10px 12px; font-size:13px; color:#4a5c6e; }

/* About & certs */
.about{ display:grid; grid-template-columns: 1.1fr .9fr; gap:24px; align-items:start; }
.about__text p{ margin:10px 0; color:#4a5c6e; }
.certs{ display:grid; grid-template-columns: repeat(2, 1fr); gap:12px; }
.certs img{ width:100%; border:1px solid var(--border); border-radius:10px; background:#fff; box-shadow: 0 2px 10px rgba(0,0,0,.03); aspect-ratio: 3 / 4; object-fit:cover; }

/* News */
.news{ display:grid; gap:8px; }
.news li{ display:flex; align-items:center; gap:10px; border-bottom:1px dashed #e9edf3; padding:8px 0; }
.news .date{ width:54px; text-align:center; background:#ffeded; color:#d33; font-weight:700; border-radius:6px; padding:6px 0; font-size:12px; }
.news a{ color:#2a3d52; text-decoration:none; }
.news a:hover{ color: var(--brand-700); }

/* Footer */
.footer{ background:#0f1a29; color:#b7c4d6; margin-top: 20px; }
.footer__inner{ display:grid; grid-template-columns: 1.2fr 1fr 1fr; gap:18px; padding: 24px 0; }
.footer__col h4{ margin:0 0 10px; color:#fff; }
.footer__col ul{ display:grid; gap:6px; font-size:14px; }
.footer__col a{ color:#c6d5e6; }
.ipc{ text-align:center; padding:10px 0; border-top:1px solid rgba(255,255,255,.06); font-size:12px; color:#98a8bb; }
.ipc a, .ipc a:visited, .ipc a:hover{ color: inherit; text-decoration: none; }

/* Responsive */
@media (max-width: 1024px){
  .cards{ grid-template-columns: repeat(2, 1fr); }
  .features, .case-grid{ grid-template-columns: repeat(2, 1fr); }
  .about{ grid-template-columns: 1fr; }
  .footer__inner{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px){
  .hero__inner{ grid-template-columns: 1fr; padding: 24px 0; }
  .hero.hero--dx .hero__inner{ grid-template-columns: 1fr; }
  .cards{ grid-template-columns: 1fr; }
  .features, .case-grid{ grid-template-columns: 1fr; }
  .nav{ display:none; }
  .footer__inner{ grid-template-columns: 1fr; }
}

/* Floating contact (homepage) */
.float-contact{ position:fixed; right:16px; bottom:110px; width:180px; background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow: var(--shadow); padding:12px; z-index:2000; }
.float-contact__title{ font-weight:800; text-align:center; margin:0 0 8px; color:#1f2d3d; font-size:14px; }
.float-contact__qrcode{ width:100%; height:auto; display:block; border:1px solid var(--border); border-radius:8px; background:#fff; }
.float-contact__close{ position:absolute; top:6px; right:6px; width:22px; height:22px; border:1px solid var(--border); border-radius:50%; background:#fff; color:#6a7a8b; cursor:pointer; line-height:20px; text-align:center; padding:0; }
.float-contact__close:hover{ background:#f5f7fb; }
/* Make the CTA text smaller and centered */
.float-contact .btn{ display:block; width:100%; text-align:center; font-size:13px; padding:8px 12px; }
@media (max-width: 768px){ .float-contact{ display:none; } }

/* —— Integrated portal + Live2D：首屏文案区沿用官网浅色 .hero，仅保留右侧展台 —— */
.hero.hero--dx{
  /* 与 .hero 一致，避免深色主题覆盖左侧品牌观感 */
  background: radial-gradient(1200px 420px at 80% -30%, #e7f0ff, transparent 60%), linear-gradient(135deg, #edf4ff 0%, #f9fbff 100%);
  border-bottom: 1px solid var(--border);
}
.hero.hero--dx .hero__inner{
  align-items: stretch;
  grid-template-columns: minmax(0, 1.08fr) minmax(260px, 0.95fr);
}
.hero.hero--dx .hero__copy{
  align-self: center;
}
/* 数字人 + 聊天：同一行排版，聊天在角色右侧 */
.hero.hero--dx .hero__visual{
  filter: none;
  width: 100%;
  min-width: 0;
}
.hero.hero--dx .hero__avatar-row{
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: clamp(12px, 2.2vw, 20px);
  width: 100%;
}
.hero.hero--dx .hero__avatar-row .live2d-shell{
  flex: 2 1 auto;
  min-width: min(300px, 52%);
  max-width: min(420px, 58%);
  align-self: flex-end;
}
@media (max-width: 900px){
  .hero.hero--dx .hero__avatar-row{
    flex-direction: column;
    align-items: center;
  }
  .hero.hero--dx .hero__avatar-row .live2d-shell{
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
    max-width: min(400px, 100%);
  }
}
#fay-chat-panel .fay-chat-form{
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
  box-sizing: border-box;
}
#fay-chat-panel:not(.fay-chat-panel--hero) .fay-chat-form{
  padding: 10px 12px 12px;
  border-top: 1px solid #e6e9ef;
  background: #fff;
}
/* 嵌入首屏：#fay-speech-region 在面板内上方，输入栏在下方；样式沿用原浅色卡片 */
.hero.hero--dx #fay-speech-region{
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: min(48vh, 440px);
  max-width: none;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  box-sizing: border-box;
  padding: 12px 14px;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow-x: hidden;
  overflow-y: auto;
  pointer-events: auto;
  z-index: 2;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 900px){
  .hero.hero--dx #fay-speech-region{
    flex: 1 1 auto;
    width: 100%;
    max-width: min(400px, 100%);
    min-width: 0;
    min-height: 0;
    max-height: min(42vh, 300px);
    justify-content: flex-start;
    align-self: center;
    margin: 0;
  }
}
.hero.hero--dx .fay-chat-panel--hero{
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vw, 12px);
  flex: 0 0 clamp(300px, 34vw, 400px);
  width: clamp(300px, 34vw, 400px);
  max-width: 400px;
  min-width: 300px;
  max-height: none;
  min-height: 0;
  align-self: flex-end;
  background: transparent;
  border: none;
  box-shadow: none;
}
@media (max-width: 900px){
  .hero.hero--dx .fay-chat-panel--hero{
    flex: 0 0 auto;
    width: 100%;
    max-width: min(400px, 100%);
    min-width: 0;
    max-height: none;
    min-height: 0;
    align-self: center;
  }
}
.hero.hero--dx .fay-chat-form{
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border: 1px solid #e6e9ef;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(10, 30, 65, 0.1);
}
.hero.hero--dx #fay-bubble-stack{
  position: relative;
  width: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
  flex: 0 0 auto;
}
.hero.hero--dx .fay-speech-bubble{
  position: relative;
  align-self: flex-start;
  max-width: min(92%, 360px);
  background: #fff;
  border: 1px solid #e6e9ef;
  border-radius: 16px;
  padding: 10px 12px 10px 14px;
  box-shadow: 0 8px 24px rgba(10, 30, 65, 0.12);
  animation: fay-bubble-in 0.32s ease;
  pointer-events: auto;
}
.hero.hero--dx .fay-speech-bubble::before{
  content: "";
  position: absolute;
  left: -7px;
  top: 20px;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-right-color: #fff;
  filter: drop-shadow(-1px 0 0 #e2e6ed);
}
.hero.hero--dx .fay-speech-bubble--user{
  align-self: flex-end;
  max-width: min(92%, 340px);
  background: #eef4ff;
  border-color: #dbe7ff;
  padding: 10px 14px 10px 12px;
  box-shadow: 0 8px 22px rgba(31, 107, 255, 0.12);
}
.hero.hero--dx .fay-speech-bubble--user::before{
  left: auto;
  right: -7px;
  border-right-color: transparent;
  border-left-color: #eef4ff;
  filter: drop-shadow(1px 0 0 #dbe7ff);
}
.hero.hero--dx .fay-speech-bubble--user .fay-speech-bubble__text{
  color: #17324d;
}
.hero.hero--dx .fay-speech-bubble__text{
  font-size: 13px;
  line-height: 1.45;
  color: #1f2d3d;
  max-height: min(32vh, 240px);
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  pointer-events: auto;
}
@keyframes fay-bubble-in{
  from{
    opacity: 0;
    transform: translateX(10px) scale(0.97);
  }
  to{
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
@media (max-width: 900px){
  .hero.hero--dx #fay-bubble-stack{
    max-height: none;
  }
}
.hero.hero--dx .live2d-shell{
  background: none;
  padding: 0;
  margin: 0;
  border: none;
  outline: none;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
}
.hero.hero--dx .live2d-shell::before,
.hero.hero--dx .live2d-shell::after{
  display: none;
  content: none;
  box-shadow: none;
  border: none;
}
.hero.hero--dx #live2d-host{
  border: none;
  outline: none;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  height: min(56vh, 560px);
  min-height: 400px;
}
.hero.hero--dx #live2d-host canvas{
  border: none;
  outline: none;
  box-shadow: none;
  display: block;
  vertical-align: top;
}

/* 非整合页若复用 .live2d-shell 可保留轻量容器；整合首页由 .hero--dx 覆盖为无框 */
.live2d-shell{
  position: relative;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500), #7eb0ff);
  box-shadow:
    0 16px 40px rgba(10, 30, 65, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset;
  min-height: 420px;
}
.live2d-shell::after{
  content:"";
  position: absolute;
  inset: 0;
  border-radius: 19px;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(10, 30, 65, 0.06) inset;
}
#live2d-host{
  position: relative;
  z-index: 1;
  width: 100%;
  height: min(52vh, 520px);
  min-height: 360px;
  border-radius: 19px;
  overflow: hidden;
  background: transparent;
  touch-action: none;
}
#live2d-host canvas{
  background: transparent;
}
@media (max-width: 1024px){
  #live2d-host{
    height: min(48vh, 440px);
    min-height: 320px;
  }
  .hero.hero--dx #live2d-host{
    height: min(52vh, 500px);
    min-height: 360px;
  }
}
