/**
 * 19-chrome.css —— 全站 chrome 调整（所有页面都加载）。
 *
 * 1) 隐藏源站的 deals 抽屉
 *    .drawer-opener 里 drawer-opener-text 是空的，文案「DEALS」和 9+ 徽章
 *    都是这个入口自带的。它和已移除的左右浮标属于同一块业务
 *    （tpd.deals，源站自营），我们申请不到联盟，先不展示。
 *    刻意用 display:none 而不是删 DOM —— interactions.js 里有 13 处
 *    querySelectorAll('.drawer-opener') 相关逻辑，删掉元素反而可能报错。
 *
 * 2) 统一内容区的左右留白节奏
 *    源站各页面 .container 的 padding 不一致，这里收敛成一套值。
 */

/* ---------- 1) deals 抽屉 ---------- */
.drawer-overlay,
.drawer-content,
.drawer-opener {
  display: none !important;
}

/* ---------- 3) 「关于本站」长文折叠 ----------
   实测详情页里这段 .inner-footer 高 4201px，占整页 75%。
   源站本身是折叠的，我们没做，导致 footer 被推到很远。
   用 :has() + checkbox 做纯 CSS 折叠，内容仍完整留在 DOM 里。 */
.cp-expand-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.copyright-message .inner-footer {
  position: relative;
  max-height: 400px;
  overflow: hidden;
  transition: max-height 0.28s ease;
}

/* 底部渐变，提示还有内容 */
.copyright-message .inner-footer::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 85%);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

body:has(#cp-expand:checked) .copyright-message .inner-footer {
  max-height: none;
}

body:has(#cp-expand:checked) .copyright-message .inner-footer::after {
  opacity: 0;
}

/* 展开/收起按钮 */
.cp-expand-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 auto 24px;
  padding: 9px 22px;
  width: fit-content;
  border: 1px solid #e6e6ec;
  border-radius: 6px;
  background: #fff;
  color: #6b6b76;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}

.cp-expand-label:hover {
  border-color: #ff9701;
  color: #ff9701;
}

.cp-expand-input:focus-visible ~ .cp-expand-label {
  outline: 2px solid #ff9701;
  outline-offset: 2px;
}

/* 文案切换 */
.cp-expand-less,
body:has(#cp-expand:checked) .cp-expand-more {
  display: none;
}

body:has(#cp-expand:checked) .cp-expand-less {
  display: inline;
}

/* 深色模式 */
.dark .copyright-message .inner-footer::after {
  background: linear-gradient(to bottom, rgba(26, 26, 32, 0), #1a1a20 85%);
}

.dark .cp-expand-label {
  background: #1e1e24;
  border-color: #2b2b33;
  color: #9d9daa;
}

.dark .cp-expand-label:hover {
  border-color: #ff9701;
  color: #ff9701;
}
