/* ============================================
   MECHS v3.1 — Gundam Mecha / Clean Tech
   高达机甲风 · 深蓝装甲 · 面板刻线 · 能量脉动

   Fonts: Orbitron (display) + Inter (body) + JetBrains Mono (code)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Orbitron:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ==========================================
   CSS VARIABLES — Gundam Palette
   ========================================== */
:root {
  /* Gundam Core Colors */
  --g-blue:        #1A5FB4;
  --g-blue-light:  #3584E4;
  --g-blue-dark:   #0D3B6F;
  --g-red:         #D32F2F;
  --g-red-light:   #EF5350;
  --g-yellow:      #F5A623;
  --g-yellow-dim:  #C4851A;
  --g-dark:         #0B1121;
  --g-dark-soft:    #1A2332;
  --g-armor:        #F3F5F9;
  --g-white:        #FFFFFF;
  --g-gray:         #64748B;
  --g-gray-light:   #94A3B8;
  --g-border:       #CBD5E1;
  --g-border-light: #E2E8F0;
  --g-mecha-line:   rgba(26,95,180,0.06);

  /* Semantic mappings */
  --color-primary:        var(--g-blue);
  --color-primary-light:  var(--g-blue-light);
  --color-primary-dark:   var(--g-blue-dark);
  --color-accent:         var(--g-red);
  --color-highlight:      var(--g-yellow);
  --color-bg:             var(--g-armor);
  --color-surface:        var(--g-white);
  --color-nav:            var(--g-dark);
  --color-nav-hover:      rgba(53,132,228,0.12);
  --color-text:           #1E293B;
  --color-text-secondary: #475569;
  --color-text-muted:     var(--g-gray-light);
  --color-text-inverse:   #E2E8F0;
  --color-border:         var(--g-border);
  --color-border-light:   var(--g-border-light);

  /* Code block — Tokyo Night Storm */
  --code-bg:       #1A1B26;
  --code-text:     #A9B1D6;
  --code-keyword:  #BB9AF7;
  --code-string:   #9ECE6A;
  --code-func:     #7AA2F7;
  --code-comment:  #565F89;
  --code-number:   #FF9E64;
  --code-op:       #89DDFF;
  --code-class:    #E0AF68;

  /* Spacing — Comfortable */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Typography */
  --font-display: 'Orbitron', ui-sans-serif, sans-serif;
  --font-body:    'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;

  /* Layout */
  --nav-height:    64px;
  --content-width: 960px;
  --content-wide:  1200px;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(11,17,33,0.06);
  --shadow-md:   0 4px 20px rgba(11,17,33,0.08);
  --shadow-lg:   0 8px 40px rgba(11,17,33,0.12);
  --shadow-blue: 0 0 0 1px rgba(26,95,180,0.1), 0 4px 16px rgba(26,95,180,0.08);

  /* Transitions */
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:      150ms;
  --dur-normal:    300ms;
  --dur-slow:      500ms;
}

/* ==========================================
   RESET & BASE
   ========================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  padding-top: calc(var(--nav-height) + var(--space-xl));
  position: relative;
  overflow-x: hidden;
}

/* ---- Background: Mecha Grid + Watermark ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  /* Mecha panel line grid */
  background-image:
    /* Horizontal panel lines */
    linear-gradient(to right, var(--g-mecha-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--g-mecha-line) 1px, transparent 1px),
    /* Thick mecha seam every 4 cells */
    linear-gradient(to right, rgba(26,95,180,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(26,95,180,0.03) 1px, transparent 1px);
  background-size:
    20px 20px,
    20px 20px,
    80px 80px,
    80px 80px;
  background-position:
    0 0,
    0 0,
    0 0,
    0 0;
}

/* ---- Gundam Silhouette Watermarks ---- */
body::after {
  content: '';
  position: fixed;
  z-index: -1;
  pointer-events: none;
  /* Top-right: large mecha silhouette */
  width: 500px;
  height: 500px;
  top: -60px;
  right: -120px;
  background:
    radial-gradient(ellipse at center, rgba(26,95,180,0.04) 0%, transparent 70%);
  border: 1px solid rgba(26,95,180,0.03);
  border-radius: 50%;
  transform: rotate(-12deg);
}

