/* 
 * 药品搜索网页样式
 * 温暖极简设计 - Warm Minimalist Design
 */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400;1,600&family=Inter:wght@300;400;500;600&display=swap');

:root {
  /* 温暖极简配色 */
  --bg-cream: #FAF8F5;
  --card-bg: #FFFFFF;
  --text-dark: #3D3D3D;
  --text-secondary: #8A8A8A;
  --text-placeholder: #BDBDBD;
  --border-light: #E5E5E5;
  
  /* 按钮和强调色 */
  --btn-green: #6AB29B;
  --btn-green-hover: #5A9F8A;
  --btn-green-active: #4A8F7A;
  
  /* 链接颜色 */
  --link-blue: #5BB4D0;
  --link-orange: #E8A462;
  
  /* 状态颜色 */
  --success-color: #6AB29B;
  --error-color: #E87C7C;
  --warning-color: #E8A462;
  
  /* 阴影和圆角 */
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-cream);
  min-height: 100vh;
  color: var(--text-dark);
  line-height: 1.6;
  /* 禁止iOS Safari缩放 */
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 头部样式 */
.header {
  text-align: center;
  padding: 60px 20px 40px;
  animation: fadeInDown 0.6s ease-out;
}

.logo {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0;
  letter-spacing: -0.01em;
  animation: scaleIn 0.5s ease-out;
}

.logo-link {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 1.8rem;
  font-style: italic;
  display: inline-block;
  margin-bottom: 10px;
  transition: var(--transition);
}

.logo-link:hover {
  color: var(--btn-green);
  transform: translateY(-2px);
}

.subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 40px;
}

/* 搜索框样式 */
.search-box {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
  gap: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 4px; /* Square */
  padding: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  align-items: center;
  animation: slideUp 0.6s ease-out 0.2s both;
}

.search-box:focus-within {
  border-color: var(--btn-green);
  box-shadow: 0 0 0 4px rgba(106, 178, 155, 0.15), 0 4px 20px rgba(106, 178, 155, 0.1);
  transform: translateY(-1px);
}

.search-input {
  flex: 1;
  padding: 0 16px;
  height: 48px;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  color: var(--text-dark);
  /* 去掉 Safari 默认的搜索图标和清除按钮 */
  -webkit-appearance: none;
}

.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
  display: none;
}

.search-input:focus {
  border-color: transparent;
  box-shadow: none;
  background: white; /* Highlight background on focus */
}

.search-input::placeholder { 
  color: transparent; /* 隐藏原生 placeholder，由自定义 scroller 替代 */
}

.search-input-container {
  flex: 1;
  position: relative;
  height: 48px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.placeholder-scroller {
  position: absolute;
  left: 16px;
  right: 16px;
  height: 100%;
  pointer-events: none;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--text-placeholder);
  font-weight: 300;
  font-size: 0.95rem;
  transition: opacity 0.2s ease;
}

.placeholder-content {
  white-space: nowrap;
  display: inline-block;
}

.placeholder-scroller.scrolling .placeholder-content {
  animation: marquee-scroll 5s linear infinite alternate;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  20% { transform: translateX(0); }
  80% { transform: translateX(min(0px, calc(var(--container-width, 100%) - var(--scroll-width, 100%)))); }
  100% { transform: translateX(min(0px, calc(var(--container-width, 100%) - var(--scroll-width, 100%)))); }
}

.search-input:focus + .placeholder-scroller,
.search-input-container.has-value .placeholder-scroller {
  opacity: 0;
  visibility: hidden;
}

.clear-search {
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #BDBDBD;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  padding: 0;
  transition: var(--transition);
  flex-shrink: 0;
}

.clear-search:hover {
  background: rgba(0,0,0,0.05);
  color: #8A8A8A;
}

.clear-search svg {
  width: 18px;
  height: 18px;
}

.search-btn {
  width: 48px;
  height: 48px;
  background: var(--btn-green);
  border: none;
  border-radius: 4px; /* Square */
  color: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  margin-right: 0;
  position: relative;
  overflow: hidden;
}

