/* Import Google Fonts for Chinese typography */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&family=Noto+Serif+SC:wght@400;600;700&display=swap');

/* --- DESIGN SYSTEM TOKENS --- */
:root {
  --color-brand: #2F5233;       /* 竹青色 (Bamboo Green) - Life & Health */
  --color-brand-light: #eef4ef; /* 浅竹绿 */
  --color-accent: #D2A267;      /* 琥珀金 (Amber Gold) - Warmth & Quality */
  --color-accent-light: #F7EFE5;/* 浅琥珀 */
  --color-bg-paper: #F9F8F3;    /* 宣纸白 (Rice White) - Main Background */
  --color-bg-grey: #EAE7DF;     /* 远山灰 (Mountain Grey) - Secondary Background */
  --color-warning: #A61B22;     /* 朱砂红 (Vermilion Red) - Emergency/SOS */
  --color-text-primary: #2A2F2B; /* 墨玉黑 (Charcoal Black) - Primary Text */
  --color-text-secondary: #5F6661;/* 松针灰 (Sage Grey) - Secondary Text */
  --color-text-muted: #8E9690;   /* 尘埃灰 (Muted Grey) */
  --color-border: #DCD9D0;      /* 瓦片灰 (Border color) */
  
  --font-title: 'Noto Serif SC', serif;
  --font-body: 'Noto Sans SC', sans-serif;
  
  --shadow-sm: 0 2px 8px rgba(47, 82, 51, 0.05);
  --shadow-md: 0 8px 24px rgba(47, 82, 51, 0.08);
  --shadow-lg: 0 16px 48px rgba(47, 82, 51, 0.12);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- RESET & GLOBAL STYLES --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: #f1efe9;
  background-image: url('zen_shanshui_bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--color-text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Background Ink wash paper filter overlay */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(241, 239, 233, 0.85); /* Rice paper filter wash */
  backdrop-filter: blur(2px);
  z-index: -1;
  pointer-events: none;
}

/* --- DESKTOP WRAPPER LAYOUT (Centered Simulator) --- */
.desktop-wrapper {
  display: flex;
  width: 100%;
  height: 100vh;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.phone-panel {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- [NEW] HIDDEN DEBUG DRAWER ON LEFT --- */
.debug-drawer {
  position: fixed;
  top: 0;
  left: -320px;
  width: 320px;
  height: 100%;
  background-color: rgba(249, 248, 243, 0.92);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform: translateX(0);
}

.debug-drawer.active {
  transform: translateX(320px);
}

.debug-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(1.5px);
  z-index: 4900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.debug-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.debug-drawer-header {
  padding: 22px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(234, 231, 223, 0.4);
}

.debug-drawer-header h3 {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--color-brand);
  font-weight: 600;
}

.debug-drawer-close {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  outline: none;
}

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

.demo-controls-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.console-btn {
  background-color: #f1efe9;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
}

.console-btn:hover {
  background-color: var(--color-brand);
  border-color: var(--color-brand);
  color: #fff;
}

.console-btn.accent {
  background-color: rgba(210, 162, 103, 0.1);
  border-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 500;
}

.console-btn.accent:hover {
  background-color: var(--color-accent);
  color: #fff;
}

/* Floating Toggle Button */
.drawer-toggle-btn {
  position: fixed;
  top: 24px;
  left: 24px;
  background-color: rgba(249, 248, 243, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  color: var(--color-brand);
  padding: 10px 18px;
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 4500;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  outline: none;
}

.drawer-toggle-btn:hover {
  background-color: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* --- SMARTPHONE SIMULATOR CONTAINER --- */
.phone-mockup {
  position: relative;
  width: 375px;
  height: 812px;
  max-height: calc(100vh - 40px); /* Scale down height on smaller desktop viewports to prevent overflow */
  border-radius: 20px;
  background-color: var(--color-bg-paper);
  border: 1px solid rgba(210, 162, 103, 0.2);
  box-shadow: 0 15px 45px rgba(78, 68, 56, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Phone top notch and elements */
.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 30px;
  background-color: #2d3330;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-camera {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #0b110e;
  margin-right: 12px;
}

.phone-speaker {
  width: 40px;
  height: 3px;
  border-radius: 2px;
  background-color: #151a17;
}

/* Phone bottom bar indicator */
.phone-home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 5px;
  border-radius: 3px;
  background-color: var(--color-text-primary);
  z-index: 998;
  pointer-events: none;
}

/* Status Bar styling */
.phone-status-bar {
  height: 44px;
  padding: 12px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-primary);
  background-color: transparent;
  z-index: 990;
  user-select: none;
}

.status-left {
  font-feature-settings: "tnum";
}

.status-right {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Screen container for transitions */
.phone-screen {
  flex: 1;
  position: relative;
  background-color: var(--color-bg-paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- APP PAGES STYLING --- */
.app-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 84px - env(safe-area-inset-bottom, 0px)); /* minus floating nav bar offset and safe area */
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: scale(0.97);
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); /* padding to clear nav bar and safe area */
  box-sizing: border-box;
}

.app-page.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* Scrollbar styles for the phone app */
.app-page::-webkit-scrollbar {
  width: 4px;
}
.app-page::-webkit-scrollbar-track {
  background: transparent;
}
.app-page::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

/* --- PAGE 1: HOME PAGE (万物归一) --- */

/* Shanshui Dynamic Header */
.home-shanshui-header {
  height: 235px; /* Slightly taller for more space and design breathability */
  background-image: url('suwen_header_bg.png');
  background-size: cover;
  background-position: center bottom;
  position: relative;
  padding: 24px 20px 0 20px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background-color: var(--color-bg-paper);
  overflow: hidden;
  border-bottom: 1px solid rgba(210, 162, 103, 0.15); /* softer, more delicate line */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

/* Ambient wash overlay - stretched gradient boundary for seamless melting effect */
.home-shanshui-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(249, 248, 243, 0) 0%, rgba(249, 248, 243, 0.25) 45%, rgba(249, 248, 243, 0.75) 75%, var(--color-bg-paper) 100%);
  z-index: 1;
  pointer-events: none;
}

.header-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 10;
}

.header-logo-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo-svg {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.header-logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-title);
  font-size: 1.25rem; /* slightly larger for premium presence */
  font-weight: 700;
  color: var(--color-brand);
  letter-spacing: 0.12em; /* wider spacing for designer look */
  margin: 0;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.logo-subtitle {
  font-family: var(--font-title);
  font-size: 0.52rem;
  color: var(--color-accent);
  margin: 4px 0 0 0;
  letter-spacing: 0.18em; /* premium micro-copy letter-spacing */
  text-transform: uppercase;
  opacity: 0.9;
}

.header-profile-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.profile-icon-svg {
  width: 24px;
  height: 24px;
}

.profile-badge {
  position: absolute;
  bottom: -4px;
  right: -6px;
  background-color: var(--color-brand);
  color: #fff;
  font-size: 0.52rem;
  padding: 1px 4px;
  border-radius: 10px;
  border: 1px solid #FAF9F5;
  font-family: var(--font-body);
  white-space: nowrap;
}

/* Stamp style removed for a cleaner look */

/* Main Home Content Section */
.home-content {
  padding: 0 16px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: -45px; /* pulled up more to overlap the taller header beautifully */
  position: relative;
  z-index: 15;
}

/* Voice Dialog Box */
.voice-search-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(210, 162, 103, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px 16px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 25px rgba(78, 68, 56, 0.05);
  transition: var(--transition);
  box-sizing: border-box;
}

.voice-search-card:hover {
  border-color: var(--color-brand);
  background: #fff;
}

.voice-search-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  margin-bottom: 12px;
}

