
.json-output {
  max-width: 900px;
  margin: 24px auto 0;
  padding: 16px;
  background: #fff;
  border: 4px solid #3a96ff;
  border-radius: 12px;
  font-family: "Monaco", "Consolas", monospace;
  font-size: clamp(13px, 1.1vw, 15px);
  white-space: pre-wrap;
  word-break: break-all;
}
.json-output .label {
  color: rgba(0, 0, 0, 0.62);
  margin-bottom: 8px;
  font-size: 12px;
}
.json-output pre {
  margin: 0;
  color: #000;
}

/* ========== 卡牌选择区（地图下方 / JSON 上方）==========
 * 卡牌外框比例须与素材一致，否则 object-fit:contain 会在长边留白。
 * 当前素材：
 * - event / blizzard: 815×1110 → 163 / 222
 * - social issue: 744×1039
 * 若换图：用「宽 / 高」替换对应类型的 aspect-ratio。
 */
.card-pick-wrap {
  --event-card-border-width: 2px;
  --event-card-radius: 8px;
  max-width: min(1100px, 96vw);
  margin: 24px auto 0;
  position: relative;
  overflow: visible;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: clamp(12px, 1.8vw, 22px);
  align-items: start;
}
.card-pick-column {
  min-width: 0;
}
.card-pick-column--events {
  padding: 14px 12px 16px;
  border-radius: 10px;
  position: relative;
  background: #fff;
  border: 4px solid #3a96ff;
  border-radius: 12px;
  box-shadow: none;
}
.card-pick-column--blizzards {
  padding: 14px 12px 16px;
  border-radius: 10px;
  position: relative;
  background: #fff;
  border: 4px solid #3a96ff;
  border-radius: 12px;
  box-shadow: none;
}
.card-pick-title {
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 600;
  color: #000;
  font-family: "LilitaOne-Regular", "FrauncesSoftWonk", serif;
  margin: 0 0 12px;
  text-align: center;
  line-height: 1.3;
}
body.lang-zh .card-pick-title {
  font-family: "GenWanMinF", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.card-grid {
  display: grid;
  gap: clamp(6px, 0.7vw, 10px);
}
.card-grid--events {
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(2, auto);
}
.card-grid--blizzards {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, auto);
}
.card-pick-social-wrap {
  width: min(980px, calc(100% - 24px));
  margin: 12px auto 0;
  padding: clamp(12px, 1.8vw, 18px) clamp(14px, 2.4vw, 22px) clamp(10px, 1.6vw, 14px);
  position: relative;
  box-sizing: border-box;
  background: #fff;
  border: 4px solid #3a96ff;
  border-radius: 12px;
}
.card-pick-social-wrap .card-pick-title {
  margin-bottom: clamp(6px, 1vw, 12px);
}
.card-grid--social {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(2, auto);
  gap: clamp(4px, 0.7vw, 8px);
  display: grid;
}
.card-pick-social-wrap .card-pick-title,
.card-pick-social-wrap .card-grid--social {
  transform: none;
}
.card-pick-btn {
  position: relative;
  padding: 0;
  margin: 0;
  border: var(--event-card-border-width) solid transparent;
  border-radius: var(--event-card-radius);
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  /* 默认比率（如未覆盖） */
  aspect-ratio: 163 / 222;
  display: block;
  width: 100%;
  box-sizing: border-box;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  transform: translateY(0);
  appearance: none;
  -webkit-appearance: none;
}

/* 不同卡组素材比例不同：分别覆盖按钮尺寸（从而影响选中态边框长宽） */
.card-pick-btn[data-card-type="event"],
.card-pick-btn[data-card-type="blizzard"] {
  aspect-ratio: 160 / 215; /* 815×1110 */
}
.card-pick-btn[data-card-type="social"] {
  aspect-ratio: 744 / 1030;
}
.card-pick-btn:focus-visible {
  outline: 2px solid #4fc3f7;
  outline-offset: 2px;
}
.card-pick-btn--selected {
  border-color: #1777bf;
  box-shadow: 0 8px 20px rgba(23, 119, 191, 0.42);
  transform: translateY(-4px);
}
.card-pick-btn img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.card-social-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--event-card-radius);
  z-index: 2;
}

