/* Shared UI components inside the phone */

/* ---------- Screen base ---------- */
.screen {
  min-height: 100%;
  padding-bottom: 18px;
  color: var(--yd-ink);
  background: var(--yd-paper);
}

.screen--flush {
  padding-bottom: 0;
}

.screen--white {
  background: #fff;
}

.screen-pad {
  padding-left: 16px;
  padding-right: 16px;
}

.screen-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.screen-footer-space {
  height: 22px;
}

/* ---------- Nav bar ---------- */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 22;
  display: flex;
  align-items: center;
  height: var(--yd-nav-h);
  padding: 0 12px;
  background: rgba(247, 245, 239, 0.93);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(12, 21, 17, 0.055);
}

.nav-bar--white {
  background: rgba(255, 255, 255, 0.94);
}

.nav-bar--dark {
  background: rgba(11, 61, 46, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: #f4f9f1;
}

.nav-bar__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-right: 4px;
  border-radius: 50%;
  color: inherit;
  font-size: 17px;
}

.nav-bar__back:hover {
  background: rgba(12, 21, 17, 0.06);
}

.nav-bar--dark .nav-bar__back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-bar__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nav-bar__sub {
  margin-left: 8px;
  font-size: 10px;
  color: var(--yd-muted);
}

.nav-bar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--yd-ink);
  background: rgba(12, 21, 17, 0.05);
  font-size: 14px;
}

.nav-bar--dark .nav-icon-btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Typography ---------- */
.h1 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.h2 {
  font-size: 19px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.h3 {
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
}

.text-muted {
  color: var(--yd-muted);
}

.text-soft {
  color: var(--yd-muted-light);
}

.text-lime {
  color: var(--yd-lime-strong);
}

.text-danger {
  color: var(--yd-danger);
}

.fs-11 {
  font-size: 11px;
}

.fs-12 {
  font-size: 12px;
}

.fs-13 {
  font-size: 13px;
}

.price {
  font-family: var(--yd-font-num);
  font-variant-numeric: tabular-nums;
  color: var(--yd-ink);
  font-weight: 700;
  line-height: 1;
}

.price__symbol {
  font-family: var(--yd-font);
  font-size: 0.62em;
  font-weight: 700;
  margin-right: 1px;
}

.price__unit {
  font-family: var(--yd-font);
  font-size: 10px;
  font-weight: 500;
  color: var(--yd-muted);
  margin-left: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 18px;
  border-radius: var(--yd-r-pill);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform var(--yd-dur) var(--yd-ease), background var(--yd-dur) var(--yd-ease),
    box-shadow var(--yd-dur) var(--yd-ease);
}

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

.btn--primary {
  color: #0b2318;
  background: var(--yd-lime);
  box-shadow: var(--yd-shadow-lime);
}

.btn--primary:hover {
  background: var(--yd-lime-strong);
}

.btn--dark {
  color: #f4f9f1;
  background: var(--yd-pitch-900);
}

.btn--dark:hover {
  background: var(--yd-pitch-800);
}

.btn--ghost {
  color: var(--yd-ink);
  background: rgba(12, 21, 17, 0.05);
}

.btn--outline {
  color: var(--yd-pitch-900);
  border: 1px solid rgba(11, 61, 46, 0.24);
  background: transparent;
}

.btn--danger {
  color: #fff;
  background: var(--yd-danger);
}

.btn--sm {
  min-height: 30px;
  padding: 0 12px;
  font-size: 11px;
}

.btn--xs {
  min-height: 26px;
  padding: 0 10px;
  font-size: 10px;
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--disabled,
.btn[disabled] {
  color: #a3ada7;
  background: #e9e7df;
  box-shadow: none;
  cursor: not-allowed;
}

.btn--primary.btn--disabled {
  color: #97a28f;
  background: #e5e9d8;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--yd-ink-soft);
  background: rgba(12, 21, 17, 0.05);
}

/* ---------- Tags / pills ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.tag--lime {
  color: #33510b;
  background: var(--yd-lime);
}

.tag--green {
  color: var(--yd-success);
  background: var(--yd-success-soft);
}

.tag--amber {
  color: #a8690f;
  background: var(--yd-warning-soft);
}

.tag--red {
  color: var(--yd-danger);
  background: var(--yd-danger-soft);
}

.tag--blue {
  color: #2c5fd1;
  background: var(--yd-info-soft);
}

.tag--gray {
  color: var(--yd-muted);
  background: #f0eee7;
}

.tag--dark {
  color: #f4f9f1;
  background: rgba(255, 255, 255, 0.14);
}

.tag--outline {
  color: var(--yd-pitch-900);
  border: 1px solid rgba(11, 61, 46, 0.24);
  background: transparent;
}

.tag i {
  font-size: 8px;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yd-success);
  box-shadow: 0 0 0 3px rgba(26, 143, 92, 0.14);
}

/* ---------- Cards ---------- */
.card {
  border-radius: var(--yd-r-lg);
  background: var(--yd-surface);
  box-shadow: var(--yd-shadow-sm);
}

.card--pad {
  padding: 16px;
}

.card--flat {
  border: 1px solid var(--yd-line);
  box-shadow: none;
}

.card--dark {
  color: #f4f9f1;
  background:
    radial-gradient(260px 160px at 100% 0%, rgba(216, 255, 79, 0.14), transparent 65%),
    linear-gradient(150deg, var(--yd-pitch-800), var(--yd-pitch-950));
  box-shadow: var(--yd-shadow-md);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 10px;
}

.section-head h2,
.section-head h3 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-head__count {
  font-family: var(--yd-font-num);
  font-size: 11px;
  color: var(--yd-muted);
}

.section-head__action {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--yd-muted);
  font-size: 11px;
  font-weight: 600;
}

.section-head__action i {
  font-size: 9px;
}

/* ---------- List rows ---------- */
.list-card {
  border-radius: var(--yd-r-md);
  background: #fff;
  box-shadow: var(--yd-shadow-sm);
  overflow: hidden;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  padding: 11px 14px;
  text-align: left;
  width: 100%;
}

.list-row + .list-row {
  border-top: 1px solid var(--yd-line);
}

.list-row__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--yd-lime-wash);
  color: var(--yd-pitch-900);
  font-size: 13px;
}

