/* ============================================================
   Parrot Toolbox — Shared Design System
   Zero external deps, system font stack, responsive all screens.
   ============================================================ */

:root {
  /* Palette — parrot green + warm orange + off-white */
  --green-700: #237a37;
  --green-600: #2f9e44;
  --green-500: #40c057;
  --green-200: #b2f2bb;
  --green-100: #d3f9d8;
  --green-50:  #ebfbee;

  --orange-600: #e8590c;
  --orange-500: #f76707;
  --orange-100: #ffe8cc;
  --orange-50:  #fff4e6;

  --bg:    #f7f9f7;
  --card:  #ffffff;
  --ink:   #1f2d1f;
  --ink-2: #3a4a3a;
  --muted: #647564;
  --line:  #e2ebe2;
  --line-2:#eef4ee;

  --red:    #e03131;
  --red-50: #fff0f0;
  --yellow:#e8a400;
  --yellow-50:#fff9db;

  /* Shape & depth */
  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow:    0 1px 2px rgba(31,45,31,.05), 0 6px 20px rgba(31,45,31,.06);
  --shadow-lg: 0 4px 10px rgba(31,45,31,.06), 0 18px 44px rgba(31,45,31,.10);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans JP",
          "Helvetica Neue", Arial, sans-serif;

  --wrap: 1140px;
  --nav-h: 62px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

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

img, svg, canvas, video { max-width: 100%; display: block; }
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-600); }

h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
.container { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------- Top navigation ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 20px;
  height: var(--nav-h); display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); font-size: 18px; }
.brand:hover { color: var(--ink); }
.brand svg { width: 30px; height: 30px; }
.brand small { font-weight: 600; color: var(--muted); font-size: 12px; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  color: var(--ink-2); padding: 8px 11px; border-radius: 9px;
  font-size: 14.5px; font-weight: 500; white-space: nowrap;
}
.nav-links a:hover { background: var(--green-50); color: var(--green-700); }
.nav-links a.active { background: var(--green-100); color: var(--green-700); }

.lang-switch { display: flex; align-items: center; gap: 2px; margin-left: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang-switch button {
  border: 0; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 4px 9px; border-radius: 999px;
}
.lang-switch button.active { background: var(--green-600); color: #fff; }

.fav-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  background: var(--orange-500); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-align: center; line-height: 18px;
}

.nav-toggle { display: none; margin-left: auto; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle svg { width: 26px; height: 26px; stroke: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  border-radius: 999px; padding: 11px 22px; border: 1px solid transparent;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-600); color: #fff; }
.btn-primary:hover { background: var(--green-700); color: #fff; }
.btn-ghost { background: #fff; color: var(--green-700); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green-500); background: var(--green-50); }
.btn-orange { background: var(--orange-500); color: #fff; }
.btn-orange:hover { background: var(--orange-600); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 46px); letter-spacing: -.5px; margin-bottom: 14px; }
.hero h1 .accent { color: var(--green-600); }
.hero p.lead { font-size: clamp(15px, 2.2vw, 18px); color: var(--muted); max-width: 640px; margin: 0 auto 26px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.trust-row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.trust-pill { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 13.5px; color: var(--ink-2); }
.trust-pill svg { width: 17px; height: 17px; color: var(--green-600); }

/* ---------- Section headings ---------- */
.section { padding: 34px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(21px, 3vw, 28px); margin: 0; }
.section-head .more { font-size: 14px; font-weight: 600; }

/* ---------- Tool card grid ---------- */
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1024px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .card-grid { grid-template-columns: 1fr; } }

.tool-card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 18px 18px; box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  display: flex; flex-direction: column;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--green-200); }
.tool-card .tool-icon {
  width: 46px; height: 46px; border-radius: 12px; background: var(--green-50);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.tool-card .tool-icon svg { width: 26px; height: 26px; stroke: var(--green-600); }
.tool-card .tool-icon-img {
  width: calc(100% + 36px); height: 140px; object-fit: cover;
  border-radius: 12px 12px 0 0; margin: -20px -18px 14px -18px;
  display: block; background: #f0f7f0;
}
.tool-card h3 { font-size: 17px; margin-bottom: 6px; }
.tool-card p { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; flex: 1; }
.tool-card .tool-cat {
  align-self: flex-start; font-size: 11.5px; font-weight: 600; color: var(--green-700);
  background: var(--green-100); padding: 3px 10px; border-radius: 999px;
}
.tool-card-body { display: flex; flex-direction: column; color: inherit; }
.tool-card-body:hover { color: inherit; }

/* star favorite */
.fav-star {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.fav-star svg { width: 17px; height: 17px; stroke: var(--muted); fill: none; }
.fav-star.on { background: var(--orange-50); border-color: var(--orange-100); }
.fav-star.on svg { stroke: var(--orange-500); fill: var(--orange-500); }

/* ---------- Buttons row / filter chips ---------- */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 999px; padding: 7px 15px; font-size: 13.5px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}
.chip:hover { border-color: var(--green-500); }
.chip.active { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.chip.fav.active { background: var(--orange-500); border-color: var(--orange-500); }

/* ---------- Generic panels / tool layout ---------- */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}
.tool-hero { padding: 36px 0 8px; }
.tool-hero .crumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.tool-hero h1 { font-size: clamp(24px, 4vw, 34px); margin-bottom: 8px; }
.tool-hero p { color: var(--muted); max-width: 720px; }
.tool-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .tool-grid { grid-template-columns: 1fr; } }

/* forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 15px; background: #fff; color: var(--ink);
}
.input:focus { outline: 2px solid var(--green-200); border-color: var(--green-500); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

/* callouts */
.callout { border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; margin: 14px 0; border: 1px solid; }
.callout-info { background: var(--green-50); border-color: var(--green-100); color: var(--green-700); }
.callout-warn { background: var(--yellow-50); border-color: #f3e7b0; color: #7a5c00; }
.callout-danger { background: var(--red-50); border-color: #ffd3d3; color: #b32121; }
.callout strong { font-weight: 700; }

/* results */
.result-box { background: var(--green-50); border: 1px dashed var(--green-200); border-radius: var(--radius-sm); padding: 18px; }
.result-big { font-size: 30px; font-weight: 800; color: var(--green-700); }
.muted { color: var(--muted); font-size: 13.5px; }

/* score ring */
.ring-wrap { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; color: var(--ink); }

/* progress bar */
.bar { background: var(--line-2); border-radius: 999px; height: 10px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--green-500); border-radius: 999px; transition: width .3s ease; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
table.tbl th, table.tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-2); }
table.tbl th { background: var(--green-50); font-weight: 700; color: var(--green-700); white-space: nowrap; }
table.tbl tr:last-child td { border-bottom: 0; }

/* tags */
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--green-100); color: var(--green-700); margin-right: 4px; }
.tag.warn { background: var(--orange-100); color: var(--orange-600); }
.tag.bad  { background: var(--red-50); color: var(--red); }
.tag.ok   { background: var(--green-100); color: var(--green-700); }

