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

:root {
  --black: #0a0a0a;
  --dark: #141414;
  --mid-dark: #1e1e1e;
  --mid: #2a2a2a;
  --border: #333;
  --text-dim: #777;
  --text: #aaa;
  --text-bright: #ccc;
  --white: #e0e0e0;
  --accent: #999;
  --accent-green: #6ea87e;
  --accent-green-dim: #4e8a62;
  --mono: 'Consolas', 'Courier New', monospace;
  --sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --focus-ring: 2px solid #6a9fb5;
}

html { scroll-behavior: smooth; }

html[data-theme="light"] {
  --black: #f5f5f5;
  --dark: #ffffff;
  --mid-dark: #f0f0f0;
  --mid: #e0e0e0;
  --border: #ccc;
  --text-dim: #777;
  --text: #444;
  --text-bright: #333;
  --white: #111;
  --accent: #555;
  --accent-green: #3d8b52;
  --accent-green-dim: #5aa06a;
}
html[data-theme="light"] .footer-tomb { filter: grayscale(60%); opacity: 0.2; }
html[data-theme="light"] .eye-banner img { filter: grayscale(60%) contrast(1.05); opacity: 0.8; }

.eye-banner {
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.eye-banner img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: grayscale(100%) contrast(1.1);
  opacity: 0.6;
}

body {
  font-family: var(--sans);
  background: var(--black);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

a:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--white);
  color: var(--black);
  padding: 8px 16px;
  z-index: 999;
  font-size: 14px;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

a { color: var(--white); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--text-bright); }

img { max-width: 100%; display: block; }

.site-header {
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 52px;
}

.site-logo {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-right: auto;
}
.site-logo:hover { color: var(--white); }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1;
  transition: border-color 0.2s, color 0.2s;
  margin-left: 8px;
  order: 10;
}
.theme-toggle:hover { border-color: var(--text); color: var(--white); }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-dim);
  border-radius: 4px;
  letter-spacing: 0.02em;
  transition: color 0.2s;
  position: relative;
}
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: var(--text-dim);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}
.main-nav a:hover {
  color: var(--white);
}
.main-nav a:hover::after {
  transform: scaleX(1);
}
.main-nav a.active {
  color: var(--white);
}
.main-nav a.active::after {
  background: var(--white);
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s;
}
.nav-toggle:hover { border-color: var(--text); }
.nav-toggle span {
  display: block; width: 18px; height: 1.5px;
  background: var(--text); border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

main {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
}

.page-title {
  font-size: 20px;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 32px;
  font-family: var(--mono);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

.section-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.link-list {
  list-style: none;
  margin-bottom: 32px;
}
.link-list li {
  border-bottom: 1px solid var(--mid);
}
.link-list li:first-child {
  border-top: 1px solid var(--mid);
}
.link-list a {
  display: block;
  padding: 10px 0;
  color: var(--text);
  font-size: 14px;
  transition: color 0.2s, padding-left 0.2s;
}
.link-list a:hover {
  color: var(--white);
  padding-left: 8px;
}
.link-list a .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-right: 10px;
  min-width: 28px;
  display: inline-block;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 32px;
}

.card {
  background: var(--dark);
  padding: 20px;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
}
.card:hover { background: var(--mid-dark); }

.card h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 6px;
}
.card p {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.5;
}
.card-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-top: auto;
}
.card:hover .card-link { color: var(--white); }

.info-block {
  background: var(--dark);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 16px;
}
.info-block h2 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 12px;
}
.info-block p {
  color: var(--text);
  margin-bottom: 8px;
  font-size: 14px;
}
.info-block p:last-child { margin-bottom: 0; }

.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
}
.contact-row .label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  min-width: 60px;
}

.support-box {
  border: 1px solid var(--accent-green-dim);
  background: linear-gradient(135deg, rgba(110,168,126,0.10), rgba(110,168,126,0.02));
  padding: 32px;
  text-align: center;
  margin-bottom: 32px;
  position: relative;
}
.support-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
}
.support-box h2 {
  font-size: 18px;
  color: var(--accent-green);
  font-weight: 400;
  margin-bottom: 8px;
}
.support-box p {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
}
.account-num {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--white);
  letter-spacing: 0.08em;
  padding: 16px;
  background: var(--mid-dark);
  border: 1px solid var(--accent-green-dim);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.copy-btn {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent-green);
  background: none;
  border: 1px solid var(--accent-green-dim);
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.copy-btn:hover { background: var(--accent-green-dim); color: var(--white); }
.copy-btn.copied { color: var(--white); border-color: var(--accent-green); }
.copy-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.file-list {
  list-style: none;
  margin-bottom: 32px;
}
.file-list li {
  border-bottom: 1px solid var(--mid);
}
.file-list li:first-child {
  border-top: 1px solid var(--mid);
}
.file-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  color: var(--text);
  font-size: 14px;
  transition: color 0.2s, padding-left 0.2s;
}
.file-list a:hover {
  color: var(--white);
  padding-left: 8px;
}
.file-list .ext {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--mid);
  padding: 2px 6px;
  border-radius: 2px;
  flex-shrink: 0;
}

