/* ============================================================
   WhereRelay — 顶部公告条（全站）
   ------------------------------------------------------------
   位置：<body> 最顶部、吸顶导航之上；随页面滚动离开，导航继续吸顶。
   结构：partials/00-notice.html
   脚本：assets/js/notice.js（关闭 + 记住选择；不负责样式动画）
   主题：浅绿底 + 绿色「公告」胶囊，内容居中一行；改色只改下面变量。

   动效：
   - 关闭：高度收到 0 + 淡出，0.28s，之后写 localStorage 不再出现
   - prefers-reduced-motion：关闭不播动画；无其它循环动画
   ============================================================ */

.notice{
  /* 主题变量（只想换配色改这里） */
  --notice-bg:var(--tint);
  --notice-line:var(--tint-2);
  --notice-h:36px;
  position:relative;
  height:var(--notice-h);
  background:var(--notice-bg);
  border-bottom:1px solid var(--notice-line);
  color:var(--ink-2);
  overflow:hidden;
  transition:height .28s cubic-bezier(.2,.6,.2,1),opacity .28s ease;
}
html.notice-off .notice{display:none}
.notice.is-closing{height:0;opacity:0;border-bottom-color:transparent}

.notice-in{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  height:var(--notice-h);
  /* 左右对称留白：内容始终相对视口居中，同时避开右侧关闭按钮 */
  padding-left:44px;
  padding-right:44px;
}

.notice-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:none;
  height:22px;
  padding:0 8px;
  border-radius:6px;
  background:var(--brand);
  color:#fff;
  font-size:11px;
  line-height:1;
  font-weight:600;
  letter-spacing:.02em;
}

.notice-promo,
.notice-main{
  display:inline-flex;
  align-items:center;
  min-width:0;
  color:var(--ink-2);
  font-size:13px;
  line-height:20px;
  white-space:nowrap;
}
.notice-promo{flex:none}
.notice-main{flex:0 1 auto;gap:5px}
.notice-tx{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.notice-sep{flex:none;color:var(--ink-4);font-size:13px;line-height:20px}

.notice-promo:hover,
.notice-main:hover .notice-tx{
  color:var(--ink);
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:3px;
  text-decoration-color:var(--brand);
}
.notice-ar{flex:none;width:15px;height:15px;color:var(--ink-3);margin-left:2px;transition:transform .16s ease,color .16s ease}
.notice-main:hover .notice-ar{transform:translateX(2px);color:var(--brand)}

/* 关闭按钮：贴在整条最右侧，浅色底上低对比，悬停才明显 */
.notice-close{
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  border-radius:6px;
  color:var(--ink-4);
  transition:color .15s ease,background-color .15s ease;
}
.notice-close:hover{color:var(--ink);background:rgba(0,136,79,.08)}
.notice-close .i{width:14px;height:14px}

/* ---------- 移动端：隐藏第一个促销链接，主文案两行 ---------- */
@media (max-width:760px){
  .notice{--notice-h:48px}
  .notice-in{gap:8px;padding-left:40px;padding-right:40px}
  .notice-promo,
  .notice-sep{display:none}
  .notice-main{flex:0 1 auto}
  .notice-tx{
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    white-space:normal;
    font-size:12px;
    line-height:18px;
    overflow:hidden;
  }
  .notice-pill{height:20px;padding:0 7px;font-size:10px}
  .notice-close{right:8px}
}

@media (prefers-reduced-motion:reduce){
  .notice{transition:none}
  .notice.is-closing{height:0;opacity:1}
}

.notice a:not([href]),.notice a:not([href]):hover{cursor:default;text-decoration:none}
.notice-main:not([href]):hover .notice-tx{text-decoration:none}

/* Editable copy may be longer than the original sample. Keep it inside the bar. */
.notice-promo{display:block;max-width:45%;overflow:hidden;text-overflow:ellipsis}
.notice.notice-promo-only .notice-promo{max-width:100%}
@media (max-width:760px){
 .notice-promo{display:none}
 .notice.notice-promo-only .notice-promo{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;font-size:12px;line-height:18px;flex:0 1 auto}
}
