/* ==========================================================================
   AG枢 — Site Kit /assets/site.css
   共享样式：reset、变量、排版、页头、页脚、按钮、网格、基础组件
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-sub);
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse at 15% -10%, rgba(123, 45, 223, 0.10), transparent 55%),
    radial-gradient(ellipse at 110% 110%, rgba(30, 58, 138, 0.12), transparent 50%);
  background-attachment: fixed;
}

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

a {
  color: inherit;
  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: var(--font-headline);
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.3;
  letter-spacing: 0.01em;
}

p {
  text-rendering: optimizeLegibility;
}

code, pre, .mono {
  font-family: var(--font-mono);
}

/* ---------- 2. Variables ---------- */
:root {
  --bg-deep: #0A0F1F;
  --bg-card: #111A3A;
  --bg-black: #080B1A;
  --bg-translucent: #1A2350;
  --purple: #7B2DDF;
  --orange: #FF6B35;
  --blue-deep: #1E3A8A;
  --border-color: #2A3B6B;
  --text-main: #F8FAFC;
  --text-sub: #A0AEC0;
  --gradient-main: linear-gradient(135deg, #1E3A8A 0%, #7B2DDF 100%);

  --font-headline: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Heiti SC', 'Helvetica Neue', sans-serif;
  --font-body: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'SimSun', 'Georgia', serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', 'Courier New', monospace;

  --container-max: 1280px;
  --header-height: 68px;
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-strong: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 28px rgba(123, 45, 223, 0.18);
}

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

/* ---------- 4. Layout ---------- */
#main-content {
  flex: 1;
  width: 100%;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 72px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 40px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

.section-index {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--orange);
  letter-spacing: 1px;
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-headline);
  font-weight: 900;
  font-size: clamp(26px, 4vw, 42px);
  color: var(--text-main);
  line-height: 1.2;
}

.section-note {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-sub);
  writing-mode: vertical-rl;
  letter-spacing: 0.4em;
  padding-right: 2px;
  opacity: 0.75;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-headline);
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--bg-black);
  font-weight: 700;
}

.btn-primary:hover {
  background: transparent;
  color: var(--orange);
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.25);
}

.btn-ghost {
  background: transparent;
  border-color: var(--purple);
  color: var(--text-main);
}

.btn-ghost:hover {
  background: rgba(123, 45, 223, 0.14);
  border-color: var(--purple);
  box-shadow: 0 0 16px rgba(123, 45, 223, 0.2);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-icon {
  display: inline-block;
  flex-shrink: 0;
}

/* ---------- 6. Cards & Tags ---------- */
.card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--purple);
  box-shadow: var(--shadow-strong), var(--shadow-glow);
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-sub);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 4px 10px;
  background: rgba(26, 35, 80, 0.4);
  line-height: 1.4;
}

.tag--purple {
  border-color: rgba(123, 45, 223, 0.5);
  color: #B197FC;
  background: rgba(123, 45, 223, 0.1);
}

.tag--orange {
  border-color: rgba(255, 107, 53, 0.5);
  color: var(--orange);
  background: rgba(255, 107, 53, 0.08);
}

/* ---------- 7. Breadcrumb & Dividers ---------- */
.breadcrumb {
  margin-bottom: 32px;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-sub);
}

.breadcrumb-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.breadcrumb-list li:not(:last-child)::after {
  content: '/';
  color: var(--purple);
  font-family: var(--font-mono);
}

.breadcrumb-list a:hover {
  color: var(--orange);
}

.breadcrumb-list [aria-current="page"] {
  color: var(--text-main);
  font-family: var(--font-headline);
  font-weight: 700;
}

.divider-gradient {
  height: 2px;
  width: 100%;
  border: none;
  background: linear-gradient(90deg, transparent, var(--purple) 35%, var(--orange) 80%, transparent);
  margin: 0 0 48px;
}

.data-line {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: hidden;
}

.data-line::before {
  content: '';
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--purple), var(--orange));
  border-radius: 2px;
}

/* ---------- 8. Image Placeholder Frames ---------- */
.img-frame {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.img-frame::before {
  content: '';
  display: block;
  padding-top: 56.25%;
}

.img-frame-4x3::before { padding-top: 75%; }
.img-frame-1x1::before { padding-top: 100%; }
.img-frame-21x9::before { padding-top: 42.857%; }

.img-frame img,
.img-frame svg,
.img-frame .img-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-frame .img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  background:
    linear-gradient(135deg, rgba(123, 45, 223, 0.18), transparent 60%),
    linear-gradient(160deg, rgba(10, 15, 31, 0.6), var(--bg-card));
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-sub);
  text-align: center;
  padding: 16px;
  letter-spacing: 0.1em;
}

.img-frame .img-placeholder::before {
  content: '';
  width: 48px;
  height: 48px;
  border: 1px solid var(--purple);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 45, 223, 0.35), transparent 70%);
  box-shadow: 0 0 24px rgba(123, 45, 223, 0.25);
}

/* ---------- 9. Header ---------- */
.skip-link {
  position: fixed;
  top: -120px;
  left: 16px;
  z-index: 400;
  background: var(--orange);
  color: var(--bg-black);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: top 0.2s ease;
}

.skip-link:focus-visible {
  top: 16px;
  outline: none;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.45);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  z-index: 400;
  background: linear-gradient(90deg, var(--purple), var(--orange));
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10, 15, 31, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--border-color);
  transition: box-shadow 0.25s ease;
}

