/* ============================================================
   Royal Mount Flavors — Global Stylesheet
   GUANGZHOU ROYAL MOUNT TECHNOLOGY CO., LIMITED
   ============================================================ */
:root {
  --green: #17843b;
  --green-dark: #0e5c28;
  --green-light: #e8f5ec;
  --green-mid: #3aa65c;
  --ink: #1c2420;
  --ink-soft: #4a5550;
  --muted: #7a857f;
  --bg: #ffffff;
  --bg-soft: #f5f8f6;
  --line: #e2eae5;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(14, 92, 40, 0.08);
  --maxw: 1180px;
  font-size: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.topbar {
  background: var(--green-dark);
  color: #d9efe0;
  font-size: 0.82rem;
  padding: 6px 0;
}
.topbar .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topbar a { color: #fff; }
header.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 24px; max-width: var(--maxw); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 52px; width: auto; }
.brand-text { line-height: 1.2; }
.brand-text strong { display: block; font-size: 1.02rem; color: var(--green-dark); letter-spacing: 0.3px; }
.brand-text span { font-size: 0.74rem; color: var(--muted); letter-spacing: 0.6px; text-transform: uppercase; }
nav.main-nav ul { list-style: none; display: flex; gap: 6px; flex-wrap: wrap; }
nav.main-nav a {
  display: block; padding: 9px 14px; border-radius: 8px;
  color: var(--ink); font-weight: 600; font-size: 0.95rem;
}
nav.main-nav a:hover, nav.main-nav a[aria-current="page"] { background: var(--green-light); color: var(--green-dark); text-decoration: none; }
.nav-cta {
  background: var(--green); color: #fff !important; border-radius: 8px;
  padding: 10px 18px !important; font-weight: 700;
}
.nav-cta:hover { background: var(--green-dark); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff;
  background: linear-gradient(rgba(10, 46, 22, 0.62), rgba(10, 46, 22, 0.55)),
    url("img/hero-factory-aerial.jpg") center / cover no-repeat;
  padding: 110px 0 120px;
}
.hero .container { max-width: 900px; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); line-height: 1.15; margin-bottom: 18px; }
.hero p.lead { font-size: 1.15rem; max-width: 640px; color: #eaf6ee; margin-bottom: 30px; }
.hero .kicker {
  display: inline-block; background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 5px 14px; border-radius: 999px; font-size: 0.85rem;
  letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 18px;
}
.btn {
  display: inline-block; padding: 13px 28px; border-radius: 10px;
  font-weight: 700; font-size: 1rem; transition: all 0.18s ease;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: #1fa04c; text-decoration: none; transform: translateY(-1px); }
.btn-outline { border: 2px solid rgba(255, 255, 255, 0.8); color: #fff; margin-left: 12px; }
.btn-outline:hover { background: rgba(255, 255, 255, 0.14); text-decoration: none; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); text-decoration: none; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
section.alt { background: var(--bg-soft); }
.section-head { max-width: 760px; margin: 0 auto 44px; text-align: center; }
.section-head .eyebrow {
  color: var(--green); font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase; font-size: 0.8rem; display: block; margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); color: var(--ink); margin-bottom: 12px; }
.section-head p { color: var(--ink-soft); }

/* Cards */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(14, 92, 40, 0.14); }
.card img { width: 100%; height: 200px; object-fit: cover; }
.card-body { padding: 22px 22px 26px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 1.15rem; margin-bottom: 8px; color: var(--green-dark); }
.card-body h3 a { color: inherit; }
.card-body p { color: var(--ink-soft); font-size: 0.95rem; flex: 1; }
.card-body .more { margin-top: 14px; font-weight: 700; }
.icon-card { padding: 28px 24px; text-align: center; }
.icon-card .emoji { font-size: 2.2rem; display: block; margin-bottom: 12px; }
.icon-card h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--ink); }
.icon-card p { font-size: 0.92rem; color: var(--ink-soft); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 2.1rem; color: var(--green); line-height: 1.1; }
.stat span { color: var(--ink-soft); font-size: 0.92rem; }

/* Split layout */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; object-fit: cover; }
.checklist { list-style: none; margin-top: 16px; }
.checklist li { padding: 7px 0 7px 34px; position: relative; color: var(--ink-soft); }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--green-light); color: var(--green-dark);
  font-weight: 800; font-size: 0.8rem; display: flex; align-items: center; justify-content: center;
}