/* ==========================================
   ANIMATIONS
   ========================================== */
/* Panel unfold — cards enter with a mechanical feel */
@keyframes panelUnfold {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    clip-path: inset(0 0 100% 0);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    clip-path: inset(0 0 0 0);
  }
}

/* Scan line sweep */
@keyframes scanSweep {
  0%   { background-position: 0 -100%; }
  100% { background-position: 0 200%; }
}

/* Energy pulse ring */
@keyframes energyPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(26,95,180,0.3),
                0 0 0 0 rgba(26,95,180,0.15);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(26,95,180,0),
                0 0 0 12px rgba(26,95,180,0);
  }
}

/* Border glow — mecha power conduit */
@keyframes conduitFlow {
  0%   { border-color: var(--g-blue); opacity: 0.5; }
  50%  { border-color: var(--g-blue-light); opacity: 1; }
  100% { border-color: var(--g-blue); opacity: 0.5; }
}

/* Flicker — random mecha light */
@keyframes mechaFlicker {
  0%, 99.5%, 100% { opacity: 1; }
  99.6%, 99.8%    { opacity: 0.3; }
}

/* Float — subtle orbital hover */
@keyframes floatOrbit {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%      { transform: translateY(-3px) rotate(0.5deg); }
  66%      { transform: translateY(1px) rotate(-0.3deg); }
}

/* Glitch text shake */
@keyframes glitchShake {
  0%, 100% { transform: translate(0); }
  20%      { transform: translate(-1px, 1px); }
  40%      { transform: translate(1px, -1px); }
  60%      { transform: translate(-1px, 0); }
  80%      { transform: translate(1px, 1px); }
}

/* Staggered panel entry */
.animate-in {
  animation: panelUnfold var(--dur-slow) var(--ease-out) both;
}

.stagger-in > * { animation: panelUnfold var(--dur-slow) var(--ease-out) both; }
.stagger-in > *:nth-child(1) { animation-delay: 0ms; }
.stagger-in > *:nth-child(2) { animation-delay: 80ms; }
.stagger-in > *:nth-child(3) { animation-delay: 160ms; }
.stagger-in > *:nth-child(4) { animation-delay: 240ms; }
.stagger-in > *:nth-child(5) { animation-delay: 320ms; }
.stagger-in > *:nth-child(6) { animation-delay: 400ms; }

/* Scan line on hover */
.scan-hover {
  position: relative;
  overflow: hidden;
}
.scan-hover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(26,95,180,0.04) 45%,
    rgba(53,132,228,0.08) 50%,
    rgba(26,95,180,0.04) 55%,
    transparent 100%
  );
  background-size: 100% 200%;
  opacity: 0;
  transition: opacity var(--dur-normal);
  pointer-events: none;
  z-index: 2;
}
.scan-hover:hover::after {
  opacity: 1;
  animation: scanSweep 2s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================
   NAVIGATION — Dark Mecha Frame
   ========================================== */
.gundam-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-2xl);
  background: var(--color-nav);
  border-bottom: 2px solid var(--g-blue);
  box-shadow: 0 2px 20px rgba(11,17,33,0.3);
  transition: box-shadow var(--dur-normal);
}

/* Nav bottom energy conduit line */
.gundam-nav::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--g-blue) 15%,
    var(--g-blue-light) 40%,
    var(--g-yellow) 55%,
    var(--g-red) 75%,
    transparent 100%
  );
  opacity: 0.6;
}

.gundam-nav.scrolled {
  box-shadow: 0 4px 30px rgba(11,17,33,0.5);
}

/* Brand */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text-inverse);
}

.brand-icon {
  width: 34px; height: 34px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-icon::before {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--g-blue);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: background var(--dur-normal);
}
.brand-icon::after {
  content: 'M';
  position: relative; z-index: 1;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900; font-size: 15px;
}
.nav-brand:hover .brand-icon::before {
  background: var(--g-blue-light);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #E2E8F0;
  transition: color var(--dur-fast);
}
.brand-text span {
  font-weight: 400;
  color: var(--g-gray-light);
  letter-spacing: 0.04em;
}
.nav-brand:hover .brand-text {
  color: #fff;
}

