/* ==========================================================================
   King Tools — Corporate site stylesheet
   Palette: white base + blue accent
   ========================================================================== */

:root {
  --white: #ffffff;
  --ink: #0a1628;
  --ink-2: #1b2c45;
  --muted: #5d7085;
  --blue: #0f62d6;
  --blue-deep: #0a4ca8;
  --blue-ink: #082f68;
  --sky: #eaf2fd;
  --sky-2: #f5f9ff;
  --sky-3: #f8fbff;
  --line: #e3eaf3;
  --line-strong: #cfdcec;
  --radius-s: 12px;
  --radius: 16px;
  --radius-l: 20px;
  --shadow-s: 0 1px 2px rgba(10, 22, 40, .05), 0 10px 26px -18px rgba(10, 22, 40, .18);
  --shadow-m: 0 20px 48px -28px rgba(10, 22, 40, .32);
  --shadow-blue: 0 16px 36px -20px rgba(15, 98, 214, .55);
  --max: 1240px;
  --header-h: 74px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--white);
  color: var(--ink-2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
    "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); letter-spacing: -.018em; line-height: 1.18; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 40px);
}

/* ------------------------------ header ---------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease);
}

.site-header.is-scrolled { box-shadow: 0 8px 28px -20px rgba(10, 22, 40, .45); }

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

/* logo */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  flex: 0 0 auto;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #1b74e8 0%, var(--blue) 45%, var(--blue-deep) 100%);
  box-shadow: var(--shadow-blue);
}

.brand-mark svg { width: 22px; height: 22px; display: block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.05; }

.brand-name {
  font-size: 17.5px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
}

.brand-sub {
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 600;
}

/* nav */
.nav { display: flex; align-items: center; gap: 4px; }

.nav a {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .01em;
  transition: color .2s, background .2s;
  white-space: nowrap;
}

.nav a:hover { color: var(--blue); background: var(--sky-2); }
.nav a.is-active { color: var(--blue); background: var(--sky); }

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: var(--shadow-blue);
  transition: background .22s, transform .22s;
  white-space: nowrap;
}

.header-cta:hover { background: var(--blue-deep); transform: translateY(-1px); }
.header-cta svg { width: 15px; height: 15px; }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  place-items: center;
  color: var(--ink);
}

.nav-toggle svg { width: 20px; height: 20px; }

/* ------------------------------ sections -------------------------------- */
section { scroll-margin-top: calc(var(--header-h) + 12px); }

.section { padding: clamp(54px, 6.6vw, 92px) 0; }
.section--tight { padding-top: clamp(38px, 4.4vw, 58px); }

