:root {
  --jade-50: #f0fdf4;
  --jade-100: #dcfce7;
  --jade-700: #15803d;
  --jade-800: #0b4f37;
  --jade-900: #052e21;
  --gold: #d4af37;
  --parchment: #faf7f2;
  --ink: #1c1c1c;
  --muted: #667085;
  --white: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 18px 50px rgba(5, 46, 33, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top right, rgba(212, 175, 55, 0.10), transparent 28%),
    var(--parchment);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header,
.site-footer {
  color: var(--white);
  background: linear-gradient(135deg, var(--jade-900), var(--jade-800));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 10px 30px rgba(5, 46, 33, 0.2);
}

.header-inner {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--jade-900);
  background: var(--gold);
  font-family: Georgia, serif;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  color: #fff2b8;
  font-family: Georgia, serif;
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brand p {
  margin-top: 5px;
  color: #b7f7d1;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 28px;
  color: #c8f7d9;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-links a:hover {
  color: var(--gold);
}

.main-content {
  flex: 1;
  padding-top: 36px;
  padding-bottom: 48px;
}

.hero-panel,
.filter-panel,
.detail-card {
  border: 1px solid rgba(5, 46, 33, 0.1);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 35px rgba(5, 46, 33, 0.07);
}

.hero-panel {
  padding: 42px 24px;
  border-radius: 24px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-panel h2 {
  margin: 0 0 12px;
  color: var(--jade-900);
  font-family: Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
}

.hero-panel p:last-child {
  max-width: 760px;
  margin: 0 auto;
  color: #5c6674;
  line-height: 1.7;
}

.filter-panel {
  margin: 28px 0 34px;
  padding: 22px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 16px;
  border-radius: 18px;
}

.field-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--jade-800);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-group input,
.field-group select {
  width: 100%;
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid #d7dce2;
  border-radius: 10px;
  background: var(--white);
  outline: none;
}

.field-group input:focus,
.field-group select:focus {
  border-color: var(--jade-700);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.13);
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px;
}

.filter-actions button,
.back-button {
  min-height: 45px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  color: #fff4bc;
  background: var(--jade-800);
  font-weight: 800;
}

.filter-actions button:hover,
.back-button:hover {
  background: var(--jade-900);
}

.filter-actions .secondary-button {
  padding-inline: 16px;
  border-color: #d7dce2;
  color: var(--jade-800);
  background: var(--white);
}

.herb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.herb-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

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

.card-image-wrap {
  position: relative;
  height: 238px;
  overflow: hidden;
  background: var(--jade-900);
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.herb-card:hover .card-image-wrap img {
  transform: scale(1.05);
}

.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  color: var(--white);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent 68%);
}

.card-overlay h3,
.card-overlay p {
  margin: 0;
}

.card-overlay h3 {
  color: #fff2b8;
  font-family: Georgia, serif;
  font-size: 1.75rem;
}

.card-overlay p {
  margin-top: 3px;
  color: #c5f4d5;
  font-size: 0.78rem;
  font-style: italic;
}

.chinese-name {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 1.8rem;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.english-name {
  margin: 0 0 12px;
  color: var(--jade-800);
  font-weight: 800;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.badge.category {
  border: 1px solid var(--jade-100);
  color: var(--jade-800);
  background: var(--jade-50);
}

.badge.temperature {
  border: 1px solid #fde68a;
  color: #92400e;
  background: #fffbeb;
}

.card-footer {
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #edf0f2;
  color: #687181;
  font-size: 0.74rem;
}

.view-link {
  flex-shrink: 0;
  color: var(--jade-700);
  font-weight: 800;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 70px 20px;
  border: 1px dashed #cfd6dc;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
  text-align: center;
}

.hidden {
  display: none !important;
}

.back-button {
  margin-bottom: 18px;
  padding: 0 18px;
}

.detail-card {
  overflow: hidden;
  border-radius: 22px;
}

.detail-hero {
  position: relative;
  min-height: 390px;
  display: flex;
  align-items: flex-end;
  padding: 34px;
  background: var(--jade-900);
}

.detail-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 46, 33, 0.96), rgba(5, 46, 33, 0.12));
}

.detail-hero-content {
  position: relative;
  z-index: 1;
  color: var(--white);
}

.profile-tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 7px 11px;
  border-radius: 7px;
  color: var(--jade-900);
  background: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-hero h2,
.detail-hero p {
  margin: 0;
}

.detail-hero h2 {
  color: #fff2b8;
  font-family: Georgia, serif;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
}

.detail-hero h2 span {
  margin-left: 12px;
  color: var(--gold);
}

.detail-latin {
  margin-top: 10px !important;
  color: #baf4cf;
  font-size: 1.1rem;
  font-style: italic;
}

.detail-english {
  margin-top: 6px !important;
  color: #dcfce7;
}

.detail-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
  padding: 30px;
}

.content-section + .content-section {
  margin-top: 30px;
}

.content-section h3,
.properties-panel h3 {
  margin: 0 0 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--jade-900);
  font-family: Georgia, serif;
}

.action-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.action-list li {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  color: #4d5663;
  line-height: 1.6;
}

.action-list li::before {
  content: "✦";
  color: var(--gold);
  font-weight: 900;
}

.formula-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.formula-chip {
  padding: 9px 12px;
  border: 1px solid #b8e6c9;
  border-radius: 9px;
  color: var(--jade-800);
  background: #edfdf3;
  font-size: 0.82rem;
  font-weight: 800;
}

.warning-box {
  padding: 18px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  color: #991b1b;
  background: #fef2f2;
}

.warning-box h3 {
  margin: 0 0 5px;
  padding: 0;
  border: 0;
  color: #7f1d1d;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.warning-box p {
  margin: 0;
  line-height: 1.6;
}

.properties-panel {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--parchment);
}

.property-item + .property-item {
  margin-top: 14px;
}

.property-item span {
  display: block;
}

.property-label {
  margin-bottom: 4px;
  color: #7a828c;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.property-value {
  color: var(--jade-900);
  font-weight: 800;
  line-height: 1.5;
}

.gallery-title {
  margin-top: 26px !important;
}

.visual-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.visual-gallery img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.1);
}

.site-footer {
  margin-top: auto;
  padding: 34px 0;
  border-top: 2px solid var(--gold);
  color: #9ee6bc;
  text-align: center;
}

.site-footer p {
  margin: 5px 0;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.footer-title {
  color: #fff2b8;
  font-family: Georgia, serif;
  font-size: 1.15rem !important;
}

@media (max-width: 920px) {
  .filter-panel,
  .detail-layout {
    grid-template-columns: 1fr 1fr;
  }

  .filter-actions {
    align-items: stretch;
  }

  .herb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout > .properties-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .header-inner {
    min-height: 76px;
  }

  .nav-links {
    display: none;
  }

  .brand p {
    display: none;
  }

  .main-content {
    padding-top: 22px;
  }

  .hero-panel {
    padding: 32px 18px;
  }

  .filter-panel,
  .detail-layout,
  .herb-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    grid-template-columns: 1fr;
  }

  .card-image-wrap {
    height: 220px;
  }

  .detail-hero {
    min-height: 330px;
    padding: 24px;
  }

  .detail-hero h2 span {
    display: block;
    margin: 6px 0 0;
  }

  .detail-layout {
    padding: 22px;
  }
}
