:root {
  --green-900: #173404;
  --green-700: #27500a;
  --green-600: #3b6d11;
  --green-500: #4c8c1a;
  --green-400: #639922;
  --green-200: #c0dd97;
  --green-100: #eaf3de;
  --green-50: #f4f9f1;
  --ink: #1f2a17;
  --muted: #5f6b54;
  --line: #d8e6c8;
  --white: #ffffff;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(39, 80, 10, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--green-50);
  line-height: 1.65;
}

a { color: var(--green-600); text-decoration: none; }

.container { width: min(1100px, 92vw); margin: 0 auto; }

/* Top bar */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--green-700); }
.brand .logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--green-500);
  display: grid; place-items: center; color: #fff; font-size: 16px;
}
.nav { display: flex; gap: 22px; }
.nav a { color: var(--muted); font-size: 15px; padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.active { color: var(--green-700); border-bottom-color: var(--green-500); }

/* Page banner (detail pages) — contained card, not full-width */
.page-banner {
  position: relative;
  background: linear-gradient(120deg, #1b5e20 0%, var(--green-600) 48%, var(--green-400) 100%);
  color: #fff;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 32px 28px;
  margin-bottom: 4px;
}
.page-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/banner-pattern.svg");
  background-size: 220px;
  background-repeat: repeat;
  opacity: .14;
  pointer-events: none;
}
.banner-inner { position: relative; z-index: 1; }
.banner-title { font-size: 28px; margin: 0; font-weight: 700; letter-spacing: .5px; line-height: 1.25; }
.banner-sub { margin: 8px 0 0; color: rgba(255,255,255,.85); font-size: 14px; }

/* Breadcrumb — standalone, sits below the banner on light background */
.breadcrumb { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.breadcrumb a { color: var(--green-600); text-decoration: none; }
.breadcrumb a:hover { color: var(--green-700); text-decoration: underline; }
.breadcrumb .sep { margin: 0 8px; color: var(--line); }
.breadcrumb .current { color: var(--ink); font-weight: 600; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--green-600), var(--green-400));
  color: #fff;
  padding: 64px 0;}
.hero h1 { font-size: 34px; margin: 0 0 14px; }
.hero p { font-size: 17px; max-width: 620px; opacity: 0.95; margin: 0 0 26px; }
.btn {
  display: inline-block; background: #fff; color: var(--green-700);
  padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
}
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.7); }

/* Sections */
.section { padding: 56px 0; }
.section h2 { font-size: 26px; color: var(--green-700); margin: 0 0 6px; }
.section .lead { color: var(--muted); margin: 0 0 30px; }

/* Cards grid */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.card .thumb {
  height: 160px; background: var(--green-100);
  display: grid; place-items: center; color: var(--green-400); font-size: 14px;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 16px 18px; }
.tag {
  display: inline-block; font-size: 12px; color: var(--green-700);
  background: var(--green-100); border-radius: 999px; padding: 2px 10px; margin-bottom: 8px;
}
.card h3 { margin: 4px 0 6px; font-size: 17px; }
.card .spec { color: var(--green-600); font-size: 13px; margin: 0 0 8px; }
.card p { color: var(--muted); font-size: 14px; margin: 0; }
a.card { color: inherit; text-decoration: none; display: block; }
a.card:hover { box-shadow: 0 6px 18px rgba(39, 80, 10, 0.14); transform: translateY(-2px); transition: .15s; }
.detail-thumb { width: 100%; height: 300px; background: var(--green-100); border-radius: 12px; margin-bottom: 18px; display: grid; place-items: center; color: var(--green-400); font-size: 14px; }
.rec-block { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 26px; }
.rec-title { font-size: 20px; color: var(--green-700); margin: 0 0 4px; }
#rec-grid { grid-template-columns: repeat(4, 1fr); }

