.hero-brand {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 220px;
  padding: 20px;
  color: var(--font-white);
  text-align: center;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.hero-brand__mark {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.hero-brand__mark .icon {
  width: 38px;
  height: 38px;
}

.hero-brand__title {
  font-size: 28px;
  font-weight: 800;
}

.hero-brand__subtitle {
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  font-weight: 500;
}

.stack {
  display: grid;
  gap: 16px;
}

.section {
  display: grid;
  gap: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
}

.section-subtitle {
  font-size: 13px;
  color: var(--font-secondary);
}

.tree-section .section-subtitle {
  font-weight: 700;
  color: var(--font-primary);
}

.tree-section .section-subtitle:first-child {
  margin-top: 6px;
}

.content-pad {
  padding: 16px;
}

.content-pad--lg {
  padding: 20px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card--flat {
  box-shadow: none;
}

.card--soft {
  background: #fffdfa;
}

.card__body {
  padding: 18px 20px;
}

.input-group {
  display: grid;
  gap: 8px;
}

.input-label {
  font-size: 14px;
  font-weight: 600;
}

.field,
.field-button,
.select-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--font-secondary);
}

.field.is-focused,
.field:focus-within,
.select-field:focus-within {
  border-color: rgba(255, 122, 47, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 122, 47, 0.1);
}

.field.is-invalid,
.select-field.is-invalid {
  border-color: rgba(220, 38, 38, 0.42);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.field input,
.field textarea {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--font-primary);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--font-tertiary);
}

.field__grow {
  flex: 1;
}

.field__meta {
  color: var(--font-tertiary);
  font-size: 13px;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row > * {
  flex: 1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.check-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--font-secondary);
}

.check-toggle__box {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  color: var(--font-white);
  background: #fff;
}

.check-toggle.is-checked .check-toggle__box {
  border-color: var(--primary);
  background: var(--primary);
}

.link-text {
  color: var(--primary);
  font-size: 13px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
}

.button--primary {
  background: var(--primary);
  color: var(--font-white);
}

.button--secondary {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: #fff;
}

.button--block {
  width: 100%;
}

.button--subtle-text {
  font-size: 13px;
}

.button--sm {
  min-height: 36px;
  border-radius: 18px;
  font-size: 13px;
  padding: 0 14px;
}

.social-row,
.center-row {
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-row {
  gap: 24px;
}

.social-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
}

.social-button--wechat {
  background: #07c160;
}

.social-button--user {
  background: #2ab2ff;
}

.divider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--font-tertiary);
  font-size: 12px;
}

.divider-row::before,
.divider-row::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--divider);
}

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

.stats-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-card);
}

.stat-card--button {
  width: 100%;
  border: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.stat-card__icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.stat-card__value {
  font-size: 31px;
  line-height: 1;
  font-weight: 800;
}

.stat-card__label {
  font-size: 12px;
  color: var(--font-secondary);
}

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

.quick-action {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-radius: 14px;
  text-align: center;
}

.quick-action__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.quick-action__label {
  font-size: 13px;
  font-weight: 600;
}

.list-stack {
  display: grid;
  gap: 12px;
}

.list-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-card);
}

.list-card__thumb {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  color: var(--primary);
}

.list-card__body {
  flex: 1;
  display: grid;
  gap: 4px;
}

.list-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.list-card__meta,
.muted {
  color: var(--font-secondary);
  font-size: 12px;
}

.tiny {
  font-size: 11px;
  color: var(--font-tertiary);
}

.chip-row,
.tags,
.tab-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--font-secondary);
  font-size: 12px;
  border: 1px solid transparent;
}

.pill.is-active {
  color: var(--primary);
  background: var(--primary-light);
}

.pill--outline {
  border-color: var(--border);
}

.top-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-card);
}

.top-card__grow {
  flex: 1;
}

.hero-pet {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 180px;
  padding: 26px 20px;
  text-align: center;
  background: var(--primary-light);
}

.avatar-lg,
.avatar-md,
.avatar-sm,
.circle-icon {
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.avatar-lg {
  width: 92px;
  height: 92px;
  background: rgba(255, 122, 47, 0.18);
  color: var(--primary);
}

.avatar-md {
  width: 56px;
  height: 56px;
  background: #ffe6da;
  color: var(--primary);
}

.avatar-sm {
  width: 36px;
  height: 36px;
  background: rgba(255, 122, 47, 0.1);
  color: var(--primary);
}

.circle-icon {
  width: 44px;
  height: 44px;
}

.action-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.action-spot {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.action-spot__bubble {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.qr-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--bg-card);
}

.qr-code {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  width: 148px;
  aspect-ratio: 1;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
}

.qr-code span {
  background: transparent;
}

.qr-code span.is-dark {
  background: #25253a;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge--success {
  background: #ecfdf5;
  color: var(--success);
}

.badge--warning {
  background: #fff7df;
  color: #d48806;
}

.badge--info {
  background: #eff6ff;
  color: var(--info);
}

.badge--danger {
  background: #fee2e2;
  color: #dc2626;
}

.timeline {
  position: relative;
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 10px;
  bottom: -12px;
  width: 2px;
  background: var(--divider);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: -2px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.timeline-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-card);
}

