/* ==========================================================================
   京西物流官网复刻 · 基础样式（设计令牌 / 头部导航 / 页脚 / 通用组件）
   仅用于课程学习演示，非官方站点
   ========================================================================== */

:root {
  --red: #e1251b;
  --red-light: #ff5a4e;
  --red-dark: #c71b12;
  --red-soft: #fff1f0;
  --dark: #1e1e22;
  --dark-2: #26262b;
  --text: #1a1a1a;
  --text-2: #4c4c4c;
  --muted: #666;
  --muted-2: #909399;
  --line: #ebebeb;
  --line-2: #e3e5ea;
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-soft-2: #f2f3f7;
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 16px;
  --shadow-s: 0 2px 10px rgba(17, 24, 39, .06);
  --shadow: 0 10px 30px rgba(17, 24, 39, .1);
  --shadow-l: 0 20px 60px rgba(17, 24, 39, .16);
  --container: 1200px;
  --header-h: 72px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; border: 0; }
a { color: inherit; text-decoration: none; transition: color .2s var(--ease); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
::selection { background: var(--red); color: #fff; }

.container {
  width: min(var(--container), calc(100% - 48px));
  margin: 0 auto;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   顶部黑色信息条
   -------------------------------------------------------------------------- */
.topbar {
  background: #111114;
  color: rgba(255, 255, 255, .62);
  font-size: 12px;
  height: 36px;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 36px;
  gap: 4px;
}
.topbar a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
  color: inherit;
}
.topbar a:hover { color: #fff; }
.topbar .caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .7;
}
.topbar__divider { width: 1px; height: 12px; background: rgba(255, 255, 255, .18); }

/* --------------------------------------------------------------------------
   主导航
   -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 300;
  background: #fff;
  transition: box-shadow .3s var(--ease);
}
.header.is-scrolled { box-shadow: 0 6px 24px rgba(17, 24, 39, .09); }

.header__inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
}

.logo { display: flex; align-items: center; flex: 0 0 auto; }
.logo img { height: 32px; width: auto; }

.nav { margin-left: auto; }
.nav__list { display: flex; align-items: stretch; height: var(--header-h); }
.nav__list > li { display: flex; }
.nav__list > li > a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 clamp(14px, 1.7vw, 27px);
  font-size: 16px;
  color: var(--text);
  white-space: nowrap;
}
.nav__list > li > a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 13px;
  width: 24px;
  height: 2px;
  background: var(--red);
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform .3s var(--ease);
}
.nav__list > li:hover > a,
.nav__list > li.is-active > a { color: var(--red); }
.nav__list > li:hover > a::after,
.nav__list > li.is-active > a::after { transform: translateX(-50%) scaleX(1); }

/* 下拉大面板 */
.mega {
  position: absolute;
  left: 50%;
  top: 100%;
  width: min(1160px, calc(100vw - 24px));
  padding: 34px 44px 30px;
  background: #fff;
  border-radius: 0 0 var(--radius-l) var(--radius-l);
  box-shadow: 0 24px 50px rgba(17, 24, 39, .14);
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
  z-index: 320;
}
.nav__list > li:hover > .mega,
.nav__list > li:focus-within > .mega {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.mega__cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 48px; }
.mega__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.mega__heading::before {
  content: "";
  width: 3px; height: 14px;
  background: var(--red);
  border-radius: 2px;
}
.mega__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 10px;
}
.mega__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-2);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.mega__item img { width: 44px; height: 44px; object-fit: contain; }
.mega__item:hover { background: var(--red-soft); color: var(--red); }

.mega__list { display: flex; flex-wrap: wrap; gap: 4px 0; }
.mega__list a {
  width: 50%;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-2);
}
.mega__list a:hover { color: var(--red); }

