/* ============================================
   LAYOUTS — 导航栏、侧边栏布局、首页布局、响应式
   ============================================ */

/* ---- Navbar — 磨砂玻璃 ---- */
.navbar {
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border));
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.nav-container {
  max-width: 100%;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: hsl(var(--foreground));
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  transition: color var(--transition);
}

.nav-logo:hover {
  color: hsl(var(--primary));
}

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

.nav-links a {
  text-decoration: none;
  color: hsl(var(--muted-foreground));
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition);
  padding: 0.375rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
}

.nav-links a:hover {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.08);
}

.nav-links a.active {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
}

/* ============================================
   App Layout — Sidebar + Main
   ============================================ */

/* Body for tool pages */
body:has(.app-layout),
body:has(.sora-container),
body:has(.app-split-view) {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Container */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  width: 100%;
  position: relative;
}

/* Sidebar */
.app-layout > aside,
aside {
  width: var(--sidebar-width);
  background: hsl(var(--panel));
  border-right: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 4px 0 24px hsl(var(--foreground) / 0.02);
}

/* Aside header */
.aside-header {
  padding: 1.375rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.5px;
  color: hsl(var(--panel-foreground));
}

/* Scroll area */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* Main area */
.app-layout > main,
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1.25rem;
  overflow: auto;
}

/* ============================================
   Landing Page Layout
   ============================================ */
.landing-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.landing-hero {
  text-align: center;
  margin-bottom: 3.75rem;
  padding: 2.5rem 0 1.25rem;
}

.landing-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, hsl(var(--foreground)) 0%, hsl(var(--primary)) 50%, hsl(263 70% 50.4%) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
}

.landing-hero p {
  color: hsl(var(--muted-foreground));
  font-size: 1.15rem;
  max-width: 500px;
  margin: 0 auto;
}

/* Stats bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 2.5rem 0 3.75rem;
  padding: 1.5rem;
  background: hsl(var(--card));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-sm);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: hsl(var(--primary));
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.375rem;
}

/* Tool grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Tool card */
.tool-card {
  background: hsl(var(--card));
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(263 70% 50.4%));
  opacity: 0;
  transition: opacity var(--transition);
}

.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

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

.icon-wrapper {
  width: 3.25rem;
  height: 3.25rem;
  background: hsl(var(--primary) / 0.1);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: all var(--transition);
}

.tool-card:hover .icon-wrapper {
  background: hsl(var(--primary));
  transform: scale(1.08);
}

.icon-wrapper i {
  font-size: 1.375rem;
  color: hsl(var(--primary));
  transition: color var(--transition);
}

.tool-card:hover .icon-wrapper i {
  color: hsl(var(--primary-foreground));
}

.tool-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tool-card p {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  margin-bottom: 1rem;
  flex-grow: 1;
  line-height: 1.6;
}

/* Footer */
.landing-footer {
  margin-top: 5rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  border-top: 1px solid hsl(var(--border));
  padding-top: 1.875rem;
}

/* ============================================
   Responsive — 统一 768px 断点
   ============================================ */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 0.625rem;
  }

  .nav-links {
    gap: 0.25rem;
    justify-content: center;
  }

  .nav-links a {
    font-size: 0.8rem;
    padding: 0.3125rem 0.5rem;
  }

  .app-layout {
    flex-direction: column;
  }

  .app-layout > aside,
  aside {
    width: 100%;
    max-height: 50vh;
  }

  .app-layout > main,
  main {
    padding: 0.625rem;
  }

  .landing-hero h1 {
    font-size: 2rem;
  }

  .landing-hero p {
    font-size: 1rem;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    gap: 1.5rem;
    flex-wrap: wrap;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}
