:root{
  --web-bg: #f6f7fb;
  --web-surface: #ffffff;
  --web-text: #0f172a;
  --web-muted: #64748b;
  --web-border: rgba(15, 23, 42, 0.10);
  --web-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --web-shadow-hover: 0 16px 40px rgba(15, 23, 42, 0.12);
  --web-radius: 16px;
  --web-brand: #2563eb;
  --web-brand-2: #1d4ed8;
}
html.web-theme-dark{
  --web-bg: #0b1220;
  /* 夜间：卡片底更深一点，减少“发灰/发白” */
  --web-surface: rgba(16, 22, 32, 0.62);
  --web-text: rgba(255, 255, 255, 0.92);
  --web-muted: rgba(255, 255, 255, 0.62);
  --web-border: rgba(255, 255, 255, 0.12);
  --web-shadow: 0 18px 54px rgba(0, 0, 0, 0.45);
  --web-shadow-hover: 0 22px 70px rgba(0, 0, 0, 0.58);
}

*{ box-sizing:border-box; }
html,body{ height:auto; min-height:100vh; }
html{
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(99, 102, 241, 0.10), transparent 50%),
    var(--web-bg);
  color: var(--web-text);
  scroll-behavior: smooth;
}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: transparent;
  color: var(--web-text);
}
html.web-theme-dark body{
  background: transparent;
}
html.web-theme-dark{
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.18), transparent 55%),
    radial-gradient(900px 520px at 100% 0%, rgba(99, 102, 241, 0.14), transparent 52%),
    radial-gradient(900px 520px at 30% 120%, rgba(56, 189, 248, 0.10), transparent 55%),
    var(--web-bg);
}

/*
 * 嵌入模式（/web/download 的 iframe）：
 * 1) 不能用全透明，否则会透出 iframe 默认白底。
 * 2) 不要用与主站 body 相同位置的径向渐变：iframe 宽度通常等于内容栏，渐变落点与
 *    视口左右「留白区」不一致，会出现「左侧更黑、内容区略亮」的色差缝。
 * 这里用纯色 var(--web-bg) 与主站留白区底色对齐；独立打开 /download 时仍可用 html 渐变。
 */
html.dl-embed{
  background-color: var(--web-bg) !important;
  background-image: none !important;
  color: var(--web-text);
}
html.dl-embed.web-theme-dark{
  background-color: var(--web-bg) !important;
  background-image: none !important;
}
html.dl-embed body{
  background: transparent !important;
}

/* 嵌入模式：去掉页面底色，但保留“玻璃卡片”以适配夜间模式（避免变得更白） */
html.dl-embed .dl-hero,
html.dl-embed .dl-card{
  box-shadow: none !important;
  background: var(--web-surface) !important;
  border-color: var(--web-border) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
/* 嵌入模式：夜间进一步压暗卡片底色，避免仍然“发白/发灰” */
html.dl-embed.web-theme-dark .dl-hero,
html.dl-embed.web-theme-dark .dl-card{
  background: rgba(10, 14, 20, 0.55) !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
}
html.dl-embed.web-theme-dark .dl-actions__hint,
html.dl-embed.web-theme-dark .dl-muted{
  color: rgba(255,255,255,0.58) !important;
}
/* 嵌入模式：夜间把 hero 渐变改为更克制的暗色，不再“发白” */
html.dl-embed.web-theme-dark .dl-hero__bg{
  display: block !important;
  background:
    radial-gradient(900px 320px at 20% 0%, rgba(37, 99, 235, 0.14), transparent 64%),
    radial-gradient(860px 320px at 90% 10%, rgba(99, 102, 241, 0.10), transparent 68%) !important;
  opacity: 0.9;
}

a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }

