* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

.controls {
    padding: 20px;
    display: flex;
    justify-content: flex-start;
}

.card-count-select {
    padding: 8px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
}

.card-container {
    position: relative;
    display: grid; /* 恢复为 Grid 布局 */
    gap: var(--card-gap, 20px);
    padding: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    box-sizing: border-box;
    min-height: calc(100vh - 100px);
}

.card {
    width: 200px;
    height: 300px;
    perspective: 1000px;
    cursor: pointer;
    position: relative;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s;
}

.card:hover .card-inner {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-back {
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-front {
    transform: rotateY(180deg);
    background-color: #fff;
    position: relative;
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.text-container {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    z-index: 1;
}

.text-box {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 8px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 10px;
}

/* 全屏覆盖层样式 */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* 半透明黑色背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* 确保在最顶层 */
    cursor: pointer; /* 提示用户可以点击关闭 */
}

/* 全屏图片样式 */
.fullscreen-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain; /* 保持图片比例 */
    border-radius: 5px; /* 可选：轻微圆角 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); /* 可选：添加阴影 */
}

.nav-fab {
  position: fixed;
  top: 24px;
  right: 32px;
  width: 56px;
  height: 56px;
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  z-index: 10001;
  cursor: pointer;
  transition: background 0.2s;
}
.nav-fab:hover { background: #1e40af; }
.nav-drawer {
  position: fixed;
  top: 0; right: -320px;
  width: 280px;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 16px rgba(0,0,0,0.12);
  z-index: 10000;
  transition: right 0.3s;
  display: flex;
  flex-direction: column;
}
.nav-drawer.open { right: 0; }
.nav-drawer-header {
  font-weight: bold;
  font-size: 1.2em;
  padding: 24px 18px 12px 18px;
  border-bottom: 1px solid #eee;
}
#nav-menu {
  list-style: none;
  padding: 0 0 0 0;
  margin: 0;
}
#nav-menu li {
  padding: 16px 24px;
  font-size: 1.1em;
  border-bottom: 1px solid #f3f3f3;
  cursor: pointer;
  display: flex;
  align-items: center;
}
#nav-menu li:hover {
  background: #f1f5fb;
}
#nav-menu li .icon {
  margin-right: 10px;
  font-size: 1.2em;
}