/* ============ 惠花生活开放平台 · 科技风官网 ============ */
:root {
  --navy: #06132c;
  --navy2: #0b2246;
  --blue: #2f6bff;
  --blue-dark: #1d4fd8;
  --cyan: #2ad4ff;
  --ink: #10213d;
  --muted: #64748b;
  --soft: #f4f8ff;
  --line: #e4ecf9;
  --white: #fff;
  --red: #ff4d4f;
  --shadow: 0 18px 50px rgba(19, 58, 130, .10);
  --shadow-lg: 0 30px 80px rgba(9, 33, 86, .18);
  --radius: 18px;
  --head-h: 74px;
  --maxw: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--soft);
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font-family: inherit; }
button { cursor: pointer; }
.container { width: min(var(--maxw), calc(100% - 48px)); margin: 0 auto; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: var(--head-h);
  transition: background .35s, box-shadow .35s, border-color .35s;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.site-header.scrolled {
  background: rgba(6,19,44,.88);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(0,0,0,.16);
  border-bottom-color: rgba(255,255,255,.08);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 40px; }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px; background: #fff;
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(47,107,255,.28);
}
.brand-logo img { width: 28px; height: 28px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { color: #fff; font-size: 18px; letter-spacing: .5px; }
.brand-text small { color: rgba(255,255,255,.55); font-size: 10px; letter-spacing: 2.2px; margin-top: 4px; }
.nav { display: flex; gap: 34px; margin-left: auto; }
.nav a {
  color: rgba(255,255,255,.78); font-size: 15px; font-weight: 500;
  position: relative; padding: 26px 0; white-space: nowrap; transition: color .2s;
}
.nav a::after {
  content: ""; position: absolute; left: 50%; right: 50%; bottom: 18px; height: 2px;
  background: var(--cyan); border-radius: 4px; transition: all .25s;
}
.nav a:hover, .nav a.active { color: #fff; }
.nav a:hover::after, .nav a.active::after { left: 0; right: 0; }
.header-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.btn-login {
  border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.08);
  color: #fff; padding: 9px 20px; border-radius: 9px; font-size: 14px;
  transition: all .2s; backdrop-filter: blur(6px);
}
.btn-login:hover { background: #fff; color: var(--blue); border-color: #fff; }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(120deg, var(--blue), #1f9dff);
  color: #fff; border: 0; border-radius: 10px; padding: 13px 26px;
  font-size: 15px; font-weight: 600; box-shadow: 0 10px 26px rgba(47,107,255,.32);
  transition: transform .2s, box-shadow .2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(47,107,255,.45); }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.4); color: #fff; padding: 13px 26px;
  border-radius: 10px; font-size: 15px; font-weight: 500; transition: all .2s;
}
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.7); }
.menu-toggle { display: none; background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; }

