/* ============================================================
 * 公告通知 —— 应用内视图（#ggView）
 * 侧栏保留，主舞台原地切换：body.is-gg 时接管 #chatArea（同 hot/vod 模式）
 * 列表：图左文右的图文列表（有封面显示图，无封面纯文字），图片容器黑底
 * 点击卡片 → 公告详情弹窗：无边框白色毛玻璃 + 背景变暗，仅关闭按钮可关闭
 * PC 阅读宽度 860px 居中 → 移动端单列自适应
 * 复用 vod.css 的顶栏（.vod__top）/ 加载 / 空状态样式与主站 CSS 变量
 * 依赖：style.css 变量与基础样式、vod.css 公共视图组件、card-in / vod-in 动画
 * ========================================================== */

/* ---------- 视图切换（body.is-gg 由 gg.js 控制） ---------- */
body.is-gg #welcome,
body.is-gg #messages,
body.is-gg #typing,
body.is-gg #btnScrollBottom,
body.is-gg #composerDock,
body.is-gg .panel__top { display: none !important; } /* 顶栏仅在任务模式存在 */

body.is-gg .stage {
  overflow: hidden;          /* 视图内部自带滚动区 */
  padding: 0;
  scroll-behavior: auto;
}

#ggView { display: none; }

body.is-gg #ggView {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
  position: relative;
  animation: vod-in .32s cubic-bezier(.2, .8, .2, 1) both; /* 复用 vod.css 入场动画 */
}

/* ---------- 可滚动内容区 ---------- */
.gg__scroll {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 0 24px 46px;
}
.gg__scroll::-webkit-scrollbar { width: 6px; }
.gg__scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; }

/* ---------- 公告列表：PC 阅读宽度居中，纵向节奏排布 ---------- */
.gg__list {
  max-width: 860px;
  margin: 0 auto;
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- 公告卡基础：图左文右 ---------- */
.gg-card {
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr;   /* 封面居左，内容居右 */
  background: var(--card-bg, #fff);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;                     /* 整卡可点击打开详情弹窗 */
  box-shadow: 0 10px 24px -14px rgba(30, 30, 45, .18), 0 2px 6px rgba(30, 30, 45, .04);
  animation: card-in .45s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: var(--d, 0s);
  transition: box-shadow .25s ease, transform .25s ease;
}
.gg-card:hover {
  box-shadow: 0 16px 34px -14px rgba(30, 30, 45, .26), 0 3px 8px rgba(30, 30, 45, .06);
  transform: translateY(-2px);
}

/* 无封面：纯文字卡（不渲染媒体区） */
.gg-card--plain { display: block; }

/* ---------- 封面媒体区：图片容器默认黑色背景 ---------- */
.gg-card__media {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 150px;
  overflow: hidden;
  background: #000;                    /* 默认黑色，图片未加载/留白时为黑底 */
}
.gg-card__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.gg-card:hover .gg-card__media img { transform: scale(1.04); }

/* ---------- 卡片主体 ---------- */
.gg-card__main { padding: 16px 20px 18px; min-width: 0; }

/* 头部：公告徽标（品牌色）+ 发布日期 */
.gg-card__head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.gg-card__badge {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  color: #fff;
  background: var(--acc, var(--brand));
  border-radius: 5px;
  flex: none;
}
.gg-card__date {
  font-size: 12px;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 4px;
}
.gg-card__date svg { width: 12px; height: 12px; flex: none; }

/* 弹窗状态徽标：弹窗推荐（有效期内）/ 停止弹窗（已到期）——只控制首页是否弹窗 */
.gg-card__state {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 8px;
  font-size: 11px; font-weight: 700;
  border-radius: 5px;
  flex: none;
}
.gg-card__state--on  { color: #1e8e4e; background: rgba(30, 142, 78, .12); }
.gg-card__state--off { color: var(--text-mute); background: var(--chip-bg, rgba(0, 0, 0, .06)); }

/* 标题 */
.gg-card__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ---------- 富文本正文（后台图文编辑器内容） ---------- */
.gg-card__body {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-soft, var(--text));
  overflow-wrap: anywhere;
}
.gg-card__body p { margin: 0 0 .6em; }
.gg-card__body p:last-child { margin-bottom: 0; }
.gg-card__body img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 8px 0; }
.gg-card__body a { color: var(--brand); }
.gg-card__body ul, .gg-card__body ol { margin: .4em 0; padding-left: 1.4em; }
.gg-card__body blockquote {
  margin: .6em 0; padding: 6px 14px;
  border-left: 3px solid var(--acc, var(--brand));
  background: var(--chip-bg);
  border-radius: 0 8px 8px 0;
}

/* ---------- 列表内正文预览：限高 + 底部渐隐（全文在详情弹窗中查看） ---------- */
.gg-clamp {
  position: relative;
  max-height: 132px;
  overflow: hidden;
}
.gg-clamp::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 52px;
  background: linear-gradient(transparent, var(--card-bg, #fff) 82%);
  pointer-events: none;
}

/* 「查看详情」提示（整卡可点击） */
.gg-card__hint {
  margin-top: 10px;
  font-size: 12.5px; font-weight: 600;
  color: var(--acc, var(--brand));
  display: inline-flex; align-items: center; gap: 4px;
}
.gg-card__hint svg { width: 13px; height: 13px; }

/* ---------- plain：无封面纯文字卡，左侧品牌色渐变条（颜色逐条轮换） ---------- */
.gg-card--plain::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--acc, var(--brand)), transparent);
}
.gg-card--plain .gg-card__main { padding-left: 24px; }

