/*
 * 后林子官网样式。照设计图 design/Minimalist Memory Brand UI Collage.png：米色暖调、衬线标题、大图留白。
 * 颜色取自 App 的 lib/app/theme/tokens.dart（AppPalette），深色模式跟随系统。
 * 字体只用系统自带的，不加载任何字体文件。
 */

:root {
  --background: #f7f2ea;
  --surface: #fffdf9;
  --surface-muted: #f1ece3;
  --primary: #4f797d;
  --primary-soft: #e4edea;
  --text: #2e3433;
  --text-secondary: #6f7673;
  --text-tertiary: #a4a8a3;
  --divider: #e6dfd3;
  --warm: #d49a5a;
  /* 深色按钮（设计图里「下载 App」那种） */
  --button: #4a4945;
  --on-button: #fffdf9;
  /* 压在插画上的渐变，让标题读得清楚 */
  --veil: 247 242 234;

  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --font-sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;

  --page-gutter: clamp(16px, 5vw, 64px);
  --content-width: 1200px;
  --radius: 14px;
  --header-height: 72px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #191c1b;
    --surface: #222726;
    --surface-muted: #2b302f;
    --primary: #8db3ae;
    --primary-soft: #2f3d3c;
    --text: #ece8e1;
    --text-secondary: #a9ada8;
    --text-tertiary: #767b77;
    --divider: #323836;
    --warm: #d9a86a;
    --button: #ece8e1;
    --on-button: #191c1b;
    --veil: 25 28 27;
  }
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.45;
  margin: 0;
  /* 换行时各行长度接近，避免最后一行只剩一两个字 */
  text-wrap: balance;
}

p {
  margin: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
}

/* ---------- 页眉 ---------- */

.site-header {
  position: relative;
  z-index: 5;
}

/* 首页、关于、下载：页眉压在第一张大图上 */
.site-header--over-image {
  position: absolute;
  inset: 0 0 auto 0;
  /* 插画顶部可能很亮或很花，导航文字压一层底色才读得清 */
  background: linear-gradient(180deg, rgb(var(--veil) / 0.9) 0%, rgb(var(--veil) / 0.6) 60%, rgb(var(--veil) / 0) 100%);
}

.site-header__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 20px var(--page-gutter);
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.08em;
  min-width: 0;
}

.brand__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-mark {
  width: 26px;
  height: 26px;
  flex: none;
  color: var(--primary);
}

.site-nav {
  display: flex;
  gap: 28px;
  margin: 0 auto;
  font-size: 14px;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: currentColor;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: none;
}

.language-switch {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}

.language-switch:hover {
  color: var(--text);
}

/* ---------- 通用按钮 ---------- */

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid transparent;
}

.button--solid {
  background: var(--button);
  color: var(--on-button);
}

.button--outline {
  border-color: rgb(46 52 51 / 0.25);
  color: var(--text);
  background: rgb(255 253 249 / 0.4);
}

.button--disabled {
  background: transparent;
  border: 1px dashed var(--text-tertiary);
  color: var(--text-secondary);
  cursor: default;
}

.button svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* ---------- 大图区（首页主视觉、关于、品牌态度、下载） ---------- */

.scene {
  position: relative;
  isolation: isolate;
  min-height: min(92vh, 860px);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.scene__image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}

/* 左边铺一层底色渐变，标题压在上面 */
.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    90deg,
    rgb(var(--veil) / 0.94) 0%,
    rgb(var(--veil) / 0.78) 34%,
    rgb(var(--veil) / 0) 62%
  );
}

.scene--soft::before {
  background: linear-gradient(
    90deg,
    rgb(var(--veil) / 0.55) 0%,
    rgb(var(--veil) / 0.25) 40%,
    rgb(var(--veil) / 0) 60%
  );
}

.scene__content {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: calc(var(--header-height) + 48px) var(--page-gutter) 72px;
}

.scene__text {
  max-width: 600px;
}

.display {
  font-size: clamp(30px, 4.2vw, 46px);
}

.lead {
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 15px;
}

.prose-lines p + p {
  margin-top: 18px;
}

.prose-lines {
  margin-top: 28px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 2;
}

/* ---------- 左文右图的区块（产品体验、探索） ---------- */

.section {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) var(--page-gutter);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

/* 整条带底色的区块，里面再放 .section */
.band {
  background: linear-gradient(180deg, var(--surface-muted), var(--background));
}

.section__title {
  font-size: clamp(26px, 3.2vw, 36px);
}

.feature-list {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

.feature-list li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-name {
  font-size: 15px;
  color: var(--text);
}

.feature-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  line-height: 20px;
  vertical-align: 1px;
}

/* 探索：四宫格 */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
}

.gallery figure {
  margin: 0;
}

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgb(107 90 62 / 0.12);
}

.gallery figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.note {
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* 产品体验：三台手机 */
.phones {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 24px 0;
}

.phone {
  width: clamp(130px, 17vw, 210px);
  aspect-ratio: 390 / 844;
  border-radius: 30px;
  padding: 7px;
  background: #e9e4dc;
  box-shadow:
    0 0 0 1px rgb(46 52 51 / 0.18),
    0 18px 40px rgb(107 90 62 / 0.22);
  flex: none;
}

.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
}

