/* v158：案號明細 Excel 平面貼上介面 */
.excel-response-module {
  min-width: 0;
}

.excel-response-help {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: #36536f;
  background: #eef7ff;
  border: 1px solid #b9d6ee;
  border-bottom: 0;
  font-size: 12px;
}

.excel-response-help b {
  flex: 0 0 auto;
  color: #0b4f82;
}

.excel-response-scroll {
  width: 100%;
  max-width: 100%;
  height: clamp(260px, 45vh, 620px);
  min-height: 260px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid #c7d8e8;
}

.excel-response-table {
  width: max-content !important;
  min-width: 1580px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.excel-response-table th,
.excel-response-table td {
  box-sizing: border-box;
  min-width: 96px;
  height: 34px;
  padding: 6px 8px;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  border-right: 1px solid #cbd9e7;
  border-bottom: 1px solid #cbd9e7;
}

.excel-response-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  color: #fff;
  background: #184f7a;
  font-weight: 700;
}

.excel-response-table th:nth-child(1),
.excel-response-table td:nth-child(1) { width: 112px; }
.excel-response-table th:nth-child(2),
.excel-response-table td:nth-child(2) { width: 96px; }
.excel-response-table th:nth-child(3),
.excel-response-table td:nth-child(3) { width: 110px; }
.excel-response-table th:nth-child(4),
.excel-response-table td:nth-child(4) { width: 190px; }
.excel-response-table th:nth-child(5),
.excel-response-table td:nth-child(5),
.excel-response-table th:nth-child(6),
.excel-response-table td:nth-child(6),
.excel-response-table th:nth-child(7),
.excel-response-table td:nth-child(7),
.excel-response-table th:nth-child(8),
.excel-response-table td:nth-child(8) { width: 96px; }
.excel-response-table th:nth-child(9),
.excel-response-table td:nth-child(9),
.excel-response-table th:nth-child(10),
.excel-response-table td:nth-child(10),
.excel-response-table th:nth-child(11),
.excel-response-table td:nth-child(11) { width: 112px; }
.excel-response-table th:nth-child(12),
.excel-response-table td:nth-child(12) { width: 130px; }
.excel-response-table th:nth-child(13),
.excel-response-table td:nth-child(13) { width: 220px; }

.excel-response-table tbody tr:nth-child(even):not(.excel-paste-target) td {
  background: #f7fafc;
}

.excel-response-table tbody td:focus {
  position: relative;
  z-index: 2;
  outline: 2px solid #1689d4;
  outline-offset: -2px;
  background: #eaf6ff;
}

.excel-paste-target td {
  color: #1a5d8f;
  background: #eef8ff;
  border-bottom: 2px solid #49a0dd;
  cursor: cell;
}

.excel-paste-target td:empty::after {
  content: "貼上";
  color: #95abc0;
  font-size: 11px;
}

.excel-paste-target.is-locked td {
  color: #7d8791;
  background: #f1f3f5;
  cursor: not-allowed;
}

.excel-paste-target.is-locked td:empty::after {
  content: "上鎖";
}

.excel-response-count {
  padding: 7px 10px;
  color: #64748b;
  text-align: right;
  font-size: 12px;
}

.response-paste-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 31, 49, .55);
}

.response-paste-dialog {
  display: flex;
  flex-direction: column;
  width: min(1040px, calc(100vw - 36px));
  max-height: min(820px, calc(100vh - 36px));
  overflow: hidden;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .28);
}

.response-paste-dialog > header,
.response-paste-dialog > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
}

.response-paste-dialog > header {
  border-bottom: 1px solid #dce5ed;
}

.response-paste-dialog > header h2,
.response-paste-dialog > header p {
  margin: 0;
}

.response-paste-dialog > header h2 { font-size: 18px; }
.response-paste-dialog > header p { margin-top: 4px; color: #64748b; font-size: 12px; }
.response-paste-dialog > header button { min-width: 34px; min-height: 34px; font-size: 20px; }

.response-paste-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px 0;
}

.response-paste-summary article {
  padding: 10px 12px;
  background: #f5f8fb;
  border: 1px solid #dce5ed;
  border-radius: 7px;
}

.response-paste-summary span { display: block; color: #64748b; font-size: 12px; }
.response-paste-summary b { display: block; margin-top: 3px; font-size: 20px; }
.response-paste-summary .success { background: #edfaf3; border-color: #9bd5b5; }
.response-paste-summary .warning { background: #fff8e6; border-color: #ebca71; }
.response-paste-summary .error { background: #fff0f0; border-color: #eaa1a1; }

.response-paste-errors {
  max-height: 140px;
  margin: 12px 18px 0;
  padding: 10px 12px;
  overflow: auto;
  color: #8d2020;
  background: #fff1f1;
  border: 1px solid #e5a4a4;
  border-radius: 6px;
  font-size: 12px;
}

.response-paste-errors ol { margin: 6px 0 0; padding-left: 22px; }

.response-paste-preview-table {
  flex: 1 1 auto;
  min-height: 140px;
  margin: 12px 18px 0;
  overflow: auto;
  border: 1px solid #ccd9e5;
}

.response-paste-preview-table table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 12px;
}

.response-paste-preview-table th,
.response-paste-preview-table td {
  padding: 7px 8px;
  text-align: center;
  border-right: 1px solid #dce5ed;
  border-bottom: 1px solid #dce5ed;
}

.response-paste-preview-table th {
  position: sticky;
  top: 0;
  color: #fff;
  background: #184f7a;
}

.response-paste-dialog > footer {
  justify-content: flex-end;
  border-top: 1px solid #dce5ed;
  margin-top: 14px;
}

.response-paste-dialog > footer button {
  min-width: 110px;
}

@media (max-width: 760px) {
  .excel-response-help { align-items: flex-start; flex-direction: column; gap: 3px; }
  .excel-response-scroll { height: clamp(240px, 42vh, 480px); }
  .response-paste-overlay { padding: 8px; }
  .response-paste-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .response-paste-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
