/* ========== BioCore Design Tokens ========== */
:root {
  --bg: #f7f4ef;
  --bg-warm: #faf6f0;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #5c5c5c;
  --ink-mute: #737373;
  --ink-legend: #4a4a4a;
  --warn-text: #6b5340;
  --border: rgba(0, 0, 0, 0.08);
  --gray-card: #eceae6;
  --beige-card: #f3ebe0;
  --lime-card: #eef2d8;
  --cream-card: #f5f0d8;
  --orange: #e87a3a;
  --green: #5cb87a;
  --green-soft: #e7f5eb;
  --green-bright: #6bc986;
  --warn: #c9894a;
  --warn-soft: #f5ebe0;
  --pause: #8a8a8a;
  --pause-soft: #ececec;
  --blue-body: #b8d4e8;
  --shadow: 0 8px 28px rgba(40, 30, 20, 0.08);
  --radius: 22px;
  --radius-pill: 999px;
  --font: "Noto Sans SC", "DM Sans", system-ui, sans-serif;
  --phone-w: 390px;
  --phone-h: 844px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, #e8dfd4 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 80%, #d9e4dc 0%, transparent 50%),
    linear-gradient(160deg, #cfc6bb 0%, #b8c4bc 45%, #aeb8b2 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

ul {
  list-style: none;
}

/* ========== Phone Shell ========== */
.app-shell {
  padding: 8px 16px 24px;
}

.phone {
  position: relative;
  width: min(100vw - 24px, var(--phone-w));
  height: min(92vh, var(--phone-h));
  background: var(--bg);
  border-radius: 40px;
  box-shadow:
    0 0 0 10px #1c1c1c,
    0 0 0 12px #3a3a3a,
    0 40px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #1c1c1c;
  border-radius: 20px;
  z-index: 50;
  pointer-events: none;
}

/* ========== Screens ========== */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 52px 18px 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(18px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  background:
    linear-gradient(180deg, #fbf8f3 0%, var(--bg) 28%, #f3f0ea 100%);
}

.screen::-webkit-scrollbar {
  display: none;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  z-index: 2;
}

.screen-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.screen-body::-webkit-scrollbar {
  display: none;
}

.screen-home,
.screen-profile {
  overflow: hidden;
  padding-bottom: 10px;
}

/* ========== Shared UI ========== */
.brand,
.footer-brand {
  font-family: "DM Sans", var(--font);
  font-weight: 700;
}

.brand {
  font-size: 28px;
  letter-spacing: -0.02em; /* English brand only */
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(40, 30, 20, 0.12);
}

.footer-brand {
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 14px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  color: var(--ink-mute);
  font-size: 13px;
  transition: transform 0.2s ease, box-shadow 0.2s;
}

.nav-pill:active {
  transform: scale(0.96);
}

.nav-pill-sm {
  padding: 8px 12px;
  flex-shrink: 0;
}

.icon {
  width: 18px;
  height: 18px;
}

.icon-leaf {
  width: 16px;
  height: 16px;
}

.card-surface {
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
  cursor: grab;
  user-select: none;
}

.card-surface:active {
  cursor: grabbing;
}

.card-surface.is-dragging {
  opacity: 0.45;
  transform: scale(0.98);
}

.card-gray {
  background: var(--gray-card);
}

.card-beige {
  background: var(--beige-card);
}

.card-lime {
  background: var(--lime-card);
}

.card-cream {
  background: var(--cream-card);
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin: 0 5px;
  vertical-align: middle;
}

.dot-dark {
  background: #2a2a2a;
}

.dot-orange {
  background: var(--orange);
}

.more-dots {
  letter-spacing: 2px;
  color: var(--ink-mute);
  font-size: 16px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ai-fab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  max-width: 210px;
}

.ai-fab-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2e2e2e;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.ai-fab-icon svg {
  width: 22px;
  height: 22px;
}

.ai-fab-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-fab-text strong {
  font-size: 14px;
  font-weight: 600;
}

.ai-fab-text small {
  font-size: 11px;
  color: var(--ink-mute);
  line-height: 1.3;
}

.ai-fab.is-drop-target .ai-fab-icon {
  background: var(--green);
  transform: scale(1.08);
  transition: background 0.2s, transform 0.2s;
}

/* ========== 首页 ========== */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.period-tabs {
  display: flex;
  gap: 22px;
  margin-bottom: 8px;
  padding-left: 2px;
}

.chart-axis-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-legend);
  margin-bottom: 6px;
  padding: 0 2px;
}

.chart-wrap-dual {
  position: relative;
  display: flex;
  gap: 6px;
  height: 148px;
  align-items: stretch;
}

.chart-wrap-dual canvas {
  flex: 1;
  width: 100% !important;
  height: 100% !important;
}

.glucose-bar-side {
  width: 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, #e87a3a 0%, #f0c090 45%, #f8e0c8 100%);
  flex-shrink: 0;
}

.home-chart-primary {
  margin-bottom: 14px;
}

/* ========== Chart deck stack ========== */
.chart-deck {
  position: relative;
  margin: 0 0 16px;
  padding-right: 14px;
}

.deck-stack {
  position: relative;
  height: 232px;
  touch-action: pan-y;
  user-select: none;
}

.deck-card {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: 210px;
  transform-origin: center center;
  will-change: transform, opacity;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
  cursor: grab;
}

.deck-card.is-front {
  cursor: grab;
}

.deck-card.is-front:active {
  cursor: grabbing;
}

.deck-card-inner {
  height: 100%;
  margin: 0 !important;
  border-radius: 24px;
  background: #fff;
  box-shadow:
    0 10px 28px rgba(40, 30, 20, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 14px 12px 10px;
  position: relative;
  overflow: hidden;
}

.deck-card-inner .chart-wrap-dual {
  height: 132px;
}

/* Peek edge like the mock */
.deck-card:not(.is-front) .deck-card-inner::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 100%;
  background: linear-gradient(180deg, #ef9a55 0%, #f6d7b8 50%, #fff 100%);
  pointer-events: none;
}

.deck-card.is-front .deck-card-inner::after {
  display: none;
}

.deck-tint-warm {
  background: linear-gradient(180deg, #fffdfb 0%, #fff8f1 100%);
}

.deck-tint-cool {
  background: linear-gradient(180deg, #ffffff 0%, #f7f8f6 100%);
}

.deck-ask {
  position: absolute;
  right: 12px;
  bottom: 10px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #5a7a66;
  background: #eef4f0;
  z-index: 3;
}

.deck-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.deck-dots {
  display: flex;
  gap: 6px;
}

.deck-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  transition: transform 0.2s, background 0.2s;
}

.deck-dot.is-on {
  background: #2a2a2a;
  transform: scale(1.2);
}

.deck-hint {
  font-size: 12px;
  color: var(--ink-mute);
}

.risk-switch-inline {
  flex-direction: row !important;
  margin: 10px 0 0 !important;
  gap: 6px;
}

.risk-switch-inline button {
  min-height: 28px;
  min-width: 0;
  flex: 1;
  font-size: 12px;
  padding: 4px 6px;
}

.status-card.zone-yellow .status-desc {
  color: var(--warn-text);
}

.status-card.zone-gray .status-desc {
  color: #5a5a5a;
}

.status-card.zone-yellow::after {
  background: #d4a574;
}

.status-card.zone-gray::after {
  background: #9a9a9a;
}

.suggest-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.btn-start-inline {
  width: auto !important;
  min-height: 40px;
  padding: 10px 16px;
  font-size: 14px;
  flex-shrink: 0;
}

.feedback-strip {
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #f7f5f1;
  border: 1px solid var(--border);
  cursor: grab;
}

.feedback-strip.is-done {
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feedback-thin-line {
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 500;
}

.feedback-done-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.feedback-done-line {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.feedback-done-note {
  margin-top: 6px;
  font-size: 13px;
  color: #3a5a44;
  line-height: 1.45;
}

.period-tab {
  font-size: 15px;
  color: var(--ink-mute);
  position: relative;
  padding-bottom: 4px;
}

.period-tab.is-active {
  color: var(--ink);
  font-weight: 600;
}

.period-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-bottom: 14px;
}

.date-label {
  font-size: 22px;
  font-weight: 700;
}

.date-arrow {
  font-size: 18px;
  color: var(--ink-soft);
  padding: 4px 8px;
}

.info-chart {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 12px 10px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.chart-legend {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-legend);
  margin-bottom: 6px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
}

.legend-right {
  flex-direction: row-reverse;
}

.chart-wrap {
  position: relative;
  display: flex;
  gap: 8px;
  height: 140px;
}

.intensity-bar {
  width: 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, #e85a3a 0%, #f0c040 45%, #3ecf4a 100%);
  flex-shrink: 0;
}

.chart-wrap canvas {
  flex: 1;
  width: 100% !important;
  height: 100% !important;
}

.chart-x {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-mute);
  padding-left: 16px;
  margin-top: 4px;
}

.home-status-row {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}

.limit-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 4px;
}

.limit-label {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.limit-value {
  font-size: 26px;
  font-weight: 700;
}

.limit-value span {
  font-size: 14px;
  font-weight: 500;
}

.status-card {
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.status-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 52px;
  height: 52px;
  background: var(--green-bright);
  border-radius: 0 0 0 18px;
}

.status-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.status-num {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  font-family: "DM Sans", var(--font);
}

.status-unit {
  font-size: 13px;
  margin-top: 2px;
}

.status-badge {
  width: 36px;
  height: 36px;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
}

.status-badge svg {
  width: 22px;
  height: 22px;
}

.status-desc {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  position: relative;
  z-index: 1;
  max-width: 85%;
}

.suggest-card {
  padding: 16px 18px 14px;
  margin-bottom: 12px;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.suggest-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.suggest-card.sm {
  margin-bottom: 10px;
  padding: 14px 16px;
}

.suggest-card.sm p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.suggest-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
}

.check-circle {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--ink-mute);
  border-radius: 50%;
  transition: background 0.2s, border-color 0.2s;
}

.check-circle.is-done {
  background: var(--green);
  border-color: var(--green);
}

.suggest-plain li {
  font-size: 14px;
  padding: 4px 0;
  color: var(--ink);
}

.suggest-foot {
  text-align: right;
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
}

.card-more {
  position: absolute;
  right: 14px;
  bottom: 8px;
  color: var(--ink-mute);
  letter-spacing: 2px;
  font-size: 14px;
}

.home-footer {
  flex-shrink: 0;
  margin-top: 0;
  padding: 10px 0 4px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, rgba(243, 240, 234, 0) 0%, #f3f0ea 35%, #f3f0ea 100%);
  z-index: 8;
}

/* ========== AI 对话 ========== */
.screen-chat {
  background:
    linear-gradient(180deg, #fffefb 0%, #faf7f2 40%, #f5f2ec 100%);
  padding-bottom: 0;
}

.chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.chat-greeting h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}

.chat-greeting p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
}

.chat-thread::-webkit-scrollbar {
  display: none;
}

.msg {
  margin-bottom: 18px;
  animation: msgIn 0.45s ease both;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg-user {
  display: flex;
  justify-content: flex-end;
}

.bubble {
  max-width: 82%;
  background: #ebe8e3;
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.55;
}

.msg-ai {
  position: relative;
  padding-left: 8px;
}

.quote-mark {
  position: absolute;
  left: 0;
  top: -8px;
  font-size: 56px;
  font-family: Georgia, "Times New Roman", serif;
  color: #3a3a3a;
  line-height: 1;
  opacity: 0.85;
}

.ai-body {
  padding-left: 28px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
}

.ai-conclusion {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 10px;
}

.ai-block {
  margin-top: 8px;
  color: var(--ink-soft);
}

.ai-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #5a7a66;
  background: #eef4f0;
  padding: 2px 7px;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: 1px;
}

.ai-safety {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f2ec;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.ai-disclaimer {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.42);
  line-height: 1.4;
  padding: 0 8px 2px;
}

.ai-body p + p,
.ai-body ul {
  margin-top: 12px;
}

.ai-lead {
  font-weight: 600;
}

.ai-body ul {
  padding-left: 4px;
}

.ai-body li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 8px;
}

