/**
 * AI创投日报 - 卡片翻转效果样式
 * 实现3D翻转动画显示团队信息
 */

/* 卡片容器 - 支持3D翻转 */
.funding-card {
  position: relative;
  width: 100%;
  height: 280px; /* 桌面端固定高度，确保内容正常显示 */
  perspective: 1000px;
  cursor: pointer;
  transition: transform 0.2s ease;
  margin-bottom: 1rem;
  border: none !important;
  background: transparent !important;
}

.funding-card:hover {
  transform: translateY(-2px);
}

/* 卡片内部容器 */
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: left;
  transition: transform 0.6s ease-in-out;
  transform-style: preserve-3d;
}

/* 翻转状态 */
.funding-card.flipped .card-inner {
  transform: rotateY(180deg);
}

/* 卡片正面和背面共同样式 */
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  background: white;
  border: none;
  display: flex;
  flex-direction: column;
  overflow: visible; /* 修复桌面端内容消失问题 */
}

/* 卡片正面样式 */
.card-front {
  z-index: 2;
}

/* 卡片背面样式 */
.card-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

/* 正面：公司信息区域 */
.funding-company {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.company-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2c3e50;
  flex: 1;
  cursor: pointer;
  transition: color 0.3s ease;
}

.company-name:hover {
  color: #fa8c32;
  text-decoration: underline;
}

.company-stage,
.funding-stage {
  background: rgba(250, 140, 50, 0.1);
  color: #fa8c32;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 0.75rem;
}

/* 正面：融资金额 */
.funding-amount {
  font-size: 1.3rem;
  font-weight: 800;
  color: #27ae60;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.amount-currency {
  font-size: 1rem;
  opacity: 0.8;
}

/* 正面：公司描述 */
.funding-description {
  color: #5a6c7d;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  flex: 1;
}

/* 正面：标签和元信息 */
.funding-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap; /* 保持单行布局 */
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f3f4;
}

.funding-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
  align-items: center;
}

.funding-tag {
  background: #f8f9fa;
  color: #495057;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid #e9ecef;
}

.funding-time {
  color: #868e96;
  font-size: 0.8rem;
  font-weight: 500;
}

/* 翻转提示 - 右对齐显示 */
.flip-hint {
  background: rgba(250, 140, 50, 0.1);
  color: #fa8c32;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  opacity: 0.8;
  pointer-events: none;
  white-space: nowrap;
  flex-shrink: 0; /* 防止压缩 */
}

/* 背面：团队信息内容 */
.team-info-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.team-header {
  text-align: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #fa8c32;
}

.team-header h3 {
  margin: 0;
  color: #fa8c32;
  font-size: 1.1rem;
  font-weight: 600;
}

.team-section {
  flex: 1;
  margin-bottom: 1rem;
}

.team-section h4 {
  color: #2c3e50;
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.team-section p {
  color: #555;
  line-height: 1.4;
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
}

/* 创始人信息 */
.founders-list {
  margin-top: 0.5rem;
}

.founder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: rgba(250, 140, 50, 0.05);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  border-left: 3px solid #fa8c32;
}

.founder-name {
  font-weight: 600;
  color: #2c3e50;
  cursor: pointer;
  transition: color 0.3s ease;
}

.founder-name:hover {
  color: #fa8c32;
  text-decoration: underline;
}

.founder-contact {
  display: flex;
  gap: 0.5rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: #fa8c32;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  transition: background 0.3s ease;
}

.contact-link:hover {
  background: #e07b2a;
  color: white;
}

/* 卡片背面底部区域 */
.card-back-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap; /* 保持单行布局 */
}

/* 公司信息链接 - 左对齐 */
.company-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: rgba(39, 174, 96, 0.1);
  color: #27ae60;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.company-link:hover {
  background: rgba(39, 174, 96, 0.2);
  color: #219a52;
  transform: translateY(-1px);
}

/* 创始人链接样式 */
.founder-link {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dotted #3498db;
  padding: 1px 2px;
  transition: all 0.3s ease;
  border-radius: 3px;
}

.founder-link:hover {
  background: rgba(52, 152, 219, 0.1);
  color: #2980b9;
  border-bottom: 1px solid #2980b9;
  text-decoration: none;
}

