:root {
  color-scheme: light;
  --bg: #f7f3eb;
  --bg-cool: #eef6f8;
  --surface: rgba(255, 253, 248, 0.82);
  --surface-2: rgba(239, 247, 246, 0.78);
  --surface-3: rgba(246, 239, 239, 0.68);
  --ink: #314047;
  --muted: #7e9094;
  --soft: #9fb8bc;
  --blue: #a9cdda;
  --blue-2: #cfe6ec;
  --green: #b7cabe;
  --green-2: #dce8df;
  --pink: #ead1d7;
  --cream: #fffaf0;
  --line: rgba(103, 127, 132, 0.16);
  --line-strong: rgba(103, 127, 132, 0.24);
  --shadow: 0 20px 58px rgba(108, 127, 132, 0.16);
  --shadow-soft: 0 10px 30px rgba(108, 127, 132, 0.12);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 18% 8%, rgba(207, 230, 236, 0.8), transparent 260px),
    radial-gradient(circle at 88% 16%, rgba(234, 209, 215, 0.72), transparent 230px),
    radial-gradient(circle at 60% 78%, rgba(220, 232, 223, 0.76), transparent 300px),
    linear-gradient(180deg, var(--bg-cool) 0%, var(--bg) 58%, #f5eee3 100%);
  color: var(--ink);
}

body {
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.52), rgba(255,255,255,0.22)),
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.46) 0 1px, transparent 1px);
  background-size: auto, 42px 42px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  min-height: 48px;
  border: 0;
  cursor: pointer;
}

button:disabled {
  opacity: 0.62;
  cursor: wait;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 18px calc(98px + var(--safe-bottom));
}

.page {
  min-height: 100vh;
  padding: 18px 0 0;
}

.phone-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 18px;
  color: rgba(80, 100, 105, 0.62);
  font-size: 12px;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 440px;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 28px 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.74), transparent 150px),
    linear-gradient(145deg, rgba(255, 253, 248, 0.88), rgba(238, 247, 248, 0.82) 48%, rgba(246, 239, 239, 0.72));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero::before,
.hero::after,
.mine-map::after,
.progress-ring::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
}

.hero::before {
  width: 260px;
  height: 260px;
  right: -118px;
  top: -94px;
  background: rgba(169, 205, 218, 0.34);
  animation: waterBreath 7s ease-in-out infinite;
}

.hero::after {
  width: 220px;
  height: 220px;
  left: -110px;
  bottom: -96px;
  background: rgba(234, 209, 215, 0.34);
  animation: waterBreath 8.5s ease-in-out infinite reverse;
}

.brand-row,
.topbar,
.section-head,
.card-head,
.metric-grid,
.node-title,
.share-link,
.bottom-nav {
  display: flex;
  align-items: center;
}

.brand-row,
.topbar,
.section-head,
.card-head,
.share-link {
  justify-content: space-between;
  gap: 14px;
}

.logo,
.avatar {
  display: grid;
  place-items: center;
  color: #627c81;
  background:
    radial-gradient(circle at 42% 35%, rgba(255,255,255,0.94), rgba(207,230,236,0.54) 58%, rgba(183,202,190,0.32));
  border: 1px solid rgba(118, 145, 149, 0.18);
  box-shadow: 0 10px 26px rgba(128, 153, 156, 0.14);
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  animation: bubbleFloat 5.5s ease-in-out infinite;
}

.eyebrow,
.chip,
.tab,
.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.eyebrow {
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid rgba(126, 144, 148, 0.16);
  border-radius: 999px;
  color: #6f878b;
  background: rgba(255, 255, 255, 0.48);
  font-size: 12px;
}

h1,
h2,
h3 {
  margin: 0;
  color: #2f4147;
  font-weight: 650;
  letter-spacing: 0;
}

h1 {
  max-width: 310px;
  margin-top: 34px;
  font-size: 34px;
  line-height: 1.18;
}

h2 {
  font-size: 21px;
  line-height: 1.32;
}

h3 {
  font-size: 16px;
  line-height: 1.38;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
  font-size: 14px;
}

.hero-copy {
  max-width: 318px;
  margin-top: 16px;
  font-size: 15px;
}

.halo-tree {
  position: relative;
  height: 158px;
  margin: 32px 0 12px;
}

.halo-line,
.mine-line {
  position: absolute;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(139, 164, 167, 0.42), transparent);
}

.halo-line {
  top: 10px;
  height: 136px;
}

.halo-node {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(126, 144, 148, 0.2);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #ffffff, var(--blue-2) 54%, var(--green-2));
  box-shadow: 0 10px 24px rgba(149, 180, 184, 0.2);
  animation: rippleBreath 3.8s infinite ease-in-out;
}

