* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f7fa;
  color: #333333;
  line-height: 1.6;
}

/* 登录页面 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  padding: 20px;
}

.login-container {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 50px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-header h1 {
  font-size: 32px;
  margin-bottom: 10px;
  color: #1a1a1a;
}

.login-header p {
  color: #666666;
  font-size: 14px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555555;
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  height: 48px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 15px;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #1890ff;
  box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.form-group textarea {
  height: auto;
  padding: 12px 16px;
  resize: vertical;
}

.login-tips {
  text-align: center;
  margin-top: 20px;
  color: #999999;
  font-size: 13px;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background-color: #1890ff;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #096dd9;
}

.btn-success {
  background-color: #52c41a;
  color: #ffffff;
}

.btn-success:hover {
  background-color: #389e0d;
}

.btn-danger {
  background-color: #ff4d4f;
  color: #ffffff;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid #d9d9d9;
  color: #666666;
}

.btn-outline:hover {
  border-color: #1890ff;
  color: #1890ff;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

/* 导航栏 */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 30px;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 22px;
  font-weight: bold;
  color: #1890ff;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-user span {
  color: #666666;
  font-size: 14px;
}

/* 标签页 */
.tabs {
  display: flex;
  gap: 8px;
  padding: 16px 30px;
  background-color: #ffffff;
  border-bottom: 1px solid #f0f0f0;
}

.tab-btn {
  padding: 10px 24px;
  border: none;
  background-color: transparent;
  color: #666666;
  font-size: 15px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  background-color: #f5f5f5;
}

.tab-btn.active {
  background-color: #1890ff;
  color: #ffffff;
}

.tab-content {
  display: none;
  padding: 30px;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 工具栏 */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 250px;
  height: 44px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 14px;
}

.search-input:focus {
  outline: none;
  border-color: #1890ff;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 18px;
  border: 2px solid transparent;
  background-color: #f5f5f5;
  color: #666666;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background-color: #e6e6e6;
}

.filter-btn.active {
  background-color: #e6f7ff;
  color: #1890ff;
  border-color: #1890ff;
}

/* 客户列表 */
.customer-list {
  display: grid;
  gap: 16px;
}

.customer-rows {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.customer-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.customer-row:last-child {
  border-bottom: none;
}

.customer-row:hover {
  background-color: #f5f9ff;
}

.row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  flex-shrink: 0;
}

.row-company {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
}

.stage-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

