/* 合同模板页面样式 */
:root {
  --primary-color: #00684a;
  --primary-hover: #005a40;
  --primary-light: rgba(0, 104, 74, 0.1);
  --success-color: #52c41a;
  --warning-color: #faad14;
  --error-color: #ff4d4f;
  --text-color: rgba(0, 0, 0, 0.85);
  --text-secondary: rgba(0, 0, 0, 0.45);
  --border-color: #f0f0f0;
  --bg-gray: #f5f5f5;
  --gradient-bg: linear-gradient(135deg, #f8fffe 0%, #f0f9ff 100%);
}

.contract-template-search {
  padding: 24px;
  background: var(--gradient-bg);
  min-height: 100vh;
}

.contract-search-results {
  padding: 24px;
  background: var(--gradient-bg);
  min-height: 100vh;
}

/* 搜索英雄区域 */
.search-hero {
  text-align: center;
  padding: 60px 0;
  background: linear-gradient(135deg, rgba(0, 104, 74, 0.05) 0%, rgba(0, 104, 74, 0.02) 100%);
  border-radius: 16px;
  margin-bottom: 32px;
}

.search-title {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 12px;
}

.search-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* 搜索框样式 */
.search-hero .search-box,
.compact-search-box .search-box {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
}

.search-hero .search-box:focus-within,
.compact-search-box .search-box:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 4px 20px rgba(0, 104, 74, 0.15);
}

.search-hero .search-textarea,
.compact-search-box .search-textarea {
  width: 100%;
  min-height: 80px;
  border: none;
  outline: none;
  resize: vertical;
  font-size: 16px;
  line-height: 1.5;
  background: transparent;
  margin: 0;
  padding: 0;
}

.search-hero .search-textarea::placeholder,
.compact-search-box .search-textarea::placeholder {
  color: var(--text-secondary);
}

.search-hero .search-actions,
.compact-search-box .search-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.search-hero .search-tips,
.compact-search-box .search-tips {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  flex: 1;
}

.search-hero .search-tips i,
.compact-search-box .search-tips i {
  margin-right: 4px;
  font-size: 12px;
}

.search-hero .search-btn,
.compact-search-box .search-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
}

.search-hero .search-btn:hover:not(:disabled),
.compact-search-box .search-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.search-hero .search-btn:disabled,
.compact-search-box .search-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  transform: none;
  opacity: 0.6;
}

.search-hero .search-btn i,
.compact-search-box .search-btn i {
  font-size: 14px;
}

/* 快速分类 */
.quick-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.category-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.category-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--primary-color);
  font-size: 24px;
}

.category-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-color);
}

.category-count {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 紧凑搜索框 */
.compact-search-box {
  margin-bottom: 24px;
}

.compact-search-box .search-hero {
  padding: 20px 0;
  margin-bottom: 0;
  background: none;
}

.compact-search-box .search-title {
  display: none; /* 在紧凑模式下隐藏大标题 */
}

.compact-search-box .search-subtitle {
  display: none; /* 在紧凑模式下隐藏副标题 */
}

.compact-search-box .search-container {
  max-width: 100%;
}

/* 紧凑搜索框特定样式 */
.compact-search-box .search-box {
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.compact-search-box .search-textarea {
  min-height: 60px;
  font-size: 14px;
}

.compact-search-box .search-actions {
  margin-top: 8px;
  padding-top: 8px;
  gap: 8px;
}

.compact-search-box .search-btn {
  padding: 6px 16px;
  font-size: 13px;
  border-radius: 6px;
}

.compact-search-box .search-tips {
  font-size: 11px;
}

.compact-search-box .search-tips i {
  font-size: 11px;
}

/* 搜索结果头部 */
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.result-info {
  font-size: 14px;
  color: var(--text-secondary);
}

.result-count {
  color: var(--primary-color);
  font-weight: 600;
}

/* 筛选标签 */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  background: white;
  color: var(--text-color);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-tab.active,
.filter-tab:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* 模板网格 */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.template-grid.list-view {
  display: block;
}

.template-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  cursor: pointer;
}

.template-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.list-view .template-card {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  margin-bottom: 12px;
}

.template-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.list-view .template-header {
  flex: 0 0 auto;
  margin-bottom: 0;
  margin-right: 16px;
}

.template-type {
  background: var(--primary-light);
  color: var(--primary-color);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.template-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
  color: var(--text-color);
}

.template-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.list-view .template-desc {
  margin-bottom: 0;
  margin-left: 16px;
  flex: 1;
}

.template-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.list-view .template-meta {
  margin-bottom: 0;
  margin-left: 16px;
  flex: 0 0 auto;
}

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

.list-view .template-actions {
  margin-left: 16px;
  flex: 0 0 auto;
}

.action-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: white;
  color: var(--text-color);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.action-btn.primary {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.action-btn.primary:hover {
  background: var(--primary-hover);
}

/* 视图切换 */
.view-toggle {
  display: flex;
  gap: 4px;
  background: white;
  border-radius: 6px;
  padding: 4px;
  border: 1px solid #e5e7eb;
}

.view-btn {
  padding: 6px 12px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.view-btn.active {
  background: var(--primary-color);
  color: white;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 32px;
  gap: 8px;
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: white;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-btn:hover,
.page-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-btn:disabled:hover {
  background: white;
  color: var(--text-color);
  border-color: #e5e7eb;
}

/* 模板详情页面 */
.template-detail {
  max-width: 800px;
  margin: 0 auto;
}

.detail-header {
  background: white;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
}

.detail-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-color);
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.meta-item {
  display: flex;
  align-items: center;
  font-size: 14px;
}

.meta-label {
  color: var(--text-secondary);
  margin-right: 8px;
}

.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
}

.detail-btn.primary {
  background: var(--primary-color);
  color: white;
}

.detail-btn.primary:hover {
  background: var(--primary-hover);
}

.detail-btn.secondary {
  background: white;
  color: var(--text-color);
  border: 1px solid #e5e7eb;
}

.detail-btn.secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.detail-content {
  background: white;
  border-radius: 12px;
  padding: 32px;
  border: 1px solid var(--border-color);
}

.content-section {
  margin-bottom: 32px;
}

.content-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-color);
}

.content-preview {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  border-left: 4px solid var(--primary-color);
  white-space: pre-wrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .search-hero {
    padding: 40px 20px;
  }

  .search-title {
    font-size: 24px;
  }

  .quick-categories {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

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

  .result-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .detail-actions {
    flex-direction: column;
  }

  .detail-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
} 