/* ===== Apple + Material 3 + Ant Design 融合设计系统 ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 设计Tokens - 参考各大厂 */
:root {
  /* Apple 风格主色 */
  --primary: #007AFF;
  --primary-hover: #0056CC;
  
  /* Material 3 风格 - 温暖渐变 */
  --md-primary: #6750A4;
  --md-on-primary: #FFFFFF;
  --md-primary-container: #EADDFF;
  --md-on-primary-container: #21005D;
  --md-secondary: #625B71;
  --md-secondary-container: #E8DEF8;
  --md-tertiary: #7D5260;
  --md-surface: #FFFBFE;
  --md-surface-variant: #E7E0EC;
  --md-outline: #79747E;
  
  /* Ant Design 风格 - 中性专业 */
  --ant-primary: #1677FF;
  --ant-success: #52C41A;
  --ant-warning: #FAAD14;
  --ant-error: #FF4D4F;
  
  /* 通用 */
  --bg: #F5F5F7; /* Apple 浅灰 */
  --bg-card: #FFFFFF;
  --text: #1D1D1F; /* Apple 深灰 */
  --text-secondary: #6E6E73;
  --text-tertiary: #86868B;
  --border: #D2D2D7;
  
  /* 阴影系统 - Apple 风格 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.16);
  
  /* 毛玻璃效果 - Apple Liquid Glass */
  --glass-bg: rgba(255,255,255,0.72);
  --glass-border: rgba(255,255,255,0.4);
  --blur: 20px;
  
  /* 间距系统 - Ant Design 4-8-16网格 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* 圆角 - Material 3 圆角系统 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* 过渡 - 弹簧动效参考Material */
  --transition-fast: 150ms cubic-bezier(0.2, 0, 0, 1);
  --transition-normal: 250ms cubic-bezier(0.2, 0, 0, 1);
  --transition-slow: 400ms cubic-bezier(0.2, 0, 0, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #F5F5F7 0%, #E8E8ED 100%);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

/* ===== Layout - Apple 双栏布局 ===== */
.site-wrap {
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}

/* ===== Left Sidebar - 毛玻璃风格 ===== */
.left-sidebar {
  width: 240px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-right: 1px solid var(--glass-border);
  padding: var(--space-lg);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  margin-bottom: var(--space-lg);
}

.sidebar-logo a {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, #5E5CE6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.sidebar-nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition-normal);
}

.sidebar-nav li a:hover {
  background: rgba(0,122,255,0.08);
  color: var(--primary);
  transform: translateX(4px);
}

.sidebar-nav li a.active {
  background: linear-gradient(135deg, rgba(0,122,255,0.1) 0%, rgba(94,92,230,0.1) 100%);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: var(--space-lg) 0;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  padding: var(--space-xl);
  min-width: 0;
  background: var(--bg-card);
}

/* ===== Search Bar - Material 3 风格 ===== */
.search-bar {
  position: relative;
  margin-bottom: var(--space-xl);
}

.search-bar input {
  width: 100%;
  padding: 16px 20px 16px 52px;
  border: 2px solid transparent;
  border-radius: var(--radius-xl);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  transition: all var(--transition-normal);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-md), 0 0 0 4px rgba(0,122,255,0.1);
}

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

.search-bar button {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.search-bar button:hover {
  color: var(--primary);
}

/* ===== Hot Section - Apple 卡片风格 ===== */
.hot-section {
  margin-bottom: var(--space-xl);
}

.hot-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.hot-section h2::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, var(--primary) 0%, #5E5CE6 100%);
  border-radius: 2px;
}

.hot-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

/* 悬停卡片 - Apple 风格 */
.hot-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.hot-item:hover {
  border-color: transparent;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.hot-item img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.hot-item .hot-info {
  flex: 1;
  min-width: 0;
}

.hot-item .hot-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.hot-item .hot-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Category Block - Ant Design 风格 ===== */
.category-block {
  margin-bottom: var(--space-2xl);
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.category-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.category-header a {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 500;
}

.category-header a:hover {
  text-decoration: underline;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}

/* 工具卡片 - Material 3 elevated 风格 */
.tool-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.tool-card .tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #F5F5F7 0%, #E8E8ED 100%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}

.tool-card .tool-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-card .tool-icon span {
  font-size: 1.5rem;
}

.tool-card .tool-info {
  flex: 1;
  min-width: 0;
}

.tool-card .tool-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

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

/* ===== Footer - Apple 简洁风格 ===== */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: var(--space-xl);
  text-align: center;
}

.site-footer p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
}

.site-footer a {
  color: var(--primary);
  margin: 0 var(--space-sm);
  transition: color var(--transition-fast);
}

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

/* ===== Modal - Material 3 风格 ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--transition-normal) ease-out;
}

.modal.show {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 520px;
  width: 90%;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: slideUp var(--transition-slow) ease-out;
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-size: 20px;
  cursor: pointer;
  color: var(--text-tertiary);
  background: var(--bg);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.modal-content h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.modal-content p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
  font-size: 0.95rem;
}

.modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--primary) 0%, #5E5CE6 100%);
  color: #fff;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 12px rgba(0,122,255,0.3);
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,122,255,0.4);
}

/* ===== Responsive - 移动端适配 ===== */
@media (max-width: 900px) {
  .site-wrap {
    flex-direction: column;
    box-shadow: none;
  }
  
  .left-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: var(--space-md);
    background: var(--bg-card);
  }
  
  .sidebar-logo {
    margin-bottom: var(--space-sm);
  }
  
  .sidebar-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-xs);
  }
  
  .sidebar-nav li a {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  
  .sidebar-divider {
    display: none;
  }
  
  .main-content {
    padding: var(--space-md);
  }
  
  .category-grid {
    grid-template-columns: 1fr;
  }
  
  .hot-list {
    grid-template-columns: 1fr;
  }
}

/* ===== 暗色模式支持 ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1C1E;
    --bg-card: #2C2C2E;
    --text: #F5F5F7;
    --text-secondary: #A1A1A6;
    --text-tertiary: #636366;
    --border: #38383A;
    --glass-bg: rgba(44,44,46,0.8);
    --glass-border: rgba(255,255,255,0.1);
  }
}