/* 小卡工具 · 全局样式（简约卡片风） */
:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --border: #eef1f5;
  --primary: #4f6ef7;
  --primary-2: #22c1a3;
  --gradient: linear-gradient(135deg, #4f6ef7 0%, #22c1a3 100%);
  --radius: 16px;
  --shadow: 0 2px 12px rgba(17, 24, 39, 0.06);
  --shadow-hover: 0 14px 32px -10px rgba(79, 110, 247, 0.22);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

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

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.25rem; font-weight: 700; letter-spacing: -0.3px;
}

.logo-dot {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--gradient);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem;
  box-shadow: 0 4px 10px rgba(79, 110, 247, 0.3);
}

/* 分类 tab */
.cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

.cat-btn {
  padding: 7px 16px; border-radius: 999px;
  font-size: 0.875rem; color: var(--text-2);
  background: transparent; border: 1px solid transparent;
  cursor: pointer; transition: all 0.15s ease;
  font-family: inherit;
}

.cat-btn:hover { color: var(--text); background: #f0f3f9; }

.cat-btn.active {
  color: #fff; background: var(--gradient);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 110, 247, 0.35);
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 56px 20px 36px; }

.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.7rem);
  font-weight: 800; letter-spacing: -0.5px;
}

.hero h1 .grad {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.hero p {
  margin-top: 12px; color: var(--text-2);
  font-size: 1.05rem;
}

/* 搜索框 */
.search-box {
  margin: 26px auto 0; max-width: 480px; position: relative;
}

.search-box input {
  width: 100%; padding: 13px 18px 13px 46px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); font-size: 0.95rem; color: var(--text);
  box-shadow: var(--shadow); outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  font-family: inherit;
}

.search-box input:focus {
  border-color: rgba(79, 110, 247, 0.5);
  box-shadow: 0 0 0 4px rgba(79, 110, 247, 0.12);
}

.search-box .search-icon {
  position: absolute; left: 17px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-3); pointer-events: none;
}

/* ---------- 工具卡片网格 ---------- */
main { flex: 1; padding-bottom: 56px; }

.tool-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.tool-card {
  background: var(--card); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 6px 14px rgba(79, 110, 247, 0.28);
}

.card-icon svg { width: 24px; height: 24px; }

.card-title-row { display: flex; align-items: center; gap: 8px; }

.card-title-row h3 { font-size: 1.05rem; font-weight: 700; }

.cat-tag {
  font-size: 0.72rem; padding: 2px 8px; border-radius: 999px;
  font-weight: 600; flex-shrink: 0;
}

