:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface-hover: #f8f9fb;
  --text: #1a1a2e;
  --text-secondary: #5a6270;
  --primary: #0d47a1;
  --primary-light: #1565c0;
  --accent: #00acc1;
  --accent-light: #4fc3f7;
  --border: #e2e5ea;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 10px;
  --max-width: 960px;
  --header-bg: #0d1b2a;
  --header-text: #b0bec5;
  --success: #2e7d32;
  --warning: #f57c00;
  --danger: #c62828;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Header --- */

header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

header strong {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

header strong::before {
  content: "\1F6E1";
  font-size: 1.3rem;
}

nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--header-text);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  transition: all 0.2s;
}

nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

nav a:first-child {
  color: var(--accent-light);
}

/* --- Main --- */

main {
  flex: 1;
  max-width: var(--max-width);
  margin: 2.5rem auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* --- Hero (index) --- */

.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.hero .description {
  max-width: 700px;
  margin: 1rem auto 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

/* --- Generic page title --- */

.page-title {
  margin-bottom: 1.5rem;
}

.page-title h1 {
  font-size: 2.2rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.page-title .subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-top: 0.25rem;
}

/* --- Cards --- */

.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

@media (max-width: 700px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 0;
}

.card .card-link {
  margin-top: 0.75rem;
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-light);
  text-decoration: none;
}

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

/* --- Notice --- */

.notice {
  background: #e8eaf6;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.7;
}

.notice a {
  color: var(--primary-light);
  font-weight: 600;
}

/* --- Section titles --- */

.section-title {
  font-size: 1.3rem;
  color: var(--primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

h4 {
  font-size: 1rem;
  color: var(--primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

/* --- Badges --- */

.badge-ok {
  color: var(--success);
  font-weight: 700;
}

.badge-todo {
  color: var(--warning);
  font-weight: 700;
}

.badge-sec {
  color: var(--danger);
  font-weight: 700;
}

/* --- Architecture page: resource items --- */

.resource-list {
  list-style: none;
  padding: 0;
}

.resource-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.resource-list li:last-child {
  border-bottom: none;
}

.resource-list .label {
  font-weight: 600;
  color: var(--text);
  min-width: 8rem;
}

.resource-list .desc {
  color: var(--text-secondary);
}

/* --- VLAN table --- */

.vlan-list {
  list-style: none;
  padding: 0;
}

.vlan-list li {
  padding: 0.45rem 0;
  font-size: 0.95rem;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.vlan-list li:last-child {
  border-bottom: none;
}

.vlan-list .vlan-id {
  display: inline-block;
  min-width: 5rem;
  font-weight: 700;
  color: var(--primary);
}

.vlan-list .vlan-cidr {
  display: inline-block;
  min-width: 10rem;
  color: var(--text-secondary);
}

/* --- Roadmap cards --- */

.roadmap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.roadmap-card:hover {
  box-shadow: var(--shadow-md);
}

.roadmap-card h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.roadmap-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  line-height: 1.6;
}

/* --- Security page --- */

.security-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 1.25rem 0.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.security-block h3 {
  font-size: 1rem;
  color: var(--primary);
  padding-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.security-block p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 0;
}

/* --- Links --- */

a {
  color: var(--primary-light);
  transition: color 0.2s;
}

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

/* --- Footer --- */

footer {
  background: var(--header-bg);
  color: #546e7a;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* --- Responsive --- */

@media (max-width: 640px) {
  header {
    height: auto;
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  nav {
    gap: 0.15rem;
  }

  nav a {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .resource-list li {
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.6rem 0;
  }

  .resource-list .label {
    min-width: auto;
  }

  .vlan-list .vlan-id {
    min-width: auto;
  }

  .vlan-list .vlan-cidr {
    min-width: auto;
  }
}

/* --- Mermaid diagram --- */

.mermaid {
  background: transparent;
  font-family: 'Inter', system-ui, sans-serif;
  text-align: center;
}

.mermaid .cluster-label span {
  font-weight: 700 !important;
  font-size: 14px !important;
  color: #1a1a2e !important;
}

.mermaid .edgeLabel {
  color: #1a1a2e !important;
  background-color: #ffffff !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 4px !important;
  padding: 2px 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}