/*
 * 四十周 · 网站共用样式
 *
 * 颜色全部照搬 App 里的 FW 主题（composeApp/.../ui/theme/Theme.kt），
 * 落地页和 App 要看上去是同一个东西。改 App 配色时这里一起改。
 *
 * 气质：一本印出来的孕期手帐。米色纸底、宋体、克制的分类色。
 */

:root {
  --paper: #FBF7F3;
  --card: #FFFDFB;
  --ink: #2E2A27;
  --ink2: #7D736A;
  --ink3: #A79C92;
  --line: #EFE9E2;
  --track: #F4EFEA;
  --accent: #B5705F;
  --accent-soft: #F6EAE5;

  /* 分类色：产检 / 筛查 / 化验 / 手续 / 日常 / 准备 */
  --c-checkup: #B5705F;
  --c-screening: #8B7AA8;
  --c-lab: #6B8CAE;
  --c-admin: #8A8578;
  --c-daily: #7A9E8E;
  --c-prep: #C99856;

  --serif: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", "SimSun", serif;
  --display: "Fraunces", "Noto Serif SC", "Songti SC", Georgia, serif;

  --gutter: clamp(20px, 5vw, 56px);
  --max: 1080px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  /*
   * 纸纹直接铺在背景里，不单独叠一层。
   * 原来是一层固定定位、带正片叠底混合模式的覆盖层，
   * 在 Chrome 里会让页面往下滚之后整片不渲染（深色区块、免责声明全是空白）。
   */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .18 0 0 0 0 .16 0 0 0 0 .15 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ------------------------------------------------------------------ 顶栏 */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.04em;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px var(--line);
}

.nav-links {
  display: flex;
  gap: clamp(14px, 3vw, 28px);
  font-size: 14px;
  color: var(--ink2);
}

.nav-links a { text-decoration: none; }

/* ------------------------------------------------------------------ 首屏 */

.hero {
  position: relative;
  /* 背后的大「40」故意往右伸出去一点，裁掉横向多出的部分，不然窄一点的屏幕会出现左右滚动。
     用 clip 不用 hidden：只裁横向，下方时间轴卡片的阴影不受影响 */
  overflow-x: clip;
  padding-block: clamp(36px, 7vw, 88px) clamp(40px, 6vw, 72px);
}

/* 背后那个很大的 40 —— 整页唯一的装饰 */
.hero-forty {
  position: absolute;
  right: calc(var(--gutter) * -0.4);
  top: clamp(-10px, -1vw, 0px);
  font-family: var(--display);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-weight: 300;
  font-size: clamp(200px, 38vw, 460px);
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.2px color-mix(in srgb, var(--accent) 26%, transparent);
  user-select: none;
  pointer-events: none;
  z-index: 0;
}

.hero > *:not(.hero-forty) { position: relative; z-index: 1; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
  color: var(--ink2);
  letter-spacing: 0.02em;
}

.eyebrow::before {
  content: "";
  width: 36px;
  height: 1px;
  background: var(--accent);
}

.hero h1 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(46px, 8.4vw, 104px);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.lede {
  max-width: 30em;
  margin: 28px 0 0;
  font-size: clamp(17px, 1.9vw, 20px);
  line-height: 1.95;
  color: var(--ink2);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 34px;
}

/* 还没上架，先不放苹果的官方徽章 —— 上架后换成官方下载徽章并加链接 */
.store-soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.store-soon svg { width: 16px; height: 16px; fill: currentColor; }

.cta-note {
  font-size: 14px;
  color: var(--ink3);
  letter-spacing: 0.06em;
}

/* ------------------------------------------------------------------ 四十周时间轴 */

