<template>
  <div class="active-preview-container">
    <div class="back-button" @click="router.replace('/indexPage')">
      <img src="@/assets/indexPage/icon_back.png" alt="">
    </div>

    <div class="preview-content">
      <div class="activity-cards">
        <div class="activity-card">
          <img src="@/assets/indexPage/zhanweitu.png" alt="传承文化" class="activity-image" />
          <div class="activity-info">
            <div class="activity-title">传承文化 温润心灵</div>
            <button class="btn-reserve" @click="goToActivePage">活动预约</button>
          </div>
        </div>

        <div class="activity-card">
          <img src="@/assets/indexPage/zhanweitu.png" alt="元宵节" class="activity-image" />
          <div class="activity-info">
            <div class="activity-title">元宵节灯谜游园会</div>
            <button class="btn-reserve" @click="goToActivePage">活动预约</button>
          </div>
        </div>
      </div>

      <button class="btn-my-reservation" @click="goUserList">我的参观人</button>

      <div class="reservation-info">
        <h2>预约须知</h2>

        <div class="time-info">
          <div class="time-section">
            <span span="time-title">开馆时间</span>
            <div class="time-value">10:00</div>
          </div>
          <div class="line"></div>
          <div class="time-section">
            <span>闭馆时间</span>
            <div class="time-value">18:00</div>
          </div>
          <div class="divider"></div>
          <div class="time-section">
            <div class="stop-time">17:00</div>
            <div class="stop-desc">停止检票</div>
          </div>
        </div>

        <div class="time-note">周一闭馆(法定节假日除外，除夕、正月初一闭馆)。</div>

        <h3 class="reservation-title">预约参观</h3>
        <div class="reservation-rules">
          <p class="rule-content">①所有观众(包括享受优待政策的观众及其陪同人员)<span class="notic">均须实名预约</span>。放票时间为<span
              class="notic">每日18:00，可提前7日(不包括当日)通过官方微信小程序预约</span>，预约时段分为上午(9:00-13:00)和下午(12:00-16:00)，当天不再放票;</p>
          <p class="rule-content">②参观当日须按照预约时段入馆参观，错过预约时段将谢绝入馆。<span
              class="notic">同一证件号</span>当天可进出馆2次，预约上午票的观众首次入馆时间必须在13：00前；</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const goBack = () => {
  router.go(-1)
}
const goUserList = () => {
  router.push('/userList')
}
const goToActivePage = () => {
  router.push('/indexPage/activePage')
}
</script>

<style lang="scss" scoped>
.active-preview-container {
  height: 100vh;
  padding-bottom: 78px;
  background: url('@/assets/indexPage/bg.png') no-repeat;
  background-size: cover;
  box-sizing: border-box;
  position: relative;
  color: #412A12;
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .active-preview-container {
    width: 400px;
  }
}

.back-button {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
}

.back-icon {
  width: 24px;
  height: 24px;
}

.preview-content {
  padding: 20px 30px;
  padding-top: 70px;
}

.activity-cards {
  display: flex;
  flex-direction: column;
}

.activity-card {
  position: relative;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 8px;
}

.activity-image {
  width: 100%;
  height: 103px;
  object-fit: cover;
}

.activity-info {
  position: absolute;
  top: 0;
  width: 100%;
  height: 103px;
  flex-direction: column;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 10px 15px;
}

.activity-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.btn-reserve {
  width: 98px;
  background: transparent;
  height: 36px;
  border-radius: 30px 30px 30px 30px;
  border: 1px solid #FFFFFF;
  margin-top: 10px;
  color: #fff;
}

.btn-my-reservation {
  width: 100%;
  height: 64px;
  background: rgba(255, 255, 255, 0.5);
  color: #584735;
  border: 1px solid #B1967B;
  padding: 12px;
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 20px;
  cursor: pointer;
}


.reservation-info {
  border-radius: 10px;

  .reservation-info h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #584735;
  }

  .time-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .time-title {
    font-size: 14px;
    color: #B1967B;
  }

  .time-value {
    font-size: 40px;
    font-weight: bold;
    color: #94765A;
  }

  .line {
    height: 2px;
    width: 13px;
    background: #584735;
    margin: 24px 6px 0 6px;
  }

  .divider {
    height: 50px;
    width: 2px;
    background: #584735;
    margin: 0 15px;
    color: #584735;
    font-size: 20px;
  }

  .stop-time {
    font-size: 14px;
    color: #B1967B;
  }

  .stop-desc {
    font-size: 14px;
    color: #B1967B;
  }

  .time-note {
    width: 227px;
    font-size: 14px;
    color: #B1967B;
    margin-bottom: 20px;
  }

  .reservation-title {
    font-size: 16px;
    margin-bottom: 10px;
    color: #584735;
    font-weight: bold;
  }

  .reservation-rules {
    font-size: 14px;
    line-height: 1.5;
    color: #B1967B;
    margin-bottom: 20px;

    .rule-content {
      color: #B1967B;

      .notic {
        color: #94765A;
        font-weight: bold;
      }
    }
  }

  .reservation-rules p {
    margin-bottom: 10px;
  }
}
</style>