.mega__sub { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.mega__sub .mega__list a { width: 33.33%; }

/* 简单面板（解决方案 / 可持续发展 / 关于 / 服务支持） */
.mega--plain { width: min(760px, calc(100vw - 24px)); padding: 30px 40px; }
.mega--plain .mega__list a { width: 33.33%; padding: 8px 0; font-size: 14px; }

/* 移动端菜单按钮 */
.burger {
  display: none;
  width: 40px; height: 40px;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.burger span {
  position: relative;
  display: block;
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s var(--ease), background .25s;
}
.burger span::before,
.burger span::after {
  content: "";
  position: absolute; left: 0;
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s var(--ease), top .25s var(--ease);
}
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }
.burger.is-open span { background: transparent; }
.burger.is-open span::before { top: 0; transform: rotate(45deg); }
.burger.is-open span::after { top: 0; transform: rotate(-45deg); }

/* --------------------------------------------------------------------------
   通用标题 / 按钮
   -------------------------------------------------------------------------- */
.sec { padding: 88px 0; }
.sec--soft { background: var(--bg-soft); }
.sec--tight { padding: 64px 0; }

.sec-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 700;
  letter-spacing: .5px;
  text-align: center;
  color: var(--text);
}
.sec-title::before,
.sec-title::after {
  content: "";
  width: 26px; height: 2px;
  background: var(--red);
  border-radius: 2px;
  flex: 0 0 auto;
}
.sec-title--light { color: #fff; }
.sec-sub {
  margin-top: 12px;
  font-size: 15px;
  color: var(--muted);
  text-align: center;
}
.sec-sub--light { color: rgba(255, 255, 255, .72); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 30px;
  font-size: 15px;
  border-radius: 999px;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), background .22s var(--ease), color .22s var(--ease);
  white-space: nowrap;
}
.btn--red {
  color: #fff;
  background: linear-gradient(100deg, #ff6a5c 0%, var(--red) 55%, var(--red-dark) 100%);
  box-shadow: 0 10px 22px rgba(225, 37, 27, .28);
}
.btn--red:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(225, 37, 27, .36);
}
.btn--ghost {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-2);
}
.btn--ghost:hover { color: var(--red); border-color: rgba(225, 37, 27, .45); }
.btn--lg { min-height: 50px; padding: 0 38px; font-size: 16px; }
.btn--sm { min-height: 38px; padding: 0 22px; font-size: 14px; }

.link-red { color: var(--red); }
.link-red:hover { color: var(--red-dark); }