/* ---------- 加载骨架（复用 .sk 底层样式） ---------- */
.gg-skel { height: 150px; border-radius: 16px; }

/* ============================================================
 * 公告详情弹窗：无边框白色毛玻璃面板 + 背景变暗
 * 仅右上角关闭按钮可关闭，点击空白区不关闭（gg.js 不绑定遮罩关闭）
 * ========================================================== */
.gg-modal {
  position: fixed; inset: 0;
  z-index: 90;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(15, 15, 25, .55);           /* 弹出后背景变暗 */
  animation: gg-fade .22s ease both;
}
.gg-modal[hidden] { display: none; }

@keyframes gg-fade { from { opacity: 0; } to { opacity: 1; } }

.gg-modal__panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(82vh, 780px);
  display: flex; flex-direction: column;
  border: none;                                /* 无边框 */
  border-radius: 20px;
  background: rgba(255, 255, 255, .78);        /* 白色毛玻璃 */
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 24px 64px -24px rgba(0, 0, 0, .45);
  overflow: hidden;
  animation: gg-pop .28s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes gg-pop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* 关闭按钮：毛玻璃圆钮，悬浮于封面之上 */
.gg-modal__close {
  position: absolute; top: 12px; right: 12px;
  z-index: 2;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #333;
  font-size: 16px; line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  transition: background .2s ease, transform .2s ease;
}
.gg-modal__close:hover { background: #fff; transform: scale(1.06); }

.gg-modal__scroll {
  overflow-y: auto;
  padding: 22px 26px 26px;
  min-height: 0;
}
.gg-modal__scroll::-webkit-scrollbar { width: 6px; }
.gg-modal__scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; }

/* 弹窗封面（有封面才显示）：黑底容器，负边距通栏 */
.gg-modal__media {
  position: relative;
  margin: -22px -26px 16px;
  aspect-ratio: 16 / 9;
  background: #000;                            /* 图片容器默认黑色 */
  overflow: hidden;
}
.gg-modal__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.gg-modal__media[hidden] { display: none; }

.gg-modal__head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}

.gg-modal__title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
}

.gg-modal__body {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-soft, var(--text));
  overflow-wrap: anywhere;
}
.gg-modal__body p { margin: 0 0 .7em; }
.gg-modal__body p:last-child { margin-bottom: 0; }
.gg-modal__body img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 10px 0; }
.gg-modal__body a { color: var(--brand); }
.gg-modal__body ul, .gg-modal__body ol { margin: .5em 0; padding-left: 1.4em; }
.gg-modal__body blockquote {
  margin: .8em 0; padding: 8px 14px;
  border-left: 3px solid var(--brand);
  background: rgba(255, 255, 255, .6);
  border-radius: 0 8px 8px 0;
}

