:root {
  --bg: #f7f7f7;
  --border: #d9d9d9;
  --text: #222;
  --muted: #666;
  --primary: #111;
  --chip-bg: #eee;
  --chip-active: #111;
  --chip-active-text: #fff;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --font-scale: 1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Heiti SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: calc(16px * var(--font-scale));
}

:root {
  --success: #12924f;
  --error: #c62828;
  --accent: #0a84ff;
  --accent-soft: #3b82f6;
}

.btn {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  padding: 8px 14px;
  font-size: calc(14px * var(--font-scale));
  cursor: pointer;
  transition: background 0.2s ease, transform 0.05s ease;
}

.btn.small {
  padding: 4px 10px;
  font-size: calc(12px * var(--font-scale));
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: #000;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:hover:not(:disabled) {
  background: #f3f3f3;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.action-bar {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: 0 var(--space-2);
}

.action-bar:empty {
  display: none;
}

.theory-card {
  background: #fdf7ed;
  border: 1px solid #f6d9b3;
  box-shadow: 0 18px 40px rgba(246, 217, 179, 0.4);
  color: #7c4a0b;
}

.theory-text {
  color: #7c4a0b;
  line-height: 1.7;
  font-size: calc(14px * var(--font-scale));
}

.font-ctrls {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin: 4px 0 8px;
}

.theory-card .title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: nowrap;
}

.theory-card .title-row .font-ctrls {
  margin: 0;
}

.theory-card .section-title {
  margin: 0;
}

.environment {
  display: block;
  --font-scale: 1;
  font-size: 16px;
}

.env-slider-shell {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 24px;
  transition: opacity 0.2s ease;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.env-slider-shell::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.env-slider-shell.loading {
  opacity: 0.65;
}

.env-track {
  display: flex;
  width: 100%;
  transition: transform 0.35s ease;
}

.env-dots {
  margin-top: var(--space-2);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.env-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.28);
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.env-dot.active {
  background: var(--accent);
  border-color: rgba(10, 132, 255, 0.35);
}

.env-note {
  margin-top: var(--space-3);
  font-size: 13px;
  color: var(--muted);
  padding-left: var(--space-1);
}

.env-card {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border: none;
  border-radius: 24px;
  background: radial-gradient(circle at 0% 50%, rgba(10, 132, 255, 0.14), transparent 60%);
  box-shadow: none;
  position: relative;
  overflow: hidden;
  min-width: 100%;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.env-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

.env-card.placeholder {
  justify-content: center;
  min-height: 160px;
  cursor: default;
}

.env-card.active {
  box-shadow: none;
  transform: translateY(-2px);
}

.env-main {
  flex: 2;
  min-width: 260px;
  display: grid;
  gap: var(--space-2);
}

.env-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.env-sub-line {
  font-size: calc(11px * var(--font-scale));
  color: rgba(17, 17, 17, 0.6);
}

.env-digest {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.env-digest span {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 12px;
  color: rgba(17, 17, 17, 0.7);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 999px;
}

.env-metrics {
  flex: 1;
  min-width: 220px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}

.env-city {
  font-size: calc(28px * var(--font-scale));
  font-weight: 700;
}

.env-season {
  font-size: 16px;
  color: rgba(17, 17, 17, 0.6);
}

.env-day {
  font-size: calc(13px * var(--font-scale));
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, 0.55);
}

.env-temp-block {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.env-temp {
  font-size: calc(54px * var(--font-scale));
  font-weight: 600;
}

.env-meta {
  font-size: calc(12px * var(--font-scale));
  color: rgba(17, 17, 17, 0.5);
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
}

.meta-label {
  font-size: calc(11px * var(--font-scale));
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.metric {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: calc(13px * var(--font-scale));
  color: rgba(17, 17, 17, 0.6);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.metric strong {
  font-size: calc(22px * var(--font-scale));
  color: var(--text);
  font-weight: 600;
}

.metric strong.aqi-good {
  color: var(--success);
}

.metric strong.aqi-moderate {
  color: #b98500;
}

.metric strong.aqi-unhealthy {
  color: #d0451b;
}

.metric strong.aqi-vunhealthy {
  color: #ad1457;
}

.metric strong.aqi-hazardous {
  color: #8b0000;
}

.metric #statAqi.aqi-good {
  color: var(--success);
}

.metric #statAqi.aqi-moderate {
  color: #b98500;
}

.metric #statAqi.aqi-unhealthy {
  color: #d0451b;
}

.metric #statAqi.aqi-vunhealthy {
  color: #ad1457;
}

.metric #statAqi.aqi-hazardous {
  color: #8b0000;
}

@media (max-width: 768px) {
  .env-card {
    flex-direction: column;
    gap: var(--space-5);
  }

  .env-temp {
    font-size: 48px;
  }
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card h3 {
  margin: 0 0 var(--space-2);
  font-size: calc(16px * var(--font-scale));
}

.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* 展示顶部天气指标栅格 */

.muted {
  color: var(--muted);
  font-size: calc(12px * var(--font-scale));
}

.content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-4);
}