.ai-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3a3a3a;
}

.ai-end {
  color: var(--ink-soft);
  margin-top: 14px !important;
}

.mode-panel {
  position: absolute;
  right: 16px;
  bottom: 150px;
  width: 118px;
  background: rgba(180, 180, 180, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
  animation: panelIn 0.25s ease;
}

.mode-panel[hidden] {
  display: none !important;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mode-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s;
}

.mode-card:active {
  transform: scale(0.97);
}

.mode-card.is-active {
  outline: 2px solid #2e2e2e;
}

.mode-card strong {
  font-size: 13px;
  font-weight: 700;
}

.mode-card .lyra {
  font-family: "DM Sans", sans-serif;
  font-style: italic;
  letter-spacing: 0.02em;
}

.mode-card span {
  font-size: 12px;
  color: var(--ink-mute);
}

.mode-card {
  min-height: 44px;
}

.chat-bottom {
  padding: 4px 0 12px;
  background: linear-gradient(180deg, transparent, #f5f2ec 30%);
  position: sticky;
  bottom: 0;
}

.chat-bottom .more-dots {
  display: inline-flex;
  margin-left: auto;
  margin-bottom: 0;
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.input-shell {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid #c8d4e0;
  border-radius: var(--radius-pill);
  padding: 4px 4px 4px 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.input-shell input {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  outline: none;
  padding: 10px 0;
}

.input-shell input::placeholder {
  color: var(--ink-mute);
}

.mic-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #2e2e2e;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.mic-btn:active {
  transform: scale(0.94);
}

.mic-btn svg {
  width: 20px;
  height: 20px;
}

.mic-btn.is-listening {
  background: var(--orange);
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(232, 122, 58, 0.2);
  }
}

.glucose-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.glucose-bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #e8452f 0%, #f0a030 35%, #e8d030 55%, #3ecf4a 100%);
  position: relative;
}

.glucose-pointer {
  position: absolute;
  top: -7px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #6a6a6a;
  transform: translateX(-50%);
}

/* ========== 个人页 ========== */
.screen-profile {
  background:
    linear-gradient(180deg, #fffefb 0%, #faf7f2 36%, #f3f0ea 100%);
}

.screen-label {
  position: absolute;
  top: 36px;
  left: 22px;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.about-title {
  font-size: 26px;
  font-weight: 700;
  font-family: "DM Sans", var(--font);
  color: var(--ink);
}

.profile-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 22px;
  min-height: 150px;
}

.body-viz {
  position: relative;
  flex: 1.2;
  min-height: 150px;
  max-width: 260px;
}

.body-silhouette {
  width: 200px;
  height: auto;
  position: absolute;
  left: -4px;
  top: 0;
  overflow: visible;
}

.callout {
  position: absolute;
  left: 100px;
  font-size: 12px;
  color: #555;
  line-height: 1.35;
  white-space: nowrap;
}

.callout strong {
  color: var(--ink);
  font-weight: 700;
}

.callout-arm {
  top: 68px;
}

.callout-leg {
  top: 108px;
}

.profile-meta {
  flex-shrink: 0;
  padding-top: 4px;
  text-align: right;
  max-width: 120px;
  margin-left: auto;
}

.profile-meta h2 {
  position: relative;
  display: inline-block;
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 10px;
  font-family: "DM Sans", var(--font);
  line-height: 1.1;
}

.name-underline {
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 52%;
  height: 2px;
  background: #7eb6d8;
  border-radius: 1px;
}

.profile-meta p {
  font-size: 13px;
  color: #7a7a7a;
  line-height: 1.45;
}

.info-block {
  margin-bottom: 16px;
}

.curve-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #111;
}

.curve-card {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: grab;
  user-select: none;
}

.curve-card.card-surface {
  border-radius: 0;
  box-shadow: none;
}

.curve-card.is-dragging {
  opacity: 0.45;
}

.curve-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-legend);
  margin-bottom: 6px;
  padding: 0 2px;
}