.voice-mic-outer {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1.5px solid rgba(210, 162, 103, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.voice-mic-outer::before {
  content: "";
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 0.8px solid rgba(210, 162, 103, 0.15);
  pointer-events: none;
}

.voice-mic-inner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background-color: #2F5233;
  color: #D2A267;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(47, 82, 51, 0.18);
  transition: all 0.3s ease;
}

.voice-mic-outer:hover .voice-mic-inner {
  transform: scale(1.05);
}

.voice-mic-outer.recording .voice-mic-inner {
  background-color: var(--color-warning);
  color: #fff;
  box-shadow: 0 0 15px rgba(166, 27, 34, 0.35);
}

.voice-wave-left, .voice-wave-right {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.voice-wave-left span, .voice-wave-right span {
  width: 2px;
  background-color: rgba(47, 82, 51, 0.25);
  border-radius: 1px;
  transition: height 0.2s ease, background-color 0.2s ease;
}

.voice-wave-left span:nth-child(1) { height: 4px; }
.voice-wave-left span:nth-child(2) { height: 8px; }
.voice-wave-left span:nth-child(3) { height: 12px; }
.voice-wave-left span:nth-child(4) { height: 16px; }
.voice-wave-left span:nth-child(5) { height: 20px; }
.voice-wave-left span:nth-child(6) { height: 12px; }
.voice-wave-left span:nth-child(7) { height: 6px; }

.voice-wave-right span:nth-child(1) { height: 6px; }
.voice-wave-right span:nth-child(2) { height: 12px; }
.voice-wave-right span:nth-child(3) { height: 20px; }
.voice-wave-right span:nth-child(4) { height: 16px; }
.voice-wave-right span:nth-child(5) { height: 12px; }
.voice-wave-right span:nth-child(6) { height: 8px; }
.voice-wave-right span:nth-child(7) { height: 4px; }

/* When recording is active, animate the waves */
.voice-search-card.recording .voice-wave-left span,
.voice-search-card.recording .voice-wave-right span {
  background-color: var(--color-brand);
  animation: wave-bounce 0.8s infinite ease-in-out alternate;
}

.voice-search-card.recording span:nth-child(odd) {
  animation-delay: 0.15s;
}
.voice-search-card.recording span:nth-child(even) {
  animation-delay: 0.3s;
}

@keyframes wave-bounce {
  0% { transform: scaleY(0.4); }
  100% { transform: scaleY(1.3); }
}

.voice-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.voice-status-text {
  font-size: 0.72rem;
  color: #D2A267;
  text-align: center;
  line-height: 1.4;
  font-family: var(--font-body);
}

/* Action grid (Multimodal + Switcher) */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.action-card {
  background-color: #FAF9F5;
  border: 1px solid rgba(210, 162, 103, 0.28);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  cursor: pointer;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.action-card:hover {
  border-color: var(--color-brand);
  background-color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(78, 68, 56, 0.04);
}

.action-icon-wrapper {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.action-icon-main {
  width: 100%;
  height: 100%;
}

.action-icon-badge {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: var(--color-accent);
  border: 1px solid #FAF9F5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-card-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  text-align: left;
}

.action-card-title {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-brand);
}

.action-card-subtitle {
  font-size: 0.62rem;
  color: var(--color-text-secondary);
  line-height: 1.2;
}

.action-card-arrow {
  position: absolute;
  bottom: 6px;
  right: 10px;
  color: var(--color-accent);
  font-size: 0.85rem;
  font-weight: bold;
}

/* SOS Emergency Button Container */
.emergency-dock {
  margin-top: 2px;
  padding: 0;
}

.emergency-btn-new {
  background: linear-gradient(135deg, #a61b22 0%, #851217 100%);
  border: 1.5px solid #d2a267;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 12px rgba(166, 27, 34, 0.15);
  transition: all 0.25s ease;
  overflow: hidden;
  box-sizing: border-box;
}

.emergency-btn-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(166, 27, 34, 0.25);
}

.emergency-btn-new::before, .emergency-btn-new::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border: 1.5px solid #d2a267;
  pointer-events: none;
}

.emergency-btn-new::before {
  top: 3px;
  left: 3px;
  border-right: none;
  border-bottom: none;
}

.emergency-btn-new::after {
  bottom: 3px;
  right: 3px;
  border-left: none;
  border-top: none;
}

.emergency-left {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  flex-shrink: 0;
}

.siren-svg {
  width: 18px;
  height: 18px;
}

.emergency-middle {
  flex: 1;
  text-align: left;
}

.emergency-title {
  color: #fff;
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.emergency-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.65rem;
}

.emergency-right {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.emergency-btn-new:hover .emergency-right {
  background-color: #fff;
  color: #a61b22;
  border-color: #fff;
}

/* --- PAGE 2: REPORT ANALYSIS PAGE (化繁为简) --- */
.analysis-header {
  height: 58px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  border-bottom: 2px solid rgba(210, 162, 103, 0.25);
  background: linear-gradient(180deg, #F9F8F3 0%, rgba(249, 248, 243, 0.95) 100%);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.header-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(210, 162, 103, 0.2);
  background-color: rgba(249, 248, 243, 0.6);
  color: var(--color-brand);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: var(--transition);
}

.header-btn:hover {
  background-color: var(--color-brand-light);
  border-color: var(--color-brand);
}

.analysis-header h3 {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-brand);
  letter-spacing: 1px;
  margin: 0;
}

.profile-bar {
  background-color: var(--color-bg-grey);
  padding: 8px 16px;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.profile-tag {
  background-color: var(--color-brand);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}

.analysis-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Large Upload Area */
.large-upload-area {
  background-color: rgba(255, 255, 255, 0.6);
  border: 2px dashed rgba(3, 166, 120, 0.4);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.large-upload-area:hover {
  background-color: rgba(3, 166, 120, 0.05);
  border-color: var(--color-brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.upload-icon-large {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--color-brand);
}
.upload-main-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-brand-dark);
  margin-bottom: 4px;
}
.upload-sub-text {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* AI Banner */
.analysis-type-banner {
  background: linear-gradient(135deg, rgba(3, 166, 120, 0.1), rgba(3, 166, 120, 0.05));
  border: 1px solid rgba(3, 166, 120, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--color-brand-dark);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

/* Info List */
.analysis-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.analysis-info-list li {
  font-size: 0.9rem;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  background-color: var(--color-bg-grey);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

/* Follow-up Guidance */
.follow-up-guidance {
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  margin-top: 8px;
}
.follow-up-title {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
  font-weight: 500;
}
.follow-up-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.follow-up-pill {
  background-color: var(--color-bg-grey);
  color: var(--color-brand);
  border: 1px solid rgba(3, 166, 120, 0.3);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: gentle-pulse 2.5s infinite ease-in-out;
  text-align: left;
}
.follow-up-pill:hover {
  background-color: rgba(3, 166, 120, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(3, 166, 120, 0.15);
}

@keyframes gentle-pulse {
  0% { box-shadow: 0 0 0 0 rgba(3, 166, 120, 0.2); }
  70% { box-shadow: 0 0 0 8px rgba(3, 166, 120, 0); }
  100% { box-shadow: 0 0 0 0 rgba(3, 166, 120, 0); }
}

/* Card layout details */
.analysis-card {
  background-color: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-title-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-brand);
  border-bottom: 1px solid var(--color-bg-grey);
  padding-bottom: 8px;
}

.traffic-light-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.traffic-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.light-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-top: 2px;
  flex-shrink: 0;
}

.light-dot.red { background-color: var(--color-warning); box-shadow: 0 0 6px var(--color-warning); }
.light-dot.green { background-color: #2F5233; box-shadow: 0 0 6px #2F5233; }

.traffic-details {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.traffic-details strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.anomalous-tag {
  background-color: rgba(166, 27, 34, 0.08);
  color: var(--color-warning);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
  margin-right: 6px;
  margin-bottom: 6px;
  border: 1px solid rgba(166, 27, 34, 0.15);
}

.normal-text {
  color: var(--color-brand);
  font-weight: 500;
}

/* AI Interpretation Bubble styling */
.ai-translation-bubble {
  background-color: var(--color-brand-light);
  border: 1px solid rgba(47, 82, 51, 0.15);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-text-primary);
  position: relative;
}

.ai-translation-bubble p {
  margin-bottom: 10px;
}

.tts-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed rgba(47, 82, 51, 0.2);
}

.tts-btn {
  background: transparent;
  border: none;
  color: var(--color-brand);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tts-btn:hover {
  text-decoration: underline;
}

.tts-waves {
  display: none;
  align-items: center;
  gap: 2px;
  height: 12px;
}

.tts-waves.playing {
  display: flex;
}

.tts-waves span {
  width: 2px;
  height: 100%;
  background-color: var(--color-brand);
  animation: ttsWaveMotion 0.8s ease-in-out infinite alternate;
}
.tts-waves span:nth-child(2) { animation-delay: 0.15s; }
.tts-waves span:nth-child(3) { animation-delay: 0.3s; }
.tts-waves span:nth-child(4) { animation-delay: 0.45s; }

@keyframes ttsWaveMotion {
  0% { height: 2px; }
  100% { height: 12px; }
}

/* Referral details */
.referral-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.referral-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.referral-row span {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.referral-row div {
  font-size: 0.8rem;
  line-height: 1.5;
}

.referral-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.referral-doctor-item {
  background-color: var(--color-bg-paper);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ref-doc-info h4 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.ref-doc-info p {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
}

.ref-score {
  font-size: 0.75rem;
  color: var(--color-accent);
  font-weight: bold;
}

/* Action block at bottom of analysis page */
.analysis-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.analysis-btn {
  padding: 12px 8px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.analysis-btn.primary {
  background-color: var(--color-brand);
  color: #fff;
  border: 1px solid var(--color-brand);
}

.analysis-btn.primary:hover {
  background-color: #233e26;
}

.analysis-btn.secondary {
  background-color: #fff;
  color: var(--color-brand);
  border: 1px solid var(--color-brand);
}

.analysis-btn.secondary:hover {
  background-color: var(--color-brand-light);
}

/* --- PAGE 3: DOCTOR MAP PAGE (去中心化口碑) --- */
.map-search-bar {
  background: linear-gradient(180deg, #F9F8F3 0%, rgba(249, 248, 243, 0.95) 100%);
  backdrop-filter: blur(10px);
  padding: 12px 16px;
  border-bottom: 2px solid rgba(210, 162, 103, 0.25);
  position: sticky;
  top: 60px;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
  flex-shrink: 0;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input-wrapper input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-paper);
  font-family: var(--font-body);
  font-size: 0.8rem;
  outline: none;
  transition: var(--transition);
}

.search-input-wrapper input:focus {
  border-color: var(--color-brand);
  background-color: #fff;
}

.search-input-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* Real Interactive Leaflet Map styling */
.real-map-container {
  height: 240px;
  background-color: #fcfbf8;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  z-index: 1;
}

.custom-map-icon {
  background: none;
  border: none;
}

.map-marker-pin {
  width: 28px;
  height: 28px;
  background-color: var(--color-accent);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.map-marker-pin.hospital {
  background-color: var(--color-brand);
}

.map-marker-pin.active {
  transform: scale(1.2) rotate(-45deg) translateY(-4px);
  z-index: 1000 !important;
  box-shadow: 0 6px 16px rgba(210, 162, 103, 0.4);
}

.map-marker-inner {
  transform: rotate(45deg);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.map-overlay-title {
  position: absolute;
  bottom: 8px;
  left: 12px;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  background-color: rgba(255, 255, 255, 0.8);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 1000;
}

.map-controls-wrapper {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 1000;
}

.map-dropdown-control {
  position: relative;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.7rem;
  color: var(--color-text-primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  font-family: var(--font-body);
  border: 1px solid rgba(210, 162, 103, 0.2);
}

.map-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background-color: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 90px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1001;
  border: 1px solid rgba(210, 162, 103, 0.1);
}

.map-dropdown-menu.show {
  display: block;
  animation: fadeInDown 0.2s ease;
}

.dropdown-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-bg-grey);
  transition: background-color 0.2s;
  text-align: center;
  font-size: 0.75rem;
}

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

.dropdown-item:hover {
  background-color: var(--color-brand-light);
}

.dropdown-item.active {
  color: var(--color-brand);
  font-weight: 600;
  background-color: rgba(47, 82, 51, 0.05);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Non-popup Pill Filters */
.filter-pills-wrapper {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(210, 162, 103, 0.15);
  flex-shrink: 0;
  overflow-x: auto;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.filter-pills-wrapper::-webkit-scrollbar {
  display: none;
}

.filter-pill-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: 20px;
  background-color: var(--color-bg-paper);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-family: var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.filter-pill:hover {
  background-color: var(--color-brand-light);
  color: var(--color-brand);
}

.filter-pill.active {
  background-color: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
  box-shadow: 0 4px 10px rgba(47, 82, 51, 0.25);
  font-weight: 600;
}

.filter-pill-divider {
  width: 1px;
  height: 20px;
  background-color: rgba(210, 162, 103, 0.3);
  flex-shrink: 0;
}

/* Doctor card listings */
.doctors-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.doctor-card {
  background: linear-gradient(145deg, #ffffff, #fdfcfa);
  border-radius: 16px;
  border: 1px solid rgba(210, 162, 103, 0.15);
  padding: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.doctor-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--color-brand), var(--color-accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.doctor-card:hover, .doctor-card.active-selected {
  border-color: rgba(210, 162, 103, 0.4);
  box-shadow: 0 8px 24px rgba(47, 82, 51, 0.08);
  transform: translateY(-2px);
}

.doctor-card.active-selected::before {
  opacity: 1;
}

.doc-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.doc-name-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-avatar {
  font-size: 1.6rem;
  background-color: var(--color-bg-paper);
  padding: 8px;
  border-radius: 12px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.doc-name {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-brand);
  margin-bottom: 4px;
  display: block;
}

.doc-heritage-badge {
  background: linear-gradient(135deg, var(--color-accent), #c29053);
  color: #fff;
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(210, 162, 103, 0.3);
}

.doc-heritage-badge.badge-secondary {
  background: linear-gradient(135deg, var(--color-bg-grey), #e2ddcf);
  color: var(--color-text-primary);
  box-shadow: none;
  border: 1px solid rgba(0,0,0,0.05);
}

.doc-distance {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background-color: var(--color-bg-paper);
  padding: 3px 8px;
  border-radius: 10px;
}

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

.specialty-tag {
  background-color: rgba(47, 82, 51, 0.05);
  color: var(--color-brand);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 500;
}

.doc-address {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--color-bg-paper);
  padding: 6px 10px;
  border-radius: 8px;
}

.doc-quote {
  font-size: 0.8rem;
  color: var(--color-text-primary);
  background-color: rgba(210, 162, 103, 0.05);
  border-left: 3px solid var(--color-accent);
  padding: 10px 12px;
  font-style: italic;
  line-height: 1.5;
  border-radius: 0 8px 8px 0;
}

.doc-trust-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--color-border);
  padding-top: 12px;
  margin-top: 4px;
}

.doc-score {
  font-size: 0.85rem;
  color: var(--color-accent);
  font-weight: 700;
}

.doc-platform-warning {
  font-size: 0.75rem;
  color: var(--color-warning);
  background-color: rgba(166, 27, 34, 0.05);
  border: 1px solid rgba(166, 27, 34, 0.15);
  padding: 8px 12px;
  border-radius: 8px;
  line-height: 1.4;
  display: flex;
  gap: 6px;
}

/* Light up campaign CTA */
.lightup-banner {
  background-color: var(--color-brand);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
}

.lightup-banner:hover {
  background-color: #233e26;
  transform: translateY(-2px);
}

.lightup-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.lightup-subtitle {
  font-size: 0.75rem;
  opacity: 0.85;
}

/* --- PAGE 4: FOUR SEASONS HEALTH PAGE (四季养生) --- */
.seasons-header {
  height: 58px;
  background: linear-gradient(180deg, #F9F8F3 0%, rgba(249, 248, 243, 0.95) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(210, 162, 103, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-brand);
  letter-spacing: 1px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.seasons-header::before,
.seasons-header::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--color-accent);
  transform: rotate(45deg);
  margin: 0 10px;
  opacity: 0.65;
}

.seasons-scroll-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: calc(100% - 56px);
  overflow-y: auto;
  box-sizing: border-box;
}

.seasons-scroll-panel.seasons-grid-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.zen-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.zen-card-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--color-brand);
  margin-bottom: 12px;
  border-left: 3px solid var(--color-brand);
  padding-left: 8px;
  font-weight: 600;
}

.tea-recipe {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.recipe-pic {
  font-size: 2rem;
  background-color: var(--color-accent-light);
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recipe-text {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.recipe-text strong {
  color: var(--color-text-primary);
  display: block;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

/* --- Season & Constitution Card --- */
.season-constitution-card {
  background: linear-gradient(135deg, rgba(238, 244, 239, 0.6) 0%, rgba(249, 248, 243, 0.9) 100%);
  border: 1px solid var(--color-border);
  position: relative;
}
.season-badge {
  background-color: var(--color-brand);
  color: #fff;
  font-size: 0.55rem;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  font-weight: 500;
}
.season-card-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--color-brand);
  margin: 6px 0 4px 0;
  font-weight: bold;
}
.season-card-intro {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}
.constitution-tip-box {
  background-color: #fff;
  border-left: 3px solid var(--color-accent);
  padding: 8px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex;
  gap: 8px;
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
  box-shadow: var(--shadow-sm);
}
.tip-icon {
  font-size: 0.9rem;
  line-height: 1;
}
.tip-content strong {
  color: var(--color-accent);
}

/* --- Daily Punch Card Styles --- */
.punch-dashboard-card {
  display: flex;
  flex-direction: column;
}

.punch-progress-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.punch-progress-container {
  flex: 1;
  height: 6px;
  background: #eae7df;
  border-radius: 3px;
  overflow: hidden;
}

.punch-progress-bar {
  height: 100%;
  background-color: var(--color-brand);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 3px;
}

.punch-progress-text {
  font-size: 0.65rem;
  color: var(--color-brand);
  font-weight: bold;
}

.punch-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.punch-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background-color: var(--color-bg-paper);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  position: relative;
  box-sizing: border-box;
  min-height: 96px;
  user-select: none;
}

.punch-grid-item:hover {
  border-color: var(--color-brand);
  background-color: var(--color-brand-light);
}

.punch-grid-item.checked {
  background-color: #f0f6f1;
  border-color: var(--color-brand);
}

.punch-grid-item.checked .punch-item-name {
  color: var(--color-brand);
  font-weight: 600;
}

.punch-grid-item.checked .punch-item-desc {
  color: var(--color-brand);
  opacity: 0.8;
}

.punch-item-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
  transition: transform 0.2s ease;
}

.punch-grid-item.checked .punch-item-icon {
  transform: scale(1.15) rotate(5deg);
}

.punch-item-name {
  font-size: 0.72rem;
  font-weight: bold;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.punch-item-desc {
  font-size: 0.58rem;
  color: var(--color-text-secondary);
}

.punch-indicator-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-border);
  transition: var(--transition);
}

.punch-grid-item.checked .punch-indicator-dot {
  background-color: var(--color-brand);
  box-shadow: 0 0 6px var(--color-brand);
}

/* --- Baduanjin Player Styles --- */
.baduanjin-player {
  background: linear-gradient(180deg, #2A2F2B 0%, #151816 100%);
  border-radius: var(--radius-md);
  padding: 16px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.05);
}

.baduanjin-bg-watermark {
  position: absolute;
  font-size: 5rem;
  opacity: 0.04;
  font-family: var(--font-title);
  top: 10px;
  left: 10px;
  pointer-events: none;
}

.baduanjin-move-name {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--color-accent);
  margin-bottom: 8px;
  text-align: center;
  font-weight: 600;
  z-index: 2;
}

.breath-guide-container {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
  z-index: 2;
}

.breath-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(210, 162, 103, 0.15);
  border: 1px solid rgba(210, 162, 103, 0.5);
  position: absolute;
  transition: transform 0.1s linear, background-color 0.3s ease;
}

.breath-circle.breathing-in {
  animation: breathInAnimation 4s infinite ease-in-out;
  background-color: rgba(47, 82, 51, 0.25);
  border-color: rgba(47, 82, 51, 0.6);
}

.breath-circle.breathing-out {
  animation: breathOutAnimation 4s infinite ease-in-out;
  background-color: rgba(210, 162, 103, 0.25);
  border-color: rgba(210, 162, 103, 0.6);
}

@keyframes breathInAnimation {
  0% { transform: scale(0.85); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 15px rgba(47, 82, 51, 0.4); }
  100% { transform: scale(0.85); opacity: 0.7; }
}

@keyframes breathOutAnimation {
  0% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 15px rgba(210, 162, 103, 0.4); }
  50% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 15px rgba(210, 162, 103, 0.4); }
}

.breath-text {
  position: absolute;
  font-size: 0.72rem;
  color: #fff;
  font-weight: bold;
  pointer-events: none;
  z-index: 3;
  letter-spacing: 0.1em;
}

.baduanjin-timer {
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 12px;
  color: var(--color-accent-light);
  z-index: 2;
}

.baduanjin-controls {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
  z-index: 2;
}

.baduanjin-tip {
  font-size: 0.65rem;
  color: #a0a8a2;
  margin-top: 12px;
  text-align: center;
  line-height: 1.4;
  min-height: 32px;
  z-index: 2;
}

/* --- Dietary Recipe Tab Styles --- */
.recipe-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
  overflow-x: auto;
  white-space: nowrap;
}

/* Hide scrollbar for tabs */
.recipe-tabs::-webkit-scrollbar {
  display: none;
}

.recipe-tab {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 12px;
  background-color: var(--color-bg-grey);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.recipe-tab:hover {
  color: var(--color-brand);
}

.recipe-tab.active {
  background-color: var(--color-brand);
  color: #fff;
}

/* Horizontal Swiper Card Carousel */
.recipe-scroll-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 2px 12px 2px;
  scroll-snap-type: x mandatory;
  box-sizing: border-box;
  width: 100%;
}
.recipe-scroll-container::-webkit-scrollbar {
  display: none;
}

.recipe-scroll-card {
  flex: 0 0 82%;
  scroll-snap-align: center;
  background: var(--color-bg-paper);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-sizing: border-box;
}

.recipe-scroll-card:hover {
  border-color: var(--color-brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.recipe-scroll-card[data-category="wet"] {
  background-color: rgba(47, 82, 51, 0.03);
}
.recipe-scroll-card[data-category="liver"] {
  background-color: rgba(210, 162, 103, 0.04);
}
.recipe-scroll-card[data-category="spleen"] {
  background-color: rgba(166, 27, 34, 0.02);
}

.recipe-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.recipe-card-pic {
  font-size: 1.5rem;
}

.recipe-card-tag {
  font-size: 0.58rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.recipe-card-tag.wet {
  background-color: var(--color-brand-light);
  color: var(--color-brand);
}
.recipe-card-tag.liver {
  background-color: var(--color-accent-light);
  color: var(--color-accent);
}
.recipe-card-tag.spleen {
  background-color: #FDF4F5;
  color: var(--color-warning);
}

.recipe-card-name {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--color-text-primary);
  margin: 0 0 6px 0;
  font-weight: bold;
}

.recipe-card-details {
  font-size: 0.68rem;
  color: var(--color-text-secondary);
  margin: 0 0 4px 0;
  line-height: 1.4;
}

.recipe-card-desc {
  font-size: 0.68rem;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.4;
}

/* --- Accordion (Hand Accordion) Styles --- */
.accordion-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.accordion-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-bg-paper);
  overflow: hidden;
  transition: var(--transition);
}

.accordion-item:hover {
  border-color: var(--color-accent);
}

.accordion-header {
  cursor: pointer;
  user-select: none;
  background-color: #fff;
  transition: var(--transition);
}

.accordion-header.header-left {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
}

.accordion-header.header-right {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  flex-direction: row-reverse;
}

.accordion-header-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.accordion-header-title.text-right {
  text-align: right;
}

.accordion-arrow {
  font-size: 0.6rem;
  color: var(--color-text-muted);
  transition: transform 0.3s ease;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: var(--color-bg-paper);
}

.accordion-content p {
  padding: 10px 12px;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin: 0;
  border-top: 1px dashed var(--color-border);
}

.accordion-item.active .accordion-arrow {
  transform: rotate(180deg);
  color: var(--color-accent);
}

/* --- BOTTOM NAVIGATION BAR --- */
.phone-nav-bar {
  position: absolute;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  width: calc(100% - 24px);
  height: 64px;
  background-color: rgba(250, 249, 245, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(47, 82, 51, 0.12);
  border-radius: 24px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  z-index: 995;
  user-select: none;
  box-sizing: border-box;
  box-shadow: 
    0 10px 30px rgba(47, 82, 51, 0.08), 
    0 2px 8px rgba(47, 82, 51, 0.04);
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
  padding: 4px 6px;
  flex: 1;
  justify-content: center;
  height: 100%;
}

.nav-item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  color: var(--color-text-muted);
}

.nav-icon-svg {
  width: 100%;
  height: 100%;
}

.nav-item-text {
  font-family: var(--font-title);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

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

.nav-item.active .nav-item-icon {
  transform: scale(1.08);
  color: var(--color-brand);
}

.nav-item.active::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 12px;
  height: 2px;
  background-color: var(--color-brand);
  border-radius: 1px;
}

/* --- RAISED CENTER AI NAV ITEM --- */
.nav-item-ai {
  position: relative;
  top: -15px; /* raised above the nav bar */
  width: 58px;
  height: 58px;
  flex: 0 0 58px !important;
  background: linear-gradient(135deg, var(--color-brand) 0%, #3e6b42 100%);
  border-radius: 50% !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(47, 82, 51, 0.3);
  border: 4px solid var(--color-bg-paper); /* separator border simulating cutout */
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background 0.3s ease;
  z-index: 996;
  padding: 0;
  gap: 0;
}

.nav-item-ai .nav-item-icon {
  width: 20px;
  height: 20px;
  color: #FFFFFF !important;
  transition: transform 0.3s ease;
}

.nav-item-ai .nav-item-text {
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 0.62rem;
  font-weight: 700;
  margin-top: 2px;
}

.nav-item-ai.active {
  background: linear-gradient(135deg, var(--color-accent) 0%, #b8864c 100%);
  box-shadow: 0 10px 24px rgba(210, 162, 103, 0.45);
  transform: translateY(-15px) scale(1.06);
}

.nav-item-ai.active .nav-item-icon {
  transform: scale(1.1);
  color: #FFFFFF !important;
}

.nav-item-ai.active::after {
  display: none; /* remove active line for the circular button */
}

/* Hover effects */
.nav-item-ai:hover {
  transform: translateY(-18px) scale(1.04);
  box-shadow: 0 10px 22px rgba(47, 82, 51, 0.38);
}

.nav-item-ai.active:hover {
  transform: translateY(-18px) scale(1.1);
  box-shadow: 0 12px 26px rgba(210, 162, 103, 0.5);
}

/* --- OVERLAY MODALS & INTERACTIVE DRAWER PANELS --- */

/* Base Overlay styles */
.app-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Bottom drawer styles */
.app-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 80%;
  background-color: var(--color-bg-paper);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  z-index: 2100;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
}

.app-drawer.active {
  transform: translateY(0);
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-brand);
}

.drawer-close {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.drawer-close:hover {
  background-color: rgba(166, 27, 34, 0.08);
  color: var(--color-warning);
}

.filter-tabs-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 0 16px;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg-paper);
}

.filter-select {
  border: none;
  background: transparent;
  padding: 12px 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  font-family: var(--font-body);
  outline: none;
}

.filter-select::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
  background-color: transparent;
  transition: var(--transition);
}

.filter-select.active {
  color: var(--color-brand);
  font-weight: 700;
}

.filter-select.active::after {
  background-color: var(--color-brand);
}

.filter-select:hover {
  color: var(--color-brand);
  opacity: 0.85;
}

.drawer-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 520px;
}

/* Dialogue Box/Chat Modal inside drawer */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  min-height: 200px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  line-height: 1.5;
}