/* 返回按钮 - 右对齐 */
.flip-back-button {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.flip-back-button:hover {
  background: linear-gradient(135deg, #5a6268, #3d4449);
  transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .funding-card {
    height: 320px !important; /* 移动端固定高度 */
    margin-bottom: 1.5rem;
    /* 优化触摸反馈 */
    -webkit-tap-highlight-color: rgba(250, 140, 50, 0.2);
    touch-action: manipulation;
  }

  .funding-card:active {
    transform: translateY(-1px) scale(0.98);
  }

  .card-front,
  .card-back {
    padding: 1rem;
  }

  .company-name {
    /* 保持与桌面端一致的字体大小 */
    font-size: 1.1rem;
    /* 增加点击区域 */
    padding: 0.25rem 0;
    margin: -0.25rem 0;
  }

  .funding-amount {
    /* 保持与桌面端一致的字体大小 */
    font-size: 1.3rem;
  }

  .funding-company {
    /* 保持与桌面端一致的水平布局 */
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .company-stage,
.funding-stage {
    /* 保持与桌面端一致的右对齐 */
    margin-left: 0.75rem;
  }

  .founder-item {
    /* 保持与桌面端一致的水平布局 */
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
  }

  .founder-contact {
    /* 保持与桌面端一致的布局 */
    display: flex;
    gap: 0.5rem;
  }

  .founder-name {
    /* 增加点击区域 */
    padding: 0.25rem 0;
    margin: -0.25rem 0;
  }

  .contact-link {
    /* 增大移动端按钮 */
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .card-back-footer {
    flex-direction: row; /* 保持水平布局 */
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
  }

  .company-link {
    /* 保持与桌面端一致的样式 */
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-height: 44px;
    flex-shrink: 0;
  }

  .flip-back-button {
    /* 保持与桌面端一致的布局 */
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    min-height: 44px;
    flex-shrink: 0;
  }

  .flip-hint {
    /* 保持与桌面端一致的样式 */
    background: rgba(250, 140, 50, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    opacity: 0.8;
    flex-shrink: 0;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .funding-card {
    height: 350px !important; /* 小屏幕固定高度 */
    margin-bottom: 1rem;
  }

  .card-front,
  .card-back {
    padding: 0.75rem;
  }

  .team-section {
    margin-bottom: 0.75rem;
  }

  .team-section h4 {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
  }

  .team-section p {
    font-size: 0.8rem;
    line-height: 1.3;
  }

  .contact-link {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
    min-width: 28px;
    min-height: 28px;
  }

  .founder-item {
    padding: 0.4rem;
    margin-bottom: 0.4rem;
  }

  .founder-name {
    font-size: 0.85rem;
  }

  .flip-hint {
    /* 保持与桌面端一致的样式 */
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .team-header h3 {
    font-size: 1rem;
  }

  .company-link {
    /* 保持与桌面端一致的样式 */
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }

  .flip-back-button {
    /* 保持与桌面端一致的样式 */
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }
}

/* 超小屏幕（如iPhone SE）优化 */
@media (max-width: 360px) {
  .funding-card {
    height: 350px !important; /* 超小屏幕固定高度 */
  }

  .card-front,
  .card-back {
    /* 保持适当的内边距 */
    padding: 0.75rem;
  }

  .funding-description {
    font-size: 0.85rem;
    /* 移除行数限制，允许完整显示 */
    overflow: hidden;
    word-break: break-word;
    hyphens: auto;
  }

  .team-section p {
    font-size: 0.75rem;
  }

  .founder-item {
    padding: 0.3rem;
  }

  .contact-link {
    font-size: 0.7rem;
    padding: 0.25rem 0.4rem;
    min-width: 24px;
    min-height: 24px;
  }
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
  .card-front,
  .card-back {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .card-back {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  }

  .company-name {
    color: #e2e8f0;
  }

  .funding-description {
    color: #a0aec0;
  }

  .funding-tag {
    background: #4a5568;
    color: #e2e8f0;
    border-color: #5a6c7d;
  }

  .founder-item {
    background: rgba(250, 140, 50, 0.1);
  }
}

/* 🎯 新增样式支持 */

/* 可点击元素样式 */
.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.clickable:hover {
  color: #fa8c32;
  transform: scale(1.02);
}

/* 公司洞察信息样式 */
.company-insights {
  padding: 1rem;
  background: rgba(250, 140, 50, 0.05);
  border-radius: 8px;
  border-left: 3px solid #fa8c32;
}

.company-insights p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.company-insights strong {
  color: #fa8c32;
  font-weight: 600;
}

/* 联系说明样式 */
.contact-note {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(116, 134, 147, 0.1);
  border-radius: 6px;
  text-align: center;
}

.contact-note small {
  color: #7f8c8d;
  font-style: italic;
}

/* 描述文本优化 - 自适应字体大小显示完整信息 */
.funding-description {
  line-height: 1.3;
  margin-bottom: 1rem;
  /* 根据文本长度自动调整字体大小 - 移除clamp让JS控制 */
  word-break: break-word;
  hyphens: auto;
  /* 移除所有高度和显示限制，确保完整显示 */
}

/* 标签容器优化 */
.funding-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 2rem; /* 确保有足够空间显示标签 */
  align-items: flex-start;
}

/* 标签样式优化 */
.funding-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: rgba(250, 140, 50, 0.1);
  color: #fa8c32;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(250, 140, 50, 0.2);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.funding-tag:hover {
  background: rgba(250, 140, 50, 0.2);
  border-color: rgba(250, 140, 50, 0.4);
}

/* 卡片内容布局优化 */
.card-front {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.funding-meta {
  margin-top: auto; /* 推到底部 */
  padding-top: 0.75rem;
  border-top: 1px solid #f1f3f4;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .funding-card {
      height: 300px; /* 增加手机端高度以改善内容显示 */
    }

  .company-insights p {
    font-size: 0.85rem;
  }

  .funding-description {
    font-size: 0.9rem;
    /* 移动端也允许完整显示，通过字体大小控制 */
    word-break: break-word;
    hyphens: auto;
    height: auto;
    min-height: 3em;
  }
}
/* 融资卡片头部布局 */
.funding-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.funding-header .funding-company {
  margin: 0;
  flex: 1;
}

.funding-header .funding-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  margin-left: 0.75rem;
}

.funding-header .funding-stage {
  background: rgba(250, 140, 50, 0.1);
  color: #fa8c32;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.funding-header .funding-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: #27ae60;
  white-space: nowrap;
}
