﻿:root {
  color-scheme: dark;
  --bg: #0e141f;
  --panel: #182130;
  --panel-2: #111b29;
  --line: #374962;
  --line-strong: #507fa8;
  --text: #e8eef7;
  --muted: #9eafc5;
  --accent: #78d2ff;
  --accent-2: #a8e6ff;
  --danger: #dc2828;
  --hot: #ff8c00;
  --event: #3278ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 "Segoe UI", "Malgun Gothic", system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 210px 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar,
.article-sidebar {
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--panel-2);
  padding: 12px;
  overflow: auto;
}

.article-sidebar {
  background: #121c2a;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.brand-title {
  color: var(--accent-2);
  font-weight: 700;
  white-space: nowrap;
}

.brand {
  flex-wrap: wrap;
}

.brand-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--line-strong);
}

.lang-button {
  min-height: 30px;
  min-width: 32px;
  padding: 4px 7px;
  color: var(--muted);
  background: #121c2a;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.lang-button + .lang-button {
  border-left: 1px solid var(--line-strong);
}

.lang-button:hover {
  color: #fff;
}

.lang-button.active {
  color: #fff;
  background: #1e5fa8;
}

.lang-fallback {
  margin-bottom: 12px;
}

.search {
  width: 100%;
  height: 34px;
  margin-bottom: 12px;
  padding: 0 10px;
  color: var(--text);
  background: #0b1320;
  border: 1px solid var(--line);
  outline: none;
}

.search:focus {
  border-color: var(--accent);
}

.panel {
  margin-bottom: 16px;
}

.panel-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-list,
.article-list {
  display: grid;
  gap: 4px;
}

.nav-item,
.article-item {
  width: 100%;
  min-height: 28px;
  padding: 5px 8px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}

.nav-item:hover,
.article-item:hover {
  background: #1d2c41;
  border-color: #314761;
}

.nav-item.active,
.article-item.active {
  color: #fff;
  background: #1e5fa8;
  border-color: #4fa4e8;
}

.article-item.sub-item {
  padding-left: 24px;
}

.compact .nav-item {
  min-height: 24px;
  color: var(--muted);
}

.content {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  background: var(--bg);
}

.content-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 8px 18px;
  background: rgba(14, 20, 31, .96);
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb span::after,
.breadcrumb a::after {
  content: "/";
  margin-left: 6px;
  color: #506277;
}

.breadcrumb span:last-child::after,
.breadcrumb a:last-child::after {
  content: "";
}

.wiki-article {
  max-width: 1120px;
  padding: 20px 24px 60px;
}

.wiki-title {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 28px;
  line-height: 1.25;
}

.wiki-summary {
  margin: 0 0 18px;
  color: var(--muted);
}

.wiki-heading {
  margin: 26px 0 10px;
  padding-bottom: 6px;
  color: #ffd84a;
  font-size: 20px;
  border-bottom: 1px solid var(--line);
}

.wiki-text,
.wiki-link-block {
  margin: 8px 0;
}

.wiki-list {
  margin: 8px 0 14px;
  padding-left: 26px;
  line-height: 1.6;
}

.wiki-list li {
  margin: 4px 0;
  padding-left: 4px;
}

.notice,
.update {
  margin: 12px 0;
  padding: 12px;
  background: #162235;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
}

.update {
  border-left-color: #68d391;
}

.notice-title {
  margin-bottom: 4px;
  color: var(--accent-2);
  font-weight: 700;
}

.wiki-image {
  display: block;
  max-width: 100%;
  margin: 10px 0;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.wiki-table {
  width: 100%;
  margin: 12px 0 18px;
  border-collapse: collapse;
  table-layout: auto;
}

.wiki-table th,
.wiki-table td {
  padding: 8px;
  line-height: 1.55;
  vertical-align: top;
  border: 1px solid var(--line);
}

.wiki-table th {
  color: #fff;
  background: #26364c;
}

.wiki-table td {
  background: #182130;
}

.inline-link,
.inline-item,
.inline-navi,
.external-link {
  padding: 0;
  font: inherit;
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

.inline-link,
.breadcrumb a {
  color: rgb(120, 210, 255);
  text-decoration: underline;
  cursor: pointer;
}

.inline-link:hover,
.breadcrumb a:hover {
  color: rgb(180, 235, 255);
}

.inline-item {
  color: rgb(255, 220, 120);
}

.inline-item:hover {
  color: rgb(255, 240, 170);
}

.inline-navi {
  color: rgb(140, 255, 160);
}

.inline-navi:hover {
  color: rgb(190, 255, 200);
}

.external-link {
  color: rgb(210, 160, 255);
}

.external-link:hover {
  color: rgb(230, 200, 255);
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-right: 6px;
  padding: 0 6px;
  color: white;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
  border-radius: 3px;
  background: #687386;
}

.badge-new {
  background: var(--danger);
}

.badge-hot {
  background: var(--hot);
}

.badge-event {
  background: var(--event);
}

.tabs {
  margin: 14px 0;
}

.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tab-button,
.ghost-button,
.icon-button {
  min-height: 30px;
  padding: 4px 10px;
  color: var(--accent);
  background: #121c2a;
  border: 1px solid var(--line-strong);
  cursor: pointer;
}

.tab-button.active,
.ghost-button:hover,
.icon-button:hover {
  color: #fff;
  background: #1e5fa8;
}

.tab-panel {
  padding: 10px;
  border: 1px solid var(--line);
  background: #111b29;
}

.references {
  margin-top: 18px;
  padding-left: 20px;
}

.recent-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 18px;
}

.recent-item {
  min-height: 24px;
}

.report-footer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 46px;
  background: rgba(0, 0, 0, .78);
}

.modal[hidden] {
  display: none;
}

.modal img {
  max-width: 100%;
  max-height: 100%;
  border: 1px solid var(--line-strong);
  background: #000;
}

.modal-close {
  position: fixed;
  top: 12px;
  right: 16px;
  width: 34px;
  height: 34px;
  color: var(--text);
  background: #182130;
  border: 1px solid var(--line-strong);
  cursor: pointer;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: 360px;
  padding: 10px 12px;
  color: #fff;
  background: #1e5fa8;
  border: 1px solid var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.empty,
.error {
  color: var(--muted);
  padding: 12px 0;
}

.error {
  color: #ff8a8a;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .article-sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content {
    height: auto;
    min-height: 60vh;
  }
}


