/* ==========================================================================
   站点骨架：头部导航 / 页脚 / 悬浮工具条 / 页面横幅
   ========================================================================== */

/* --------------------------------------------------------------------------
   头部
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-h);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  margin-right: 8px;
}
.logo__mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(150deg, #f2543c, #d3261c);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.5px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(217, 40, 26, .28);
}
.logo__text { display: flex; flex-direction: column; line-height: 1.15; }
.logo__name { font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.logo__sub { font-size: 10px; color: var(--ink-3); font-weight: 500; letter-spacing: .3px; }

.nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--header-h);
  padding: 0 14px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color .18s;
}
.nav__link:hover { color: var(--ink); }
.nav__link.is-active { color: var(--ink); font-weight: 600; }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2.5px;
  border-radius: 3px;
  background: var(--brand);
}

.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }

/* 页头右侧「发布信息」按钮 */
.header-post { flex: none; gap: 5px; padding: 0 14px; }
.header-post svg { width: 15px; height: 15px; }
@media (max-width: 1120px) { .header-post svg { display: none; } .header-post { padding: 0 12px; } }

.cart-link { position: relative; }
.cart-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  font-variant-numeric: tabular-nums;
}
.cart-badge.is-empty { display: none; }

.user-menu { position: relative; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 4px;
  border-radius: 20px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  transition: background .18s;
}
.user-chip:hover { background: #eef0f3; }
.user-chip__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(150deg, #ffb08a, #e8392c);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 176px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: .18s var(--ease);
}
.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown { opacity: 1; visibility: visible; transform: none; }
.user-dropdown a,
.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-xs);
  font-size: 13px;
  color: var(--ink-2);
  text-align: left;
}
.user-dropdown a:hover,
.user-dropdown button:hover { background: var(--bg); color: var(--brand); }
.user-dropdown svg { width: 16px; height: 16px; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--r-xs);
  color: var(--ink);
  place-items: center;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* 移动端抽屉 */
.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 8px 0 16px;
}
.mobile-nav.is-open { display: block; animation: fadeUp .24s var(--ease) both; }
.mobile-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  font-size: 15px;
  color: var(--ink-2);
  border-radius: 0;
}
.mobile-nav a:hover { background: var(--bg); }
.mobile-nav a.is-active { color: var(--brand); font-weight: 600; }
.mobile-nav a svg { width: 16px; height: 16px; opacity: .4; }

/* --------------------------------------------------------------------------
   页面横幅（内页通用）
   -------------------------------------------------------------------------- */
.page-hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-grad);
  color: #fff;
}
.page-hero::after {
  content: "";
  position: absolute;
  right: -140px;
  top: -180px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 0 0 60px rgba(255, 255, 255, .05), 0 0 0 160px rgba(255, 255, 255, .04);
  pointer-events: none;
}
.page-hero__inner { position: relative; z-index: 2; padding: 54px 0 58px; max-width: 720px; }
.page-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .26);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  margin-bottom: 16px;
}
.page-hero h1 { font-size: 36px; line-height: 1.25; font-weight: 800; letter-spacing: -.5px; }
.page-hero p { margin-top: 12px; font-size: 15px; color: rgba(255, 255, 255, .88); }

/* 面包屑 */
.crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 18px 0;
  font-size: 12.5px;
  color: var(--ink-3);
}
.crumb a, .crumb span { white-space: nowrap; }
.crumb > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.crumb a:hover { color: var(--brand); }
.crumb svg { width: 12px; height: 12px; opacity: .5; flex: none; }
.crumb span { color: var(--ink-2); }

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 72px;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}
.footer-main {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1.1fr;
  gap: 48px;
  padding: 52px 0 44px;
}
.footer-brand .logo { margin: 0 0 14px; }
.footer-desc {
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-2);
  max-width: 360px;
}
.footer-contact { margin-top: 16px; display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.footer-contact li { display: flex; gap: 8px; line-height: 1.7; }
.footer-contact svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--ink-3); }
.footer-contact a:hover { color: var(--brand); }

.footer-col h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
  letter-spacing: .2px;
}
.footer-col ul { display: grid; gap: 10px; }
.footer-col a { font-size: 13px; color: var(--ink-2); transition: color .18s; }
.footer-col a:hover { color: var(--brand); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 18px 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-3);
}
.footer-bottom a { color: var(--ink-3); }
.footer-bottom a:hover { color: var(--brand); }

/* --------------------------------------------------------------------------
   右侧悬浮工具条
   -------------------------------------------------------------------------- */
.float-rail {
  position: fixed;
  right: 22px;
  bottom: 96px;
  z-index: 55;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.float-rail__btn {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition: background .18s, color .18s;
}
.float-rail__btn + .float-rail__btn { border-top: 1px solid var(--line); }
.float-rail__btn:hover { background: var(--brand-50); color: var(--brand); }
.float-rail__btn svg { width: 19px; height: 19px; }
.float-rail__btn[data-tip]::before {
  content: attr(data-tip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translate(6px, -50%);
  padding: 6px 10px;
  border-radius: 7px;
  background: #1f2229;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: .18s var(--ease);
}
.float-rail__btn[data-tip]:hover::before { opacity: 1; transform: translate(0, -50%); }
.float-rail__btn.is-hidden { display: none; }

/* --------------------------------------------------------------------------
   提示条
   -------------------------------------------------------------------------- */
.toast-wrap {
  position: fixed;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  background: #1f2229;
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .26s var(--ease) both;
}
.toast svg { width: 16px; height: 16px; }
.toast--ok svg { color: #6ee7a8; }
.toast--err svg { color: #ff9a92; }
.toast.is-out { animation: toastOut .22s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .footer-main { grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; }
  .footer-main .footer-col:last-child { grid-column: 2 / 4; }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .nav-toggle { display: grid; }
  .header-inner { gap: 12px; }
  .header-actions { margin-left: auto; }
  .float-rail { display: none; }
  .page-hero__inner { padding: 38px 0 42px; }
  .page-hero h1 { font-size: 26px; }
}

@media (max-width: 720px) {
  .footer-main { grid-template-columns: 1fr 1fr; gap: 28px; padding: 36px 0 30px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-main .footer-col:last-child { grid-column: auto; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
  .site-footer { margin-top: 48px; }
  .logo__sub { display: none; }
}