.curve-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.curve-legend .dot {
  width: 7px;
  height: 7px;
  margin: 0;
}

.curve-plot {
  width: 100%;
  border-radius: 0;
  overflow: hidden;
}

.curve-plot canvas {
  width: 100% !important;
  height: 132px !important;
  display: block;
  background: #f7f3ec;
}

.curve-x {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
  padding: 6px 4px 0;
  font-family: "DM Sans", var(--font);
}

/* 卡片马赛克：左历史+饮食，右运动建议 */
.profile-mosaic {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  grid-template-rows: auto auto;
  gap: 10px;
  margin-bottom: 12px;
  align-items: stretch;
}

.history-block {
  grid-column: 1;
  grid-row: 1;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 14px 28px;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
}

.history-block h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.history-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 10px;
  color: var(--ink-soft);
}

.bar {
  display: block;
  width: 44px;
  height: 10px;
  border-radius: 6px;
  flex-shrink: 0;
}

.bar-green {
  background: var(--green-bright);
}

.bar-yellow {
  background: #f0d030;
}

.profile-exercise {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 16px 16px 28px;
}

.profile-exercise p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  flex: 1;
}

.profile-diet {
  grid-column: 1;
  grid-row: 2;
  margin-bottom: 0 !important;
  padding: 14px 14px 28px;
  min-height: 88px;
}