.search-btn:hover { 
  background: var(--btn-green-hover);
  transform: scale(1.08);
  box-shadow: 0 4px 15px rgba(106, 178, 155, 0.4);
}

.search-btn:active {
  background: var(--btn-green-active);
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(106, 178, 155, 0.3);
}

/* 头部主区域 - 标题与登录并排 */
.header-main {
  display: inline-flex;
  position: relative;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
}

/* 用户登录状态 */
.user-status {
  position: absolute;
  left: 100%;
  bottom: 4px; /* Align to bottom, adjusted for visual baseline */
  margin-left: 8px;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .header {
    padding: 40px 10px 30px;
  }
}

.login-prompt {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
}

.prompt-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.btn-login {
  padding: 0;
  background: transparent;
  color: var(--btn-green);
  border: none;
  border-radius: 0;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn-login:hover {
  background: transparent;
  color: var(--btn-green-hover);
  transform: none;
  box-shadow: none;
}

.user-avatar {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.avatar-circle {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--btn-green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.avatar-circle:hover {
  background: var(--btn-green-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.user-menu {
  position: absolute;
  top: 2rem;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  box-shadow: var(--shadow-card);
  min-width: 90px;
  padding: 4px 0;
  z-index: 1000;
  opacity: 1;
  transform: translateX(calc(50% - 0.8rem));
  transition: var(--transition);
}

.menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
}

.menu-item:hover {
  background: rgba(106, 178, 155, 0.1);
  color: var(--btn-green);
}

/* 登录弹窗 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 10px 20px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 420px;
  overflow: hidden;
  animation: modalBounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.closing .modal-overlay {
  animation: fadeIn 0.2s ease-out reverse forwards;
}

.modal.closing .modal-content {
  animation: modalSlideOut 0.3s ease-in forwards;
}

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

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}

.btn-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  border-radius: 4px;
}

.btn-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-dark);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-field {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--card-bg);
  color: var(--text-dark);
}

.input-field::placeholder {
  color: var(--text-placeholder);
  font-weight: 300;
}

.input-field:focus {
  outline: none;
  border-color: var(--btn-green);
  box-shadow: 0 0 0 3px rgba(106, 178, 155, 0.1);
}

.error-message {
  color: var(--error-color);
  font-size: 0.9rem;
  margin: 0;
  padding: 0;
}

.btn {
  padding: 14px 24px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--btn-green);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: var(--btn-green-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(106, 178, 155, 0.3);
}

.btn-primary:active {
  background: var(--btn-green-active);
  transform: translateY(0);
}


/* 主内容区域 */
.main {
  flex: 1;
  padding: 30px 0;
}

.admin-main {
  max-width: 1000px; /* Wider for dashboard view */
  margin: 0 auto;
  width: 100%;
}

/* 加载状态 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-secondary);
  animation: fadeIn 0.3s ease-out;
}

.loading span {
  animation: pulse 1.5s ease-in-out infinite;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-light);
  border-top-color: var(--btn-green);
  border-radius: 50%;
  animation: spinPulse 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  margin-right: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 新增动画关键帧 ========== */

/* 页面加载动画 */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 交互反馈动画 */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.6;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(106, 178, 155, 0.3); }
  50% { box-shadow: 0 0 20px rgba(106, 178, 155, 0.6); }
}

/* 加载动画增强 */
@keyframes spinPulse {
  0% { 
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
  50% { 
    transform: rotate(180deg) scale(1.1);
    opacity: 0.8;
  }
  100% { 
    transform: rotate(360deg) scale(1);
    opacity: 1;
  }
}

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

/* 弹窗动画增强 */
@keyframes modalFadeIn {
  from { 
    opacity: 0;
    backdrop-filter: blur(0);
  }
  to { 
    opacity: 1;
    backdrop-filter: blur(4px);
  }
}

@keyframes modalBounceIn {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(-20px);
  }
  50% {
    transform: scale(1.02) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
}

/* 导航动画 */
@keyframes underlineSlide {
  from { 
    width: 0;
    left: 50%;
  }
  to { 
    width: 100%;
    left: 0;
  }
}

/* 数字计数动画辅助 */
@keyframes countPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* 结果信息 */
.result-info {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 0.9rem;
  font-weight: 400;
}

/* 药品卡片网格 */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.medicine-card {
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 0; /* Remove padding to let children control it */
  border: 1px solid var(--border-light);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden; /* For header background if needed */
  display: flex;
  flex-direction: column;
}

.medicine-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-6px);
  border-color: rgba(106, 178, 155, 0.3);
}

.medicine-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  background: rgba(250, 248, 245, 0.5); /* Slight tint */
}