/* Flavor tag chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip {
  background: var(--green-light); color: var(--green-dark);
  padding: 7px 15px; border-radius: 999px; font-size: 0.88rem; font-weight: 600;
  border: 1px solid #cfe8d8;
}

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gallery img { width: 100%; height: 200px; object-fit: cover; border-radius: 10px; transition: transform 0.2s ease; }
.gallery img:hover { transform: scale(1.03); }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; }
details {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 22px; margin-bottom: 12px; box-shadow: var(--shadow);
}
details summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: 1.02rem; list-style: none; position: relative; padding-right: 30px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; position: absolute; right: 4px; top: -2px; font-size: 1.3rem; color: var(--green); font-weight: 400; }
details[open] summary::after { content: "–"; }
details p { margin-top: 10px; color: var(--ink-soft); }

/* CTA band */
.cta-band { background: linear-gradient(135deg, var(--green-dark), var(--green)); color: #fff; text-align: center; }
.cta-band h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 12px; }
.cta-band p { color: #d9efe0; max-width: 620px; margin: 0 auto 26px; }
.cta-band .btn-white { background: #fff; color: var(--green-dark); }
.cta-band .btn-white:hover { background: #e8f5ec; text-decoration: none; }

/* Contact form */
.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 44px; align-items: start; }
form .field { margin-bottom: 16px; }
form label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
form input, form textarea, form select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
}
form input:focus, form textarea:focus, form select:focus { outline: 2px solid var(--green-mid); border-color: transparent; }
.contact-info-card { background: var(--green-light); border-radius: var(--radius); padding: 30px; }
.contact-info-card h3 { color: var(--green-dark); margin-bottom: 14px; }
.contact-info-card p { margin-bottom: 10px; color: var(--ink-soft); }

/* Breadcrumb */
.breadcrumb { font-size: 0.86rem; color: var(--muted); padding: 18px 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--line); }

