/* =========================================================
   瑞奈斯特（北京）电子科技有限公司 企业官网 · 科技蓝 / 简约大气
   共享样式表（首页 / 关于我们 / 产品服务 / 联系我们）
   替换提示：如需改公司名/业务，全文搜索「瑞奈斯特（北京）电子科技有限公司」「储能电源、逆变器及电力电子产品」即可整体替换
   ========================================================= */

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff4ff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e5e9f2;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  --maxw: 1180px;
  --header-h: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
}
.brand .logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), #60a5fa);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}
.brand .logo-img {
  height: 28px;
  width: auto;
  display: block;
  border-radius: 0;
}
/* 页头品牌标识：RENEXT（下方横线）与 电源/POWER（上方横线）在中间汇成闪电(Z) */
a.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
a.brand .brand-img {
  height: 54px;
  width: auto;
  display: block;
}
a.brand .brand-fallback {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 1px;
  white-space: nowrap;
}
@media (max-width: 768px) {
  a.brand .brand-img { height: 44px; }
  a.brand .brand-fallback { font-size: 18px; }
}
.site-footer .logo-img { filter: brightness(0) invert(1); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--blue); background: var(--blue-soft); }
.nav a.active { color: var(--blue); font-weight: 600; }
.nav a.lang {
  border: 1px solid var(--line);
  margin-left: 6px;
  font-weight: 600;
  font-size: 13px;
}
.nav a.lang:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: 0.25s;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-ghost {
  background: #fff;
  color: var(--blue);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--blue); background: var(--blue-soft); }

/* ---------------- Sections ---------------- */
section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: 34px;
  margin: 0 0 14px;
  letter-spacing: 0.5px;
}
.section-head p { color: var(--muted); margin: 0; font-size: 16px; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  padding: 120px 0 110px;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(37, 99, 235, 0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(96, 165, 250, 0.12), transparent 55%);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.35;
  mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  font-size: 52px;
  line-height: 1.18;
  margin: 0 0 22px;
  letter-spacing: 0.5px;
  max-width: 880px;
}
.hero h1 .accent { color: var(--blue); }
.hero p.lead {
  font-size: 19px;
  color: var(--muted);
  max-width: 640px;
  margin: 0 0 34px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 70px;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
}
.stat .num { font-size: 30px; font-weight: 800; color: var(--blue); }
.stat .label { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ---------------- Cards / Grid ---------------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #cdd9f5; }
.card .ico {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid; place-items: center;
  font-size: 22px;
  margin-bottom: 18px;
}
.card h3 { margin: 0 0 10px; font-size: 19px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------------- About ---------------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.about-grid h2 { font-size: 32px; margin: 0 0 18px; }
.about-grid p { color: var(--muted); margin: 0 0 16px; }
.value-list { list-style: none; padding: 0; margin: 22px 0 0; }
.value-list li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.value-list li:first-child { border-top: 0; }
.value-list .dot {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--blue); color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; margin-top: 3px;
}
.about-visual {
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb 60%, #60a5fa);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.about-visual::before {
  content: "储能电源、逆变器及电力电子产品";
  position: absolute; left: 28px; bottom: 26px; right: 28px;
  color: rgba(255,255,255,0.95); font-size: 20px; font-weight: 700; line-height: 1.5;
}
.about-visual::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.12) 1px, transparent 1px);
  background-size: 100% 38px;
}