.tree-section {
  display: grid;
  gap: 10px;
}

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

.tree-node {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-card);
}

.bloodline-node {
  align-items: flex-start;
  min-height: 84px;
  padding: 12px;
  border: 1px solid rgba(229, 231, 235, 0.92);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.bloodline-node__body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.bloodline-node__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bloodline-node__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--font-primary);
}

.bloodline-node__breed {
  font-weight: 400;
  color: var(--font-secondary);
}

.bloodline-role-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.bloodline-role-tag--father,
.bloodline-role-tag--grandfather,
.bloodline-role-tag--maternal-grandfather {
  background: #eff6ff;
  color: var(--info);
}

.bloodline-role-tag--mother,
.bloodline-role-tag--grandmother,
.bloodline-role-tag--maternal-grandmother {
  background: #fdf2f8;
  color: #db2777;
}

.bloodline-award-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  min-width: 22px;
  padding: 0;
  border-radius: 999px;
  background: #fff7df;
  color: #b7791f;
}

.bloodline-award-tag .icon {
  width: 12px;
  height: 12px;
}

.tree-divider {
  height: 18px;
  width: 1px;
  margin: 0 auto;
  background: var(--divider);
}

.upload-panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 160px;
  padding: 24px 16px;
  border-radius: 12px;
  border: 2px dashed var(--border);
  background: var(--bg-card);
  text-align: center;
}

.upload-panel.is-complete {
  border-color: rgba(34, 197, 94, 0.45);
  background: linear-gradient(180deg, #fff 0%, #f5fff8 100%);
}

.watermark-preview {
  position: relative;
  min-height: 180px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, #23233b 0%, #17182a 100%);
}

.watermark-preview::after {
  content: attr(data-mark);
  position: absolute;
  left: 10px;
  right: auto;
  top: auto;
  bottom: 10px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 10px;
  line-height: 1.45;
  white-space: pre-line;
}

.watermark-preview[data-watermark-pos="left-top"]::after {
  left: 10px;
  right: auto;
  top: 10px;
  bottom: auto;
}

.watermark-preview[data-watermark-pos="right-top"]::after {
  left: auto;
  right: 10px;
  top: 10px;
  bottom: auto;
  text-align: right;
}

.watermark-preview[data-watermark-pos="left-bottom"]::after {
  left: 10px;
  right: auto;
  top: auto;
  bottom: 10px;
}

.watermark-preview[data-watermark-pos="right-bottom"]::after {
  left: auto;
  right: 10px;
  top: auto;
  bottom: 10px;
  text-align: right;
}

.watermark-preview.has-upload::after {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.watermark-position {
  display: grid;
  grid-template-columns: repeat(2, 10px);
  gap: 4px;
  padding: 6px;
  border-radius: 8px;
  background: #f3f4f6;
}

.watermark-position button {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #d1d5db;
}

.watermark-position button.is-active {
  background: var(--primary);
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  min-height: 140px;
}

.bar {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.bar__shape {
  width: 100%;
  max-width: 20px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-mid) 100%);
}

.bar__shape.is-muted {
  background: #ffb689;
}

.bar__label {
  font-size: 11px;
  color: var(--font-tertiary);
}

.record-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-card);
}

.empty-state {
  padding: 20px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px dashed var(--border);
  color: var(--font-secondary);
  text-align: center;
  font-size: 13px;
}

.menu-group {
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg-card);
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
}

.menu-row + .menu-row {
  border-top: 1px solid var(--divider);
}

.menu-row__grow {
  flex: 1;
}

.menu-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f7f8fb;
}

.tab-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  width: min(100%, var(--screen-width));
  min-height: 62px;
  margin: 0 auto;
  padding: 4px 12px 8px;
  border-radius: 36px 36px 0 0;
  background: var(--bg-card);
  box-shadow: var(--shadow-tab);
}

.app-content:has(.tab-bar) {
  padding-bottom: 76px;
}

.tab-item {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  color: var(--tab-inactive);
  font-size: 10px;
}

.message-unread-badge {
  position: absolute;
  top: 2px;
  right: 16px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 2px solid var(--bg-card);
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.message-unread-badge[hidden] {
  display: none;
}

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

.tab-item span:last-child {
  font-weight: 600;
}