/* Page hero (inner pages) */
.page-hero {
  background: linear-gradient(rgba(10, 46, 22, 0.66), rgba(10, 46, 22, 0.6)),
    var(--green-dark) center / cover no-repeat;
  color: #fff; padding: 64px 0 56px;
}
.page-hero h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 10px; }
.page-hero p { color: #d9efe0; max-width: 700px; }

/* Table */
.table-wrap { overflow-x: auto; }
table.flavors { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.flavors th, table.flavors td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
table.flavors th { background: var(--green-light); color: var(--green-dark); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.6px; }
table.flavors tr:last-child td { border-bottom: none; }

/* Footer */
footer.site-footer { background: #10281a; color: #b9cdbf; padding: 56px 0 0; font-size: 0.93rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; padding-bottom: 40px; }
.footer-grid h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: #b9cdbf; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); padding: 18px 0; font-size: 0.84rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* Responsive */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .split, .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .nav-wrap { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn-outline { margin-left: 0; margin-top: 12px; display: block; }
}

/* ---------- Product catalog cards (data/products.json) ---------- */
[data-product-grid] { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
[data-product-grid]:empty::before {
  content: "Loading products…"; color: var(--muted); font-size: 0.9rem;
  grid-column: 1 / -1;
}
.pcard {
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--green);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.pcard:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(14, 92, 40, 0.13); }
.pcard img { width: 100%; height: 150px; object-fit: cover; }
.pcard-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.pcard-body h3 { font-size: 1.02rem; color: var(--green-dark); margin-bottom: 6px; }
.pcard-form {
  display: inline-block; font-size: 0.74rem; letter-spacing: 0.3px;
  background: var(--green-light); color: var(--green-dark);
  padding: 3px 9px; border-radius: 5px; margin-bottom: 10px; font-weight: 600; align-self: flex-start;
}
.pcard-body p { font-size: 0.88rem; color: var(--ink-soft); flex: 1; }
.pcard-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pcard-tags span {
  font-size: 0.72rem; color: var(--muted); border: 1px solid var(--line);
  padding: 2px 7px; border-radius: 999px;
}
.grid-note { color: var(--muted); font-size: 0.88rem; grid-column: 1 / -1; }

/* ---------- Article listing ---------- */
.acard {
  display: grid; grid-template-columns: 320px 1fr; gap: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); margin-bottom: 22px;
  transition: box-shadow 0.18s ease;
}
.acard:hover { box-shadow: 0 14px 34px rgba(14, 92, 40, 0.14); }
.acard-img { display: block; overflow: hidden; }
.acard-img img { width: 100%; height: 100%; min-height: 210px; object-fit: cover; transition: transform 0.25s ease; }
.acard:hover .acard-img img { transform: scale(1.04); }
.acard-body { padding: 24px 28px; display: flex; flex-direction: column; justify-content: center; }
.acard-meta { font-size: 0.78rem; letter-spacing: 1px; text-transform: uppercase; color: var(--green); font-weight: 700; margin-bottom: 8px; }
.acard-body h2 { font-size: 1.25rem; line-height: 1.35; margin-bottom: 10px; }
.acard-body h2 a { color: var(--ink); }
.acard-body h2 a:hover { color: var(--green-dark); text-decoration: none; }
.acard-body p { color: var(--ink-soft); font-size: 0.94rem; }
.acard-body .more { margin-top: 14px; font-weight: 700; }

/* ---------- Article page ---------- */
.article-hero {
  background: linear-gradient(rgba(10, 46, 22, 0.68), rgba(10, 46, 22, 0.62)), var(--green-dark) center / cover no-repeat;
  color: #fff; padding: 60px 0 52px;
}
.article-hero .meta { font-size: 0.8rem; letter-spacing: 1.4px; text-transform: uppercase; color: #a8d8b8; margin-bottom: 12px; }
.article-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.25; max-width: 860px; }
.article-body { max-width: 780px; margin: 0 auto; padding: 56px 24px 20px; }
.article-body p { color: #35403a; margin-bottom: 18px; font-size: 1.02rem; }
.article-body h2 { font-size: 1.45rem; color: var(--green-dark); margin: 38px 0 14px; }
.article-body h3 { font-size: 1.12rem; margin: 26px 0 10px; color: var(--ink); }
.article-body ul, .article-body ol { margin: 0 0 20px 22px; color: #35403a; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  border-left: 4px solid var(--green); background: var(--green-light);
  padding: 16px 22px; margin: 24px 0; border-radius: 0 10px 10px 0; color: var(--green-dark);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 0.94rem; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.article-body th { background: var(--green-light); color: var(--green-dark); }
.article-foot {
  max-width: 780px; margin: 20px auto 0; padding: 24px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.9rem;
}
.article-cta {
  max-width: 780px; margin: 30px auto 70px; padding: 32px;
  background: var(--green-light); border-radius: var(--radius); text-align: center;
}
.article-cta h3 { color: var(--green-dark); margin-bottom: 8px; font-size: 1.2rem; }
.article-cta p { color: var(--ink-soft); margin-bottom: 18px; }
.related { max-width: 780px; margin: 0 auto 70px; padding: 0 24px; }
.related h3 { font-size: 1.1rem; margin-bottom: 14px; color: var(--ink); }

@media (max-width: 960px) {
  [data-product-grid] { grid-template-columns: repeat(2, 1fr); }
  .acard { grid-template-columns: 1fr; }
  .acard-img img { min-height: 190px; }
}
@media (max-width: 600px) {
  [data-product-grid] { grid-template-columns: 1fr; }
}

/* ---------- Compact article grid (Insights listing) ---------- */
.agrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.acard-v {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.acard-v:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(14, 92, 40, 0.14); }
.acard-v .acard-img { display: block; overflow: hidden; }
.acard-v .acard-img img { width: 100%; height: 175px; object-fit: cover; transition: transform 0.25s ease; }
.acard-v:hover .acard-img img { transform: scale(1.05); }
.acard-v .acard-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.acard-v h2 { font-size: 1.02rem; line-height: 1.4; margin-bottom: 0; }
.acard-v h2 a { color: var(--ink); }
.acard-v h2 a:hover { color: var(--green-dark); text-decoration: none; }
.acard-v p {
  font-size: 0.86rem; color: var(--ink-soft); margin-top: 8px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.acard-v .more { margin-top: 12px; font-weight: 700; font-size: 0.88rem; }

/* ---------- Visual blocks inside articles ---------- */
.article-figure { margin: 28px 0; }
.article-figure img { width: 100%; border-radius: 12px; box-shadow: var(--shadow); }
.article-figure figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 8px; text-align: center; }
.keypoints {
  background: var(--green-light); border-radius: 12px;
  padding: 20px 24px; margin: 26px 0;
}
.keypoints h3 { margin: 0 0 10px !important; color: var(--green-dark); font-size: 1.05rem; }
.keypoints ul, .keypoints ol { margin: 0 0 0 20px !important; }
.img-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 26px 0; }
.img-row img { width: 100%; height: 200px; object-fit: cover; border-radius: 12px; box-shadow: var(--shadow); }
.img-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0; }
.img-row-3 img { width: 100%; height: 160px; object-fit: cover; border-radius: 12px; box-shadow: var(--shadow); }

@media (max-width: 960px) {
  .agrid { grid-template-columns: 1fr 1fr; }
  .img-row-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .agrid { grid-template-columns: 1fr; }
  .img-row { grid-template-columns: 1fr; }
  .img-row-3 { grid-template-columns: 1fr; }
}

/* ===== 动态版新增组件 ===== */
.form-alert { border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; font-size: 0.92rem; }
.form-alert.ok { background: #e8f6ec; border: 1px solid #b7dfc2; color: #146c2f; }
.form-alert.err { background: #fdeceb; border: 1px solid #f3c4c0; color: #a02a20; }
.form-alert ul { margin: 8px 0 0 18px; }
.form-alert p { margin: 6px 0 0; }
.pager { display: flex; gap: 14px; justify-content: center; align-items: center; margin-top: 30px; font-size: 0.9rem; color: var(--muted); }
.pager a { padding: 8px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--green-dark); font-weight: 600; }
.pager a:hover { background: var(--green-light); text-decoration: none; }
a.chip { text-decoration: none; }
a.chip:hover { background: var(--green); color: #fff; border-color: var(--green); }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.pcard .more { color: var(--green-dark); }
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .product-grid { grid-template-columns: 1fr; } }
