:root {
  --bg: #f2f3ef;
  --app: #f8f7f1;
  --paper: #fffef9;
  --ink: #171813;
  --muted: #70766b;
  --soft: #eef2ea;
  --line: rgba(23, 24, 19, 0.1);
  --green: #315a45;
  --green-2: #557864;
  --gold: #b88935;
  --red: #a64b3c;
  --blue: #486f90;
  --purple: #75639b;
  --shadow: 0 24px 70px rgba(22, 28, 22, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

button {
  font: inherit;
}

.gallery {
  min-height: 100vh;
  padding: 34px 32px 44px;
}

.gallery-title {
  max-width: 1240px;
  margin: 0 auto 24px;
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.gallery-title h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.gallery-title span {
  color: var(--muted);
  font-size: 14px;
}

.phone-row {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 390px);
  gap: 28px;
  align-items: start;
  justify-content: center;
}

.prototype-card {
  width: 390px;
}

.prototype-meta {
  min-height: 50px;
  padding: 0 4px 8px;
}

.prototype-meta strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0;
}

.prototype-meta span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.phone-frame {
  width: 390px;
  height: 844px;
  padding: 10px;
  border-radius: 44px;
  overflow: hidden;
  background: #181917;
  box-shadow: var(--shadow);
}

.phone-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 34px;
  overflow: hidden;
  display: block;
  background: #fff;
}

.app {
  width: 100%;
  min-height: 100vh;
  background: var(--app);
  padding-bottom: 88px;
}

.status-bar {
  height: 44px;
  padding: 13px 20px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
}

.status-icons {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 12px;
}

.top-nav {
  min-height: 66px;
  padding: 4px 18px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-nav .nav-title {
  flex: 1;
  min-width: 0;
}

.nav-title strong {
  display: block;
  font-size: 23px;
  line-height: 1.16;
  letter-spacing: 0;
}

.nav-title span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 19px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}

.content {
  padding: 0 16px;
}

.focus-card {
  margin-bottom: 12px;
  min-height: 128px;
  border-radius: 24px;
  padding: 17px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 36px rgba(31, 42, 31, 0.07);
}