/* 选中后显示A/B按钮 */
.card-pick-btn--selected .card-social-overlay {
  display: flex;
}

/* 已选A/B后换成填充蒙层 */
.card-pick-btn--chosen .card-social-overlay {
  display: none;
}

.card-social-ab-btn {
  width: clamp(32px, 2.2vw, 40px);
  height: clamp(32px, 2.2vw, 40px);
  border-radius: 50%;
  border: none;
  font-size: clamp(14px, 1.2vw, 17px);
  font-weight: 700;
  cursor: pointer;
  opacity: 0.92;
  transition: transform 0.15s;
}
.card-social-ab-btn:hover { transform: scale(1.06); }
.card-social-ab-btn--a {
  background: #4fc3f7;
  color: #fff;
}
.card-social-ab-btn--b {
  background: #9575cd;
  color: #fff;
}

/* 选择后的填充蒙层 */
.card-social-chosen-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--event-card-radius);
  font-size: clamp(38px, 3.8vw, 56px);
  font-weight: 900;
  color: rgba(255,255,255,0.95);
  z-index: 3;
  pointer-events: none;
}
.card-pick-btn--chosen-a .card-social-chosen-overlay {
  display: flex;
  background: rgba(79, 195, 247, 0.66);
}
.card-pick-btn--chosen-b .card-social-chosen-overlay {
  display: flex;
  background: rgba(149, 117, 205, 0.66);
}

/* 已选 A/B 后，整张卡稍微更透明一些 */
.card-pick-btn--chosen {
  opacity: 0.96;
}

/* ========== AI 今日档案（卡牌区下方）========== */
.ai-report-wrap {
  max-width: 900px;
  margin: 20px auto 0;
  padding: 16px 16px 18px;
  background: #fff;
  border: 4px solid #3a96ff;
  border-radius: 12px;
  box-sizing: border-box;
}
.ai-report-title {
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 600;
  font-family: "LilitaOne-Regular", "FrauncesSoftWonk", "GenWanMinF", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #000;
  margin: 0 0 14px;
  text-align: center;
}
.ai-report-btn {
  display: block;
  margin: 0 auto 16px;
  padding: 12px 28px;
  font-size: clamp(14px, 1.15vw, 16px);
  font-weight: 600;
  color: #000;
  cursor: pointer;
  border: 2px solid #3a96ff;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  transition: border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}
.ai-report-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 auto 16px;
}
.ai-report-actions .ai-report-btn {
  margin: 0;
}
.ai-report-btn--link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.ai-report-btn:hover:not(:disabled) {
  border-color: #4fc3f7;
  transform: translateY(-1px);
}
.ai-report-btn:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}
.ai-report-output {
  margin: 0;
  padding: 18px 20px;
  min-height: 5em;
  border-radius: 12px;
  background: #fff;
  border: 2px solid #3a96ff;
  color: #000;
  font-size: clamp(14px, 1.2vw, 16px);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-report-output:empty::before {
  content: "生成后的档案将显示在这里。";
  color: rgba(0, 0, 0, 0.38);
}

/* 横屏窄宽下略放大卡牌，避免卡面过密 */
@media (orientation: landscape) and (max-width: 1180px) {
  .card-grid--events {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .card-grid--blizzards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .card-grid--social {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* 竖屏：改为单列区块 + 减少列数，让卡牌更大更易读 */
@media (orientation: portrait) {
  .card-pick-wrap {
    max-width: min(840px, 98vw);
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 18px;
  }
  .card-pick-column--events,
  .card-pick-column--blizzards {
    padding: clamp(12px, 2.4vw, 18px);
  }
  .card-grid--events {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .card-grid--blizzards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .card-pick-social-wrap,
  .ai-report-wrap,
  .json-output {
    width: min(840px, 98vw);
    max-width: min(840px, 98vw);
  }
  .card-grid--social {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(6px, 1.2vw, 10px);
  }
}

/* 超窄竖屏手机进一步降列数，保证可点击面积 */
@media (orientation: portrait) and (max-width: 620px) {
  .card-grid--events {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .card-grid--blizzards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .card-grid--social {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .card-pick-title,
  .ai-report-title {
    font-size: clamp(16px, 4.2vw, 20px);
  }
}