.site-header[data-scrolled="true"] {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.header-inner {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(123, 45, 223, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 45, 223, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.header-inner > * {
  position: relative;
  z-index: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  display: inline-flex;
  flex-shrink: 0;
}

.brand-mark svg {
  filter: drop-shadow(0 0 12px rgba(123, 45, 223, 0.3));
}

.brand-name {
  font-family: var(--font-headline);
  font-weight: 900;
  font-size: 20px;
  color: var(--text-main);
  letter-spacing: 0.05em;
}

.version-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  border: 1px solid rgba(123, 45, 223, 0.5);
  border-radius: 3px;
  color: #B197FC;
  background: rgba(123, 45, 223, 0.08);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.version-badge::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
  margin-right: 6px;
  vertical-align: 1px;
}

.site-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: var(--font-headline);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-sub);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--purple);
  letter-spacing: 0.5px;
  opacity: 0.85;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(26, 35, 80, 0.55);
  border-color: rgba(42, 59, 107, 0.8);
}

.nav-link:hover .nav-index {
  color: var(--orange);
  opacity: 1;
}

.nav-link[aria-current="page"] {
  color: var(--orange);
  background: rgba(255, 107, 53, 0.08);
  border-color: rgba(255, 107, 53, 0.3);
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.member-link {
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(26, 35, 80, 0.4);
  color: var(--text-sub);
  font-family: var(--font-headline);
  font-weight: 500;
  font-size: 13px;
  line-height: 1;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.nav-toggle:hover {
  color: var(--text-main);
  border-color: var(--purple);
  background: rgba(123, 45, 223, 0.12);
}

.nav-toggle-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 16px;
  flex-shrink: 0;
}

.nav-toggle-line {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* ---------- 10. Mobile Nav ---------- */
@media (max-width: 1023px) {
  :root {
    --header-height: 56px;
  }

  .header-inner {
    min-height: 56px;
    gap: 16px;
    padding: 0 16px;
  }

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

  .version-badge {
    font-size: 10px;
    padding: 3px 6px;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    margin-left: 0;
    background: rgba(8, 11, 26, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 2px solid var(--border-color);
    box-shadow: var(--shadow-strong);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .site-nav[data-open] {
    max-height: min(480px, calc(100vh - 56px));
    overflow-y: auto;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 16px;
    gap: 2px;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    padding: 12px 14px;
    font-size: 15px;
    border-radius: var(--radius-sm);
  }

  .nav-index {
    font-size: 11px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .member-link {
    padding: 8px 12px;
    font-size: 12px;
  }
}

@media (max-width: 479px) {
  .brand-name {
    font-size: 17px;
  }

  .version-badge {
    display: none;
  }

  .member-link .btn-icon {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  .container,
  .footer-inner,
  .header-inner {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ---------- 11. Footer ---------- */
.site-footer {
  position: relative;
  flex-shrink: 0;
  margin-top: auto;
  background: var(--bg-black);
  border-top: 2px solid var(--border-color);
  padding-top: 64px;
  padding-bottom: 28px;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--purple) 0%, rgba(30, 58, 138, 0.4) 30%, transparent 70%, var(--orange) 100%);
  z-index: 1;
}

.site-footer::after {
  content: '';
  position: absolute;
  right: -140px;
  bottom: -200px;
  width: 380px;
  height: 380px;
  border: 2px solid rgba(123, 45, 223, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 32px rgba(123, 45, 223, 0.03),
    0 0 0 64px rgba(123, 45, 223, 0.02);
  pointer-events: none;
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr 1.3fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.footer-brand-name {
  font-family: var(--font-headline);
  font-weight: 900;
  font-size: 22px;
  color: var(--text-main);
  letter-spacing: 0.03em;
}

.footer-tagline {
  font-family: var(--font-headline);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 12px;
}

.footer-description {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-sub);
  opacity: 0.8;
  max-width: 400px;
  margin-bottom: 16px;
}

.footer-stat {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-title {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 16px;
  position: relative;
  padding-left: 14px;
}

.footer-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--orange);
  border-radius: 1px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-sub);
  transition: color 0.2s ease;
}

.footer-links a::before {
  content: '→';
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--purple);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.footer-links a:hover {
  color: var(--orange);
}

.footer-links a:hover::before {
  opacity: 1;
  transform: translateX(0);
}

.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-sub);
}

.footer-contact-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #B197FC;
  border: 1px solid rgba(123, 45, 223, 0.35);
  border-radius: 2px;
  padding: 2px 6px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 3px;
}

.footer-contact-value {
  word-break: break-all;
}

.footer-note {
  font-size: 12px;
  color: var(--text-sub);
  opacity: 0.7;
  line-height: 1.6;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-sub);
  opacity: 0.8;
}

.footer-icp {
  font-size: 12px;
}

@media (max-width: 1023px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer-brand-col {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-brand-col,
  .footer-nav-col,
  .footer-contact-col {
    grid-column: 1;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- 12. Back to Top ---------- */
.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--purple);
  border-radius: 50%;
  background: rgba(10, 15, 31, 0.92);
  color: var(--text-main);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

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

.back-top:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.back-top-arrow {
  display: block;
}

@media (max-width: 767px) {
  .back-top {
    right: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
  }
}

/* ---------- 13. Responsive Grid ---------- */
@media (max-width: 1023px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 48px 0;
  }

  .section-head {
    flex-wrap: wrap;
    margin-bottom: 28px;
    gap: 8px;
  }

  .section-note {
    display: none;
  }
}

/* ---------- 14. 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;
  }
}
