/* ========================================
   中医药穴位查询 - 样式表
   设计风格：中医现代健康风，清新绿色系
   ======================================== */

/* ===== CSS 变量 ===== */
:root {
  --primary: #2e7d32;
  --primary-light: #4caf50;
  --primary-lighter: #81c784;
  --primary-dark: #1b5e20;
  --primary-bg: #e8f5e9;
  --primary-bg-light: #f1f8e9;
  --accent: #8d6e63;
  --accent-light: #bcaaa4;
  --text-main: #1b2b1b;
  --text-secondary: #555;
  --text-light: #888;
  --bg: #f5f7f5;
  --white: #ffffff;
  --border: #c8e6c9;
  --shadow: 0 2px 8px rgba(46, 125, 50, 0.1);
  --shadow-lg: 0 4px 16px rgba(46, 125, 50, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Header ===== */
.header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: var(--white);
  padding: 1.5rem 1rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  letter-spacing: 2px;
  position: relative;
  z-index: 1;
}

.header .subtitle {
  font-size: 0.85rem;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

.header .tagline {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.7;
  position: relative;
  z-index: 1;
}

/* ===== 搜索区域 ===== */
.search-section {
  max-width: 700px;
  margin: -1.2rem auto 0;
  padding: 0 1rem;
  position: relative;
  z-index: 10;
}

.search-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  font-size: 1rem;
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}

.search-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.search-btn:hover {
  background: var(--primary-dark);
}

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

/* ===== 症状快捷选择 ===== */
.symptom-tags {
  margin-top: 0.8rem;
}

.symptom-tags-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.symptom-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.symptom-tag {
  background: var(--primary-bg);
  color: var(--primary-dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.symptom-tag:hover {
  background: var(--primary-lighter);
  color: var(--white);
  border-color: var(--primary-light);
}

.symptom-tag.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ===== 主内容区 ===== */
.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ===== 分区标题 ===== */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 1.5rem 0 0.8rem;
  padding-left: 0.8rem;
  border-left: 4px solid var(--primary-light);
}

/* ===== 经络图谱 ===== */
.meridian-chart-wrapper {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

#meridian-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.view-switcher {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.view-btn {
  background: var(--primary-bg);
  color: var(--primary-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.view-btn:hover {
  background: var(--primary-lighter);
}

.view-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.svg-container {
  width: 100%;
  max-width: 400px;
  display: flex;
  justify-content: center;
}

.svg-container svg {
  width: 100%;
  height: auto;
}

.acupoint-marker {
  cursor: pointer;
  transition: var(--transition);
}

.acupoint-dot {
  transition: r 0.2s ease;
}

.acupoint-dot.active {
  fill: #e65100 !important;
  r: 7;
}

.acupoint-label {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.acupoint-marker:hover .acupoint-label {
  opacity: 1;
}

.chart-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* ===== 搜索结果 - 穴位卡片 ===== */
.results-section {
  margin-top: 1.5rem;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.results-header h2 {
  font-size: 1.1rem;
  color: var(--primary-dark);
}

.results-count {
  font-size: 0.8rem;
  color: var(--text-light);
}

.acupoint-card-list {
  display: grid;
  gap: 0.8rem;
}

.acupoint-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  transition: var(--transition);
  cursor: pointer;
  border-left: 4px solid var(--primary-light);
}

.acupoint-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateX(2px);
}

.acupoint-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.acupoint-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.acupoint-code {
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 4px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  font-family: monospace;
}

.acupoint-meridian {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.acupoint-effect {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.acupoint-card-footer {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-detail {
  background: var(--primary-bg);
  color: var(--primary-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

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

/* ===== 穴位详情弹窗 ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
}

.modal-close:hover {
  color: var(--text-main);
}

.detail-header {
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--primary-bg);
}

.detail-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.detail-code {
  display: inline-block;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 4px;
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
  font-family: monospace;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.detail-meridian {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: var(--accent);
}

.detail-section {
  margin-bottom: 1rem;
}

.detail-label {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.2rem;
  font-weight: 500;
}

.detail-value {
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.6;
}

/* ===== 按摩教程 ===== */
.tutorial-section {
  background: var(--primary-bg-light);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 0.5rem;
}

.tutorial-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tutorial-steps {
  list-style: none;
  counter-reset: step;
}

.tutorial-step {
  counter-increment: step;
  padding: 0.5rem 0 0.5rem 2rem;
  position: relative;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px dashed var(--border);
}

.tutorial-step:last-child {
  border-bottom: none;
}

.tutorial-step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--primary-light);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

/* ===== 语音播报控制 ===== */
.voice-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.btn-voice {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: inherit;
}

.btn-voice:hover {
  background: var(--primary-dark);
}

.btn-voice.playing {
  background: #e65100;
}

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

.voice-speed {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.voice-speed select {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text-main);
  cursor: pointer;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-light);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.empty-state .empty-text {
  font-size: 0.9rem;
}

/* ===== 知识库区 ===== */
.knowledge-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-top: 1.5rem;
}

.knowledge-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--primary-bg);
  margin-bottom: 0.8rem;
  overflow-x: auto;
}

.knowledge-tab {
  background: none;
  border: none;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
  margin-bottom: -2px;
}

.knowledge-tab:hover {
  color: var(--primary);
}

.knowledge-tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.knowledge-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
}

.knowledge-item {
  background: var(--primary-bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.knowledge-item:hover {
  background: var(--primary-bg);
  border-color: var(--primary-light);
}

.knowledge-item-name {
  font-weight: 600;
  color: var(--primary-dark);
}

.knowledge-item-meridian {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 0.1rem;
}

/* ===== 收藏列表 ===== */
.favorites-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-top: 1.5rem;
}

.favorites-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.favorite-item {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.favorite-item:hover {
  background: #ffe0b2;
}

.favorite-remove {
  background: none;
  border: none;
  color: #e65100;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  opacity: 0.6;
}

.favorite-remove:hover {
  opacity: 1;
}

.favorites-empty {
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: center;
  padding: 0.5rem;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.78rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
}

.footer p {
  margin: 0.2rem 0;
}

.footer .disclaimer {
  margin-top: 0.5rem;
  color: var(--text-light);
  opacity: 0.7;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
  .header h1 {
    font-size: 1.2rem;
  }
  
  .header .subtitle {
    font-size: 0.75rem;
  }
  
  .search-input {
    font-size: 0.9rem;
    padding: 0.6rem 0.8rem 0.6rem 2.2rem;
  }
  
  .search-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
  
  .acupoint-card {
    padding: 0.8rem;
  }
  
  .acupoint-name {
    font-size: 1rem;
  }
  
  .modal-content {
    padding: 1.2rem;
    width: 95%;
  }
  
  .detail-name {
    font-size: 1.2rem;
  }
  
  .knowledge-list {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  
  .svg-container {
    max-width: 300px;
  }
  
  .view-btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 380px) {
  .search-input-wrapper {
    flex-direction: column;
  }
  
  .search-btn {
    width: 100%;
  }
  
  .knowledge-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== 动画 ===== */
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

.acupoint-dot.active + .acupoint-pulse {
  animation: pulse 1.5s infinite;
}

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

.acupoint-card {
  animation: fadeInUp 0.3s ease;
}

/* ===== 提示弹窗 ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-main);
  color: var(--white);
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  z-index: 200;
  opacity: 0;
  transition: var(--transition);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
