/* ============================================================
   HotBench —— 配色沿用个人主页 xingheling.cn（PRTI 同色系）
   bg #e6f7f6 / card #fff / accent #2bb3a6 / accent-dark #23978c
   text #1f2d3d / muted #5b6b7a / border #d9eceb
   ============================================================ */

:root {
  --bg: #e6f7f6;
  --card: #ffffff;
  --accent: #2bb3a6;
  --accent-dark: #23978c;
  --accent-deep: #177a70;
  --text: #1f2d3d;
  --muted: #5b6b7a;
  --border: #d9eceb;
  --soft: #e6fffb;
  --shadow-sm: 0 4px 14px rgba(43, 179, 166, 0.10);
  --shadow-md: 0 6px 18px rgba(35, 151, 140, 0.08);
  --shadow-lg: 0 18px 44px rgba(35, 151, 140, 0.18);
}

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

body {
  font-family: "PingFang SC", "Microsoft Yahei", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

button { font-family: inherit; }

/* ===== 顶部导航 ===== */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--accent-deep);
  letter-spacing: 0.2px;
}
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 18px; }
.nav-links a { color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--accent-dark); }

/* ===== 版心 ===== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px 72px;
}

/* ===== Hero ===== */
.hero {
  padding: 52px 0 34px;
  text-align: center;
}
.hero-title {
  font-size: 36px;
  line-height: 1.35;
  color: var(--accent-dark);
  letter-spacing: 0.5px;
}
.hero-sep { color: var(--accent); }
.hero-desc {
  margin-top: 12px;
  font-size: 16px;
  color: var(--text);
}
.hero-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

/* ===== 项目卡片 ===== */
.projects { display: flex; flex-direction: column; gap: 24px; }

.project {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 24px 26px;
  box-shadow: var(--shadow-md);
}

.project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.project-name {
  font-size: 20px;
  color: var(--accent-deep);
  font-weight: 700;
  letter-spacing: 0.3px;
}
.project-title {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}
.project-meta {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  font-size: 12px;
  color: var(--accent-dark);
  background: var(--soft);
  border: 1px solid #cdeeea;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

/* 下拉框 */
.mode-picker { display: flex; align-items: center; gap: 8px; }
.mode-picker label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.mode-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 9px 34px 9px 14px;
  font-size: 14px;
  color: var(--text);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2323978c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.mode-select:hover { border-color: var(--accent); }
.mode-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 179, 166, 0.12);
}

/* 原始 prompt */
.prompt-box {
  margin-top: 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #fbfefd;
  padding: 10px 14px;
}
.prompt-box summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--accent-dark);
  font-weight: 600;
  list-style: none;
}
.prompt-box summary::-webkit-details-marker { display: none; }
.prompt-box summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform .2s ease;
}
.prompt-box[open] summary::before { transform: rotate(90deg); }
.prompt-text {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 评语 */
.comment-box {
  margin-top: 20px;
  background: #f0fffd;
  border: 1px solid #cdeeea;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 14px 18px;
}
.comment-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.comment-text {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== 分组 ===== */
.groups { margin-top: 20px; }
.group + .group {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}
.group-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 16.5px;
  color: var(--accent-dark);
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  line-height: 1.4;
  margin-bottom: 14px;
}
.group-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  background: var(--soft);
  border-radius: 999px;
  padding: 1px 10px;
}

/* ===== 预览（横向排列，实时运行） ===== */
.previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 18px;
}
.preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.shot {
  position: relative;
  /* 与 main.js 中的 FRAME_W / FRAME_H 保持同一比例（1280 × 1000） */
  aspect-ratio: 1280 / 1000;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #f2f8f8;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.preview:hover .shot {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.shot iframe {
  position: absolute;
  top: 0;
  left: 0;
  /* 默认固定视口；短页面由 main.js 按量到的高度覆写，再等比缩放到卡片大小 */
  width: 1280px;
  height: 1000px;
  border: 0;
  display: block;
  background: #fff;
  transform-origin: 0 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.shot-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}
.shot-zoom {
  margin: 10px;
  font-size: 12px;
  color: #fff;
  background: rgba(31, 45, 61, 0.68);
  border-radius: 999px;
  padding: 4px 12px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
}
.preview:hover .shot-zoom,
.shot-mask:focus-visible .shot-zoom { opacity: 1; transform: translateY(0); }
.shot-mask:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.preview-cap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text);
}
.cap-main { font-weight: 600; }
.cap-tag {
  font-size: 11.5px;
  color: var(--accent-dark);
  background: var(--soft);
  border-radius: 999px;
  padding: 1px 9px;
}

/* ===== 空状态 ===== */
.empty-tip {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* ===== 页脚 ===== */
.site-footer {
  text-align: center;
  padding: 8px 20px 44px;
  color: var(--muted);
  font-size: 13px;
}
.foot-line { display: inline-flex; align-items: center; }
.foot-name { color: var(--muted); }
.foot-sep { color: var(--muted); }
.footer-github {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s ease;
}
.footer-github:hover { color: var(--accent); text-decoration: none; }
.footer-github .octocat { transition: transform .2s ease; }
.footer-github:hover .octocat { transform: scale(1.15); }

/* ===== 放大查看 ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 35, 45, 0.72);
  backdrop-filter: blur(2px);
}
.lightbox-panel {
  position: relative;
  width: min(1440px, 96vw);
  height: min(900px, 90vh);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fbfefd;
}
.lightbox-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--accent-deep);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lightbox-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lb-btn {
  font-size: 13px;
  color: var(--accent-dark);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.lb-btn:hover {
  border-color: var(--accent);
  background: var(--soft);
  text-decoration: none;
}
.lb-btn-close { padding: 6px 10px; color: var(--muted); }
.lightbox-body { flex: 1; min-height: 0; background: #fff; }
.lightbox-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

body.lightbox-open { overflow: hidden; }

/* ===== 移动端 ===== */
@media (max-width: 640px) {
  .hero { padding: 34px 0 24px; }
  .hero-title { font-size: 25px; }
  .hero-desc { font-size: 14.5px; }
  .container { padding: 0 14px 56px; }
  .project { padding: 18px 16px 20px; }
  .project-head { flex-direction: column; }
  .mode-picker { width: 100%; justify-content: space-between; }
  .mode-select { flex: 1; }
  .previews { grid-template-columns: 1fr; gap: 16px; }
  .lightbox { padding: 10px; }
  .lightbox-panel { width: 100%; height: 92vh; border-radius: 12px; }
  .lightbox-bar { flex-wrap: wrap; }
  .lightbox-title { width: 100%; }
}
