/* ========== 搜索结果弹窗美化样式 ========== */

/* 基础弹窗容器样式增强 */
.bottom-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

/* 移动端底部滑出动画优化 */
@media (max-width: 800px) {
  .bottom-popup {
    align-items: flex-end;
  }
  
  .popup-content {
    border-radius: 20px 20px 0 0;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 80vh;
    overflow-y: auto;
  }
}

/* 桌面端居中显示优化 */
@media (min-width: 801px) {
  .popup-content {
    border-radius: 20px;
    max-width: 640px;
    margin: 40px 20px;
    animation: scaleIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  }
}

/* 动画效果增强 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes scaleOut {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.95); opacity: 0; }
}

/* 弹窗内容容器增强 */
.popup-content {
  width: 100%;
  background: white;
  padding: 0;
  overflow: hidden;
}

/* 弹窗头部增强 */
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 24px 0 24px;
  margin-bottom: 16px;
  position: relative;
}

/* 头部装饰线 */
.popup-header::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 24px;
  right: 24px;
  height: 6px;
  background: linear-gradient(90deg, #4bb4f7, #2b9be6);
  border-radius: 3px;
}

.popup-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #2b2b2b;
  flex: 1;
  margin-right: 15px;
  word-break: break-word;
  line-height: 1.4;
}

/* 关闭按钮美化 */
.popup-close {
  background: #f5f7fa;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.popup-close:hover {
  background: #e8ebf0;
  color: #666;
  transform: rotate(90deg);
}

/* 弹窗内容区域 */
.popup-body {
  padding: 0 24px 24px;
}

/* 资源信息卡片 */
.resource-info {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}

.resource-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-grad);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(43, 155, 230, 0.15);
}

.resource-details {
  flex: 1;
  min-width: 0;
}

.resource-type {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}

.resource-name {
  font-size: 16px;
  font-weight: 500;
  color: #2b2b2b;
  margin: 0 0 6px 0;
  word-break: break-word;
  line-height: 1.3;
}

.resource-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #64748b;
}

/* 链接信息区域美化 */
.link-container {
  margin-bottom: 24px;
}

.link-title {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.link-title i {
  color: #94a3b8;
  font-size: 12px;
}

.link-info {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  position: relative;
}

.link-label {
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}

.link-text {
  color: #2b2b2b;
  word-break: break-all;
  flex: 1;
  font-family: monospace;
  background: white;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  min-height: 20px;
  display: flex;
  align-items: center;
}

/* 复制按钮 */
.copy-btn {
  background: white;
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.copy-btn:hover {
  background: #f5f7fa;
  color: #2b2b2b;
}

.copy-btn.copied {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

/* 状态提示区域 */
.status-container {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.status-icon {
  color: #0ea5e9;
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.status-content {
  flex: 1;
}

.status-title {
  font-size: 14px;
  font-weight: 600;
  color: #0c4a6e;
  margin: 0 0 4px 0;
}

.status-message {
  font-size: 13px;
  color: #0891b2;
  line-height: 1.4;
  margin: 0;
}

/* 弹窗底部按钮区域 */
.popup-footer {
  display: flex;
  gap: 12px;
  padding: 0 24px 24px;
}

.popup-btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* 主按钮渐变背景和动画 */
.extract-btn {
  background: linear-gradient(135deg, #4bb4f7, #2b9be6);
  color: white;
  box-shadow: 0 4px 12px rgba(43, 155, 230, 0.2);
}

.extract-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #3ca3e6, #1a8bd5);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(43, 155, 230, 0.3);
}

.extract-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(43, 155, 230, 0.2);
}

.extract-btn:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}



/* 次要按钮样式 */
.open-btn {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.open-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.open-btn:active:not(:disabled) {
  transform: translateY(0);
}

.open-btn:disabled {
  background: #f8fafc;
  color: #94a3b8;
  border-color: #e2e8f0;
  cursor: not-allowed;
  transform: none;
}

/* 加载动画增强 */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 提取中状态的进度条 */
.extraction-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #4ade80, #22c55e);
  border-radius: 0 0 10px 10px;
  transition: width 0.1s linear;
}

/* 成功和失败状态的图标和颜色 */
.status-success {
  background: #dcfce7;
  border-color: #bbf7d0;
}

.status-success .status-icon {
  color: #22c55e;
}

.status-success .status-title {
  color: #166534;
}

.status-success .status-message {
  color: #059669;
}

.status-error {
  background: #fee2e2;
  border-color: #fecaca;
}

.status-error .status-icon {
  color: #ef4444;
}

.status-error .status-title {
  color: #991b1b;
}

.status-error .status-message {
  color: #dc2626;
}

/* 提示标签样式 */
.popup-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  color: #64748b;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.tag.primary {
  background: #dbeafe;
  color: #1e40af;
}

/* 适配不同屏幕尺寸的间距调整 */
@media (max-width: 480px) {
  .popup-header, .popup-body, .popup-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .popup-title {
    font-size: 18px;
  }
  
  .popup-btn {
    padding: 12px;
    font-size: 15px;
  }
  
  .resource-info {
    padding: 12px;
    gap: 12px;
  }
  
  .resource-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
  .bottom-popup {
    background: rgba(0, 0, 0, 0.8);
  }
  
  .popup-content {
    background: #1e293b;
  }
  
  .popup-title {
    color: #f8fafc;
  }
  
  .popup-close {
    background: #334155;
    color: #94a3b8;
  }
  
  .popup-close:hover {
    background: #475569;
    color: #cbd5e1;
  }
  
  .resource-info {
    background: #334155;
    border-color: #475569;
  }
  
  .resource-name {
    color: #f8fafc;
  }
  
  .resource-meta {
    color: #94a3b8;
  }
  
  .link-info {
    background: #334155;
    border-color: #475569;
  }
  
  .link-label {
    color: #94a3b8;
  }
  
  .link-text {
    color: #f8fafc;
    background: #475569;
    border-color: #64748b;
  }
  
  .copy-btn {
    background: #475569;
    border-color: #64748b;
    color: #cbd5e1;
  }
  
  .copy-btn:hover {
    background: #64748b;
    color: #f8fafc;
  }
  
  .open-btn {
    background: #334155;
    color: #f8fafc;
    border-color: #475569;
  }
  
  .open-btn:hover:not(:disabled) {
    background: #475569;
    color: #f8fafc;
    border-color: #64748b;
  }
  
  /* 暗色模式下的禁用状态 */
  .extract-btn:disabled {
    background: #475569;
    color: #94a3b8;
    border-color: #64748b;
    cursor: not-allowed;
  }
  

}