.medicine-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
  line-height: 1.4;
}

.brand-name {
  font-size: 0.9rem;
  color: var(--btn-green);
  font-weight: 500;
}

/* 可点击的药品头部样式 */
.clickable-header {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.clickable-header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(106, 178, 155, 0.08) 0%, rgba(106, 178, 155, 0.15) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.clickable-header:hover::after {
  opacity: 1;
}

.clickable-header:hover {
  background: linear-gradient(135deg, #F5F5F5 0%, #EFEFEF 100%);
}

.clickable-header:active {
  transform: scale(0.98);
}

/* 照片图标样式 */
.image-icon {
  display: inline-block;
  margin-left: 8px;
  font-size: 1.05rem;
  opacity: 0.7;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.clickable-header:hover .image-icon {
  opacity: 1;
  transform: scale(1.15) rotate(5deg);
}

/* 照片查看弹窗样式 */
/* 照片查看弹窗样式 */
.image-modal-content {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  box-sizing: border-box;
  border-radius: 0;
  background: var(--bg-cream);
  box-shadow: none;
  overflow: hidden;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.image-modal-body {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-cream);
  position: relative;
  width: 100%;
  height: 100%;
}

.image-carousel {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-cream);
  padding: 0;
}

.image-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 100%;
  height: 100%;
  position: relative;
}

.image-container .loading {
  animation: pulse 1.5s ease-in-out infinite;
}

.image-container img {
  border-radius: 0;
  box-shadow: none;
  transition: opacity 0.3s ease;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: block;
}

/* 移动端高比例屏幕 (如 16:9 手机)：图片充满屏幕 (允许裁剪) */
@media screen and (max-width: 768px) and (min-aspect-ratio: 16/10), 
       screen and (max-width: 768px) and (max-aspect-ratio: 10/16) {
  .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* 桌面端或标准/低比例屏幕：图片保持比例缩放，确保内容完整 */
@media screen and (min-width: 769px),
       screen and (max-width: 768px) and (min-aspect-ratio: 10/16) and (max-aspect-ratio: 16/10) {
  .image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

.image-initial {
  animation: imageFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 10;
  padding: 0;
  margin: 0;
  opacity: 0.8;
  outline: none;
}

.carousel-btn:hover {
  background: var(--btn-green);
  border-color: var(--btn-green);
  color: white;
  box-shadow: 0 8px 25px rgba(106, 178, 155, 0.4);
  transform: translateY(-50%) scale(1.1);
  opacity: 1;
}

.carousel-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.carousel-btn-prev {
  left: 24px;
}

.carousel-btn-prev:hover {
  transform: translateY(-50%) scale(1.1) translateX(-3px);
}

.carousel-btn-next {
  right: 24px;
}

.carousel-btn-next:hover {
  transform: translateY(-50%) scale(1.1) translateX(3px);
}

.image-counter {
  text-align: center;
  color: var(--text-dark);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  margin: 0;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.05);
  
  /* Absolute positioning floating at bottom */
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 图片查看器空状态 */
.image-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-secondary);
  padding: 40px;
  text-align: center;
  animation: imageFadeIn 0.5s ease-out forwards;
  /* 绝对居中 */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  z-index: 5;
}

@keyframes imageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.image-empty-icon {
  width: 64px;
  height: 64px;
  opacity: 0.3;
  color: var(--text-secondary);
}

.image-empty-text {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}


/* Immersive Header Styles (Global) */
.image-modal-content .modal-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: transparent;
  border-bottom: none;
  z-index: 20;
  justify-content: space-between;
  padding: 16px;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.image-modal-content .modal-header h3 {
  display: block;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-soft);
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: none;
  pointer-events: auto;
  margin: 0;
}