.profile-diet p {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}

.profile-footer {
  flex-shrink: 0;
  margin-top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px 0 4px;
  gap: 8px;
  background: linear-gradient(180deg, rgba(243, 240, 234, 0) 0%, #f3f0ea 35%, #f3f0ea 100%);
  z-index: 8;
}

.menu-btn {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  flex-shrink: 0;
}

.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
}

.ai-fab-right {
  margin-left: auto;
  margin-right: 4px;
}

/* ========== Home: core cards & risk ========== */
.home-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
  font-weight: 400;
}

.risk-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  margin-bottom: 14px;
  background: var(--green-soft);
  border: 1px solid rgba(92, 184, 122, 0.25);
}

.risk-banner[data-zone="yellow"] {
  background: var(--warn-soft);
  border-color: rgba(201, 137, 74, 0.28);
}

.risk-banner[data-zone="gray"] {
  background: var(--pause-soft);
  border-color: rgba(0, 0, 0, 0.08);
}

.risk-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  margin-top: 22px;
  flex-shrink: 0;
}

.risk-banner[data-zone="yellow"] .risk-dot {
  background: var(--warn);
}

.risk-banner[data-zone="gray"] .risk-dot {
  background: var(--pause);
}

.risk-copy {
  flex: 1;
  min-width: 0;
}