.focus-card.green {
  background: linear-gradient(135deg, #315a45, #5e7f64);
  color: #fff;
}

.focus-card.blue {
  background: linear-gradient(135deg, #3f6585, #6f8c9b);
  color: #fff;
}

.focus-card.gold {
  background: linear-gradient(135deg, #8f6630, #c19a58);
  color: #fff;
}

.focus-card.red {
  background: linear-gradient(135deg, #91483e, #bd7356);
  color: #fff;
}

.focus-card.purple {
  background: linear-gradient(135deg, #67568f, #9a7b9b);
  color: #fff;
}

.focus-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.focus-kicker {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
}

.focus-card:not(.green):not(.blue):not(.gold):not(.red):not(.purple) .focus-kicker {
  color: var(--muted);
}

.focus-card h2 {
  margin: 18px 0 8px;
  font-size: 25px;
  line-height: 1.14;
  letter-spacing: 0;
}

.focus-card p {
  width: 275px;
  margin: 0;
  font-size: 13px;
  line-height: 1.42;
  color: rgba(255, 255, 255, 0.82);
}

.focus-card:not(.green):not(.blue):not(.gold):not(.red):not(.purple) p {
  color: var(--muted);
}

.memorial-scene {
  margin-bottom: 12px;
  min-height: 252px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(184, 137, 53, 0.18);
  background:
    linear-gradient(180deg, rgba(22, 16, 10, 0.08), rgba(22, 16, 10, 0.72)),
    url("assets/memorial-hall.png") center/cover;
  box-shadow: 0 16px 40px rgba(42, 29, 17, 0.18);
}

.memorial-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 38%, rgba(255, 230, 184, 0.12), rgba(10, 8, 6, 0.2) 72%);
  pointer-events: none;
}

.memorial-info {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  color: #fff;
}

.memorial-info span {
  display: block;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 700;
}

.memorial-info strong {
  display: block;
  margin-top: 5px;
  font-size: 23px;
  letter-spacing: 0;
}

.memorial-actions {
  margin-top: 12px;
  height: 44px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(18px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
}

.memorial-actions button {
  height: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
}

.section-head {
  margin: 16px 2px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-head h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.section-head span,
.section-head button {
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.module-card {
  min-height: 102px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 10px 30px rgba(31, 42, 31, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.module-card.compact {
  min-height: 82px;
}

.module-card.wide {
  grid-column: span 2;
  min-height: 86px;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.module-icon {
  width: 34px;
  height: 34px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
}

.module-icon.gold {
  background: var(--gold);
}

.module-icon.red {
  background: var(--red);
}

.module-icon.blue {
  background: var(--blue);
}

.module-icon.purple {
  background: var(--purple);
}

.module-card strong {
  font-size: 15px;
  letter-spacing: 0;
}

.module-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.quick-list {
  display: grid;
  gap: 8px;
}

.list-item {
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.93);
  display: flex;
  gap: 10px;
  align-items: center;
}

.list-item.locked {
  background: #fbf6ed;
}

.mini-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: #edf3ed;
}

.mini-icon.gold {
  color: #8f6630;
  background: #f7f0df;
}

.mini-icon.red {
  color: var(--red);
  background: #faece8;
}

.mini-icon.blue {
  color: var(--blue);
  background: #eaf0f5;
}

.list-text {
  flex: 1;
  min-width: 0;
}

.list-text strong {
  display: block;
  font-size: 14px;
  letter-spacing: 0;
}

.list-text span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chev {
  color: #b4b8b0;
}

.pill-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pill {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: #3f453e;
  font-size: 12px;
  font-weight: 650;
}

.pill.active {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat {
  min-height: 70px;
  padding: 11px 10px;
  border-radius: 17px;
  background: #fff;
  border: 1px solid var(--line);
}

.stat strong {
  display: block;
  font-size: 19px;
  letter-spacing: 0;
}

.stat span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.timeline {
  border-left: 2px solid #dfe6dc;
  margin-left: 12px;
  display: grid;
  gap: 12px;
}

.timeline-item {
  position: relative;
  padding-left: 18px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.timeline-item strong {
  display: block;
  font-size: 14px;
}

.timeline-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.tree-board {
  height: 330px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.tree-board.editor {
  background:
    linear-gradient(180deg, rgba(248, 251, 245, 0.94), rgba(255, 255, 255, 0.98)),
    radial-gradient(circle at 50% 24%, rgba(184, 137, 53, 0.09), transparent 44%);
}

.tree-node {
  width: 86px;
  height: 56px;
  border: 1px solid rgba(49, 90, 69, 0.16);
  border-radius: 16px;
  background: #f8fbf5;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 5px;
  position: relative;
  z-index: 1;
  box-shadow: 0 8px 20px rgba(37, 49, 39, 0.05);
}

.tree-board.editor .tree-node {
  position: absolute;
}

.tree-node.editing {
  border-color: rgba(184, 137, 53, 0.68);
  background: #fffaf0;
  box-shadow: 0 10px 26px rgba(184, 137, 53, 0.17);
}

.tree-node.main {
  width: 96px;
  background: #eef5eb;
  border-color: rgba(49, 90, 69, 0.3);
}

.tree-node .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
}

.tree-node span {
  font-size: 12px;
  font-weight: 750;
}

.editor-line {
  position: absolute;
  z-index: 0;
  background: #cdd9cd;
}

.editor-line.x {
  height: 2px;
}

.editor-line.y {
  width: 2px;
}

.node-grandpa {
  left: 54px;
  top: 22px;
}

.node-grandma {
  left: 188px;
  top: 22px;
}

.node-parent {
  left: 38px;
  top: 136px;
}

.node-uncle {
  left: 126px;
  top: 136px;
}

.node-aunt {
  left: 214px;
  top: 136px;
}

.node-child-a {
  left: 38px;
  top: 248px;
}

.node-child-b {
  left: 142px;
  top: 248px;
}

.add-handle {
  position: absolute;
  z-index: 3;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(90, 61, 21, 0.24);
  font-size: 12px;
}

.add-handle::after {
  position: absolute;
  padding: 4px 7px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(184, 137, 53, 0.24);
  color: #5c421e;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(61, 43, 18, 0.09);
}

.add-handle.parents {
  left: 50%;
  top: -36px;
  transform: translateX(-50%);
}

.add-handle.parents::after {
  content: "父母";
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
}

.add-handle.spouse {
  right: -42px;
  top: 50%;
  transform: translateY(-50%);
}

.add-handle.spouse::after {
  content: "配偶";
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
}

.add-handle.child {
  left: 50%;
  bottom: -36px;
  transform: translateX(-50%);
}

.add-handle.child::after {
  content: "子女";
  left: 50%;
  top: 30px;
  transform: translateX(-50%);
}

.add-handle.sibling {
  left: -42px;
  top: 50%;
  transform: translateY(-50%);
}

.add-handle.sibling::after {
  content: "兄弟姐妹";
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
}

.merge-card {
  margin-top: 12px;
  min-height: 72px;
  border: 1px solid rgba(184, 137, 53, 0.24);
  border-radius: 19px;
  background: linear-gradient(135deg, #fffaf0, #fff);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 28px rgba(89, 68, 37, 0.08);
}

.merge-card .module-icon {
  flex: 0 0 auto;
}

.merge-card strong {
  display: block;
  font-size: 15px;
}

.merge-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.merge-action {
  margin-left: auto;
  flex: 0 0 auto;
  height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 17px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
}

.chat-box {
  min-height: 348px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.45;
}

.bubble.ai {
  background: #eef4ef;
}

.bubble.me {
  justify-self: end;
  background: var(--green);
  color: #fff;
}

.input-bar {
  min-height: 46px;
  border-radius: 23px;
  background: #f4f5f2;
  display: flex;
  align-items: center;
  padding: 0 8px 0 14px;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.input-bar i:last-child {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
}

.bottom-tab {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 10px;
  height: 68px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(22px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  box-shadow: 0 14px 36px rgba(16, 24, 16, 0.12);
}

.tab-item {
  display: grid;
  place-items: center;
  gap: 4px;
  color: #8b9088;
  font-size: 10px;
  font-weight: 650;
}

.tab-item i {
  font-size: 18px;
}

.tab-item.active {
  color: var(--green);
}

.tab-item.active i {
  width: 34px;
  height: 28px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #edf3ed;
}

@media (max-width: 1220px) {
  .phone-row {
    grid-template-columns: 390px;
  }
}