.list-row__title {
  font-size: 13px;
  font-weight: 600;
}

.list-row__desc {
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--yd-muted);
}

.list-row__value {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--yd-muted);
}

.list-row__chevron {
  color: #b4bcb7;
  font-size: 10px;
}

/* ---------- Segmented / chips / tabs ---------- */
.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--yd-r-pill);
  background: #ebe8df;
}

.segmented__item {
  min-height: 28px;
  padding: 0 14px;
  border-radius: var(--yd-r-pill);
  font-size: 11px;
  font-weight: 700;
  color: var(--yd-muted);
  transition: all var(--yd-dur) var(--yd-ease);
}

.segmented__item.is-active {
  color: #fff;
  background: var(--yd-pitch-900);
  box-shadow: 0 2px 8px rgba(11, 61, 46, 0.22);
}

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--yd-r-pill);
  font-size: 11px;
  font-weight: 600;
  color: var(--yd-muted);
  background: #fff;
  border: 1px solid var(--yd-line);
}

.chip.is-active {
  color: #f4f9f1;
  background: var(--yd-pitch-900);
  border-color: var(--yd-pitch-900);
}

.chip i {
  font-size: 10px;
}

.tabs {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--yd-line);
  scrollbar-width: none;
}

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

.tab {
  position: relative;
  flex: 0 0 auto;
  padding: 11px 1px;
  color: var(--yd-muted);
  font-size: 12px;
  font-weight: 600;
}

.tab.is-active {
  color: var(--yd-ink);
  font-weight: 800;
}

.tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 18px;
  height: 3px;
  margin-left: -9px;
  border-radius: 2px;
  background: var(--yd-lime-strong);
}