.risk-kicker {
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 4px;
}

.risk-copy strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
}

#risk-reason {
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin-bottom: 2px;
}

#risk-action {
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  font-weight: 500;
}

.risk-banner[data-zone="yellow"] .risk-copy strong,
.risk-banner[data-zone="yellow"] #risk-reason,
.risk-banner[data-zone="yellow"] #risk-action {
  color: var(--warn-text);
}

.risk-banner[data-zone="yellow"] #risk-reason {
  color: #7a6554;
}

.risk-switch {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.risk-switch button {
  font-size: 12px;
  min-height: 32px;
  min-width: 48px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-mute);
}

.risk-switch button.is-on {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.core-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.core-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 16px 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.core-card.is-primary {
  padding: 18px 18px 20px;
  box-shadow: 0 10px 32px rgba(40, 30, 20, 0.1);
}

.core-card.is-secondary {
  padding: 14px 16px 16px;
}

.core-card.is-tertiary.is-idle {
  padding: 12px 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  background: #f7f5f1;
}

.core-card.is-tertiary.is-done {
  padding: 14px 16px 16px;
}

.status-verdict {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin: 4px 0 14px;
  color: #2f6b4f;
}

.status-verdict.is-warn {
  color: var(--warn-text);
}

.status-verdict.is-pause {
  color: #5a5a5a;
}

.core-card-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.core-card-head h2 {
  font-size: 20px;
  font-weight: 700;
}

.core-card.is-primary .core-card-head h2 {
  font-size: 22px;
}

.core-card.is-secondary .core-card-head h2 {
  font-size: 18px;
}

.core-tag {
  display: inline-flex;
  align-self: flex-start;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.tag-status {
  background: var(--green-soft);
  color: #2f7a4a;
}

.tag-action {
  background: #eef2f8;
  color: #4a5f7a;
}

.tag-feedback {
  background: var(--beige-card);
  color: #7a5a3a;
}

.core-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.core-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  line-height: 1.4;
}

.core-lines span {
  color: var(--ink-soft);
}

.core-lines strong {
  font-weight: 600;
  text-align: right;
}

.core-tip {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #3a5a44;
  background: var(--green-soft);
  padding: 10px 12px;
  border-radius: 14px;
}

.action-primary {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 6px;
}

.action-alts {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 12px;
}

.action-alts li {
  padding: 1px 0;
}

.btn-start {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 14px 16px;
  border-radius: var(--radius-pill);
  background: #2f6b4f;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  transition: opacity 0.2s, transform 0.15s, background 0.2s;
}

.btn-start:active {
  transform: scale(0.98);
}

.btn-start:disabled {
  background: #9a9a9a;
  opacity: 0.75;
  cursor: not-allowed;
}

.drag-hint {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 11px;
  color: var(--ink-mute);
}

.core-card.is-tertiary.is-idle .drag-hint {
  bottom: 8px;
}

.feedback-thin {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}

.feedback-thin p {
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 500;
}

.feedback-idle {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 6px;
}

.feedback-idle.soft,
.feedback-note.soft {
  color: var(--ink-soft);
  font-size: 13px;
}

.feedback-note {
  font-size: 13px;
  line-height: 1.45;
  margin-top: 8px;
  color: var(--ink-soft);
}

.secondary-panel {
  margin-bottom: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--border);
  padding: 2px 10px 8px;
}

.secondary-panel summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mute);
  padding: 10px 4px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.secondary-panel summary::-webkit-details-marker {
  display: none;
}

.chart-secondary {
  margin: 0;
  box-shadow: none;
  border: 1px solid var(--border);
}

.chart-secondary .chart-wrap {
  height: 100px;
}

.device-oneline {
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
  padding: 4px 8px 10px;
  line-height: 1.4;
}

.device-card {
  background: #f3f1ec;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.device-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.device-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 5px 0;
  color: var(--ink-soft);
}

.device-list strong {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
  max-width: 58%;
}

.device-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-mute);
  line-height: 1.4;
}

.device-card-sm {
  margin-bottom: 14px;
}

.profile-identity {
  font-size: 12px !important;
  line-height: 1.4 !important;
  margin: 6px 0 8px !important;
  color: var(--ink-soft) !important;
  text-align: right;
}

