/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --accent: #06b6d4;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-dark: #0f172a;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.12);
  --transition: 0.25s ease;
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(37, 99, 235, 0.04);
}

.btn-outline-light {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  color: #fff;
}

.btn-nav {
  padding: 8px 20px;
  background: var(--primary);
  color: #fff !important;
  border-radius: 8px;
}

.btn-nav:hover {
  background: var(--primary-dark);
  color: #fff !important;
}

.btn-nav-tg {
  background: #229ED9;
  color: #fff !important;
}

.btn-nav-tg:hover {
  background: #1a8bc4;
  color: #fff !important;
}

.btn-tg {
  background: #229ED9;
  color: #fff;
  box-shadow: 0 4px 16px rgba(34, 158, 217, 0.35);
}

.btn-tg:hover {
  background: #1a8bc4;
  color: #fff;
  transform: translateY(-2px);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 16px;
}

.btn-demo {
  width: 100%;
  margin-top: auto;
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 8px;
  font-weight: 500;
}

.btn-demo:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: all var(--transition);
}

.header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
}

.logo:hover {
  color: var(--text);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-links a.active {
  font-weight: 600;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Subpage ===== */
.subpage .section:first-of-type {
  padding-top: 60px;
}

.page-banner {
  padding: 120px 0 60px;
  background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 100%);
  text-align: center;
}

.page-banner h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin: 12px 0;
  letter-spacing: -0.02em;
}

.page-banner p {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto;
}

.page-banner-dark {
  background: var(--bg-dark);
  color: #e2e8f0;
}

.page-banner-dark .section-tag {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.page-banner-dark p {
  color: #94a3b8;
}

.page-banner-alt {
  background: var(--bg-alt);
}

.page-nav-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.page-nav-actions-dark {
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* ===== Nav Cards (Home) ===== */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.nav-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  color: var(--text);
  transition: all var(--transition);
}

.nav-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
  color: var(--text);
}

.nav-card-icon {
  width: 48px;
  height: 48px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.nav-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.nav-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}

.nav-card-link {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37, 99, 235, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #f0f7ff 0%, #ffffff 100%);
  z-index: -1;
}

