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

    <div class="header-image">
      <img src="@/assets/indexPage/zhanweitu.png" alt="预约参观" class="main-image" />
    </div>
    <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 class="reservation-button">
        <div class="btn-reserve" @click="startPreview">参观预约</div>
        <div class="btn-people">我的参观人</div>
      </div>
    </div>
  </div>
</template>

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

const router = useRouter()
const startPreview = () => {
  router.push({ name: 'startPreview' })
}
</script>

<style lang="scss" scoped>
.visit-preview-container {
  position: relative;
  height: 100vh;
  padding-bottom: 78px;
  background: #fff;
  position: relative;
  color: #412A12;
  overflow-y: auto;
}

.back-button {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;

  img {
    width: 40px;
    height: 40px;
  }
}

.header-image {
  height: 240px;

  .main-image {
    width: 100%;
    height: 100%;
  }
}

.reservation-info {
  position: absolute;
  width: 100%;
  top: 200px;
  height: calc(100vh - 200px);
  background: #E0D2B4;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  padding: 30px;
  overflow: auto;

  .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;
  }
}

.reservation-button {
  display: flex;
  flex-direction: column;
  margin-top: 20px;
}

.btn-reserve {
  background: url('@/assets/indexPage/preview-btn.png');
  width: 100%;
  height: 93px;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-size: 100% auto;
  color: #fff;
}

.btn-people {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 64px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 5px 5px 5px 5px;
  border: 1px solid #94765A;
  margin-top: 10px;
}

.btn-reserve:hover {
  background-color: #9A7F65;
}
</style>