:root {
  --bg-color: #f4f6f8;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --card-hover-bg: rgba(255, 255, 255, 0.95);
  --accent-color: #3b82f6;
  --shadow-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] {
  --bg-color: #0f172a;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --card-hover-bg: rgba(30, 41, 59, 0.95);
  --accent-color: #60a5fa;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  position: relative;
}

/* 动态背景装饰 */
.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.6;
}

.shape-1 {
  width: 500px;
  height: 500px;
  background: rgba(59, 130, 246, 0.3);
  top: -100px;
  left: -100px;
  animation: float 15s ease-in-out infinite alternate;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: rgba(168, 85, 247, 0.3);
  bottom: -50px;
  right: -50px;
  animation: float 20s ease-in-out infinite alternate-reverse;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 50px) scale(1.1); }
}

/* 布局容器 */
.container {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  gap: 2rem;
  min-height: 100vh;
}

/* 毛玻璃通用样式 */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px var(--shadow-color);
  border-radius: 20px;
}

/* 侧边栏 */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 2rem;
  height: calc(100vh - 4rem);
}

.logo {
  margin-bottom: 2rem;
}

.logo h2 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.nav-item {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-item:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-color);
  color: white;
}

.theme-toggle {
  margin-top: auto;
  display: flex;
  justify-content: center;
}

#theme-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

#theme-btn:hover {
  transform: scale(1.1);
}

/* 主内容区 */
.main-content {
  flex-grow: 1;
  padding: 1rem 0;
}

.header {
  margin-bottom: 2rem;
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* 工具卡片网格 */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* 工具卡片 */
.tool-card {
  text-decoration: none;
  color: inherit;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-5px);
  background: var(--card-hover-bg);
  box-shadow: 0 12px 40px var(--shadow-color);
}

.tool-icon {
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 16px;
  flex-shrink: 0;
}

.tool-info {
  flex-grow: 1;
}

.tool-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.tool-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 响应式设计 */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
    padding: 1rem;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
  }
  
  .logo {
    margin-bottom: 0;
  }
  
  nav {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 1rem;
  }
  
  .theme-toggle {
    margin-top: 0;
  }
}