.chat-bubble.assistant {
  background-color: #fff;
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble.assistant.loading-bubble {
  background-color: var(--color-brand-light);
  border: 1.2px dashed var(--color-brand);
  color: var(--color-brand);
  font-weight: 500;
  animation: pulse-glow 1.5s infinite ease-in-out;
}

@keyframes pulse-glow {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.chat-bubble.user {
  background-color: var(--color-brand);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.suggested-qs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.suggested-q-pill {
  background-color: var(--color-bg-grey);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 30px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}

.suggested-q-pill:hover {
  background-color: var(--color-brand-light);
  color: var(--color-brand);
  border-color: rgba(47, 82, 51, 0.15);
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

.chat-input-row input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 0.8rem;
  outline: none;
}

.chat-send-btn {
  background-color: var(--color-brand);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.chat-send-btn:hover {
  background-color: #233e26;
}

/* --- TONGUE DIAGNOSTIC SIMULATOR DRAWER --- */
.tongue-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.tongue-preview-box {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 2px dashed rgba(47, 82, 51, 0.25);
  background-color: var(--color-bg-paper);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.tongue-sample-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

/* Mirror front camera stream */
.tongue-preview-box video {
  transform: scaleX(-1);
}

.camera-active-pulse {
  background-color: rgba(166, 27, 34, 0.1) !important;
  color: var(--color-warning) !important;
  border-color: var(--color-warning) !important;
  animation: btn-pulse-glow 1.5s infinite ease-in-out;
}

@keyframes btn-pulse-glow {
  0% { opacity: 0.8; }
  50% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 0.8; }
}

.tongue-placeholder-text {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
  padding: 20px;
}

/* Scanner Laser animation */
.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--color-brand);
  box-shadow: 0 0 8px var(--color-brand);
  display: none;
  z-index: 10;
}

.scanner-laser.scanning {
  display: block;
  animation: scanningLaser 2s infinite ease-in-out;
}

@keyframes scanningLaser {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.tongue-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.tongue-btn {
  flex: 1;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 24px;
  cursor: pointer;
  transition: var(--transition);
  border: 1.5px solid var(--color-border);
  background: #fff;
  color: var(--color-text-primary);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  outline: none;
  box-sizing: border-box;
}

.tongue-btn:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
  background-color: var(--color-brand-light);
  transform: translateY(-1px);
}

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

.tongue-btn.primary {
  background-color: var(--color-brand);
  border-color: var(--color-brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(47, 82, 51, 0.15);
}

.tongue-btn.primary:hover {
  background-color: #233e26;
  border-color: #233e26;
  box-shadow: 0 6px 16px rgba(47, 82, 51, 0.2);
}

.tongue-results-card {
  width: 100%;
  background-color: var(--color-accent-light);
  border: 1px dashed rgba(210, 162, 103, 0.4);
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  line-height: 1.5;
  display: none;
}

/* --- REPORT UPLOAD SIMULATOR DRAWER --- */
.report-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.report-file-box {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--color-border);
  background-color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.report-file-box:hover {
  border-color: var(--color-brand);
  background-color: var(--color-brand-light);
}

.report-file-icon {
  font-size: 2rem;
  color: var(--color-text-muted);
}

.report-file-text {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.upload-progress-container {
  width: 100%;
  display: none;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background-color: var(--color-bg-grey);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background-color: var(--color-brand);
  transition: width 0.1s linear;
}

.progress-text {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  text-align: right;
  margin-top: 4px;
}

/* --- EMERGENCY PLAN DOCK PANEL (120 CALL) --- */
.emergency-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-warning);
  color: #fff;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 24px 24px; /* leave top space for status bar */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.emergency-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.emergency-header {
  text-align: center;
  margin-top: 20px;
}

.emergency-header h2 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.emergency-header p {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* Countdown circle */
.countdown-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 220px;
}

.countdown-svg {
  width: 180px;
  height: 180px;
}

.countdown-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 8;
}

.countdown-circle-fill {
  fill: none;
  stroke: #fff;
  stroke-width: 8;
  stroke-dasharray: 502;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.1s linear;
}

.countdown-number {
  position: absolute;
  font-size: 3.5rem;
  font-family: var(--font-title);
  font-weight: bold;
}

.emergency-contacts-list {
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.emergency-contact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.emergency-contact-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.contact-name {
  font-weight: 600;
}

.contact-call-btn {
  background-color: #fff;
  color: var(--color-warning);
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
}

.contact-call-btn:hover {
  background-color: var(--color-accent-light);
}

.cancel-emergency-btn {
  background-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.95rem;
  font-weight: bold;
  letter-spacing: 2px;
  cursor: pointer;
  transition: var(--transition);
}

.cancel-emergency-btn:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

/* Simulation Calling Screen */
.calling-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #1a1e1b;
  color: #fff;
  z-index: 3500;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 60px 24px 60px;
  display: none;
}

.calling-screen.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

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

.calling-info h3 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  font-family: var(--font-title);
}

