/* Hallmark · brand mode (mylpti tokens as base) × Impeccable craft-floor applied
 * A 版 · 线条小狗风 — user brief 2026-11-18: each sign gets a cute line-art icon.
 * World: sticker line-art. Warm paper lifted from mylpti, near-black rounded
 * line work, flat candy accents, drawn icon system (icons/ + hero-dogs).
 * Type scale steps >= 1.25 (Impeccable typeset note); body contrast >= 4.5:1. */

:root {
  --paper: #FFFBF3;
  --card: #FFFFFF;
  --ink: #33302E;
  --ink-2: #5C554F;
  --muted: #8A7D72;
  --line-soft: #F1E2D2;
  --pink: #FF8FAB;
  --pink-deep: #E14E78;
  --link: #B23A5E;
  --pink-soft: #FFE0E8;
  --yellow: #FFDF8E;
  --yellow-soft: #FFF3D6;
  --cream: #FFF6EA;
  --shadow-pop: 5px 5px 0 #F3DFC9;
  --serif: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.75;
  background-image: radial-gradient(#F3E3CF 1.5px, transparent 1.5px);
  background-size: 26px 26px;
}
a { color: var(--link); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--pink-deep); outline-offset: 2px; border-radius: 6px;
}
::selection { background: var(--pink-soft); }
.shell { max-width: 720px; margin: 0 auto; padding: 0 16px 64px; }

