/* variables */
:root {
  --bg: #ffffff;
  --text: #222222;
  --gray: #6b6b6b;
  --line: #e0e0e0;
  --green: #2b5f52;
  --light: #dfe6df;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.8;
}

a {
  color: var(--green);
}

/* layout */
.layout {
  display: flex;
  gap: 28px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
  align-items: flex-start;
}

/* sidebar */
.sidebar {
  flex: 0 0 180px;
  position: sticky;
  top: 20px;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfa;
}

.sidebar h2 {
  margin: 0 0 10px;
  font-size: 15px;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.sidebar ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.sidebar li {
  margin-bottom: 6px;
}

.sidebar a {
  font-size: 13.5px;
  color: #444444;
  text-decoration: none;
}

.sidebar a:hover {
  color: var(--green);
  text-decoration: underline;
}

/* content */
.content {
  flex: 1;
  min-width: 0;
}

section {
  margin-bottom: 48px;
}

#d1,
#d2,
#d3,
#d4,
#d5 {
  scroll-margin-top: 20px;
}

h2 {
  margin: 0 0 14px;
  padding-bottom: 6px;
  font-size: 20px;
  border-bottom: 1px solid var(--line);
}

p {
  margin: 0 0 12px;
}

.demo {
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
}

.demo h2 {
  margin-top: 0;
  font-size: 18px;
}

/* card list */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.card {
  flex: 1 1 30%;
  min-width: 140px;
  padding: 10px;
  border: 1px solid var(--line);
  transition: box-shadow 0.25s;
}

.card:hover {
  box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15);
}

.pic {
  height: 56px;
  margin-bottom: 8px;
  background: var(--light);
}

.ct {
  margin: 0;
  font-size: 14px;
}

.cp {
  margin: 0;
  color: var(--gray);
  font-size: 13px;
}

/* badge */
.parent {
  position: relative;
  width: 260px;
  padding: 14px 16px;
  border: 1px solid var(--line);
}

.pt {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.pd {
  margin: 2px 0 0;
  font-size: 13px;
  color: #6b6b6b;
}

.badge {
  position: absolute;
  top: -9px;
  right: 10px;
  padding: 1px 7px;
  font-size: 11px;
  line-height: 1.6;
  color: #ffffff;
  background: var(--green);
}

/* dropdown */
.drop {
  position: relative;
  display: inline-block;
}

.drop-top {
  margin: 0;
  padding: 8px 14px;
  font-size: 14px;
  border: 1px solid var(--line);
  transition: background 0.2s;
}

.drop:hover .drop-top {
  background: #f4f6f4;
}

.drop-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: #ffffff;
  border: 1px solid var(--line);
  z-index: 10;
}

.drop:hover .drop-list {
  display: block;
}

.drop-list a {
  display: block;
  padding: 7px 13px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid #f2f2f2;
}

.drop-list a:hover {
  background: #f4f6f4;
  color: var(--green);
}

/* animation */
.ani-panel {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 56px;
  padding: 30px 10px;
  background: #f7f8f7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ani-item {
  text-align: center;
}

.ani-item span {
  display: block;
  margin-top: 12px;
  color: var(--gray);
  font-size: 12px;
}

.breathe {
  width: 44px;
  height: 44px;
  margin: 8px auto;
  background: #ffffff;
  border: 1px solid #e2e6e3;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  animation: breathe 1.8s ease-in-out infinite alternate;
}

@keyframes breathe {
  from {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  }
  to {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  }
}

.pulse {
  width: 14px;
  height: 14px;
  margin: 11px auto;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.4s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(43, 95, 82, 0.4);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(43, 95, 82, 0);
  }
}

.ani-panel:hover .breathe,
.ani-panel:hover .pulse {
  animation-play-state: paused;
}

/* links */
.links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.links li {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0ee;
}

.links li:last-child {
  border-bottom: 0;
}

.links a {
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--green);
}

.links a:hover {
  color: #1d463c;
}

.links a::after {
  content: " ↗";
  font-size: 13px;
}

.links li span {
  display: block;
  margin-top: 3px;
  color: var(--gray);
  font-size: 13px;
}

.links li.more {
  color: #9a9a93;
  font-size: 13px;
}

/* footer */
.foot {
  padding: 16px 0 20px;
  color: var(--gray);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

/* breakpoints */
@media screen and (min-width: 768px) and (max-width: 995px) {
  .card {
    flex: 1 1 45%;
  }
}

@media screen and (max-width: 767px) {
  body {
    font-size: 15px;
  }

  .layout {
    flex-direction: column;
    gap: 20px;
    padding: 24px 16px;
  }

  .sidebar {
    position: static;
    width: 100%;
    flex: none;
  }

  .card {
    flex: 1 1 100%;
    min-width: 0;
  }

  .parent {
    width: 100%;
  }
}
