:root {
  color-scheme: dark;

  --bg: #0d1420;
  --bg-gradient:
    radial-gradient(ellipse 800px 700px at 100% 100%, rgba(0, 41, 102, 0.85) 0%, transparent 70%),
    radial-gradient(ellipse 800px 700px at 0% 0%, rgba(0, 41, 102, 0.85) 0%, transparent 70%),
    radial-gradient(ellipse 560px 340px at 50% 0%, rgba(71, 169, 202, 0.10) 0%, transparent 70%);
  --text: #b4bfcd;
  --text-strong: #eef3f9;
  --text-muted: #8491a3;
  --accent: #47a9ca;
  --accent-hover: #8ad8f0;
  --accent-soft: rgba(71, 169, 202, 0.14);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(71, 169, 202, 0.50);
  --shadow: 0 16px 40px rgba(0, 8, 24, 0.45);
  --selection: rgba(71, 169, 202, 0.35);
  --panel-bg:
    radial-gradient(ellipse 520px 300px at 50% 0%, rgba(71, 169, 202, 0.14) 0%, transparent 65%),
    linear-gradient(160deg, rgba(0, 41, 102, 0.60) 0%, rgba(15, 22, 34, 0.96) 55%, rgba(10, 14, 22, 0.98) 100%);
  --cta-bg: linear-gradient(135deg, #47a9ca, #2f6be0);
  --cta-shadow: 0 10px 28px rgba(47, 107, 224, 0.35);

  --k-post: linear-gradient(135deg, #1d4f91, #47a9ca);
  --k-update: linear-gradient(135deg, #4c2a96, #8b5cf6);
  --k-info: linear-gradient(135deg, #0f6b66, #5eead4);
  --unread: #ff5d5d;

  --font-display: "Cinzel", Georgia, "Times New Roman", serif;
  --font-body: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --radius: 14px;
  --radius-pill: 999px;

  --ctl-size: clamp(42px, 8vw, 48px);
  --ctl-top: max(20px, env(safe-area-inset-top));
  --ctl-edge: max(20px, env(safe-area-inset-right));

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f7fb;
  --bg-gradient:
    radial-gradient(ellipse 800px 700px at 100% 100%, #dce8ff 0%, transparent 70%),
    radial-gradient(ellipse 800px 700px at 0% 0%, #dce8ff 0%, transparent 70%),
    radial-gradient(ellipse 560px 340px at 50% 0%, rgba(14, 116, 144, 0.07) 0%, transparent 70%);
  --text: #3a4556;
  --text-strong: #0f1e33;
  --text-muted: #5d6a7e;
  --accent: #0e7490;
  --accent-hover: #0a5670;
  --accent-soft: rgba(14, 116, 144, 0.10);
  --surface: rgba(255, 255, 255, 0.70);
  --surface-hover: rgba(255, 255, 255, 0.96);
  --border: rgba(15, 30, 51, 0.12);
  --border-strong: rgba(14, 116, 144, 0.45);
  --shadow: 0 16px 36px rgba(0, 30, 80, 0.12);
  --selection: rgba(14, 116, 144, 0.25);
  --panel-bg:
    radial-gradient(ellipse 520px 300px at 50% 0%, rgba(14, 116, 144, 0.10) 0%, transparent 65%),
    linear-gradient(160deg, rgba(0, 41, 102, 0.05) 0%, rgba(255, 255, 255, 0.97) 55%, rgba(248, 249, 250, 0.98) 100%);
  --cta-bg: linear-gradient(135deg, #0e7490, #1d4ed8);

  --k-post: linear-gradient(135deg, #2563eb, #22a6c9);
  --k-update: linear-gradient(135deg, #7c3aed, #c084fc);
  --k-info: linear-gradient(135deg, #0d9488, #5eead4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  background-repeat: no-repeat;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection);
  color: var(--text-strong);
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.25;
  color: var(--text-strong);
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease, transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

button {
  font: inherit;
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.theme-toggle {
  position: fixed;
  top: var(--ctl-top);
  right: var(--ctl-edge);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--ctl-size);
  height: var(--ctl-size);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-strong);
  box-shadow: var(--shadow);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.25s ease, border-color 0.3s ease, background-color 0.3s ease;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .theme-toggle {
    background: var(--bg);
  }

  .board {
    background: var(--bg);
  }
}

@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
  }
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

.theme-toggle__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.notice-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  min-height: 100dvh;
  padding: calc(var(--ctl-top) + var(--ctl-size) + 1rem) 1rem 2rem;
}

.icon {
  display: inline-flex;
  flex: none;
}

.icon svg {
  width: 100%;
  height: 100%;
}

[data-kind="post"] { --kind: var(--k-post); }
[data-kind="update"] { --kind: var(--k-update); }
[data-kind="info"] { --kind: var(--k-info); }

.board {
  display: grid;
  grid-template-columns: 11.5rem 18rem minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "head head head"
    "tabs list detail";
  width: 100%;
  max-width: 62rem;
  height: min(78dvh, 680px);
  border: 1px solid var(--border-strong);
  border-top-width: 2px;
  border-radius: var(--radius);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: boardEnter 600ms var(--ease-out) backwards;
}

@keyframes boardEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.board__head {
  grid-area: head;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.board__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.board__sub {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.board__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-strong);
}

.board__close:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: var(--accent-hover);
}

.board__close svg {
  width: 16px;
  height: 16px;
}

.board__tabs,
.board__list,
.board__detail {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.board__tabs {
  grid-area: tabs;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--border);
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.7rem 0.9rem 0.7rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.tab::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.65rem;
  width: 7px;
  height: 7px;
  background: var(--accent);
  transform: translateY(-50%) rotate(45deg) scale(0);
  transition: transform 0.3s var(--ease-out);
}

.tab:hover {
  background: var(--surface);
  color: var(--text-strong);
}

.tab[aria-current="true"] {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  color: var(--text-strong);
}

.tab[aria-current="true"]::before {
  transform: translateY(-50%) rotate(45deg) scale(1);
}

.tab .icon {
  width: 18px;
  height: 18px;
}

.tab__label {
  flex: 1;
}

.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--unread);
  box-shadow: 0 0 8px var(--unread);
}

.dot[hidden] {
  display: none;
}

.board__list {
  grid-area: list;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border-right: 1px solid var(--border);
}

.entry {
  position: relative;
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.entry:hover {
  background: var(--surface-hover);
}

.entry[aria-current="true"] {
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.entry__thumb {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 8px;
  background: var(--kind);
  color: #ffffff;
}

.entry__thumb .icon {
  width: 22px;
  height: 22px;
}

.entry__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-right: 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-strong);
}

.entry__date {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.entry .dot {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
}

.empty {
  margin: auto;
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.board__detail {
  grid-area: detail;
  padding: 1.25rem 1.5rem 1.5rem;
}

.detail {
  animation: detailIn 350ms var(--ease-out) backwards;
}

@keyframes detailIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.detail__back {
  display: none;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.detail__back::before {
  content: "\2190";
}

.detail__back:hover {
  border-color: var(--border-strong);
  color: var(--accent-hover);
}

.detail__banner {
  position: relative;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 16 / 6;
  min-height: 7rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: var(--kind);
  color: #ffffff;
  overflow: hidden;
}

.detail__banner .icon {
  position: absolute;
  top: 50%;
  right: -0.5rem;
  width: 8rem;
  height: 8rem;
  opacity: 0.22;
  transform: translateY(-50%) rotate(-8deg);
}

.detail__kind {
  position: relative;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.detail__title {
  margin: 1.2rem 0 0.3rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.detail__date {
  margin: 0 0 1.1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.detail__body p {
  max-width: 60ch;
  font-weight: 300;
  line-height: 1.8;
}

.detail__link {
  display: inline-flex;
  margin-top: 0.5rem;
  padding: 0.65rem 1.6rem;
  border-radius: var(--radius-pill);
  background: var(--cta-bg);
  box-shadow: var(--cta-shadow);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #ffffff;
}

.detail__link:hover {
  transform: translateY(-2px);
  color: #ffffff;
}

.notice-footer {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-meta-link {
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.8;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.footer-meta-link:hover,
.footer-meta-link:focus-visible {
  opacity: 1;
  color: var(--accent-hover);
}

@media (max-width: 760px) {
  :root {
    --ctl-edge: max(14px, env(safe-area-inset-right));
    --ctl-top: max(14px, env(safe-area-inset-top));
  }

  .board {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
      "head"
      "tabs"
      "list";
    height: min(82dvh, 720px);
  }

  .board[data-view="detail"] {
    grid-template-areas:
      "head"
      "tabs"
      "detail";
  }

  .board[data-view="list"] .board__detail,
  .board[data-view="detail"] .board__list {
    display: none;
  }

  .board__head {
    padding: 0.95rem 1.1rem;
  }

  .board__tabs {
    flex-direction: row;
    padding: 0.6rem 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .tab {
    flex: none;
    width: auto;
  }

  .board__list {
    border-right: 0;
  }

  .board__detail {
    padding: 1.1rem;
  }

  .detail__back {
    display: inline-flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .board,
  .detail {
    animation: none !important;
  }

  .theme-toggle,
  .tab,
  .tab::before,
  .entry,
  .detail__link {
    transition: none !important;
  }
}
