/* CSV ↔ JSON 转换器 UI(中英页共用) */
.csvc-actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin: 0 0 16px;
}
.csvc-actions button {
  font: inherit; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 999px; padding: 8px 20px; cursor: pointer;
  transition: opacity .12s, transform .12s;
}
.csvc-actions button:active { transform: scale(.97); }
.csvc-actions button.primary { background: var(--dark-btn); border-color: var(--dark-btn); color: var(--on-accent); }
.csvc-actions button.primary:hover { opacity: .88; }
.csvc-actions button:disabled { opacity: .45; cursor: not-allowed; }

.csvc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .csvc-grid { grid-template-columns: 1fr; } }
.csvc-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.csvc-card h2 { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text2); }
.csvc-card textarea {
  flex: 1; width: 100%; min-height: 300px; resize: vertical;
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 14px; line-height: 1.6;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  background: var(--bg); color: var(--text);
}
.csvc-status { text-align: center; font-size: 14px; color: var(--text2); margin-top: 12px; min-height: 18px; }

.wc-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
  margin: 16px 0 0;
}
.wc-stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.wc-stat span { display: block; font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.wc-stat strong { font-size: 22px; font-weight: 600; color: var(--text); }

.cp-swatches {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 8px 0 0;
}
.cp-swatch {
  border: 1px solid var(--border); border-radius: var(--radius); min-height: 88px;
  cursor: pointer; display: flex; align-items: flex-end; justify-content: center;
  padding: 8px; font: inherit; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.45);
}
.cp-swatch span { font-size: 12px; font-weight: 600; }
@media (max-width: 640px) { .cp-swatches { grid-template-columns: repeat(2, 1fr); } }

/* HTML 预览 UI(中英页共用),布局类复用 csvc.css 的 csvc-grid/csvc-card/csvc-actions */
.htmlpv-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.htmlpv-card-head h2 {
  margin-bottom: 0;
}
.htmlpv-file-meta {
  font-size: 12px;
  color: var(--text2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.htmlpv-mini-btn {
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
}
.htmlpv-mini-btn:hover {
  border-color: var(--accent);
}
.htmlpv-greeting-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text2);
}
.htmlpv-greeting-bar[hidden],
.htmlpv-large-notice[hidden],
.htmlpv-fs-bar[hidden] {
  display: none !important;
}
.htmlpv-greeting-bar input {
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  min-width: 190px;
}
.htmlpv-greeting-bar button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--dark-btn);
  background: var(--dark-btn);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
}
.htmlpv-large-notice {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 10px;
}
.htmlpv-large-notice p {
  margin: 0 0 12px;
}
.htmlpv-large-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.htmlpv-large-actions button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
}
.htmlpv-large-actions button.primary {
  background: var(--dark-btn);
  border-color: var(--dark-btn);
  color: var(--on-accent);
}
.csvc-grid.is-dragover .csvc-card:first-child {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}
.htmlpv-frame-wrap {
  flex: 1;
  position: relative;
  background: #fff; /* 用户 HTML 默认按白底渲染,与浏览器新开页一致 */
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
}
.htmlpv-frame-wrap.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  background: #020308;
}
.htmlpv-frame-wrap.is-fullscreen #hpFrame {
  min-height: 100%;
  height: 100%;
}
.htmlpv-fs-bar {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 10000;
  display: flex;
  gap: 8px;
}
.htmlpv-fs-bar button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.htmlpv-fs-bar button:hover {
  background: #1e293b;
}
#hpFrame {
  flex: 1;
  width: 100%;
  min-height: 440px;
  border: 0;
  background: #fff;
}
.htmlpv-auto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  user-select: none;
}
.htmlpv-auto input { accent-color: var(--accent); }