/* ---------- 顶部下拉抽屉 ---------- */
.nav a .caret { font-style: normal; font-size: 12px; margin-left: 3px; transition: transform .2s; display: inline-block; }
.nav a.mega-active .caret { transform: rotate(180deg); }
.mega-panel {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 99;
  background: #fff; color: var(--ink); border-top: 1px solid #eef2f8;
  box-shadow: 0 26px 60px rgba(6, 24, 60, .18);
  opacity: 0; visibility: hidden; transform: translateY(-14px);
  transition: opacity .28s ease, transform .28s ease, visibility .28s;
}
.mega-panel.open { opacity: 1; visibility: visible; transform: none; }
.mega-inner {
  width: min(var(--maxw), calc(100% - 48px)); margin: 0 auto;
  padding: 32px 8px 36px; display: grid;
  grid-template-columns: 1.15fr 1.15fr 1.15fr .82fr; gap: 34px;
}
.mega-group-title { font-size: 14px; font-weight: 700; color: var(--blue); margin-bottom: 18px; padding-left: 10px; border-left: 3px solid var(--blue); }
.mega-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 10px; }
.mega-card { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; transition: background .2s, transform .2s; }
.mega-card:hover { background: #f2f6ff; transform: translateX(3px); }
.mega-img { width: 42px; height: 42px; flex: none; border-radius: 10px; background: #f4f8ff; border: 1px solid #e8eef9; display: grid; place-items: center; overflow: hidden; }
.mega-img img { width: 34px; height: 34px; object-fit: contain; }
.mega-txt { min-width: 0; display: flex; flex-direction: column; }
.mega-txt b { font-size: 13px; color: #1d2e4a; white-space: nowrap; }
.mega-txt span { font-size: 11px; color: #8a98ac; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mega-side-title { font-size: 14px; font-weight: 700; color: var(--blue); margin-bottom: 18px; padding-left: 10px; border-left: 3px solid var(--cyan); }
.mega-side-card { display: block; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.mega-side-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.mega-side-card img { width: 100%; height: 110px; object-fit: cover; background: #eef3ff; }
.mega-side-card b { display: block; font-size: 13px; padding: 10px 12px 2px; }
.mega-side-card span { display: block; font-size: 11px; color: var(--blue); padding: 0 12px 12px; }

/* ---------- 顶部：白底黑字导航 + 整幅轮播 ---------- */
body[data-page="home"] .site-header,
body[data-page="home"] .site-header.scrolled {
  background: #fff; border-bottom: 1px solid #e8edf5; box-shadow: 0 2px 16px rgba(12,32,70,.05);
  backdrop-filter: none;
}
body[data-page="home"] .brand-logo { background: #f2f6ff; box-shadow: none; }
body[data-page="home"] .brand-text b { color: #14213d; }
body[data-page="home"] .brand-text small { color: #8a98ac; }
body[data-page="home"] .nav a { color: #33415c; }
body[data-page="home"] .nav a:hover,
body[data-page="home"] .nav a.active { color: var(--blue); }
body[data-page="home"] .nav a::after { background: var(--blue); }
body[data-page="home"] .btn-login { color: #33415c; border-color: #d8e0ee; background: #fff; backdrop-filter: none; }
body[data-page="home"] .btn-login:hover { background: #f2f6ff; border-color: var(--blue); color: var(--blue); }
body[data-page="home"] .menu-toggle { color: #14213d; }
.top-carousel {
  position: relative; width: 100%; height: clamp(460px, 38vw, 580px);
  margin-top: var(--head-h); overflow: hidden; background: #eef3ff;
}
.top-carousel-track { display: flex; width: 100%; height: 100%; transition: transform .7s cubic-bezier(.22,.61,.36,1); }
.top-slide { width: 100%; height: 100%; flex: none; overflow: hidden; }
.top-carousel-track img { display: block; width: 100%; height: 100%; object-fit: contain; }
.top-carousel::before { content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(130deg, rgba(223,235,255,.85), rgba(238,244,255,.6) 55%, rgba(214,232,255,.85)); }
.top-carousel-track { position: relative; z-index: 1; }
.top-carousel-fade { display: none; }
.top-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 54px; height: 54px; border-radius: 50%; border: 1px solid rgba(255,255,255,.5);
  background: rgba(6,19,44,.4); color: #fff; font-size: 28px; line-height: 1;
  display: grid; place-items: center; backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.2); transition: all .25s;
}
.top-arrow:hover { background: var(--blue); border-color: var(--blue); }
.top-arrow.prev { left: 18px; } .top-arrow.next { right: 18px; }
.top-dots { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; gap: 9px; }
.top-dots button { width: 9px; height: 9px; border-radius: 10px; border: 0; padding: 0; background: rgba(6,19,44,.35); box-shadow: 0 1px 6px rgba(255,255,255,.35); transition: all .25s; }
.top-dots button.active { width: 30px; background: var(--blue); }

.badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px;
  border: 1px solid rgba(75,180,255,.35); background: rgba(47,107,255,.12);
  border-radius: 100px; font-size: 13px; color: #8cd8ff; letter-spacing: .4px;
}
.badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.hero h1 { font-size: clamp(40px, 4.6vw, 66px); line-height: 1.18; margin: 26px 0 22px; letter-spacing: -1px; font-weight: 800; }
.hero h1 .grad { background: linear-gradient(95deg, #7ed6ff, #4f8bff 55%, #b28bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-desc { font-size: 17px; color: rgba(226,238,255,.72); max-width: 560px; margin: 0 0 34px; line-height: 1.95; }
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-trust { margin-top: 52px; display: flex; gap: 0; max-width: 660px; }
.hero-trust div { flex: 1; padding-left: 26px; border-left: 1px solid rgba(255,255,255,.14); }
.hero-trust b { display: block; font-size: 30px; line-height: 1.2; font-weight: 700; background: linear-gradient(90deg, #fff, #8ed5ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-trust span { font-size: 13px; color: rgba(255,255,255,.58); }

/* Console visual */
.console { position: relative; }
.console-card {
  background: linear-gradient(160deg, rgba(19,48,96,.92), rgba(8,25,58,.94));
  border: 1px solid rgba(120,180,255,.24); border-radius: 20px; padding: 22px;
  box-shadow: 0 40px 100px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(10px); transform: perspective(1200px) rotateY(-7deg) rotateX(3deg);
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 50% { transform: perspective(1200px) rotateY(-4deg) rotateX(1deg) translateY(-12px); } }
.console-top { display: flex; align-items: center; gap: 6px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.09); }
.console-top i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.console-top i:nth-child(2) { background: #febc2e; }
.console-top i:nth-child(3) { background: #28c840; }
.console-top span { margin-left: 12px; font-size: 12px; color: rgba(255,255,255,.45); font-family: Consolas, monospace; }
.code { font-family: Consolas, "SFMono-Regular", monospace; font-size: 13px; line-height: 2; padding: 18px 0 10px; color: #c9dcff; }
.code .k { color: #ff7ab6; } .code .s { color: #7ee7a8; } .code .c { color: #5d779c; } .code .f { color: #7ec8ff; }
.console-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.console-stats div { background: rgba(47,107,255,.14); border: 1px solid rgba(90,160,255,.18); border-radius: 12px; padding: 14px 10px; text-align: center; }
.console-stats b { display: block; font-size: 21px; color: #fff; }
.console-stats span { font-size: 11px; color: #8fa9cc; }
.float-chip {
  position: absolute; background: rgba(9,30,66,.92); border: 1px solid rgba(100,190,255,.35);
  border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: #dbeaff;
}
.float-chip i { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--blue), var(--cyan)); display: grid; place-items: center; font-style: normal; font-size: 14px; }
.chip-1 { top: -28px; right: -22px; animation: float 6s ease-in-out infinite; }
.chip-2 { bottom: -26px; left: -32px; animation: float 8s ease-in-out infinite reverse; }

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.section-head { text-align: center; margin-bottom: 52px; }
.eyebrow { color: var(--blue); font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; }
.section-head h2 { font-size: clamp(30px, 3vw, 42px); margin: 12px 0 14px; letter-spacing: -.5px; }
.section-head p { color: var(--muted); max-width: 680px; margin: 0 auto; font-size: 15px; }

/* Carousel */
.showcase { padding: 0 0 96px; background: var(--soft); }
.showcase-wrap { position: relative; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); }
.showcase-track { display: flex; transition: transform .65s cubic-bezier(.22,.61,.36,1); }
.showcase-track img { width: 100%; flex: none; object-fit: cover; }
.showcase-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(6,19,44,.5);
  color: #fff; font-size: 20px; display: grid; place-items: center; backdrop-filter: blur(6px);
  transition: background .2s;
}
.showcase-btn:hover { background: var(--blue); }
.showcase-btn.prev { left: 18px; } .showcase-btn.next { right: 18px; }
.dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.dots button { width: 8px; height: 8px; border-radius: 8px; border: 0; background: rgba(255,255,255,.5); padding: 0; transition: all .25s; }
.dots button.active { width: 26px; background: var(--blue); }

/* Feature grid */
.features { background: #fff; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.feature-card {
  background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 26px; position: relative; overflow: hidden; transition: all .3s;
}
.feature-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(var(--blue), var(--cyan)); transform: scaleY(0); transition: transform .3s;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: #c9dbff; background: #fff; }
.feature-card:hover::before { transform: scaleY(1); }
.feature-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, #e8f0ff, #dff6ff); color: var(--blue); margin-bottom: 22px;
}
.feature-icon svg { width: 26px; height: 26px; }
.feature-card h3 { font-size: 19px; margin: 0 0 12px; }
.feature-card p { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.9; }

/* ---------- API catalog ---------- */
.catalog { background: var(--soft); }
.catalog-layout { display: grid; grid-template-columns: 238px 1fr; gap: 34px; align-items: start; }
.catalog-side {
  position: sticky; top: calc(var(--head-h) + 22px); background: #fff;
  border: 1px solid var(--line); border-radius: 18px; padding: 22px 14px; box-shadow: var(--shadow);
}
.catalog-side h3 { font-size: 14px; color: var(--muted); margin: 0 0 14px 10px; letter-spacing: 1px; }
.cat-link {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px;
  color: #42536d; font-size: 14px; cursor: pointer; transition: all .2s; margin-bottom: 2px;
}
.cat-link span { font-size: 11px; color: #a3b1c8; font-family: Consolas, monospace; width: 18px; }
.cat-link em { font-style: normal; margin-left: auto; font-size: 11px; color: #9dacc2; background: #eef3fb; border-radius: 20px; padding: 1px 8px; }
.cat-link:hover, .cat-link.active { background: linear-gradient(90deg, #eaf1ff, #f6fbff); color: var(--blue); font-weight: 600; }
.cat-link.active span, .cat-link.active em { color: var(--blue); }
.catalog-main { min-width: 0; }
.catalog-toolbar {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px;
  display: flex; align-items: center; gap: 14px; margin-bottom: 28px; box-shadow: var(--shadow);
}
.search-box { display: flex; align-items: center; gap: 10px; flex: 1; background: var(--soft); border-radius: 10px; padding: 10px 14px; }
.search-box svg { width: 18px; height: 18px; color: #94a5bd; flex: none; }
.search-box input { border: 0; background: none; outline: none; width: 100%; font-size: 14px; color: var(--ink); }
.toolbar-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.toolbar-count b { color: var(--blue); font-size: 17px; }
.cat-block { margin-bottom: 46px; scroll-margin-top: calc(var(--head-h) + 20px); }
.cat-block-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.cat-block-head h3 { font-size: 22px; margin: 0; }
.cat-block-head .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.cat-block-head .num { font-size: 12px; color: var(--blue); background: #e5efff; padding: 4px 10px; border-radius: 20px; }
.api-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.api-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 10px 14px;
  text-align: center; cursor: pointer; transition: all .25s; position: relative; overflow: hidden;
}
.api-card::after {
  content: ""; position: absolute; inset: 0; border-radius: 14px; border: 1px solid var(--blue);
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.api-card:hover { transform: translateY(-5px); box-shadow: 0 16px 32px rgba(31,82,180,.14); }
.api-card:hover::after { opacity: 1; }
.api-card img { width: 54px; height: 54px; object-fit: contain; margin: 0 auto 12px; border-radius: 12px; }
.api-card .name { font-size: 13px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #223454; }
.api-card .type { display: inline-block; margin-top: 9px; font-size: 10px; color: var(--blue); background: #eaf2ff; border-radius: 5px; padding: 2px 8px; letter-spacing: .5px; }
.empty { text-align: center; padding: 70px 0; color: var(--muted); }

/* Steps */
.steps { background: linear-gradient(135deg, #06132c, #0c2a58); color: #fff; position: relative; overflow: hidden; }
.steps::before { content: ""; position: absolute; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(47,107,255,.25), transparent 70%); right: -100px; top: -200px; }
.steps .section-head h2 { color: #fff; }
.steps .section-head p { color: rgba(255,255,255,.6); }
.step-grid { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.step-grid::before { content: ""; position: absolute; top: 32px; left: 12%; right: 12%; height: 1px; background: linear-gradient(90deg, transparent, rgba(120,180,255,.45), transparent); }
.step { position: relative; text-align: center; padding: 0 8px; }
.step-no {
  width: 64px; height: 64px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center;
  background: #0e2b5a; border: 1px solid rgba(110,180,255,.5); color: var(--cyan);
  font-size: 20px; font-weight: 700; position: relative; z-index: 2;
}
.step h3 { font-size: 18px; margin: 0 0 10px; }
.step p { font-size: 13px; color: rgba(255,255,255,.6); margin: 0; line-height: 1.9; }

/* CTA */
.cta-band { background: var(--soft); padding: 90px 0; }
.cta-box {
  position: relative; overflow: hidden; border-radius: 26px; padding: 66px 40px; text-align: center; color: #fff;
  background: linear-gradient(115deg, #1749c6, #2f6bff 55%, #1ba8e8);
  box-shadow: 0 30px 70px rgba(28,85,205,.3);
}
.cta-box::before, .cta-box::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.cta-box::before { width: 420px; height: 420px; left: -140px; top: -230px; }
.cta-box::after { width: 500px; height: 500px; right: -120px; bottom: -340px; }
.cta-box h2 { font-size: 36px; margin: 0 0 14px; position: relative; }
.cta-box p { color: rgba(255,255,255,.8); margin: 0 0 30px; position: relative; }
.cta-box .hero-buttons { justify-content: center; position: relative; }
.cta-box .btn-primary { background: #fff; color: var(--blue); box-shadow: 0 12px 30px rgba(0,0,0,.16); }

/* ---------- Footer ---------- */
.footer { background: #04102a; color: rgba(255,255,255,.68); }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 44px; padding: 70px 0 54px; }
.footer-brand .brand-logo { margin-bottom: 18px; }
.footer-brand p { font-size: 13px; line-height: 2; margin: 0 0 18px; max-width: 280px; }
.footer-col h4 { color: #fff; font-size: 15px; margin: 0 0 20px; }
.footer-col a, .footer-col span { display: block; font-size: 13px; margin-bottom: 10px; color: rgba(255,255,255,.58); transition: color .2s; }
.footer-col a:hover { color: var(--cyan); }
.footer-qr { display: flex; gap: 16px; }
.footer-qr div { text-align: center; font-size: 11px; }
.footer-qr img { width: 82px; height: 82px; object-fit: cover; border-radius: 8px; background: #fff; padding: 3px; margin-bottom: 6px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 22px 0; font-size: 12px; color: rgba(255,255,255,.42); }
.footer-bottom .container { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.footer-bottom a:hover { color: var(--cyan); }

/* ---------- Floating service widget ---------- */
.kf { position: fixed; right: 20px; top: 48%; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.kf-btn {
  width: 62px; padding: 12px 4px; border-radius: 12px; background: var(--blue); color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px;
  box-shadow: 0 12px 30px rgba(47,107,255,.42); transition: all .2s; position: relative;
}
.kf-btn:hover { background: var(--blue-dark); transform: translateX(-3px); }
.kf-btn svg { width: 22px; height: 22px; }
.kf-pop {
  position: absolute; right: 72px; top: 0; width: 210px; background: #fff; color: var(--ink);
  border-radius: 14px; padding: 18px; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden;
  transform: translateX(8px); transition: all .22s; text-align: center;
}
.kf-btn:hover .kf-pop, .kf-btn:focus-within .kf-pop { opacity: 1; visibility: visible; transform: none; }
.kf-pop::after { content: ""; position: absolute; right: -6px; top: 24px; width: 12px; height: 12px; background: #fff; transform: rotate(45deg); }
.kf-pop b { display: block; font-size: 16px; color: var(--blue); margin: 6px 0 2px; }
.kf-pop small { color: var(--muted); font-size: 12px; }
.kf-pop img { width: 128px; height: 128px; object-fit: cover; margin: 0 auto 8px; border-radius: 8px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-mask { position: absolute; inset: 0; background: rgba(2,10,26,.72); backdrop-filter: blur(6px); }
.modal-box {
  position: relative; width: min(440px, 100%); background: #fff; border-radius: 20px; padding: 34px;
  box-shadow: 0 40px 100px rgba(0,0,0,.4); animation: pop .3s ease;
}
@keyframes pop { from { transform: translateY(16px) scale(.97); opacity: 0; } }
.modal-close { position: absolute; right: 18px; top: 14px; border: 0; background: none; font-size: 24px; color: #94a3b8; }
.modal-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.modal-tabs button { border: 0; background: none; padding: 0 0 12px; font-size: 16px; color: var(--muted); position: relative; }
.modal-tabs button.active { color: var(--blue); font-weight: 700; }
.modal-tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--blue); }
.modal-panel { display: none; } .modal-panel.active { display: block; }
.modal-panel h3 { font-size: 22px; margin: 0 0 22px; }
.field { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; margin-bottom: 14px; background: var(--soft); }
.field input { border: 0; background: none; outline: none; flex: 1; padding: 13px 0; font-size: 14px; }
.field button { border: 0; background: none; color: var(--blue); font-size: 13px; font-weight: 600; }
.field button:disabled { color: #9aa8bd; }
.modal-submit { width: 100%; margin-top: 8px; padding: 14px; border: 0; border-radius: 10px; background: linear-gradient(120deg, var(--blue), #1f9dff); color: #fff; font-size: 15px; font-weight: 700; }
.modal-note { font-size: 12px; color: var(--muted); margin-top: 16px; text-align: center; }
.modal-note a { color: var(--blue); }
.modal-msg { min-height: 20px; color: var(--red); font-size: 12px; margin-bottom: 4px; }

/* Detail drawer */
.drawer { position: fixed; inset: 0 0 0 auto; width: min(430px, 100%); z-index: 210; display: none; }
.drawer.open { display: block; }
.drawer-mask { position: absolute; inset: 0; background: rgba(2,10,26,.5); }
.drawer-box { position: absolute; inset: 0 0 0 auto; background: #fff; padding: 40px 34px; overflow-y: auto; box-shadow: -20px 0 60px rgba(0,0,0,.2); animation: slideIn .3s ease; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.drawer-box .close { position: absolute; right: 22px; top: 18px; border: 0; background: none; font-size: 26px; color: #94a3b8; }
.drawer-icon { width: 100px; height: 100px; object-fit: contain; border-radius: 18px; background: var(--soft); padding: 12px; }
.drawer-cat { color: var(--blue); font-size: 13px; font-weight: 600; margin-top: 24px; }
.drawer-box h2 { font-size: 28px; margin: 8px 0 18px; }
.drawer-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.drawer-tags span { background: #eaf2ff; color: var(--blue); font-size: 12px; padding: 5px 12px; border-radius: 20px; }
.drawer-info { border-top: 1px solid var(--line); padding-top: 22px; }
.drawer-info div { display: flex; justify-content: space-between; font-size: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.drawer-info div span:first-child { color: var(--muted); }
.drawer-info div b { font-weight: 600; }
.drawer-box .btn-primary { width: 100%; margin-top: 28px; }

/* ---------- Inner pages ---------- */
.page-hero {
  position: relative; padding: calc(var(--head-h) + 70px) 0 70px; color: #fff; overflow: hidden;
  background: radial-gradient(700px 400px at 80% 20%, rgba(47,107,255,.35), transparent 65%),
              linear-gradient(130deg, #05132d, #0b2750);
}
.page-hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(120,170,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(120,170,255,.05) 1px, transparent 1px); background-size: 48px 48px; }
.page-hero .container { position: relative; }
.crumb { font-size: 13px; color: rgba(255,255,255,.5); margin-bottom: 16px; }
.crumb a:hover { color: var(--cyan); }
.page-hero h1 { font-size: 44px; margin: 0 0 14px; }
.page-hero p { color: rgba(255,255,255,.65); margin: 0; max-width: 720px; }
.page-hero .glowline { width: 68px; height: 3px; background: linear-gradient(90deg, var(--cyan), var(--blue)); border-radius: 4px; margin-top: 24px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-8 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.info-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.info-card h3 { font-size: 19px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.info-card h3 i { width: 30px; height: 30px; border-radius: 9px; background: #eaf2ff; color: var(--blue); display: grid; place-items: center; font-style: normal; font-size: 14px; flex: none; }
.info-card p { color: var(--muted); font-size: 14px; line-height: 2; margin: 0; }
.feature-compact { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px 20px; transition: all .25s; }
.feature-compact:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: #bfd4ff; }
.feature-compact .ic { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #eaf2ff, #dff7ff); color: var(--blue); display: grid; place-items: center; font-size: 20px; margin-bottom: 14px; }
.feature-compact h4 { margin: 0 0 6px; font-size: 16px; }
.feature-compact p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.85; }

/* Article list */
.tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 34px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: #fff; color: var(--muted); padding: 9px 22px; border-radius: 30px; font-size: 14px; transition: all .2s; }
.tabs button:hover, .tabs button.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.article-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; transition: all .25s; cursor: pointer; }
.article-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.article-card img { width: 100%; height: 180px; object-fit: cover; background: #e9f0ff; }
.article-card .body { padding: 22px; }
.article-card h3 { font-size: 17px; margin: 0 0 10px; line-height: 1.5; }
.article-card p { color: var(--muted); font-size: 13px; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-card time { font-size: 12px; color: #9aa8bd; }
.article-list { display: flex; flex-direction: column; gap: 14px; }
.article-item { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.article-item-head { display: flex; gap: 20px; align-items: center; padding: 18px 22px; cursor: pointer; }
.article-item-head img { width: 110px; height: 76px; object-fit: cover; border-radius: 10px; flex: none; background: #e9f0ff; }
.article-item-head .t { flex: 1; min-width: 0; }
.article-item-head h3 { font-size: 17px; margin: 0 0 8px; }
.article-item-head time { font-size: 12px; color: #9aa8bd; }
.article-item-head .arrow { color: var(--blue); font-size: 20px; transition: transform .25s; }
.article-item.open .arrow { transform: rotate(180deg); }
.article-content { display: none; padding: 0 26px 26px; border-top: 1px solid var(--line); color: #45536a; font-size: 14px; }
.article-item.open .article-content { display: block; }
.article-content img { max-width: 100%; height: auto; margin: 12px 0; border-radius: 8px; }
.article-content p { line-height: 2; margin: 12px 0; }
.load-more { text-align: center; margin-top: 30px; }
.load-more button { border: 1px solid var(--blue); background: #fff; color: var(--blue); padding: 11px 34px; border-radius: 10px; font-size: 14px; }
.load-more button:hover { background: var(--blue); color: #fff; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px 26px; text-align: center; box-shadow: var(--shadow); transition: all .3s; }
.contact-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: #bcd3ff; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #fff; display: grid; place-items: center; font-size: 24px; font-weight: 700; margin: 0 auto 14px; }
.contact-card h3 { margin: 0 0 18px; font-size: 19px; }
.contact-line { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: #4a5b75; padding: 7px 0; border-top: 1px dashed var(--line); }
.contact-line b { color: var(--ink); }
.contact-qr { width: 138px; height: 138px; margin: 18px auto 8px; border-radius: 10px; object-fit: cover; }
.contact-card small { color: var(--muted); font-size: 12px; }
.company-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
.company-map { min-height: 280px; border-radius: 20px; background: linear-gradient(135deg, #e8f0ff, #d8eaff); position: relative; overflow: hidden; border: 1px solid var(--line); }
.company-map::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(47,107,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(47,107,255,.12) 1px, transparent 1px); background-size: 38px 38px; }
.pin { position: absolute; left: 52%; top: 46%; transform: translate(-50%,-50%); text-align: center; }
.pin i { width: 40px; height: 40px; border-radius: 50% 50% 50% 0; background: var(--blue); transform: rotate(-45deg); box-shadow: 0 10px 24px rgba(47,107,255,.5); display: block; }
.pin span { display: inline-block; margin-top: 14px; background: #fff; padding: 6px 14px; border-radius: 8px; font-size: 13px; color: var(--ink); box-shadow: var(--shadow); }
.info-row { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.info-row span:first-child { color: var(--muted); flex: none; width: 92px; }
.info-row b { font-weight: 600; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.show { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 1100px) {
  .feature-grid, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .api-grid { grid-template-columns: repeat(5, 1fr); }
  .hero-inner { gap: 30px; }
  .footer-top { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .nav { position: fixed; top: var(--head-h); left: 0; right: 0; background: rgba(6,19,44,.97); flex-direction: column; gap: 0; padding: 10px 24px 20px; display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; }
  .nav a::after { display: none; }
  .menu-toggle { display: block; }
  .header-actions .btn-primary { display: none; }
  .nav a .caret, .mega-panel { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
  .console { max-width: 520px; }
  .hero { min-height: auto; }
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-side { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .catalog-side h3 { width: 100%; }
  .cat-link { margin: 0; }
  .cat-link em { display: none; }
  .step-grid, .grid-8 { grid-template-columns: repeat(2, 1fr); }
  .step-grid::before { display: none; }
  .article-grid, .contact-grid, .grid-2, .company-panel { grid-template-columns: 1fr; }
  .hero-trust { flex-wrap: wrap; gap: 20px; }
  .hero-trust div { min-width: 30%; }
}
@media (max-width: 620px) {
  .container { width: calc(100% - 32px); }
  .section { padding: 66px 0; }
  .hero { padding-top: calc(var(--head-h) + 56px); }
  .hero h1 { font-size: 38px; }
  .hero-desc { font-size: 15px; }
  .feature-grid, .grid-4, .step-grid, .grid-8 { grid-template-columns: 1fr; }
  .api-grid { grid-template-columns: repeat(3, 1fr); }
  .api-card img { width: 44px; height: 44px; }
  .api-card .name { font-size: 11px; }
  .footer-top { grid-template-columns: 1fr; }
  .kf { right: 10px; }
  .cta-box { padding: 50px 22px; }
  .cta-box h2 { font-size: 28px; }
  .console-card { transform: none; }
  .article-item-head img { width: 76px; height: 60px; }
}