.calling-status {
  font-size: 0.85rem;
  color: var(--color-accent);
  animation: pulseOpacity 1.5s infinite;
}

.calling-animation {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.calling-avatar {
  font-size: 3rem;
  z-index: 10;
}

.calling-animation::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--color-warning);
  animation: pulseRing 2s infinite;
}

.hangup-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--color-warning);
  color: #fff;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 14px rgba(166, 27, 34, 0.4);
  transition: var(--transition);
}

.hangup-btn:hover {
  background-color: #bf2129;
  transform: scale(1.05);
}

/* Animations declarations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulseOpacity {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes pulseRing {
  0% { transform: scale(0.95); opacity: 0.8; box-shadow: 0 0 0 0 rgba(166, 27, 34, 0.4); }
  70% { transform: scale(1.2); opacity: 0; box-shadow: 0 0 0 10px rgba(166, 27, 34, 0); }
  100% { transform: scale(0.95); opacity: 0; box-shadow: 0 0 0 0 rgba(166, 27, 34, 0); }
}

/* --- LIGHT UP NEW CLINIC FORM --- */
.lightup-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 0.8rem;
  outline: none;
  background-color: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-brand);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

/* Success Lightup Overlay */
.success-lightup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(47, 82, 51, 0.95);
  color: #fff;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  gap: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.success-lightup-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.success-lightup-icon {
  font-size: 3.5rem;
  color: var(--color-accent);
  animation: floatGold 2s infinite ease-in-out;
}

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

