/* ikeriri Design System v2 — Wireshark-inspired */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;700&display=swap');

/* ── Light (default) ── */
:root {
  --ik-bg: #f5f7fa;
  --ik-surface: #ffffff;
  --ik-card: #ffffff;
  --ik-border: #dce3ed;
  --ik-primary: #1a5276;
  --ik-primary-light: #2980b9;
  --ik-accent: #27ae60;
  --ik-accent-hover: #219a52;
  --ik-text: #2c3e50;
  --ik-text-muted: #7f8c8d;
  --ik-heading: #1a252f;
  --ik-link: #2471a3;
  --ik-link-hover: #1a5276;
  --ik-header-bg: #2c3e50;
  --ik-header-text: #ecf0f1;
  --ik-header-link: #bdc3c7;
  --ik-header-link-hover: #ffffff;
  --ik-hero-bg: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
  --ik-hero-text: #ecf0f1;
  --ik-footer-bg: #2c3e50;
  --ik-footer-text: #bdc3c7;
  --ik-nav-bg: rgba(255,255,255,0.08);
  --ik-nav-active: #3498db;
  --ik-card-shadow: 0 2px 8px rgba(0,0,0,0.06);
  --ik-card-hover-shadow: 0 8px 24px rgba(0,0,0,0.1);
  --ik-badge-blue: #2980b9;
  --ik-badge-green: #27ae60;
  --ik-badge-red: #e74c3c;
  --ik-radius: 8px;
  --ik-radius-lg: 12px;
  --ik-transition: 0.25s ease;
}

/* ── Dark mode ── */
[data-theme="dark"] {
  --ik-bg: #1a1a2e;
  --ik-surface: #16213e;
  --ik-card: #1f2937;
  --ik-border: #374151;
  --ik-primary: #3498db;
  --ik-primary-light: #5dade2;
  --ik-accent: #2ecc71;
  --ik-accent-hover: #27ae60;
  --ik-text: #e5e7eb;
  --ik-text-muted: #9ca3af;
  --ik-heading: #f3f4f6;
  --ik-link: #5dade2;
  --ik-link-hover: #85c1e9;
  --ik-header-bg: #0f172a;
  --ik-header-text: #e5e7eb;
  --ik-header-link: #9ca3af;
  --ik-header-link-hover: #ffffff;
  --ik-hero-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  --ik-hero-text: #e5e7eb;
  --ik-footer-bg: #0f172a;
  --ik-footer-text: #9ca3af;
  --ik-nav-bg: rgba(255,255,255,0.06);
  --ik-nav-active: #5dade2;
  --ik-card-shadow: 0 2px 8px rgba(0,0,0,0.3);
  --ik-card-hover-shadow: 0 8px 24px rgba(0,0,0,0.4);
  --ik-badge-blue: #5dade2;
  --ik-badge-green: #2ecc71;
  --ik-badge-red: #e74c3c;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; padding: 0;
  font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--ik-bg);
  color: var(--ik-text);
  line-height: 1.7;
  transition: background var(--ik-transition), color var(--ik-transition);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ik-link); text-decoration: none; transition: color var(--ik-transition); }
a:hover { color: var(--ik-link-hover); }
img { max-width: 100%; height: auto; }

/* ── Header ── */
#ik-header, #rt-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--ik-header-bg);
  border-bottom: 3px solid var(--ik-primary-light);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transition: background var(--ik-transition);
}
.ik-header-inner, .rt-header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem;
}
.ik-logo, .rt-logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1.1rem; font-weight: 700;
  color: var(--ik-header-text); text-decoration: none;
}
.ik-logo img, .rt-logo img {
  height: 36px; width: auto;
}

