:root {
  /* Light Mode (Default) */
  --bg-color: #f8fafc;
  --text-primary: #334155;
  /* Softened from #1e293b for elegance */
  --text-secondary: #64748b;
  --card-bg: rgba(255, 255, 255, 0.65);
  --card-border: rgba(255, 255, 255, 0.4);
  --card-hover-bg: rgba(255, 255, 255, 0.85);
  --card-shadow: 0 20px 40px rgba(148, 163, 184, 0.15);
  --logo-gradient: linear-gradient(135deg, #1e293b 0%, #64748b 100%);

  /* Aurora Colors - Light */
  --aurora-1: rgba(192, 132, 252, 0.15);
  /* Lighter Purple */
  --aurora-2: rgba(34, 211, 238, 0.15);
  /* Lighter Cyan */
  --aurora-3: rgba(251, 113, 133, 0.15);
  /* Lighter Rose */
}

[data-theme="dark"] {
  /* Dark Mode */
  --bg-color: #030712;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --card-bg: rgba(255, 255, 255, 0.08);
  /* Increased opacity from 0.03 for better contrast */
  --card-border: rgba(255, 255, 255, 0.1);
  /* Stronger border */
  --card-hover-bg: rgba(255, 255, 255, 0.12);
  --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  --logo-gradient: linear-gradient(135deg, #fff 0%, #94a3b8 100%);

  /* Aurora Colors - Dark */
  --aurora-1: rgba(76, 29, 149, 0.15);
  /* Purple */
  --aurora-2: rgba(34, 211, 238, 0.1);
  /* Cyan */
  --aurora-3: rgba(251, 113, 133, 0.08);
  /* Rose */
}

/* Constants */
:root {
  --accent-cyan: #22d3ee;
  --accent-purple: #c084fc;
  --accent-rose: #fb7185;
  --transition-speed: 0.3s;
}

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

body {
  font-family: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Aurora Background */
.aurora-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(circle at 15% 50%, var(--aurora-1) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, var(--aurora-2) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, var(--aurora-3) 0%, transparent 50%);
  filter: blur(60px);
  animation: aurora-move 20s ease-in-out infinite alternate;
  transition: background var(--transition-speed);
}

@keyframes aurora-move {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.1);
  }
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  position: relative;
  /* For toggle positioning context if needed, but toggle is absolute */
}

/* Header */
header {
  text-align: center;
  margin-bottom: 4rem;
  opacity: 0;
  animation: fade-in-down 1s ease-out forwards;
}

.logo-text {
  font-size: 3rem;
  font-weight: 200;
  letter-spacing: 0.5rem;
  background: var(--logo-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  transition: background var(--transition-speed);
}

.slogan-main {
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 400;
  letter-spacing: 0.3rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  transition: color var(--transition-speed);
}

.slogan-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.15rem;
  opacity: 0.8;
  transition: color var(--transition-speed);
}

/* Cards Container */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  width: 100%;
  max-width: 900px;
}

/* Card Styles */
.nav-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  /* Slightly tighter radius for wider card */
  padding: 2.5rem 3rem;
  /* Less vertical, more horizontal padding -> Wider look */
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  animation: fade-in-up 1s ease-out forwards;
  /* Layout changes for Center alignment */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  /* Add flex gap for better control than margins */
}

.nav-card:nth-child(1) {
  animation-delay: 0.2s;
}

.nav-card:nth-child(2) {
  animation-delay: 0.4s;
}

.nav-card:hover {
  transform: translateY(-5px);
  background: var(--card-hover-bg);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--card-shadow);
}

/* Card Content */
.card-icon {
  width: 72px;
  /* Slightly reduce from 80 for balance */
  height: 72px;
  margin-bottom: 0.5rem;
  /* Minimal bottom gap */
  display: flex;
  /* Ensure SVG/Img centers within */
  justify-content: center;
  align-items: center;
  stroke-width: 1.5;
}

/* SVG Logo styling - treated same as inline SVGs */
.card-icon svg,
.card-icon img.icon-svg-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
  transition: all 0.3s ease;
}

.nav-card:hover .card-icon svg,
.nav-card:hover .card-icon img.icon-svg-logo {
  transform: scale(1.1) rotate(5deg);
}

.card-title {
  font-size: 1.6rem;
  /* Slightly larger */
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: block;
  transition: color var(--transition-speed);
}

.card-desc {
  font-size: 1rem;
  /* Increased readability */
  color: var(--text-secondary);
  line-height: 1.6;
  display: block;
  transition: color var(--transition-speed);
  max-width: 90%;
  /* Prevent text from hitting edges too hard */
}

/* Specific Card Accents - Keeping these consistent but maybe tweaking opacity for light mode? 
   Actually, the colors are vibrant enough to work on both. */
.card-zhengjian .card-icon {
  color: var(--accent-cyan);
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}

.card-jianlou .card-icon {
  color: var(--accent-rose);
  text-shadow: 0 0 20px rgba(251, 113, 133, 0.3);
}

/* Decorative Glow on Hover */
.nav-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.06), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.nav-card:hover::before {
  opacity: 1;
}

/* Theme Toggle */
.theme-toggle {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  z-index: 100;
}

.theme-toggle:hover {
  background: var(--card-hover-bg);
  transform: rotate(15deg);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Footer */
footer {
  margin-top: auto;
  padding: 2rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  opacity: 0.6;
  transition: color var(--transition-speed);
}

footer a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s;
}

footer a:hover {
  color: var(--text-primary);
}

/* Animations */
@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Prevent transition flash on load */
.preload * {
  transition: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem;
    /* Reduce container padding */
  }

  .cards-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 1rem;
    /* Tighter gap */
  }

  .nav-card {
    padding: 1.5rem;
    /* Compact padding */
    border-radius: 16px;

    /* Horizontal Layout Transformation */
    flex-direction: row;
    align-items: center;
    /* Vertically center icon with text block */
    text-align: left;
    /* Left align text */
    gap: 1.25rem;
    /* Space between icon and text */
  }

  /* Wrap text content to ensure it stays on the right */
  .nav-card>*:not(.card-icon) {
    flex: 1;
    /* Allow text to take remaining space */
  }

  /* We need to group title and desc in HTML for perfect flex behavior, 
     but assuming simple flow: */

  .card-icon {
    width: 48px;
    /* Much smaller, button-like icon */
    height: 48px;
    margin-bottom: 0;
    /* No bottom margin needed in row layout */
    flex-shrink: 0;
    /* Don't shrink the icon */
  }

  /* Mobile Typography */
  .card-title {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
  }

  .card-desc {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-secondary);
    /* Limit lines if needed, or let it flow */
    opacity: 0.8;
  }

  /* Header Adjustments */
  .logo-text {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }

  .slogan-main {
    font-size: 0.9rem;
    letter-spacing: 0.15rem;
  }

  .slogan-sub {
    font-size: 0.75rem;
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
    top: 1rem;
    right: 1rem;
  }

  .theme-toggle svg {
    width: 20px;
    height: 20px;
  }
}