/* 航栈 inner-page chrome — shared by /read /discover /community /about /auth/login.
 * 移植自原站 entry.RHqsFfBL.css（site-* 规则，逐值保留）+ SiteHeader.BAhGXHuJ.css（nav-jelly，去 Vue scope）。
 * V2 覆盖段（stage 渐变、nav 胶囊底、create lime）为原站后者声明的生效值，直接合并。
 * :root 变量 --hz-* 已存在于 src/app/globals.css，勿重复定义。 */

.site-stage {
  background:
    radial-gradient(circle at 8% 4%, #dfff6b47, #0000 23%),
    radial-gradient(circle at 94% 12%, #a5b5ff3d, #0000 24%),
    #eef1f6;
  min-height: 100vh;
  padding: clamp(8px, 1.2vw, 20px);
}

.site-shell {
  border-radius: var(--hz-radius-shell);
  background: #fffffff0;
  border: 3px solid #ffffffe0;
  width: min(1720px, 100%);
  min-height: calc(100vh - 40px);
  margin: 0 auto;
  padding: 0 clamp(18px, 3vw, 56px);
  overflow: hidden;
  box-shadow: 0 26px 80px #3c42581f;
}

/* ---------------- header ---------------- */

.site-header {
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  min-height: 84px;
  display: grid;
  z-index: 20;
  position: relative;
}

.site-brand {
  letter-spacing: -.05em;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-size: 23px;
  font-weight: 780;
  display: inline-flex;
  color: #171719;
}

.site-brand img { width: 29px; height: 29px; }

.site-nav {
  background: #f4f4f6;
  border-radius: 14px;
  padding: 5px;
  gap: 6px;
  display: flex;
}

.site-nav a {
  color: #56565c;
  border-radius: 11px;
  padding: 10px 16px;
  font-size: 13px;
  text-align: center;
  min-width: 62px;
}

/* nav-jelly — JS 驱动的滑移胶囊（indicator transform 由 SiteHeader.tsx 设置） */

.nav-jelly { isolation: isolate; position: relative; overflow: visible; }

.nav-jelly-indicator {
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  will-change: transform;
  background: #171719;
  border-radius: 11px;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  box-shadow: 0 9px 22px #17171929;
  transition: transform .22s cubic-bezier(.3, 1.25, .45, 1), opacity .15s, width .18s ease;
}

.nav-jelly .nav-jelly-link {
  z-index: 1;
  will-change: transform;
  transition: color .15s, background-color .16s, transform .16s;
  position: relative;
  box-shadow: none !important;
  background: 0 0 !important;
}

.nav-jelly .nav-jelly-link.active,
.nav-jelly .nav-jelly-link:active,
.nav-jelly .nav-jelly-link:hover { box-shadow: none !important; background: 0 0 !important; }

.nav-jelly .nav-jelly-link:not(.active):hover { color: #171719; box-shadow: none !important; background: 0 0 !important; }

.nav-jelly .nav-jelly-link.active { color: #fff; }

.nav-jelly:not(.is-ready) .nav-jelly-link.active { background: #171719; }

.nav-jelly .nav-jelly-link:focus-visible { outline-offset: 3px; outline: 3px solid #aed33147; }

.site-header-actions { justify-content: flex-end; align-items: center; gap: 9px; display: flex; }

.site-search-mini {
  background: #f1f2f5;
  border-radius: 10px;
  align-items: center;
  gap: 7px;
  width: 152px;
  height: 38px;
  padding: 0 11px;
  transition: background-color .18s, box-shadow .18s;
  display: flex;
}

.site-search-mini:focus-within { background: #fff; box-shadow: 0 0 0 3px #9ec22324; }

.site-search-mini input {
  width: 100%;
  min-width: 0;
  box-shadow: none;
  background: 0 0;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.site-search-mini input:focus,
.site-search-mini input:focus-visible,
.site-search-mini input:hover { box-shadow: none; background: 0 0; border: 0; outline: 0; transform: none; }

.site-create-link {
  color: #171719;
  background: #dfff6b;
  border-color: #0000;
  font-weight: 700;
  padding: 9px 18px;
  border: 1px solid #e3e3e6;
  border-radius: 9px;
  font-size: 12px;
}

.site-user {
  color: #fff;
  background: linear-gradient(145deg, #f7a976 0 47%, #25252a 48%);
  border-radius: 50%;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 12px;
  font-weight: 700;
  display: grid;
}

.site-user.site-login { background: #171719; border-radius: 12px; width: auto; padding: 0 14px; }

.site-menu {
  background: #f4f4f5;
  border: 0;
  border-radius: 9px;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  display: none;
  cursor: pointer;
}

.site-mobile-nav {
  background: #f4f4f6;
  border-radius: 12px;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px;
  display: none; /* 源站：默认隐藏，≤1000px 由媒体查询切 grid */
}

@media (width <= 1000px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-nav { display: none; }
  .site-menu { display: grid; }
  .site-mobile-nav { display: grid; }
}

.site-mobile-nav a { text-align: center; font-size: var(--hz-font-min); padding: 9px 4px; color: #56565c; }

.site-mobile-nav a.router-link-active { color: #fff; background: #171719; border-radius: 9px; }

/* ---------------- footer ---------------- */

.site-footer {
  color: #898a91;
  min-height: 82px;
  font-size: var(--hz-font-min);
  border-top: 1px solid #ededf0;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  display: grid;
}

.site-footer-brand { color: #171719; font-size: 18px; letter-spacing: -.05em; align-items: center; gap: 10px; width: fit-content; display: inline-flex; font-weight: 780; }
.site-footer-brand img { width: 23px; height: 23px; }
.site-footer p { text-align: center; margin: 0; }
.site-footer nav { justify-content: flex-end; gap: 15px; display: flex; }
.site-footer nav a { color: #898a91; }
.site-footer nav a:hover { color: #171719; }

/* ---------------- responsive ---------------- */

@media (width <= 1000px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-nav { display: none; }
  .site-menu { display: grid; }
  .nav-jelly-indicator { display: none; }
}

@media (width <= 680px) {
  .site-stage { padding: 0; }
  .site-shell { border: 0; border-radius: 0; min-height: 100vh; padding: 0 15px; }
  .site-header { min-height: 72px; }
  .site-create-link, .site-search-mini { display: none; }
  .site-mobile-nav { grid-template-columns: repeat(3, 1fr); }
  .site-footer { text-align: center; grid-template-columns: 1fr; padding: 22px 0; }
  .site-footer-brand { margin: auto; }
  .site-footer nav { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-jelly .nav-jelly-link { transition-duration: 0s; }
  .nav-jelly-indicator { transition-duration: 0s; }
}

/* ---- 编辑器变体 header（/create/* 页；computed style 实测值 2026-09-15） ---- */

.site-creator-save {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #6f7178;
}

.site-preview-link {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 650;
  color: #20201f;
  background: #fff;
  border: 1px solid #dfe1e6;
  border-radius: 10px;
  transition: border-color .18s, transform .18s;
}

.site-preview-link:hover { border-color: #c8cbd1; transform: translateY(-1px); }

/* 移动端横向溢出兜底：仅阻止意外横向滚动，不改变任何元素尺寸
   （原 WP 端曾加 .site-header-actions{max-width:60vw} 等尺寸保险，与 Next 不一致，
     导致 ≤680px 档 header 列宽分歧，已移除） */
@media (width <= 680px) {
  html, body { overflow-x: hidden; }
}

/* ===== 3.1.7：移动端触控目标（WCAG 2.5.8 AA 底线 24px，目标 44px）=====
 * 汉堡按钮 38→44；页脚链接行高 18px 命中区过窄 → padding-block 扩到 34px。 */
@media (width <= 680px) {
  .site-menu { width: 44px; height: 44px; }
  .site-footer nav a { padding-block: 8px; }
}