/* ========== Workout screen ========== */
.screen-workout {
  background: linear-gradient(180deg, #fbf8f3 0%, #f0ebe3 100%);
  align-items: stretch;
  text-align: center;
  padding-top: 64px;
}

.workout-eyebrow {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.workout-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 28px;
}

.workout-timer-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: background 0.35s, box-shadow 0.35s;
}

.workout-badge {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #2f6b4f;
  margin-bottom: 16px;
}

.workout-timer-wrap[data-intensity="strong"] .workout-badge {
  background: #f3e6d6;
  color: #8a5a2e;
}

.workout-timer-wrap[data-intensity="light"] .workout-badge {
  background: #eef2f0;
  color: #4a5c52;
}

.workout-timer-wrap[data-intensity="strong"] {
  background: var(--warn-soft);
  box-shadow: 0 8px 28px rgba(160, 100, 40, 0.12);
}

.workout-timer-wrap[data-intensity="light"] {
  background: #f3f6f4;
}

.workout-timer-wrap.is-rebound {
  animation: rebound 0.55s ease;
}

@keyframes rebound {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(0.97);
  }
  100% {
    transform: scale(1);
  }
}

.workout-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-bottom: 22px;
}

.workout-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--green);
  transition: width 0.35s ease;
}

.workout-timer-wrap[data-intensity="strong"] .workout-progress-bar {
  background: var(--warn);
}

.workout-timer {
  font-size: 48px;
  font-weight: 700;
  font-family: "DM Sans", var(--font);
  line-height: 1.1;
}

.workout-timer span {
  font-size: 22px;
  color: var(--ink-mute);
  font-weight: 500;
}

.workout-intensity {
  margin-top: 14px;
  font-size: 16px;
  font-weight: 600;
}

.workout-hint {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 280px;
}

.workout-hint[hidden] {
  display: none;
}

.workout-steps {
  list-style: none;
  margin-top: 14px;
  padding: 0;
  width: 100%;
  max-width: 260px;
  text-align: left;
  counter-reset: step;
}

.workout-steps[hidden] {
  display: none;
}

.workout-steps li {
  position: relative;
  padding: 10px 12px 10px 40px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  font-weight: 600;
  color: #5c4330;
  line-height: 1.35;
  counter-increment: step;
}

.workout-steps li::before {
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e8d4bc;
  color: #6a4a2e;
  font-size: 12px;
  display: grid;
  place-items: center;
}

.workout-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.workout-actions.encourage-slow {
  grid-template-columns: 1.35fr 1fr;
}

.btn-slow,
.btn-end {
  min-height: 48px;
  padding: 14px 12px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 600;
  transition: background 0.25s, opacity 0.25s, box-shadow 0.25s, transform 0.15s;
}

.btn-slow {
  background: #ebe6df;
  color: var(--ink);
}

.btn-end {
  background: #2e2e2e;
  color: #fff;
}

.btn-slow.is-primary {
  background: #efdcc4;
  color: #5a3d22;
  box-shadow: 0 6px 16px rgba(160, 110, 50, 0.16);
  font-size: 16px;
}

.btn-end.is-secondary {
  background: #5a5a5a;
  opacity: 0.72;
  font-weight: 500;
  box-shadow: none;
}

.workout-foot {
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.4;
}

/* ========== Chat context & follow-ups ========== */
.context-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #eef4f0;
  border: 1px solid rgba(92, 184, 122, 0.3);
  border-radius: 14px;
  padding: 8px 8px 8px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #2f5a40;
}

.context-chip[hidden] {
  display: none !important;
}

.context-chip span {
  flex: 1;
}

.context-chip button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  font-size: 18px;
  line-height: 1;
  color: var(--ink-soft);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.follow-ups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 10px;
}

.follow-chip {
  font-size: 13px;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink-soft);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.follow-chip:active {
  background: var(--green-soft);
  color: #2f5a40;
}

/* ========== Summary sheet ========== */
.summary-sheet {
  position: absolute;
  inset: 0;
  z-index: 80;
  background: rgba(30, 28, 24, 0.35);
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.summary-sheet[hidden] {
  display: none !important;
}

.summary-panel {
  width: 100%;
  background: #fffefb;
  border-radius: 24px;
  padding: 22px 20px 20px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);
  animation: sheetUp 0.3s ease;
}

