/* 渤海船票官网 - 静态样式 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #5495e9;
  --primary-dark: #3a7bd5;
  --text: #000;
  --text-secondary: #979797;
  --border: #eaeaea;
  --bg-light: #f5f9ff;
  --shadow: 0 4px 20px rgba(84, 149, 233, 0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #fff;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

a { text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }

img { max-width: 100%; display: block; }

/* 显隐控制 */
.desktop-only { display: none !important; }

/* ========== 页头 ========== */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.header-contact {
  font-size: 14px;
  opacity: 0.95;
}

.header-contact a {
  color: #fff;
  font-weight: 600;
}

/* ========== 轮播 ========== */
.swiper-box {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: var(--primary);
}

.swiper-slide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.swiper-slide.active { opacity: 1; }

.swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.swiper-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  z-index: 2;
}

.swiper-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0 4px;
  -webkit-appearance: none;
  appearance: none;
}

.swiper-dot.active { background: #fff; width: 20px; border-radius: 4px; }

/* ========== 公告 ========== */
.notice-box {
  background: #fffbe8;
  border-bottom: 1px solid #f5e6a3;
  overflow: hidden;
  height: 40px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.notice-icon {
  flex-shrink: 0;
  padding: 0 12px;
  color: #e6a23c;
  font-size: 14px;
  font-weight: 600;
}

.notice-scroll {
  overflow: hidden;
  flex: 1;
}

.notice-track {
  display: flex;
  animation: noticeScroll 20s linear infinite;
  white-space: nowrap;
}

.notice-track span {
  padding-right: 60px;
  font-size: 13px;
  color: #666;
}

@keyframes noticeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ========== 主内容区 ========== */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px 24px;
  position: relative;
  z-index: 1;
}

.booking-section {
  margin-top: 0;
  position: relative;
  z-index: 1;
}

.booking-layout {
  display: block;
}

/* 订票卡片 */
.booking-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ticket-box {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 32px 24px 24px;
}

.city-block {
  flex: 1;
  cursor: pointer;
}

.city-block.left { text-align: left; }
.city-block.right { text-align: right; }

.city-title-text {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 4px;
}

.city-text {
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
}

.exchange-wrap {
  flex-shrink: 0;
  padding: 0 12px;
  cursor: pointer;
}

.exchange-btn {
  width: 44px;
  height: 44px;
  display: block;
}

.date-box {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 20px 20px;
}

.date-display {
  display: flex;
  align-items: baseline;
  cursor: pointer;
}

.date-time-text {
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  margin-right: 12px;
}

.date-week-text {
  color: var(--text-secondary);
  font-size: 14px;
}

.date-input-hidden {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.search-box {
  padding: 24px 20px 16px;
}

.btn-search {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  padding: 14px 0;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-search:hover { background: var(--primary-dark); }

.tips-box {
  text-align: center;
  color: var(--primary);
  font-size: 13px;
  padding: 8px 20px 20px;
  cursor: pointer;
}

.tips-box:hover { text-decoration: underline; }

/* ========== 二维码面板（PC） ========== */
.qrcode-panel {
  display: none !important;
}

/* ========== 微信客服栏 ========== */
.wechat-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  cursor: pointer;
}

.wechat-bar:active {
  background: #fafafa;
}

.wechat-bar-text {
  flex: 1;
  font-size: 15px;
  color: #333;
}

.wechat-bar-text strong {
  color: var(--text);
  font-weight: 600;
}

.wechat-bar-btn {
  flex-shrink: 0;
  display: inline-block;
  margin-left: 12px;
  background-color: #e74c3c;
  color: #ffffff;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 600;
  font-style: normal;
  line-height: 1.4;
  white-space: nowrap;
}

/* ========== 微信弹窗 ========== */
#wechatModal .wechat-modal-box {
  position: relative;
  display: block;
  flex-shrink: 0;
  background: #ffffff;
  width: 85%;
  max-width: 340px;
  border-radius: 16px;
  padding: 36px 24px 24px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  max-height: none;
  overflow: visible;
}

.wechat-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 26px;
  color: #cccccc;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.wechat-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #000000;
  margin-bottom: 20px;
  line-height: 1.5;
}

.wechat-modal-id {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 14px;
  font-size: 15px;
  color: #666666;
  margin-bottom: 20px;
}

.wechat-modal-copy {
  display: block;
  width: 100%;
  background-color: #07c160;
  color: #ffffff;
  border-radius: 50px;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
}

.wechat-modal-copy:active {
  background-color: #06ad56;
}

.wechat-copy-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 600;
}