/* ============================================================
 * 首页公告横条（#ggPop）：悬浮横条，不影响背景页面使用
 * 无全屏遮罩、不变暗（容器 pointer-events:none 放行底层交互）
 * 定位在首页 hero 区块（.home__hero，logo+标题）下方，水平居中（gg.js 计算）
 * 横条：左侧固定图片 + 右侧详情文字跑马灯（超宽向左滚动，到结尾重新从头）
 * 关闭按钮在横条右侧外部；宽度不超过对话页面 70%
 * 页面加载后自动弹出最新一条有效公告（每次打开页面都会弹出）
 * ========================================================== */
.gg-pop {
  position: fixed; inset: 0;
  z-index: 88;
  display: block;
  pointer-events: none;                        /* 容器不拦截点击，背景页面可正常操作 */
  background: none;                            /* 无遮罩、不变暗，纯悬浮 */
}
.gg-pop[hidden] { display: none; }

/* 横条 + 外部关闭按钮的整组（坐标由 gg.js 按按钮位置设置） */
.gg-pop__wrap {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 8px;
  pointer-events: auto;                        /* 横条自身可交互 */
  animation: gg-pop-in .3s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes gg-pop-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* 横条：左图片 + 右文字，单排，圆角 5px */
.gg-pop__bar {
  display: flex; align-items: stretch;
  width: min(70vw, 560px);                     /* 不超过对话页面 70% 宽度 */
  height: 30px;
  border: none;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18), 0 14px 36px rgba(0, 0, 0, .38); /* 常驻悬浮阴影（双层） */
  cursor: pointer;                             /* 点击横条打开公告详情弹窗 */
}

/* 右：详情文字跑马灯区（白色毛玻璃，单行，超宽由 JS 向左滚动） */
.gg-pop__text {
  flex: 1; min-width: 0;
  height: 100%;
  overflow: hidden;
  display: flex; align-items: center;
  padding: 0 12px;
  background: rgba(255, 255, 255, .82);        /* 白色毛玻璃 */
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  font-size: 12.5px;
  color: var(--text-soft, var(--text));
  white-space: nowrap;
}
.gg-pop__track {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;                      /* 位移由 gg.js rAF 驱动 */
}

/* 左：固定图片（1:1 正方形，黑底容器，铺满横条左端；点击横条打开公告详情） */
.gg-pop__media {
  position: relative;
  flex: none;
  height: 100%;
  aspect-ratio: 1 / 1;                         /* 1:1 尺寸 */
  background: #000;
  overflow: hidden;
}
.gg-pop__media[hidden] { display: none; }
.gg-pop__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* 关闭按钮：横条右侧外部 */
.gg-pop__close {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #333;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  transition: background .2s ease, transform .2s ease;
}
.gg-pop__close:hover { background: #fff; transform: scale(1.06); }

/* ---------- 响应式：平板 ---------- */
@media (max-width: 900px) {
  .gg__scroll { padding: 0 16px 36px; }
  .gg-card { grid-template-columns: 180px 1fr; }
}

/* ---------- 响应式：移动端（保持图左文右，缩小封面列） ---------- */
@media (max-width: 640px) {
  .gg__list { gap: 12px; padding-top: 12px; }
  .gg-card { grid-template-columns: 128px 1fr; border-radius: 13px; }
  .gg-card__media { min-height: 118px; }
  .gg-card__main { padding: 12px 14px 14px; }
  .gg-card--plain .gg-card__main { padding-left: 18px; }
  .gg-card__title { font-size: 15.5px; margin-bottom: 6px; }
  .gg-card__body { font-size: 13px; line-height: 1.65; }
  .gg-clamp { max-height: 96px; }
  .gg-clamp::after { height: 40px; }
  .gg-skel { height: 118px; }
  .gg-modal { padding: 14px; }
  .gg-modal__scroll { padding: 18px 18px 20px; }
  .gg-modal__media { margin: -18px -18px 14px; }
  .gg-modal__title { font-size: 17.5px; }
  .gg-modal__body { font-size: 13.5px; }
}