/* ── Navigation ── */
.ik-nav-wrap {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.ik-nav {
  display: flex; gap: 0.25rem; flex-wrap: wrap;
  list-style: none; margin: 0; padding: 0;
}
.ik-nav a, .rt-fallback-nav a {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  background: var(--ik-nav-bg);
  color: var(--ik-header-link) !important;
  font-size: 0.8rem; font-weight: 500;
  text-decoration: none;
  transition: all var(--ik-transition);
  border: 1px solid transparent;
}
.ik-nav a:hover, .ik-nav a.active, .rt-fallback-nav a:hover {
  background: var(--ik-nav-active);
  color: #fff !important;
  border-color: var(--ik-nav-active);
}

/* Hamburger (mobile) */
.ik-hamburger {
  display: none; background: none; border: none;
  color: var(--ik-header-text); font-size: 1.5rem;
  cursor: pointer; padding: 0.25rem;
}
@media (max-width: 768px) {
  .ik-hamburger { display: block; }
  .ik-nav { display: none; width: 100%; flex-direction: column; gap: 0.25rem; }
  .ik-nav.open { display: flex; }
  .ik-nav a { width: 100%; text-align: center; }
}

/* ── Theme toggle ── */
.ik-theme-toggle {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--ik-header-link);
  cursor: pointer; font-size: 0.8rem;
  transition: all var(--ik-transition);
  user-select: none;
}
.ik-theme-toggle:hover {
  border-color: var(--ik-nav-active);
  color: #fff; background: rgba(255,255,255,0.12);
}