/* 滚动出现动画 */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */
.footer {
  background: var(--dark);
  color: rgba(255, 255, 255, .58);
  padding: 62px 0 0;
  font-size: 13px;
}
.footer__contact {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding-bottom: 34px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.footer__contact-label {
  display: block;
  width: 100%;
  font-size: 13px;
  color: rgba(255, 255, 255, .5);
}
.footer__phone {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  line-height: 1.1;
}
.footer__contact-icons { display: flex; gap: 12px; margin-left: 12px; }
.footer__contact-icons span {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}
.footer__contact-icons svg { width: 18px; height: 18px; fill: rgba(255, 255, 255, .8); }

.footer__cols {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 28px;
  padding: 40px 0 34px;
}
.footer__col h4 {
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.footer__col a {
  display: block;
  padding: 5px 0;
  color: rgba(255, 255, 255, .55);
}
.footer__col a:hover { color: #fff; }

.footer__social {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 6px 0 30px;
}
.footer__social i {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .14);
  transition: background .2s;
}
.footer__social i:hover { background: rgba(255, 255, 255, .3); }

.footer__legal {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 20px 0 26px;
  font-size: 12px;
  line-height: 1.9;
  color: rgba(255, 255, 255, .38);
}
.footer__legal a { color: rgba(255, 255, 255, .55); }
.footer__legal a:hover { color: #fff; }
.footer__legal .sep { margin: 0 8px; opacity: .4; }

/* --------------------------------------------------------------------------
   右侧悬浮工具条
   -------------------------------------------------------------------------- */
.float-bar {
  position: fixed;
  right: 18px;
  bottom: 90px;
  z-index: 260;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.float-bar button,
.float-bar a {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(17, 24, 39, .16);
  transition: transform .22s var(--ease), background .22s var(--ease);
}
.float-bar button:hover,
.float-bar a:hover { transform: translateY(-2px); background: var(--red-soft); }
.float-bar svg { width: 20px; height: 20px; fill: var(--text-2); }
.float-bar .is-accent { background: linear-gradient(135deg, #ff6a5c, var(--red)); }
.float-bar .is-accent svg { fill: #fff; }
.float-bar .is-accent:hover { background: linear-gradient(135deg, #ff6a5c, var(--red-dark)); }
.float-bar__tip {
  position: absolute;
  right: 56px;
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  padding: 6px 10px;
  font-size: 12px;
  color: #fff;
  background: rgba(24, 24, 28, .9);
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.float-bar button:hover .float-bar__tip,
.float-bar a:hover .float-bar__tip { opacity: 1; transform: translateY(-50%) translateX(0); }

/* --------------------------------------------------------------------------
   合作咨询弹层
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 12, 16, .55);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s var(--ease), visibility .25s;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__box {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 34px 38px 30px;
  background: #fff;
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-l);
  transform: translateY(16px) scale(.98);
  transition: transform .25s var(--ease);
}
.modal.is-open .modal__box { transform: none; }
.modal__title { font-size: 22px; font-weight: 700; }
.modal__sub { margin-top: 6px; color: var(--muted); font-size: 13px; }
.modal__close {
  position: absolute;
  top: 14px; right: 16px;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--muted);
  border-radius: 50%;
}
.modal__close:hover { background: var(--bg-soft); color: var(--text); }
.modal__box { position: relative; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field--full { grid-column: 1 / -1; }
.form-field label { font-size: 13px; color: var(--text-2); }
.form-field label .req { color: var(--red); }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 11px 12px;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: rgba(225, 37, 27, .55);
  box-shadow: 0 0 0 3px rgba(225, 37, 27, .1);
}
.form-field textarea { resize: vertical; min-height: 84px; }
.form-agree {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}
.form-agree input { margin-top: 3px; accent-color: var(--red); }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.form-note { margin-top: 12px; font-size: 12px; color: var(--muted-2); }

/* 轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  z-index: 600;
  padding: 12px 22px;
  color: #fff;
  font-size: 14px;
  background: rgba(24, 24, 28, .92);
  border-radius: 999px;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .nav__list > li > a { padding: 0 14px; font-size: 15px; }
  .footer__cols { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .container { width: calc(100% - 32px); }
  .topbar { display: none; }
  .logo img { height: 28px; }
  .nav { display: none; }
  .burger { display: inline-flex; }

  .nav.is-open {
    display: flex;
    position: fixed;
    left: 0; right: 0;
    top: var(--header-h);
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 40px;
    background: #fff;
    overflow-y: auto;
    z-index: 290;
    height: auto;
  }
  .nav.is-open .nav__list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    width: 100%;
  }
  .nav.is-open .nav__list > li { display: block; border-bottom: 1px solid var(--line); }
  .nav.is-open .nav__list > li > a { height: 52px; padding: 0 6px; font-size: 16px; }
  .nav.is-open .nav__list > li > a::after { display: none; }
  .nav.is-open .mega {
    position: static;
    width: 100%;
    padding: 8px 6px 18px;
    box-shadow: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    display: none;
    border-radius: 0;
  }
  .nav.is-open .nav__list > li.is-expanded > .mega { display: block; }
  .mega__cols { grid-template-columns: 1fr; gap: 18px; }
  .mega__grid { grid-template-columns: repeat(4, 1fr); }
  .mega__item img { width: 34px; height: 34px; }
  .mega--plain { width: 100%; padding: 8px 6px 18px; }

  .sec { padding: 56px 0; }
  .float-bar { right: 10px; bottom: 70px; }
  .float-bar button, .float-bar a { width: 40px; height: 40px; }
  .footer { padding-top: 44px; }
  .footer__cols { grid-template-columns: repeat(2, 1fr); gap: 20px; padding: 28px 0 20px; }
  .footer__contact { padding-bottom: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal__box { padding: 26px 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