.halo-node::after,
.aura-tree span::after,
.ink-dot::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(169, 205, 218, 0.22);
  border-radius: inherit;
  animation: ripple 3.8s infinite ease-out;
}

.halo-node:nth-child(2) {
  left: calc(50% - 10px);
  top: 8px;
}

.halo-node:nth-child(3) {
  left: calc(50% - 96px);
  top: 76px;
  animation-delay: 0.28s;
}

.halo-node:nth-child(4) {
  right: calc(50% - 96px);
  top: 76px;
  animation-delay: 0.48s;
}

.halo-node:nth-child(5) {
  left: calc(50% - 10px);
  top: 132px;
  animation-delay: 0.68s;
}

.hero-actions,
.form-grid,
.stack,
.feed,
.timeline,
.report-grid,
.delivery-list {
  display: grid;
  gap: 14px;
}

.hero-actions {
  position: relative;
  z-index: 1;
  grid-template-columns: 1fr 1fr;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 18px;
  padding: 12px 16px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn.primary {
  background: linear-gradient(135deg, #bfdde5, #dce8df 58%, #efe1e3);
  color: #34474c;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(137, 167, 171, 0.2);
}

.btn.secondary,
.btn.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.44);
  color: #667d82;
}

.btn.ghost {
  width: auto;
  min-height: 40px;
  padding: 9px 13px;
}

.btn.danger {
  border: 1px solid rgba(185, 129, 136, 0.26);
  background: linear-gradient(135deg, rgba(234, 209, 215, 0.78), rgba(255, 250, 240, 0.72));
  color: #9b6e75;
  font-weight: 700;
}

.signup-card,
.panel,
.node-card,
.report-card,
.delivery-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.signup-card {
  margin-top: 18px;
  padding: 18px;
}

.panel,
.node-card,
.report-card,
.delivery-card {
  padding: 18px;
}

.caution-panel {
  background: rgba(255, 250, 240, 0.66);
}

.caution-panel p {
  color: #887d7f;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.label {
  color: #738b8e;
  font-size: 13px;
  font-weight: 560;
}

.input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(115, 139, 142, 0.16);
  border-radius: 18px;
  padding: 13px 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.input:focus,
textarea:focus,
select:focus {
  border-color: rgba(139, 172, 178, 0.42);
  box-shadow: 0 0 0 4px rgba(207, 230, 236, 0.42);
  background: rgba(255, 255, 255, 0.88);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -18px 18px;
  padding: 12px 18px;
  background: rgba(247, 243, 235, 0.74);
  backdrop-filter: blur(20px);
}

.identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.identity strong {
  display: block;
  max-width: 245px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #34474c;
  font-size: 15px;
}

.avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 17px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 14px;
  margin-bottom: 4px;
}

.progress-ring {
  position: relative;
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  background:
    conic-gradient(#aacbd4 calc(var(--progress) * 1%), rgba(255,255,255,0.54) 0),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255,255,255,0.9), rgba(239,247,246,0.76));
}

.progress-ring::after {
  width: 112px;
  height: 112px;
  background: rgba(234, 209, 215, 0.18);
  animation: waterBreath 6.8s ease-in-out infinite;
}

.progress-ring strong,
.progress-ring span {
  position: relative;
  z-index: 1;
}

.progress-ring strong {
  display: block;
  color: #607f86;
  font-size: 31px;
}

.metric-stack {
  display: grid;
  gap: 14px;
}

.mini-stat {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.48);
}

.mini-stat strong {
  display: block;
  color: #607f86;
  font-size: 22px;
}

.view-tabs {
  display: flex;
  gap: 8px;
  margin: 18px -18px 16px;
  padding: 0 18px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.view-tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.38);
  color: var(--muted);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.tab.active {
  border-color: rgba(112, 147, 153, 0.28);
  background: rgba(207, 230, 236, 0.68);
  color: #4f7077;
  transform: translateY(-1px);
}

.chat-row {
  display: flex;
}

.bubble {
  max-width: 86%;
  border-radius: 22px;
  padding: 13px 15px;
  line-height: 1.68;
  font-size: 14px;
  animation: softSlide 280ms ease both;
}

.bubble.ai {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
}

.bubble.user {
  margin-left: auto;
  background: rgba(207, 230, 236, 0.74);
  color: #365055;
}

.quick-prompts {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.quick-prompts::-webkit-scrollbar {
  display: none;
}

.quick-prompts button {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.42);
  color: #6f878b;
}

.mine-map {
  position: relative;
  min-height: 540px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.82), transparent 145px),
    linear-gradient(180deg, rgba(239, 247, 246, 0.86), rgba(246, 239, 239, 0.62));
  box-shadow: var(--shadow-soft);
}