/* ── Hero Section ── */
.ik-hero {
  background: var(--ik-hero-bg);
  color: var(--ik-hero-text);
  padding: 3rem 1.5rem;
  text-align: center;
  position: relative;
  transition: background var(--ik-transition);
}
.ik-hero h1 {
  font-size: 2rem; font-weight: 700;
  margin: 0 0 0.5rem;
  background: linear-gradient(135deg, #5dade2, #2ecc71);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ik-hero p { color: rgba(255,255,255,0.8); max-width: 700px; margin: 0 auto; font-size: 0.95rem; }

/* ── Main container ── */
.ik-main, .rt-main {
  max-width: 1200px; margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

/* ── Breadcrumb ── */
.ik-breadcrumb, .rt-breadcrumb {
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--ik-surface);
  border: 1px solid var(--ik-border);
  border-radius: var(--ik-radius);
  font-size: 0.8rem; color: var(--ik-text-muted);
}
.ik-breadcrumb a { color: var(--ik-link); }

/* ── Language switch ── */
.ik-lang-switch, .rt-lang-switch {
  text-align: right; margin-bottom: 0.5rem;
  font-size: 0.8rem; color: var(--ik-text-muted);
}

/* ── Cards ── */
.ik-card, .rt-content {
  background: var(--ik-card);
  border: 1px solid var(--ik-border);
  border-radius: var(--ik-radius-lg);
  padding: 1.25rem;
  box-shadow: var(--ik-card-shadow);
  transition: all var(--ik-transition);
  overflow-x: auto;
}
.ik-card:hover {
  border-color: var(--ik-primary-light);
  box-shadow: var(--ik-card-hover-shadow);
  transform: translateY(-2px);
}
.ik-card h3 {
  font-size: 1rem; font-weight: 600;
  margin: 0 0 0.4rem; color: var(--ik-heading);
}
.ik-card p { font-size: 0.85rem; color: var(--ik-text-muted); margin: 0; }

/* Grid */
.ik-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}

/* ── Section titles ── */
.ik-section-title {
  font-size: 1.25rem; font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  padding-left: 0.75rem;
  border-left: 4px solid var(--ik-primary-light);
  color: var(--ik-heading);
}

/* ── Badges ── */
.ik-badge {
  display: inline-block;
  font-size: 0.65rem; font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.ik-badge-blue { background: rgba(41,128,185,0.15); color: var(--ik-badge-blue); }
.ik-badge-green { background: rgba(39,174,96,0.15); color: var(--ik-badge-green); }
.ik-badge-red { background: rgba(231,76,60,0.15); color: var(--ik-badge-red); }

/* ── Tables ── */
.ik-table {
  width: 100%; border-collapse: collapse; margin-bottom: 1rem;
}
.ik-table th {
  text-align: left; padding: 0.6rem 0.75rem;
  background: var(--ik-primary);
  color: #fff;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.ik-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--ik-border);
  font-size: 0.85rem;
}
.ik-table tr:hover { background: rgba(41,128,185,0.04); }

/* ── Buttons ── */
.ik-btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: var(--ik-radius);
  border: none;
  font-weight: 600; font-size: 0.85rem;
  cursor: pointer; text-decoration: none;
  transition: all var(--ik-transition);
}
.ik-btn-primary {
  background: var(--ik-primary-light);
  color: #fff;
}
.ik-btn-primary:hover {
  background: var(--ik-primary);
  color: #fff;
}
.ik-btn-outline {
  background: transparent;
  border: 1px solid var(--ik-border);
  color: var(--ik-text);
}
.ik-btn-outline:hover {
  border-color: var(--ik-primary-light);
  color: var(--ik-primary-light);
}

/* ── Footer ── */
#ik-footer, #rt-footer {
  background: var(--ik-footer-bg);
  color: var(--ik-footer-text);
  margin-top: 2rem;
  transition: background var(--ik-transition);
}
.ik-footer-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 2rem 1rem 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}
.ik-footer-inner h3 {
  font-size: 0.85rem; font-weight: 700;
  margin: 0 0 0.5rem;
  color: #fff;
  border-bottom: 2px solid var(--ik-primary-light);
  padding-bottom: 0.3rem;
}
.ik-footer-inner ul {
  list-style: none; margin: 0; padding: 0;
}
.ik-footer-inner li { margin-bottom: 0.3rem; }
.ik-footer-inner a {
  color: var(--ik-footer-text) !important;
  font-size: 0.8rem;
  transition: color var(--ik-transition);
}
.ik-footer-inner a:hover { color: #fff !important; }
.ik-footer-bottom {
  max-width: 1200px; margin: 0 auto;
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.5rem;
  font-size: 0.75rem;
}
.ik-footer-bottom a { color: var(--ik-footer-text) !important; }
.ik-footer-bottom a:hover { color: #fff !important; }

/* ── Back to top ── */
.ik-backtotop {
  position: fixed; right: 1rem; bottom: 1.5rem; z-index: 1200;
}
.ik-backtotop a, .rt-backtotop a {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ik-primary);
  color: #fff !important; text-decoration: none;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all var(--ik-transition);
}
.ik-backtotop a:hover, .rt-backtotop a:hover {
  background: var(--ik-primary-light);
  transform: translateY(-2px);
}

/* ── Legacy content overrides ── */
.legacy-content { overflow-x: auto; }
.legacy-content table {
  width: 100% !important; max-width: 100%;
  border-collapse: collapse; background: var(--ik-card);
}
.legacy-content td, .legacy-content th {
  border: 1px solid var(--ik-border) !important;
  padding: 8px; vertical-align: top;
}
.legacy-content img { max-width: 100%; height: auto; }
.legacy-content tr[bgcolor="#0033CC"] td,
.legacy-content tr[bgcolor="#0033cc"] td {
  background: var(--ik-primary) !important; color: #fff;
}

/* ── Stats row ── */
.ik-stats { display: flex; justify-content: center; gap: 2rem; margin: 1.5rem 0; flex-wrap: wrap; }
.ik-stat { text-align: center; }
.ik-stat-num { font-size: 1.8rem; font-weight: 700; color: var(--ik-accent); }
.ik-stat-label { font-size: 0.75rem; color: var(--ik-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Search box ── */
.ik-search-box {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
  background: var(--ik-card); border: 1px solid var(--ik-border);
  border-radius: var(--ik-radius-lg); padding: 1rem; margin-bottom: 1.5rem;
}
.ik-search-box input {
  flex: 1; min-width: 200px;
  padding: 0.5rem 0.75rem; border-radius: 6px;
  border: 1px solid var(--ik-border);
  background: var(--ik-bg); color: var(--ik-text);
  font-size: 0.9rem; outline: none;
  transition: border-color var(--ik-transition);
}
.ik-search-box input:focus { border-color: var(--ik-primary-light); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .ik-hero h1 { font-size: 1.4rem; }
  .ik-grid { grid-template-columns: 1fr; }
  .ik-footer-inner { grid-template-columns: repeat(2, 1fr); }
  .ik-header-inner, .rt-header-inner { padding: 0.5rem 0.75rem; }
  .ik-stats { gap: 1rem; }
}
@media (max-width: 480px) {
  .ik-footer-inner { grid-template-columns: 1fr; }
}

/* ── Utility ── */
.ik-text-center { text-align: center; }
.ik-mt-1 { margin-top: 0.5rem; }
.ik-mt-2 { margin-top: 1rem; }
.ik-mb-1 { margin-bottom: 0.5rem; }
.ik-mb-2 { margin-bottom: 1rem; }