.hero-content {
  text-align: center;
  max-width: 800px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== Sections ===== */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-dark {
  background: var(--bg-dark);
  color: #e2e8f0;
}

.section-dark .section-tag {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.section-dark .section-header p {
  color: #94a3b8;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-tag {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto;
}

/* ===== Features ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.feature-icon {
  width: 52px;
  height: 52px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

/* ===== Tech ===== */
.tech-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.tech-stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.tech-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.tech-dot {
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.tech-item h4 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #f1f5f9;
}

.tech-item p {
  color: #94a3b8;
  font-size: 14px;
}

.arch-diagram {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}

.arch-layer {
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}

.arch-top {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.arch-mid {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

.arch-bottom {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.arch-arrow {
  color: #475569;
  font-size: 18px;
  padding: 8px 0;
}

.arch-services {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.arch-services span {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 12px;
  color: #cbd5e1;
}

/* ===== Demo ===== */
.demo-notice {
  display: flex;
  gap: 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 40px;
  color: #92400e;
}

.demo-notice svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.demo-notice strong {
  display: block;
  margin-bottom: 4px;
}

.demo-notice p {
  font-size: 14px;
  line-height: 1.7;
  opacity: 0.9;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.demo-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
}

.demo-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.demo-card-header {
  margin-bottom: 20px;
}

.demo-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.demo-badge-primary { background: #dbeafe; color: #1d4ed8; }
.demo-badge-purple { background: #ede9fe; color: #6d28d9; }
.demo-badge-cyan { background: #cffafe; color: #0e7490; }
.demo-badge-green { background: #d1fae5; color: #047857; }
.demo-badge-orange { background: #ffedd5; color: #c2410c; }

.demo-card-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 8px;
}

.demo-card-desc code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary);
}

.demo-card h3 {
  font-size: 18px;
  font-weight: 600;
}

.demo-card-body {
  flex: 1;
  margin-bottom: 20px;
}

.demo-field {
  margin-bottom: 16px;
}

.demo-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

.demo-field a {
  font-size: 14px;
  word-break: break-all;
}

.demo-credentials {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.credential {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-alt);
  padding: 8px 12px;
  border-radius: 8px;
}

.cred-label {
  font-size: 13px;
  color: var(--text-muted);
}

code.copyable {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  background: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text);
}

code.copyable:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== CTA ===== */
.cta-section {
  padding: 80px 0;
}

.cta-box {
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 50%, var(--accent) 100%);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  color: #fff;
}

.cta-box h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.cta-box p {
  font-size: 17px;
  opacity: 0.9;
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-box .btn-primary {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.cta-box .btn-primary:hover {
  background: #f8fafc;
  color: var(--primary-dark);
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-dark);
  color: #94a3b8;
  padding-top: 60px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 40px;
}

.footer-brand p {
  margin-top: 12px;
  font-size: 14px;
}

.footer-brand .logo {
  color: #f1f5f9;
}

.footer-links {
  display: flex;
  gap: 60px;
}

.footer-col h5 {
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: #94a3b8;
  font-size: 14px;
}

.footer-col a:hover {
  color: #fff;
}

.footer-contact-tip {
  font-size: 13px;
  color: #64748b;
  margin-top: 8px;
  line-height: 1.6;
  max-width: 200px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-dark);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== Intro Page ===== */
.container-narrow {
  max-width: 860px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.hero-tags span {
  padding: 6px 14px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
}

.intro-block {
  margin-bottom: 48px;
}

.intro-block h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.intro-block p {
  color: var(--text-muted);
  line-height: 1.9;
  margin-bottom: 16px;
}

.intro-block strong {
  color: var(--text);
}

.intro-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.intro-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.intro-card p {
  margin-bottom: 12px;
}

.intro-note {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 0 !important;
}

.doc-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.doc-list a {
  color: var(--primary);
}

.doc-list a:hover {
  text-decoration: underline;
}

.doc-list li {
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  border-left: 3px solid var(--primary);
}

.feature-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-alt);
  border-radius: 10px;
  font-size: 14px;
}

.highlight-icon {
  color: #10b981;
  font-weight: 700;
}

.support-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(6, 182, 212, 0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
}

.support-box h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

.support-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.support-list li {
  font-size: 14px;
  color: var(--text-muted);
  padding-left: 18px;
  position: relative;
}

.support-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.notice-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 16px 20px;
  color: #92400e;
}

.notice-box strong {
  display: block;
  margin-bottom: 6px;
}

.notice-box p {
  font-size: 14px;
  margin-bottom: 0;
  line-height: 1.7;
}

/* ===== Module Grid ===== */
.container-narrow .module-grid {
  margin-top: 24px;
}

.section-lead {
  text-align: center;
  color: var(--text-muted);
  font-size: 16px;
  max-width: 720px;
  margin: -20px auto 40px;
  line-height: 1.8;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.module-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}

.module-card:hover {
  box-shadow: var(--shadow);
  border-color: transparent;
}

.module-card-highlight {
  border-left: 4px solid var(--primary);
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.module-name {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
}

.module-port {
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  background: #d1fae5;
  padding: 3px 10px;
  border-radius: 100px;
}

.module-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ===== Port Table ===== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.port-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.port-table th,
.port-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.port-table th {
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.port-table tr:last-child td {
  border-bottom: none;
}

.port-table tr:hover td {
  background: rgba(37, 99, 235, 0.03);
}

.port-table code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
}

.port-badge {
  display: inline-block;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 6px;
  font-family: 'Consolas', 'Monaco', monospace;
}

/* ===== Home Highlights ===== */
.highlights-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.highlight-block {
  text-align: center;
  padding: 32px 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.highlight-block h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--primary);
}

.highlight-block p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ===== Functions List ===== */
.system-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.system-tab {
  padding: 12px 32px;
  border: 2px solid var(--border);
  background: var(--bg);
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  color: var(--text-muted);
}

.system-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.system-tab:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
}

.system-panel {
  display: none;
}

.system-panel.active {
  display: block;
}

.system-panel-header {
  text-align: center;
  margin-bottom: 28px;
}

.system-panel-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.system-panel-header p {
  color: var(--text-muted);
  font-size: 15px;
}

.fn-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.fn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.fn-table th {
  background: var(--bg-alt);
  padding: 16px 20px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.fn-table th:first-child {
  width: 140px;
}

.fn-table td {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.fn-table tr:last-child td {
  border-bottom: none;
}

.fn-table tr:hover td {
  background: rgba(37, 99, 235, 0.02);
}

.fn-module {
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  background: rgba(37, 99, 235, 0.04);
}

.fn-list p {
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0;
}

.fn-group {
  margin-bottom: 14px;
}

.fn-group:last-child {
  margin-bottom: 0;
}

.fn-group strong {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-alt);
  padding: 2px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
  border-left: 3px solid var(--primary);
}

.fn-group strong + p {
  padding-left: 4px;
}

/* ===== Doc Page ===== */
.doc-section {
  padding-top: 60px;
  padding-bottom: 80px;
}

.doc-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}

.doc-sidebar {
  position: sticky;
  top: 96px;
}

.doc-toc {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.doc-toc h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.doc-toc a {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}

.doc-toc a:last-child {
  border-bottom: none;
}

.doc-toc a:hover {
  color: var(--primary);
}

.doc-content {
  min-width: 0;
}

.doc-intro {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(6, 182, 212, 0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 40px;
}

.doc-intro p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.doc-intro p:last-of-type {
  margin-bottom: 0;
}

.doc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.doc-tags span {
  font-size: 12px;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--primary);
}

.doc-h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 48px 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.doc-h2:first-of-type {
  margin-top: 0;
}

.doc-h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--text);
}

.doc-h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 24px 0 12px;
}

.doc-content > p,
.doc-content li p {
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 16px;
}

.doc-content code {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.88em;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 4px;
}

.code-block {
  position: relative;
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #334155;
  background: #0f172a;
}

.code-block pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
}

.code-block code {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e2e8f0;
  background: none;
  padding: 0;
  white-space: pre;
}

.code-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 12px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.code-copy:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.doc-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.doc-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.doc-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary);
}

