/* =============================================
   秋末 // CYBER_NEXUS
   Cyberpunk Personal Website Theme
   Inspired by bobzhang.top
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
  --bg-deep: #020617;
  --bg-surface: #0a0f1e;
  --bg-card: rgba(15, 23, 42, 0.6);
  --bg-card-hover: rgba(30, 41, 59, 0.7);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-muted: #475569;

  --cyan: #22d3ee;
  --cyan-dim: rgba(34, 211, 238, 0.15);
  --cyan-glow: rgba(34, 211, 238, 0.4);
  --purple: #6a35ff;
  --purple-dim: rgba(106, 53, 255, 0.15);
  --indigo: #6366f1;
  --blue: #3b82f6;
  --emerald: #10b981;
  --fuchsia: #d946ef;
  --orange: #fb8b46;

  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(34, 211, 238, 0.25);
  --border-color-hover: var(--border-hover);

  /* Backward compat aliases for sub-components */
  --accent-blue: var(--cyan);
  --accent-purple: var(--purple);
  --accent-cyan: var(--cyan);
  --gradient-primary: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 50%, var(--fuchsia) 100%);
  --gradient-border: linear-gradient(135deg, rgba(34, 211, 238, 0.5) 0%, rgba(106, 53, 255, 0.5) 50%, rgba(217, 70, 239, 0.5) 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(34, 211, 238, 0.08) 0%, rgba(106, 53, 255, 0.08) 100%);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --bg-card-hover: rgba(30, 41, 59, 0.7);
  --bg-secondary: #0a0f1e;
  --bg-tertiary: rgba(15, 23, 42, 0.5);
  --shadow-glow: 0 0 30px rgba(34, 211, 238, 0.08);
  --shadow-glow-strong: 0 0 50px rgba(34, 211, 238, 0.15);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* --- Reset --- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}
::selection { background: var(--cyan-dim); color: var(--cyan); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }
input, textarea { font-family: inherit; font-size: inherit; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ============================================
   TEXT GLOW
   ============================================ */
.text-glow {
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan-glow), 0 0 30px rgba(34, 211, 238, 0.15);
}

/* ============================================
   ENTRY SCREEN
   ============================================ */
.entry-screen {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s, transform 0.8s;
}
.entry-screen.hidden {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}
.entry-bg {
  position: absolute;
  inset: 0;
  background: url('bg.jpg') center/cover no-repeat;
}
.entry-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(4px);
}
.entry-card {
  position: relative;
  z-index: 1;
  display: flex;
  width: 900px;
  max-width: 92vw;
  height: 540px;
  max-height: 85vh;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}

/* Entry Left - Character */
.entry-left {
  width: 50%;
  background: linear-gradient(180deg, rgba(15,23,42,0.3) 0%, rgba(30,41,59,0.5) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 20px;
}
.entry-character {
  position: relative;
  width: 260px;
  height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.char-body {
  position: relative;
  width: 200px;
  height: 280px;
}
.char-torso {
  position: absolute;
  bottom: 0;
  left: 35px;
  width: 130px;
  height: 260px;
  background: linear-gradient(180deg, var(--purple), #4a1fb3);
  border-radius: 65px 65px 0 0;
}
.char-head {
  position: absolute;
  top: 10px;
  left: 60px;
  width: 80px;
  height: 80px;
  background: #1c1d22;
  border-radius: 50%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
}
.char-eye {
  width: 12px; height: 12px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cyan-glow);
  animation: eye-blink 3s ease-in-out infinite;
}
@keyframes eye-blink {
  0%, 90%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}
.char-eye-l { margin-right: 4px; }
.char-mouth {
  width: 20px; height: 4px;
  background: var(--cyan);
  border-radius: 2px;
  margin-top: 4px;
  opacity: 0.6;
}
.char-arm {
  position: absolute;
  bottom: 30px;
  width: 30px;
  height: 100px;
  background: var(--orange);
  border-radius: 15px;
}
.char-arm-l { left: -10px; transform: rotate(15deg); }
.char-arm-r { right: -10px; transform: rotate(-15deg); }

/* Visualizer bars */
.char-visualizer {
  position: absolute;
  top: -10px;
  right: -40px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
}
.vis-bar {
  width: 6px;
  background: linear-gradient(to top, var(--cyan), var(--purple));
  border-radius: 3px 3px 0 0;
  animation: vis-bounce 1.2s ease-in-out infinite;
}
.vis-bar:nth-child(1) { animation-delay: 0s; }
.vis-bar:nth-child(2) { animation-delay: 0.15s; }
.vis-bar:nth-child(3) { animation-delay: 0.3s; }
.vis-bar:nth-child(4) { animation-delay: 0.45s; }
.vis-bar:nth-child(5) { animation-delay: 0.1s; }
.vis-bar:nth-child(6) { animation-delay: 0.25s; }
.vis-bar:nth-child(7) { animation-delay: 0.4s; }
.vis-bar:nth-child(8) { animation-delay: 0.55s; }
@keyframes vis-bounce {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.6); }
}