.phone:nth-child(1) {
  transform: translateX(22%) translateY(-4%) rotate(-5deg) scale(0.88);
}

.phone:nth-child(2) {
  z-index: 1;
}

.phone:nth-child(3) {
  transform: translateX(-22%) translateY(-4%) rotate(5deg) scale(0.88);
}

/* ---------- 下载 ---------- */

.scene--download {
  align-items: flex-start;
  text-align: center;
}

.scene--download::before {
  background: linear-gradient(
    180deg,
    rgb(var(--veil) / 0.88) 0%,
    rgb(var(--veil) / 0.55) 45%,
    rgb(var(--veil) / 0.05) 80%
  );
}

.scene--download .scene__image {
  object-position: center bottom;
}

.scene--download .scene__text {
  margin: 0 auto;
  max-width: 640px;
}

.download-options {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 24px;
}

.download-buttons {
  display: grid;
  gap: 12px;
  justify-items: stretch;
}

.qr {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.qr__code {
  width: 112px;
  height: 112px;
  padding: 8px;
  background: #fffdf9;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgb(107 90 62 / 0.15);
}

.qr__code svg {
  display: block;
  width: 100%;
  height: 100%;
}

.qr figcaption {
  font-size: 12px;
  color: var(--text-secondary);
}

.download-notes {
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ---------- 关于：联系方式 ---------- */

.contact {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) var(--page-gutter);
}

.contact dl {
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 12px 28px;
  font-size: 15px;
}

.contact dt {
  color: var(--text-secondary);
}

.contact dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.contact p {
  margin-top: 28px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ---------- 法律文本 ---------- */

.legal {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px var(--page-gutter) 96px;
}

.legal__header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--divider);
}

.legal__header h1 {
  font-size: clamp(26px, 3.4vw, 34px);
}

.legal__dates {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.legal__draft {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
}

.legal__body {
  font-size: 15px;
  line-height: 1.9;
}

.legal__body h2 {
  margin-top: 48px;
  font-size: 21px;
}

.legal__body h3 {
  margin-top: 28px;
  font-size: 17px;
}

.legal__body p,
.legal__body ul,
.legal__body ol {
  margin: 14px 0 0;
}

.legal__body li + li {
  margin-top: 6px;
}

.legal__body strong {
  font-weight: 600;
}

.legal__body table {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.7;
}

.legal__body th,
.legal__body td {
  border: 1px solid var(--divider);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  min-width: 120px;
}

.legal__body th {
  background: var(--surface-muted);
  font-weight: 600;
}

/* ---------- 404 ---------- */

.not-found {
  max-width: 640px;
  margin: 0 auto;
  padding: 120px var(--page-gutter);
  text-align: center;
}

.not-found p {
  margin-top: 16px;
  color: var(--text-secondary);
}

.not-found .button-row {
  justify-content: center;
}

/* ---------- 页脚 ---------- */

.site-footer {
  border-top: 1px solid var(--divider);
  background: var(--background);
}

.site-footer__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 28px var(--page-gutter) 32px;
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 40px;
}

.brand--small {
  font-size: 15px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 13px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.tagline {
  margin-left: auto;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--text-tertiary);
}

.site-footer__record {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.site-footer__record a {
  color: inherit;
  text-decoration: none;
}

.site-footer__record a:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* ---------- 窄屏 ---------- */

/* 六个导航放不下一行时，导航换到第二行 */
@media (max-width: 1100px) {
  .site-header__inner {
    flex-wrap: wrap;
    gap: 12px 16px;
  }

  /* 网站名称太长时省略，不把语言切换挤到下一行 */
  .site-header__inner > .brand {
    flex: 1 1 0;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin: 0;
    flex-wrap: wrap;
    gap: 4px 24px;
  }

  .site-header__actions {
    margin-left: auto;
  }
}

@media (max-width: 900px) {

  .scene__content {
    padding-top: calc(var(--header-height) + 72px);
  }

  .section {
    grid-template-columns: minmax(0, 1fr);
  }

  .tagline {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .site-nav {
    gap: 4px 18px;
  }

  /* 手机上不把字压在图上：文字在上，图片在下面单独一块，主体（偏右）露出来 */
  .scene {
    min-height: 0;
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .scene::before {
    display: none;
  }

  .scene__image {
    position: static;
    z-index: auto;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .scene__content {
    padding-bottom: 32px;
  }

  .scene--download .scene__image {
    aspect-ratio: 16 / 9;
  }

  .gallery {
    gap: 12px;
  }

  /* 表格放不下时在表格内部左右滑动，不撑宽整个页面 */
  .legal__body table {
    display: block;
    overflow-x: auto;
  }

  .phone {
    width: 34vw;
    border-radius: 22px;
    padding: 5px;
  }

  .phone img {
    border-radius: 18px;
  }

  .contact dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .contact dd + dt {
    margin-top: 12px;
  }
}
