/* Swiss / International Typographic Style — paper, hairlines, strict grid, type-led. */
:root {
  --paper: #f4f2ec;
  --paper-2: #efece4;
  --ink: #17150f;
  --ink-2: #5c574d;
  --ink-3: #908a7d;
  --rule: #d8d3c6;
  --rule-2: #c7c1b2;
  --accent: #c8401f; /* used sparingly */
  --ok: #2f7d4f;
  --warn: #9a7a16;
  --partial: #b85e1c;
  --down: #c0341d;
  --maxw: 1040px;
  --sans: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 32px 18px;
  border-bottom: 1px solid var(--ink);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.logo {
  width: 12px;
  height: 12px;
  background: var(--accent);
  display: inline-block;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.ghost-btn {
  background: none;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
}
.ghost-btn:hover {
  color: var(--ink);
}
/* 刷新按钮做成居中正方形，让 ⟳ 字形几何中心 = 盒子中心，旋转才不抖 */
#refreshBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
}
#refreshBtn svg {
  display: block;
  width: 1em;
  height: 1em;
}
/* GitHub 链接:图标按钮,与 RSS 同高对齐 */
a.ghost-btn[title='GitHub'] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
}
a.ghost-btn[title='GitHub'] svg {
  display: block;
  width: 1.05em;
  height: 1.05em;
}
.ghost-btn.spin {
  animation: spin 0.7s linear infinite;
  transform-origin: 50% 50%;
}
/* 通知铃铛:与刷新按钮同样的正方形对齐 */
#notifyBtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
}
#notifyBtn svg {
  display: block;
  width: 1em;
  height: 1em;
  /* 以铃铛顶部悬挂点为支点摆动 */
  transform-origin: 50% 12%;
}
/* 开启瞬间:用力摇铃 */
#notifyBtn.ring svg {
  animation: bell-ring 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