.mine-map::after {
  width: 260px;
  height: 260px;
  right: -100px;
  bottom: -120px;
  background: rgba(169, 205, 218, 0.22);
  animation: bubbleFloat 7s ease-in-out infinite;
}

.mine-line {
  top: 34px;
  height: calc(100% - 68px);
}

.mine-node {
  position: absolute;
  width: 138px;
  min-height: 78px;
  border: 1px solid rgba(112, 147, 153, 0.18);
  border-radius: 22px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 26px rgba(112, 147, 153, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.mine-node:active {
  transform: scale(0.985);
}

.mine-node.key {
  border-color: rgba(234, 209, 215, 0.54);
  background: rgba(255, 250, 240, 0.78);
}

.mine-node small,
.node-year {
  color: #6e8b90;
}

.timeline {
  position: relative;
}

.node-card {
  content-visibility: auto;
  contain-intrinsic-size: 260px;
  animation: softSlide 260ms ease both;
}

.node-title {
  justify-content: space-between;
  gap: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 28px;
  border: 1px solid rgba(112, 147, 153, 0.12);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(220, 232, 223, 0.48);
  color: #687f83;
  font-size: 12px;
}

.line-progress {
  display: grid;
  gap: 11px;
}

.line-item {
  display: grid;
  gap: 7px;
}

.line-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a9cdda, #b7cabe 62%, #ead1d7);
  transition: width 420ms ease;
}

.report-grid {
  grid-template-columns: 1fr;
}

.report-card.featured {
  background: linear-gradient(150deg, rgba(207, 230, 236, 0.72), rgba(255, 253, 248, 0.88));
}

.share-link {
  align-items: flex-start;
  border: 1px dashed rgba(112, 147, 153, 0.22);
  border-radius: 22px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.44);
}

.empty {
  display: grid;
  min-height: 290px;
  place-items: center;
  text-align: center;
}

.ink-dot {
  position: relative;
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #ffffff, var(--blue-2) 58%, transparent 72%);
  animation: rippleBreath 3.6s infinite ease-in-out;
}

.bottom-nav {
  position: fixed;
  left: max(12px, calc((100vw - 430px) / 2 + 12px));
  right: max(12px, calc((100vw - 430px) / 2 + 12px));
  bottom: calc(10px + var(--safe-bottom));
  z-index: 30;
  justify-content: space-around;
  gap: 6px;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 7px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.nav-item {
  flex: 1;
  min-height: 52px;
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  flex-direction: column;
  font-size: 12px;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-item.active {
  background: rgba(207, 230, 236, 0.62);
  color: #54777d;
  transform: translateY(-1px);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + var(--safe-bottom));
  z-index: 60;
  max-width: calc(100vw - 40px);
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px;
  background: rgba(255, 253, 248, 0.88);
  color: #617e83;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  animation: softRise 220ms ease both;
}

.skeleton-screen {
  display: grid;
  min-height: 100vh;
  align-content: center;
  gap: 16px;
}

.aura-tree {
  position: relative;
  width: 140px;
  height: 160px;
  margin: 0 auto;
}

.aura-tree span {
  position: absolute;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #ffffff, var(--blue-2));
  box-shadow: 0 12px 26px rgba(128, 153, 156, 0.18);
  animation: rippleBreath 3.4s infinite ease-in-out;
}

.aura-tree span:nth-child(1) {
  left: 62px;
  top: 12px;
}

.aura-tree span:nth-child(2) {
  left: 18px;
  top: 74px;
}

.aura-tree span:nth-child(3) {
  right: 18px;
  top: 74px;
}

.aura-tree span:nth-child(4) {
  left: 62px;
  bottom: 10px;
}

.skeleton-title,
.skeleton-line {
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.44), rgba(207,230,236,0.76), rgba(255,255,255,0.44));
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite linear;
}

.skeleton-title {
  height: 38px;
  width: 70%;
}

.skeleton-line.short {
  width: 58%;
}

.danger {
  color: #b98188;
}

@keyframes rippleBreath {
  0%, 100% { opacity: 0.76; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.06); }
}

@keyframes ripple {
  0% { opacity: 0.35; transform: scale(0.72); }
  70% { opacity: 0; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(1.5); }
}

@keyframes waterBreath {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.62; }
  50% { transform: translate3d(8px, 10px, 0) scale(1.08); opacity: 0.9; }
}

@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes softSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes softRise {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (min-width: 431px) {
  .app-shell {
    margin-top: 18px;
    min-height: calc(100vh - 36px);
    border: 1px solid rgba(126, 144, 148, 0.12);
    border-radius: 36px;
    background: rgba(255, 255, 255, 0.24);
    box-shadow: 0 28px 90px rgba(112, 147, 153, 0.16);
  }
}
