:root {
  --primary-color: #2a2a9a;
  --secondary-color: #f7fafc;
  --text-color: #2d3748;
  --light-gray: #e2e8f0;
  --dark-gray: #4a5568;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text-color);
  background-color: #f8f9fa;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 8px;
}

header {
  background-color: var(--primary-color);
  color: white;
  padding: 40px 0;
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.filters {
  margin: 30px 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#search {
  padding: 12px 15px;
  border: 1px solid var(--light-gray);
  border-radius: var(--border-radius);
  font-size: 1rem;
  width: 100%;
  font-family: var(--font-family);
}

.tags-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
  min-height: 40px;
}

.tag-button {
  background-color: var(--secondary-color);
  border: 1px solid var(--light-gray);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: normal;
  font-family: var(--font-family);
}

.tag-button:hover {
  background-color: var(--light-gray);
}

.tag-button.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.tag-toggle-btn {
  background: var(--secondary-color);
  border: 1px solid var(--light-gray);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 1.3rem;
  cursor: pointer;
  margin-left: 10px;
  font-family: var(--font-family);
  transition: background 0.2s, color 0.2s;
  color: var(--primary-color);
  box-shadow: 0 1px 4px rgba(94, 114, 228, 0.08);
}

.tag-toggle-btn:hover {
  background: var(--light-gray);
  color: #222;
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin-bottom: 50px;
}

.card {
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}
.card-link-icon-fixed-wrap {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}
.card-link-icon-fixed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #2a2a9a;
  text-decoration: none;
  transition: color 0.18s;
}
.card-link-icon-fixed:hover svg circle,
.card-link-icon-fixed:hover svg line {
  stroke: #4c5ec2;
}
.card-link-icon-fixed .card-link-icon-bg {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e6eaff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.card-link-icon-fixed:hover .card-link-icon-bg {
  background: #d0d8ff;
}
.card-link-icon-bg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e6eaff;
  transition: background 0.18s;
}
.card-link-icon:hover .card-link-icon-bg {
  background: #d0d8ff;
}
.card-link-icon-bg svg {
  display: block;
}

.card:hover {
  transform: translateY(-5px);
}

.card-image {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  display: block;
}

/* 瀑布流图片容器 */
.card-images-masonry {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  justify-content: flex-start;
}
.card-images-masonry img {
  width: calc(50% - 3px);
  max-width: 180px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: transform 0.2s;
}
.card-images-masonry img:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
}
/* 单图大图 */
.card-image-single {
  width: 100%;
  max-width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.09);
  transition: transform 0.2s;
}
.card-image-single:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
/* 图片预览弹窗 */
.img-modal {
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
.img-modal img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  background: #fff;
}
.img-modal .img-modal-close {
  position: absolute;
  top: 30px;
  right: 40px;
  font-size: 2.2rem;
  color: #fff;
  cursor: pointer;
  z-index: 10001;
  font-weight: bold;
  text-shadow: 0 2px 8px #000;
}
.img-modal .img-modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  z-index: 10001;
  user-select: none;
  padding: 0 18px;
  text-shadow: 0 2px 8px #000;
}
.img-modal .img-modal-arrow.left { left: 20px; }
.img-modal .img-modal-arrow.right { right: 20px; }