/* Timeline */
.timeline { max-width: 760px; margin: 0 auto; position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.tl-item { position: relative; padding: 0 0 32px 26px; }
.tl-item::before {
  content: ""; position: absolute; left: -28px; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--blue);
}
.tl-item .year { font-weight: 800; color: var(--blue); font-size: 17px; }
.tl-item h4 { margin: 4px 0 6px; font-size: 17px; }
.tl-item p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------------- Products ---------------- */
.product-card { display: flex; flex-direction: column; }
.product-card .thumb {
  height: 150px; border-radius: 12px; margin-bottom: 18px;
  background: linear-gradient(135deg, #eef3ff, #dbe7ff);
  display: grid; place-items: center; font-size: 34px; color: var(--blue);
}
.product-card h3 { margin: 0 0 8px; font-size: 19px; }
.product-card p { margin: 0 0 16px; color: var(--muted); font-size: 15px; flex: 1; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 12px; color: var(--blue); background: var(--blue-soft);
  padding: 4px 10px; border-radius: 999px; font-weight: 600;
}

/* ---------------- Contact ---------------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 48px; align-items: start; }
.contact-info h2 { font-size: 30px; margin: 0 0 16px; }
.contact-info p { color: var(--muted); margin: 0 0 26px; }
.info-item { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.info-item .ico {
  width: 42px; height: 42px; flex: none; border-radius: 10px;
  background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-size: 18px;
}
.info-item .k { font-weight: 600; font-size: 15px; }
.info-item .v { color: var(--muted); font-size: 14px; }

.map-placeholder, .contact-map {
  margin-top: 24px; height: 240px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #eef2f7; overflow: hidden;
  display: grid; place-items: center; color: var(--muted); font-size: 14px; text-align: center;
}
.contact-map { display: block; }
.contact-map .amap-info-content { line-height: 1.6; }

.form-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow-sm);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; font-family: inherit; color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s; background: #fff;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.field textarea { resize: vertical; min-height: 120px; }
.field .err { color: #dc2626; font-size: 13px; margin-top: 6px; display: none; }
.field.invalid input, .field.invalid textarea { border-color: #dc2626; }
.field.invalid .err { display: block; }
.form-note { font-size: 13px; color: var(--muted); margin-top: 4px; }
.form-success {
  display: none; margin-top: 16px; padding: 14px 16px; border-radius: 10px;
  background: #ecfdf5; color: #047857; font-size: 14px; border: 1px solid #a7f3d0;
}

/* ---------------- CTA ---------------- */
.cta {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  border-radius: 22px;
  padding: 56px 48px;
  text-align: center;
  color: #fff;
}
.cta h2 { font-size: 32px; margin: 0 0 12px; }
.cta p { color: rgba(255,255,255,0.85); margin: 0 0 28px; font-size: 17px; }
.cta .btn-primary { background: #fff; color: var(--blue); box-shadow: none; }
.cta .btn-primary:hover { background: #f1f5ff; }

/* ---------------- Footer ---------------- */
.site-footer { background: #0b1220; color: #9aa6bd; padding: 56px 0 28px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.site-footer .brand { color: #fff; margin-bottom: 14px; }
.site-footer p { font-size: 14px; line-height: 1.8; }
.footer-col h4 { color: #fff; font-size: 15px; margin: 0 0 16px; }
.footer-col a { display: block; font-size: 14px; padding: 5px 0; color: #9aa6bd; transition: color 0.2s; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: 13px; color: #6b7790;
}

/* ---------------- Reveal animation ---------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .hero h1 { font-size: 38px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .section-head h2 { font-size: 28px; }
}
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px; display: none; box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 8px; }
  section { padding: 64px 0; }
  .hero { padding: 90px 0 80px; }
  .hero h1 { font-size: 32px; }
  .form-row { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .cta { padding: 40px 24px; }
}

/* ===== 产品服务页：产品系列 / 型号胶囊 ===== */
.families { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.family-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 28px 30px;
  box-shadow: var(--shadow-sm);
}
.family-card h3 { font-size: 20px; margin: 0 0 6px; }
.family-desc { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.series { margin-top: 18px; }
.series:first-of-type { margin-top: 4px; }
.series-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--blue);
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 3px solid var(--blue);
}
.model-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.model-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-alt);
  transition: all .18s ease;
}
.model-chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
@media (max-width: 768px) { .families { grid-template-columns: 1fr; } }

/* ===== 产品服务页：卡片悬停浮窗 + 可点击 ===== */
.family-card { position: relative; overflow: hidden; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.family-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-face { transition: opacity .2s ease; }
.pop {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff; padding: 26px 28px;
  display: flex; flex-direction: column; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.family-card:hover .pop,
.family-card:focus-within .pop { opacity: 1; visibility: visible; transform: translateY(0); }
.pop-t { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.pop p { font-size: 14px; line-height: 1.6; margin: 0 0 14px; opacity: .92; }
.pop .model-grid .model-chip { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
.pop .model-grid .model-chip:hover { background: #fff; color: var(--blue); }
.pop-go { margin-top: 14px; font-weight: 700; font-size: 14px; }
a.model-chip { cursor: pointer; text-decoration: none; }
.model-chip:hover { text-decoration: none; }

/* ===== 商品详情 / 分类页 ===== */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.detail-card, .side-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.detail-card h3 { margin: 0 0 12px; font-size: 17px; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.spec-table th { color: var(--muted); font-weight: 400; width: 26%; }
.spec-table td { line-height: 1.5; text-align: left; padding-left: 152px; font-weight: 200; font-family: "PingFang SC", "Microsoft YaHei Light", "Source Han Sans SC Light", "Hiragino Sans GB", sans-serif; color: #475569; -webkit-font-smoothing: antialiased; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: none; }
.spec-table .spec-group { background: var(--bg-alt); }
.spec-table .spec-group th { padding: 10px 8px; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); }
.spec-table .spec-sub th { padding-left: 22px; color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.back-link { color: var(--blue); font-weight: 600; }
.back-link:hover { text-decoration: underline; }
.side-k { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.side-v { font-weight: 700; font-size: 18px; }
.side-card .btn { width: 100%; text-align: center; }
.side-card .model-grid { margin-top: 4px; }
/* 详情页右侧：产品照片方框 */
.side-photo .photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.side-photo .photo-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.side-photo .photo-ph {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
  padding: 12px;
}
.side-photo .photo-ph span {
  display: block;
  margin-top: 6px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
@media (max-width: 768px) { .detail-grid { grid-template-columns: 1fr; } }

/* ===== 在线联系悬浮按钮 + 弹窗 ===== */
.chat-fab {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .18s ease, box-shadow .18s ease;
}
.chat-fab:hover { transform: translateY(-50%) scale(1.06); box-shadow: 0 12px 30px rgba(37, 99, 235, 0.45); }
.chat-fab svg { width: 26px; height: 26px; }
.chat-fab.hidden { display: none; }

/* 欢迎浮窗 */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s;
}
.welcome-overlay.open { opacity: 1; visibility: visible; }
.welcome-card {
  position: relative;
  width: 92%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  padding: 38px 32px 32px;
  text-align: center;
  transform: translateY(18px) scale(.97);
  transition: transform .25s ease;
}
.welcome-overlay.open .welcome-card { transform: translateY(0) scale(1); }
.welcome-card .welcome-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.welcome-card .welcome-close:hover { background: var(--bg-alt); color: var(--ink); }
.welcome-card .welcome-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
}
.welcome-card .welcome-icon svg { width: 28px; height: 28px; }
.welcome-card .welcome-text {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 26px;
  font-weight: 500;
}
.welcome-card .welcome-cta {
  display: inline-block;
  border-radius: 999px;
  padding: 12px 36px;
  font-size: 15px;
}
@media (max-width: 768px) {
  .chat-fab { right: 14px; width: 52px; height: 52px; }
  .welcome-card { padding: 34px 22px 26px; }
}

.chat-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s;
}
.chat-modal-overlay.open { opacity: 1; visibility: visible; }

.chat-modal {
  width: 92%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
  transform: translateY(16px) scale(.98);
  transition: transform .22s ease;
}
.chat-modal-overlay.open .chat-modal { transform: translateY(0) scale(1); }

.chat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.chat-modal-header h3 { margin: 0; font-size: 18px; }
.chat-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.chat-modal-close:hover { background: var(--bg-alt); color: var(--ink); }

.chat-modal-body { padding: 22px; }
.chat-modal .field { margin-bottom: 16px; }
.chat-modal .field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.chat-modal .field input,
.chat-modal .field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.chat-modal .field input:focus,
.chat-modal .field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.chat-modal .field.invalid input,
.chat-modal .field.invalid textarea { border-color: #ef4444; }
.chat-modal .field .err {
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
  min-height: 17px;
}
.chat-modal .btn-primary { width: 100%; }
.chat-modal-success {
  display: none;
  text-align: center;
  padding: 28px 10px;
  color: var(--ink);
}
.chat-modal-success .check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  font-size: 28px;
}

@media (max-width: 768px) {
  .chat-fab { right: 16px; bottom: 16px; width: 52px; height: 52px; }
  .chat-modal { width: 96%; }
}

