body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

.app-logo img {
  /* Make edges blend better with the round background (less cutout feel) */
  filter: saturate(0.98) contrast(0.98);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

.dropdown-animate {
  transform-origin: top right;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-hidden {
  opacity: 0;
  transform: scale(0.9) translateY(-15px);
  pointer-events: none;
}

.article-content p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  color: #475569;
  font-size: 0.95rem;
}

.notice-list::-webkit-scrollbar {
  width: 4px;
}

.notice-list::-webkit-scrollbar-thumb {
  background: #f3f0eb;
  border-radius: 10px;
}

.detail-cover {
  max-height: 320px;
  transition: max-height 240ms ease, opacity 200ms ease, transform 240ms ease;
  will-change: max-height, opacity, transform;
}

/* When user scrolls up in article detail, hide cover + title area, keep top buttons */
#view-article-detail.detail-collapsed .detail-cover {
  max-height: 0;
  opacity: 0;
  transform: translateY(-10px);
}

/* Detail top bar: floats over cover (transparent) */
#view-article-detail .detail-topbar {
  backdrop-filter: none;
}

/* When cover is collapsed, switch to readable white top bar */
#view-article-detail.detail-collapsed .detail-topbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(243, 240, 235, 1);
}

#view-article-detail.detail-collapsed .detail-topbar button {
  color: #64748b;
  /* slate-500 */
}

/* Print Styles for Subtitle Export */
@media print {

  /* Hide everything except print preview */
  body>*:not(#view-print-preview) {
    display: none !important;
  }

  #view-print-preview {
    position: static !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Remove preview controls */
  #view-print-preview>div:first-child {
    display: none !important;
  }

  /* Enable full content rendering */
  #print-body {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    max-height: none !important;
  }

  /* Ensure subtitles break properly across pages */
  .break-inside-avoid {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Force backgrounds to print */
  .print-exact,
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* Page breaks */
  @page {
    margin: 1.5cm;
    size: A4;
  }
}

/* 解决视频播放页在手机端的布局稳定性 */
#view-video-player {
  /* 使用 fixed 代替 absolute，脱离父容器的滚动影响 */
  position: fixed !important;
  inset: 0 !important;
  /* 关键：高度使用 dvh，自动适配手机浏览器地址栏的显隐 */
  height: 100dvh !important;
  z-index: 200 !important;
  /* 确保在所有内容之上 */
  /* CRITICAL ADDITION: Maintain Phone Width on Desktop */
  /* This prevents the "Huge Screen" bug while satisfying the "Fixed Position" requirement */
  max-width: 28rem !important;
  /* Matches max-w-md (28rem) */
  margin: 0 auto !important;
}

/* 确保中间的字幕区是唯一可以滚动的区域 */
#subtitles-container {
  flex: 1 1 0% !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  /* 丝滑滚动 */
}

/* 顶栏和底栏强制禁止收缩，保持固定高度 */
#video-navbar,
#view-video-player>div.flex-shrink-0 {
  flex-shrink: 0 !important;
  z-index: 210 !important;
  /* Base level for footer/header */
  position: relative !important;
  /* Enable Z-Index */
}

/* 1. 确保导航栏是视频页的最高层级，远超视频内容区 */
#view-video-player #video-navbar {
  z-index: 250 !important;
  /* 提升到 250，压制视频区的 210 */
  position: relative !important;
}

/* 2. 修正下拉菜单的定位基准，防止它在不同机型上漂移 */
#video-settings-dropdown {
  /* 确保菜单相对于导航栏的右侧定位 */
  right: 1rem !important;
  top: 3.5rem !important;
  /* 强制保持白色背景，防止被下方视频颜色透过来 */
  background-color: white !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}