/* 卡片内容优化 */
.card-content {
  padding: 18px 18px 14px 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  font-size: 1.01rem;
  line-height: 1.7;
  min-height: 120px;
}
.card-function {
  color: #3a3a3a;
  font-size: 1.08rem;
  margin-bottom: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-function svg {
  height: 1.25em;
  width: 1.25em;
  vertical-align: middle;
  margin-right: 4px;
  display: inline-block;
}
.card-description {
  margin-bottom: 16px;
  color: #222;
  font-size: 1.04rem;
  font-weight: 400;
  background: #e6eaff;
  border-radius: 6px;
  padding: 8px 10px;
  line-height: 1.8;
}
.card-function-risk, .card-function-risk svg {
  color: #1a1a5a;
  font-size: 1.18rem;
  font-weight: bold;
  display: flex;
  align-items: center;
}
.card-title {
  font-size: 1.18rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #2d3748;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.card-tag {
  background-color: #e8eaf6;
  border-radius: 15px;
  padding: 4px 10px;
  font-size: 0.85rem;
  color: #5e72e4;
  font-weight: 500;
}
/* 动态网格图片布局 */
.card-images-grid3 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  width: 100%;
  height: 220px;
  margin-bottom: 12px;
}
.card-images-grid3 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: transform 0.2s;
}
.card-images-grid3 img:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
}
.card-images-grid3 .main-img {
  grid-row: 1 / span 2;
  grid-column: 1 / 2;
}
.card-images-grid3 .side-img1 {
  grid-row: 1 / 2;
  grid-column: 2 / 3;
}
.card-images-grid3 .side-img2 {
  grid-row: 2 / 3;
  grid-column: 2 / 3;
}
/* 动态网格图片布局（1-10图自适应） */
.card-images-dynamic {
  display: grid;
  width: 100%;
  margin-bottom: 14px;
  gap: 2px;
  border-radius: 12px;
  overflow: hidden;
  min-height: 260px;
  height: 260px;
  background: #f7f8fa;
}
.card-images-dynamic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: transform 0.2s;
}
.card-images-dynamic img:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
}
/* 1图 */
.card-images-dynamic.imgs-1 { grid-template-columns: 1fr; grid-template-rows: 260px; }
.card-images-dynamic.imgs-1 img { grid-column: 1 / 2; grid-row: 1 / 2; }
/* 2图 */
.card-images-dynamic.imgs-2 { grid-template-columns: 2fr 1fr; grid-template-rows: 260px; }
.card-images-dynamic.imgs-2 img:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 2; }
.card-images-dynamic.imgs-2 img:nth-child(2) { grid-column: 2 / 3; grid-row: 1 / 2; }
/* 3图 */
.card-images-dynamic.imgs-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; height: 260px; }
.card-images-dynamic.imgs-3 img:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 3; }
.card-images-dynamic.imgs-3 img:nth-child(2) { grid-column: 2 / 3; grid-row: 1 / 2; }
.card-images-dynamic.imgs-3 img:nth-child(3) { grid-column: 2 / 3; grid-row: 2 / 3; }
/* 4图 */
.card-images-dynamic.imgs-4 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; height: 260px; }
.card-images-dynamic.imgs-4 img:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 3; }
.card-images-dynamic.imgs-4 img:nth-child(2) { grid-column: 2 / 3; grid-row: 1 / 2; }
.card-images-dynamic.imgs-4 img:nth-child(3) { grid-column: 3 / 4; grid-row: 1 / 2; }
.card-images-dynamic.imgs-4 img:nth-child(4) { grid-column: 2 / 4; grid-row: 2 / 3; }
/* 5-10图：N大N小动态网格，填满空间 */
.card-images-dynamic.imgs-5,
.card-images-dynamic.imgs-6,
.card-images-dynamic.imgs-7,
.card-images-dynamic.imgs-8,
.card-images-dynamic.imgs-9,
.card-images-dynamic.imgs-10 {
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  height: 260px;
}
.card-images-dynamic.imgs-5 img:nth-child(1),
.card-images-dynamic.imgs-6 img:nth-child(1),
.card-images-dynamic.imgs-7 img:nth-child(1),
.card-images-dynamic.imgs-8 img:nth-child(1),
.card-images-dynamic.imgs-9 img:nth-child(1),
.card-images-dynamic.imgs-10 img:nth-child(1) {
  grid-row: 1 / 4;
  grid-column: 1 / 2;
}
.card-images-dynamic.imgs-5 img:nth-child(2) { grid-row: 1 / 2; grid-column: 2 / 3; }
.card-images-dynamic.imgs-5 img:nth-child(3) { grid-row: 2 / 3; grid-column: 2 / 3; }
.card-images-dynamic.imgs-5 img:nth-child(4) { grid-row: 3 / 4; grid-column: 2 / 3; }
.card-images-dynamic.imgs-5 img:nth-child(5) { grid-row: 1 / 3; grid-column: 3 / 4; }
/* 6-10图依次填满右侧格子 */
.card-images-dynamic.imgs-6 img:nth-child(2) { grid-row: 1 / 2; grid-column: 2 / 3; }
.card-images-dynamic.imgs-6 img:nth-child(3) { grid-row: 2 / 3; grid-column: 2 / 3; }
.card-images-dynamic.imgs-6 img:nth-child(4) { grid-row: 3 / 4; grid-column: 2 / 3; }
.card-images-dynamic.imgs-6 img:nth-child(5) { grid-row: 1 / 2; grid-column: 3 / 4; }
.card-images-dynamic.imgs-6 img:nth-child(6) { grid-row: 2 / 4; grid-column: 3 / 4; }
/* 7-10图同理，自动填满右侧格子，可继续扩展 */
.card-person-info {
  font-size: 1.6rem;
  font-weight: bold;
  color: #2a2a9a;
  text-align: center;
  margin-bottom: 12px;
  margin-top: 12px;
  letter-spacing: 0.02em;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.person-icon-wrap {
  display: inline-flex;
  align-items: center;
  height: 1.18em;
  width: 1.35em;
  vertical-align: middle;
  margin-right: 2px;
}
/* 时间和城市新样式（小字体+背景） */
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  margin-top: 10px;
  color: #888;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  gap: 0;
}
.card-meta .meta-item {
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  padding: 2px 12px 2px 10px;
  margin: 0;
  background: #f2f3f7;
  min-width: 0;
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta .meta-item.meta-date {
  background: #e6eaff;
  color: #2a2a9a;
  margin-right: 0;
  justify-content: flex-start;
}
.card-meta .meta-item.meta-city {
  background: #e6eaff;
  color: #2a2a9a;
  margin-left: 0;
  justify-content: flex-end;
}
.card-meta .meta-icon {
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  height: 1.1em;
  vertical-align: middle;
  font-size: 1em;
}
.card-meta .meta-city {
  color: #2a2a9a;
  font-weight: 500;
}
.card-meta .meta-date {
  color: #666;
  font-weight: 400;
}

.card-link {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 8px 15px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: normal;
  transition: background-color 0.2s;
  margin-top: auto;
  text-align: center;
  width: 100%;
  font-family: var(--font-family);
}

.card-link:hover {
  background-color: #4c5ec2;
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px;
  font-size: 1.2rem;
  color: var(--dark-gray);
  font-family: var(--font-family);
}

footer {
  background-color: var(--secondary-color);
  padding: 20px 0;
  text-align: center;
  border-top: 1px solid var(--light-gray);
  margin-top: 30px;
  font-family: var(--font-family);
}

.card-content .card-function:last-child,
.card-content .card-meta:last-child {
  margin-top: auto;
}

.card-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  vertical-align: middle;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #2a2a9a;
  text-decoration: none;
  transition: color 0.18s;
}
.card-link-icon:hover svg circle,
.card-link-icon:hover svg line {
  stroke: #4c5ec2;
}