/* ---------- Progress ---------- */
.progress {
  height: 5px;
  border-radius: 3px;
  background: #ece9e0;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--yd-pitch-700), var(--yd-lime-strong));
}

.progress__bar--amber {
  background: linear-gradient(90deg, #e8a33d, #f4c26b);
}

.progress__bar--full {
  background: var(--yd-danger);
}

/* ---------- Forms ---------- */
.form-card {
  padding: 2px 14px;
  border-radius: var(--yd-r-md);
  background: #fff;
  box-shadow: var(--yd-shadow-sm);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 0;
}

.form-row + .form-row {
  border-top: 1px solid var(--yd-line);
}

.form-row__label {
  width: 68px;
  flex: 0 0 68px;
  font-size: 12px;
  color: var(--yd-muted);
}

.form-row__main {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
}

.form-row__value {
  margin-left: auto;
  font-size: 12px;
  color: var(--yd-ink);
}

.form-row__chevron {
  color: #b4bcb7;
  font-size: 10px;
}

.field {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--yd-line);
  background: #fbfaf6;
  font-size: 12px;
  outline: none;
}

.field:focus {
  border-color: var(--yd-pitch-600);
  background: #fff;
}

.textarea {
  height: 76px;
  padding: 10px 12px;
  resize: none;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.stepper__btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--yd-line-strong);
  color: var(--yd-ink);
  font-size: 11px;
}

.stepper__btn--plus {
  color: #fff;
  background: var(--yd-pitch-900);
  border-color: var(--yd-pitch-900);
}

.stepper__value {
  min-width: 22px;
  text-align: center;
  font-family: var(--yd-font-num);
  font-size: 15px;
  font-weight: 700;
}

/* ---------- Sticky CTA ---------- */
.sticky-cta {
  position: sticky;
  bottom: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 12px;
  background: linear-gradient(180deg, rgba(247, 245, 239, 0), rgba(247, 245, 239, 0.94) 26%, var(--yd-paper));
}

.sticky-cta__info {
  flex: 1;
  min-width: 0;
}

.sticky-cta__label {
  font-size: 10px;
  color: var(--yd-muted);
}

.sticky-cta__price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-top: 1px;
}

.sticky-cta .btn {
  min-width: 116px;
}

.cta-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--yd-line);
  backdrop-filter: blur(14px);
}

.cta-bar__info {
  flex: 1;
  min-width: 0;
}

/* ---------- Notice / banner ---------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 10.5px;
  line-height: 1.55;
  color: #7b5a13;
  background: #fdf4df;
}

.notice i {
  margin-top: 2px;
  font-size: 11px;
  color: var(--yd-warning);
}

.notice--green {
  color: #245a41;
  background: var(--yd-lime-wash);
}

.notice--green i {
  color: var(--yd-pitch-700);
}

.notice--dark {
  color: rgba(244, 249, 241, 0.82);
  background: rgba(255, 255, 255, 0.08);
}

.notice--dark i {
  color: var(--yd-lime);
}

/* ---------- Avatar / QR / art helpers ---------- */
.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(145deg, var(--yd-pitch-600), var(--yd-pitch-950));
}

.avatar--lime {
  color: #1c3511;
  background: linear-gradient(145deg, var(--yd-lime), #a8d52f);
}

.avatar--amber {
  color: #4a2b08;
  background: linear-gradient(145deg, #ffd37a, #d98b2b);
}

.avatar--blue {
  color: #072a5e;
  background: linear-gradient(145deg, #9fc4ff, #3e7bfa);
}

.avatar--paper {
  color: var(--yd-pitch-900);
  background: #fff;
  border: 1px solid var(--yd-line);
}

.avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 9px;
}

.avatar--lg {
  width: 54px;
  height: 54px;
  font-size: 16px;
}

.avatar-group {
  display: flex;
  align-items: center;
}

.avatar-group .avatar + .avatar {
  margin-left: -9px;
  border: 2px solid #fff;
}

.qr {
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  grid-template-rows: repeat(21, 1fr);
  width: 148px;
  height: 148px;
  padding: 7px;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--yd-shadow-sm);
}

.qr__cell {
  background: transparent;
}

.qr__cell.is-on {
  background: var(--yd-ink);
}

/* ---------- Sheets ---------- */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(6, 16, 11, 0.48);
  backdrop-filter: blur(2px);
  animation: yd-fade 180ms var(--yd-ease);
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  max-height: 78%;
  display: flex;
  flex-direction: column;
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -20px 50px rgba(6, 16, 11, 0.22);
  animation: yd-sheet-up 240ms var(--yd-ease);
}