.stage-badge.summarized { background-color: #e6f7ff; color: #1890ff; }
.stage-badge.arranging_bank { background-color: #e6f7ff; color: #1890ff; }
.stage-badge.waiting_visit { background-color: #fff7e6; color: #fa8c16; }
.stage-badge.visited { background-color: #e6f7ff; color: #1890ff; }
.stage-badge.reviewing { background-color: #fff7e6; color: #fa8c16; }
.stage-badge.approved { background-color: #f6ffed; color: #52c41a; }
.stage-badge.disbursing { background-color: #f6ffed; color: #52c41a; }
.stage-badge.completed { background-color: #f6ffed; color: #52c41a; }

/* 附件区域 */
.attachment-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachment-box span {
  font-size: 14px;
}

.attachment-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-danger {
  background-color: #ff4d4f;
  color: #fff;
  border: none;
}

.btn-danger:hover {
  background-color: #ff7875;
}

.row-contact {
  flex: 1;
  color: #666666;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-manager {
  margin-left: 10px;
  color: #1890ff;
  font-size: 12px;
}

/* 新增/编辑弹窗里的文件选择器 */
.file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-picker-name {
  color: #666666;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.row-amount {
  color: #ff4d4f;
  font-weight: bold;
  font-size: 14px;
  min-width: 70px;
  text-align: right;
  flex-shrink: 0;
}

.row-time {
  color: #999999;
  font-size: 12px;
  min-width: 120px;
  text-align: right;
  flex-shrink: 0;
}

/* 统计卡片 */
.stat-overview,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  border-radius: 12px;
  padding: 28px;
  color: #ffffff;
  text-align: center;
}

.stat-card h3 {
  font-size: 42px;
  font-weight: bold;
  margin-bottom: 8px;
}

.stat-card p {
  font-size: 15px;
  opacity: 0.9;
}

.stat-orange {
  background: linear-gradient(135deg, #fa8c16 0%, #d46b08 100%);
}

.stat-green {
  background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
}

/* 卡片 */
.card {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
}

.card h2 {
  font-size: 20px;
  margin-bottom: 20px;
  color: #1a1a1a;
}

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.data-table th {
  background-color: #fafafa;
  font-weight: 600;
  color: #666666;
}

.data-table tr:hover {
  background-color: #fafafa;
}

/* 阶段图表 */
.stage-chart {
  margin-top: 20px;
}

.stage-item {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.stage-name {
  width: 120px;
  font-size: 14px;
  color: #333333;
}

.stage-bar-wrapper {
  flex: 1;
  height: 24px;
  background-color: #f0f0f0;
  border-radius: 12px;
  overflow: hidden;
  margin: 0 16px;
}

.stage-bar {
  height: 100%;
  background-color: #1890ff;
  border-radius: 12px;
  transition: width 0.5s ease;
}

.stage-count {
  width: 50px;
  text-align: right;
  font-weight: 600;
  color: #1890ff;
}

/* 模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.modal-content {
  background-color: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease;
}

.modal-lg {
  max-width: 800px;
}

/* ===== DOCX在线预览弹窗 ===== */
.modal-preview {
  max-width: 960px;
  width: 95%;
  height: 90vh;
  display: flex;
  flex-direction: column;
}

.preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background-color: #f5f6fa;
}

.preview-loading {
  text-align: center;
  color: #999999;
  padding: 80px 0;
  font-size: 15px;
}

.docx-container {
  background-color: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

/* docx-preview 渲染内容的适配 */
.docx-container .docx-wrapper {
  background: #f5f6fa !important;
  padding: 16px !important;
}

.docx-container .docx-wrapper > section.docx {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1) !important;
  margin-bottom: 16px !important;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid #f0f0f0;
}

.modal-header h2 {
  font-size: 20px;
  color: #1a1a1a;
}

.close-btn {
  width: 36px;
  height: 36px;
  border: none;
  background-color: #f5f5f5;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  color: #666666;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background-color: #ff4d4f;
  color: #ffffff;
}

.modal-body {
  padding: 28px;
}

/* 信息区域 */
.info-section {
  margin-bottom: 32px;
}

.info-section h3 {
  font-size: 17px;
  margin-bottom: 20px;
  color: #1a1a1a;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-item.full-width {
  grid-column: span 2;
}

.info-item label {
  font-size: 13px;
  color: #999999;
  font-weight: 500;
}

.info-item span {
  font-size: 15px;
  color: #333333;
  font-weight: 500;
}

/* 时间线 */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #e0e0e0;
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #1890ff;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px #1890ff;
}

.timeline-stage {
  font-size: 15px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 4px;
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #999999;
  margin-top: 6px;
}

.timeline-notes {
  margin-top: 8px;
  padding: 10px 14px;
  background-color: #fafafa;
  border-radius: 6px;
  font-size: 13px;
  color: #666666;
}

/* 表单行 */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999999;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar {
    padding: 12px 16px;
  }

  .tabs {
    padding: 12px 16px;
    overflow-x: auto;
  }

  .tab-content {
    padding: 16px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-item.full-width {
    grid-column: span 1;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
  }

  .search-input {
    min-width: auto;
  }

  .customer-row {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
  }

  .row-left {
    min-width: auto;
    flex: 1;
  }

  .row-contact {
    flex-basis: 100%;
    order: 3;
  }

  .row-time {
    min-width: auto;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