/* Web 分页（统一：页码按钮 + 省略号），兼容夜间模式 */
.web-pager{
  width: 100%;
  display: flex;
  justify-content: center;
}
.web-pager .pagination{
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.web-pager .page-item{ margin: 0 !important; }
.web-pager .page-link{
  border-radius: 12px !important;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.01em;
  border: 1px solid var(--web-border) !important;
  background: rgba(255,255,255,0.88);
  color: rgba(15, 23, 42, 0.80) !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}
.web-pager .page-link:hover{
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.30) !important;
  color: var(--web-brand) !important;
  background: rgba(37, 99, 235, 0.06);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.14);
}
.web-pager .page-link:active{
  transform: translateY(0);
}
.web-pager .page-item.disabled .page-link{
  opacity: 0.55;
  box-shadow: none;
  transform: none;
  background: rgba(15, 23, 42, 0.03);
  color: rgba(15, 23, 42, 0.55) !important;
}
.web-pager .page-item.active .page-link{
  border-color: rgba(37, 99, 235, 0.0) !important;
  background: linear-gradient(135deg, var(--web-brand), var(--web-brand-2));
  color: #fff !important;
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.32);
}
.web-pager .page-link:focus{
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}
html.web-theme-dark .web-pager .page-link{
  background: rgba(16, 22, 32, 0.78);
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: rgba(255,255,255,0.82) !important;
  box-shadow: 0 14px 34px rgba(0,0,0,0.45);
}
html.web-theme-dark .web-pager .page-link:hover{
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.35) !important;
  color: rgba(255,255,255,0.92) !important;
  box-shadow: 0 18px 44px rgba(0,0,0,0.55);
}
html.web-theme-dark .web-pager .page-item.disabled .page-link{
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.58) !important;
  border-color: rgba(255,255,255,0.12) !important;
}
html.web-theme-dark .web-pager .page-item.active .page-link{
  box-shadow: 0 18px 52px rgba(0,0,0,0.58);
}

.dl-page{
  width: 100%;
  margin: 0;
  padding: 0;
}

.dl-hero{
  position: relative;
  border-radius: var(--web-radius);
  background: var(--web-surface);
  border: 1px solid var(--web-border);
  box-shadow: var(--web-shadow);
  overflow: hidden;
}
.dl-hero__bg{
  position:absolute; inset:-2px;
  background:
    radial-gradient(900px 320px at 20% 0%, rgba(37, 99, 235, 0.14), transparent 60%),
    radial-gradient(860px 320px at 90% 10%, rgba(99, 102, 241, 0.12), transparent 62%);
  pointer-events:none;
}
html.web-theme-dark .dl-hero__bg{
  background:
    radial-gradient(900px 320px at 20% 0%, rgba(37, 99, 235, 0.18), transparent 62%),
    radial-gradient(860px 320px at 90% 10%, rgba(99, 102, 241, 0.14), transparent 65%);
}
.dl-hero__inner{
  position:relative;
  padding: 20px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dl-app{ display:flex; gap: 14px; align-items:center; min-width: 260px; }
.dl-app__icon{
  width: 64px; height: 64px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--web-border);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
  overflow:hidden;
  flex: 0 0 auto;
}
html.web-theme-dark .dl-app__icon{
  background: rgba(255,255,255,0.06);
  box-shadow: 0 16px 34px rgba(0,0,0,0.45);
}
.dl-app__icon img{ width:100%; height:100%; object-fit: cover; }
.dl-app__name{ font-size: 18px; font-weight: 800; letter-spacing: 0.2px; }
.dl-app__sub{ font-size: 13px; display:flex; align-items:center; gap: 8px; }
.dl-app__desc{
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 520px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.dl-muted{ color: var(--web-muted); }
.dl-dot{ color: var(--web-muted); opacity: 0.75; }

.dl-badge{
  display:inline-flex;
  align-items:center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--web-border);
  background: rgba(37, 99, 235, 0.08);
  color: var(--web-brand);
  font-weight: 700;
  font-size: 12px;
}
html.web-theme-dark .dl-badge{
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(255,255,255,0.14);
}
.dl-badge--soft{
  background: rgba(100, 116, 139, 0.10);
  color: var(--web-text);
}
html.web-theme-dark .dl-badge--soft{
  background: rgba(148, 163, 184, 0.12);
}

.dl-actions{ display:flex; flex-direction:column; align-items:flex-end; gap: 8px; }
.dl-actions__row{ display:flex; align-items:center; gap: 10px; }
.dl-actions__hint{ font-size: 12px; }

.dl-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--web-border);
  background: transparent;
  color: var(--web-text);
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  user-select:none;
}
.dl-btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--web-shadow-hover);
  border-color: rgba(37, 99, 235, 0.28);
}
.dl-btn--primary{
  background: linear-gradient(135deg, var(--web-brand), var(--web-brand-2));
  border-color: rgba(37, 99, 235, 0.42);
  color: #fff;
}
.dl-btn--primary:hover{
  border-color: rgba(37, 99, 235, 0.55);
}
.dl-btn--ghost{
  background: rgba(15, 23, 42, 0.02);
}
html.web-theme-dark .dl-btn--ghost{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
}
.dl-btn:active{
  transform: translateY(0px) scale(0.99);
}
.dl-btn:focus-visible{
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
}