.axis {
  margin: clamp(44px, 6vw, 72px) 0 0;
  padding: clamp(20px, 3vw, 34px) clamp(16px, 3vw, 36px) clamp(18px, 2.4vw, 26px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 1px 0 rgba(46, 42, 39, 0.03), 0 30px 60px -40px rgba(46, 42, 39, 0.35);
  --name: 5.4em;
  --pad: 2.6em;
}

.axis-grid {
  position: relative;
  display: grid;
  grid-template-columns: var(--name) 1fr;
  row-gap: 11px;
  font-size: 13px;
}

/* 刻度、孕期三段、每条事项，右边那一列都用同一个「内框」定位，保证对得齐 */
.axis-row-name {
  align-self: center;
  color: var(--ink2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inner {
  position: relative;
  margin-inline: var(--pad);
  height: 100%;
}

.ruler span {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  font-family: var(--display);
  font-size: 12px;
  color: var(--ink3);
  font-variant-numeric: tabular-nums;
}

.trimesters {
  display: flex;
  height: 24px;
  border-radius: 7px;
  overflow: hidden;
  font-size: 12px;
  color: var(--ink2);
}

.trimesters span {
  flex: 1;
  display: grid;
  place-items: center;
  background: var(--track);
}
.trimesters span + span { border-left: 2px solid var(--card); }

.lane { height: 22px; }

.lane .band {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 999px;
  background: var(--c);
  opacity: 0.9;
  transform-origin: left center;
  animation: grow 0.9s cubic-bezier(0.2, 0.75, 0.2, 1) both;
  animation-delay: calc(var(--i) * 110ms + 250ms);
}

/* 轨道本身（.lane 和 .inner 是同一个元素） */
.lane::before {
  content: "";
  position: absolute;
  inset: 3px 0;
  border-radius: 999px;
  background: var(--track);
}

/* 起止周数贴在色块左右两端的外侧 —— 和 App 里窗口窄时的摆法一样，永远不会压到色块 */
.lane .wk {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  color: var(--c);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  /* 「今天」「预产期」两根竖线会穿过周数，让字画在线上面。不垫底色 —— 垫了会在轨道上挖出缺口 */
  z-index: 2;
  animation: fade 0.6s ease both;
  animation-delay: calc(var(--i) * 110ms + 750ms);
}

.lane .wk.s { transform: translate(calc(-100% - 7px), -50%); }
.lane .wk.e { transform: translate(7px, -50%); }

/* 预产期和「今天」两根竖线，贯穿所有行。字标在最上面那一行，刻度在最下面，互相不压 */
.marks {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 30px;
  left: var(--name);
  right: 0;
  pointer-events: none;
}

.marks .inner { position: absolute; inset: 0 var(--pad); margin: 0; height: auto; }

.edd,
.today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
}

.edd span,
.today span {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(-50%);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.edd span { color: var(--accent); }

.edd::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 0;
  left: -0.5px;
  border-left: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
}

.today { animation: slide 1.5s cubic-bezier(0.25, 0.8, 0.25, 1) both 0.2s; }

.today span { font-weight: 600; color: var(--ink2); }

/* 小三角指下来，和 App 详情页里的「今天」一样 */
.today::after {
  content: "";
  position: absolute;
  top: 16px;
  left: -5px;
  border: 5px solid transparent;
  border-top: 6px solid var(--ink2);
  border-bottom: 0;
}

.today::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 0;
  left: -0.5px;
  border-left: 1px solid color-mix(in srgb, var(--ink2) 55%, transparent);
}

.ruler { height: 22px; }

.axis figcaption {
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink3);
}

@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide { from { left: 0; opacity: 0; } 15% { opacity: 1; } }

/* ------------------------------------------------------------------ 它和普通日历不一样的地方 */

.section {
  padding-block: clamp(64px, 9vw, 120px);
}

.principles {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
  gap: clamp(28px, 6vw, 88px);
  align-items: start;
}

.section-head {
  position: sticky;
  top: 32px;
}

.section-head h2 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.3;
}

.section-head p {
  margin: 18px 0 0;
  color: var(--ink2);
  font-size: 16px;
}

.items { list-style: none; margin: 0; padding: 0; }

.item {
  display: grid;
  grid-template-columns: 3.2em 1fr;
  column-gap: 8px;
  padding-block: 30px;
  border-top: 1px solid var(--line);
}
.item:last-child { border-bottom: 1px solid var(--line); }

.item-no {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.5;
  color: var(--accent);
}

.item h3 {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: clamp(21px, 2.3vw, 25px);
  line-height: 1.45;
}

.item p {
  margin: 0;
  color: var(--ink2);
}

/* 用 HTML 照着 App 画的小样，不用截图 —— 截图等准备商店素材时统一出 */
.mock {
  margin-top: 22px;
  max-width: 380px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.8;
  box-shadow: 0 20px 40px -34px rgba(46, 42, 39, 0.5);
}