/* Nav links */
.nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: #94A3B8;
  text-decoration: none;
  transition: all var(--dur-fast);
  position: relative;
}

.nav-links a:hover {
  color: #E2E8F0;
  background: var(--color-nav-hover);
}

.nav-links a.active {
  color: #fff;
  font-weight: 700;
  background: rgba(26,95,180,0.2);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  background: var(--g-yellow);
  border-radius: 50%;
}

/* User area */
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-profile-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 3px 14px 3px 3px;
  border-radius: 24px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all var(--dur-fast);
}
.nav-profile-link:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.18);
  text-decoration: none;
}

.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--g-blue), var(--g-blue-light));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 0.75rem; font-weight: 700;
  flex-shrink: 0;
}

.user-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: #CBD5E1;
  max-width: 100px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none;
  cursor: pointer; padding: 4px; z-index: 1001;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: #94A3B8;
  border-radius: 2px;
  transition: all var(--dur-fast);
}

/* ==========================================
   CONTENT CONTAINER
   ========================================== */
.gundam-main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-4xl);
  position: relative;
  z-index: 1;
}
.gundam-main.wide { max-width: var(--content-wide); }

/* ==========================================
   PANEL / CARD — Mecha Armor Plate
   ========================================== */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

/* Mecha panel: seam lines + corner studs */
.panel-mecha {
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-blue);
}

/* Panel seam — horizontal line at top, like armor plate joint */
.panel-mecha::before {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--g-blue) 20%,
    var(--g-blue-light) 50%,
    var(--g-blue) 80%,
    transparent 100%
  );
  opacity: 0.15;
}

/* Rivet studs at 4 corners */
.panel-mecha::after {
  content: '';
  position: absolute;
  inset: 6px;
  pointer-events: none;
  background:
    /* top-left */
    radial-gradient(circle 2px, var(--g-blue) 100%, transparent 0) 12px 12px,
    /* top-right */
    radial-gradient(circle 2px, var(--g-blue) 100%, transparent 0) calc(100% - 12px) 12px,
    /* bottom-left */
    radial-gradient(circle 2px, var(--g-blue) 100%, transparent 0) 12px calc(100% - 12px),
    /* bottom-right */
    radial-gradient(circle 2px, var(--g-blue) 100%, transparent 0) calc(100% - 12px) calc(100% - 12px);
  background-repeat: no-repeat;
  opacity: 0.18;
}

.panel:hover {
  border-color: var(--g-blue);
  box-shadow: 0 0 0 1px rgba(26,95,180,0.15), 0 8px 32px rgba(26,95,180,0.1);
}
.panel-mecha:hover {
  border-color: var(--g-blue);
  box-shadow: 0 0 0 1px rgba(26,95,180,0.2), 0 8px 32px rgba(26,95,180,0.12);
}

.panel + .panel { margin-top: var(--space-xl); }

/* Panel header */
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border-light);
}

.panel-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 10px;
}

/* Hexagonal bullet before title */
.panel-title::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--g-blue);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

/* ==========================================
   STAT CARDS — Dashboard
   ========================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  transition: all var(--dur-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 40px;
  background: var(--g-blue);
  border-radius: 0 0 3px 0;
  opacity: 0.5;
  transition: height var(--dur-normal), opacity var(--dur-normal);
}

.stat-card:hover {
  border-color: var(--g-blue);
  box-shadow: var(--shadow-blue);
  transform: translateY(-2px);
}
.stat-card:hover::before {
  height: 100%;
  opacity: 0.8;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--g-blue);
  line-height: 1;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ==========================================
   PROJECT CARDS
   ========================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  transition: all var(--dur-normal) var(--ease-out);
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
}

/* Hexagon accent on project card */
.project-card::after {
  content: '';
  position: absolute;
  bottom: 16px; right: 16px;
  width: 20px; height: 20px;
  border: 1px solid var(--color-border);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  opacity: 0;
  transition: all var(--dur-normal);
}