/* Entry Right - Form */
.entry-right {
  width: 50%;
  padding: 60px 40px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.entry-logo {
  margin-bottom: 16px;
}
.entry-logo-svg {
  width: 32px; height: 32px;
  fill: var(--cyan);
  filter: drop-shadow(0 0 8px var(--cyan-glow));
}
.entry-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}
.entry-subtitle {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 28px;
}
.entry-avatars {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  justify-content: center;
}
.avatar-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.1);
  transition: all 0.3s;
  opacity: 0.6;
  filter: grayscale(40%);
}
.avatar-btn:hover {
  opacity: 0.9;
  filter: grayscale(0%);
  border-color: rgba(255,255,255,0.2);
}
.avatar-btn.active {
  opacity: 1;
  filter: grayscale(0%);
  border-color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow);
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-add {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px dashed rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  transition: all 0.3s;
}
.avatar-add:hover {
  border-color: var(--text-tertiary);
  color: var(--text-secondary);
}
.avatar-upload { display: none; }
.entry-form {
  width: 100%;
  max-width: 320px;
}
.entry-field { margin-bottom: 20px; }
.entry-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
.entry-field input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s;
}
.entry-field input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
  background: rgba(255,255,255,0.06);
}
.entry-field input::placeholder { color: var(--text-muted); }
.entry-submit {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.2);
  color: var(--cyan);
  transition: all 0.3s;
  cursor: default;
}
.entry-submit:not(:disabled) {
  background: var(--cyan);
  color: var(--bg-deep);
  cursor: pointer;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}
.entry-submit:not(:disabled):hover {
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.5);
  transform: translateY(-2px);
}
.entry-submit:not(:disabled):active {
  transform: translateY(0);
}
.entry-submit:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.entry-footer {
  margin-top: 28px;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  font-weight: 700;
  text-transform: uppercase;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.main-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  min-height: 100vh;
  padding: 32px 20px;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255,255,255,0.05);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-profile {
  text-align: center;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 20px;
}
.sidebar-avatar {
  position: relative;
  width: 80px; height: 80px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow);
}
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-status {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--emerald);
  border: 2px solid var(--bg-deep);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}
.sidebar-greeting {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 2px;
}
.sidebar-badge {
  font-size: 0.65rem;
  color: var(--emerald);
  margin-bottom: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.sidebar-name {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
  margin-bottom: 4px;
}
.sidebar-tagline {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.sidebar-version {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Sidebar Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
  flex: 1;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-tertiary);
  transition: all 0.25s;
  letter-spacing: 0.02em;
}
.side-link:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}
.side-link.active {
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  border-left: 2px solid var(--cyan);
}
.side-link-icon {
  font-family: var(--font-mono);
  font-weight: 900;
  width: 16px;
  text-align: center;
}

/* Sidebar Tags */
.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.side-tag {
  font-size: 0.65rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.1);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 40px 48px 0;
  max-width: 960px;
}

/* ============================================
   CYBER SECTION
   ============================================ */
.cyber-section {
  padding: 60px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cyber-section:last-of-type { border-bottom: none; }
.section-header { margin-bottom: 36px; }
.sec-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.2em;
  font-family: var(--font-mono);
  margin-bottom: 8px;
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid rgba(34, 211, 238, 0.15);
  border-radius: var(--radius-full);
  background: rgba(34, 211, 238, 0.04);
}
.sec-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.2;
}
.sec-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
}