@keyframes sheetUp {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.summary-panel h3 {
  font-size: 18px;
  margin-bottom: 14px;
}

.summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.summary-list span {
  color: var(--ink-soft);
}

.summary-encourage {
  margin: 14px 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: #3a5a44;
}

/* ========== Drag Ghost & Toast ========== */
.drag-ghost {
  position: absolute;
  z-index: 100;
  pointer-events: none;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  font-weight: 600;
  max-width: 160px;
  transform: translate(-50%, -50%) rotate(-4deg);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: #2e2e2e;
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  z-index: 110;
  white-space: nowrap;
  animation: toastIn 0.3s ease;
}

.toast[hidden] {
  display: none;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ========== Responsive ========== */
@media (max-width: 440px) {
  body {
    background: var(--bg);
    align-items: stretch;
  }

  .app-shell {
    padding: 0;
    width: 100%;
    height: 100%;
  }

  .phone {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .phone-notch {
    display: none;
  }
}

/* ========== Demo bar ========== */
.demo-bar {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: rgba(28, 28, 28, 0.72);
  backdrop-filter: blur(12px);
  border-radius: 999px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.demo-btn {
  padding: 8px 16px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.demo-btn:hover {
  color: #fff;
}

.demo-btn.is-active {
  background: #fff;
  color: #1a1a1a;
}

/* ========== Phone OS layers ========== */
.os-layer {
  --os-solid: #2c2c2e;
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 14px;
  color: #fff;
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
  background: var(--os-solid);
  scrollbar-width: none;
}

.os-layer::-webkit-scrollbar {
  display: none;
}

.os-layer.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 25;
}

.os-layer[hidden] {
  display: none !important;
}

.os-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  opacity: 0.88;
  padding-top: 2px;
}

.os-lock-icon {
  display: flex;
  justify-content: center;
  margin: 8px 0 4px;
  opacity: 0.9;
}

.os-dual-clock {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.os-home-clocks {
  margin-top: 18px;
}

.os-clock strong {
  display: block;
  font-family: "DM Sans", var(--font);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.os-home-clocks .os-clock strong {
  font-size: 34px;
}

.os-clock span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  opacity: 0.9;
}

.os-clock small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  opacity: 0.65;
}

.os-widget-row {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr 0.55fr;
  gap: 8px;
  margin-bottom: 12px;
}

.os-pill,
.os-steps,
.os-mini-icon {
  height: 60px;
  border-radius: 16px;
  background: rgba(58, 58, 60, 0.92);
}

.os-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.os-steps {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.os-steps b {
  font-family: "DM Sans", var(--font);
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
}

.os-steps small {
  font-size: 10px;
  opacity: 0.65;
  margin-top: 2px;
}

.os-search {
  margin: 4px 0 14px;
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(48, 48, 50, 0.95);
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  text-align: center;
}

.os-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 8px;
  padding: 0 2px;
}

.os-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 10px;
}

.os-app .ico,
.os-app-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.os-app-icon {
  object-fit: cover;
}

.os-app--biocore {
  color: #fff;
}

.os-app--biocore .os-app-icon {
  background: #f2e3d5;
}

.ico-photos { background: linear-gradient(145deg, #f2a4c8, #7ec8f0); }
.ico-folder { background: linear-gradient(145deg, #ffd56a, #f0a020); }
.ico-social { background: linear-gradient(145deg, #7ec8ff, #4a8ef0); }
.ico-food { background: linear-gradient(145deg, #ff9a6b, #ff5c3a); }
.ico-shop { background: linear-gradient(145deg, #ff6b9a, #e04080); }
.ico-music { background: linear-gradient(145deg, #ff6b8a, #ff3d6e); }
.ico-pay { background: linear-gradient(145deg, #4db8ff, #1677ff); }
.ico-health { background: linear-gradient(145deg, #ff7a6e, #ff4d5a); }
.ico-video { background: linear-gradient(145deg, #7ec8ff, #fb7299); }
.ico-mail { background: linear-gradient(145deg, #5aa9ff, #3d7eff); }
.ico-set { background: linear-gradient(145deg, #8a8f98, #5c616a); }
.ico-phone { background: #2ad158; }
.ico-files { background: linear-gradient(145deg, #6ec6ff, #4a90e2); }
.ico-chat { background: #2ad158; }
.ico-cam { background: #636366; }

.os-dock {
  margin-top: auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 14px;
  border-radius: 26px;
  background: rgba(48, 48, 50, 0.85);
}

.os-dock .ico {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.os-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 40px 2px;
}

.os-nav span {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
}

.os-nav span:nth-child(2) {
  border-radius: 50%;
}

.os-nav span:nth-child(3) {
  width: 14px;
  height: 14px;
  border-radius: 2px;
}

.os-lock-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  padding: 8px 6px 2px;
  pointer-events: none;
}

.os-round-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(58, 58, 60, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.os-round-btn svg {
  width: 20px;
  height: 20px;
}

/* ========== BioCore 卡片组件（严格按图二） ========== */
.bc-widget {
  position: relative;
  z-index: 6;
  margin: 4px 0 8px;
}

.bc-card {
  --bc-bg: #c6bbb0;
  --bc-signal: #6dff2e;
  position: relative;
  height: 148px;
  border-radius: 34px;
  background: var(--bc-bg);
  border: 2.5px solid #1a1a1a;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  overflow: visible;
}

/* 右上切角井：露出纯色底，并形成凹陷感 */
.bc-card__well {
  position: absolute;
  top: -2.5px;
  right: -2.5px;
  width: 88px;
  height: 88px;
  background: var(--os-solid);
  border-radius: 0 34px 0 28px;
  padding: 11px;
  box-sizing: border-box;
  z-index: 3;
  /* 沿切角补黑边 */
  box-shadow:
    -2.5px 0 0 #1a1a1a,
    0 2.5px 0 #1a1a1a;
}

.bc-card__signal {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background: var(--bc-signal);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.bc-card__arc-light {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 26px;
  height: 26px;
  pointer-events: none;
}

.bc-card__body {
  position: relative;
  height: 100%;
  padding: 14px 96px 12px 20px;
  display: flex;
  flex-direction: column;
}

.bc-card__brand {
  position: absolute;
  top: 14px;
  right: 96px;
  font-family: "DM Sans", var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: rgba(30, 28, 26, 0.55);
}

.bc-card__metric {
  margin-top: 2px;
}

.bc-card__value {
  display: block;
  font-family: "DM Sans", var(--font);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.92;
  color: #111;
}

.bc-card__unit {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
}

.bc-card__part-a {
  margin-top: auto;
  display: block;
  width: 100%;
  text-align: left;
  position: relative;
  padding: 4px 36px 2px 0;
  cursor: pointer;
}

.bc-card__msg {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: #1a1a1a;
}

.bc-card__arc-dark {
  position: absolute;
  right: 0;
  bottom: -2px;
  width: 32px;
  height: 32px;
  pointer-events: none;
}

/* 展开面板 */
.bc-pop {
  position: relative;
  z-index: 4;
}

.bc-pop[hidden] {
  display: none !important;
}

.bc-pop--up {
  margin-bottom: 8px;
  animation: bc-pop-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.bc-pop--down {
  margin-top: 8px;
  animation: bc-pop-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes bc-pop-in {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.bc-pop__panel {
  position: relative;
  border-radius: 26px;
  padding: 16px 18px;
  min-height: 96px;
}

.bc-pop__panel--up {
  background: #e8efc8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bc-pop__panel--down {
  background: #d8d6d2;
  display: flex;
  flex-direction: column;
}

.bc-pop__eyebrow {
  display: block;
  font-size: 12px;
  color: rgba(30, 30, 30, 0.7);
  margin-bottom: 4px;
}

.bc-pop__level {
  display: block;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #111;
  line-height: 1;
}

.bc-pop__gauge {
  position: relative;
  width: 18px;
  height: 72px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e23b2e 0%, #f0a020 40%, #e8d44a 62%, #6dff2e 100%);
  flex-shrink: 0;
  margin-right: 8px;
}

.bc-pop__needle {
  position: absolute;
  left: -9px;
  bottom: 10px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #111;
}

.bc-pop__title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin-bottom: 10px;
}

.bc-pop__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.bc-pop__list li {
  font-size: 14px;
  color: #222;
  padding-left: 12px;
  position: relative;
}

.bc-pop__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #444;
}

.bc-pop__enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.bc-pop__dots {
  position: absolute;
  right: 16px;
  top: 48%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bc-pop__dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(40, 40, 40, 0.45);
}

.bc-pop__bracket {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 4px solid #3a342e;
  pointer-events: none;
}

.bc-pop__bracket--bl {
  left: 14px;
  bottom: 12px;
  border-right: none;
  border-top: none;
  border-radius: 0 0 0 10px;
}

.bc-pop__bracket--tr {
  right: 14px;
  top: 12px;
  border-left: none;
  border-bottom: none;
  border-radius: 0 10px 0 0;
}

.bc-pop__tail {
  position: absolute;
  left: 78%;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

.bc-pop__tail--down {
  bottom: -7px;
  border-top: 8px solid #e8efc8;
}

.bc-pop__tail--up {
  top: -7px;
  left: 82%;
  border-bottom: 8px solid #d8d6d2;
}

.app-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.app-layer[hidden] {
  display: none !important;
}

.phone.is-os .app-layer {
  pointer-events: none;
}

.phone.is-app .os-layer {
  pointer-events: none;
}

@media (max-width: 899px) {
  .demo-bar {
    position: sticky;
    top: 12px;
  }
}