.project-card:hover {
  border-color: var(--g-blue);
  box-shadow: var(--shadow-blue);
  transform: translateY(-2px);
}
.project-card:hover::after {
  opacity: 0.4;
  border-color: var(--g-blue);
}

.project-card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.project-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ==========================================
   TYPOGRAPHY
   ========================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text);
  line-height: 1.3;
  font-weight: 600;
}
h1 { font-size: var(--text-4xl); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: var(--text-3xl); font-weight: 700; }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

.page-header {
  margin-bottom: var(--space-2xl);
  animation: panelUnfold var(--dur-slow) var(--ease-out);
}
.page-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: var(--text-4xl);
  color: var(--g-dark);
  margin-bottom: var(--space-sm);
}
.page-header p {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 600px;
  line-height: 1.6;
}

a {
  color: var(--g-blue);
  text-decoration: none;
  transition: color var(--dur-fast);
}
a:hover { color: var(--g-blue-dark); }

p { margin-bottom: var(--space-md); color: var(--color-text-secondary); }

.section-divider {
  height: 1px;
  background: var(--color-border-light);
  margin: var(--space-3xl) 0;
  position: relative;
}
.section-divider::after {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 1px;
  background: var(--g-blue);
  opacity: 0.3;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm); font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-spring);
  line-height: 1; white-space: nowrap;
  text-decoration: none;
}
.btn:focus-visible {
  outline: 2px solid var(--g-blue);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--g-blue); color: #fff;
}
.btn-primary:hover {
  background: var(--g-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26,95,180,0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: #94A3B8;
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-outline:hover {
  color: #E2E8F0;
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
}

.btn-ghost {
  background: transparent; color: var(--color-text-secondary);
}
.btn-ghost:hover { background: var(--g-mecha-line); }

.btn-danger { background: var(--g-red); color: #fff; }
.btn-danger:hover { background: #B71C1C; }

.btn-sm { padding: 6px 14px; font-size: var(--text-xs); }
.btn-lg { padding: 14px 28px; font-size: var(--text-base); }

/* ==========================================
   FORMS
   ========================================== */
.form-group { margin-bottom: var(--space-lg); }
.form-label {
  display: block;
  font-size: var(--text-sm); font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--g-blue);
  box-shadow: 0 0 0 3px rgba(26,95,180,0.1);
}
.form-input::placeholder { color: var(--color-text-muted); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-help { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-xs); }
.form-error { font-size: var(--text-xs); color: var(--g-red); margin-top: var(--space-xs); }

/* ==========================================
   CODE BLOCKS
   ========================================== */
code:not(pre code) {
  padding: 2px 6px; border-radius: 4px;
  background: #F1F5F9; color: var(--g-blue-dark);
  font-family: var(--font-mono); font-size: 0.9em;
  border: 1px solid var(--color-border-light);
}

.code-block {
  position: relative;
  margin: var(--space-lg) 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--g-dark-soft);
  box-shadow: 0 4px 16px rgba(11,17,33,0.3);
}

.code-block-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: #161822;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.code-block-lang {
  font-size: var(--text-xs); font-weight: 600;
  color: var(--code-func);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-family: var(--font-display);
}
.code-block-dots { display: flex; gap: 6px; }
.code-block-dots span {
  width: 10px; height: 10px; border-radius: 50%;
}
.code-block-dots span:nth-child(1) { background: #FF5F56; }
.code-block-dots span:nth-child(2) { background: #FFBD2E; }
.code-block-dots span:nth-child(3) { background: #27C93F; }

.code-block-copy {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--code-text);
  font-size: var(--text-xs); padding: 4px 10px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--dur-fast);
  font-family: var(--font-body);
}
.code-block-copy:hover { background: rgba(255,255,255,0.14); color: #fff; }

.code-block pre {
  margin: 0; padding: var(--space-lg);
  background: var(--code-bg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem; line-height: 1.7;
}
.code-block pre code {
  background: transparent !important; border: none !important;
  padding: 0 !important; font-size: inherit; color: var(--code-text);
}

.token.comment, .token.prolog, .token.doctype, .token.cdata { color: var(--code-comment); font-style: italic; }
.token.punctuation { color: #7982A9; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: var(--code-number); }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: var(--code-string); }
.token.operator, .token.entity, .token.url { color: var(--code-op); }
.token.atrule, .token.attr-value, .token.keyword { color: var(--code-keyword); }
.token.function, .token.class-name { color: var(--code-func); }
.token.regex, .token.important, .token.variable { color: var(--code-class); }

/* ==========================================
   FLASH MESSAGES
   ========================================== */
.flash-messages { margin-bottom: var(--space-xl); }
.flash {
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: 500;
  margin-bottom: var(--space-sm);
  animation: panelUnfold var(--dur-normal) var(--ease-out);
  display: flex; align-items: center; gap: var(--space-sm);
}
.flash-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.flash-error, .flash-danger { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.flash-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.flash-info { background: #ECFEFF; color: #155E75; border: 1px solid #A5F3FC; }

/* ==========================================
   BADGES
   ========================================== */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 100px;
  font-size: var(--text-xs); font-weight: 600; line-height: 1.5;
}
.badge-primary { background: rgba(26,95,180,0.08); color: var(--g-blue); }
.badge-success { background: #ECFDF5; color: #065F46; }
.badge-warning { background: #FFFBEB; color: #92400E; }
.badge-danger  { background: #FEF2F2; color: #991B1B; }

/* ==========================================
   TABLES
   ========================================== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
}
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
thead { background: var(--g-armor); border-bottom: 2px solid var(--color-border); }
th {
  padding: 12px 16px; text-align: left;
  font-weight: 600; color: var(--color-text-secondary);
  font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: 0.05em; white-space: nowrap;
  font-family: var(--font-display);
}
td { padding: 12px 16px; border-bottom: 1px solid var(--color-border-light); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--g-mecha-line); }

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty-state {
  text-align: center; padding: var(--space-4xl) var(--space-xl);
  color: var(--color-text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: var(--space-lg); opacity: 0.2; }
.empty-state h3 { color: var(--color-text-secondary); margin-bottom: var(--space-sm); }

/* ==========================================
   MECHA DECORATION — Bracket Corners (page-level)
   ========================================== */
.page-brackets::before,
.page-brackets::after {
  content: ''; position: fixed; z-index: -1; pointer-events: none;
  opacity: 0.06;
}
.page-brackets::before {
  top: 32px; left: 32px;
  width: 32px; height: 32px;
  border-top: 2px solid var(--g-blue);
  border-left: 2px solid var(--g-blue);
}
.page-brackets::after {
  bottom: 32px; right: 32px;
  width: 32px; height: 32px;
  border-bottom: 2px solid var(--g-blue);
  border-right: 2px solid var(--g-blue);
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.text-muted     { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-primary   { color: var(--g-blue); }
.text-sm  { font-size: var(--text-sm); }
.text-xs  { font-size: var(--text-xs); }
.text-center { text-align: center; }
.font-mono    { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.w-full { width: 100%; }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
  :root {
    --content-width: 100%;
    --space-3xl: 2.5rem;
    --space-4xl: 3.5rem;
  }
  .gundam-nav { padding: 0 var(--space-lg); }
  .gundam-main { padding: 0 var(--space-md) var(--space-2xl); }

  .nav-toggle { display: flex; }
  .nav-right {
    position: fixed;
    top: 0; right: -100%;
    width: 280px; height: 100vh;
    background: var(--color-nav);
    flex-direction: column;
    padding: calc(var(--nav-height) + var(--space-lg)) var(--space-lg) var(--space-lg);
    box-shadow: -4px 0 30px rgba(0,0,0,0.4);
    transition: right var(--dur-normal) var(--ease-out);
    gap: var(--space-xl);
  }
  .nav-right.open { right: 0; }
  .nav-links { flex-direction: column; width: 100%; }
  .nav-links a { width: 100%; padding: 12px 16px; }
  .nav-user { flex-direction: column; width: 100%; }

  .page-header h1 { font-size: var(--text-3xl); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .gundam-nav { padding: 0 var(--space-md); }
  .brand-text { display: none; }
}

@media print {
  .gundam-nav { display: none; }
  body { padding-top: 0; }
  .panel { box-shadow: none; border: 1px solid #ccc; }
}
