/* ── 客户案例列表页 ── */

/* 案例页面顶部介绍 */
.case-page .case-intro {
  max-width: 900px;
  margin: 48px auto 32px;
  padding: 0 16px;
  text-align: center;
}

.case-page .case-intro h2 {
  font-size: 2.2em;
  color: var(--primary);
  margin-bottom: 12px;
  font-weight: bold;
}

.case-page .case-intro p {
  color: #555;
  font-size: 1.05em;
  line-height: 1.8;
}

/* 分类筛选标签 */
.case-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 auto 40px;
  padding: 0 16px;
}

.case-filter-btn {
  padding: 8px 24px;
  border: 1.5px solid var(--primary);
  border-radius: 24px;
  background: transparent;
  color: var(--primary);
  font-size: 0.98em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.case-filter-btn:hover,
.case-filter-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(var(--primary-rgb, 0,119,204), 0.18);
}

/* 案例卡片网格 */
.case-list-section {
  max-width: 1400px;
  margin: 0 auto 60px;
  padding: 0 16px;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.case-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.case-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.case-card-img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  display: block;
  background: #f0f2f5;
  padding: 8px;
  box-sizing: border-box;
}

.case-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.case-card-customer {
  font-size: 0.85em;
  color: var(--accent, #00b4ff);
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.case-card-title {
  font-size: 1.1em;
  font-weight: bold;
  color: #222;
  margin-bottom: 10px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-card-desc {
  color: #666;
  font-size: 0.95em;
  line-height: 1.7;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.case-card-tag {
  font-size: 0.8em;
  padding: 3px 10px;
  border-radius: 12px;
  background: #f0f4f8;
  color: #555;
  white-space: nowrap;
}

.case-card-more {
  margin-top: 14px;
  color: var(--primary);
  font-size: 0.92em;
  font-weight: 600;
}

/* ── 案例详情页 ── */
.case-detail-banner {
  width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
  margin-top: 0;
}

.case-detail-page .banner {
  overflow: hidden;
  line-height: 0;
  background: #e8eef5;
}

.case-detail-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 16px 60px;
}

.case-detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92em;
  color: #888;
  margin-bottom: 32px;
}

.case-detail-breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.case-detail-breadcrumb a:hover {
  text-decoration: underline;
}

.case-detail-header {
  margin-bottom: 36px;
}

.case-detail-customer {
  display: inline-block;
  font-size: 0.88em;
  color: var(--accent, #00b4ff);
  font-weight: 600;
  background: #f0f7ff;
  padding: 4px 14px;
  border-radius: 16px;
  margin-bottom: 14px;
}

.case-detail-title {
  font-size: 1.8em;
  font-weight: bold;
  color: #222;
  margin-bottom: 16px;
  line-height: 1.4;
}

.case-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.case-detail-tag {
  font-size: 0.85em;
  padding: 4px 14px;
  border-radius: 16px;
  background: #f0f4f8;
  color: #555;
  white-space: nowrap;
}

.case-detail-main-img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 36px;
  max-height: 520px;
  object-fit: contain;
  background: #f5f7fa;
}

.case-detail-section {
  margin-bottom: 36px;
}

.case-detail-section-title {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.case-detail-text {
  color: #444;
  font-size: 1em;
  line-height: 2;
}

/* 返回按钮 */
.case-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border: 1.5px solid var(--primary);
  border-radius: 6px;
  color: var(--primary);
  font-size: 0.95em;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  margin-top: 20px;
}

.case-back-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* ── 方案预览按钮 ── */
.case-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px;
  border: 1.5px solid var(--accent, #00b4ff);
  border-radius: 20px;
  background: transparent;
  color: var(--accent, #00b4ff);
  font-size: 0.88em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
  white-space: nowrap;
  margin-left: 8px;
}

.case-preview-btn:hover {
  background: var(--accent, #00b4ff);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 180, 255, 0.25);
}

.case-preview-btn svg {
  flex-shrink: 0;
}

/* ── 方案预览弹窗 ── */
.case-preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
}

.case-preview-modal.active {
  display: flex;
}

.case-preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.case-preview-dialog {
  position: relative;
  width: 92vw;
  height: 90vh;
  max-width: 1200px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: casePreviewFadeIn 0.3s ease;
}

@keyframes casePreviewFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.case-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.case-preview-title {
  font-size: 1.05em;
  font-weight: 600;
  color: #333;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 48px);
}

.case-preview-close {
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  font-size: 1.4em;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.case-preview-close:hover {
  background: #e0e0e0;
  color: #333;
}

.case-preview-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #f0f2f5;
}

.case-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* 加载状态 */
.case-preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 1.05em;
  color: #888;
  gap: 12px;
  position: absolute;
  inset: 0;
  z-index: 0;
}

.case-preview-loading::before {
  content: '';
  width: 36px;
  height: 36px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--accent, #00b4ff);
  border-radius: 50%;
  animation: casePreviewSpin 0.8s linear infinite;
}

@keyframes casePreviewSpin {
  to { transform: rotate(360deg); }
}

/* DOCX渲染容器 */
.case-preview-docx {
  width: 100%;
  height: 100%;
  overflow: auto;
  background: #e8e8e8;
}

.case-preview-docx .docx-wrapper {
  background: #e8e8e8;
  padding: 20px 0;
}

.case-preview-docx .docx-wrapper > section.docx {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

/* 错误状态 */
.case-preview-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
  gap: 12px;
  text-align: center;
  padding: 24px;
}

.case-preview-error p {
  margin: 0;
  font-size: 0.95em;
}

.case-preview-error-detail {
  font-size: 0.82em !important;
  color: #999;
}

.case-preview-footer {
  padding: 10px 24px;
  text-align: center;
  font-size: 0.82em;
  color: #999;
  border-top: 1px solid #eee;
  flex-shrink: 0;
  background: #fafafa;
}

/* 响应式 */
@media (max-width: 768px) {
  .case-preview-dialog {
    width: 98vw;
    height: 95vh;
    border-radius: 8px;
  }
  .case-preview-header {
    padding: 12px 16px;
  }
  .case-preview-title {
    font-size: 0.95em;
  }
}

/* 响应式 */
@media (max-width: 992px) {
  .case-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }
  .case-detail-banner {
    height: 220px;
  }
}

@media (max-width: 768px) {
  .case-grid {
    grid-template-columns: 1fr;
  }
  .case-detail-title {
    font-size: 1.4em;
  }
  .case-page .case-intro {
    margin: 32px auto 20px;
  }
  .case-page .case-intro h2 {
    font-size: 1.6em;
  }
}
