:root {
  --primary: #2f6f5e;
  --primary-light: #e7f1ee;
  --accent: #c9a063;
  --danger: #c0392b;
  --warn: #b8860b;
  --text-main: #2b2b2b;
  --text-sub: #777777;
  --border: #ebe5d8;
  --bg: #f7f3ec;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
}

a {
  text-decoration: none;
  color: inherit;
}

input, textarea, button {
  font-family: inherit;
  font-size: 15px;
}

/* 顶部导航 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 16px;
}

.brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--primary);
  white-space: nowrap;
}

.nav-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
}

.nav-tabs a {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-sub);
  white-space: nowrap;
}

.nav-tabs a.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.content {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 60px;
  min-height: calc(100vh - 56px);
}

.container {
  padding: 16px;
}

.page {
  padding: 16px;
}

/* 卡片与通用组件 */
.card {
  background: #ffffff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.btn-primary {
  display: block;
  background: var(--primary);
  color: #ffffff;
  border-radius: 24px;
  font-size: 15px;
  padding: 11px 0;
  text-align: center;
  border: none;
  cursor: pointer;
}

.btn-outline {
  display: block;
  background: #ffffff;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 24px;
  font-size: 15px;
  padding: 10px 0;
  text-align: center;
  cursor: pointer;
}

.btn-danger {
  display: block;
  background: #ffffff;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 24px;
  font-size: 14px;
  padding: 9px 0;
  text-align: center;
  cursor: pointer;
}

.tag {
  display: inline-block;
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 5px;
  padding: 3px 9px;
  margin: 0 6px 6px 0;
}

.tag-accent {
  color: #8a6420;
  background: #fbf1de;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
}

.search-bar {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 20px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  margin-left: 8px;
  font-size: 15px;
  background: transparent;
}

.icon, .clear-icon {
  font-size: 15px;
  color: var(--text-sub);
}

.clear-icon {
  cursor: pointer;
  padding: 0 4px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 4px 0 10px 0;
  display: flex;
  align-items: center;
}

.section-title .bar {
  width: 4px;
  height: 15px;
  background: var(--accent);
  border-radius: 2px;
  margin-right: 8px;
  display: inline-block;
}

.empty {
  text-align: center;
  color: var(--text-sub);
  padding: 60px 0;
  font-size: 14px;
}

.warn-banner {
  background: #fdf3e3;
  border: 1px solid #f0d8a8;
  color: #8a6420;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.strong-warn {
  border-color: #e8b4a8;
  background: #fdeae5;
  color: var(--danger);
  font-weight: 600;
}

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

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-main);
}

.bullet {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.8;
}

.tip {
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  margin: 10px 0 20px;
}

.back-link {
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 12px;
}

/* ============ 首页：人体图谱 ============ */
.banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.banner-title .title {
  font-size: 19px;
  font-weight: 700;
}

.banner-title .sub {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

.view-toggle {
  display: flex;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.toggle-btn {
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
}

.toggle-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.meridian-legend {
  display: flex;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 4px;
  gap: 8px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 5px 12px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.legend-chip.active {
  border-width: 2px;
  font-weight: 600;
}

.legend-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  display: inline-block;
}

.diagram-outer {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

.diagram-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 88 / 192;
  background: #000;
  border-radius: 16px;
  border: 1px solid #0c2630;
  overflow: hidden;
}

.view-label {
  position: absolute;
  left: 10px;
  top: 8px;
  font-size: 11px;
  color: #9aeaff;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 8px;
  border-radius: 10px;
}

.xray-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.points-layer {
  position: absolute;
  inset: 0;
}

.point-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid #ffffff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.26), 0 0 5px 1px rgba(255, 255, 255, 0.62);
  cursor: pointer;
}

/* 扩大实际可点击/可触摸热区，视觉上仍保持小圆点 */
.point-dot::after {
  content: '';
  position: absolute;
  inset: -7px;
}

.point-dot:hover {
  width: 11px;
  height: 11px;
}

.point-dot.is-highlight {
  width: 14px;
  height: 14px;
  pointer-events: none;
  animation: pulse-marker 1.6s ease-in-out infinite;
}

.locator-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.locator-col {
  flex: 1 1 140px;
  min-width: 140px;
}

.locator-label {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 6px;
  text-align: center;
}

.locator-diagram {
  max-width: 220px;
  margin: 0 auto;
}

.zoom-box {
  position: relative;
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  background: #000;
  border-radius: 12px;
  border: 1px solid #0c2630;
  overflow: hidden;
}

.zoom-img {
  position: absolute;
  object-fit: fill;
}

.zoom-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.zoom-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 0 7px 1px rgba(255, 255, 255, 0.85);
  animation: pulse-marker 1.6s ease-in-out infinite;
}

@keyframes pulse-marker {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 0 7px 2px rgba(255, 255, 255, 0.85); }
  50% { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 0 14px 5px rgba(255, 255, 255, 0.95); }
}

.hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 6px;
}

.mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 30;
}

.point-popup {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: 720px;
  transform: translateX(-50%);
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  padding: 18px 18px 26px;
  z-index: 31;
}

.popup-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.popup-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.popup-name {
  font-size: 19px;
  font-weight: 700;
}

.popup-code {
  font-size: 12px;
  color: var(--text-sub);
  flex: 1;
}

.popup-close {
  font-size: 16px;
  color: var(--text-sub);
  cursor: pointer;
  padding: 0 4px;
}

.popup-meridian {
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 8px;
}

.popup-location {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.popup-link {
  text-decoration: none;
}

/* ============ 搜索 / 详情 ============ */
.point-card {
  display: block;
  padding: 14px 16px;
}

.point-name {
  font-size: 17px;
  font-weight: 700;
  margin-right: 8px;
}

.point-code {
  font-size: 12px;
  color: var(--text-sub);
}

.point-location {
  font-size: 13px;
  color: var(--text-sub);
  margin: 6px 0;
}

.hot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hot-item {
  display: block;
  width: calc((100% - 20px) / 3);
  background: #ffffff;
  border-radius: 10px;
  padding: 14px 0;
  text-align: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
}

.hot-name {
  font-size: 15px;
  font-weight: 600;
  display: block;
}

.hot-code {
  font-size: 11px;
  color: var(--text-sub);
  display: block;
  margin-top: 2px;
}

.detail-header {
  padding: 16px;
}

.detail-name {
  font-size: 24px;
  font-weight: 700;
  margin-right: 10px;
}

.detail-code {
  font-size: 13px;
  color: var(--text-sub);
}

/* ============ 放血疗法 ============ */
.intro-card {
  cursor: pointer;
}

.toggle-arrow {
  font-size: 12px;
  color: var(--text-sub);
}

.intro-body {
  margin-top: 10px;
}

.sub-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin: 10px 0 4px;
}

.cat-scroll {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 4px;
}

.cat-chip {
  display: inline-block;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-sub);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.cat-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.seg-tabs {
  display: flex;
  background: var(--primary-light);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 14px;
}

.seg-tab {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  padding: 8px 0;
  border-radius: 8px;
  cursor: pointer;
}

.seg-tab.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.special-desc {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.6;
  background: var(--primary-light);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.technique-card {
  display: block;
  padding: 14px 16px;
}

.technique-name {
  font-size: 16px;
  font-weight: 700;
}

.technique-points {
  font-size: 13px;
  color: var(--text-sub);
  margin: 6px 0;
}

/* ============ 我的医案 ============ */
.case-card {
  display: block;
  padding: 14px 16px;
}

.case-title {
  font-size: 16px;
  font-weight: 700;
}

.case-date {
  font-size: 12px;
  color: var(--text-sub);
}

.case-complaint {
  font-size: 13px;
  color: var(--text-sub);
  margin: 6px 0;
}

.case-owner {
  display: inline-block;
  font-size: 12px;
  color: var(--primary);
  margin-top: 4px;
}

.login-box {
  max-width: 360px;
  margin: 40px auto;
  text-align: center;
}

.login-box .form-item {
  margin: 16px 0;
}

.patient-info {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 6px;
}

.point-tag {
  background: var(--primary-light);
  cursor: pointer;
}

.action-row {
  display: flex;
  margin: 16px 0 30px;
  gap: 10px;
}

.action-btn {
  flex: 1;
}

.fab {
  position: fixed;
  right: 24px;
  bottom: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(47, 111, 94, 0.4);
  line-height: 1;
}

/* ============ 医案表单 ============ */
.form-item {
  margin-bottom: 14px;
}

.label {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 6px;
  display: block;
}

.input {
  width: 100%;
  background: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
}

.textarea {
  width: 100%;
  background: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  min-height: 70px;
  resize: vertical;
  font-family: inherit;
}

.point-chips {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 10px;
  gap: 8px;
}

.point-chip {
  display: flex;
  align-items: center;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
}

.chip-remove {
  margin-left: 8px;
  color: var(--text-sub);
  cursor: pointer;
}

.suggestion-list {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 8px;
  overflow: hidden;
}

.suggestion-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  cursor: pointer;
}

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

.suggestion-item:hover {
  background: var(--primary-light);
}

.sug-code {
  color: var(--text-sub);
  font-size: 12px;
}

.save-btn {
  margin: 18px 0 8px;
  border: none;
}

/* ============ 关于 ============ */
.app-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.app-sub {
  font-size: 13px;
  color: var(--text-sub);
  text-align: center;
  margin-top: 4px;
}

/* ============ 全局 toast ============ */
#global-toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
  max-width: 80%;
  text-align: center;
}

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

.developer-signature {
  max-width: 720px;
  margin: -42px auto 0;
  padding: 0 16px 24px;
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

@media (max-width: 420px) {
  .hot-item {
    width: calc((100% - 16px) / 2);
  }
}