.success-lightup-overlay h3 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  letter-spacing: 1px;
}

.success-lightup-overlay p {
  font-size: 0.8rem;
  line-height: 1.5;
  opacity: 0.85;
}

/* Sparkles animation container */
.sparkles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  background-color: var(--color-accent);
  border-radius: 50%;
  animation: flySparkle 1.5s forwards ease-out;
}

@keyframes flySparkle {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) scale(0); opacity: 0; }
}

/* --- MOCK BOOKING DIALOGUE --- */
.booking-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.booking-confirm-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 10px 0;
}

.booking-confirm-icon {
  font-size: 3rem;
  color: var(--color-brand);
}

.booking-confirm-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--color-brand);
  font-weight: bold;
}

.booking-confirm-detail {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  background-color: var(--color-bg-grey);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  width: 100%;
}

/* --- WANG & QUIZ DIAGNOSIS STYLING --- */
.quiz-answer-btn {
  background-color: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.8rem;
  font-family: var(--font-body);
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
  outline: none;
}
.quiz-answer-btn:hover {
  border-color: var(--color-brand);
  background-color: var(--color-brand-light);
  transform: translateX(4px);
}
.quiz-answer-btn.selected {
  border-color: var(--color-brand);
  background-color: var(--color-brand-light);
  font-weight: 600;
}