.cat-视频 { background: #eaf2ff; color: #3b6fe0; }
.cat-音频 { background: #e9f9f4; color: #0f9d76; }
.cat-图片 { background: #fff3e8; color: #e07c2f; }
.cat-其他 { background: #eef0f4; color: #5c6b7f; }
.cat-抖音工具 { background: #efefff; color: #5b5bd6; }
.cat-脚本 { background: #fff0f5; color: #d63384; }

.tool-card p {
  color: var(--text-2); font-size: 0.875rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.6em;
}

.card-foot {
  margin-top: auto; display: flex; align-items: center;
  justify-content: space-between;
}

.badge {
  font-size: 0.75rem; padding: 4px 10px; border-radius: 999px; font-weight: 600;
}

.badge-upcoming { background: #f2f4f7; color: var(--text-3); }

.badge-online { background: #e6f9f0; color: #0f9d76; }

.card-arrow {
  color: var(--text-3); font-size: 1rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.tool-card:hover .card-arrow { transform: translateX(3px); color: var(--primary); }

/* 空状态 */
.empty { text-align: center; color: var(--text-3); padding: 60px 0; font-size: 0.95rem; }

/* ---------- 详情页 ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-2); font-size: 0.9rem; margin: 26px 0 18px;
  transition: color 0.15s ease;
}

.back-link:hover { color: var(--primary); }

.detail-card {
  background: var(--card); border-radius: 20px;
  padding: 32px; box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.detail-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }

.detail-head .card-icon { width: 64px; height: 64px; border-radius: 16px; }
.detail-head .card-icon svg { width: 32px; height: 32px; }

.detail-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.detail-title-row h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.3px; }

.detail-desc { color: var(--text-2); margin-top: 8px; font-size: 1rem; }

.detail-sections {
  display: grid; gap: 16px; margin-top: 28px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.detail-sections section {
  background: #fafbfd; border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
}

.detail-sections h2 {
  font-size: 0.95rem; font-weight: 700; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}

.detail-sections h2::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: var(--gradient);
}

.detail-sections ul, .detail-sections ol {
  list-style: none; display: flex; flex-direction: column; gap: 10px;
}

.detail-sections li {
  font-size: 0.9rem; color: var(--text-2);
  display: flex; gap: 10px; align-items: flex-start;
}

.detail-sections ul li::before {
  content: "✓"; color: var(--primary-2); font-weight: 700; flex-shrink: 0;
}

.detail-sections ol { counter-reset: step; }

.detail-sections ol li { counter-increment: step; }

.detail-sections ol li::before {
  content: counter(step);
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: #e8edfc; color: var(--primary);
  font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* 功能介绍（图文交替区） */
.media-area { margin-top: 28px; }

.media-area h2 {
  font-size: 0.95rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}

.media-area h2::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: var(--gradient);
}

.media-rows { display: flex; flex-direction: column; gap: 30px; margin-top: 18px; }

.media-row { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }

.media-row.flipped .media-img { order: 2; }

.media-img img {
  width: 100%; border-radius: 14px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  cursor: zoom-in;
}

/* 图片放大遮罩 */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(17, 24, 39, 0.88);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
  animation: lb-fade 0.2s ease;
}

.lightbox img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox .lb-close {
  position: fixed; top: 18px; right: 26px;
  color: #fff; font-size: 1.6rem; cursor: pointer; opacity: 0.85;
}

.lightbox .lb-close:hover { opacity: 1; }

@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }

.media-text h3 { font-size: 1.15rem; margin-bottom: 10px; }

.media-text p { color: var(--text-2); font-size: 0.92rem; line-height: 1.8; }

/* 联系作者（全宽） */
.contact-card {
  background: #fafbfd; border: 1px solid var(--border);
  border-radius: 14px; padding: 20px; margin-top: 16px;
}

.contact-card h2 {
  font-size: 0.95rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}

.contact-card h2::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: var(--gradient);
}

.qr-center { justify-content: center; margin-top: 14px; }

/* 联系作者二维码 */
.qr-tip { font-size: 0.85rem; color: var(--text-3); margin-bottom: 12px; }

.qr-grid { display: flex; gap: 14px; flex-wrap: wrap; }

.qr-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 10px 12px; text-align: center;
}

.qr-card img {
  width: 150px; height: auto; display: block;
  border-radius: 8px; background: #fff;
}

.qr-label { margin-top: 8px; font-size: 0.8rem; color: var(--text-2); font-weight: 600; }

.detail-cta { margin-top: 28px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 28px; border-radius: 999px;
  font-size: 1rem; font-weight: 600; font-family: inherit;
  border: none; cursor: pointer; transition: all 0.2s ease;
}

.btn.cta {
  background: var(--gradient); color: #fff;
  box-shadow: 0 8px 20px rgba(79, 110, 247, 0.35);
}

.btn.cta:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(79, 110, 247, 0.45); }

.btn.cta.disabled {
  background: #e5e7eb; color: var(--text-3);
  box-shadow: none; cursor: not-allowed; transform: none;
}

.cta-note { color: var(--text-3); font-size: 0.85rem; }

/* 未找到 */
.not-found { text-align: center; padding: 80px 0; }

.not-found h2 { font-size: 1.3rem; margin-bottom: 20px; color: var(--text-2); }

.not-found .btn { background: var(--gradient); color: #fff; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 20px 34px;
  text-align: center; color: var(--text-3);
  font-size: 0.83rem;
}

.site-footer .footer-line { margin: 3px 0; }

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

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .hero { padding: 40px 16px 28px; }
  .detail-card { padding: 22px; }
  .header-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
  .media-row { grid-template-columns: 1fr; gap: 16px; }
  .media-row.flipped .media-img { order: 0; }
}