.card-link-icon-bg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e6eaff;
  transition: background 0.18s;
}
.card-link-icon:hover .card-link-icon-bg {
  background: #d0d8ff;
}
.card-link-icon-bg svg {
  display: block;
}

.nav-submit-btn {
  display: inline-flex;
  align-items: center;
  background: #fff;
  color: #2a2a9a;
  border-radius: 24px;
  box-shadow: 0 2px 10px rgba(42,42,154,0.08);
  padding: 8px 22px 8px 16px;
  font-size: 1.18em;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid #2a2a9a;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  margin-left: 0;
}
.nav-submit-btn:hover {
  background: #2a2a9a;
  color: #fff;
  box-shadow: 0 4px 18px rgba(42,42,154,0.13);
}
.nav-submit-btn:hover .nav-submit-icon svg rect {
  fill: #2a2a9a;
}
.nav-submit-btn:hover .nav-submit-icon svg path,
.nav-submit-btn:hover .nav-submit-icon svg rect[stroke] {
  stroke: #fff;
}
.nav-submit-icon {
  margin-right: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  width: 30px;
}

.card-stamp-wrap {
  position: absolute;
  left: 58%;
  top: 235px;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  width: 170px;
  height: 170px;
  opacity: 0.93;
}
.card-stamp {
  filter: drop-shadow(0 4px 16px rgba(217,0,27,0.18));
  opacity: 0.93;
  transform: rotate(-7deg) scale(1.35);
}
@media (max-width: 599px) {
  .card-stamp-wrap {
    left: 58%;
    top: 215px;
    width: 120px;
    height: 120px;
  }
  .card-stamp {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 768px) {
  .cards-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  header h1 {
    font-size: 2rem;
  }
}

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

@media (min-width: 1200px) {
  .cards-container {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .cards-container {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 600px) and (max-width: 899px) {
  .cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 599px) {
  .cards-container {
    grid-template-columns: 1fr;
  }
}