/* ==========================================================
   新挑战 · 游戏内容计时器
   布局参考：游戏内公告页（顶部 logo + 大标题 + 分类工具栏 + 三列横版卡片）
   ========================================================== */

:root {
  --page: #f4f4f6;
  --paper: #ffffff;

  --ink: #141414;
  --ink-2: #333333;
  --muted: #777777;
  --dim: #999999;

  --red: #cf0a2c;
  --red-hi: #e01a3c;
  --navy: #2a2450;
  --navy-hi: #3a3168;
  --blue: #3d6fd6;

  --line: #d0d0d0;
  --line-soft: #e6e6e6;
  --card-line: #1a1a1a;

  --radius: 3px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

button { font-family: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

::selection { background: rgba(207, 10, 44, .16); color: var(--ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb {
  background: #cfcfcf;
  border: 2px solid #f0f0f0;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #b5b5b5; }

/* ---------------- 背景 ---------------- */
.bg-art {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--page) url("/boss/images/bg.jpg") center top / cover no-repeat;
}

.bg-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 520px at 50% 0%, rgba(255, 255, 255, .3), transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, .22) 0%, rgba(252, 252, 253, .36) 42%, rgba(248, 248, 250, .5) 100%);
}

.bg-glow,
.bg-grid { display: none; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------------- 顶部 ---------------- */
.site-bar {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.site-logo {
  display: block;
  line-height: 0;
  text-decoration: none;
}

/* 白色书法 logo 在浅色背景上反相为墨色 */
.site-logo img {
  display: block;
  width: 124px;
  height: auto;
  filter: invert(1) sepia(.3) saturate(1.5) brightness(.72);
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
}

.site-enter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 14px;
  background: var(--navy);
  color: #fff;
  font-size: 16px;
  letter-spacing: .04em;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background .16s;
}

.site-enter svg { width: 15px; height: 15px; }
.site-enter:hover { background: var(--navy-hi); }

.lang-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  text-decoration: none;
  transition: color .16s, border-color .16s;
}

.lang-btn:hover { color: var(--red); border-color: var(--red); }

/* ---------------- 主体 ---------------- */
.stage {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 46px;
}

.stage-title {
  margin: 18px 0 52px;
  text-align: center;
  font-size: 54px;
  font-weight: 900;
  letter-spacing: .10em;
  line-height: 1.25;
  color: var(--ink);
}

/* 工具栏：分类 + 搜索 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cat-tabs {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 1px;
}

.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  flex: none;
  padding: 0 12px;
  border: 1px solid #d5d5d5;
  border-radius: 2px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}

.cat-tab svg { width: 14px; height: 14px; color: #8a8a8a; }
.cat-tab:hover { color: var(--red); border-color: var(--red); }
.cat-tab:hover svg { color: var(--red); }

.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f0f0f0;
  color: #666;
  font-size: 11px;
  line-height: 1;
}

.cat-tab.is-active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.cat-tab.is-active svg { color: #fff; }

.cat-tab.is-active .tab-count {
  background: #fff;
  color: var(--red);
  font-weight: 700;
}

/* 搜索 */
.search {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 240px;
  height: 34px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid #d5d5d5;
  border-radius: var(--radius);
  color: var(--dim);
  transition: border-color .16s;
}

.search svg { width: 15px; height: 15px; }
.search:focus-within { border-color: var(--navy); }

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}

.search input::placeholder { color: #a5a5a5; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* 通知按钮 */
.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #d5d5d5;
  border-radius: var(--radius);
  background: #fff;
  color: #666;
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}

.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--red); border-color: var(--red); }

.icon-btn.is-on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* ---------------- 卡片网格 ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 22px;
}

.ev-card {
  display: flex;
  gap: 12px;
  min-height: 142px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--card-line);
  border-radius: 6px;
  transition: box-shadow .16s, transform .16s;
}

.ev-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .45);
}

/* 左侧缩略图 */
.ev-thumb {
  position: relative;
  flex: none;
  align-self: stretch;     /* 正方形且撑满卡片内容高度，上/下/左间距一致 */
  width: auto;
  height: auto;
  aspect-ratio: 1 / 1;
  min-width: 96px;
  overflow: hidden;
  border-radius: 3px;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, .035) 0 1px, transparent 1px 8px),
    #ededed;
  color: #b0b0b0;
}

.ev-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ev-thumb svg { width: 22px; height: 22px; stroke-width: 1.2; }
.ev-thumb:has(img) svg { display: none; }

.ev-tag {
  position: absolute;
  top: 0;
  left: 0;
  padding: 2px 6px;
  background: rgba(255, 255, 255, .95);
  color: #2a2a2a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .02em;
  border-bottom-right-radius: 3px;
}

