:root {
  color-scheme: light dark;
  --navy: #1657a6;
  --navy-dark: #0b2d5c;
  --ink: #172235;
  --muted: #60708a;
  --line: #d6dfeb;
  --surface: #f1f5fa;
  --white: #fff;
  --header: rgb(255 255 255 / 92%);
  --shadow: rgb(15 42 78 / 8%);
  --danger: #9d3030;
  --danger-line: #e5b1b1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy: #76b5ff;
    --navy-dark: #dcecff;
    --ink: #e8eef8;
    --muted: #aab9ce;
    --line: #2c3a4f;
    --surface: #101722;
    --white: #182333;
    --header: rgb(24 35 51 / 94%);
    --shadow: rgb(0 0 0 / 25%);
    --danger: #ffadad;
    --danger-line: #754343;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --navy: #1657a6;
  --navy-dark: #0b2d5c;
  --ink: #172235;
  --muted: #60708a;
  --line: #d6dfeb;
  --surface: #f1f5fa;
  --white: #fff;
  --header: rgb(255 255 255 / 92%);
  --shadow: rgb(15 42 78 / 8%);
  --danger: #9d3030;
  --danger-line: #e5b1b1;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #76b5ff;
  --navy-dark: #dcecff;
  --ink: #e8eef8;
  --muted: #aab9ce;
  --line: #2c3a4f;
  --surface: #101722;
  --white: #182333;
  --header: rgb(24 35 51 / 94%);
  --shadow: rgb(0 0 0 / 25%);
  --danger: #ffadad;
  --danger-line: #754343;
}

:root[data-theme="dark"] .brand img {
  filter: brightness(0) invert(1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand img {
    filter: brightness(0) invert(1);
  }
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--surface); }
body { margin: 0; min-width: 320px; }
a { color: var(--navy); }
.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.site-header { background: var(--header); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-height: 5.5rem; }
.brand img { display: block; width: min(390px, 78vw); height: auto; }
.site-nav { display: flex; align-items: center; gap: .25rem; }
.site-nav a { padding: .75rem .9rem; border-radius: .5rem; text-decoration: none; font-weight: 650; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--white); background: var(--navy); }
.menu-toggle, .theme-toggle { border: 1px solid var(--line); border-radius: .5rem; background: var(--white); color: var(--ink); padding: .6rem .8rem; font: inherit; cursor: pointer; }
.theme-toggle { flex: none; width: 2.6rem; padding: .55rem; font-size: 1.1rem; line-height: 1; }
.site-nav .theme-toggle { margin-left: .5rem; }
.menu-toggle { display: none; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.main-content { min-height: calc(100vh - 10rem); padding: 3.5rem 0 5rem; }
h1 { margin: 0 0 1.5rem; color: var(--navy-dark); font-size: clamp(1.75rem, 3.5vw, 2.4rem); line-height: 1.15; }
h2 { margin: 0 0 .75rem; color: var(--navy); font-size: 1.3rem; }
.news-list { display: grid; gap: 1rem; }
.article { padding: 1.5rem; background: var(--white); border: 1px solid var(--line); border-radius: .8rem; box-shadow: 0 5px 18px var(--shadow); }
.article-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .75rem; }
.timestamp { flex: none; color: var(--muted); font-size: .85rem; }
.article-body { margin: 1rem 0; line-height: 1.65; }
.attachments { margin-top: 1rem; padding: 1rem; background: var(--surface); border-radius: .5rem; }
.attachments h3 { margin: 0 0 .5rem; font-size: .9rem; color: var(--muted); }
.attachments ul { margin: 0; padding: 0; list-style: none; }
.attachments li + li { margin-top: .35rem; }
.image-link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 650; }
.image-lightbox { width: min(94vw, 1120px); max-width: none; padding: 0; border: 1px solid var(--line); border-radius: .8rem; background: var(--white); color: var(--ink); box-shadow: 0 18px 70px rgb(0 0 0 / 45%); }
.image-lightbox::backdrop { background: rgb(4 12 24 / 78%); backdrop-filter: blur(3px); }
.lightbox-frame { position: relative; display: grid; gap: .7rem; margin: 0; padding: 1rem; }
.lightbox-image { display: block; width: 100%; max-height: 82vh; object-fit: contain; border-radius: .4rem; }
.lightbox-caption { color: var(--muted); font-size: .9rem; }
.lightbox-close { position: absolute; top: .65rem; right: .65rem; z-index: 1; width: 2.3rem; height: 2.3rem; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.page-card { padding: 1.75rem; background: var(--white); border: 1px solid var(--line); border-radius: .8rem; line-height: 1.7; }
.page-card table { border-collapse: collapse; max-width: 100%; }
.page-card td, .page-card th { padding: .55rem .75rem .55rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.page-card .label { font-weight: 700; white-space: nowrap; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.empty, .error { padding: 1.25rem; border-radius: .6rem; background: var(--white); color: var(--muted); }
.error { color: var(--danger); border: 1px solid var(--danger-line); }
.site-footer { margin-top: auto; padding: 2rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; align-items: start; }
.footer-grid strong { color: var(--ink); font-size: 1rem; }
.footer-grid p { margin: .45rem 0 0; }
.footer-grid nav { display: grid; gap: .45rem; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; }
.footer-meta { display: grid; gap: .45rem; justify-items: end; text-align: right; }
.archive-link { margin: 1.5rem 0 0; text-align: center; }
.button { display: inline-block; padding: .75rem 1.1rem; border-radius: .5rem; background: var(--navy); color: var(--white); font-weight: 700; text-decoration: none; }
.button:hover { background: var(--navy-dark); text-decoration: none; }
.functional-notice { position: fixed; right: 1rem; bottom: 1rem; z-index: 10; display: flex; align-items: center; gap: 1rem; width: min(31rem, calc(100% - 2rem)); padding: 1rem 1.1rem; background: var(--white); border: 1px solid var(--line); border-radius: .8rem; box-shadow: 0 10px 35px var(--shadow); }
.functional-notice p { margin: .3rem 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.functional-notice button { flex: none; border: 0; border-radius: .5rem; background: var(--navy); color: var(--white); padding: .65rem .85rem; font: inherit; font-weight: 700; cursor: pointer; }
@media (max-width: 760px) {
  .header-inner { min-height: 4.5rem; flex-wrap: wrap; gap: 1rem; padding: .5rem 0; }
  .brand img { width: min(250px, 68vw); }
  .menu-toggle { display: block; width: 2.6rem; height: 2.6rem; margin-left: auto; padding: 0; font-size: 1.4rem; line-height: 1; }
  .site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: .5rem; }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .7rem; }
  .site-nav .theme-toggle { align-self: flex-start; margin: .25rem 0 0; }
  .main-content { padding-top: 2.25rem; }
  .article-header, .columns { display: block; }
  .timestamp { display: block; margin-top: .4rem; }
  .page-card { padding: 1rem; overflow-x: auto; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .footer-meta { justify-items: start; text-align: left; }
  .functional-notice { display: block; }
  .functional-notice button { margin-top: .8rem; }
  .image-lightbox { width: calc(100% - 1rem); }
  .lightbox-frame { padding: .55rem; }
  .lightbox-image { max-height: 78vh; }
}
