/* ============================================================
   AI Compass Guide — Site Stylesheet
   Brand colors: blue #2563eb / cyan #06b6d4 on light background
   ============================================================ */

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --cyan: #06b6d4;
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --line: #e2e8f0;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --font: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

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

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); }
.brand .logo-img { height: 58px; width: auto; display: block; }
.brand .logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px;
}

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  padding: 8px 12px; border-radius: 8px; color: var(--ink-soft);
  font-weight: 600; font-size: 14.5px;
}
.nav a:hover { background: #eff6ff; color: var(--blue); }
.nav a.lang-switch { background: #eef2ff; color: var(--blue-dark); }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 16px; cursor: pointer; }

/* ---------- Category bar (row 2 of header) ---------- */
.catbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 6px 0 12px;
}
.catbar a {
  padding: 5px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  color: var(--ink-soft); background: #f1f5f9; border: 1px solid var(--line);
  white-space: nowrap; transition: color .15s, background .15s, border-color .15s;
}
.catbar a:hover { background: #eff6ff; color: var(--blue); border-color: #bfdbfe; }

/* ---------- Tool icons & star badges ---------- */
.tool-icon { width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; object-fit: contain; }
.star-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 700; color: #92400e;
  background: #fef3c7; border: 1px solid #fde68a; border-radius: 999px; padding: 1px 8px;
  white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 55%, #f8fafc 100%);
  border-bottom: 1px solid var(--line);
  padding: 72px 0 56px;
  text-align: center;
}
.hero .hero-logo { display: flex; justify-content: center; margin-bottom: 26px; }
.hero .hero-logo img { width: 320px; max-width: 100%; height: auto; mix-blend-mode: multiply; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.2; font-weight: 800; letter-spacing: -.5px; }
.hero h1 .grad {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.sub { font-size: clamp(16px, 2.4vw, 19px); color: var(--ink-soft); max-width: 680px; margin: 18px auto 0; }
.hero .cta-row { margin-top: 28px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 999px;
  font-weight: 700; font-size: 15px; transition: transform .15s, box-shadow .15s;
}
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(37,99,235,.25); }
.btn-primary:hover { background: var(--blue-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--blue-dark); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.section-head .more { font-size: 14.5px; font-weight: 600; }

/* ---------- Category chips ---------- */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.chip {
  padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
}
.chip:hover { border-color: var(--blue); color: var(--blue); background: #eff6ff; }

/* ---------- Article cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(15,23,42,.1); }
.card .cover { aspect-ratio: 16/9; overflow: hidden; background: #e2e8f0; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .tag {
  align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--blue); background: #eff6ff; border-radius: 6px; padding: 3px 9px;
}
.card h3 { font-size: 17.5px; line-height: 1.4; font-weight: 700; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--blue); }
.card p.excerpt { font-size: 14px; color: var(--ink-soft); flex: 1; }
.card .meta { font-size: 12.5px; color: #94a3b8; display: flex; gap: 10px; align-items: center; }

/* ---------- Article page ---------- */
.article-wrap { max-width: 760px; margin: 0 auto; padding: 40px 20px 64px; }
.crumb { font-size: 13.5px; color: #94a3b8; margin-bottom: 18px; }
.crumb a { color: var(--blue); }
.article-head h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.25; font-weight: 800; letter-spacing: -.4px; margin-bottom: 14px; }
.article-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-soft); margin-bottom: 20px; }
.article-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: #cbd5e1; }
.article-cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; box-shadow: var(--shadow); }

