/* editor-kit styles.css - v0.1.2 */

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  margin: 1.5rem 2rem;
  color: #1F2937;
  background: #fff;
}

/* ─── 顶栏 B 满色横幅 ─── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #4F46E5;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 1.5rem;
}
.topbar h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.topbar-title { display: flex; flex-direction: column; gap: 2px; }
.topbar-version {
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0;
}
.topbar-handle {
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0;
}
.topbar-actions { display: flex; gap: 8px; }

/* ─── 按钮 ─── */
button {
  padding: 7px 14px;
  border: 1px solid #D1D5DB;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #1F2937;
  font-family: inherit;
  transition: background-color 150ms ease, border-color 150ms ease, transform 80ms ease, box-shadow 150ms ease;
}
button:hover { background: #F9FAFB; }
button:active { transform: translateY(1px); }
button:focus-visible {
  outline: none;
  border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* 顶栏内的按钮（半透明白） */
.topbar button {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.topbar button:hover {
  background: rgba(255, 255, 255, 0.20);
  border-color: rgba(255, 255, 255, 0.4);
}

.primary {
  background: #4F46E5;
  color: white;
  border-color: #4F46E5;
  font-weight: 600;
}
.primary:hover { background: #4338CA; border-color: #4338CA; }
.primary:disabled { background: #9CA3AF; border-color: #9CA3AF; }

/* 顶栏内的主按钮（白底） */
.topbar button.primary {
  background: #fff;
  color: #4F46E5;
  border-color: #fff;
}
.topbar button.primary:hover { background: #F9FAFB; color: #4338CA; }

.hidden { display: none !important; }

/* ─── 设置面板 overlay ─── */
#settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.settings-panel {
  background: #fff;
  padding: 24px 28px;
  border-radius: 10px;
  min-width: 360px;
  max-width: 90vw;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.08);
}
.settings-panel h2 {
  margin-top: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #1F2937;
}
.settings-panel label {
  display: block;
  margin: 16px 0;
  font-size: 0.9rem;
  color: #1F2937;
}
.settings-panel input {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin-top: 6px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.95rem;
  color: #1F2937;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.settings-panel input:focus {
  outline: none;
  border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.settings-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

/* ─── 编辑器主区 ─── */
.editor { max-width: 900px; }
.mode-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.mode-bar label { margin-right: 0; }
.variant-selector label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #6B7280;
}
.variant-selector select {
  padding: 4px 8px;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.85rem;
}

.input-block { display: block; margin: 12px 0; }
.input-block input,
.input-block textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  margin-top: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  color: #1F2937;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.input-block input::placeholder,
.input-block textarea::placeholder { color: #9CA3AF; }
.input-block input:focus,
.input-block textarea:focus {
  outline: none;
  border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.input-block textarea {
  resize: vertical;
  min-height: 160px;
  line-height: 1.6;
}

.action-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.platforms {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}
.platform-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.results { margin-top: 24px; max-width: 900px; }

/* ─── 结果卡 ─── */
.result-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.result-card.loading { border-color: #D97706; }
.result-card.success { border-color: #059669; }
.result-card.error { border-color: #DC2626; background: #FEF2F2; }
.result-card.baseline { border-color: #4F46E5; }

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.result-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1F2937;
}
.result-actions { display: flex; gap: 6px; }

.warning {
  color: #92400e;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.result-body {
  white-space: pre-wrap;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", monospace;
  font-size: 0.92rem;
  line-height: 1.7;
  background: #F9FAFB;
  padding: 12px 14px;
  border-radius: 6px;
  color: #1F2937;
  max-height: 500px;
  overflow-y: auto;
}

/* ─── 调试面板 ─── */
.debug-panel {
  margin: 16px 0;
  border: 1px solid #4F46E5;
  border-radius: 8px;
  overflow: hidden;
}
.debug-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #EEF2FF;
  border-bottom: 1px solid #C7D2FE;
  font-weight: 600;
  font-size: 0.9rem;
  color: #3730A3;
}
.debug-head select {
  padding: 4px 8px;
  border: 1px solid #C7D2FE;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.85rem;
}
.debug-tone-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: #3730A3;
}
.debug-tone-label select {
  padding: 4px 8px;
  border: 1px solid #C7D2FE;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.85rem;
}
#btn-debug-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #6B7280;
  padding: 2px 6px;
}
.debug-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 16px;
  align-items: stretch;
}
.debug-col {
  display: flex;
  flex-direction: column;
}
.debug-col h4 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: #6B7280;
  flex-shrink: 0;
}
.debug-col pre,
.debug-col textarea {
  margin: 0;
  padding: 10px 12px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow-y: auto;
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", monospace;
  color: #1F2937;
  resize: none;
  flex: 1;
  min-height: 200px;
}
.debug-col textarea:focus {
  outline: none;
  border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* ─── 变动对比（妥协清单） ─── */
.diff-view {
  margin-top: 12px;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  overflow: hidden;
}
.diff-head {
  padding: 8px 12px;
  background: #F3F4F6;
  font-size: 0.85rem;
  color: #6B7280;
  border-bottom: 1px solid #E5E7EB;
}
.diff-inline {
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.8;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.diff-add {
  background: #D1FAE5;
  color: #065F46;
}
.diff-remove {
  background: #FEE2E2;
  color: #991B1B;
}
.diff-same {
  color: #6B7280;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