/* 关闭瞬间:无力地晃两下并变暗,然后沉静下来 */
#notifyBtn.muted svg {
  animation: bell-mute 0.55s ease-in-out;
}
/* 开启瞬间:向外扩散一圈光环 */
#notifyBtn.ring::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  animation: bell-pulse 0.7s ease-out;
  pointer-events: none;
}
/* 已开启:铃铛填充为强调色 */
#notifyBtn.on {
  color: var(--accent);
}
#notifyBtn.on svg {
  fill: var(--accent);
  stroke: var(--accent);
}
@keyframes bell-ring {
  0% {
    transform: rotate(0);
  }
  15% {
    transform: rotate(15deg);
  }
  30% {
    transform: rotate(-13deg);
  }
  45% {
    transform: rotate(10deg);
  }
  60% {
    transform: rotate(-7deg);
  }
  75% {
    transform: rotate(4deg);
  }
  100% {
    transform: rotate(0);
  }
}
@keyframes bell-pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}
/* 关闭:幅度递减的左右摆动,中途变暗,最后停住 */
@keyframes bell-mute {
  0% {
    transform: rotate(0);
    opacity: 1;
  }
  20% {
    transform: rotate(-7deg);
  }
  40% {
    transform: rotate(5deg);
    opacity: 0.45;
  }
  65% {
    transform: rotate(-3deg);
  }
  85% {
    transform: rotate(1.5deg);
    opacity: 0.75;
  }
  100% {
    transform: rotate(0);
    opacity: 1;
  }
}
/* 尊重"减少动态效果"系统设置 */
@media (prefers-reduced-motion: reduce) {
  #notifyBtn.ring svg,
  #notifyBtn.ring::after,
  #notifyBtn.muted svg,
  .notify-hint,
  .notify-hint.leaving {
    animation: none;
  }
}
/* 通知提示:右上角浮动 toast([hidden] 时不显示:类选择器的 display 会盖过 UA 的 [hidden]) */
.notify-hint[hidden] {
  display: none;
}
.notify-hint {
  position: fixed;
  top: 60px;
  right: 32px;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: min(320px, calc(100vw - 32px));
  margin: 0;
  padding: 11px 12px 11px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0 6px 22px rgba(23, 21, 15, 0.14);
  animation: toast-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
/* 离场:淡出上移 */
.notify-hint.leaving {
  animation: toast-out 0.2s ease-in forwards;
}
.notify-hint span {
  flex: 1 1 auto;
}
.notify-hint button {
  flex: none;
  margin-top: -1px;
  background: none;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
}
.notify-hint button:hover {
  color: var(--ink);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}
/* 窄屏:贴右上,但留出边距,避免压住标题 */
@media (max-width: 560px) {
  .notify-hint {
    top: 54px;
    right: 12px;
    max-width: calc(100vw - 24px);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.lang-toggle {
  display: flex;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
}
.lang-toggle button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.lang-toggle button.active {
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Banner (type-led, no colored block) ---------- */
.banner {
  padding: 46px 0 40px;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 16px;
}
.banner-dot {
  display: none; /* status conveyed by the headline + a square marker below */
}
.banner-text {
  min-width: 0;
}
.banner-title {
  font-size: clamp(34px, 6vw, 60px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.02;
  display: flex;
  align-items: center;
  gap: 18px;
}
.banner-title::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: none;
  background: var(--ink-3);
}
.banner.ok .banner-title::before {
  background: var(--ok);
}
.banner.warn .banner-title {
  color: var(--warn);
}
.banner.warn .banner-title::before {
  background: var(--warn);
}
.banner.down .banner-title {
  color: var(--down);
}
.banner.down .banner-title::before {
  background: var(--down);
}
.banner.loading .banner-title {
  color: var(--ink-3);
}
.banner-sub {
  margin-top: 14px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}
.banner-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.banner-link:hover {
  color: var(--accent);
}

/* ---------- Section (card -> open block) ---------- */
.card {
  padding: 30px 0 0;
}
.card + .card {
  border-top: 1px solid var(--rule);
  padding-top: 30px;
}
.card h2,
.card-head h2 {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.card-head h2 {
  margin: 0;
}

/* ---------- Components (spec-sheet grid) ---------- */
.components {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 48px;
  border-top: 1px solid var(--rule);
}
/* collapsed summary reuses .comp so font/spacing match a real row */
.comp-summary {
  border-top: 1px solid var(--rule);
  cursor: pointer;
  list-style: none;
}
.comp-summary::-webkit-details-marker {
  display: none;
}
/* CJK 摘要文案在 400 下偏细,加重到 medium 以匹配拉丁组件名的视觉份量 */
.comp-summary .cname {
  font-weight: 500;
}
/* one row when collapsed: drop its bottom rule, the card's own rule closes it */
.comp-details:not([open]) > .comp-summary {
  border-bottom: none;
}
/* when open the summary supplies the top rule, so the list must not double it */
.comp-details[open] > .components {
  border-top: none;
}
.comp-summary .ctgl {
  flex: none;
  margin-left: 14px;
  width: 1ch;
  text-align: center;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-3);
}
.comp-summary .ctgl::after {
  content: '+';
}
.comp-details[open] > .comp-summary .ctgl::after {
  content: '\2212';
}
.comp {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.comp .cdot {
  width: 9px;
  height: 9px;
  flex: none;
  background: var(--ink-3);
}
.comp .cname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comp .cstat {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.cdot.operational {
  background: var(--ok);
}
.cdot.degraded_performance,
.cdot.under_maintenance {
  background: var(--warn);
}
.cdot.partial_outage {
  background: var(--partial);
}
.cdot.major_outage {
  background: var(--down);
}

/* ---------- Filters ---------- */
.filters {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
}
.filters button {
  background: none;
  border: none;
  padding: 0 0 3px;
  cursor: pointer;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
}
.filters button:hover {
  color: var(--ink);
}
.filters button.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- Feed (grouped by month, hairline between groups) ---------- */
.feed {
  border-top: 1px solid var(--rule);
}
.date-header {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 20px 0 6px;
  border-top: 1px solid var(--rule);
}
.date-group {
  padding-bottom: 7px;
}
.date-group + .date-header {
  margin-top: 0;
}
.event {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.event:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
/* 若只有一组，顶上的 date-header 不用画线（feed 本身已有一条） */
.date-header:first-child {
  border-top: none;
  padding-top: 12px;
}
.event-body {
  min-width: 0;
}
.event-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.badge {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
}
.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--ink-3);
}
.badge.reset::before {
  background: var(--partial);
}
.badge.new_model::before {
  background: var(--ok);
}
.badge.new_feature::before {
  background: var(--accent);
}
.badge.news::before {
  background: var(--ink-3);
}
.badge.sample {
  color: var(--ink-3);
}
.badge.sample::before {
  display: none;
}
/* NEW:实心强调色小标签,比普通 badge 更跳，引导注意到最近活跃的卡 */
.badge.new {
  color: var(--paper);
  background: var(--accent);
  padding: 1px 6px;
  letter-spacing: 0.1em;
}
.badge.new::before {
  display: none;
}
.event-acct {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}
.event-date {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}
.event-upd {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--accent);
}
.event-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin-bottom: 6px;
}
/* 单 source 时标题即外链 */
a.event-title {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.event-title:hover {
  color: var(--accent);
}
.title-arrow {
  font-family: var(--mono);
  font-size: 0.6em;
  color: var(--ink-3);
  vertical-align: 0.22em;
  margin-left: 5px;
}
a.event-title:hover .title-arrow {
  color: var(--accent);
}
.event-summary {
  color: var(--ink-2);
  font-size: 14px;
  max-width: 62ch;
}
.event-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 14px;
}
.chip {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  padding: 1px 0;
  color: var(--ink-3);
  white-space: nowrap;
}
.chip:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 10px;
  margin-left: 10px;
  vertical-align: -1px;
  background: var(--rule-2);
}
.chip b {
  color: var(--ink);
  font-weight: 500;
}
.event-foot {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.event-foot a {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  text-decoration: none;
}
.event-foot a:hover {
  color: var(--accent);
}
/* 多 source 合并:「来源 [1] [2]」一组,标签与角标紧凑排列 */
.src-group {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.src-label {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ---------- Loading skeletons (首屏占位,数据到达后被 render 整块覆盖) ---------- */
.skel {
  display: block;
  background: linear-gradient(90deg, var(--rule) 25%, var(--paper-2) 50%, var(--rule) 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.5s ease-in-out infinite;
  border-radius: 2px;
}
@keyframes skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel-line { height: 11px; width: 100%; }
.skel-line.lg { height: 16px; width: 68%; }
.skel-line.short { width: 45%; }
.skel-line.head { height: 14px; width: 150px; margin: 13px 0; }
.skel-dot { width: 9px; height: 9px; flex: none; border-radius: 0; }
.skel-chip { height: 11px; width: 64px; }
.skel-chip.sm { width: 40px; margin-top: 8px; }
/* components 占位:对齐真实 .components 2 列网格 + .comp 行 */
.skel-comp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 48px;
  border-top: 1px solid var(--rule);
}
.skel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
}
.skel-row .skel-line { width: 55%; }
/* feed 占位:对齐真实 .event 的 180px / 1fr 双列 */
.skel-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.skel-card-main .skel-line { margin-top: 8px; }
.skel-card-main .skel-line.lg { margin-top: 0; }
@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; }
}

/* ---------- Incidents ---------- */
#incidents {
  border-top: 1px solid var(--rule);
}
.incident {
  padding: 16px 0 16px 16px;
  border-bottom: 1px solid var(--rule);
  border-left: 2px solid var(--down);
}
.incident .iname {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.incident .imeta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 5px 0 8px;
}
.incident .ibody {
  font-size: 13.5px;
  color: var(--ink-2);
  max-width: 70ch;
}

.empty {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 13px;
  padding: 16px 0;
}

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 32px 50px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.footer .dot {
  opacity: 0.5;
}
/* 免责声明:独占一行,更淡,与商标风险的合理使用声明相符 */
.footer .disclaimer {
  flex-basis: 100%;
  opacity: 0.7;
}

@media (max-width: 680px) {
  .topbar,
  main,
  .footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  .components {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
  .event {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .event-head {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }
  .banner {
    grid-template-columns: 1fr;
    align-items: start;
  }
}