/* ---------- Ad slot ---------- */
.ad-slot {
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: #fbfdfb; min-height: 90px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; margin: 22px 0; position: relative; overflow: hidden;
}
.ad-slot::before {
  content: "AD"; position: absolute; top: 6px; left: 8px; font-size: 10px;
  letter-spacing: 1px; color: #b6c4b6; font-weight: 700;
}
.ad-slot .ad-inner { width: 100%; }

/* ---------- Article pages ---------- */
.article-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13.5px; margin-bottom: 8px; }
article.prose { max-width: 780px; margin: 0 auto; }
article.prose h2 { font-size: 22px; margin-top: 1.6em; padding-top: .4em; border-top: 1px solid var(--line-2); }
article.prose h3 { font-size: 17.5px; margin-top: 1.4em; }
article.prose ul, article.prose ol { padding-left: 22px; }
article.prose li { margin-bottom: 6px; }
article.prose blockquote { border-left: 3px solid var(--green-500); margin: 16px 0; padding: 4px 18px; background: var(--green-50); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-2); }
.article-lang-tabs { display: flex; gap: 6px; margin: 18px 0; }
.article-body section[data-lang] { display: none; }
html.article-lang-en .article-body section[data-lang="en"] { display: block; }
html.article-lang-zh .article-body section[data-lang="zh"] { display: block; }
html.article-lang-ja .article-body section[data-lang="ja"] { display: block; }

/* article list cards */
.post-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); overflow: hidden; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--green-200); }
.post-card-img {
  width: calc(100% + 40px); height: 150px; object-fit: cover;
  border-radius: 15px 15px 0 0; margin: -20px -20px 16px -20px;
  display: block; background: #f0f7f0;
}
.post-card h3 { font-size: 17.5px; }
.post-card p { font-size: 14px; color: var(--muted); flex: 1; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; border-top: 1px solid var(--line); background: #fff; padding: 34px 0 26px; font-size: 13.5px; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { font-size: 13.5px; color: var(--ink); margin-bottom: 10px; }
.footer-grid a { display: block; color: var(--muted); padding: 3px 0; }
.footer-grid a:hover { color: var(--green-700); }
.footer-bottom { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line-2); display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: space-between; align-items: flex-start; }
.footer-bottom > span { min-width: 0; line-height: 1.7; }
/* narrow screens: stack legal info vertically so it never overlaps */
@media (max-width: 640px) {
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-bottom > span { width: 100%; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state svg { width: 56px; height: 56px; margin: 0 auto 14px; stroke: var(--line); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.checklist li { list-style: none; }
.checklist { padding-left: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.checklist input { margin-top: 5px; width: 17px; height: 17px; accent-color: var(--green-600); }

/* ---------- Mobile nav ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 12px 20px 18px; gap: 2px;
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .18s ease;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 11px 12px; }
  .lang-switch { margin: 8px 0 0; align-self: flex-start; }
}

/* utility */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Overseas breed spotlight ---------- */
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 22px; }
.stat-pill {
  flex: 1 1 190px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 16px; box-shadow: var(--shadow);
}
.stat-pill strong { display: block; font-size: 23px; line-height: 1.2; color: var(--green-700); }
.stat-pill span { font-size: 12.5px; color: var(--muted); }

.breed-card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.breed-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--green-200); }
.breed-card > img { width: 100%; height: 150px; object-fit: cover; display: block; background: #f0f7f0; }
.breed-card .breed-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.breed-card .breed-body .tag { align-self: flex-start; margin-bottom: 8px; }
.breed-card h3 { font-size: 16.5px; margin: 0 0 6px; }
.breed-card p { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; flex: 1; }
.breed-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.breed-facts span {
  font-size: 11.5px; color: var(--ink-2); background: var(--green-50);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 9px;
}

/* ---------- Consent banner ---------- */
.consent-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(31,45,31,.10); padding: 14px 0;
}
.consent-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 20px;
  display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.consent-copy { max-width: 740px; }
.consent-copy strong { font-size: 15px; }
.consent-copy p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.consent-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
