/* ==========================================================================
   简单设计 · 工具站矩阵共用样式 (_shared.css)
   --------------------------------------------------------------------------
   设计语言：Apple / Arc Browser —— 大留白、少边框、弱阴影、大圆角
   主色 #6366f1（简单设计品牌色）
   三工具页（compress / qrcode / matting）+ 导航页 index 共用此文件
   ========================================================================== */

/* ============ 设计变量（设计文档 2.1 / 2.3 节） ============ */
:root {
  /* 品牌色 */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #f5f3ff;
  --primary-soft: #eef2ff;

  /* 中性色 */
  --text: #1f2937;
  --text-light: #6b7280;
  --text-lighter: #9ca3af;
  --border: #e5e7eb;
  --border-soft: #f0f1f3;
  --bg: #ffffff;
  --bg-soft: #f9fafb;

  /* 圆角 */
  --radius-card: 16px;
  --radius-btn: 10px;
  --radius-sm: 8px;

  /* 阴影（弱阴影，不抢戏） */
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 4px 16px rgba(99, 102, 241, 0.12);

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;

  /* 容器 */
  --container-width: 960px;
}

/* ============ 基础重置 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
main { flex: 1 0 auto; }

/* ============ 顶部导航（.top-nav，设计文档 2.3 节） ============ */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.top-nav-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.nav-brand:hover { color: var(--primary); }
.nav-brand-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.nav-tab {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  border-radius: var(--radius-btn);
  border: none;
  background: transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--text); background: var(--bg-soft); }
.nav-tab.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}
.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ============ 按钮（.btn-primary / .btn-ghost） ============ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-btn);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.28);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-ghost:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}
.btn-primary:focus-visible,
.btn-ghost:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============ Hero 区 ============ */
.hero {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 56px 24px 32px;
  text-align: center;
}
.hero h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 14px;
}
.hero-sub {
  font-size: 17px;
  color: var(--text-light);
  max-width: 640px;
  margin: 0 auto;
}

/* ============ 工具卡片（.tool-card） ============ */
.tools-grid {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 8px 24px 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  text-align: left;
}
.tool-card:hover {
  border-color: #c7d2fe;
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.tool-card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: var(--primary-light);
  border-radius: 14px;
  margin-bottom: 18px;
}
.tool-card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.tool-card-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 20px;
}
.tool-card .btn-primary { align-self: flex-start; }

/* ============ 拖拽上传区（.drop-zone，后续批次用） ============ */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-soft);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.drop-zone-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.drop-zone-text {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}
.drop-zone-hint {
  font-size: 13px;
  color: var(--text-lighter);
}

/* ============ 广告位（.ad-slot，设计文档第十章 10.3 节） ============ */
/* 初期空容器，不加载任何广告脚本；联盟通过后在此注入代码 */
.ad-slot {
  margin: 12px auto 16px;
  max-width: 728px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: opacity 200ms ease;
  opacity: 1;
}
/* hidden 用 display:none 彻底移出布局，不占空间 */
.ad-slot[hidden] {
  display: none;
}
/* 移动端适配：728×90 自动降级为 320×50 */
@media (max-width: 728px) {
  .ad-slot {
    min-height: 50px;
    max-width: 320px;
  }
}
/* 尊重用户"减少动态"偏好：禁用过渡动画 */
@media (prefers-reduced-motion: reduce) {
  .ad-slot {
    transition: none;
  }
}

/* ============ 标准底部 Footer（.site-footer，设计文档 2.4 节） ============ */
.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
  padding: 28px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-lighter);
}
.footer-inner {
  max-width: var(--container-width);
  margin: 0 auto;
}
.footer-brand {
  margin-bottom: 10px;
  color: var(--text-light);
}
.footer-links {
  margin-bottom: 10px;
  line-height: 2;
}
.footer-links a {
  margin: 0 6px;
  color: var(--text-light);
}
.footer-links a:hover {
  color: var(--primary);
}
.footer-icp a {
  color: var(--text-lighter);
}
.footer-icp a:hover {
  color: var(--text-light);
}

/* ============ 响应式（768px / 728px 断点） ============ */
@media (max-width: 768px) {
  .top-nav-inner {
    flex-wrap: wrap;
    padding: 12px 16px;
  }
  .nav-tabs {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .hero {
    padding: 40px 16px 24px;
  }
  .hero h1 {
    font-size: 28px;
  }
  .hero-sub {
    font-size: 15px;
  }
  .tools-grid {
    grid-template-columns: 1fr;
    padding: 8px 16px 32px;
    gap: 16px;
  }
  .tool-card {
    padding: 22px 20px;
  }
}

@media (max-width: 728px) {
  .hero h1 {
    font-size: 24px;
  }
}
