:root {
  --green: #62c21d;
  --green-dark: #4a9a15;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e8e8e8;
  --card-bg: #fff;
  --page-bg: #f4f6f4;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --max: 1200px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

html {
  font-size: 16px;
  color: var(--text);
  background: var(--page-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--green-dark);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.site-header {
  background: linear-gradient(135deg, var(--green) 0%, #53a818 100%);
  color: #fff;
  padding: 1rem 1.25rem 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.site-header-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.site-title {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.site-sub {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  opacity: 0.92;
}

.shell {
  flex: 1;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.search-input {
  flex: 1 1 240px;
  min-width: 200px;
  height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.95rem;
  background: #fff;
  box-shadow: var(--shadow);
}

.search-input:focus {
  outline: 2px solid rgba(98, 194, 29, 0.35);
  border-color: var(--green);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-btn:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.filter-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

@media (min-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.grid-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 180px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.grid-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}

.grid-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grid-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f5e4, #f0f4ee);
  color: #6b8f63;
  font-size: 0.85rem;
}

.grid-card-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.12), transparent);
  pointer-events: none;
  z-index: 1;
}

.grid-card-title {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.grid-card-summary {
  display: none;
}

.empty-hint {
  text-align: center;
  color: #999;
  margin-top: 3rem;
  font-size: 0.95rem;
}

.hidden {
  display: none !important;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  background: #fff;
}

/* Detail page */
.detail-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #fff;
  font-size: 0.95rem;
  opacity: 0.95;
  text-decoration: none;
}
.back-link:hover {
  opacity: 1;
  text-decoration: none;
}

.detail-title-line {
  flex: 1;
  text-align: center;
  margin-right: 2.5rem;
}

.detail-title-line h1 {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 700;
}

.detail-crop {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.detail-body {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.5rem;
}

.gallery {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.gallery-main {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 480px;
  object-fit: cover;
  display: block;
  background: #eee;
}

.gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #fafafa;
  border-top: 1px solid var(--border);
}

.gallery-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.85;
  transition: border-color 0.15s, opacity 0.15s;
}

.gallery-thumb:hover,
.gallery-thumb.active {
  opacity: 1;
  border-color: var(--green);
}

.gallery-empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.article-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem 1.75rem;
}

.article-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.article-head-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.article-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin: 1.25rem 0 0.6rem;
}

.article-section-title.first {
  margin-top: 0.25rem;
}

.article-bullet-row {
  display: flex;
  gap: 0.5rem;
  margin: 0.4rem 0;
  line-height: 1.65;
  font-size: 0.95rem;
  color: #333;
}

.article-bullet-dot {
  flex-shrink: 0;
  color: var(--green);
  margin-top: 0.15rem;
}

.detail-error {
  max-width: var(--max);
  margin: 2rem auto;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
}
