/* ==========================================================
   OUBO ABG Panel — Shared Site CSS
   Deep Space Blue · Gold · Electric Blue
   ========================================================== */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "微软雅黑", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: #F5EFE6;
  background-color: #0B1D2A;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #3EC6FF;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #8BD6F7;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Bahnschrift", "DIN Alternate", "Arial Narrow", "微软雅黑", "Microsoft YaHei", sans-serif;
  line-height: 1.3;
  font-weight: 700;
}

p {
  margin: 0;
}

/* ---------- CSS Variables ---------- */
:root {
  --bg-deep: #0B1D2A;
  --bg-panel: #132C3C;
  --accent: #3EC6FF;
  --gold: #C9A063;
  --gold-soft: #E8C99E;
  --text-main: #F5EFE6;
  --text-dim: #7A8D9E;
  --line: #0F2333;
  --warn: #FFC857;
  --data: #8BD6F7;
  --radius: 4px;
  --max-w: 1240px;
  --font-display: "Bahnschrift", "DIN Alternate", "Arial Narrow", "微软雅黑", "Microsoft YaHei", sans-serif;
  --font-mono: "Roboto Mono", "Courier New", "微软雅黑", monospace;
  --header-z: 90;
  --drawer-z: 93;
  --overlay-z: 92;
  --totop-z: 96;
  --progress-z: 94;
}

/* ---------- Screen Reader Only ---------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Skip Link ---------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  padding: 0.75rem 1.5rem;
  background: var(--gold);
  color: var(--bg-deep);
  font-weight: 700;
  font-size: 14px;
  border-radius: 0 0 4px 4px;
  transition: top 0.25s ease;
}

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

/* ---------- Header General ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--header-z);
  background: rgba(11, 29, 42, 0.95);
  border-bottom: 1px solid var(--line);
}

.site-header::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--accent) 60%, transparent 100%);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

/* ---------- Header Top: brand + actions ---------- */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
}

.brand-link:hover {
  color: var(--text-main);
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--gold-soft);
  background: linear-gradient(135deg, rgba(201, 160, 99, 0.14) 0%, rgba(11, 29, 42, 0) 70%);
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-main);
  white-space: nowrap;
}

.brand-tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* ---------- Header Actions ---------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-soft);
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.quick-link:hover {
  background: rgba(201, 160, 99, 0.12);
  border-color: var(--gold-soft);
  color: var(--gold-soft);
  box-shadow: 0 0 20px rgba(201, 160, 99, 0.16);
}

.quick-icon {
  font-size: 10px;
  color: var(--accent);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-panel);
  transition: border-color 0.2s;
}

.nav-toggle:hover {
  border-color: var(--gold);
}

.toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-main);
  border-radius: 1px;
  transition: transform 0.25s, width 0.25s, background 0.25s;
}

/* ---------- Header Navbar ---------- */
.header-navbar {
  position: relative;
  border-top: 1px solid var(--line);
  background-color: rgba(19, 44, 60, 0.55);
  background-image:
    linear-gradient(rgba(62, 198, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 198, 255, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
}

.nav-binding {
  position: absolute;
  left: max(0px, calc((100vw - var(--max-w)) / 2));
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold);
  z-index: 2;
  pointer-events: none;
}

@media (min-width: 1024px) {
  .nav-binding {
    left: 24px;
  }
}

.site-nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 0 32px;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.nav-item {
  display: flex;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.nav-link:hover {
  color: var(--gold-soft);
  border-bottom-color: var(--gold);
  background: rgba(62, 198, 255, 0.045);
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  opacity: 0.85;
}

.nav-link[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-link[aria-current="page"] .nav-index {
  color: var(--accent);
  opacity: 1;
}

/* ---------- Nav extra (mobile drawer) ---------- */
.nav-head,
.nav-close {
  display: none;
}

/* ---------- Scroll Progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: transparent;
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: var(--progress-z);
  pointer-events: none;
  background-image: linear-gradient(90deg, var(--accent), var(--data));
}

/* ---------- Mobile Header / Nav Drawer ---------- */
@media (max-width: 1023px) {
  .header-top {
    padding: 10px 0;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-tagline {
    font-size: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .quick-link {
    padding: 6px 12px;
    font-size: 13px;
  }

  .quick-icon {
    font-size: 9px;
  }

  .nav-toggle {
    display: flex;
  }

  .header-navbar {
    border-top: none;
    background: none;
    background-image: none;
  }

  .nav-binding {
    display: none;
  }

  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 82vw);
    z-index: var(--drawer-z);
    background: var(--bg-panel);
    border-right: 1px solid rgba(201, 160, 99, 0.35);
    padding: 20px;
    max-width: none;
    margin: 0;
    overflow-y: auto;
    visibility: hidden;
    transform: translateX(-102%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.35s;
  }

  .site-nav::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, var(--gold) 0%, rgba(201, 160, 99, 0.3) 50%, transparent 100%);
  }

  .site-nav[data-open="true"] {
    visibility: visible;
    transform: translateX(0);
    box-shadow: 8px 0 48px rgba(0, 0, 0, 0.5);
  }

  .nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }

  .nav-title {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--gold);
  }

  .nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 15px;
    color: var(--text-dim);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: color 0.2s, border-color 0.2s;
  }

  .nav-close:hover {
    color: var(--text-main);
    border-color: var(--gold);
  }

  .nav-list {
    flex-direction: column;
    gap: 2px;
  }

  .nav-item {
    display: block;
    border-bottom: 1px solid rgba(15, 35, 51, 0.7);
  }

  .nav-link {
    width: 100%;
    padding: 13px 8px;
    border-bottom: none;
    border-left: 2px solid transparent;
  }

  .nav-link:hover {
    border-left-color: var(--gold);
    background: rgba(201, 160, 99, 0.06);
  }

  .nav-link[aria-current="page"] {
    border-left-color: var(--accent);
    background: rgba(62, 198, 255, 0.05);
  }

  .nav-link[aria-current="page"] .nav-text {
    color: var(--accent);
  }

  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: var(--overlay-z);
    background: rgba(5, 12, 18, 0.68);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .nav-overlay[data-open="true"] {
    opacity: 1;
    visibility: visible;
  }
}

