/* ------------------------------------------------------------------ *
 *  版本化手机截图生成器 · 共享样式
 *  只新增版本切换、动态表单与版本管理页的样式，不改动根目录经典版。
 * ------------------------------------------------------------------ */

/* ---------------- Version page preview ---------------- */
/* 版本页的画布比例各不相同，按比例完整放进预览框，避免拉伸。 */
.version-page #previewCanvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

/* ---------------- Version chips (header) ---------------- */
.version-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #e1e6ef;
  border-radius: 999px;
  background: #f4f7fb;
}

.version-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  color: #6d778c;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}

.version-chip:hover {
  color: #39465e;
  background: #e9eef7;
}

.version-chip.is-current {
  color: var(--accent-strong);
  background: #fff;
  box-shadow: 0 1px 2px rgba(24, 39, 75, .16);
}

.version-chip-hub {
  gap: 7px;
  color: #8a93a6;
  font-weight: 600;
}

.version-chip-hub::before {
  content: "";
  width: 1px;
  height: 12px;
  background: #dfe4ec;
}

/* ---------------- Language switch ---------------- */
.lang-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 11px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px -26px rgba(24, 39, 75, .35);
}

.lang-label {
  color: #66718a;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #e1e6ef;
  border-radius: 999px;
  background: #f2f5fa;
}

.lang-btn {
  height: 28px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6d778c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}

.lang-btn:hover {
  color: #39465e;
  background: #e9eef7;
}

.lang-btn.is-active {
  color: var(--accent-strong);
  background: #fff;
  box-shadow: 0 1px 2px rgba(24, 39, 75, .16);
}

.lang-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .22);
}

/* ---------------- Generated form ---------------- */
.field-grid {
  display: grid;
  gap: 12px 16px;
  margin-top: 4px;
}

.field-grid .field-stack input,
.field-grid .field-stack select {
  width: 100%;
}

.field-grid .field-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-note {
  margin: -2px 0 14px;
  color: #8a93a6;
  font-size: 11.5px;
  line-height: 1.6;
}

.version-page .field select {
  appearance: none;
  padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, #7b8599 50%),
    linear-gradient(135deg, #7b8599 50%, transparent 50%);
  background-position: calc(100% - 14px) 16px, calc(100% - 9px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* ---------------- Dynamic list groups ---------------- */
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin: 0 0 12px;
}

.list-count {
  color: #8a93a6;
  font-size: 11.5px;
}

.list-add {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  border: 1px solid #d3ddec;
  border-radius: 999px;
  background: #f5f8fd;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.list-add:hover {
  background: #eaf1fd;
  border-color: #b9cdf0;
}

.list-add:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .22);
}

.list-add:disabled {
  background: #f4f6fa;
  border-color: #e4e9f1;
  color: #a7b0c0;
  cursor: not-allowed;
}

.list-item {
  padding: 12px 14px 14px;
  border: 1px solid #e3e9f3;
  border-radius: 12px;
  background: #fbfcff;
}

.list-item + .list-item {
  margin-top: 12px;
}

.list-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.list-item-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #39465e;
  font-size: 12px;
  font-weight: 700;
}

.list-item-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.list-remove {
  padding: 3px 10px;
  border: 1px solid #f0d2d0;
  border-radius: 999px;
  background: #fff7f6;
  color: #c0403a;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.list-remove:hover {
  background: #fdeceb;
  border-color: #e7b3af;
}

.list-remove:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(192, 64, 58, .18);
}

.list-item .field-grid {
  margin-top: 0;
}

.list-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed #d8e0ec;
  border-radius: 12px;
  color: #8a93a6;
  font-size: 12px;
  text-align: center;
}

/* ---------------- Version hub ---------------- */
.hub-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 42px 28px 64px;
}

.hub-hero {
  max-width: 760px;
}

.hub-eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
}

.hub-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -.01em;
}

.hub-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.8;
}

.version-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.version-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 34px -30px rgba(24, 39, 75, .45);
}

.version-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.version-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 700;
}

.version-status {
  padding: 3px 8px;
  border: 1px solid #e1e6ef;
  border-radius: 999px;
  background: #fff;
  color: #7b8599;
  font-size: 10.5px;
  font-weight: 600;
}

.version-card h2 {
  margin: 0;
  font-size: 18px;
}

.version-card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.version-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 0;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
}

.version-meta dt {
  margin: 0;
  color: #8a93a6;
  font-size: 10.5px;
}

.version-meta dd {
  margin: 3px 0 0;
  color: #39465e;
  font-size: 12px;
  font-weight: 600;
}

.version-card .btn {
  margin-top: auto;
  text-decoration: none;
}

.hub-guide {
  margin-top: 34px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.hub-guide h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.hub-guide p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.hub-guide ol {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.9;
}

.hub-guide pre {
  margin: 14px 0 0;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid #e4e9f1;
  border-radius: 12px;
  background: #f8fafd;
  color: #39465e;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11.5px;
  line-height: 1.7;
}

.hub-guide code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #f1f4fa;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
}

.hub-guide pre code {
  padding: 0;
  background: none;
}

.hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hub-actions .btn {
  width: auto;
  min-width: 132px;
  padding: 0 18px;
  text-decoration: none;
}

@media (max-width: 680px) {
  .hub-main { padding: 26px 16px 48px; }
  .version-cards { grid-template-columns: 1fr; }
  .version-nav { display: none; }
  .hub-actions .btn { flex: 1 1 140px; }
}

@media (max-width: 760px) {
  /* 列表条目在窄屏下改为两列，避免 4 列输入框过于拥挤 */
  .list-item .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