/* ============================================
   ABOUT
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}
.about-text p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 14px;
}
.about-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stat-card {
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.3s;
}
.stat-card:hover {
  border-color: var(--cyan-glow);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.05);
}
.stat-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.2);
}
.stat-num::after { content: '+'; }
.stat-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  margin-top: 2px;
  display: block;
}

/* Tech Stack */
.tech-stack {
  margin-top: 8px;
}
.tech-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tech-tag {
  padding: 8px 16px;
  background: rgba(34, 211, 238, 0.04);
  border: 1px solid rgba(34, 211, 238, 0.1);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  transition: all 0.3s;
}
.tech-tag:hover {
  border-color: var(--cyan-glow);
  color: var(--cyan);
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.1);
}
.tt-icon { color: var(--cyan); margin-right: 6px; }

/* ============================================
   MATRIX GRID (Projects)
   ============================================ */
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.matrix-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  transition: all 0.4s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.matrix-card:hover {
  border-color: rgba(34, 211, 238, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 30px rgba(34, 211, 238, 0.05);
}
.mc-badge {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.15em;
  font-family: var(--font-mono);
  margin-bottom: 12px;
  padding: 3px 10px;
  border: 1px solid rgba(34, 211, 238, 0.15);
  border-radius: var(--radius-full);
  display: inline-block;
  background: rgba(34, 211, 238, 0.04);
}
.mc-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.mc-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}
.mc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.mc-tag {
  font-size: 0.65rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.1);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.mc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.mc-verified {
  font-size: 0.6rem;
  color: var(--emerald);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.mc-explore {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  transition: all 0.3s;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}
.mc-explore:hover {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.06);
}

/* ============================================
   GUESTBOOK FORM
   ============================================ */
.gb-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}
.gb-field { margin-bottom: 16px; }
.gb-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}
.gb-field input,
.gb-field textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s;
}
.gb-field input:focus,
.gb-field textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}
.gb-field input::placeholder,
.gb-field textarea::placeholder { color: var(--text-muted); }
.gb-field textarea { resize: vertical; min-height: 100px; }
.gb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.gb-toolbar-left { display: flex; gap: 6px; }
.gb-tool-btn {
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.2s;
  display: flex;
}
.gb-tool-btn:hover { color: var(--cyan); background: rgba(34, 211, 238, 0.06); }
.gb-charcount { font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-mono); }

/* Cyber Button */
.cyber-btn {
  width: 100%;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.2);
  color: var(--cyan);
  transition: all 0.3s;
  font-family: var(--font-mono);
}
.cyber-btn:hover:not(:disabled) {
  background: var(--cyan);
  color: var(--bg-deep);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.3);
}
.cyber-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cyber-btn .btn-loading,
.cyber-btn .btn-success { display: none; }
.cyber-btn.loading .btn-text { display: none; }
.cyber-btn.loading .btn-loading { display: inline-flex; }
.cyber-btn.success .btn-text { display: none; }
.cyber-btn.success .btn-loading { display: none; }
.cyber-btn.success .btn-success { display: inline-flex; }
.cyber-btn.success { background: var(--emerald); border-color: var(--emerald); color: #fff; }

.cyber-btn-outline {
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.8rem;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  transition: all 0.3s;
}
.cyber-btn-outline:hover {
  border-color: var(--cyan-glow);
  color: var(--cyan);
}

.spinner {
  width: 18px; height: 18px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sort toolbar */
.gb-toolbar-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.gb-sort-group { display: flex; gap: 4px; }
.gb-sort-btn {
  padding: 6px 14px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-muted);
  font-family: var(--font-mono);
  transition: all 0.3s;
}
.gb-sort-btn:hover { color: var(--text-secondary); border-color: rgba(255,255,255,0.1); }
.gb-sort-btn.active {
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.15);
}
.gb-count { font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ============================================
   CHAT
   ============================================ */
.chat-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.85rem;
}
.chat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(16,185,129,0.5);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }
.chat-header-right { display: flex; align-items: center; gap: 12px; }
.chat-remaining { font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-mono); }
.chat-messages {
  height: 360px;
  overflow-y: auto;
  padding: 16px 20px;
}
.chat-input-area {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-color);
}
.chat-input-wrapper {
  display: flex;
  gap: 8px;
}
.chat-input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  resize: none;
  transition: all 0.3s;
}
.chat-input:focus { border-color: var(--cyan); }
.chat-send-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  transition: all 0.3s;
}
.chat-send-btn:hover { background: var(--cyan); color: var(--bg-deep); }
.chat-footer-hint { font-size: 0.65rem; color: var(--text-muted); margin-top: 6px; }

