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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #f5f5f7;
  color: #1d1d1f;
  line-height: 1.6;
  min-height: 100vh;
}

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

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ==================== 变量 ==================== */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --bg: #f5f5f7;
  --card-bg: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.12), 0 8px 24px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 8px;
}

/* ==================== 顶部导航 ==================== */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  margin-right: 40px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
  position: relative;
}

.nav-links a:hover {
  color: var(--text);
  background: #f3f4f6;
}

.nav-links a.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

.nav-action {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
}

/* ==================== 主容器 ==================== */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ==================== Hero区域 ==================== */
.hero {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.search-box {
  flex: 1;
  min-width: 280px;
  max-width: 520px;
  position: relative;
}

.search-box input {
  width: 100%;
  height: 48px;
  padding: 0 48px 0 20px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 0.9375rem;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.search-box input::placeholder {
  color: #9ca3af;
}

.search-box button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
}

.search-box button:hover {
  background: #f3f4f6;
  color: var(--text);
}

/* ==================== 内容布局 ==================== */
.content-layout {
  display: flex;
  gap: 24px;
}

.content-main {
  flex: 1;
  min-width: 0;
}

.content-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.tool-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  cursor: pointer;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tool-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.tool-card-add {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1;
  transition: all 0.2s;
}

.tool-card-add:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.tool-card-body {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-icon {
  width: 100px;
  height: 100px;
  color: var(--primary);
  opacity: 0.85;
}

.tool-card-placeholder {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ==================== 广告位 ==================== */
.ad-slot {
  background: #e8e8ed;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 0.8125rem;
  text-align: center;
}

.ad-slot-300x250 {
  width: 300px;
  height: 250px;
}

.ad-slot-300x600 {
  width: 300px;
  height: 600px;
}

/* ==================== 快捷浮动卡片 ==================== */
.float-card {
  background: var(--primary);
  border-radius: var(--radius);
  padding: 16px;
  color: #fff;
  text-align: center;
}

.float-card-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.float-card-text {
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0.9;
}

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

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.footer-links a {
  transition: color 0.2s;
}

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

.footer-divider {
  color: #d1d5db;
}

/* ==================== 面包屑 ==================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

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

.breadcrumb-current {
  color: var(--text);
  font-weight: 500;
}

/* ==================== 工具页面框架 ==================== */
.tool-page {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  min-height: 400px;
}

.tool-page-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.tool-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.tool-page-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.tool-workspace {
  min-height: 300px;
  background: #fafafa;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ==================== 分类页 ==================== */
.category-header {
  margin-bottom: 24px;
}

.category-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.category-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
  .content-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .navbar-inner {
    padding: 0 16px;
    height: 56px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .search-box {
    width: 100%;
    max-width: none;
  }

  .main-container {
    padding: 20px 16px;
  }

  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .tool-card {
    padding: 16px;
  }

  .tool-card-body {
    height: 100px;
  }

  .tool-icon {
    width: 72px;
    height: 72px;
  }
}

/* ==================== 移动端菜单 ==================== */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover {
  background: #f3f4f6;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }
}
