:root {
  --color-primary: #1a73e8;
  --color-primary-dark: #1557b0;
  --color-success: #188038;
  --color-success-bg: #e6f4ea;
  --color-danger: #c5221f;
  --color-danger-bg: #fce8e6;
  --color-bg: #f8f9fa;
  --color-surface: #ffffff;
  --color-text: #202124;
  --color-text-secondary: #5f6368;
  --color-border: #dadce0;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --max-width: 1120px;
}

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

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page-wrapper { min-height: 100vh; display: flex; flex-direction: column; }

/* ===== Header ===== */
.page-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.page-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.back-link:hover { background: rgba(26, 115, 232, 0.08); }
.page-header h1 { font-size: 18px; font-weight: 600; }

.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
  flex: 1;
}

/* ===== Homepage ===== */
.hero { text-align: center; padding: 64px 24px 48px; }
.hero h1 { font-size: 40px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 12px; }
.hero p { font-size: 18px; color: var(--color-text-secondary); max-width: 600px; margin: 0 auto; }

.demo-section { max-width: var(--max-width); margin: 0 auto 48px; padding: 0 24px; }
.demo-section h2 { font-size: 24px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.demo-section > p { color: var(--color-text-secondary); margin-bottom: 24px; }

.demo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.demo-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.demo-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.demo-card h3 { font-size: 18px; font-weight: 600; color: var(--color-primary); }
.demo-card p { color: var(--color-text-secondary); font-size: 14px; flex: 1; }
.demo-card .card-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 100px; font-weight: 500; }
.tag-keyboard { background: #e8f0fe; color: #1967d2; }
.tag-aria { background: #fce8e6; color: #c5221f; }
.tag-shadow-dom { background: #e6f4ea; color: #188038; }
.tag-i18n { background: #fef7e0; color: #e37400; }

/* ===== Demo Page ===== */
.demo-description {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}
.demo-description h2 { font-size: 20px; margin-bottom: 8px; }
.demo-description p { color: var(--color-text-secondary); font-size: 15px; }

.demo-area {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}
.demo-area-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}
.demo-area-header h3 { font-size: 15px; font-weight: 600; }
.demo-area-body { padding: 0; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
}
.status-badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.status-badge-success { background: var(--color-success-bg); color: var(--color-success); }

/* ===== Instructions ===== */
.instructions {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}
.instructions h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.instructions ol { padding-left: 24px; }
.instructions li { margin-bottom: 8px; font-size: 15px; color: var(--color-text-secondary); }
kbd {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--color-border);
  margin: 0 2px;
}

/* ===== Inaccessible Nav ===== */
.inaccessible-nav {
  background: #1a1a2e;
  padding: 0 24px;
  display: flex;
  align-items: center;
  min-height: 56px;
}
.inaccessible-nav .nav-logo {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  margin-right: 32px;
  text-decoration: none;
}
.inaccessible-nav ul { list-style: none; display: flex; gap: 0; margin: 0; padding: 0; }
.inaccessible-nav > ul > li { position: relative; }
.inaccessible-nav a,
.inaccessible-nav span.nav-label {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 16px 18px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
  white-space: nowrap;
  cursor: pointer;
}
.inaccessible-nav a:hover,
.inaccessible-nav span.nav-label:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.inaccessible-nav .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #16213e;
  min-width: 220px;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}
.inaccessible-nav li:hover > .dropdown { display: block; }
.inaccessible-nav .dropdown li { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.inaccessible-nav .dropdown li:last-child { border-bottom: none; }
.inaccessible-nav .dropdown a,
.inaccessible-nav .dropdown span.nav-label { padding: 12px 18px; font-size: 13px; }
.inaccessible-nav .dropdown .dropdown { left: 100%; top: 0; border-radius: 0 8px 8px 0; }

/* ===== Inaccessible Carousel ===== */
.inaccessible-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #000;
  aspect-ratio: 16/7;
  max-height: 420px;
}
.carousel-track { display: flex; transition: transform 0.5s ease; height: 100%; }
.carousel-slide {
  min-width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-slide-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 32px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: #fff;
}
.carousel-slide-content h3 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.carousel-slide-content p { font-size: 16px; opacity: 0.9; }

.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  border: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: background 0.15s;
  z-index: 2;
  color: #333;
}
.carousel-nav-btn:hover { background: #fff; }
.carousel-prev { left: 16px; }
.carousel-next { right: 16px; }

.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}
.carousel-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}
.carousel-dot.active { background: #fff; }

/* ===== Content Carousel ===== */
.content-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #e0e7ff 0%, #f0e6ff 100%);
  min-height: 400px;
}
.content-carousel .carousel-track { min-height: 400px; }
.content-slide {
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.content-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-width: 600px;
  width: 100%;
  overflow: hidden;
}
.content-card-image {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
}
.content-card-body { padding: 24px; }
.content-card-body h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.content-card-body p { color: var(--color-text-secondary); font-size: 14px; margin-bottom: 16px; }
.promo-badge {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}
.promo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
  border: none;
  cursor: pointer;
}
.promo-btn:hover { background: var(--color-primary-dark); }

/* ===== Fix Code Block ===== */
.fix-code {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}
.fix-code h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fix-code p {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}
.fix-code-block {
  position: relative;
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
}
.fix-code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #cdd6f4;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.15s;
}
.fix-code-copy:hover { background: rgba(255, 255, 255, 0.2); }

/* ===== Footer ===== */
.page-footer {
  border-top: 1px solid var(--color-border);
  padding: 24px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 13px;
  margin-top: auto;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-section h2 { font-size: 20px; }
  .inaccessible-nav { flex-wrap: wrap; }
  .carousel-slide-content h3 { font-size: 20px; }
}
