/* 侧栏小组件（公告 / 倒计时 / 投票）的轮播与内部排版。
   卡片外观、间距由 style.css 的 .notice-widget / .countdown-widget / .vote-widget 和 .sidebar gap 提供。
   只在首页加载（index.html），位置在 assets_common 之后，与原先内联 <style> 的层级一致。 */

/* ---- 来自 notice.html ---- */
/* ---- 公告轮播组件（卡片外观与间距统一由 style.css 的 .notice-widget / .sidebar gap 提供） ---- */
.notice-roll {
  position: relative;
  height: 44px;
  overflow: hidden;
}
.notice-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: transform 0.5s ease, opacity 0.5s ease, visibility 0.5s;
}
.notice-item.nt-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.notice-item.nt-leave {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
}
/* 无 JS 时兜底：仅显示第一条 */
.notice-roll .notice-item:first-child {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.notice-roll.nt-ready .notice-item:first-child {
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
}
.notice-roll.nt-ready .notice-item:first-child.nt-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nt-line {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  text-decoration: none;
  padding: 4px 2px;
  box-sizing: border-box;
}
.nt-top {
  flex: none;
  background: var(--color-danger, #ef4444);
  color: #fff;
  font-size: var(--text-xs);
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  margin-right: 8px;
}
.nt-title {
  flex: 1;
  color: var(--color-text, #1e293b);
  font-size: var(--text-base);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nt-line:hover .nt-title {
  color: var(--color-accent, #6366f1);
}
.nt-arrow {
  flex: none;
  color: var(--color-accent, #6366f1);
  font-size: var(--text-xl);
  margin-left: 6px;
  line-height: 1;
}
/* 移动端适配：768px 以下（触屏点击区域随行高整体保留；内边距由 style.css 统一控制） */
@media screen and (max-width: 768px) {
  .notice-roll { height: 40px; }
  .nt-line { min-height: 40px; }
  .nt-title { font-size: var(--text-md); }
}
/* 窄屏适配：480px 以下 */
@media screen and (max-width: 480px) {
  .notice-roll { height: 38px; }
  .nt-line { min-height: 38px; }
  .nt-title { font-size: var(--text-sm); }
}

/* ---- 来自 countdown.html ---- */
/* ---- 倒计时轮播组件（卡片外观与间距统一由 style.css 的 .countdown-widget / .sidebar gap 提供） ---- */
.countdown-roll {
  position: relative;
  height: 64px;
  overflow: hidden;
}
.countdown-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: transform 0.5s ease, opacity 0.5s ease, visibility 0.5s;
}
.countdown-item.cd-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.countdown-item.cd-leave {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
}
/* 无 JS 时兜底：仅显示第一条 */
.countdown-roll .countdown-item:first-child {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.countdown-roll.cd-ready .countdown-item:first-child {
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
}
.countdown-roll.cd-ready .countdown-item:first-child.cd-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.cd-line {
  margin: 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
/* 常规文字：使用网站默认基础字体颜色与大小 */
.cd-txt {
  color: var(--color-text, #1e293b);
  font-size: var(--text-base);
}
/* 事件名称：加粗 + 高亮彩色 */
.cd-name {
  font-weight: bold;
  color: var(--color-accent, #6366f1);
  font-size: var(--text-base);
  margin: 0 3px;
}
/* 剩余天数：醒目字号、主题色渐变，与侧栏标题点缀色呼应 */
.cd-days {
  font-weight: 800;
  font-size: var(--text-3xl);
  background: linear-gradient(90deg, var(--color-primary, #0d9488), var(--color-accent, #6366f1));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--color-primary, #0d9488);
  margin: 0 5px;
  line-height: 1;
}
/* 移动端适配：768px 以下 */
@media screen and (max-width: 768px) {
  .countdown-roll { height: 56px; }
  .cd-txt { font-size: var(--text-md); }
  .cd-name { font-size: var(--text-base); }
  .cd-days { font-size: var(--text-3xl); }
}
/* 窄屏适配：480px 以下 */
@media screen and (max-width: 480px) {
  .countdown-roll { height: 50px; }
  .cd-txt { font-size: var(--text-sm); }
  .cd-name { font-size: var(--text-md); }
  .cd-days { font-size: var(--text-2xl); }
}

/* ---- 来自 vote.html ---- */
/* ---- 投票预览轮播组件（卡片外观与间距统一由 style.css 的 .vote-widget / .sidebar gap 提供） ---- */
.vote-roll {
  position: relative;
  height: 168px;
  overflow: hidden;
}
.vote-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: transform 0.5s ease, opacity 0.5s ease, visibility 0.5s;
}
.vote-item.vt-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.vote-item.vt-leave {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
}
/* 无 JS 时兜底：仅显示第一条 */
.vote-roll .vote-item:first-child {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.vote-roll.vt-ready .vote-item:first-child {
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
}
.vote-roll.vt-ready .vote-item:first-child.vt-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.vt-card {
  display: block;
  height: 100%;
  text-decoration: none;
  padding: 2px;
  box-sizing: border-box;
}
.vt-title {
  margin: 0 0 6px;
  font-size: var(--text-base);
  font-weight: bold;
  color: var(--color-text, #1e293b);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vt-card:hover .vt-title {
  color: var(--color-accent, #6366f1);
}
.vt-intro {
  margin: 0 0 8px;
  font-size: var(--text-sm);
  color: var(--color-text-light, #64748b);
  line-height: 1.5;
  max-height: 40px;
  overflow: hidden;
}
.vt-bars { margin-bottom: 8px; }
.vt-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}
.vt-bar-name {
  flex: none;
  width: 34%;
  font-size: var(--text-xs);
  color: var(--color-text, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 6px;
}
.vt-bar-track {
  flex: 1;
  height: 8px;
  background: var(--color-bg, #f1f5f9);
  border-radius: 4px;
  overflow: hidden;
}
.vt-bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--color-accent, #6366f1), #8b5cf6);
}
.vt-bar-pct {
  flex: none;
  width: 38px;
  font-size: var(--text-xs);
  color: var(--color-text-light, #64748b);
  text-align: right;
}
.vt-go {
  display: inline-block;
  font-size: var(--text-sm);
  color: var(--color-accent, #6366f1);
  font-weight: bold;
}
/* 移动端适配：768px 以下 */
@media screen and (max-width: 768px) {
  .vote-roll { height: 160px; }
  .vt-title { font-size: var(--text-md); }
  .vt-intro { font-size: var(--text-xs); }
}
/* 窄屏适配：480px 以下 */
@media screen and (max-width: 480px) {
  .vote-roll { height: 156px; }
}
