/* ============================================================
   妙草堂官网 · 基础样式（设计令牌 / 重置 / 头部 / 页脚 / 通用组件）
   ============================================================ */

:root {
  --brand: #0e7c66;
  --brand-600: #0b6a57;
  --brand-700: #095446;
  --brand-900: #06382e;
  --brand-50: #edf7f4;
  --brand-100: #dbefe9;
  --brand-200: #bee2d7;
  --gold: #c9a227;
  --rx: #c1443c;
  --rx-bg: #fdeceb;
  --ink: #16241f;
  --ink-2: #3d4c48;
  --muted: #6e807b;
  --line: #e3ebe8;
  --bg: #f6f9f8;
  --white: #ffffff;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(6, 56, 46, 0.05), 0 4px 12px rgba(6, 56, 46, 0.05);
  --shadow-md: 0 10px 28px rgba(6, 56, 46, 0.09);
  --shadow-lg: 0 22px 50px rgba(6, 56, 46, 0.16);
  --container: 1200px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

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

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

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

::selection {
  background: var(--brand-200);
  color: var(--brand-900);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 头部 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
}

.topbar {
  background: var(--brand-900);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12.5px;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 36px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-left span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
}

.topbar-right a {
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.topbar-right a:hover {
  color: var(--brand-200);
}

.mainbar {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.mainbar-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 74px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.logo-mark {
  flex: 0 0 auto;
  filter: drop-shadow(0 6px 12px rgba(14, 124, 102, 0.22));
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text strong {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--brand-900);
}

.logo-text em {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-top: 3px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  height: 74px;
  padding: 0 15px;
  font-size: 15px;
  color: var(--ink-2);
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s ease;
}

.nav-link:hover {
  color: var(--brand);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
}

.nav-link.is-active {
  color: var(--brand);
  font-weight: 600;
}

.header-phone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.header-phone-ic {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--brand-50);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.header-phone em {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}

.header-phone a {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-900);
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  align-items: center;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1180px) {
  .header-phone {
    display: none;
  }
}

@media (max-width: 1000px) {
  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 0 14px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    z-index: 10;
  }

  .nav.is-open {
    display: flex;
  }

  .nav-link {
    height: auto;
    padding: 13px 24px;
    font-size: 15px;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link.is-active {
    background: var(--brand-50);
    box-shadow: inset 3px 0 0 var(--brand);
  }
}

@media (max-width: 760px) {
  .topbar-left {
    display: none;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
  }
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px rgba(14, 124, 102, 0.24);
}

.btn-primary:hover {
  background: var(--brand-600);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(14, 124, 102, 0.3);
}

.btn-outline {
  border: 1px solid var(--brand-200);
  color: var(--brand-700);
  background: #fff;
}

.btn-outline:hover {
  background: var(--brand-50);
  border-color: var(--brand);
}

.btn-ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.btn-light {
  background: #fff;
  color: var(--brand-700);
  box-shadow: var(--shadow-sm);
}

.btn-light:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  height: 38px;
  padding: 0 18px;
  font-size: 13.5px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ---------- 通用排版 ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--brand);
}

.eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.section {
  padding: 76px 0;
}

.section--bg {
  background: var(--bg);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.section-head h2 {
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-top: 10px;
}

.section-head p {
  color: var(--muted);
  font-size: 14.5px;
  margin-top: 8px;
  max-width: 620px;
}

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.link-more:hover {
  border-color: var(--brand);
}

.link-more svg {
  width: 15px;
  height: 15px;
}

/* ---------- 标签 ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--brand-50);
  color: var(--brand-700);
}

.tag--rx {
  background: var(--rx-bg);
  color: var(--rx);
}

.tag--muted {
  background: #f1f5f3;
  color: var(--muted);
}

/* ---------- 药品卡片 ---------- */

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

.product-grid--cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.p-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.p-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-200);
  box-shadow: var(--shadow-md);
}

.p-card-media {
  position: relative;
  padding: 18px 18px 6px;
  background: linear-gradient(175deg, #f2f9f7 0%, #fbfdfc 100%);
}

.p-card-media img {
  width: 100%;
  height: 188px;
  object-fit: contain;
}

.p-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #fff;
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
}

.p-badge--rx {
  color: var(--rx);
  border-color: #f6ccc8;
  background: var(--rx-bg);
}

.p-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 18px 8px;
}

.p-card-cat {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.02em;
}

.p-card-name {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.45;
  margin-top: 6px;
  color: var(--ink);
}

.p-card-name a:hover {
  color: var(--brand);
}

.p-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 8px;
}

.p-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.p-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.p-card-meta em {
  font-style: normal;
  color: var(--ink-2);
}

.p-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 14px 18px 16px;
}

.p-card-foot .spec {
  font-size: 12.5px;
  color: var(--muted);
}

.p-card-foot .go {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}

.p-card-foot .go svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.p-card:hover .go svg {
  transform: translateX(3px);
}

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: 0;
  background: var(--brand-900);
  color: rgba(255, 255, 255, 0.7);
}

.footer-main {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1.25fr;
  gap: 44px;
  padding: 58px 0 44px;
}

.logo--light .logo-text strong {
  color: #fff;
}

.logo--light .logo-text em {
  color: rgba(255, 255, 255, 0.55);
}

.footer-desc {
  font-size: 13px;
  line-height: 1.85;
  margin-top: 18px;
  max-width: 330px;
  color: rgba(255, 255, 255, 0.62);
}

.footer-addr {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
}

.footer-addr svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 3px;
  color: var(--brand-200);
}

.footer-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.footer-links a {
  display: block;
  padding: 5px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #fff;
}

.footer-contact li {
  font-size: 13px;
  padding: 5px 0;
  color: rgba(255, 255, 255, 0.62);
}

.footer-contact a {
  color: #fff;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.footer-contact a:hover {
  color: var(--brand-200);
}

.footer-legal {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 18px 0 26px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.45);
}

.legal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 6px;
}

.legal-row strong {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
}

.legal-copy {
  line-height: 1.8;
}

@media (max-width: 980px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 34px;
    padding: 44px 0 34px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-legal {
    font-size: 12px;
  }
}
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 8px;
}

.legal-links a {
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
}

.legal-links a:hover {
  color: #fff;
}