@media (min-width: 1024px) {
  .nav-overlay {
    display: none;
  }

  .site-nav {
    visibility: visible;
    transform: none;
    display: block;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  margin-top: 64px;
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, rgba(201, 160, 99, 0.35) 30%, var(--accent) 100%);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 0;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.footer-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--gold-soft);
  background: linear-gradient(135deg, rgba(201, 160, 99, 0.12) 0%, rgba(11, 29, 42, 0) 70%);
}

.footer-brand-lockup {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.footer-brand-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-main);
}

.footer-brand-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.footer-trust {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 360px;
}

.footer-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
  padding-left: 10px;
  border-left: 2px solid var(--gold);
  margin-bottom: 14px;
  font-family: var(--font-display);
}

.footer-title.has-mark {
  border-left-color: var(--warn);
  color: var(--warn);
}

.footer-links li + li {
  margin-top: 8px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-main);
  transition: color 0.2s, padding-left 0.2s;
}

.footer-links a:hover {
  color: var(--gold-soft);
  padding-left: 4px;
}

.footer-secondary {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.footer-changelog {
  padding-right: 24px;
}

.changelog-item {
  background: var(--bg-panel);
  border-left: 3px solid var(--warn);
  border-radius: 0 4px 4px 0;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-main);
}

.tag-date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--warn);
  border: 1px solid rgba(255, 200, 87, 0.3);
  border-radius: 2px;
  padding: 2px 6px;
  margin-bottom: 4px;
}

.changelog-more {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--accent);
  border-bottom: 1px dashed rgba(62, 198, 255, 0.4);
  transition: border-color 0.2s;
}

.changelog-more:hover {
  border-color: var(--accent);
}

.footer-contact-block {}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-item {
  display: flex;
  gap: 12px;
  font-size: 13px;
  line-height: 1.6;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  min-width: 42px;
  padding-top: 1px;
}

.contact-value {
  color: var(--text-main);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 20px 0 28px;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-bottom-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-bottom-links a {
  color: var(--text-dim);
  font-size: 13px;
  transition: color 0.2s;
}

.footer-bottom-links a:hover {
  color: var(--gold-soft);
}

.footer-icp {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ---------- Back to Top ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 30px;
  z-index: var(--totop-z);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 48px;
  height: 48px;
  background: var(--bg-panel);
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--gold);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s, box-shadow 0.3s;
}

.to-top[data-visible="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  border-color: var(--gold-soft);
  box-shadow: 0 4px 24px rgba(201, 160, 99, 0.25);
}

.to-top-arrow {
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1;
}

.to-top-text {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

/* ---------- Container & Layout Helpers ---------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 56px 0;
}

.section-heading {
  font-size: 30px;
  line-height: 1.3;
  color: var(--text-main);
  letter-spacing: 0.04em;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  position: relative;
  margin-bottom: 22px;
  font-family: var(--font-display);
}

.section-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 72px;
  height: 2px;
  background: var(--gold);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn:hover {
  background: rgba(201, 160, 99, 0.1);
  border-color: var(--gold-soft);
  box-shadow: 0 0 18px rgba(201, 160, 99, 0.16);
}

.btn-primary {
  background: var(--gold);
  color: var(--bg-deep);
  border-color: var(--gold);
}

.btn-primary:hover {
  background: var(--gold-soft);
  color: var(--bg-deep);
  box-shadow: 0 4px 22px rgba(201, 160, 99, 0.35);
}

.btn-blue {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-blue:hover {
  background: rgba(62, 198, 255, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(62, 198, 255, 0.22);
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: rgba(201, 160, 99, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
}

/* ---------- Tags ---------- */
.tag {
  display: inline-block;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  border-radius: 2px;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.tag-gold {
  border: 1px solid rgba(201, 160, 99, 0.4);
  color: var(--gold-soft);
  background: rgba(201, 160, 99, 0.08);
}

.tag-warn {
  border: 1px solid rgba(255, 200, 87, 0.4);
  color: var(--warn);
  background: rgba(255, 200, 87, 0.06);
}

/* ---------- Utilities ---------- */
.mono {
  font-family: var(--font-mono);
}

.divider-gold {
  height: 1px;
  border: none;
  background: linear-gradient(90deg, var(--gold) 0%, transparent 100%);
  margin: 32px 0;
}

.img-frame {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
}

.img-frame::before {
  content: "IMG";
  opacity: 0.65;
}

/* ---------- Responsive ---------- */
@media (max-width: 899px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .footer-brand {
    grid-column: span 2;
  }

  .footer-secondary {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-changelog {
    padding-right: 0;
  }

  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 639px) {
  .header-inner {
    padding: 0 16px;
  }

  .quick-text {
    display: none;
  }

  .quick-link {
    padding: 8px 12px;
  }

  .footer-inner {
    padding: 36px 16px 0;
  }

  .footer-main {
    grid-template-columns: 1fr;
  }

  .footer-brand {
    grid-column: span 1;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-bottom-links {
    justify-content: center;
  }

  .to-top {
    right: 16px;
    bottom: 20px;
    width: 42px;
    height: 42px;
  }
}

/* ---------- Focus Visible ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .site-nav,
  .nav-overlay,
  .to-top,
  .skip-link,
  .scroll-progress {
    transition: none !important;
  }
}
