/* 星海纪事 · 首页公告与纪事卷（Neon 视觉精修 + 亮暗双主题 + 微动效） */
@keyframes hc-star-pulse {
  0%, 100% { box-shadow: 0 0 10px 1px var(--gold-glow); opacity: .92; }
  50% { box-shadow: 0 0 18px 4px var(--gold-glow), 0 0 28px rgba(124,226,246,.22); opacity: 1; }
}
@keyframes hc-sheet-in {
  from { opacity: 0; transform: translate3d(18px, -6px, 0) scale(.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes hc-note-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hc-rail-sweep {
  0% { background-position: -60% 0; }
  100% { background-position: 160% 0; }
}

.home-chronicle {
  position: relative;
  margin-top: 26px;
  padding: 6px 0 6px 26px;
  background: linear-gradient(90deg, rgba(235,197,120,.07), rgba(124,226,246,.025) 52%, transparent 84%);
  transition: background .35s var(--ease);
}
.home-chronicle::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 4px; width: 1px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 48%, rgba(235,197,120,.05));
}
.home-chronicle::after {
  content: "";
  position: absolute;
  left: -3.5px; top: 5px; width: 8px; height: 8px;
  background: var(--gold-2);
  transform: rotate(45deg);
  box-shadow: 0 0 12px 2px var(--gold-glow);
  animation: hc-star-pulse 3.6s ease-in-out infinite;
}
.hc-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 10px;
}
.hc-head [data-chronicle-open] {
  transition: color .22s var(--ease), transform .22s var(--ease);
}
.hc-head [data-chronicle-open]:hover {
  color: var(--gold-2);
  transform: translateX(3px);
}
.hc-kicker {
  display: inline-flex; align-items: baseline; gap: 10px;
  color: var(--gold); font: 500 12.5px/1.3 var(--serif); letter-spacing: .12em;
}
.hc-ver-tag {
  color: var(--cyan); font: 500 12px/1 var(--serif); letter-spacing: .05em; font-style: normal;
}
.hc-list { display: grid; gap: 6px; }
.hc-row {
  display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: baseline; gap: 10px;
  padding: 3px 6px 3px 2px;
  font: 400 13.5px/1.55 var(--serif); color: var(--text-2);
  transition: transform .22s var(--ease), background .22s var(--ease), color .22s var(--ease);
}
.hc-row:hover {
  transform: translateX(4px);
  color: var(--text);
  background: linear-gradient(90deg, rgba(235,197,120,.07), transparent 85%);
}
.hc-row b {
  font: 600 12.5px/1 var(--serif); color: var(--gold-2); letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.hc-row:not(:first-child) b { color: var(--gold); opacity: .85; }

.hc-sheet {
  position: fixed; right: 36px; top: 74px; width: 530px; z-index: 48;
  overflow-x: hidden;
  max-height: min(86dvh, 780px);
  overflow: auto;
  scrollbar-width: thin;
  padding: 28px 32px 30px;
  color: var(--text);
  background:
    radial-gradient(ellipse at 82% 0%, rgba(124,226,246,.11), transparent 58%),
    radial-gradient(ellipse at 12% 0%, rgba(235,197,120,.13), transparent 54%),
    linear-gradient(180deg, rgba(8,14,32,.95), rgba(4,9,22,.98));
  backdrop-filter: blur(24px) saturate(1.15);
  box-shadow:
    inset 0 1px 0 rgba(235,197,120,.32),
    inset 2px 0 0 rgba(235,197,120,.22),
    0 32px 90px rgba(1,5,16,.8);
  animation: hc-sheet-in .32s var(--ease) both;
}
.hc-sheet::before {
  content: ""; position: sticky; display: block;
  margin: -28px -32px 26px; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent 10%, var(--gold-2) 45%, var(--cyan) 62%, transparent 92%);
  background-size: 220% 100%;
  opacity: .72;
  animation: hc-rail-sweep 7s ease-in-out infinite;
}
.hc-sheet-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 8px;
}
.hc-sheet-title {
  font: 700 24px/1.25 var(--serif); letter-spacing: .08em;
  background: var(--title-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hc-sheet-sub { color: var(--text-3); font: 400 12px var(--serif); letter-spacing: .06em; margin-right: auto; }
.hc-sheet .tabs {
  display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line); margin-bottom: 18px; gap: 4px;
}
.hc-sheet .tabs::-webkit-scrollbar { display: none; }
.hc-sheet .tab {
  position: relative;
  flex: 0 0 auto; padding: 8px 7px; font-size: 12.5px; white-space: nowrap;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.hc-sheet .tab::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 1.5px;
  background: linear-gradient(90deg, var(--gold-2), var(--cyan));
  transform: scaleX(0); transform-origin: center;
  transition: transform .26s var(--ease);
}
.hc-sheet .tab[aria-selected="true"]::after {
  transform: scaleX(1);
}
.hc-notes { display: grid; gap: 15px; }
.hc-note {
  position: relative; padding: 3px 0 13px 16px;
  background: linear-gradient(90deg, var(--line-soft), transparent 88%) left bottom/100% 1px no-repeat;
  animation: hc-note-in .28s var(--ease) both;
}
.hc-note:nth-child(2) { animation-delay: .04s; }
.hc-note:nth-child(3) { animation-delay: .08s; }
.hc-note:nth-child(4) { animation-delay: .12s; }
.hc-note:last-child { background: none; padding-bottom: 2px; }
.hc-note::before {
  content: ""; position: absolute; left: 0; top: 9px; width: 5px; height: 5px;
  background: var(--gold-2); transform: rotate(45deg);
  box-shadow: 0 0 8px var(--gold);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.hc-note:hover::before {
  transform: rotate(135deg) scale(1.25);
  box-shadow: 0 0 14px var(--gold-2);
}
.hc-note h4 {
  margin: 0 0 4px; font: 600 14.5px/1.35 var(--serif); color: var(--gold-2); letter-spacing: .04em;
}
.hc-note p { margin: 0; font: 400 13px/1.72 var(--serif); color: var(--text-2); }

/* 亮色主题（starlight）完整适配 */
html[data-theme="starlight"] .home-chronicle {
  background: linear-gradient(90deg, rgba(248,251,255,.78), rgba(240,246,255,.48) 64%, transparent 92%);
}
html[data-theme="starlight"] .hc-kicker,
html[data-theme="starlight"] .hc-row b,
html[data-theme="starlight"] .hc-row:not(:first-child) b {
  color: #845506;
  opacity: 1;
}
html[data-theme="starlight"] .hc-row:hover {
  background: linear-gradient(90deg, rgba(159,110,13,.1), transparent 85%);
}
html[data-theme="starlight"] .hc-sheet {
  background:
    radial-gradient(ellipse at 82% 0%, rgba(18,117,154,.1), transparent 58%),
    radial-gradient(ellipse at 12% 0%, rgba(159,110,13,.11), transparent 54%),
    linear-gradient(180deg, rgba(248,251,255,.96), rgba(235,242,253,.98));
  box-shadow:
    inset 0 1px 0 rgba(159,110,13,.38),
    inset 2px 0 0 rgba(159,110,13,.28),
    0 24px 72px rgba(24,42,88,.22);
}

@media (max-width: 760px) {
  .hc-sheet {
    left: 14px; right: 14px; width: auto;
    top: calc(var(--top) + 10px);
    max-height: calc(100dvh - var(--top) - 24px);
    padding: 20px 18px 22px;
  }
  .hc-sheet::before { margin: -20px -18px 18px; }
  .hc-sheet-head { flex-wrap: wrap; gap: 6px 10px; }
  .hc-sheet-title { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-chronicle::after, .hc-sheet, .hc-sheet::before, .hc-note { animation: none !important; }
  .hc-row, .hc-note::before, .hc-head [data-chronicle-open], .hc-sheet .tab::after { transition: none !important; }
}
html[data-motion="reduce"] .home-chronicle::after,
html[data-motion="reduce"] .hc-sheet::before { animation: none !important; }