.custom-input-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.custom-input {
  flex: 1;
  min-width: 200px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: var(--space-2) var(--space-3);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.btns.center-btns {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #999;
  font-size: 10px;
  background: none;
  border: none;
  padding: 4px 12px;
  cursor: pointer;
}

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

.nav-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

/* Adjust main content for bottom nav */
main {
  padding-bottom: 80px;
  /* Space for bottom nav */
}

/* Mine Page Styles (Migrated from mine.html) */
.user-info {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avatar-section {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.avatar-wrapper {
  order: 2;
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-login-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.avatar-login-btn:hover {
  background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.avatar-login-btn:active {
  transform: translateY(0);
}

.avatar-login-btn .login-icon {
  font-size: 28px;
  filter: brightness(0) invert(1);
}

.avatar-login-btn .login-text {
  font-size: 11px;
  color: white;
  font-weight: 500;
}


.user-details {
  flex: 1;
  order: 1;
}

.username {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  display: block;
  margin-bottom: 5px;
}

.welcome {
  font-size: 14px;
  color: #666;
  margin-bottom: 3px;
}

.subscription-info-text {
  font-size: 13px;
  color: #4CAF50;
  font-weight: 500;
}

.login-btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  width: 100%;
}

.login-btn:hover {
  background: #45a049;
}

.section-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
}

.menu-list {
  border-top: 1px solid #f0f0f0;
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.menu-item:hover {
  background: #f9f9f9;
}

.menu-text {
  font-size: 14px;
  color: #333;
}

.menu-arrow {
  color: #999;
  font-size: 16px;
}

.subscription-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.subscription-buttons .login-btn {
  flex: 1;
  min-width: 80px;
  text-align: center;
}

.mine-text {
  color: #666;
  font-size: 14px;
}

/* Modal Styles (Existing) */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  /* Higher than bottom nav */
  backdrop-filter: blur(4px);
}

.modal-content {
  background: #fff;
  width: 90%;
  max-width: 500px;
  border-radius: 12px;
  padding: var(--space-5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal h3 {
  margin-top: 0;
}

.modal textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: var(--space-3) 0;
  font-family: inherit;
  resize: vertical;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Consultation List Item */
.cons-item {
  padding: var(--space-3);
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s;
}

.cons-item:last-child {
  border-bottom: none;
}

.cons-item:hover {
  background: #fafafa;
}

.cons-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cons-title {
  font-weight: 600;
}

.cons-status {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eee;
  color: #666;
}

.cons-status.pending {
  background: #e6f7ff;
  color: #1890ff;
}

.cons-status.completed {
  background: #f6ffed;
  color: #52c41a;
}

.cons-time {
  font-size: 12px;
  color: #999;
}

.highlight-text {
  background: #fff7e6;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ffd591;
  color: #d46b08;
}

.recipe-preview {
  background: #f9f9f9;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.form .row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.form .row.compact {
  margin-bottom: var(--space-2);
}

.label {
  font-size: calc(12px * var(--font-scale));
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

#bodyInfo,
.body-info {
  text-align: center;
  color: var(--accent-soft);
  line-height: 1.8;
  font-weight: 500;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.chip {
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: var(--space-1) var(--space-3);
  font-size: calc(13px * var(--font-scale));
  background: var(--chip-bg);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.chip.active {
  background: var(--chip-active);
  color: var(--chip-active-text);
  border-color: var(--chip-active);
}

.chip:hover {
  background: #e7e7e7;
}

.list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sku {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sku-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.sku-title {
  font-weight: 600;
  font-size: calc(18px * var(--font-scale));
}

.grid,
.grid-2-1 {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-4);
  min-height: 80px;
  font-size: calc(14px * var(--font-scale));
  line-height: 1.7;
  background: #fafafa;
}

.label-preview,
.label-line,
.qr {
  display: none;
}

.block strong {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 14px;
}

.block ul {
  margin: 0;
  padding-left: 18px;
}

.block ul li {
  margin: var(--space-1) 0;
}

.block p {
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  font-size: calc(12px * var(--font-scale));
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}

.badge::before {
  content: "\25CF";
  font-size: 10px;
  color: var(--accent);
}

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

  100% {
    background-position: 200px 0;
  }
}

.loading .kv span,
.loading .block {
  color: transparent;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
  background-size: 400px 100%;
  animation: shimmer 1.2s infinite;
}

.empty {
  padding: var(--space-10);
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fff;
}

.sku-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.sku-actions .btn {
  flex: 1;
}

@media (max-width: 900px) {
  .content {
    grid-template-columns: 1fr;
  }

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

  .label-preview {
    width: 100%;
  }

  header {
    flex-direction: column;
    gap: 12px;
  }

  .actions {
    width: 100%;
    justify-content: center;
  }
}

.page-container {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-4);
  min-height: 100vh;
  background: #f5f5f5;
}

.goal-custom-line {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 5px;
}

.goal-custom-line .text-input {
  flex: 1;
  width: auto;
  margin-bottom: 0;
  padding: 6px 12px;
  height: 36px;
  font-size: 14px;
}

.goal-custom-line .btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}


/* Chat & Consultation UI Improvements */

/* Consultation Input Box */
#consultNote {
  min-height: 150px;
  /* Increase height as requested */
  font-size: 16px;
  /* Ensure readable font size */
  padding: 12px;
}



.context-info-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #4b5563;
}

.context-info-row {
  display: flex;
  margin-bottom: 6px;
}

.context-info-row:last-child {
  margin-bottom: 0;
}

.context-label {
  font-weight: 600;
  color: #374151;
  width: 70px;
  flex-shrink: 0;
}

.context-value {
  color: #111827;
}

/* Image Preview Container */
.image-preview-container {
  margin-bottom: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  display: inline-block;
}

.image-preview-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
  display: block;
}

.image-preview-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

/* 通用文本输入框样式 */
.text-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.6;
  box-sizing: border-box;
  margin-bottom: 15px;
  font-family: inherit;
}

.text-input:focus {
  border-color: var(--primary-color);
  outline: none;
}

/* 咨询专用输入框（多行） */
textarea.text-input,
#consultNote {
  min-height: 150px;
  resize: vertical;
}