/* 右侧内容 */
.ev-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ev-name {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.01em;
}

.ev-meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 3px;
  margin-top: 5px;
}

.ev-place-tag {
  flex: none;
  padding: 1px 3px;
  background: #f0f0f0;
  color: #666;
  font-size: 9.5px;
  line-height: 1.6;
  border-radius: 2px;
  white-space: nowrap;
}

.ev-place {
  flex: 0 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ev-place:hover { color: var(--navy); text-decoration: underline; }

.ev-req {
  flex: none;
  padding: 1px 5px;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  line-height: 1.6;
  border-radius: 2px;
  white-space: nowrap;
}

.ev-daily {
  flex: none;
  padding: 1px 4px;
  background: #3d6fd6;
  color: #ffffff;
  font-size: 10px;
  line-height: 1.6;
  border-radius: 2px;
  white-space: nowrap;
}

/* 倒计时 */
.ev-cd {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  row-gap: 3px;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.ev-cd b {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: .01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 跨天倒计时（如 4 天 07:47:36）字号收一档，避免撑爆卡片 */
.ev-cd.is-multi b { font-size: 21px; }

.ev-cd span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* 进度条 */
.ev-bar {
  height: 3px;
  margin-top: 6px;
  background: #ededed;
  overflow: hidden;
}

.ev-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width .45s linear;
}

/* 底部时间 */
.ev-foot {
  display: flex;
  align-items: center;
  /* justify-content: flex-end; */
  flex-wrap: wrap;
  column-gap: 10px;
  row-gap: 2px;
  margin-top: 6px;
  font-size: 10.5px;
  color: #8a8a8a;
  font-variant-numeric: tabular-nums;
}

.ev-foot span { white-space: nowrap; }

.ev-foot .foot-link {
  margin-left: auto;
  color: var(--blue);
  text-decoration: none;
}

.ev-foot .foot-link:hover { text-decoration: underline; }

/* 状态 */
.ev-card.is-soon .ev-cd b { color: var(--red); }
.ev-card.is-soon .ev-bar i { background: var(--red); }

.ev-card.is-critical .ev-cd b {
  color: var(--red);
  font-weight: 900;
  -webkit-text-stroke: .2px currentColor;
}

.ev-card.is-critical .ev-bar i { background: var(--red); }

.ev-card.is-fresh .ev-cd b { color: var(--ink); }
.ev-card.is-fresh .ev-bar i { background: var(--blue); }

/* ---------------- 空态 ---------------- */
.empty {
  padding: 70px 20px 60px;
  text-align: center;
  color: var(--muted);
}

.empty svg {
  width: 42px;
  height: 42px;
  stroke-width: 1.2;
  opacity: .55;
  margin: 0 auto 12px;
}

.empty p { font-size: 15px; color: var(--ink-2); margin-bottom: 4px; }
.empty span { font-size: 12px; }

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  padding: 10px 20px;
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  box-shadow: 0 16px 30px -20px rgba(0, 0, 0, .5);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: min(560px, calc(100vw - 40px));
  text-align: center;
}

.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================
   响应式
   ========================================================== */
@media (max-width: 1000px) {
  .stage-title { font-size: 34px; margin: 16px 0 22px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .search { width: 200px; }
  .site-logo img { width: 132px; }
  .ev-thumb { min-width: 100px; }
  .ev-name { font-size: 13.5px; }

  /* 中等宽度下工具栏折成两行，避免分类标签被裁切 */
  .toolbar { flex-wrap: wrap; }
  .cat-tabs { flex: 1 0 100%; }
  .search { order: 2; flex: 1; width: auto; min-width: 0; }
  .icon-btn { order: 3; }
}

@media (max-width: 700px) {
  .site-bar { padding: 16px 14px 0; }
  .stage { padding: 0 14px 36px; }
  .stage-title { font-size: 26px; letter-spacing: .06em; margin: 12px 0 18px; }
  .site-logo img { width: 112px; }
  .site-enter { height: 32px; padding: 0 10px; font-size: 12px; }
  .lang-btn { width: 32px; height: 32px; }

  .toolbar { flex-wrap: wrap; padding: 8px; gap: 8px; }
  .cat-tabs { flex: 1 0 100%; order: 1; }
  .search { order: 2; flex: 1; width: auto; min-width: 0; }
  .icon-btn { order: 3; }

  .grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
    gap: 14px;
    margin-top: 16px;
  }
  .ev-card { min-height: 0; }
  .ev-thumb { min-width: 88px; }
  .ev-name { font-size: 14px; }
  .ev-cd b { font-size: 24px; }

}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
