* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100vh;
  height: 100dvh; /* 动态视口高度，适配移动端浏览器地址栏收起/展开 */
  overflow: hidden; /* 锁定整页滚动，只有日程列表内部可滚 */
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none; /* 阻止滚动穿透到父级（下拉回弹等） */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
    'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #1f2d3d;
  line-height: 1.5;
  /* 默认渐变背景（无图时） */
  background-color: #eef3fa;
  /* 垂直 flex，上中下三段布局 */
  display: flex;
  flex-direction: column;
  /* 适配 iOS 安全区：顶部/底部 padding 加上安全区 */
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  padding-left: 16px;
  padding-right: 16px;
}

/* 有背景图时：图 + 半透明遮罩，保证文字可读 */
body.has-bg {
  background-image:
    linear-gradient(rgba(245, 247, 250, 0.86), rgba(233, 239, 247, 0.90)),
    var(--bg-url);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
}

#app {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  flex: 1;                     /* 占满 body 剩余高度 */
  display: flex;
  flex-direction: column;
  min-height: 0;               /* 关键：允许子元素 overflow，不被内容撑高 */
  /* 主题色变量，两个页面通过 class 切换 */
  --primary: #2c5aa0;
  --primary-light: #4a90e2;
  --primary-soft: rgba(44, 90, 160, 0.12);
  --primary-shadow: rgba(44, 90, 160, 0.28);
}

#app.page-camp {
  --primary: #6a5ae0;
  --primary-light: #8b7ff0;
  --primary-soft: rgba(106, 90, 224, 0.12);
  --primary-shadow: rgba(106, 90, 224, 0.28);
}

/* ===================== 页面标题 ===================== */
.page-title {
  flex: 0 0 auto;             /* 固定高度，不参与伸缩 */
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 6px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary); /* 降级色 */
  margin: 8px 0 4px;
}

/* 标题下方装饰短线 */
.page-title::after {
  content: '';
  display: block;
  width: 44px;
  height: 3px;
  border-radius: 2px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

/* ===================== 日程列表（时间线） =====================
 * 布局思路：
 *   - flex:0 1 auto：条目少时自适应高度，条目多时在剩余空间内收缩
 *   - max-height:100%：保证不超过标题与底部按钮之间的可用空间
 *   - overflow-y:auto：仅此区域内部可滚动
 *   - -webkit-overflow-scrolling:touch：提供 iOS 惯性滚动
 */
.schedule-list {
  position: relative;
  flex: 0 1 auto;             /* 条目少时自适应高度，条目多时收缩并滚动 */
  min-height: 0;              /* 关键：允许在 flex 容器中收缩以触发 overflow */
  max-height: 100%;           /* 不超过剩余可用空间 */
  list-style: none;
  background: rgba(255, 255, 255, 0.94); /* 背景图下也保持可读 */
  -webkit-backdrop-filter: saturate(180%) blur(6px);
  backdrop-filter: saturate(180%) blur(6px);
  border-radius: 16px;
  padding: 18px 18px 4px;
  margin-top: 16px;
  box-shadow: 0 10px 30px rgba(44, 90, 160, 0.12);
  overflow-y: auto;           /* 唯一的可滚动区域 */
  -webkit-overflow-scrolling: touch; /* iOS 惯性滚动 */
  overscroll-behavior: contain;     /* 阻止滚动穿透到 body */
}

/* 贯穿竖线（已移除容器级 ::before，改用每条目自己画）
 * 原因：当 .schedule-list 是 overflow-y:auto 时，
 * 容器 ::before 的 top/bottom 只基于可见区域而非完整内容高度。
 * 解决：每条目的 ::after 画半段竖线，连起来成一条完整时间线。
 */

.schedule-item {
  position: relative;
  padding: 14px 4px 14px 56px;   /* 内容区从 56px 开始，远离圆点 */
}

/* 圆点：left=24, 直径12 => 中心=30，对齐竖线 */
.schedule-item::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
  z-index: 1;
}

/* 贯穿竖线段：从圆点下方延伸到下一条目圆点下方，首尾项特殊处理 */
.schedule-item::after {
  content: '';
  position: absolute;
  left: 29px;               /* 圆点中心 30px - 半线宽 1px */
  top: 30px;                /* 圆点底部 18 + 12 */
  bottom: -7px;             /* 延伸到下一条目圆点下方 -7px（与下半段重叠避免缝隙） */
  width: 2px;
  background: linear-gradient(180deg,
    var(--primary) 0%,
    var(--primary-light) 100%);
  opacity: 0.35;
  z-index: 0;
}

/* 首项：顶部不画竖线（避免从卡片顶部引出一段空白竖线） */
.schedule-item:first-child::after {
  top: 24px;                /* 略低于圆点中心开始 */
}

/* 末项：不再延伸到卡片外，结束在本条目底部 */
.schedule-item:last-child::after {
  bottom: 14px;             /* 结束在条目内底部 */
}

.schedule-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 3px;
  /* 防止长数字串在窄屏折行压到圆点 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-event {
  font-size: 16px;
  font-weight: 500;
  color: #2c3e50;
  word-break: break-word;
}

/* ===================== 底部超链接 ===================== */
.footer-links {
  flex: 0 0 auto;             /* 固定在底部，不参与伸缩 */
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  padding-bottom: 4px;
}

.footer-link {
  display: inline-block;
  min-width: 120px;
  text-align: center;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 24px;
  box-shadow: 0 8px 18px var(--primary-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.footer-link:active {
  transform: translateY(2px);
  box-shadow: 0 4px 10px var(--primary-shadow);
}
