/* 宣纸色背景和水墨晕染效果 */
* {
  box-sizing: border-box;
}

body {
  background-color: #f8f3e6;
  /* 宣纸色 */
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0L100 100M100 0L0 100' stroke='%23e8e0d5' stroke-width='0.5'/%3E%3C/svg%3E");
  font-family: "KaiTi", "STKaiti", "FangSong", serif;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  color: #333;
}

.container {
  background: rgba(255, 253, 245, 0.9);
  /* 米白半透 */
  padding: 36px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  width: 100%;
  max-width: 1400px;
  position: relative;
  border: 1px solid #e0d7c9;
}

/* 水墨晕染背景装饰 */
.container::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.03) 0%, transparent 70%);
  z-index: -1;
  border-radius: 50%;
}

.container::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: -20px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle,
      rgba(139, 0, 0, 0.02) 0%,
      transparent 80%);
  z-index: -1;
  border-radius: 50%;
}

/* 导航栏 */
header {
  text-align: center;
  margin-bottom: 36px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 2.2rem;
  font-weight: bold;
  color: #2c1810;
  text-decoration: none;
  margin-bottom: 12px;
}

.logo-icon {
  color: #c12a2a;
  font-size: 2.5rem;
}

.section-title {
  text-align: center;
  margin-bottom: 28px;
  color: #2c1810;
  font-size: 28px;
  letter-spacing: 2px;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  background: #c12a2a;
  /* 朱砂红 */
  margin: 10px auto;
  border-radius: 1px;
}

/* 体质类型卡片网格 */
.constitution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.constitution-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid #b8a99a;
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

.constitution-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-color: #c12a2a;
}

.constitution-header {
  background: #f0e9e0;
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid #b8a99a;
}

.constitution-header h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: #2c1810;
}

.constitution-header .constitution-code {
  background: #c12a2a;
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  display: inline-block;
  margin-top: 5px;
  min-height: 30px;
}

.constitution-content {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.constitution-characteristics {
  color: #4a3a2a;
  font-size: 0.9rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
}

.constitution-characteristics i {
  color: #c12a2a;
}

.constitution-description {
  color: #4a3a2a;
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.6;
  flex: 1;
}

.view-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(to bottom, #c12a2a, #a02020);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  font-family: "KaiTi", serif;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  min-height: 44px;
  margin-top: auto;
}

.view-btn:hover {
  background: linear-gradient(to bottom, #d43a3a, #b02525);
}

/* 详情面板 */
.details-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 900px;
  height: 100vh;
  background: rgba(255, 253, 245, 0.95);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
  transition: right 0.3s ease;
  overflow-y: auto;
  z-index: 100;
  padding: 30px;
  border: 1px solid #e0d7c9;
}

.details-panel.active {
  right: 0;
}

.close-details {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 2rem;
  cursor: pointer;
  color: #c12a2a;
  transition: color 0.3s;
  min-height: 44px;
  min-width: 44px;
}

.close-details:hover {
  color: #a02020;
}

.details-header {
  text-align: center;
  margin-bottom: 30px;
}

.details-header h2 {
  color: #2c1810;
  margin-bottom: 10px;
  font-size: 2.2rem;
}

.details-header .constitution-code {
  background: #c12a2a;
  color: white;
  padding: 3px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  display: inline-block;
  margin-top: 5px;
}

.details-content {
  margin-bottom: 30px;
}

.details-content h3 {
  color: #2c1810;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid #b8a99a;
  font-size: 1.6rem;
}

.details-content p {
  margin-bottom: 15px;
  line-height: 1.7;
  color: #4a3a2a;
}

.advice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 25px;
}

.advice-item {
  background: #fdfcf9;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  border: 1px solid #b8a99a;
}

.advice-item h4 {
  color: #c12a2a;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  min-height: 44px;
}

.advice-item h4 i {
  color: #c12a2a;
}

.advice-item ul {
  padding-left: 20px;
}

.advice-item li {
  margin-bottom: 8px;
  list-style-type: none;
  position: relative;
}

/* 页脚 */
footer {
  text-align: center;
  margin-top: 40px;
  padding: 30px 0;
  border-top: 1px solid #e0d7c9;
  color: #5a4a3a;
}

.footer-content {
  margin-bottom: 20px;
}

.footer-title {
  font-size: 1.4rem;
  margin-bottom: 15px;
  color: #2c1810;
  position: relative;
  display: inline-block;
}

.footer-title::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 20px;
  width: 40px;
  height: 2px;
  background: #c12a2a;
  border-radius: 1px;
}

.links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.links a {
  color: #c12a2a;
  text-decoration: none;
  position: relative;
  padding: 2px 6px;
  font-family: "KaiTi", serif;
  font-size: 1.1rem;
}

.links a::before {
  content: "「";
  opacity: 0.7;
}

.links a::after {
  content: "」";
  opacity: 0.7;
}

.links a:hover {
  color: #a02020;
}

.footer-bottom {
  font-size: 0.9rem;
  color: #7a6a5a;
  margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .constitution-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .constitution-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .details-panel {
    width: 100%;
    padding: 20px;
  }

  .section-title h2 {
    font-size: 2.2rem;
  }

  footer {
    margin-top: 25px;
    padding: 20px 0;
  }

  .container::before {
    width: 80px;
    height: 80px;
    top: -20px;
    right: -20px;
  }

  .container::after {
    width: 70px;
    height: 70px;
    bottom: -30px;
    left: -15px;
  }
}

@media (max-width: 576px) {
  .advice-grid {
    gap: 15px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
    padding: 10px;
  }

  .logo {
    font-size: 1.8rem;
    gap: 8px;
  }

  .section-title {
    font-size: 24px;
  }

  .container {
    padding: 20px;
  }

  .constitution-card {
    border-radius: 8px;
    min-height: 200px;
  }

  .constitution-header {
    padding: 15px;
  }

  .constitution-header h3 {
    font-size: 1.2rem;
  }

  .constitution-content {
    padding: 20px;
  }

  .view-btn {
    padding: 10px;
    font-size: 14px;
    min-height: 44px;
  }

  .details-panel {
    padding: 15px;
  }

  .details-header h2 {
    font-size: 1.5rem;
  }

  .details-content h3 {
    font-size: 1.3rem;
  }

  .advice-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .advice-item {
    padding: 15px;
  }

  .footer-title {
    font-size: 1.2rem;
  }

  .links {
    gap: 10px;
    font-size: 1rem;
  }

  .footer-bottom {
    font-size: 0.8rem;
  }
}