/* Chat UI in Detail Modal */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px 0;
  margin-bottom: 20px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.chat-msg.user {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg.nutri {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-content {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  word-wrap: break-word;
}

.chat-msg.user .msg-content {
  background: #111;
  /* Primary color */
  color: #fff;
  border-bottom-right-radius: 2px;
}

.chat-msg.nutri .msg-content {
  background: #f3f4f6;
  color: #1f2937;
  border-bottom-left-radius: 2px;
}

.msg-time {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
  padding: 0 4px;
}

/* Reply Input Bar */
.reply-section {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: #fff;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.reply-input-wrapper {
  flex: 1;
  position: relative;
}

.reply-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  /* Auto-grow handled by JS or fixed height */
  height: 42px;
  /* Single line height */
  font-family: inherit;
  transition: border-color 0.2s;
}

.reply-input:focus {
  outline: none;
  border-color: #111;
}

.reply-btn {
  background: #111;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0 20px;
  height: 42px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.reply-btn:hover {
  opacity: 0.9;
}

.reply-btn:disabled {
  background: #e5e7eb;
  cursor: not-allowed;
}

/* Updated Consult Card Styles */
.consult-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.1s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.consult-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.consult-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.consult-time {
  font-size: 12px;
  color: #6b7280;
}

.consult-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 500;
}

.consult-status.pending {
  background: #eff6ff;
  color: #3b82f6;
}

.consult-status.replied {
  background: #ecfdf5;
  color: #10b981;
}

.consult-status.completed {
  background: #f3f4f6;
  color: #6b7280;
}

.consult-status.updated {
  background: #fff7ed;
  color: #f97316;
}

.consult-title {
  font-weight: 600;
  font-size: 15px;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cons-tag.updated {
  font-size: 10px;
  background: #fff7ed;
  color: #f97316;
  padding: 1px 4px;
  border: 1px solid #ffedd5;
  border-radius: 4px;
}

.consult-preview {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
  display: -webkit-box;
  display: box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  box-orient: vertical;
  overflow: hidden;
}

/* View Section Spacing */
.view-section>*+* {
  margin-top: var(--space-5);
}

/* Consultation Detail Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.modal-box {
  background: #fff;
  width: 90%;
  max-width: 400px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

.modal-header {
  padding: 15px;
  border-bottom: 1px solid #eee;
  font-weight: 600;
  text-align: center;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 15px;
  border-top: 1px solid #eee;
  text-align: center;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 5px;
}

.detail-text {
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}

.detail-time {
  font-size: 12px;
  color: #ccc;
  margin-top: 5px;
}

.detail-section.reply {
  background: #f9f9f9;
  padding: 10px;
  border-radius: 8px;
}

.formula-card {
  background: #e6ffec;
  border: 1px solid #b7eb8f;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}

.formula-header {
  font-weight: 600;
  color: #135200;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.formula-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ing-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  border-bottom: 1px dashed #d9f7be;
  padding-bottom: 4px;
}

.ing-row:last-child {
  border-bottom: none;
}

/* View Switching */
.view-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Nutritionist Selection Modal */
.nutri-selection-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}

.nutri-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s;
}

.nutri-card:hover {
  background: #f9f9f9;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nutri-card.selected {
  border-color: var(--accent);
  background: #f0f7ff;
}

.nutri-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.nutri-info {
  flex: 1;
}

.nutri-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.nutri-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #666;
  align-items: center;
}

.nutri-rating {
  color: #ffc107;
  font-weight: bold;
}

.nutri-loc {
  background: #eee;
  padding: 2px 6px;
  border-radius: 4px;
}

.nutri-loc.near {
  background: #e6f7ff;
  color: #1890ff;
}