/* --- TCM Quiz Form Styles --- */
.quiz-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.quiz-form-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.quiz-btn-group {
  display: flex;
  gap: 8px;
  width: 100%;
}
.quiz-toggle-btn {
  flex: 1;
  background-color: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.72rem;
  font-family: var(--font-body);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  outline: none;
}
.quiz-toggle-btn:hover {
  border-color: rgba(47, 82, 51, 0.4);
  color: var(--color-brand);
}
.quiz-toggle-btn.active {
  background-color: var(--color-brand-light);
  border-color: var(--color-brand);
  color: var(--color-brand);
  font-weight: bold;
}
.quiz-text-input {
  width: 100%;
  box-sizing: border-box;
  background-color: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.72rem;
  color: var(--color-text-primary);
  outline: none;
  transition: var(--transition);
  font-family: var(--font-body);
}
.quiz-text-input:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 2px rgba(47, 82, 51, 0.1);
}

/* --- Neijing Life Cycle Card --- */
.neijing-card {
  background: linear-gradient(135deg, #2f5233 0%, #1c3320 100%);
  border: 1px solid #d2a267;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: #f9f8f3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}
.neijing-card::before {
  content: "☯";
  position: absolute;
  right: -10px;
  bottom: -20px;
  font-size: 6rem;
  color: rgba(255, 255, 255, 0.03);
  pointer-events: none;
}
.neijing-card-title {
  font-family: var(--font-title);
  font-size: 0.75rem;
  color: #d2a267;
  letter-spacing: 1px;
  margin-bottom: 4px;
  font-weight: bold;
}
.neijing-card-cycle {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: bold;
  color: #fff;
  margin-bottom: 6px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.neijing-card-desc {
  font-size: 0.7rem;
  line-height: 1.45;
  color: rgba(249, 248, 243, 0.9);
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(210, 162, 103, 0.25);
  padding-bottom: 6px;
}
.neijing-card-focus {
  font-size: 0.7rem;
  color: #f9f8f3;
  line-height: 1.4;
}
.neijing-card-focus strong {
  color: #d2a267;
  font-weight: 700;
}

/* --- Drug Analysis Card --- */
.drug-analysis-card {
  background-color: rgba(220, 53, 69, 0.04);
  border: 1px solid rgba(220, 53, 69, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
}
.drug-card-title {
  font-size: 0.75rem;
  font-weight: bold;
  color: #c92a2a;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.drug-card-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.drug-analysis-item {
  font-size: 0.7rem;
  line-height: 1.45;
  color: var(--color-text-secondary);
  border-bottom: 1px dashed rgba(220, 53, 69, 0.15);
  padding-bottom: 6px;
}
.drug-analysis-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.drug-analysis-item strong.drug-warn-name {
  color: #c92a2a;
}
.drug-analysis-item strong.drug-property {
  color: var(--color-warning);
}

#qie-sensor-pad::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--color-warning);
  opacity: 0;
  pointer-events: none;
}

#qie-sensor-pad.acquiring::before {
  animation: pulseRing 1.2s infinite ease-out;
}

#qie-sensor-pad.acquiring {
  transform: scale(0.95);
  background: radial-gradient(circle, #a61b22 0%, #1d2b20 70%) !important;
  box-shadow: 0 0 25px rgba(166, 27, 34, 0.6) !important;
  border-color: var(--color-warning) !important;
}

#qie-sensor-pad.acquiring #sensor-pad-fingerprint {
  filter: grayscale(0) opacity(1);
  transform: scale(1.1);
}

#qie-sensor-pad.signal-ready {
  background: radial-gradient(circle, #2f5233 0%, #111d13 70%) !important;
  box-shadow: 0 0 25px rgba(47, 82, 51, 0.7) !important;
  border-color: #4CAF50 !important;
}

#qie-sensor-pad.signal-ready::before {
  border-color: #4CAF50 !important;
  animation: pulseRingGreen 1s infinite ease-out !important;
}

@keyframes pulseRingGreen {
  0% { transform: scale(0.95); opacity: 0.8; box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.5); }
  70% { transform: scale(1.25); opacity: 0; box-shadow: 0 0 0 12px rgba(76, 175, 80, 0); }
  100% { transform: scale(0.95); opacity: 0; box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

/* --- ADAPTIVE RESPONSIVENESS --- */
@media (max-width: 800px) {
  html, body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
  body {
    background-color: var(--color-bg-paper);
    background-image: none;
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
  }
  body::before {
    display: none;
  }
  .desktop-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
  }
  .phone-panel {
    width: 100vw;
    height: 100%;
    display: flex;
    align-items: stretch;
  }
  .phone-mockup {
    width: 100vw;
    height: 100%;
    max-height: none !important; /* Stretch to full height on actual mobile devices */
    border-radius: 0;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
  }
  .phone-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .app-page {
    height: calc(100% - 84px - env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* --- SUBPAGE HEADER REDESIGN --- */
.subpage-header {
  height: 60px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  justify-items: center;
  padding: 0 16px;
  background: rgba(249, 248, 243, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(47, 82, 51, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(47, 82, 51, 0.02);
  box-sizing: border-box;
}

.subpage-header .header-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-brand);
  letter-spacing: 2px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

.subpage-header .header-title::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  background-color: var(--color-accent);
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  opacity: 0.8;
}

.subpage-header .header-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(210, 162, 103, 0.2);
  background-color: rgba(249, 248, 243, 0.6);
  color: var(--color-brand);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  outline: none;
  box-sizing: border-box;
}

.subpage-header .header-btn:hover {
  background-color: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
  box-shadow: 0 4px 10px rgba(47, 82, 51, 0.15);
  transform: translateY(-1px);
}

.subpage-header .header-btn:active {
  transform: translateY(0);
}

/* --- NEW MEMBERSHIP CARD STYLE --- */
.membership-card-new {
  height: 180px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1b351e 0%, #2f5233 60%, #152718 100%);
  border: 1.5px solid rgba(210, 162, 103, 0.45);
  box-shadow: 0 10px 30px rgba(47, 82, 51, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  margin-bottom: 16px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.membership-card-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 35px rgba(47, 82, 51, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  border-color: rgba(210, 162, 103, 0.75);
}

.membership-card-new::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 80% 20%, rgba(210, 162, 103, 0.12) 0%, transparent 50%);
  pointer-events: none;
}

.membership-card-new::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 30%;
  height: 200%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.12), transparent);
  transform: rotate(30deg);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.membership-card-new:hover::after {
  transform: translate(400%, 0) rotate(30deg);
}

.membership-card-new .card-inner {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

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

.membership-card-new .card-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.membership-card-new .brand-emblem {
  color: var(--color-accent);
  font-size: 1rem;
}

.membership-card-new .card-level {
  font-size: 0.55rem;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  padding: 1px 6px;
  border-radius: 12px;
  background: rgba(210, 162, 103, 0.15);
  font-weight: bold;
}

.membership-card-new .card-body {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.membership-card-new .avatar-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(210, 162, 103, 0.5);
  background-color: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
}

.membership-card-new .avatar-emoji {
  font-size: 1.5rem;
}

.membership-card-new .card-info-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.membership-card-new .user-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.membership-card-new .user-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  font-family: var(--font-title);
}