/* ---------- chrome ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  column-gap: 12px; padding: 18px 0 6px; font-size: 13.5px;
}
.topbar .brand { font-family: var(--serif); font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; white-space: nowrap; flex: none; }
.topbar .brand::before { content: "✦ "; color: var(--pink-deep); }
.topbar nav a { margin-left: 16px; text-decoration: none; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.topbar nav a.active { color: var(--ink); font-weight: 800; border-bottom: 3px solid var(--pink); padding-bottom: 2px; }
.breadcrumb { font-size: 13.5px; color: var(--muted); padding-top: 14px; }
.breadcrumb a { text-decoration: none; color: var(--ink-2); font-weight: 600; }
footer.site { margin-top: 56px; padding: 26px 0 8px; font-size: 13.5px; color: var(--muted); text-align: center; }
footer.site::before { content: "✦ ✦ ✦"; display: block; color: var(--pink-deep); letter-spacing: .6em; margin-bottom: 12px; font-size: 11px; }
footer.site a { margin: 0 8px; color: var(--ink-2); font-weight: 600; text-decoration: none; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 26px 0 4px; }
.hero-frame {
  background: linear-gradient(160deg, #FFF9EE 0%, var(--pink-soft) 130%);
  border: 2px solid var(--ink); border-radius: 28px;
  box-shadow: var(--shadow-pop); padding: 30px 26px 34px;
}
.hero-dogs { display: block; width: min(320px, 82%); height: auto; margin: 0 auto 6px; }
.hero h1 {
  font-family: var(--serif); font-weight: 900; font-size: clamp(32px, 6vw, 44px);
  line-height: 1.3; margin: 6px 0 10px; overflow-wrap: break-word; min-width: 0;
}
.hero p { margin: 0 auto; max-width: 34em; color: var(--ink-2); font-size: 15.5px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; cursor: pointer; text-decoration: none;
  font-family: var(--sans); font-size: 17px; font-weight: 800; color: #fff;
  background: var(--ink); border: 2px solid var(--ink);
  padding: 13px 40px; border-radius: 999px;
  box-shadow: 4px 4px 0 #FFC7D1;
  transition: transform .16s ease, box-shadow .16s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #FFC7D1; }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #FFC7D1; }
.btn.secondary {
  background: var(--card); color: var(--ink); font-size: 15.5px; padding: 10px 30px;
  box-shadow: 4px 4px 0 var(--line-soft);
}
.btn.secondary:hover { background: var(--yellow-soft); }
.action-row { text-align: center; margin: 32px 0 6px; }
.action-row .hint { color: var(--muted); font-size: 14px; margin: 0 0 14px; }

/* ---------- picker ---------- */
.picker-card {
  background: var(--card); border: 2px solid var(--ink); border-radius: 26px;
  padding: 24px 24px 20px; margin-top: 22px; box-shadow: var(--shadow-pop);
}
.picker-card h2 { font-family: var(--serif); font-weight: 900; font-size: 25px; margin: 0 0 4px; }
.picker-card .hint { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.sign-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.sign-btn {
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  border-radius: 22px; padding: 12px 4px 10px; cursor: pointer; position: relative;
  font-family: var(--sans); text-align: center;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
/* four elements, four candy tints — zodiac order cycles fire/earth/air/water */
.sign-btn:nth-child(4n+1) { background: #FFE9DC; }
.sign-btn:nth-child(4n+2) { background: #E1F2DF; }
.sign-btn:nth-child(4n+3) { background: #DFEFFB; }
.sign-btn:nth-child(4n) { background: #ECE4FB; }
.sign-btn:hover { transform: translateY(-3px); box-shadow: 3px 3px 0 rgba(51, 48, 46, .8); }
.sign-btn .sign-icon {
  display: block; width: 84px; height: 84px; object-fit: contain; margin: 0 auto 4px;
  background: #fff; border: 2px solid var(--ink); border-radius: 50%; padding: 6px;
}
.sign-btn:hover .sign-icon, .sign-btn:focus-visible .sign-icon { animation: wiggle .5s ease; }
@keyframes wiggle {
  0%, 100% { transform: rotate(0) scale(1); }
  25% { transform: rotate(-5deg) scale(1.07); }
  75% { transform: rotate(5deg) scale(1.07); }
}
.sign-btn .sname { display: block; font-size: 16px; font-weight: 800; }
.sign-btn .sdates { display: block; font-size: 11.5px; color: var(--ink-2); }
.sign-btn[aria-pressed="true"] {
  border-color: var(--ink); background: var(--yellow);
  box-shadow: 3px 3px 0 var(--pink-deep);
}
.sign-btn[aria-pressed="true"] .sign-icon { border-color: var(--pink-deep); }
.sign-btn[aria-pressed="true"]::after {
  content: "♥"; position: absolute; top: 5px; right: 9px; color: var(--pink-deep); font-size: 13px;
}
.birthday-row { margin-top: 16px; font-size: 14px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.birthday-row input {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  padding: 6px 14px; border: 2px solid var(--line-soft); border-radius: 999px; background: var(--card);
}
.chips { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 4px; }
.chip {
  border: 2px solid var(--line-soft); background: var(--card); color: var(--ink-2);
  border-radius: 999px; padding: 7px 18px; cursor: pointer;
  font-family: var(--sans); font-size: 14px; font-weight: 700;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- result hero ---------- */
.score-panel {
  margin-top: 26px; border: 2.5px solid var(--ink); border-radius: 28px;
  text-align: center; padding: 34px 24px 32px; background: var(--cream);
  box-shadow: 6px 6px 0 var(--tone-soft, #FFC7D1);
}
.score-panel .versus { color: var(--ink-2); font-size: 14px; margin: 0; }
.pair-fig { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 16px 0 4px; }
.pair-fig img {
  width: 96px; height: 96px; object-fit: contain; background: #fff;
  border: 2px solid var(--ink); border-radius: 50%; padding: 6px;
}
.pair-fig .pair-heart { color: var(--pink-deep); font-size: 26px; }
.score-panel .cp {
  font-family: var(--serif); font-weight: 900; font-size: clamp(28px, 5vw, 38px);
  margin: 10px 0 0; color: var(--ink);
}
.score-panel .total {
  width: 138px; height: 138px; margin: 18px auto 4px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; gap: 2px;
  background: var(--pink); border: 2.5px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(51, 48, 46, .85);
  font-family: var(--serif); font-weight: 900; font-size: 52px; line-height: 1; color: #fff;
}
.score-panel .total small { font-size: 17px; font-family: var(--sans); font-weight: 700; }
.score-panel .grade {
  display: inline-block; font-size: 16px; font-weight: 800; color: var(--ink);
  background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px;
  padding: 4px 20px; margin: 12px 0 6px;
}
.status-metric {
  margin: 14px auto 4px; max-width: 430px; background: #fff;
  border: 2px solid var(--ink); border-radius: 20px; padding: 12px 18px 10px;
  box-shadow: 3px 3px 0 var(--pink);
}
.status-metric .sm-label { display: block; font-size: 13.5px; font-weight: 800; color: var(--ink-2); }
.status-metric .sm-score {
  display: block; font-family: var(--serif); font-weight: 900; font-size: 40px;
  line-height: 1.15; color: var(--pink-deep);
}
.status-metric .sm-score small { font-size: 15px; font-family: var(--sans); font-weight: 700; }
.status-metric .sm-note { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
/* Status-first hero (fix: 状态分升为顶部主角): the per-status metric is now
 * the BIG circle at the top of the result; the pair index total is demoted
 * to a small secondary circle. Each relationship status tints the panel via
 * --tone / --tone-soft, so switching status changes the biggest number, its
 * label AND the panel colour at once. The panel still pulses on switch. */
.score-panel.rel-crush   { --tone: #FF8A5C; --tone-soft: #FFD9C4; }
.score-panel.rel-love    { --tone: #FF7D9C; --tone-soft: #FFC7D1; }
.score-panel.rel-reunion { --tone: #9B7EDE; --tone-soft: #DCCFFA; }
.score-panel.rel-friend  { --tone: #4CAF7D; --tone-soft: #CDEEDD; }
.hero-score { margin-top: 6px; }
.hero-score .hero-num {
  width: 156px; height: 156px; margin: 16px auto 4px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; gap: 2px;
  background: var(--tone, var(--pink)); border: 2.5px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(51, 48, 46, .85);
  font-family: var(--serif); font-weight: 900; font-size: 58px; line-height: 1; color: #fff;
}
.hero-score .hero-num small { font-size: 18px; font-family: var(--sans); font-weight: 700; }
.hero-score .hero-label {
  display: inline-block; font-size: 17px; font-weight: 800; color: var(--ink);
  background: var(--tone-soft, #FFC7D1); border: 2px solid var(--ink); border-radius: 999px;
  padding: 5px 22px; margin: 12px 0 6px;
}
.hero-score .hero-note { display: block; max-width: 430px; margin: 4px auto 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.score-sub {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 18px auto 2px; max-width: 430px;
  border-top: 2px dashed var(--line-soft); padding-top: 14px;
}
.score-sub .sub-circle {
  width: 62px; height: 62px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; gap: 1px;
  background: #fff; border: 2px dashed var(--ink);
  font-family: var(--serif); font-weight: 900; font-size: 21px; line-height: 1; color: var(--ink-2);
}
.score-sub .sub-circle small { font-size: 11px; font-family: var(--sans); font-weight: 700; }
.score-sub .sub-info { text-align: left; }
.score-sub .sub-grade { display: block; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.score-sub .sub-label { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
@keyframes panelFlash {
  0% { box-shadow: 0 0 0 0 rgba(255, 216, 77, 0), 6px 6px 0 var(--tone-soft, #FFC7D1); }
  30% { box-shadow: 0 0 0 7px #FFD84D, 6px 6px 0 var(--tone-soft, #FFC7D1); }
  100% { box-shadow: 0 0 0 0 rgba(255, 216, 77, 0), 6px 6px 0 var(--tone-soft, #FFC7D1); }
}
@keyframes circlePop {
  0% { transform: scale(.8); }
  55% { transform: scale(1.09); }
  100% { transform: scale(1); }
}
.score-panel.flash { animation: panelFlash .9s ease; }
.score-panel.flash .hero-score .hero-num { animation: circlePop .6s ease; }
.dims-appendix { opacity: .92; }

/* ---------- result sections ---------- */
.b-section {
  background: var(--card); border: 2px solid var(--ink); border-radius: 24px;
  padding: 24px 26px 20px; margin-top: 20px; box-shadow: var(--shadow-pop); color: var(--ink);
}
.b-section h2 {
  font-family: var(--serif); font-weight: 900; font-size: 25px; margin: 0 0 12px;
  display: flex; gap: 11px; align-items: center;
}
.b-section h3 { font-family: var(--serif); font-weight: 900; font-size: 19px; margin: 20px 0 8px; color: var(--ink); }
.b-section h2 .no {
  font-family: var(--sans); font-size: 12px; font-weight: 800; color: #fff;
  background: var(--ink); border-radius: 999px; padding: 3px 11px; letter-spacing: .06em;
}
.b-section p { margin: 0 0 10px; color: var(--ink-2); }
.b-section ul { margin: 0; padding: 0; list-style: none; }
.b-section li { margin: 0 0 10px; padding-left: 26px; position: relative; color: var(--ink-2); }
.b-section li::before { content: "♥"; position: absolute; left: 2px; top: 1px; color: var(--pink-deep); font-size: 13px; }
.dim-row { display: grid; grid-template-columns: 5.5em 1fr 2.8em; gap: 12px; align-items: center; margin-bottom: 12px; font-size: 14.5px; }
.dim-row > span:first-child { font-weight: 700; }
.dim-row > span:last-child { font-weight: 800; color: var(--pink-deep); text-align: right; }
.dim-track { background: #F6E9DC; height: 14px; border-radius: 999px; overflow: hidden; border: 1.5px solid var(--line-soft); }
.dim-fill { height: 100%; border-radius: 999px; background: var(--pink); }
.dim-row.top .dim-fill { background: var(--pink-deep); }
.dim-row.low .dim-fill { background: #D9BBA8; }

/* ---------- sign profiles ---------- */
.sign-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.sign-card {
  background: var(--card); border: 2px solid var(--ink); border-radius: 22px;
  padding: 18px 20px 12px; box-shadow: var(--shadow-pop);
}
.sign-card h3 { font-family: var(--serif); font-weight: 900; font-size: 20px; margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
.sign-card .sign-icon {
  width: 56px; height: 56px; object-fit: contain; flex: none;
  background: #fff; border: 2px solid var(--ink); border-radius: 50%; padding: 4px;
}
.sign-card .glyph-sm { color: var(--muted); font-size: 15px; }
.sign-card p { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }
.mark { background: var(--pink-soft); border-radius: 6px; padding: 0 5px; color: var(--link); font-weight: 700; }

/* ---------- faq / related / promo ---------- */
.faq dt { font-weight: 800; margin-top: 16px; }
.faq dt::before { content: "Q "; color: var(--pink-deep); font-family: var(--serif); }
.faq dd { margin: 4px 0 0; color: var(--ink-2); }
.related { display: flex; flex-wrap: wrap; gap: 9px; }
.related a {
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-decoration: none;
  border: 2px solid var(--line-soft); border-radius: 999px; padding: 6px 15px; background: var(--card);
  transition: border-color .16s ease, background .16s ease;
}
.related a:hover { border-color: var(--ink); background: var(--yellow-soft); color: var(--ink); }
.cross-promo {
  border: 2px solid var(--ink); border-radius: 24px; text-align: center;
  background: var(--yellow-soft); padding: 30px 24px; margin-top: 24px; box-shadow: var(--shadow-pop);
}
.cross-promo h2 { font-family: var(--serif); font-weight: 900; font-size: 25px; margin: 0 0 8px; }
.cross-promo p { color: var(--ink-2); margin: 0 0 18px; font-size: 15px; }

/* ---------- hub matrix ---------- */
.matrix-wrap { overflow-x: auto; margin-top: 20px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.matrix-hint { display: none; }
table.matrix { border-collapse: separate; border-spacing: 4px; width: 100%; min-width: 612px; font-size: 13px; }
table.matrix th { font-weight: 800; color: var(--ink-2); padding: 3px 1px; text-align: center; white-space: nowrap; }
table.matrix th:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--card); min-width: 52px;
  box-shadow: 6px 0 6px -6px rgba(51, 48, 46, .45);
}
table.matrix td { padding: 0; text-align: center; }
table.matrix td a {
  text-decoration: none; color: var(--ink-2); display: block; padding: 6px 0;
  font-weight: 700; border-radius: 11px; border: 1.5px solid var(--line-soft); background: #FFFDF8;
  transition: transform .14s ease, border-color .14s ease;
}
table.matrix td a:hover { transform: scale(1.1); border-color: var(--ink); }
table.matrix td.s-high { background: transparent; }
table.matrix td.s-high a { background: var(--pink); border-color: var(--ink); color: #fff; }
table.matrix td.s-mid a { background: var(--yellow-soft); }
table.matrix td.s-low a { background: #FAF3EA; color: var(--muted); }

@media (max-width: 560px) {
  .sign-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sign-btn .sign-icon { width: 62px; height: 62px; }
  .sign-cards { grid-template-columns: minmax(0, 1fr); }
  .b-section { padding: 20px 18px 16px; }
  .b-section h2 { font-size: 22px; }
  .b-section h2 .no { flex: none; }
  .picker-card { padding: 20px 16px 16px; }
  .score-panel { padding: 26px 16px 24px; }
  .pair-fig img { width: 78px; height: 78px; }
  .score-panel .total { width: 120px; height: 120px; font-size: 46px; }
  .birthday-row label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 100%; }
  .birthday-row input { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none; animation: none; }
}

/* 语言切换键（三语互跳，与主站切换键同一组文案） */
.lang-switch { display: inline-flex; gap: 4px; margin-left: 18px; flex: none; }
.lang-switch a {
  text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 13px; white-space: nowrap; flex: none;
  padding: 3px 9px; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff;
}
.lang-switch a[aria-current="true"] { background: var(--yellow, #ffd94d); color: var(--ink); box-shadow: 2px 2px 0 var(--pink-deep); }

/* 顶栏响应式（2026-11-19，用户 iPhone 14 实测截图反馈）：
 * 原单行 flex 把 brand + 4 导航 + 3 语言键全挤在 390px 里，导航折成
 * 3 行与 logo 重叠、语言键被挤成逐字竖排。本节起顶栏分工：
 * >=768px（iPad 竖屏起 / 桌面）：维持单行，只给英文收紧字号间距；
 * <=767px（全部 iPhone 竖屏 320-440、iPad mini 竖屏、折叠小屏）：
 * 改两行——第一行 brand 左 + 语言键右（横排胶囊，永不折字），
 * 第二行导航占满整行均分、每词不折行，与用户确认的模板一致。 */
@media (min-width: 768px) {
  html[lang="en"] .topbar nav a { font-size: 11.5px; margin-left: 10px; letter-spacing: -0.01em; }
}
@media (max-width: 767px) {
  .topbar { flex-wrap: wrap; row-gap: 0; padding-top: 14px; }
  .topbar .brand { order: 1; }
  .topbar .lang-switch { order: 2; margin-left: auto; }
  .topbar nav {
    order: 3; flex: 1 1 100%; display: flex; justify-content: space-between;
    align-items: center; gap: 6px; flex-wrap: wrap; row-gap: 6px;
    margin-top: 11px; padding-top: 10px; border-top: 1.5px dashed var(--line-soft);
  }
  .topbar nav a { margin-left: 0; }
  /* 英文导航文案最长：小字紧排，390px 以下放不下时整齐折成 2+2，
   * 而不是逐词竖折；中日文案短，保持正文字号单行均分。 */
  html[lang="en"] .topbar nav { font-size: 11px; line-height: 1.5; letter-spacing: -0.01em; }
  /* 英文四词总宽超过任何手机屏宽，flex 均分会折成 3+1 的零散行；
   * 改 2×2 网格，左右两列对齐，当前页下划线只跟文字宽。 */
  html[lang="en"] .topbar nav { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 7px; }
  html[lang="en"] .topbar nav a { justify-self: start; }
  html[lang="en"] .topbar nav a:nth-child(even) { justify-self: end; }
  .matrix-hint { display: block; font-size: 12.5px; color: var(--muted); margin: 10px 0 -8px; }
}
