
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: linear-gradient(135deg, #f9f5f0 0%, #f0e8d8 100%);
    color: #5a3e2a;
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    position: relative; /* 确保背景能覆盖整个页面 */
  }
  /* 全屏背景层 */
  body::before {
    content: "";
    position: fixed; /* 使用 fixed 确保背景不随滚动条移动 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    /* background-position: center; */
    background-repeat: no-repeat;
    z-index: -1; /* 置于最底层 */
    opacity: 0.6; /* 调整透明度，避免影响文字阅读 */
  }
  .container {
    width: 1000px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    overflow: hidden;
  }

  /* 页面标题 */
  .page1 .page-title {
    text-align: center;
    margin: 30px 0;
    position: relative;
    z-index: 1;
  }
  .page2 .page-title,
  .page3 .page-title {
    display: none;
  }
  .page-title h1 {
    color: #8b2e24;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  }

  .page-title p {
    color: #7a6b5e;
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
  }

  /* 页面内容 */
  .page {
    background: rgba(255, 255, 255, 0.2); /* 半透明白色，确保文字可读 */
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
    padding: 40px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
    transition: all 0.5s ease;
    display: none;
    margin-top: 50px;
  }

  .page.active {
    display: block;
    animation: fadeIn 0.5s ease;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* 首页特定样式 */
  .start-content {
    text-align: center;
    margin: 20px 0;
  }

  .sachet-animation {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    position: relative;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50,10 C70,10 85,25 85,45 C85,65 70,80 50,80 C30,80 15,65 15,45 C15,25 30,10 50,10 Z" fill="%23d4a373"/><path d="M50,15 C68,15 80,28 80,45 C80,62 68,75 50,75 C32,75 20,62 20,45 C20,28 32,15 50,15 Z" fill="%23fefae0"/><path d="M50,20 Q60,30 50,40 Q40,30 50,20 Z" fill="%238b2e24"/></svg>')
      no-repeat center/contain;
    animation: float 4s ease-in-out infinite;
  }

  .sachet-animation::after {
    content: "";
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 30px;
    background: #8b2e24;
    border-radius: 3px;
  }

  .instructions {
    background: rgba(212, 163, 115, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin: 30px auto;
    border-left: 4px solid #d4a373;
    max-width: 600px;
    text-align: left;
  }

  .instructions h3 {
    color: #8b2e24;
    margin-bottom: 15px;
    font-size: 18px;
  }

  .instructions p {
    color: #5a3e2a;
    margin-bottom: 10px;
  }

  /* 药材选择区域 */
  .herbs-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin: 40px 0;
  }

  .herb {
    width: 140px;
    height: 140px;
    background: white;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid transparent;
    padding: 15px;
    position: relative;
    overflow: hidden;
  }

  /* .herb:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: #8b2e24;
    opacity: 0;
    transition: opacity 0.3s;
  } */
  .herb.selected {
    border-color: #8b2e24;
    background: #f9e6e4;
  }

  .herb.selected:before {
    opacity: 1;
  }

  .herb-image {
    width: 70px;
    height: 70px;
    object-fit: contain;
    margin-bottom: 12px;
    transition: transform 0.3s;
  }

  .herb:hover .herb-image {
    transform: scale(1.1);
  }

  .herb-name {
    font-size: 16px;
    font-weight: bold;
    color: #5a3e2a;
    text-align: center;
  }

  /* 香囊制作区域 */
  .sachet-area {
    min-height: 200px;
    border: 2px dashed #d4a373;
    border-radius: 15px;
    margin: 30px 0;
    padding: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.3s;
  }

  .sachet-area.active {
    background: rgba(249, 230, 228, 0.3);
    border-color: #8b2e24;
  }

  .selected-herb {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }

  @keyframes popIn {
    0% {
      transform: scale(0.8);
      opacity: 0;
    }
    100% {
      transform: scale(1);
      opacity: 1;
    }
  }
  @keyframes float {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-20px);
    }
  }
  .selected-herb-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
  }

  /* 按钮样式 */
  .btn-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
  }

  .btn {
    background: linear-gradient(135deg, #8b2e24 0%, #6d241c 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(139, 46, 36, 0.3);
    min-width: 200px;
    text-align: center;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
  }

  .btn:after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent
    );
    transition: all 0.5s;
  }

  .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(139, 46, 36, 0.4);
  }

  .btn:hover:after {
    left: 100%;
  }

  .btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }

  .btn-outline {
    background: transparent;
    color: #8b2e24;
    border: 2px solid #8b2e24;
    box-shadow: none;
  }

  .btn-outline:hover {
    background: rgba(139, 46, 36, 0.05);
  }

  /* 结果页面 */
  .result-container {
    text-align: center;
    padding: 20px;
  }

  .sachet-result {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto 20px;
  }

  .sachet-result-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    z-index: 2;
  }

  .result-title {
    font-size: 32px;
    color: #8b2e24;
    margin-bottom: 25px;
    font-weight: bold;
    position: relative;
    display: inline-block;
  }

  .result-detail {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 30px;
    margin: 30px auto;
    max-width: 700px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    text-align: left;
    border: 1px solid rgba(212, 163, 115, 0.3);
  }

  .detail-item {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px dashed #d4a373;
  }

  .detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .detail-label {
    font-weight: bold;
    color: #8b2e24;
    margin-bottom: 15px;
    font-size: 20px;
    display: flex;
    align-items: center;
  }

  .detail-label:before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #8b2e24;
    border-radius: 50%;
    margin-right: 12px;
  }

  .detail-value {
    font-size: 17px;
    line-height: 1.8;
    color: #5a3e2a;
    padding-left: 20px;
  }

  .no-combination {
    color: #8b2e24;
    font-size: 20px;
    margin: 30px 0;
    text-align: center;
    font-weight: bold;
  }

  /* 响应式设计 */
  /* 移动端优化 */
  @media (max-width: 768px) {
    .container {
      width: 100%;
      padding: 10px;
    }

    .page {
      padding: 20px 15px;
      margin-bottom: 20px;
      margin-top: 20px;
    }

    .page-title {
      margin: 20px 0;
    }

    .page-title h1 {
      font-size: 24px;
      margin-bottom: 5px;
    }

    .page-title p {
      font-size: 14px;
      padding: 0 10px;
    }

    .sachet-animation {
      width: 120px;
      height: 120px;
      margin: 20px auto;
    }

    .instructions {
      padding: 15px;
      margin: 20px auto;
    }

    .instructions h3 {
      font-size: 16px;
      margin-bottom: 10px;
    }

    .instructions p {
      font-size: 14px;
      margin-bottom: 8px;
    }

    .herbs-container {
      gap: 15px;
      margin: 20px 0;
    }

    .herb {
      width: 90px;
      height: 90px;
      padding: 10px;
    }

    .herb-image {
      width: 40px;
      height: 40px;
      margin-bottom: 8px;
    }

    .herb-name {
      font-size: 12px;
    }

    .sachet-area {
      min-height: 120px;
      padding: 15px;
      margin: 20px 0;
    }

    .selected-herb {
      width: 70px;
      height: 70px;
    }

    .selected-herb-image {
      width: 35px;
      height: 35px;
    }

    .btn-group {
      margin-top: 20px;
      gap: 15px;
    }

    .btn {
      padding: 12px 20px;
      font-size: 16px;
      min-width: 140px;
    }

    #page2 h2 {
      font-size: 20px;
      margin-bottom: 10px;
    }

    #page2 p {
      font-size: 14px;
      margin-bottom: 20px;
    }

    .result-container {
      padding: 10px;
    }

    .sachet-result {
      width: 150px;
      height: 150px;
      margin: 15px auto;
    }

    .result-title {
      font-size: 22px;
      margin-bottom: 15px;
    }

    .result-detail {
      padding: 20px 15px;
      margin: 20px auto;
    }

    .detail-item {
      margin-bottom: 15px;
      padding-bottom: 15px;
    }

    .detail-label {
      font-size: 16px;
      margin-bottom: 10px;
    }

    .detail-value {
      font-size: 14px;
      padding-left: 15px;
    }

    .no-combination {
      font-size: 16px;
      margin: 20px 0;
    }
  }

  @media (max-width: 480px) {
    .page {
      padding: 15px 10px;
    }

    .page-title h1 {
      font-size: 22px;
    }

    .page-title p {
      font-size: 13px;
    }

    .herb {
      width: 80px;
      height: 80px;
    }

    .sachet-area {
      min-height: 100px;
      padding: 10px;
    }

    .selected-herb {
      width: 60px;
      height: 60px;
    }

    .btn {
      padding: 10px 15px;
      font-size: 15px;
      min-width: 120px;
    }

    .result-title {
      font-size: 20px;
    }

    .detail-label {
      font-size: 15px;
    }

    .detail-value {
      font-size: 13px;
    }
  }
  /* 在现有样式后添加以下代码 */
  body.page::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("../images/bg1.jpg") center/cover no-repeat;
    background-size: cover;
    opacity: 0.15;
    z-index: -1;
    border-radius: 20px; /* 保持与页面相同的圆角 */
  }

  /* 为不同页面指定不同背景 */
  body.page1::before {
    background-image: url("../images/bg1.jpg");
    opacity: 0.5;
  }

  body.page2::before {
    background-image: url("../images/bg2.jpg");
    opacity: 0.8;
  }

  body.page3::before {
    background-image: url("../images/bg3.jpg");
    opacity: 0.8;
  }