.image-modal-content .btn-close {
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 44px; 
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.8;
}

.image-modal-content .btn-close:hover {
  background: var(--bg-cream);
  transform: scale(1.1) rotate(90deg);
  opacity: 1;
  color: var(--error-color);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.image-modal-content .btn-close:active {
  transform: scale(0.95) rotate(90deg);
}

/* Immersive Mode Support */
.image-modal-content.immersive-mode .modal-header {
  opacity: 0;
  pointer-events: none;
}

.image-modal-content.immersive-mode .image-counter {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px) !important; /* Ensure translation happens on all screens */
}


/* 图片切换动画 - 优化为更平滑的微位移+缩放 */
.slide-in-right {
  animation: slideInRight 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.slide-in-left {
  animation: slideInLeft 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.slide-out-right {
  animation: slideOutRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.slide-out-left {
  animation: slideOutLeft 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes slideInRight {
  from { transform: translateX(30px) scale(0.98); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-30px) scale(0.98); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0) scale(1); opacity: 1; }
  to { transform: translateX(30px) scale(0.98); opacity: 0; }
}

@keyframes slideOutLeft {
  from { transform: translateX(0) scale(1); opacity: 1; }
  to { transform: translateX(-30px) scale(0.98); opacity: 0; }
}

/* 移动端优化 */
@media (max-width: 768px) {
  @keyframes modalSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  .image-modal-content {
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Mobile adjustment overlaps with base style now, just ensuring reset if needed */
  .image-carousel {
    background: var(--bg-cream);
  }
  

  /* Re-assert mobile specific behaviors if any */
  .image-container img {
    /* Mobile specific tweaks can go here if distinct from global aspect ratio logic */
  }

  .carousel-btn {
    display: none !important; /* Hide buttons on mobile, use swipe */
  }

  /* 移动端特定调整 */
  /* Counter styles promoted to global, just ensuring touch optimization if needed */

  /* 沉浸模式：隐藏控件 (Counter specific to mobile here, header handled globally) */

}

.medicine-body {
  padding: 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-group-title {
  font-size: 0.75rem;
  color: var(--text-placeholder);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 4px;
}

.info-row {
  display: flex;
  font-size: 0.9rem;
  line-height: 1.5;
}

.info-label {
  color: var(--text-secondary);
  width: 80px; /* Fixed width for alignment */
  flex-shrink: 0;
}

.info-value {
  color: var(--text-dark);
  font-weight: 500;
  flex: 1;
  word-break: break-word; /* Ensure long words like formulas break */
  overflow-wrap: break-word;
}

.stock-group {
  background: #F8FAF9;
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid rgba(106, 178, 155, 0.1);
}

.stock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-light);
}

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

.stock-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.stock-value {
  font-weight: 600;
  color: var(--text-dark);
}

.stock-value.has-stock {
  color: var(--btn-green);
}

.stock-value.no-stock {
  color: var(--text-placeholder);
}

.medicine-tags {
  padding: 0 24px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.tag-insurance { background: #E8F4FD; color: #4A90A4; }
.tag-procurement { background: #E8F5F0; color: #5A9F8A; }
.tag-dual { background: #FDF5E8; color: #C4935A; }

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.page-btn {
  padding: 10px 18px;
  border: 1px solid var(--border-light);
  background: var(--card-bg);
  border-radius: 4px; /* Square */
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-dark);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--btn-green);
  color: var(--btn-green);
}

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

.page-btn.active { 
  background: var(--btn-green); 
  color: white; 
  border-color: var(--btn-green); 
}

/* 页脚 */
.footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.footer p {
  margin-bottom: 8px;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.footer a:hover { 
  color: var(--btn-green);
}

/* 卡片容器 */
.card {
  background: var(--card-bg);
  border-radius: 4px; /* Square */
  padding: 40px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
}

/* 表单样式 */
.form { 
  display: flex; 
  flex-direction: column; 
  gap: 20px; 
}

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

.form-group label { 
  display: none;
}

.form-group input[type="text"],
.form-group input[type="password"] {
  padding: 18px 24px;
  border: 1px solid var(--border-light);
  border-radius: 4px; /* Square */
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--card-bg);
  color: var(--text-dark);
}

.form-group input::placeholder {
  color: var(--text-placeholder);
  font-weight: 300;
}

.form-group input:focus {
  outline: none;
  border-color: var(--btn-green);
  box-shadow: 0 0 0 3px rgba(106, 178, 155, 0.1);
}

.checkbox-group { 
  flex-direction: row; 
  align-items: center; 
  margin-top: 24px;
  margin-bottom: 32px;
}

.checkbox-group label {
  display: inline;
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.checkbox-group input[type="checkbox"] { 
  width: 18px; 
  height: 18px; 
  margin-right: 10px;
  accent-color: var(--btn-green);
}

.file-upload-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-cream);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 24px;
}

.file-upload-wrapper:hover {
  border-color: var(--btn-green);
  background: rgba(106, 178, 155, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(106, 178, 155, 0.15);
}

.file-upload-wrapper:hover .upload-icon {
  animation: bounce 0.6s ease infinite;
  opacity: 1;
}

.file-input-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.file-upload-content {
  text-align: center;
  pointer-events: none;
  transition: transform 0.3s ease;
}

.file-upload-wrapper:hover .file-upload-content {
  transform: scale(1.02);
}

.upload-icon {
  color: var(--btn-green);
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.upload-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.upload-subtext {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 300;
}

.file-input:hover {
  border-color: var(--btn-green);
  background: rgba(106, 178, 155, 0.02);
}

/* 按钮样式 */
.btn {
  padding: 16px 32px;
  border: none;
  border-radius: 4px; /* Square */
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

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

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

.btn-primary { 
  background: var(--btn-green); 
  color: white; 
}

.btn-primary:hover:not(:disabled) { 
  background: var(--btn-green-hover);
  transform: translateY(-1px);
}

.btn-secondary { 
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover:not(:disabled) { 
  border-color: var(--text-secondary);
  color: var(--text-dark);
}

/* 管理后台头部 */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: 1.5rem;
}

/* 管理后台容器 */
.admin-container {
  width: 100%;
}

/* 管理后台左右布局 */
.admin-layout {
  display: flex;
  gap: 0;
  min-height: 500px;
  /* Removed background, shadow, border to make it flat */
}

/* 左侧导航栏 */
.admin-sidebar {
  width: 180px; /* narrowed */
  background: transparent;
  padding: 40px 20px 0 0; /* Add right padding */
  flex-shrink: 0;
  border-right: 1px solid var(--border-light); /* Clean divider */
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-end; /* Right align items */
}

.nav-item {
  display: inline-block;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1rem;
  font-weight: 500;
  text-align: right; /* Text align right */
  position: relative;
  padding: 8px 0;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--btn-green);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover::after {
  width: 100%;
}

.nav-item:hover {
  color: var(--text-dark);
  transform: translateX(-3px);
}

.nav-item.active {
  color: var(--btn-green); /* Active color */
}

.nav-item.active::after {
  width: 100%;
}

.nav-item:active {
  transform: scale(0.96) translateX(-3px);
}

/* 右侧内容区 */
.admin-content {
  flex: 1;
  padding: 0 0 0 60px; /* Left padding for content */
  background: transparent;
}

.admin-content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 0;
  border-bottom: none; /* Removed line under header to look cleaner */
}

.admin-content-header h2 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 内容面板标题 */
.panel-section-title {
  font-size: 1.1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin-bottom: 20px;
  display: none; /* Generally hidden as the main header takes role, but kept for structure */
}

/* 内容面板 */
.content-panel {
  display: none;
  opacity: 0;
  transform: translateY(15px);
}

@keyframes panelFadeIn { 
  from { 
    opacity: 0; 
    transform: translateY(15px); 
  } 
  to { 
    opacity: 1; 
    transform: translateY(0); 
  } 
}

.content-panel.active {
  display: block;
  animation: panelFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.panel-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 40px;
  line-height: 1.6;
}

/* 导入区域 */
.import-section { 
  margin-top: 24px; 
}

.import-section h3 { 
  margin-bottom: 12px;
  font-weight: 500;
  color: var(--text-dark);
}

.hint { 
  color: var(--text-secondary); 
  font-size: 0.9rem; 
  margin-bottom: 24px;
  line-height: 1.5;
}

.file-info {
  background: rgba(106, 178, 155, 0.08);
  border: 1px solid rgba(106, 178, 155, 0.2);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.file-info p { 
  margin-bottom: 6px; 
  font-size: 0.9rem; 
  color: var(--text-dark); 
}

.file-info p:last-child { margin-bottom: 0; }
.file-info span { font-weight: 600; }

/* 进度条 */
.import-progress-container {
  margin-top: 24px;
  background: var(--bg-cream);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.progress-header #progressStatus { 
  color: var(--text-dark); 
  font-weight: 500; 
}

.progress-header #progressPercent { 
  color: var(--btn-green); 
  font-weight: 600; 
}

.progress {
  height: 8px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--btn-green), #8AC9B5, var(--btn-green));
  background-size: 200% 100%;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-full);
  animation: shimmer 2s linear infinite;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s ease-in-out infinite;
}

.progress-details {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* 状态消息 */
.error { 
  color: var(--error-color); 
  margin-top: 16px;
  font-size: 0.9rem;
}

.result {
  margin-top: 20px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(106, 178, 155, 0.1);
  color: var(--btn-green);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid var(--btn-green);
}

.result.success-detail {
  background: rgba(106, 178, 155, 0.1);
  color: #4A8F7A;
  border-left-color: #4A8F7A;
}

.result.success-detail .result-title { 
  font-weight: 600; 
  margin-bottom: 10px; 
}

.result.success-detail .result-stats { 
  font-size: 0.9rem; 
}

.result.error { 
  background: rgba(232, 124, 124, 0.1); 
  color: var(--error-color);
  border-left-color: var(--error-color);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1), shake 0.5s ease-in-out 0.4s;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 60px;
  height: 60px;
  margin-bottom: 24px;
  opacity: 0.4;
  stroke: var(--text-secondary);
}

/* 欢迎页面 */
.welcome-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dark);
}

.welcome-icon {
  font-size: 4rem;
  margin-bottom: 24px;
  filter: grayscale(20%);
}

.welcome-state h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.welcome-desc {
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-weight: 300;
}

.welcome-examples {
  display: inline-block;
  text-align: center;
  background: var(--card-bg);
  padding: 24px 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.welcome-examples p {
  margin-bottom: 12px;
  color: var(--text-dark);
}

.welcome-examples ul {
  list-style: none;
  padding: 0;
  text-align: center;
}

.welcome-examples li {
  padding: 8px 0;
  color: var(--text-secondary);
  font-weight: 300;
}

.welcome-examples li::before {
  content: '→ ';
  color: var(--btn-green);
}

/* 底部链接样式 */
.auth-links {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 32px;
}

.auth-links a {
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: var(--transition);
}

.auth-links a.signup {
  color: var(--link-blue);
}

.auth-links a.forgot {
  color: var(--link-orange);
}

.auth-links a:hover {
  opacity: 0.8;
}

/* 分隔线 */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 28px 0;
}

/* 库存导入模块样式 */
.stock-import-modules {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 32px;
}

.stock-module {
  background: transparent;
  border: none;
  border-radius: 0;
  padding-bottom: 32px;
  border-bottom: 1px dashed var(--border-light);
  transition: none;
}

.stock-module:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stock-module:hover {
  box-shadow: none;
}

.stock-module-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.last-import-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.last-import-date span {
  color: var(--btn-green);
  font-weight: 500;
}

.stock-file-upload {
  /* Inherit generic height (200px) */
  margin-bottom: 24px;
}

.stock-module .btn {
  width: 100%;
  margin-top: 12px;
}

.stock-module .result {
  margin-top: 16px;
  font-size: 0.9rem;
}

/* 库存导入进度显示 */
.import-progress-detail {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-cream);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.progress-status {
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: 12px;
  font-weight: 500;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--btn-green);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-stats {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: right;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container { padding: 20px 16px; }
  .header { padding: 40px 16px 30px; }
  .logo { font-size: 2.2rem; }
  .search-input { padding: 16px 20px; font-size: 0.95rem; }
  .main { padding: 20px 0; }
  .results-grid { grid-template-columns: 1fr; gap: 16px; }
  .medicine-card { padding: 0; } /* Remove padding for edge-to-edge header */
  .medicine-header { padding: 16px; }
  .medicine-body { padding: 16px; }
  .medicine-tags { padding: 0 16px 16px; }
  .card { padding: 28px 24px; }
  .admin-header { flex-direction: column; gap: 16px; align-items: stretch; }
  .admin-header h2 { text-align: center; }
  .stock-import-modules { grid-template-columns: 1fr; gap: 16px; }
  
  /* 管理后台响应式 */
  .admin-container { max-width: 100%; }
  .admin-layout { flex-direction: column; min-height: auto; }
  .admin-sidebar { width: 100%; padding: 16px 0; }
  .admin-nav { flex-direction: row; overflow-x: auto; }
  .nav-item { 
    padding: 10px 16px; 
    border-left: none; 
    border-bottom: 3px solid transparent;
    white-space: nowrap;
  }
  .nav-item.active { border-left: none; border-bottom-color: var(--btn-green); }
  .admin-content { padding: 24px 20px; }
  .admin-content-header { flex-direction: column; gap: 12px; }
  .admin-content-header h2 { text-align: center; }
}

@media (max-width: 480px) {
  .container { padding: 16px 12px; }
  .header { padding: 30px 12px 24px; }
  .logo { font-size: 1.9rem; }
  .subtitle { font-size: 0.9rem; margin-bottom: 30px; }
  .pagination { gap: 6px; }
  .page-btn { padding: 8px 14px; font-size: 0.85rem; }
  .card { padding: 24px 20px; }
  .form-group input[type="text"],
  .form-group input[type="password"] {
    padding: 16px 20px;
  }
  .btn { padding: 14px 24px; }
  .auth-links { gap: 30px; }
}

/* ========== 移动端触摸反馈增强 ========== */
@media (max-width: 768px) {
  /* 触摸反馈 - 按钮点击效果 */
  .btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
  
  .search-btn:active {
    transform: scale(0.9);
  }
  
  /* 卡片触摸反馈 */
  .medicine-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
  
  /* 导航触摸反馈 */
  .nav-item:active {
    opacity: 0.7;
    transform: scale(0.95);
  }
  
  /* 可点击区域触摸反馈 */
  .clickable-header:active {
    background: rgba(106, 178, 155, 0.15);
    transform: scale(0.98);
  }
  
  /* 分页按钮触摸反馈 */
  .page-btn:active {
    transform: scale(0.9);
    background: var(--btn-green);
    color: white;
  }
  
  /* 用户头像触摸反馈 */
  .avatar-circle:active {
    transform: scale(0.9);
  }
  
  /* 菜单项触摸反馈 */
  .menu-item:active {
    background: rgba(106, 178, 155, 0.2);
  }
  
  /* 文件上传区触摸反馈 */
  .file-upload-wrapper:active {
    transform: scale(0.98);
    border-color: var(--btn-green);
  }
  
  /* 库存模块触摸反馈 */
  .stock-module:active {
    opacity: 0.9;
  }
  
  /* 统计卡片触摸反馈 */
  .stat-card:active {
    transform: scale(0.97);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  /* 移除 hover 效果，只保留 active 反馈 */
  .btn:hover {
    transform: none;
    box-shadow: none;
  }
  
  .btn:active {
    transform: scale(0.95);
  }
  
  .medicine-card:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  }
  
  .medicine-card:active {
    transform: scale(0.98);
  }
  
  /* 触摸设备的动画时间更短，响应更快 */
  .btn,
  .medicine-card,
  .nav-item,
  .clickable-header {
    transition-duration: 0.15s;
  }
}

}