/* mechs.top — GUNDAM HANGAR Personal Site */

:root {
  /* GUNDAM HANGAR Design System (from xiaowen) */
  --gundam-blue: #1A5FB4;
  --gundam-blue-dark: #0D3B6E;
  --gundam-blue-light: #3584E4;
  --gundam-red: #D32F2F;
  --gundam-red-light: #E53935;
  --gundam-yellow: #FFA726;
  --gundam-dark: #1E1E2E;
  --gundam-gray: #6C7A8D;
  --gundam-border: #D7DDE5;
  --gundam-armor: #FAFBFC;
  --gundam-bg: #F0F3F8;
  --gundam-shadow: 0 2px 8px rgba(26, 95, 180, 0.08);
  --gundam-shadow-lg: 0 4px 20px rgba(26, 95, 180, 0.12);
  --gundam-radius: 6px;
  --gundam-radius-lg: 10px;
  --font-display: 'Orbitron', monospace;
  --font-body: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Layout */
  --gutter: 32px;
  --container-width: 1200px;
  --nav-height: 72px;
  
  /* Legacy Compat */
  --gundam-text: var(--gundam-dark);
  --gundam-text-dim: var(--gundam-gray);
  --gundam-accent: var(--gundam-blue);
  --gundam-surface: var(--gundam-armor);
}

/* ========== Reset & Base ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--gundam-bg);
  color: var(--gundam-dark);
  min-height: 100vh;
}

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

a:hover {
  color: var(--gundam-blue-light);
}

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

/* ========== Typography ========== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--gundam-dark);
  letter-spacing: 0.02em;
}

h1 { font-size: 2.5rem; margin-bottom: 1.5rem; }
h2 { font-size: 2rem; margin-bottom: 1.25rem; }
h3 { font-size: 1.5rem; margin-bottom: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--gundam-gray);
  line-height: 1.7;
}

code, pre {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
}

/* ========== Navigation ========== */
.gundam-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: white;
  border-bottom: 1px solid var(--gundam-border);
  box-shadow: var(--gundam-shadow);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gundam-dark);
  letter-spacing: 0.05em;
}

.nav-brand span {
  color: var(--gundam-blue);
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gundam-gray);
  letter-spacing: 0.05em;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gundam-blue);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gundam-blue);
}

.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--gundam-radius);
  background: linear-gradient(135deg, var(--gundam-blue-dark), var(--gundam-blue));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.user-name {
  font-weight: 600;
  color: var(--gundam-dark);
}

.nav-profile-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--gundam-dark);
  transition: opacity 0.2s ease;
}

.nav-profile-link:hover {
  opacity: 0.8;
}

/* Mobile Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--gundam-blue);
  transition: all 0.2s ease;
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-right {
    position: fixed;
    top: var(--nav-height);
    right: 0;
    width: 300px;
    height: calc(100vh - var(--nav-height));
    background: white;
    border-left: 1px solid var(--gundam-border);
    box-shadow: var(--gundam-shadow-lg);
    flex-direction: column;
    align-items: stretch;
    padding: 2rem var(--gutter);
    gap: 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  .nav-right.open { transform: translateX(0); }
  .nav-links { flex-direction: column; gap: 1.5rem; }
}

/* ========== Main Layout ========== */
.gundam-main {
  padding-top: calc(var(--nav-height) + 3rem);
  padding-bottom: 5rem;
  min-height: 100vh;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ========== Card System ========== */
.card {
  background: var(--gundam-armor);
  border: 1px solid var(--gundam-border);
  border-radius: var(--gundam-radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--gundam-shadow);
  transition: all 0.3s ease;
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--gundam-dark);
  letter-spacing: 0.02em;
}

.card-description {
  color: var(--gundam-gray);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* ========== Forms ========== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--gundam-dark);
  margin-bottom: 0.5rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--gundam-dark);
  background: white;
  border: 1px solid var(--gundam-border);
  border-radius: var(--gundam-radius);
  transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gundam-blue);
  box-shadow: 0 0 0 3px rgba(26, 95, 180, 0.1);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--gundam-radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--gundam-blue);
  color: white;
  box-shadow: 0 2px 8px rgba(26, 95, 180, 0.2);
}

.btn-primary:hover {
  background: var(--gundam-blue-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 95, 180, 0.3);
  color: white;
}

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

.btn-outline:hover {
  border-color: var(--gundam-blue);
  color: var(--gundam-blue);
  background: rgba(26, 95, 180, 0.05);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ========== Code Block ========== */
.code-block {
  position: relative;
  background: #0d1117;
  border-radius: var(--gundam-radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  box-shadow: var(--gundam-shadow);
}

.code-block pre {
  margin: 0;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #c9d1d9;
}

.code-block-copy {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--gundam-blue);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.code-block-copy:hover {
  background: var(--gundam-blue-light);
}

/* GitHub Dark Syntax Highlighting */
.hljs { color: #c9d1d9; background: #0d1117; }
.hljs-doctag, .hljs-keyword, .hljs-meta .hljs-keyword, .hljs-template-tag, .hljs-template-variable, .hljs-type, .hljs-variable.language_ { color: #ff7b72; }
.hljs-title, .hljs-title.class_, .hljs-title.class_.inherited__, .hljs-title.function_ { color: #d2a8ff; }
.hljs-attr, .hljs-attribute, .hljs-literal, .hljs-meta, .hljs-number, .hljs-operator, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-id, .hljs-variable { color: #79c0ff; }
.hljs-meta .hljs-string, .hljs-regexp, .hljs-string { color: #a5d6ff; }
.hljs-built_in, .hljs-symbol { color: #ffa657; }
.hljs-code, .hljs-comment, .hljs-formula { color: #8b949e; }
.hljs-name, .hljs-quote, .hljs-selector-pseudo, .hljs-selector-tag { color: #7ee787; }
.hljs-subst { color: #c9d1d9; }
.hljs-section { color: #1f6feb; font-weight: bold; }
.hljs-bullet { color: #f2cc60; }
.hljs-emphasis { color: #c9d1d9; font-style: italic; }
.hljs-strong { color: #c9d1d9; font-weight: bold; }
.hljs-addition { color: #aff5b4; background-color: #033a16; }
.hljs-deletion { color: #ffdcd7; background-color: #67060c; }

/* ========== Flash Messages ========== */
.flash-messages {
  position: fixed;
  top: calc(var(--nav-height) + 1rem);
  right: 1rem;
  max-width: 400px;
  z-index: 200;
}

.flash {
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  border-radius: var(--gundam-radius);
  border-left: 4px solid;
  font-size: 0.9375rem;
  background: white;
  box-shadow: var(--gundam-shadow-lg);
  animation: slideInRight 0.3s ease;
}

.flash-success {
  border-color: #10B981;
  color: #10B981;
}

.flash-error {
  border-color: var(--gundam-red);
  color: var(--gundam-red);
}

.flash-info {
  border-color: var(--gundam-blue);
  color: var(--gundam-blue);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(2rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== Utilities ========== */
.text-muted { color: var(--gundam-gray); }
.text-accent { color: var(--gundam-blue); }

.mb-sm { margin-bottom: 0.75rem; }
.mb-md { margin-bottom: 1.5rem; }
.mb-lg { margin-bottom: 2.5rem; }

.mt-sm { margin-top: 0.75rem; }
.mt-md { margin-top: 1.5rem; }
.mt-lg { margin-top: 2.5rem; }

/* ========== Responsive ========== */
@media (max-width: 768px) {
  :root {
    --gutter: 20px;
    --nav-height: 64px;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .card { padding: 1.5rem; }
}