.membership-card-new .user-badge {
  font-size: 0.55rem;
  color: var(--color-accent);
  background: rgba(255, 255, 255, 0.12);
  border: 0.5px solid rgba(210, 162, 103, 0.4);
  padding: 0px 5px;
  border-radius: 4px;
  font-weight: normal;
}

.membership-card-new .user-constitution {
  font-size: 0.7rem;
  color: var(--color-brand-light);
  opacity: 0.9;
}

.membership-card-new .card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 8px;
}

.membership-card-new .card-id-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.membership-card-new .id-label {
  font-size: 0.45rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.5px;
}

.membership-card-new .id-value {
  font-size: 0.75rem;
  color: #fff;
  font-family: monospace;
  letter-spacing: 0.5px;
}

.membership-card-new .card-qrcode-btn {
  background-color: var(--color-accent);
  color: #2A2F2B;
  border: none;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 0.62rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 10px rgba(210, 162, 103, 0.2);
  outline: none;
}

.membership-card-new .card-qrcode-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(210, 162, 103, 0.35);
  background-color: #e5b172;
}

.membership-card-new .card-qrcode-btn:active {
  transform: translateY(0);
}

/* --- MEMBERSHIP STATS BAR --- */
.membership-stats-bar {
  background-color: #fff;
  margin: 16px 0;
  padding: 14px 0;
  border-radius: var(--radius-md);
  border: 1px solid rgba(210, 162, 103, 0.15);
  display: flex;
  text-align: center;
  box-shadow: 0 4px 12px rgba(47, 82, 51, 0.02);
}

.membership-stats-bar .stat-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.membership-stats-bar .stat-value {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--color-brand);
  font-family: var(--font-title);
}

.membership-stats-bar .stat-value.highlight {
  color: var(--color-accent);
}

.membership-stats-bar .stat-label {
  font-size: 0.62rem;
  color: var(--color-text-secondary);
}

.membership-stats-bar .line-split {
  border-left: 1px solid rgba(210, 162, 103, 0.15);
  border-right: 1px solid rgba(210, 162, 103, 0.15);
}

/* --- MEMBERSHIP TIP BANNER --- */
.membership-tip-banner {
  background-color: rgba(234, 231, 223, 0.3);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.65rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  border: 0.5px solid rgba(47, 82, 51, 0.05);
}

.membership-tip-banner .tip-icon {
  font-size: 0.8rem;
}

.membership-tip-banner .tip-text {
  flex: 1;
}

/* --- MEMBERSHIP MENU LIST --- */
.membership-menu-list {
  background-color: #fff;
  border-radius: var(--radius-md);
  border: 1px solid rgba(210, 162, 103, 0.15);
  box-shadow: 0 4px 12px rgba(47, 82, 51, 0.02);
  margin-bottom: 20px;
  overflow: hidden;
}

.menu-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(210, 162, 103, 0.1);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

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

.menu-item-row:hover {
  background-color: var(--color-brand-light);
}

.menu-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-item-icon {
  font-size: 1rem;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-item-title {
  font-size: 0.78rem;
  font-weight: 550;
  color: var(--color-text-primary);
}

.menu-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-item-badge {
  font-size: 0.55rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: bold;
}

.menu-item-badge.badge-red {
  background-color: var(--color-warning);
  color: #fff;
}

.menu-item-arrow {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
}

.menu-item-row:hover .menu-item-arrow {
  transform: translateX(2px);
  color: var(--color-brand);
}



/* --- NEW HEADER DESIGNS --- */

/* Option 1: Immersive Header (For Profile, AI Chat) */
.immersive-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  padding: 16px;
  z-index: 100;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.immersive-header .header-btn-float {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(249, 248, 243, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--color-brand);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(47, 82, 51, 0.1);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.immersive-header .header-btn-float:active {
  transform: scale(0.92);
}

.immersive-title-area {
  padding-top: 80px;
  padding-left: 20px;
  padding-right: 20px;
  margin-bottom: 20px;
  position: relative;
  z-index: 10;
}
.immersive-title-area .large-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  color: var(--color-brand);
  margin: 0;
  font-weight: 700;
  letter-spacing: 2px;
}
.immersive-title-area .sub-title {
  font-size: 0.95rem;
  color: #8c938c;
  margin-top: 6px;
  letter-spacing: 1px;
}

/* Option 2: Collapsible Header (For Report, Map, Season) */
.collapsible-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  flex-shrink: 0;
}

.collapsible-header {
  height: 140px;
  padding: 16px 20px;
  background: rgba(249, 248, 243, 1);
  border-bottom: 1px solid transparent;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.collapsible-header.collapsed {
  height: 60px;
  background: rgba(249, 248, 243, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(47, 82, 51, 0.08);
  box-shadow: 0 4px 16px rgba(47, 82, 51, 0.03);
}

.collapsible-header .header-top-row {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

.collapsible-header .header-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(210, 162, 103, 0.4);
  background-color: transparent;
  color: var(--color-brand);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.collapsible-header .collapsed-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-brand);
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  letter-spacing: 2px;
}

.collapsible-header.collapsed .collapsed-title {
  opacity: 1;
}

.collapsible-header .large-title-area {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform-origin: left bottom;
  margin-bottom: 4px;
}

.collapsible-header.collapsed .large-title-area {
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
}

.collapsible-header .large-title-area h2 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--color-brand);
  margin: 0;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.collapsible-header .large-title-area p {
  font-size: 0.9rem;
  color: #8c938c;
  margin: 6px 0 0 0;
}

/* AI问诊 快捷提问 滚动容器 (五行显示，超长省略，悬停动效) */
.chat-suggested-scroll-container {
  height: 85px; /* 5 lines of 17px */
  overflow: hidden;
  position: relative;
  flex: 1;
  margin-left: 14px;
  max-width: 210px;
  background: rgba(47, 82, 51, 0.03);
  border-left: 2px solid var(--color-accent);
  padding: 2px 8px;
  box-sizing: border-box;
  border-radius: 0 6px 6px 0;
}

.chat-scroll-track {
  display: flex;
  flex-direction: column;
}

.chat-scroll-item {
  height: 17px;
  line-height: 17px;
  font-size: 0.58rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.chat-scroll-item span {
  color: var(--color-accent);
  font-weight: bold;
}

.chat-scroll-item:hover {
  color: var(--color-brand);
  transform: translateX(3px);
  text-decoration: underline;
}

/* AI Bubble Action Icons Bar & Typography Refinements */
.chat-bubble.assistant {
  display: flex;
  flex-direction: column;
  gap: 8px; /* space between text and actions bar */
  position: relative;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(47, 82, 51, 0.03);
}

.bubble-content {
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--color-text-primary);
}

/* Professional lists and typography structure inside bubble content */
.bubble-content ul, .bubble-content ol {
  margin: 6px 0 6px 14px;
  padding: 0;
}

.bubble-content li {
  margin-bottom: 4px;
  line-height: 1.5;
}

.bubble-content strong {
  color: var(--color-brand);
  font-weight: 600;
}

.bubble-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px dashed rgba(210, 162, 103, 0.15);
  padding-top: 6px;
  margin-top: 2px;
  justify-content: flex-end;
}

.bubble-action-btn {
  background: transparent;
  border: none;
  padding: 2px 4px;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  outline: none;
  border-radius: 4px;
}

.bubble-action-btn:hover {
  color: var(--color-brand);
  background-color: rgba(47, 82, 51, 0.05);
}

.bubble-action-btn:active {
  transform: scale(0.9);
}

/* Hide Bottom Nav Bar & Stretch Chat Page to full screen */
.phone-nav-bar.hidden {
  display: none !important;
}

#page-chat {
  height: 100% !important;
  padding-bottom: 0px !important;
}

/* User Bubble Quote Formatting */
.user-quote-box {
  font-size: 0.62rem;
  background: rgba(255, 255, 255, 0.15);
  border-left: 2px solid var(--color-accent);
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
  opacity: 0.95;
  box-sizing: border-box;
}

.user-question-text {
  font-size: 0.76rem;
  line-height: 1.5;
}

/* Active Thumbs-up Pop-bounce Animation */
@keyframes pop-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.bubble-action-btn.active svg {
  fill: currentColor;
  animation: pop-bounce 0.32s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Automatically hide the bottom navigation bar when `#page-chat` is active */
#page-chat.active ~ .phone-nav-bar {
  display: none !important;
}

/* Remove max-height constraint from the main page chat messages area so it occupies full space */
#page-chat-messages {
  max-height: none !important;
}