/* Product detail layout (3 columns: gallery | info | buy) */
.pd-top { display: flex; gap: 24px; align-items: flex-start; margin: 10px 0 28px; }
.pd-gallery { width: 360px; flex: none; }
.pd-gallery .main-img { width: 100%; height: 360px; object-fit: cover; border-radius: 12px; background: var(--green-100); display: block; }
.pd-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pd-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.pd-thumbs img.active { border-color: var(--green-500); }
.detail-thumb { width: 100%; height: 360px; background: var(--green-100); border-radius: 12px; margin-bottom: 18px; display: grid; place-items: center; color: var(--green-400); font-size: 14px; }
.pd-info { flex: 1; min-width: 0; }
.pd-title { margin: 8px 0 14px; color: var(--green-700); font-size: 22px; }
.pd-info .spec-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.pd-info .spec-row span:first-child { color: var(--muted); }
.pd-info .spec-row b { text-align: right; }
.pd-intro { margin: 8px 0 4px; padding-top: 22px; border-top: 1px solid var(--line); }
.pd-sub { color: var(--green-700); font-size: 18px; margin: 0 0 10px; }
.pd-desc { font-size: 15px; line-height: 1.9; color: var(--ink); }
.pd-buy { width: 300px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); position: sticky; top: 88px; }
.buy-tip { font-size: 13px; color: var(--green-700); background: var(--green-100); border-radius: 8px; padding: 8px 10px; margin-bottom: 14px; text-align: center; }
.buy-btn { display: block; text-align: center; text-decoration: none; margin-bottom: 14px; }
.buy-row { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; border-top: 1px dashed var(--line); }
.buy-row span { color: var(--muted); }
.buy-note { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 10px 0 0; }
.buy-note a { color: var(--green-600); }

/* Admin multi-image list */
.img-list { display: flex; flex-wrap: wrap; gap: 10px; }
.img-item { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 13px; line-height: 20px; padding: 0; }

/* News list */
.news-item {
  display: flex; gap: 16px; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.news-item .date { color: var(--green-600); font-weight: 600; white-space: nowrap; }
.news-item h3 { margin: 0 0 6px; font-size: 17px; }
.news-item p { margin: 0; color: var(--muted); font-size: 14px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.contact-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.contact-box h3 { margin-top: 0; color: var(--green-700); }

/* Sales grid */
.sales-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 18px; }
.sales-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 16px; text-align: center; box-shadow: var(--shadow); position: relative; }
.sales-card .qr { width: 130px; height: 130px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.sales-card h3 { margin: 12px 0 6px; color: var(--green-700); font-size: 18px; }
.sales-card .region { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.sales-card .phone { margin: 0 0 10px; font-size: 14px; color: var(--ink); }
.sales-card .phone a { color: var(--green-600); }
.sales-card .qr-tip { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.sales-card .avatar { width: 56px; height: 56px; border-radius: 50%; color: #fff; font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 4px; box-shadow: 0 2px 6px rgba(0,0,0,.08); }

/* Footer */
.footer { background: transparent; padding: 40px 0; font-size: 14px; }
.footer .container { background: var(--green-700); color: #eaf3de; border-radius: var(--radius); padding: 22px; }
.footer a { color: #eaf3de; }

/* Admin */
.admin-wrap { padding: 32px 0; }
.admin-login { max-width: 360px; margin: 80px auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.btn-primary { background: var(--green-500); color: #fff; border: none; padding: 11px 20px; border-radius: 8px; font-size: 15px; cursor: pointer; }
.btn-primary:hover { background: var(--green-600); }
.btn-danger { background: #fff; color: #a32d2d; border: 1px solid #f09595; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.admin-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.admin-list { margin-top: 18px; }
.admin-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.admin-row .mini { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--green-100); }
.admin-row .grow { flex: 1; }
.admin-row .grow b { font-size: 14px; }
.admin-row .grow span { color: var(--muted); font-size: 12px; }
.seo-box { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; margin: 4px 0 14px; background: #fafdf8; }
.seo-box summary { cursor: pointer; color: var(--green-700); font-size: 13px; font-weight: 600; user-select: none; }
.seo-box .field { margin-top: 10px; }
.seo-box .field label { font-size: 13px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs button { padding: 8px 16px; border: 1px solid var(--line); background: #fff; border-radius: 999px; cursor: pointer; font-size: 14px; }
.tabs button.active { background: var(--green-500); color: #fff; border-color: var(--green-500); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--green-700); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.hidden { display: none; }

@media (max-width: 720px) {
  .nav { gap: 14px; font-size: 14px; }
  .hero h1 { font-size: 26px; }
  .contact-grid { grid-template-columns: 1fr; }
  .sales-grid { grid-template-columns: repeat(2, 1fr); }
  .news-item { flex-direction: column; gap: 6px; }
  .pd-top { flex-direction: column; }
  .pd-gallery { width: 100%; }
  .pd-buy { width: 100%; position: static; }
  #rec-grid { grid-template-columns: repeat(2, 1fr); }
  .page-banner { padding: 38px 0 32px; }
  .banner-title { font-size: 23px; }
}