.mock .mock-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.mock-box {
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink2);
}
.mock .mock-box p:not(.mock-label) { margin: 0; color: var(--ink2); }

.mock-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.mock-choices span {
  padding: 9px 4px;
  text-align: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.mock-choices .on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.mock .mock-age { margin: 0; font-size: 12px; color: var(--ink3); }

.mock .mock-writing {
  min-height: 64px;
  margin: 6px 0 14px;
  font-size: 15px;
  color: var(--ink);
}

.mock-writing i {
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.mock-moods {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.mock-moods span {
  display: grid;
  place-items: center;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 18px;
}

.mock-moods .on {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ------------------------------------------------------------------ 数据归你 */

.own {
  background: var(--ink);
  color: #F3ECE5;
}

.own .inner-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: end;
}

.own h2 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(36px, 5.6vw, 64px);
  line-height: 1.2;
}

.own h2 em { font-style: normal; color: #E0A48F; }

.own .intro {
  margin: 24px 0 0;
  color: #BFB3A8;
  font-size: 17px;
}

.own ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.own li {
  position: relative;
  padding: 14px 0 14px 26px;
  border-top: 1px solid rgba(243, 236, 229, 0.12);
  color: #E7DED6;
}

.own li:last-child { border-bottom: 1px solid rgba(243, 236, 229, 0.12); }

.own li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.45em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #E0A48F;
}

.own .more {
  display: inline-block;
  margin-top: 22px;
  color: #E0A48F;
  font-size: 15px;
}

/* ------------------------------------------------------------------ 写在前面 */

.note {
  padding: clamp(22px, 3vw, 32px) clamp(20px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.note h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.note p { margin: 0; color: var(--ink2); font-size: 15.5px; }

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

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding-block: 32px 44px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink3);
}

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

.footer-links a { text-decoration: none; }

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

.doc {
  max-width: 740px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) var(--gutter) 40px;
}

.doc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(36px, 6vw, 64px);
  font-size: 14px;
  color: var(--ink2);
}

.doc h1 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(34px, 5.4vw, 50px);
  line-height: 1.2;
}

.doc .meta {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--ink3);
}

.doc h2 {
  margin: 52px 0 14px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.5;
}

.doc h3 { margin: 26px 0 8px; font-size: 18px; font-weight: 600; }

.doc p, .doc li { color: #4A443F; }
.doc p { margin: 12px 0; }
.doc ul { margin: 12px 0; padding-left: 1.3em; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--accent); }
.doc strong { color: var(--ink); font-weight: 600; }

.summary {
  margin: 32px 0 0;
  padding: 20px 22px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}

.summary p { margin: 0; color: var(--ink); }
.summary p + p { margin-top: 10px; }

.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.doc table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.75;
}

.doc th, .doc td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.doc tr:last-child td { border-bottom: 0; }
.doc th { font-weight: 600; color: var(--ink2); font-size: 13.5px; background: var(--paper); }

/* 上线前必须替换的占位符，故意做得很显眼，免得漏改就发出去 */
.todo {
  padding: 1px 6px;
  border-radius: 5px;
  background: #FFF1B8;
  color: #7A5B00;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.86em;
  white-space: nowrap;
}

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

@media (max-width: 760px) {
  .principles,
  .own .inner-wrap { grid-template-columns: 1fr; }

  .section-head { position: static; }

  .axis { --name: 3.3em; --pad: 2.3em; }
  .axis-grid { font-size: 12px; row-gap: 10px; }
  .ruler .minor { display: none; }
  .trimesters { font-size: 11px; }
  .lane .wk { font-size: 11px; }
  .hero-forty { top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
  }
}

/* ------------------------------------------------------------------ 英文页 */

/* 英文正文用 Fraunces：它有光学尺寸轴，小字号下会自动换成适合正文的字形 */
html[lang="en"] body {
  font-family: var(--display);
  font-variation-settings: "SOFT" 0, "WONK" 0;
  line-height: 1.7;
}

html[lang="en"] .doc h1 { font-weight: 600; letter-spacing: -0.02em; }
html[lang="en"] .doc h2 { font-weight: 600; }