/* Flashcard UI Styles */
.flashcard-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.flip-card {
  background-color: transparent;
  width: 100%;
  height: 180px;
  perspective: 1000px; /* 3D effect */
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
}

.flip-card-inner.flipped {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #fff;
  border: 1px solid rgba(210, 162, 103, 0.3);
}

.flip-card-front {
  background: linear-gradient(135deg, #FFFCF5 0%, #F7EDE1 100%);
}

.flip-card-back {
  background: linear-gradient(135deg, #F2FBF5 0%, #E2F0E6 100%);
  transform: rotateY(180deg);
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.65rem;
  background: rgba(210, 162, 103, 0.15);
  color: var(--color-accent);
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
}
.card-badge.success {
  background: rgba(47, 82, 51, 0.1);
  color: var(--color-brand);
}

.flashcard-q {
  font-size: 0.95rem;
  color: var(--color-text-primary);
  margin: 0 0 8px 0;
  line-height: 1.4;
  font-weight: 600;
}

.flashcard-a {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin: 0 0 8px 0;
  line-height: 1.5;
  text-align: left;
}

.card-hint {
  position: absolute;
  bottom: 12px;
  font-size: 0.65rem;
  color: var(--color-text-muted);
  opacity: 0.8;
}

.flashcard-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.flashcard-btn {
  flex: 1;
  background: #fff;
  border: 1px solid rgba(210, 162, 103, 0.4);
  color: var(--color-text-primary);
  padding: 8px 0;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.flashcard-btn:active {
  transform: scale(0.95);
}

.flashcard-btn.random-btn {
  background: var(--color-brand);
  color: #fff;
  border: none;
  font-weight: bold;
}
/* --- WEN VOICE DIAGNOSIS STYLES --- */
.voice-tab-btn {
  position: relative;
}
.voice-tab-btn::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 15%;
  width: 70%;
  height: 2px;
  background-color: transparent;
  transition: all 0.3s ease;
}
.voice-tab-btn.active {
  color: var(--color-brand) !important;
}
.voice-tab-btn.active::after {
  background-color: var(--color-brand);
}
.voice-tab-btn:hover {
  color: var(--color-brand) !important;
  opacity: 0.8;
}

/* Teleprompter texture style */
.teleprompter-card {
  background-image: linear-gradient(rgba(244, 242, 235, 0.5) 1px, transparent 1px);
  background-size: 100% 24px;
}

/* Blink animation for recording */
@keyframes voice-recording-blink {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}
.voice-recording-active-text {
  animation: voice-recording-blink 1.5s infinite ease-in-out;
}

/* Custom scrollbar for reports */
#wen-voice-results::-webkit-scrollbar {
  width: 4px;
}
#wen-voice-results::-webkit-scrollbar-track {
  background: transparent;
}
#wen-voice-results::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}
#wen-voice-results::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* --- AI DIAGNOSTIC REPORT MULTI-DIMENSIONAL DASHBOARD --- */
.report-section-title {
  display: flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-main);
  margin-top: 14px;
  margin-bottom: 8px;
}
.report-section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  background-color: var(--color-brand);
  margin-right: 6px;
  border-radius: 1.5px;
}

.report-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.feature-item {
  background: rgba(247, 239, 229, 0.4);
  border: 1px solid rgba(210, 162, 103, 0.15);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feature-label {
  font-size: 0.65rem;
  color: var(--color-text-muted);
}

.feature-value {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--color-text-main);
}

.face-zones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.zone-item {
  background: rgba(247, 239, 229, 0.4);
  border: 1px solid rgba(210, 162, 103, 0.15);
  border-radius: 6px;
  padding: 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.zone-name {
  font-size: 0.62rem;
  color: var(--color-text-muted);
}

.zone-status {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-main);
}

.tcm-metrics-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.metric-name {
  font-size: 0.7rem;
  color: var(--color-text-main);
  width: 70px;
  flex-shrink: 0;
}

.metric-bar-container {
  flex-grow: 1;
  height: 6px;
  background-color: #F7EFE5;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.metric-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-val {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-main);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* Skeleton Loading Screens */
.skeleton-loading-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 8px 0;
}

.skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, #f3f3f3 25%, #e6e6e6 37%, #f3f3f3 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 4px;
}

.skeleton-line:nth-child(1) {
  width: 40%;
}
.skeleton-line:nth-child(2) {
  width: 90%;
}
.skeleton-line:nth-child(3) {
  width: 75%;
}
.skeleton-line:nth-child(4) {
  width: 85%;
}

@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}




/* Modern Recipe Cards */
.modern-recipe-card {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(210, 162, 103, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.modern-recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.modern-recipe-img-wrapper {
  position: relative;
  height: 120px;
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid rgba(210, 162, 103, 0.1);
}
.recipe-img-full {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.recipe-img-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}
.modern-recipe-svg-wrapper_old {
  background: linear-gradient(135deg, rgba(210,162,103,0.05), rgba(47,82,51,0.02));
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(210, 162, 103, 0.1);
}
.modern-recipe-svg-wrapper svg {
  width: 40px;
  height: 40px;
  opacity: 0.8;
}
.modern-recipe-content {
  padding: 12px;
  position: relative;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Recipe Drawer Sections */
.recipe-section-box {
  background: rgba(47, 82, 51, 0.03);
  border-left: 3px solid var(--color-brand);
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 0 8px 8px 0;
}
.recipe-section-title {
  margin: 0 0 6px 0;
  font-size: 0.85rem;
  color: var(--color-text-primary);
  font-weight: 600;
}
.recipe-section-text {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}
.recipe-section-text ol {
  margin: 0;
  padding-left: 20px;
}
.recipe-section-text li {
  margin-bottom: 4px;
}

/* --- TCM AI DIAGNOSTIC SCAN PIPELINE AND TELEMETRY CONSOLE --- */
.tcm-scan-pipeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background-color: var(--color-bg-paper);
  border-radius: var(--radius-md);
  margin-top: 10px;
  position: relative;
}

.pipeline-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  transition: all 0.3s ease;
}

/* Timeline vertical line */
.pipeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 11px; /* Center of the 24px icon container */
  top: 24px;
  bottom: -16px;
  width: 2px;
  background-color: var(--color-border);
  z-index: 1;
  transition: all 0.3s ease;
}

.pipeline-step.completed:not(:last-child)::after {
  background-color: var(--color-brand); /* Turn green when completed */
}

.step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--color-bg-grey);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  z-index: 2;
  position: relative;
  transition: all 0.3s ease;
}

.pipeline-step.active .step-icon {
  background-color: var(--color-brand-light);
  color: var(--color-brand);
  box-shadow: 0 0 8px rgba(47, 82, 51, 0.2);
}

.pipeline-step.completed .step-icon {
  background-color: var(--color-brand);
  color: #fff;
}

.step-text {
  flex: 1;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  font-family: var(--font-body);
  transition: all 0.3s ease;
}

.pipeline-step.active .step-text {
  color: var(--color-brand);
  font-weight: 600;
}

.pipeline-step.completed .step-text {
  color: var(--color-text-secondary);
}

.step-status {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  white-space: nowrap;
}

.pipeline-step.active .step-status {
  color: var(--color-brand);
  font-weight: bold;
}

.pipeline-step.completed .step-status {
  color: var(--color-brand);
}

/* Spinner small */
.spinner-small {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(47, 82, 51, 0.2);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  animation: spinner-small-spin 0.8s infinite linear;
}

@keyframes spinner-small-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Step dot */
.step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-text-muted);
}

/* Telemetry console */
.tcm-telemetry-console {
  background-color: #1F2320;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 14px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
  border: 1px solid rgba(210, 162, 103, 0.15);
  text-align: left;
}

.console-title {
  font-size: 0.7rem;
  color: var(--color-accent);
  font-weight: bold;
  margin-bottom: 6px;
  font-family: var(--font-body);
  letter-spacing: 0.5px;
  border-bottom: 1px dashed rgba(210, 162, 103, 0.15);
  padding-bottom: 4px;
  text-align: left;
}

.console-logs {
  font-family: 'Consolas', 'Courier New', Courier, monospace;
  font-size: 0.65rem;
  color: #4CAF50;
  line-height: 1.5;
  height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  text-align: left;
}

/* Styling for long HTML AI report details */
.report-ai-content p {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-top: 0;
  margin-bottom: 12px;
  text-align: justify;
}

.report-ai-content ul, .report-ai-content ol {
  margin-top: 0;
  margin-bottom: 12px;
  padding-left: 20px;
}

.report-ai-content li {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.report-ai-content strong {
  color: var(--color-brand);
  font-weight: bold;
}