.sheet--tall {
  max-height: 88%;
}

.sheet__handle {
  width: 34px;
  height: 4px;
  margin: 9px auto 2px;
  border-radius: 2px;
  background: #d9d6cc;
}

.sheet__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 11px;
  border-bottom: 1px solid var(--yd-line);
}

.sheet__title {
  font-size: 15px;
  font-weight: 800;
}

.sheet__close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f2f0e9;
  color: var(--yd-muted);
  font-size: 11px;
}

.sheet__body {
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

.sheet__body--flush {
  padding: 0 0 calc(12px + env(safe-area-inset-bottom));
}

.sheet__actions {
  display: flex;
  gap: 9px;
  padding-top: 4px;
}

@keyframes yd-sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes yd-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Toast ---------- */
.yd-toast {
  position: absolute;
  left: 50%;
  bottom: 92px;
  z-index: 70;
  transform: translateX(-50%);
  max-width: 280px;
  padding: 9px 14px;
  border-radius: var(--yd-r-pill);
  color: #fff;
  background: rgba(6, 16, 11, 0.88);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
  backdrop-filter: blur(8px);
  animation: yd-toast-in 200ms var(--yd-ease);
  pointer-events: none;
}

@keyframes yd-toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ---------- Empty / skeleton ---------- */
.empty {
  padding: 42px 24px;
  text-align: center;
}

.empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: var(--yd-pitch-700);
  background: var(--yd-lime-wash);
  font-size: 22px;
}

.empty__title {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
}

.empty__desc {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--yd-muted);
}

.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, #eeeae0 25%, #f8f6f0 37%, #eeeae0 63%);
  background-size: 400% 100%;
  animation: yd-shimmer 1.4s ease infinite;
}

@keyframes yd-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* ---------- Utility ---------- */
.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row--between {
  justify-content: space-between;
}

.row--top {
  align-items: flex-start;
}

.col {
  display: flex;
  flex-direction: column;
}

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

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 12px;
}

.mt-4 {
  margin-top: 16px;
}

.mt-5 {
  margin-top: 20px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 12px;
}

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- System menu (WeChat capsule demo) ---------- */
.sys-menu-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--yd-muted);
  background: #f8f6f0;
}

.sys-menu-note i {
  margin-top: 2px;
  color: var(--yd-pitch-700);
  font-size: 10px;
}

.sys-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 14px;
}

.sys-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 13px 4px;
  border-radius: 12px;
  background: #f8f6f0;
  color: var(--yd-ink-soft);
  font-size: 9px;
}

.sys-menu-item i {
  font-size: 19px;
  color: var(--yd-pitch-700);
}

.sys-menu-item:hover {
  background: var(--yd-lime-wash);
}

/* ---------- Full-screen photo viewer ---------- */
.photo-viewer {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: #040a07;
  pointer-events: auto;
}

.photo-viewer__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--yd-status-h) + 8px) 16px 10px;
  color: #f4f9f1;
}

.photo-viewer__count {
  flex: 0 0 auto;
  font-family: var(--yd-font-num);
  font-size: 12px;
  color: rgba(244, 249, 241, 0.7);
}

.photo-viewer__count b {
  color: var(--yd-lime);
}

.photo-viewer__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 10px;
  color: rgba(244, 249, 241, 0.7);
}

.photo-viewer__close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
}

.photo-viewer__track {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.photo-viewer__track::-webkit-scrollbar {
  display: none;
}

.photo-viewer__slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 40px;
  scroll-snap-align: center;
}

.photo-viewer__slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
