/* ============================================
   BLOG.PRO — Design System
   Deep/Light mode, Glassmorphism, Responsive
   ============================================ */

/* ── CSS Variables ── */
:root,
:root[data-theme="dark"] {
  --bg: #0b0f19;
  --bg-alt: #111827;
  --surface: #1e293b;
  --surface-hover: #263348;
  --card-bg: rgba(30, 41, 59, 0.55);
  --card-border: rgba(148, 163, 184, 0.12);
  --card-border-hover: rgba(59, 130, 246, 0.5);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.25);
  --accent-subtle: rgba(59, 130, 246, 0.08);
  --gradient-start: rgba(59, 130, 246, 0.06);
  --border: rgba(148, 163, 184, 0.1);
  --nav-bg: rgba(11, 15, 25, 0.62);
  --hero-overlay: rgba(11, 15, 25, 0.85);
  --footer-bg: #070a11;
  --scrollbar-thumb: #334155;
  --scrollbar-track: #0f172a;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

:root[data-theme="light"] {
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(148, 163, 184, 0.2);
  --card-border-hover: rgba(37, 99, 235, 0.5);
  --text: #1e293b;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --accent-glow: rgba(37, 99, 235, 0.15);
  --accent-subtle: rgba(37, 99, 235, 0.06);
  --gradient-start: rgba(37, 99, 235, 0.04);
  --border: rgba(148, 163, 184, 0.25);
  --nav-bg: rgba(248, 250, 252, 0.68);
  --hero-overlay: rgba(248, 250, 252, 0.88);
  --footer-bg: #f1f5f9;
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-track: #f1f5f9;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(
    160deg,
    var(--gradient-start) 0%,
    var(--bg) 50%,
    var(--bg) 100%
  );
  z-index: -1;
  pointer-events: none;
}

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

a:hover {
  color: var(--accent-hover);
}

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

h1,
h2,
h3,
h4 {
  line-height: 1.3;
  font-weight: 700;
  color: var(--text);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  color: var(--text-muted);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

/* ── Container ── */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 64px;
  background: var(--nav-bg);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.nav-brand:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* ── Hero ── */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 50% at 50% 0%,
    var(--accent-glow) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 100px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.hero-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.hero-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

.subtitle {
  max-width: 640px;
  margin: 0 auto 32px;
  font-size: 1.1rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s;
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* ── Sections ── */
.section {
  padding: 72px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header p {
  max-width: 560px;
  margin: 12px auto 0;
}

.section-label {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 100px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.03em;
}

/* ── Grid ── */
.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);
}

/* ── Card ── */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--card-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.card h3 {
  margin-bottom: 8px;
}

.card p {
  font-size: 0.925rem;
  line-height: 1.7;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

.card-link:hover {
  color: var(--accent-hover);
}

/* Card variant: centered */
.card-centered {
  text-align: center;
}

.card-centered .card-icon {
  margin: 0 auto 16px;
}

.card-centered img {
  margin: 0 auto 16px;
  border-radius: 12px;
}

/* ── Feature List ── */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.2s;
}

.feature-item:hover {
  border-color: var(--card-border-hover);
  background: var(--surface-hover);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.feature-item h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.feature-item p {
  font-size: 0.875rem;
}

/* ── Table ── */
.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.vps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.vps-table thead {
  background: var(--accent);
  color: #fff;
}

.vps-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vps-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.vps-table tbody tr {
  transition: background 0.15s;
}

.vps-table tbody tr:hover {
  background: var(--accent-subtle);
}

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

.price-tag {
  color: var(--accent);
  font-weight: 700;
}

.badge-new {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--success);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── Tags / Badges ── */
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.12);
}

.tag-success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.15);
}

.tag-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.15);
}

/* ── Timeline ── */
.timeline {
  position: relative;
  padding-left: 40px;
  max-width: 720px;
  margin: 0 auto;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 40px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.timeline-year {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 100px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.timeline-item h3 {
  margin-bottom: 6px;
}

.timeline-item p {
  font-size: 0.9rem;
}

/* ── Footer ── */
.footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  padding: 32px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
}

.footer-brand p {
  font-size: 0.875rem;
  margin-top: 12px;
  line-height: 1.7;
}

.footer h4 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer-links li {
  margin: 0;
  padding: 2px 0;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.2s;
}

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

.footer-bottom {
  margin-top: 24px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ── Preview / Screenshot ── */
.preview-img {
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.preview-img img {
  width: 100%;
  display: block;
}

/* ── Copy Button ── */
.copy-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: "Fira Code", "Cascadia Code", "JetBrains Mono", monospace;
  font-size: 0.875rem;
}

.copy-box code {
  flex: 1;
  color: var(--text);
  overflow-x: auto;
  white-space: nowrap;
}

.copy-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.copy-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* ── Quick Jump Anchors ── */
.anchor-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 40px;
}

/* ── Split Hero (About page) ── */
.hero-split {
  text-align: left;
  padding: 60px 0;
}

.hero-split .container {
  display: flex;
  align-items: center;
  gap: 40px;
}

.hero-split .hero-avatar {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.hero-split .hero-info {
  flex: 1;
}

.hero-split .hero-actions {
  justify-content: flex-start;
}

/* ── Responsive: Tablet (≤1024px) ── */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .scripts-preview-grid {
    grid-template-columns: 1fr 1fr !important;
  }

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

  .container {
    padding: 0 20px;
  }
}

/* ── Responsive: Nav Collapse (≤960px) ── */
@media (max-width: 960px) {
  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(22px) saturate(1.25);
    -webkit-backdrop-filter: blur(22px) saturate(1.25);
    border: 1px solid var(--border);
    border-radius: 12px;
    flex-direction: column;
    padding: 8px;
    gap: 4px;
    min-width: 160px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 10px 16px;
    width: 100%;
    border-radius: 10px;
  }
}

/* ── Responsive: Mobile (≤768px) ── */
@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .scripts-preview-grid {
    grid-template-columns: 1fr !important;
  }

  .hero {
    padding: 48px 0 32px;
  }

  .hero-avatar {
    width: 72px;
    height: 72px;
  }

  .subtitle {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 24px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .section {
    padding: 40px 0;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .section-header h2 {
    font-size: 1.4rem;
  }

  .card {
    padding: 20px;
  }

  .card h3 {
    font-size: 1.1rem;
  }

  .container {
    padding: 0 16px;
  }

  .copy-box {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .copy-box code {
    text-align: center;
    padding: 8px 0;
  }

  .copy-btn {
    width: 100%;
    text-align: center;
  }

  .footer {
    display: none;
  }

  .timeline {
    padding-left: 28px;
  }

  .timeline::before {
    left: 8px;
  }

  .timeline-item::before {
    left: -25px;
    width: 10px;
    height: 10px;
  }

  .anchor-row {
    gap: 6px;
  }

  .anchor-row .btn-sm {
    font-size: 0.75rem;
    padding: 5px 10px;
  }

  .feature-item {
    padding: 14px;
    gap: 12px;
  }

  .feature-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  /* Table → card on mobile */
  .vps-table thead {
    display: none;
  }

  .vps-table tbody tr {
    display: block;
    padding: 16px;
    border-bottom: 1px solid var(--border);
  }

  .vps-table td {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: none;
  }

  .vps-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text);
    font-size: 0.8rem;
  }
}