.dl-section{ margin-top: 14px; }
.dl-section__title{
  font-size: 13px;
  font-weight: 800;
  color: var(--web-muted);
  margin: 10px 6px 8px;
}
html.web-theme-dark .dl-section__title{
  color: rgba(255,255,255,0.72);
}
.dl-card{
  background: var(--web-surface);
  border: 1px solid var(--web-border);
  border-radius: var(--web-radius);
  box-shadow: var(--web-shadow);
  padding: 14px;
}
html.web-theme-dark .dl-card{
  box-shadow: 0 22px 60px rgba(0,0,0,0.55);
}

.dl-shots{
  display:flex;
  gap: 12px;
  overflow-x:auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge legacy */
  cursor: grab;
  user-select: none;
  touch-action: pan-y; /* 允许竖向滚动，但让横向拖拽交给 JS */
  /* 允许鼠标滚轮在此区域继续滚动整页（不要阻断滚动链） */
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
}
.dl-shots-wrap{
  position: relative;
}
.dl-shots-arrow{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--web-border);
  background: rgba(255,255,255,0.92);
  color: rgba(15, 23, 42, 0.82);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
  display: grid;
  place-items: center;
  line-height: 0;
  padding: 0;
  cursor: pointer;
  user-select: none;
}
.dl-shots-arrow__icon{
  display: block;
  width: 18px;
  height: 18px;
}
.dl-shots-arrow:hover{
  background: rgba(255,255,255,0.98);
}
.dl-shots-arrow:active{
  transform: translateY(-50%) scale(0.98);
}
.dl-shots-arrow--left{ left: 6px; }
.dl-shots-arrow--right{ right: 6px; }
html.web-theme-dark .dl-shots-arrow{
  background: rgba(16, 22, 32, 0.88);
  border-color: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.88);
  box-shadow: 0 14px 34px rgba(0,0,0,0.45);
}
.dl-shots-arrow:focus{
  outline: none;
}
.dl-shots:active{ cursor: grabbing; }
.dl-shots.is-dragging{ cursor: grabbing; }
.dl-shots.is-dragging{
  /* 不启用 scroll-snap：保证“停在哪里就在哪里”不跳动 */
}
.dl-shots::-webkit-scrollbar{ width: 0; height: 0; display: none; } /* Chrome/Safari */
.dl-shot{
  height: 320px;
  border-radius: 14px;
  border: 1px solid var(--web-border);
  background: rgba(15, 23, 42, 0.04);
  object-fit: cover;
  pointer-events: none; /* 拖拽滚动时不让图片接管事件 */
}
html.web-theme-dark .dl-shot{
  /* 截图一般偏白：夜间加深背景与边框，降低刺眼感 */
  background: rgba(0,0,0,0.22);
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 18px 42px rgba(0,0,0,0.55);
}
@media (max-width: 768px){
  .dl-shot{ height: 260px; }
}
@media (max-width: 576px){
  /* 已在桌面端改为全宽；移动端保持全宽避免露出底色 */
  .dl-page{ width: 100%; margin: 0; padding: 0; }
  .dl-hero__inner{ padding: 16px; }
  .dl-actions{ align-items:stretch; width: 100%; }
  .dl-actions__row{ width: 100%; }
  .dl-btn{ width: 100%; }
}

.dl-rich{
  font-size: 14px;
  line-height: 1.75;
  word-break: break-word;
}
.dl-rich a{ color: var(--web-brand); text-decoration: underline; text-underline-offset: 2px; }
.dl-rich img{ border-radius: 12px; }

.dl-log{ padding: 10px 0; border-top: 1px solid rgba(15, 23, 42, 0.08); }
.dl-log:first-child{ border-top: none; padding-top: 0; }
html.web-theme-dark .dl-log{ border-top-color: rgba(255,255,255,0.10); }
.dl-log__meta{ display:flex; align-items:center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.dl-log__content{ color: var(--web-text); }

.dl-footer{
  margin-top: 16px;
  padding: 0;
  background: transparent;
}
.dl-footer__inner{
  text-align:center;
  font-size: 12px;
  padding: 12px 0 0;
}

.dl-toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 18px 52px rgba(0,0,0,0.35);
  font-size: 13px;
  font-weight: 700;
  display: none;
}
html.web-theme-dark .dl-toast{
  background: rgba(2, 6, 23, 0.78);
  border-color: rgba(255,255,255,0.12);
}
.dl-toast--success{ background: rgba(16, 185, 129, 0.92); }
.dl-toast--warn{ background: rgba(245, 158, 11, 0.92); }
.dl-toast--info{ background: rgba(37, 99, 235, 0.92); }
html.web-theme-dark .dl-toast--success{ background: rgba(16, 185, 129, 0.72); }
html.web-theme-dark .dl-toast--warn{ background: rgba(245, 158, 11, 0.72); }
html.web-theme-dark .dl-toast--info{ background: rgba(37, 99, 235, 0.72); }