.article-body { font-size: 17px; color: #1e293b; }
.article-body h2 { font-size: 25px; font-weight: 800; margin: 40px 0 16px; letter-spacing: -.3px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.article-body h3 { font-size: 20px; font-weight: 700; margin: 30px 0 12px; }
.article-body p { margin-bottom: 18px; }
.article-body ul, .article-body ol { margin: 0 0 20px 22px; }
.article-body li { margin-bottom: 8px; }
.article-body strong { color: var(--ink); }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote {
  border-left: 4px solid var(--cyan); background: #f0f9ff; padding: 14px 18px;
  border-radius: 0 10px 10px 0; margin: 0 0 20px; color: var(--ink-soft);
}
.article-body table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 15px; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.article-body th { background: #f1f5f9; font-weight: 700; }
.article-body tr:nth-child(even) td { background: #fafbfc; }

/* ---------- Ad slots (placeholder for Google AdSense) ---------- */
.ad-slot {
  margin: 34px 0; min-height: 120px; border-radius: 12px;
  background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 12px, #e2e8f0 12px, #e2e8f0 24px);
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: 13px; letter-spacing: .5px;
}
/* ===== Paste your Google AdSense <ins> code inside this element after approval ===== */

/* ---------- Article images ---------- */
.article-img { margin: 30px 0; }
.article-img img { width: 100%; height: auto; border-radius: 14px; box-shadow: 0 10px 30px rgba(2, 132, 199, .12); }
.article-img figcaption { font-size: 13px; color: var(--ink-soft); text-align: center; margin-top: 10px; }

/* ---------- Official websites (anti-phishing) ---------- */
.official-sites {
  margin: 36px 0 8px; padding: 24px 26px; border-radius: 16px;
  background: linear-gradient(180deg, #f0f9ff, #f8fafc); border: 1px solid #bae6fd;
}
.official-sites h2 { font-size: 20px; font-weight: 800; color: var(--ink); }
.official-warn { font-size: 14px; color: var(--ink-soft); margin: 8px 0 18px; }
.official-sites h3 { font-size: 15px; font-weight: 700; color: var(--blue); margin: 18px 0 8px; }
.official-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 18px; }
.official-list li {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-size: 14.5px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.official-list a { color: var(--blue); font-weight: 700; text-decoration: none; }
.official-list a:hover { text-decoration: underline; }
.official-url { color: #94a3b8; font-size: 12.5px; margin-left: auto; }

/* ---------- Tools directory page ---------- */
.page-title { font-size: 30px; font-weight: 800; margin-bottom: 10px; }
.dir-note { color: var(--blue); font-weight: 600; margin-bottom: 26px; }
.dir-cat { margin: 20px 0 10px; }
.dir-cat h2 { font-size: 17px; font-weight: 800; color: var(--ink); border-bottom: 2px solid #bae6fd; padding-bottom: 8px; margin-bottom: 12px; }
.archive-list { list-style: none; padding: 0; margin: 0; }
.archive-list li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.archive-list a { color: var(--ink); font-weight: 600; text-decoration: none; }
.archive-list a:hover { color: var(--blue); }
.archive-list .meta { font-size: 13px; color: #94a3b8; white-space: nowrap; }
.tool-desc { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
/* Tools directory cards: vertical layout inside a wider card, desc on its own line */
.dir-page .official-list { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px 20px; }
.dir-page .official-list li { display: block; padding: 14px 16px; }
.dir-page .official-list li a { display: inline; font-size: 15.5px; }
.dir-page .official-list .official-url { display: inline-block; margin-left: auto; }
.dir-page .tool-desc { font-size: 13.5px; line-height: 1.65; margin-top: 8px; }
.dir-page .tool-head { display: flex; align-items: center; gap: 10px; }
.dir-page .tool-head .tool-icon { width: 24px; height: 24px; }
.dir-page .tool-head .star-badge { margin-left: 4px; }
.hot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.hot-card {
  display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto;
  column-gap: 12px; row-gap: 2px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; text-decoration: none; transition: box-shadow .15s, transform .15s;
}
.hot-card:hover { box-shadow: 0 10px 28px rgba(15,23,42,.1); transform: translateY(-2px); }
.hot-card .tool-icon { grid-row: 1 / span 2; width: 34px; height: 34px; }
.hot-head { grid-column: 2; display: flex; align-items: center; gap: 8px; min-width: 0; }
.hot-head strong { font-size: 16px; color: var(--blue); }
.hot-desc { grid-column: 2; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }

/* ---------- New Tools strip (home) ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool-card {
  display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto;
  column-gap: 12px; row-gap: 2px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; text-decoration: none; transition: box-shadow .15s, transform .15s;
}
.tool-card:hover { box-shadow: 0 10px 28px rgba(15,23,42,.1); transform: translateY(-2px); }
.tool-card .tool-icon { grid-row: 1 / span 2; width: 34px; height: 34px; }
.tool-card-name { grid-column: 2; font-size: 15px; font-weight: 700; color: var(--blue); }
.tool-card-desc { grid-column: 2; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }

/* ---------- Home AI news strip ---------- */
.home-news .news-item { padding: 11px 0; display: flex; align-items: center; gap: 10px; }
.home-news .news-item a { font-size: 15px; font-weight: 600; }
.news-thumb-mini { width: 64px; height: 36px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }

/* ---------- AI News page cards ---------- */
.news-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.news-card {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s;
}
.news-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(15,23,42,.1); }
.news-card .news-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.news-card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-card-body .news-date { align-self: flex-start; }
.news-card h2 { font-size: 16.5px; line-height: 1.45; font-weight: 700; }
.news-card h2 a { color: var(--ink); }
.news-card h2 a:hover { color: var(--blue); }
.news-card .news-summary { margin-top: auto; font-size: 13.5px; line-height: 1.6; }
.news-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); color: #fff; border-radius: 16px; padding: 24px 26px; margin: 6px 0 24px; }
.news-header h1 { margin: 0; font-size: 27px; line-height: 1.25; color: #fff; }
.news-header p { margin: 7px 0 0; font-size: 14.5px; color: #cbd5e1; }
.news-updated { font-size: 12.5px; font-weight: 700; color: #93c5fd; background: rgba(255,255,255,.12); border: 1px solid rgba(147,197,253,.35); border-radius: 10px; padding: 7px 13px; white-space: nowrap; }
.news-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.news-tag { display: inline-block; font-size: 11.5px; font-weight: 700; color: #1e40af; background: #dbeafe; border-radius: 6px; padding: 2px 8px; }
.news-latest { display: inline-block; font-size: 11px; font-weight: 800; color: #fff; background: #dc2626; border-radius: 6px; padding: 2px 8px; letter-spacing: .4px; }
.news-card-body .news-date { align-self: flex-start; margin-right: 0; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.news-item a { font-size: 16.5px; font-weight: 700; color: var(--ink); text-decoration: none; }
.news-item a:hover { color: var(--blue); }
.news-date { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--blue); background: #eff6ff; border-radius: 6px; padding: 2px 8px; margin-right: 10px; }
.news-summary { font-size: 14px; color: var(--ink-soft); margin: 7px 0 0; line-height: 1.6; }
.aff-block { margin-top: 28px; padding: 18px 20px; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 14px; }
.aff-block h3 { font-size: 15px; font-weight: 700; color: var(--blue); margin: 0 0 12px; }
.aff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.aff-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.aff-card:hover { box-shadow: 0 8px 20px rgba(2,132,199,.12); transform: translateY(-2px); }
.aff-card strong { font-size: 15px; color: var(--blue); }
.aff-card span { font-size: 12.5px; color: var(--ink-soft); }
.official-sites.dir-page { background: #fff; box-shadow: 0 6px 24px rgba(2, 132, 199, .06); }
.page { padding: 48px 0 64px; }

/* ---------- Related ---------- */
.related { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.related h3 { font-size: 20px; font-weight: 800; margin-bottom: 16px; }
.related .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

/* ---------- Footer ---------- */
.footer { background: #0f172a; color: #94a3b8; margin-top: 40px; padding: 44px 0 36px; }
.footer-inner { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.footer .f-brand { font-weight: 800; color: #fff; font-size: 17px; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.footer .f-brand .logo-img { height: 42px; width: auto; display: block; }
.footer p { font-size: 13.5px; max-width: 380px; }
.footer .f-links { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer .f-links a { color: #cbd5e1; }
.footer .f-links a:hover { color: #fff; }
.footer .f-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid #1e293b; font-size: 12.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; flex-direction: column; align-items: flex-start; }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
  .catbar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 6px 0 12px; }
  .catbar::-webkit-scrollbar { display: none; }
  .hero { padding: 48px 0 40px; }
  .section { padding: 36px 0; }
}