/* ============================================
   CONTACT
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}
.contact-channels {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.channel-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s;
}
.channel-card:hover {
  border-color: var(--cyan-glow);
  transform: translateX(4px);
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.05);
}
.channel-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(34, 211, 238, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  font-size: 1rem;
  flex-shrink: 0;
}
.channel-label { font-size: 0.7rem; color: var(--text-tertiary); font-weight: 600; }
.channel-value { font-size: 0.85rem; font-weight: 700; }

/* Contact form */
.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
}

/* ============================================
   FOOTER
   ============================================ */
.cyber-footer {
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  max-width: 640px; width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-close {
  position: sticky; top: 16px; float: right;
  margin: 16px 16px 0 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.3s;
  z-index: 10;
}
.modal-close:hover {
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  transform: rotate(90deg);
}
.modal-content { padding: 36px; }
.modal-content h2 {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 6px;
  color: var(--cyan);
}
.modal-content .modal-subtitle {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  margin-bottom: 20px;
}
.modal-content .modal-desc { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.8; margin-bottom: 20px; }
.modal-content .modal-desc p { margin-bottom: 10px; }
.modal-content .modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.modal-content .modal-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.3s;
}
.modal-content .modal-link:hover {
  background: var(--cyan);
  color: var(--bg-deep);
  box-shadow: 0 0 25px rgba(34, 211, 238, 0.3);
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 7000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 360px;
  position: relative;
  overflow: hidden;
}
.toast.show { transform: translateX(0); }
.toast-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast-icon.success { background: rgba(16,185,129,0.15); color: var(--emerald); }
.toast-icon.error { background: rgba(239,68,68,0.15); color: #ef4444; }
.toast-text { font-size: 0.8rem; font-weight: 600; }
.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  background: var(--cyan);
  animation: toast-progress 3s linear forwards;
}
@keyframes toast-progress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ============================================
   ADMIN SECTION
   ============================================ */
.admin-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 48px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .entry-card { flex-direction: column; height: auto; width: 480px; }
  .entry-left { width: 100%; height: 200px; padding-bottom: 0; }
  .entry-character { width: 180px; height: 200px; }
  .char-body { width: 140px; height: 160px; }
  .char-torso { width: 90px; height: 150px; left: 25px; }
  .char-head { width: 60px; height: 60px; top: 5px; left: 40px; padding: 12px; }
  .char-eye { width: 8px; height: 8px; }
  .char-mouth { width: 14px; height: 3px; }
  .char-arm { width: 20px; height: 70px; }
  .char-arm-l { left: -5px; }
  .char-arm-r { right: -5px; }
  .char-visualizer { right: -30px; height: 80px; }
  .vis-bar { width: 4px; }
  .entry-right { width: 100%; padding: 30px 24px; }
  .sidebar { width: 220px; padding: 24px 16px; }
  .main-content { padding: 24px; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .main-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    min-height: auto;
    position: relative;
    padding: 20px 16px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .sidebar-profile { border-bottom: none; padding-bottom: 0; margin-bottom: 0; text-align: left; display: flex; align-items: center; gap: 12px; }
  .sidebar-avatar { width: 48px; height: 48px; margin: 0; }
  .sidebar-greeting { font-size: 0.8rem; }
  .sidebar-badge { margin-bottom: 0; }
  .sidebar-name { font-size: 1rem; }
  .sidebar-tagline { display: none; }
  .sidebar-version { display: none; }
  .sidebar-nav { display: none; }
  .sidebar-tags { display: none; }
  .entry-card { width: 100%; max-width: 400px; }
  .contact-grid { grid-template-columns: 1fr; }
  .cyber-footer { flex-direction: column; gap: 6px; text-align: center; }
  .top-actions { top: 12px; right: 12px; }
  .top-btn { width: 36px; height: 36px; }
  .matrix-grid { grid-template-columns: 1fr; }
}
