/* ============================================
   0liuuil0 个人导航站 - 样式表
   简约科技感设计 | 支持系统主题适配
   ============================================ */

/* CSS 变量 - 浅色主题（默认） */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-hover: #f0f1f3;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #eff6ff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;
}

/* 深色主题 */
@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --bg-primary: #0f0f0f;
    --bg-secondary: #171717;
    --bg-tertiary: #1f1f1f;
    --bg-hover: #262626;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --border-color: #262626;
    --border-light: #1f1f1f;
    --accent-color: #60a5fa;
    --accent-hover: #3b82f6;
    --accent-light: #1e3a5f;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  }
}

/* 手动深色主题 */
.dark {
  --bg-primary: #0f0f0f;
  --bg-secondary: #171717;
  --bg-tertiary: #1f1f1f;
  --bg-hover: #262626;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --border-color: #262626;
  --border-light: #1f1f1f;
  --accent-color: #60a5fa;
  --accent-hover: #3b82f6;
  --accent-light: #1e3a5f;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

/* 手动浅色主题 */
.light {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-hover: #f0f1f3;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #eff6ff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* 基础重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  text-decoration: none;
  color: inherit;
}

/* 主容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 头部 */
.header {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 100;
  backdrop-filter: blur(10px);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-md);
}

.site-info {
  display: flex;
  flex-direction: column;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

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

/* 头部操作区 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

/* 汉堡菜单按钮 */
.nav-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.nav-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.nav-toggle .close-icon {
  display: none;
}

.nav-toggle.active .hamburger-icon {
  display: none;
}

.nav-toggle.active .close-icon {
  display: block;
}

/* 下拉导航菜单 */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: 200;
  overflow: hidden;
}

.nav-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-list {
  list-style: none;
  padding: 8px 0;
  margin: 0;
}

.nav-link {
  display: block;
  padding: 12px 16px;
  font-size: 0.9375rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.nav-link:hover {
  background: var(--accent-light);
  color: var(--accent-color);
}

/* 桌面端：导航链接直接显示在header中 */
@media (min-width: 769px) {
  .nav-toggle {
    display: none;
  }
  
  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    min-width: auto;
    overflow: visible;
  }
  
  .nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
  }
  
  .nav-link {
    padding: 8px 12px;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
  }
  
  .nav-link:hover {
    background: var(--bg-tertiary);
  }
}

/* 移动端样式优化 */
@media (max-width: 768px) {
  .nav-dropdown {
    position: fixed;
    top: 72px;
    left: 16px;
    right: 16px;
    width: auto;
    border-radius: var(--radius-md);
  }
}

/* 主题切换按钮 */
.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.theme-toggle .sun-icon {
  display: none;
}

.theme-toggle .moon-icon {
  display: block;
}

.dark .theme-toggle .sun-icon {
  display: block;
}

.dark .theme-toggle .moon-icon {
  display: none;
}

/* 搜索区域 */
.search-section {
  padding: 24px 0;
}

.search-box {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 48px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9375rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-input:focus {
  border-color: var(--accent-color);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
}

.search-clear.visible {
  display: flex;
}

.search-clear:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* 主要内容 */
.main-content {
  flex: 1;
  padding-bottom: 40px;
}

/* 分类区块 */
.category-section {
  margin-bottom: 32px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.category-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
}

.category-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* 链接网格 */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* 链接卡片 */
.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.link-card:hover {
  border-color: var(--accent-color);
  background: var(--bg-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.link-card:active {
  transform: translateY(0);
}

.link-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.link-card:hover .link-icon {
  background: var(--accent-light);
  color: var(--accent-color);
}

/* 品牌图标颜色 */
.link-icon.chatgpt-icon {
  color: #10a37f;
}

.link-icon.claude-icon {
  color: #cc785c;
}

.link-icon.notion-icon {
  color: #000;
}

.dark .link-icon.notion-icon {
  color: #fff;
}

.link-icon.figma-icon {
  color: #f24e1e;
}

.link-icon.twitter-icon {
  color: #000;
}

.dark .link-icon.twitter-icon {
  color: #fff;
}

.link-icon.weibo-icon {
  color: #e6162d;
}

.link-icon.bilibili-icon {
  color: #00a1d6;
}

.link-icon.youtube-icon {
  color: #ff0000;
}

.link-icon.stackoverflow-icon {
  color: #f48024;
}

.link-icon.npm-icon {
  color: #cb3837;
}

.link-icon.mdn-icon {
  color: #000;
}

.dark .link-icon.mdn-icon {
  color: #83d0f2;
}

.link-icon.codepen-icon {
  color: #000;
}

.dark .link-icon.codepen-icon {
  color: #fff;
}

.link-icon.codesandbox-icon {
  color: #000;
}

.dark .link-icon.codesandbox-icon {
  color: #fff;
}

.link-icon.vercel-icon {
  color: #000;
}

.dark .link-icon.vercel-icon {
  color: #fff;
}

.link-icon.midjourney-icon {
  color: #000;
}

.dark .link-icon.midjourney-icon {
  color: #fff;
}

.link-icon.huggingface-icon {
  color: #ff9d00;
}

.link-icon.poe-icon {
  color: #5b4fcc;
}

.link-icon.runway-icon {
  color: #000;
}

.dark .link-icon.runway-icon {
  color: #fff;
}

.link-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.link-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-desc {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 页脚 */
.footer {
  padding: 24px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-text {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer-brand {
  font-weight: 500;
  color: var(--accent-color);
}

.footer-divider {
  color: var(--border-color);
}

/* 隐藏状态 */
.hidden {
  display: none !important;
}

/* 无搜索结果提示 */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.no-results-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--text-tertiary);
}

.no-results-text {
  font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .header {
    padding: 16px 0;
  }

  .site-title {
    font-size: 1.125rem;
  }

  .site-subtitle {
    font-size: 0.75rem;
  }

  .search-section {
    padding: 16px 0;
  }

  .links-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .link-card {
    padding: 14px;
  }

  .category-section {
    margin-bottom: 24px;
  }
}

@media (max-width: 480px) {
  .logo {
    width: 40px;
    height: 40px;
  }

  .logo svg {
    width: 20px;
    height: 20px;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
  }
  
  .nav-toggle {
    width: 36px;
    height: 36px;
  }

  .search-input {
    height: 44px;
    font-size: 0.875rem;
  }

  .link-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .link-icon svg {
    width: 20px;
    height: 20px;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-section {
  animation: fadeIn 0.4s ease-out;
}

.category-section:nth-child(1) { animation-delay: 0s; }
.category-section:nth-child(2) { animation-delay: 0.1s; }
.category-section:nth-child(3) { animation-delay: 0.2s; }
.category-section:nth-child(4) { animation-delay: 0.3s; }

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* 选中文字样式 */
::selection {
  background: var(--accent-light);
  color: var(--accent-hover);
}