.doc-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

.doc-tip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0;
}

.doc-tip strong {
  display: block;
  margin-bottom: 10px;
  color: #1e40af;
}

.doc-tip ul {
  list-style: none;
  margin: 0;
}

.doc-tip li {
  font-size: 14px;
  color: #1e3a8a;
  padding: 4px 0;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
}

.doc-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 16px 0 24px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.doc-table th,
.doc-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.doc-table th {
  background: var(--bg-alt);
  font-weight: 600;
  width: 160px;
  white-space: nowrap;
}

.doc-table tr:last-child td,
.doc-table tr:last-child th {
  border-bottom: none;
}

.doc-steps {
  list-style: none;
  counter-reset: step;
  margin: 24px 0;
  padding: 0;
}

.doc-steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
  margin-bottom: 28px;
}

.doc-steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.doc-steps strong {
  display: block;
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--text);
}

.doc-steps p {
  margin-bottom: 12px;
}

.doc-support {
  text-align: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-top: 48px;
}

.doc-support p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.code-block-output {
  border-color: #1e293b;
  background: #1e293b;
}

.code-block-output code {
  color: #86efac;
}

.doc-note {
  font-size: 14px;
  color: var(--text-muted);
  padding: 10px 14px;
  background: var(--bg-alt);
  border-left: 3px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  margin: 16px 0;
}

.doc-content .page-nav-actions {
  margin-top: 40px;
}

/* ===== API Doc ===== */
.api-endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 16px 0 24px;
  flex-wrap: wrap;
}

.api-endpoint code {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 14px;
  color: var(--text);
  background: none;
  padding: 0;
}

.method {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.method.post {
  background: #dbeafe;
  color: #1d4ed8;
}

.api-table th {
  width: auto;
  white-space: normal;
  font-size: 13px;
}

.api-table td {
  font-size: 13px;
  color: var(--text-muted);
  vertical-align: top;
}

.api-table td:first-child {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.doc-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin: 20px 0 12px;
}

.doc-list-num {
  margin: 12px 0 20px 20px;
  color: var(--text-muted);
  line-height: 1.8;
}

.doc-list-num li {
  margin-bottom: 6px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .tech-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-inner {
    flex-direction: column;
  }

  .footer-links {
    gap: 40px;
  }

  .highlights-row {
    grid-template-columns: 1fr;
  }

  .fn-table th:first-child {
    width: 100px;
  }

  .fn-module {
    font-size: 13px;
  }

  .doc-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .doc-sidebar {
    position: static;
  }

  .doc-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    transition: all var(--transition);
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .hero-stats {
    gap: 32px;
  }

  .section {
    padding: 70px 0;
  }

  .cta-box {
    padding: 40px 24px;
  }
}

@media (max-width: 480px) {
  .hero-stats {
    flex-direction: column;
    gap: 20px;
  }
}