.file-search {
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 16px;
  background: var(--mid-dark);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  border-radius: 4px;
  transition: border-color 0.2s;
}
.file-search:focus { border-color: var(--accent); outline: none; }
.file-search::placeholder { color: var(--text-dim); }

.book-list {
  list-style: none;
  margin-bottom: 32px;
}
.book-list li {
  border-bottom: 1px solid var(--mid);
  padding: 12px 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.book-list li:first-child { border-top: 1px solid var(--mid); }

.pdf-viewer-container {
  display: none;
  margin-bottom: 16px;
}
.pdf-viewer-container.active { display: block; }
.pdf-viewer-container.expanded {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200;
  background: var(--black);
  margin: 0;
  padding: 12px;
  overflow: auto;
}
.pdf-viewer-container.expanded .pdf-viewer {
  height: calc(100vh - 80px);
}
.pdf-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}
.pdf-viewer {
  width: 100%;
  height: 85vh;
  border: 1px solid var(--border);
  background: var(--mid-dark);
}
.pdf-close {
  font-family: var(--mono);
  font-size: 13px;
  display: inline-block;
  margin-bottom: 12px;
  color: var(--text-dim);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.pdf-close:hover { color: var(--white); }
.pdf-close::before { content: '← '; }
.pdf-expand {
  font-family: var(--mono);
  font-size: 13px;
  display: inline-block;
  color: var(--text-dim);
  cursor: pointer;
  background: none;
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 3px;
  transition: color 0.2s, border-color 0.2s;
}
.pdf-expand:hover { color: var(--white); border-color: var(--text); }
.pdf-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.pdf-filename {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
}

.breadcrumb {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--white); }
.breadcrumb .sep { margin: 0 6px; opacity: 0.4; }

.error-page-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.error-page {
  text-align: center;
  padding: 80px 24px;
}
.error-code {
  font-family: var(--mono);
  font-size: 72px;
  font-weight: 300;
  color: var(--border);
  line-height: 1;
  margin-bottom: 16px;
}
.error-message {
  font-size: 18px;
  color: var(--text-bright);
  margin-bottom: 8px;
}
.error-hint {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 32px;
}
.error-link {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 8px 20px;
  border-radius: 4px;
  transition: color 0.2s, border-color 0.2s;
  display: inline-block;
}
.error-link:hover { color: var(--white); border-color: var(--text); }

.site-footer {
  background: var(--dark);
  border-top: 1px solid var(--border);
}
.footer-tomb {
  height: 100%;
  width: auto;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1);
  opacity: 0.25;
  flex-shrink: 0;
}
.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  /* padding: 20px 24px; */
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-dim);
}
.footer-links { display: flex; gap: 16px; align-items: center; align-self: stretch; }
.footer-links a { color: var(--text-dim); font-size: 12px; }
.footer-links a:hover { color: var(--white); }

@media (max-width: 900px) {
  .card-grid > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .header-inner { height: 48px; }
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 48px; left: 0; right: 0;
    background: var(--dark);
    flex-direction: column;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
    padding: 0 8px;
  }
  .main-nav.open {
    max-height: 300px;
    opacity: 1;
    padding: 8px;
  }
  .main-nav a {
    padding: 12px 16px;
    transform: translateY(-8px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease, color 0.2s;
    border-left: 2px solid transparent;
    border-radius: 0;
    font-size: 14px;
  }
  .main-nav a::after { display: none; }
  .main-nav a:hover,
  .main-nav a:focus {
    background: var(--mid-dark);
    border-left-color: var(--text-dim);
  }
  .main-nav a.active {
    border-left-color: var(--white);
    background: var(--mid-dark);
  }
  .main-nav.open a {
    transform: translateY(0);
    opacity: 1;
  }
  .main-nav.open a:nth-child(1) { transition-delay: 0.05s; }
  .main-nav.open a:nth-child(2) { transition-delay: 0.10s; }
  .main-nav.open a:nth-child(3) { transition-delay: 0.15s; }
  .main-nav.open a:nth-child(4) { transition-delay: 0.20s; }
  .main-nav.open a:nth-child(5) { transition-delay: 0.25s; }
  .card-grid { grid-template-columns: 1fr; }
  main { padding: 24px 16px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .eye-banner img { max-height: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

@media print {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  a { color: #000; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 9pt; color: #555; }
  a[href^="#"]::after, a[href^="javascript"]::after, .main-nav a::after, .footer-links a::after, .breadcrumb a::after, .skip-link::after { content: none; }
  .site-header, .nav-toggle, .main-nav, .skip-link, .site-footer, .footer-tomb, .eye-banner, .pdf-viewer-container, .copy-btn { display: none !important; }
  main { max-width: 100%; padding: 0; margin: 0; }
  .card-grid { border-color: #ccc; }
  .card { border-bottom: 1px solid #ccc; }
  .support-box { border-color: #999; background: none; }
  .support-box::before { display: none; }
  .account-num { background: #eee; border-color: #999; color: #000; }
  .info-block { border-color: #ccc; }
  img { filter: none; opacity: 1; }
}