.section--tint {
  background: linear-gradient(180deg, var(--sky-3) 0%, #fff 78%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: clamp(26px, 3.2vw, 42px);
  flex-wrap: wrap;
}

.section-head--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.section-head--center .eyebrow::after {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.section-title {
  font-size: clamp(25px, 3.1vw, 38px);
  font-weight: 800;
}

.section-desc {
  margin-top: 11px;
  font-size: 15px;
  color: var(--muted);
  max-width: 62ch;
}

/* ------------------------------ hero band (poster marquee) --------------- */
.poster-band {
  padding: clamp(30px, 3.6vw, 46px) 0 clamp(26px, 3vw, 38px);
  background: linear-gradient(180deg, var(--sky-3) 0%, #fff 100%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.band-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: clamp(18px, 2.2vw, 26px);
}

.band-title {
  font-size: clamp(20px, 2.2vw, 27px);
  font-weight: 800;
  max-width: 26ch;
}

.band-title span { color: var(--blue); }

.band-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.band-note i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(15, 98, 214, .14);
}

.poster-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.poster-viewport::before,
.poster-viewport::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(24px, 5vw, 74px);
  z-index: 2;
  pointer-events: none;
}

.poster-viewport::before { left: 0; background: linear-gradient(90deg, #fff 10%, rgba(255, 255, 255, 0)); }
.poster-viewport::after { right: 0; background: linear-gradient(270deg, #fff 10%, rgba(255, 255, 255, 0)); }

.poster-track {
  display: flex;
  width: max-content;
  animation: rollRight 52s linear infinite;
  will-change: transform;
}

.poster-track:hover { animation-play-state: paused; }

.poster-group {
  display: flex;
  gap: 20px;
  padding-right: 20px;
  flex: 0 0 auto;
}

.poster-slide {
  position: relative;
  flex: 0 0 auto;
  width: clamp(300px, 44vw, 600px);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--sky-2);
  box-shadow: var(--shadow-s);
}

.poster-slide img {
  width: 100%;
  height: auto;
  aspect-ratio: 1500 / 621;
  object-fit: cover;
}

@keyframes rollRight {
  from { transform: translate3d(-50%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}

/* ------------------------------ brand wall ------------------------------- */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(16px, 2vw, 24px);
  max-width: 840px;
  margin: 0 auto;
}

.brand-card {
  display: grid;
  place-items: center;
  min-height: 148px;
  padding: 32px 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  transition: border-color .28s, box-shadow .28s, transform .28s var(--ease);
}

.brand-card img {
  max-height: 76px;
  width: auto;
  object-fit: contain;
  filter: grayscale(1) opacity(.72);
  transition: filter .3s;
}

.brand-card:hover {
  border-color: #b9d2f2;
  box-shadow: var(--shadow-m);
  transform: translateY(-3px);
}

.brand-card:hover img { filter: none; }

/* ------------------------------ product rail ----------------------------- */
.rail-block { position: relative; }

.rail {
  display: flex;
  gap: clamp(14px, 1.6vw, 20px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 2px 18px;
}

.rail::-webkit-scrollbar { display: none; }

.rail-btn {
  position: absolute;
  top: calc(50% - 22px);
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-s);
  transition: background .22s, color .22s, border-color .22s, transform .22s;
}

.rail-btn svg { width: 17px; height: 17px; }
.rail-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.rail-btn:disabled { opacity: .35; cursor: default; }
.rail-btn:disabled:hover { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.rail-btn--prev { left: -18px; }
.rail-btn--next { right: -18px; }

.tool-card {
  flex: 0 0 clamp(198px, 22.5vw, 268px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  box-shadow: var(--shadow-s);
  transition: border-color .28s, box-shadow .28s, transform .3s var(--ease);
}

.tool-card:hover {
  border-color: #b9d2f2;
  box-shadow: var(--shadow-m);
  transform: translateY(-4px);
}

.tool-figure {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(circle at 50% 38%, #f6faff 0%, #e8f0fa 100%);
  border-bottom: 1px solid var(--line);
}

.tool-figure img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform .5s var(--ease);
}

.tool-card:hover .tool-figure img { transform: scale(1.055); }

.tool-body { padding: 14px 16px 17px; }

.tool-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 7px;
}

.tool-name {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}

.tool-link {
  margin-top: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue);
}

.tool-link svg { width: 13px; height: 13px; transition: transform .24s; }
.tool-card:hover .tool-link svg { transform: translateX(3px); }

/* machines rail: wider cards */
.rail--wide .tool-card { flex: 0 0 clamp(252px, 38vw, 430px); }
.rail--wide .tool-figure { padding: 20px; }

/* ------------------------------ empty state ------------------------------ */
.empty-state {
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(38px, 5vw, 66px) clamp(20px, 3vw, 40px);
  text-align: center;
  border: 1.5px dashed #c6d8ee;
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, #fbfdff 0%, #f2f8ff 100%);
}

.empty-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #d8e5f6;
  color: var(--blue);
  box-shadow: var(--shadow-s);
}

.empty-icon svg { width: 28px; height: 28px; }

.empty-state h3 { font-size: clamp(18px, 2vw, 23px); font-weight: 800; margin-bottom: 10px; }

.empty-state p {
  font-size: 14px;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .22s, color .22s, border-color .22s, transform .22s;
}

.btn--primary { background: var(--blue); color: #fff; box-shadow: var(--shadow-blue); }
.btn--primary:hover { background: var(--blue-deep); transform: translateY(-1px); }

.btn--ghost { background: #fff; color: var(--blue); border-color: #c3d8f2; }
.btn--ghost:hover { background: var(--sky); border-color: var(--blue); }

.empty-state .btn { margin-top: 22px; }

/* ------------------------------ contact ---------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: clamp(18px, 2.6vw, 34px);
  align-items: stretch;
}

.contact-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: clamp(20px, 2.4vw, 32px);
  box-shadow: var(--shadow-s);
  display: flex;
  flex-direction: column;
}

.contact-panel h3 { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.contact-panel > .panel-sub { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.c-item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px 0;
  border-bottom: 1px dashed var(--line);
}

.c-item:last-of-type { border-bottom: 0; }

.c-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--sky);
  color: var(--blue);
}

.c-icon svg { width: 19px; height: 19px; }

.c-body { min-width: 0; flex: 1 1 auto; }

.c-label {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.c-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

a.c-value:hover { color: var(--blue); }

.copy-btn {
  flex: 0 0 auto;
  align-self: center;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--blue);
  background: var(--sky-2);
  border: 1px solid #d7e5f7;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.copy-btn:hover { background: var(--sky); border-color: var(--blue); }

.qr-box {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f7fbff 0%, #eff6ff 100%);
}

.qr-box img {
  width: 104px;
  height: auto;
  border-radius: 8px;
  border: 1px solid #dde8f6;
  background: #fff;
}

.qr-text { min-width: 0; }
.qr-text strong { display: block; font-size: 13.5px; color: var(--ink); font-weight: 800; }
.qr-text span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

.map-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  overflow: hidden;
  background: var(--sky-2);
  min-height: 430px;
  box-shadow: var(--shadow-s);
}

.map-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 430px;
  border: 0;
  filter: grayscale(.12) contrast(1.02);
}

.map-caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 11px 14px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  box-shadow: var(--shadow-s);
  display: flex;
  gap: 8px;
  align-items: flex-start;
  backdrop-filter: blur(6px);
}

.map-caption svg { flex: 0 0 auto; width: 15px; height: 15px; color: var(--blue); margin-top: 2px; }

/* ------------------------------ footer ----------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 34px 0 30px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-nav { display: flex; gap: 4px; flex-wrap: wrap; }

.footer-nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  transition: color .2s, background .2s;
}

.footer-nav a:hover { color: var(--blue); background: var(--sky-2); }

.copyright { font-size: 12.5px; color: var(--muted); }

.footer-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.footer-note p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

/* ------------------------------ reveal ----------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal.is-in { opacity: 1; transform: none; }

/* ------------------------------ toast ------------------------------------ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  z-index: 200;
  padding: 11px 20px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .26s, transform .26s;
  box-shadow: var(--shadow-m);
  white-space: nowrap;
  max-width: calc(100vw - 32px);
}

.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------ responsive -------------------------------- */
@media (max-width: 1080px) {
  .rail-btn--prev { left: -8px; }
  .rail-btn--next { right: -8px; }
}

@media (max-width: 960px) {
  .nav { display: none; }
  .nav-toggle { display: grid; }

  .site-header.is-open .nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    padding: 12px clamp(18px, 4vw, 40px) 18px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 34px -26px rgba(10, 22, 40, .5);
  }

  .site-header.is-open .nav a { padding: 12px 14px; font-size: 15px; }

  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .map-wrap, .map-wrap iframe { min-height: 340px; }
  .header-cta { display: none; }
}

@media (max-width: 760px) {
  .section-head { align-items: flex-start; }
  .rail-btn { display: none; }
  .rail { padding-bottom: 12px; }
  .brand-card { min-height: 126px; padding: 24px 20px; }
  .brand-card img { max-height: 62px; }
  .tool-card { flex: 0 0 min(62vw, 240px); }
  .rail--wide .tool-card { flex: 0 0 min(80vw, 320px); }
  .poster-slide { width: min(78vw, 420px); }
  .band-note { font-size: 11px; }
  .qr-box { flex-direction: row; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 460px) {
  .brand-text .brand-sub { display: none; }
  .brand-name { font-size: 15.5px; letter-spacing: .12em; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .poster-slide { width: 84vw; }
  .qr-box img { width: 88px; }
  .map-caption { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .poster-track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tool-card:hover, .brand-card:hover { transform: none; }
}
