:root {
  --background: #ffffff;
  --foreground: #0d1117;
  --accent: #f59e0b;
  --accent-600: #d97706;
  --accent-bg: rgba(245, 158, 11, 0.1);
  --muted: #64748b;
  --border: #e6e8ec;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-400: #90a1b9;
  --slate-500: #62748e;
  --slate-600: #45556c;
  --slate-700: #314158;
  --slate-900: #0f172b;
}

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

html, body {
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.container-page {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
}

.nav-bar {
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}

.brand-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--slate-600);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--foreground);
  font-weight: 500;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-drawer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 14px 20px;
  flex-direction: column;
  gap: 10px;
  font-size: 14.5px;
  color: var(--slate-700);
}

.mobile-drawer a {
  padding: 8px 4px;
  display: block;
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-dark {
  background: var(--foreground);
  color: #fff;
}

.btn-dark:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-600);
}

.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--foreground);
}

.btn-outline:hover:not(:disabled) {
  background: var(--slate-50);
}

.btn-soft {
  background: var(--accent-bg);
  color: var(--accent-600);
  padding: 6px 12px;
}

.btn-soft:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.2);
}

.hero-section {
  position: relative;
  overflow: hidden;
  padding: 80px 0 96px;
  text-align: center;
}

.hero-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(90deg, rgba(15,23,42,0.05) 1px, transparent 1px),
                    linear-gradient(rgba(15,23,42,0.05) 1px, transparent 1px);
  background-size: 38px 38px;
  -webkit-mask-image: radial-gradient(75% 55% at 50% 0, #000 35%, transparent 78%);
  mask-image: radial-gradient(75% 55% at 50% 0, #000 35%, transparent 78%);
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-600);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-title {
  max-width: 760px;
  margin: 24px auto 0;
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.hero-sub {
  max-width: 580px;
  margin: 20px auto 0;
  font-size: 18px;
  color: var(--slate-600);
}

.terminal-card {
  max-width: 680px;
  margin: 52px auto 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0d1117;
  text-align: left;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.12);
  overflow: hidden;
}

.terminal-top {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 12px 16px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-pre {
  padding: 20px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #f1f5f9;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.section-gray {
  border-top: 1px solid var(--border);
  background: var(--slate-50);
  padding: 76px 0;
}

.section-white {
  padding: 76px 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 44px;
}

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

.grid-form-2 {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
}

.card {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 24px;
  min-width: 0;
}

.card-highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 10px 15px -3px rgba(0,0,0,0.08);
}

.feature-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--slate-700);
}

.form-input, .form-select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent);
}

.seg-group {
  display: flex;
  gap: 8px;
}

.seg-btn {
  flex: 1;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--slate-600);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.seg-btn:hover {
  background: var(--slate-50);
}

.seg-btn.active {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent-600);
  font-weight: 500;
}

.file-input::file-selector-button {
  margin-right: 12px;
  border-radius: 8px;
  border: 0;
  background: var(--accent-bg);
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent-600);
  cursor: pointer;
}

.prog-track {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: var(--slate-100);
  overflow: hidden;
  margin-top: 6px;
}

.prog-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.15s;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

table.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
  min-width: 580px;
}

table.clean-table th {
  background: var(--slate-50);
  color: var(--slate-500);
  font-weight: 500;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.clean-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--slate-700);
}

table.clean-table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  border-radius: 99px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-green { background: #ecfdf5; color: #059669; }
.badge-amber { background: #fffbeb; color: #d97706; }
.badge-gray { background: var(--slate-100); color: var(--slate-500); }
.badge-red { background: #fef2f2; color: #dc2626; }

.docs-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 36px;
  padding: 44px 0;
}

.docs-nav {
  position: sticky;
  top: 88px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--slate-600);
}

.docs-nav a {
  padding: 6px 10px;
  border-radius: 6px;
}

.docs-nav a:hover {
  background: var(--slate-100);
  color: var(--foreground);
}

.docs-mobile-pills {
  display: none;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.docs-mobile-pills a {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--slate-100);
  font-size: 13px;
  color: var(--slate-700);
}

.docs-block {
  margin-bottom: 48px;
  min-width: 0;
}

.docs-block h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.docs-block h3 {
  font-size: 16.5px;
  font-weight: 600;
  margin: 18px 0 8px;
  color: var(--slate-900);
}

.docs-block p, .docs-block li {
  color: var(--slate-600);
  font-size: 14.5px;
  margin: 8px 0;
  line-height: 1.65;
}

.code-dark {
  background: #0d1117;
  color: #f1f5f9;
  padding: 16px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 12px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.skill-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--slate-50);
  padding: 20px;
  margin: 16px 0;
}

footer.site-footer {
  border-top: 1px solid var(--border);
  background: var(--slate-50);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 48px 0;
  font-size: 14px;
}

.footer-col ul {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--slate-500);
}

.footer-col a:hover {
  color: var(--foreground);
}

.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-top: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-item {
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--slate-500);
  cursor: pointer;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-item.active {
  border-bottom-color: var(--accent);
  color: var(--accent-600);
}

/* ==================== Mobile Responsive Optimization ==================== */
@media (max-width: 820px) {
  .container-page {
    padding: 0 16px;
  }
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .hero-section {
    padding: 48px 0 56px;
  }
  .hero-title {
    font-size: 32px;
  }
  .hero-sub {
    font-size: 15.5px;
  }
  .section-gray, .section-white {
    padding: 48px 0;
  }
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .grid-form-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .card {
    padding: 18px 16px;
  }
  .seg-group {
    flex-direction: column;
  }
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px 0;
  }
  .docs-nav {
    display: none;
  }
  .docs-mobile-pills {
    display: flex;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 32px 0;
  }
  .form-input, .form-select {
    font-size: 16px; /* Prevents iOS Safari auto-zoom on focus */
  }
}
