/* ============================================================
   matrix_extra.css
   免费矩阵生图（matrix.html）补充样式
   补齐 duomi 同款非收费功能所需的样式（智能对话 / 日志 / 尺寸档位 / Box1 分栏等）
   主题沿用 matrix_style.css 的青绿（#7a9e1a）基调
   ============================================================ */

/* ---------- 智能对话按钮 + 日志按钮 ---------- */
.chat_btn {
  background: linear-gradient(135deg, #8a6db1 0%, #6f559a 100%) !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(138, 109, 177, 0.3) !important;
}
.chat_btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(138, 109, 177, 0.45) !important;
}

.log_btn {
  background: linear-gradient(135deg, #4a90d9 0%, #2a6eba 100%) !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(74, 144, 217, 0.3) !important;
}
.log_btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(74, 144, 217, 0.45) !important;
}

/* ---------- Box1 前后导分栏 ---------- */
.box1_split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.box1_split_col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.box1_sub_label {
  font-size: 12px;
  font-weight: 600;
  color: #7a9e1a;
}

/* ---------- 尺寸选择器（像素档位 + 自定义宽高） ---------- */
.size_selector {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 8px;
}
.size_select {
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: white;
  color: #333;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  max-width: 200px;
}
.size_select option { background: white; color: #333; }
.size_select optgroup { background: white; color: #333; font-weight: 600; font-style: normal; }
.size_select:focus { border-color: #7a9e1a; }

.size_custom {
  display: flex;
  align-items: center;
  gap: 6px;
}
.size_custom label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.size_custom input {
  width: 64px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 13px;
  text-align: center;
  outline: none;
}
.size_custom input:focus { border-color: #7a9e1a; }

/* 面板内浅色版本（覆盖顶部深色默认值） */
.panel_head_right .size_selector {
  background: #f4f4ea;
  border: 1px solid #e0e0d0;
  padding: 5px 10px;
}
.panel_head_right .size_select {
  background: white;
  border-color: #d0d0c0;
  color: #333;
}
.panel_head_right .size_custom label { color: #666; }
.panel_head_right .size_custom input {
  background: white;
  border-color: #d0d0c0;
  color: #333;
}

/* ---------- 智能对话弹窗 ---------- */
.chat_modal {
  width: 760px;
  max-width: 92%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat_modal h2 {
  margin: 0 0 6px;
  font-size: 18px;
  padding: 16px 20px;
  border-bottom: 2px solid #8a6db1;
  color: #333;
}
.chat_tip {
  margin: 0;
  padding: 0 20px 12px;
  font-size: 12px;
  color: #999;
  line-height: 1.5;
}
.chat_body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 20px 20px;
  min-height: 0;
  overflow: hidden;
}
.chat_input_area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat_input_area textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.3s ease;
}
.chat_input_area textarea:focus {
  border-color: #8a6db1;
  background: #fbfafe;
}
.chat_actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.chat_result_area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.chat_result_placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #aaa;
  font-size: 13px;
  border: 1px dashed #e0e0e0;
  border-radius: 8px;
  padding: 20px;
}
#chatResult {
  flex: 1;
  width: 100%;
  min-height: 220px;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.7;
  resize: none;
  outline: none;
  background: #fafaf5;
  overflow-y: auto;
}
#chatResult:focus {
  border-color: #8a6db1;
  background: #fbfafe;
}
#chatResult.ai_loading {
  border-color: #8a6db1;
  background: #fbfafe;
  animation: ai_pulse 1.2s ease-in-out infinite;
}
.chat_result_actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.chat_result_actions .v2_btn {
  flex: 1;
  min-width: 120px;
}

/* ---------- 日志查看弹窗 ---------- */
.log_modal {
  width: 80vw;
  max-width: 1100px;
  height: 76vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.log_modal h2 {
  font-size: 18px;
  padding: 16px 20px;
  border-bottom: 2px solid #4a90d9;
  color: #333;
}
.log_body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}
.log_list_wrap {
  width: 280px;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  background: #fafaf5;
  flex-shrink: 0;
}
.log_list {
  padding: 8px;
}
.log_item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-left: 3px solid transparent;
}
.log_item:hover { background: #f0f5fa; }
.log_item.active {
  background: #eaf2fb;
  border-left-color: #4a90d9;
}
.log_item_name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  word-break: break-all;
}
.log_item_meta {
  font-size: 11px;
  color: #999;
}
.log_list_empty {
  color: #999;
  text-align: center;
  padding: 30px 10px;
  font-size: 12px;
}
.log_detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.log_detail_head {
  padding: 10px 16px;
  background: #f4f4f0;
  border-bottom: 1px solid #e0e0e0;
  font-size: 13px;
  color: #555;
  font-weight: 600;
  flex-shrink: 0;
}
.log_detail_content {
  flex: 1;
  margin: 0;
  padding: 16px;
  overflow-y: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #333;
  white-space: pre-wrap;
  word-break: break-all;
  background: #fff;
}

/* ---------- 移动端：屏宽分界线 980px ---------- */
@media (max-width: 980px) {
  .box1_split { grid-template-columns: 1fr; }
  .chat_modal { width: 95vw; max-height: 90vh; }
  .log_modal { width: 95vw; height: 90vh; }
  .log_body { flex-direction: column; }
  .log_list_wrap { width: 100%; max-height: 30%; border-right: none; border-bottom: 1px solid #e0e0e0; }
}

/* ---------- 批次模式面板 ---------- */
.batch_panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.batch_dialog {
  width: 560px;
  max-width: 92%;
  max-height: 86vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.batch_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 2px solid #7a9e1a;
}
.batch_head h2 {
  margin: 0;
  font-size: 17px;
  color: #333;
}
.batch_close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #999;
  cursor: pointer;
}
.batch_close:hover { color: #e05555; }
.batch_tip {
  margin: 0;
  padding: 12px 18px 0;
  font-size: 12px;
  color: #888;
  line-height: 1.6;
}
.batch_tip code {
  background: #f0f5e8;
  color: #5a7e0a;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}
.batch_row {
  display: flex;
  gap: 10px;
  padding: 12px 18px;
}
.batch_input {
  flex: 1;
  padding: 9px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s ease;
}
.batch_input:focus { border-color: #7a9e1a; background: #fafef8; }
.batch_status {
  padding: 0 18px 8px;
  font-size: 12px;
  color: #666;
  min-height: 18px;
}
.batch_list {
  list-style: none;
  margin: 0;
  padding: 0 18px 18px;
  overflow-y: auto;
  flex: 1;
}
.batch_list li {
  border: 1px solid #e8e8dc;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.batch_list li:hover {
  border-color: #7a9e1a;
  box-shadow: 0 2px 12px rgba(122, 158, 26, 0.18);
}
.batch_list li a {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
}
.batch_list .case_name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.batch_list .case_meta {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: #999;
  word-break: break-all;
}
.batch_actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-bottom: 1px dashed #e0e0e0;
  flex-wrap: wrap;
}
.batch_selall {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
}
.batch_count {
  font-size: 12px;
  color: #7a9e1a;
}
.batch_item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}
.batch_item input.batch_cb {
  margin-top: 3px;
  width: 15px;
  height: 15px;
  accent-color: #7a9e1a;
  flex: none;
}
