/* static/shared/style.css */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f9fafb;
  margin: 0;
  padding: 20px;
}
.container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 有顶部固定语言栏时，给主容器留出空间，避免“返回首页”被遮挡 */
body:has(.language-bar) .container {
  margin-top: 64px;
}
@media (max-width: 768px) {
  body:has(.language-bar) .container {
    margin-top: 80px;
  }
}
h1 { color: #000000; }
.desc { color: #64748b; margin-bottom: 24px; }
.upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: 6px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 24px;
}
.field-card {
  background: #f1f5f9;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}
.btn:hover { background: #2563eb; }
.upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
  background: #f8fafc;
}
.field-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.field-card:hover {
  border-color: #94a3b8;
}
.field-card .status {
  color: #64748b;
  font-size: 14px;
}
#previewSection h3 {
  margin-top: 24px;
  margin-bottom: 12px;
  color: #334155;
}

.excel-table {
  border-collapse: collapse;
  width: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 12px; /* 小字号 */
  margin-top: 8px;
}

.excel-table th,
.excel-table td {
  border: 1px solid #ccc;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.excel-table th {
  background-color: #f0f0f0;
  font-weight: bold;
  color: #333;
}

.excel-table tr:nth-child(even) {
  background-color: #fafafa;
}

.excel-table tr:hover {
  background-color: #f5f5f5;
}

/* ============ Excel-like 表格样式 ============ */

.table-container {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px; /* 缩小字号 */
  line-height: 1.4;
  color: #1e293b;
}

/* 表头 */
.result-table thead th {
  background-color: #f8fafc;
  border-bottom: 2px solid #cbd5e1;
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  border-right: 1px solid #e2e8f0;
}

/* 表格单元格 */
.result-table td {
  padding: 1.4px 5.88px; /* 上下减少50%：2.8px->1.4px，左右减少30%：8.4px->5.88px */
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
  border-right: 1px solid #e2e8f0;
}

/* 斑马纹：奇数行浅灰 */
.result-table tbody tr:nth-child(odd) {
  background-color: #ffffff;
}
.result-table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

/* 悬停高亮（可选，提升交互感） */
.result-table tbody tr:hover {
  background-color: #f1f5f9 !important;
}

/* 数字右对齐（智能识别？先全局左对齐，后续可扩展） */
/* 如果你希望“客户人数”等数字列右对齐，可在 renderTable 中加 class */
.result-table td.number {
  text-align: right;
  font-family: 'SF Mono', 'Consolas', monospace;
}

/* 响应式：小屏允许横向滚动 */
@media (max-width: 640px) {
  .table-container {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* 最后一列不显示右侧边框 */
.result-table th:last-child,
.result-table td:last-child {
  border-right: none;
}

/* 隐藏所有复制表格按钮 */
.copy-table-btn {
  display: none !important;
}



.preview-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  font-size: 14px;
  color: #2b2b2b;
}

.preview-table thead th {
  border: 1px solid #d9d9d9;
  padding: 8px;
  background-color: #e7ebf0;
  text-align: left;
  font-weight: bold;
  font-size: 14px;
  color: #2b2b2b;
  vertical-align: top;
}

.preview-table tbody td {
  border: 1px solid #d9d9d9;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.preview-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.preview-table tbody tr:hover {
  background-color: #eaf6ff;
}