/* ========== H5 底部电话栏 ========== */
.mobile-phone-bar {
  display: block;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: #ffffff;
  border-top: 1px solid #eaeaea;
  padding: 8px 16px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

a.btn-phone-call {
  display: block;
  width: 100%;
  height: 44px;
  line-height: 44px;
  text-align: center;
  background-color: #e74c3c;
  color: #ffffff;
  font-size: 16px;
  border-radius: 22px;
  font-weight: 600;
  text-decoration: none;
}

/* ========== 补充区块 ========== */
.section {
  margin-top: 32px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}

.route-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.route-card {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  border: 1px solid rgba(84, 149, 233, 0.15);
  width: 48%;
  margin-bottom: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, background-color 0.2s;
}

.route-card:active {
  background-color: #f5f9ff;
  border-color: #5495e9;
}

.route-card.selected {
  background-color: #f5f9ff;
  border-color: #5495e9;
}

.route-card.selected .route-name {
  color: #5495e9;
}

.route-card .route-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.route-card .route-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.tips-section {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 20px;
  font-size: 14px;
  color: #555;
  line-height: 1.8;
}

.tips-section p { margin-bottom: 8px; }
.tips-section p:last-child { margin-bottom: 0; }

/* ========== 页脚 ========== */
.site-footer {
  background: #2c3e50;
  color: rgba(255,255,255,0.8);
  padding: 32px 16px;
  margin-top: 40px;
  margin-bottom: 0;
  text-align: center;
  font-size: 13px;
}

.footer-contact {
  margin-bottom: 12px;
  font-size: 15px;
}

.footer-contact p {
  margin: 0 0 6px 0;
}

.footer-contact p:last-child {
  margin-bottom: 0;
}

.footer-contact strong {
  color: #fff;
  font-size: 18px;
}

.footer-copy {
  opacity: 0.6;
  margin-top: 8px;
}

.footer-beian {
  opacity: 0.6;
  margin-top: 6px;
  font-size: 12px;
}

.footer-beian a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.footer-beian a:hover {
  color: #ffffff;
}

/* ========== 弹层：须知 ========== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

#wechatModal.modal-overlay {
  align-items: center;
  justify-content: center;
}

.modal-sheet {
  background: #fff;
  width: 100%;
  max-height: 70vh;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 16px; }

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.modal-tab {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  font-size: 14px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}

.modal-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(70vh - 120px);
  font-size: 14px;
  color: #555;
  line-height: 1.8;
}

.modal-panel { display: none; }
.modal-panel.active { display: block; }

.modal-panel h4 {
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--text);
}

.modal-panel p { margin-bottom: 8px; }

/* ========== 城市选择弹层 ========== */
.city-modal .modal-sheet {
  max-height: 75vh;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
}

.city-modal .modal-header {
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}

.city-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  min-height: 0;
}

.city-list li {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 15px;
}

.city-list li:hover,
.city-list li:active { background: #f5f9ff; color: #5495e9; }

.city-list li.selected {
  background-color: #f5f9ff;
  color: #5495e9;
  font-weight: 600;
}

.city-list li .city-selected-tag {
  display: none;
  float: right;
  font-size: 13px;
  font-weight: normal;
  color: #5495e9;
}

.city-list li.selected .city-selected-tag {
  display: inline;
}

/* ========== PC 布局 ========== */
@media (min-width: 992px) {
  body {
    padding-bottom: 0;
  }

  .desktop-only { display: block !important; }

  .mobile-phone-bar { display: none !important; }

  .main-content { padding-bottom: 40px; }

  .swiper-box { height: 420px; border-radius: 0; }

  .booking-section { margin-top: 24px; }

  .booking-layout {
    display: flex;
    align-items: flex-start;
  }

  .booking-card {
    flex: 1;
    border-radius: 12px;
  }

  .qrcode-panel {
    width: 340px;
    margin-left: 24px;
    flex-shrink: 0;
    display: block !important;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 80px;
    transition: box-shadow 0.3s;
  }

  .qrcode-panel:target,
  .qrcode-panel.highlight {
    box-shadow: 0 0 0 3px var(--primary), var(--shadow);
  }

  .qrcode-panel img {
    width: 220px;
    height: 220px;
    margin: 0 auto 16px;
    border-radius: 8px;
  }

  .qrcode-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
  }

  .qrcode-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
  }

  .qrcode-contact {
    border-top: 1px solid rgba(84, 149, 233, 0.2);
    padding-top: 16px;
    text-align: left;
  }

  .qrcode-contact p {
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
  }

  .qrcode-contact .phone-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
  }

  .route-grid { justify-content: flex-start; }

  .route-card {
    width: 23%;
    margin-right: 2.66%;
    margin-bottom: 12px;
  }

  .route-card:nth-child(4n) {
    margin-right: 0;
  }

  .header-contact { font-size: 16px; }

  .footer-contact p {
    display: inline;
    margin: 0;
  }

  .footer-phone::after {
    content: ' | ';
    opacity: 0.6;
  }

  .modal-overlay { align-items: center; }

  .modal-sheet {
    max-width: 600px;
    border-radius: 16px;
    max-height: 80vh;
  }

  @keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
}
