/* 工具页面专属样式 - tool.css */

/* 基础布局 */
.tool-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 15px;
}

/* 卡片样式 */
.tool-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.tool-card-header {
  padding: 15px 20px;
  border-bottom: 1px solid #eaeaea;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tool-card-body {
  padding: 20px;
}

/* 工具分类网格 */
.tool-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.tool-category-item {
  display: flex;
  text-decoration: none;
  padding: 15px;
  border-radius: 8px;
  transition: all 0.3s;
  border: 1px solid #eaeaea;
}

.tool-category-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  border-color: #d1e0ff;
}

.tool-category-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: 8px;
  overflow: hidden;
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f7ff;
}

.tool-category-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-category-info {
  flex: 1;
}

.tool-category-name {
  margin: 0 0 5px 0;
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 5px;
}

.tool-category-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 工具列表样式 - 网格布局 */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.tool-item {
  display: flex;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #eaeaea;
  transition: all 0.3s;
  text-decoration: none;
}

.tool-item:hover {
  border-color: #d1e0ff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.tool-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: 8px;
  overflow: hidden;
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f7ff;
}

.tool-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tool-name {
  margin: 0 0 8px 0;
  font-size: 15px;
  color: #333;
  transition: color 0.2s;
}

.tool-item:hover .tool-name {
  color: #3b82f6;
}

.tool-vip-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 4px;
  background: #fef3c7;
  color: #d97706;
  margin-left: 8px;
}

.tool-vip-badge i {
  margin-right: 4px;
}

.tool-desc {
  margin: 0 0 7px 0;
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.tool-meta {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #888;
  gap: 12px;
}

.tool-meta-item {
  display: inline-flex;
  align-items: center;
}

.tool-meta-item i {
  margin-right: 4px;
  color: #3b82f6;
}

/* 工具介绍和公告 */
.tool-announcement {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
}

.tool-announcement p {
  margin-bottom: 12px;
}

.tool-announcement ul {
  padding-left: 20px;
  margin-bottom: 15px;
}

.tool-announcement li {
  margin-bottom: 8px;
}

/* 分页容器 - 更新为与软件分页一致的样式 */
.tool-pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.tool-pagination-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 15px;
  background: #f0f7ff;
  color: #3b82f6;
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: var(--transition);
}

.tool-pagination-btn:hover {
  background: #3b82f6;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
  transform: translateY(-2px);
}

.tool-pagination-info {
  margin: 0 15px;
  color: var(--gray);
}

.tool-next-btn .fa-angle-right {
  margin-left: 5px;
}

.tool-prev-btn .fa-angle-left {
  margin-right: 5px;
}

/* 工具详情页样式 */
.tool-detail {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.tool-info {
  display: flex;
  gap: 20px;
}

.tool-detail-icon {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.tool-detail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-detail-content {
  flex: 1;
}

.tool-detail-name {
  font-size: 24px;
  margin: 0 0 8px 0;
  color: #222;
}

.tool-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
}

.tool-detail-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  background: #f0f7ff;
  color: #3b82f6;
}

.tool-detail-tag i {
  margin-right: 4px;
}

.tool-detail-desc {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 20px;
}

.tool-usage {
  background: #fff;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.tool-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.tool-btn-lg {
  padding: 10px 20px;
  font-size: 15px;
}

.tool-btn-primary {
  background: #3b82f6;
  color: #fff;
  border: 1px solid #3b82f6;
}

.tool-btn-primary:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.tool-btn-outline {
  border: 1px solid #3b82f6;
  color: #3b82f6;
  background: transparent;
}

.tool-btn-outline:hover {
  background: #3b82f6;
  color: #fff;
}

/* 相关工具推荐 */
.tool-related {
  margin-top: 30px;
}

.tool-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.tool-related-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #eaeaea;
  transition: all 0.3s;
  text-decoration: none;
}

.tool-related-item:hover {
  transform: translateY(-3px);
  border-color: #d1e0ff;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.08);
}

.tool-related-icon {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.tool-related-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-related-name {
  font-size: 14px;
  color: #333;
  text-align: center;
  margin-bottom: 6px;
  font-weight: 500;
}

.tool-related-meta {
  font-size: 12px;
  color: #888;
  display: flex;
  align-items: center;
}

.tool-related-meta i {
  margin-right: 4px;
  color: #3b82f6;
}

/* 分类页面特有样式 */
.tool-category-hero {
  display: flex;
  align-items: center;
  padding: 25px 30px;
  margin-bottom: 25px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f6df5, #3b82f6, #60a5fa);
  color: white;
  box-shadow: 0 5px 20px rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
  width: 650px;
}

.tool-category-hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100%" height="100%" fill="none"/><path d="M0,0 L100,100 M20,0 L100,80 M40,0 L100,60 M60,0 L100,40 M80,0 L100,20 M0,20 L80,100 M0,40 L60,100 M0,60 L40,100 M0,80 L20,100" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></svg>') repeat;
  opacity: 0.5;
}

.tool-category-list-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 15px;
  position: relative;
  z-index: 2;
  padding: 5px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-category-list-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tool-category-title {
  margin: 0 0 10px 0;
  font-size: 28px;
  color: white;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tool-category-description {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

.tool-category-stats {
  display: flex;
  align-items: center;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.15);
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
}

.tool-stats-item {
  display: inline-flex;
  align-items: center;
}

.tool-stats-item i {
  margin-right: 6px;
  color: rgba(255, 255, 255, 0.9);
}

/* 空状态样式 */
.tool-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #888;
}

.tool-empty-state i {
  font-size: 5rem;
  margin-bottom: 20px;
  color: #e0e0e0;
  animation: floating 3s ease-in-out infinite;
}

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

/* 工具搜索框样式 */
.tool-search {
  margin-bottom: 25px;
}

.tool-search-form {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
}

.tool-search-input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px 0 0 6px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.tool-search-input:focus {
  border-color: #3b82f6;
}

.tool-search-button {
  padding: 12px 20px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s;
}

.tool-search-button:hover {
  background: #2563eb;
}

/* 加载动画 */
.tool-loading {
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
}

.tool-loading::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: tool-loading 1.5s infinite;
}

.tool-login-badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 4px;
    background: #e6f7ff;
    color: #1890ff;
    margin-left: 8px;
}

.tool-login-badge i {
    margin-right: 4px;
}

@keyframes tool-loading {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* 浮动动画关键帧 */
@keyframes floating {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* PC端样式 - 工具统计信息紧跟在标题后面 */
@media (min-width: 769px) {
  .tool-category-hero .tool-category-info {
    position: relative;
  }
  
  .tool-category-hero .tool-category-title {
    display: inline-block;
    margin-right: 15px;
  }
  
  .tool-category-hero .tool-category-stats {
    display: inline-block;
    vertical-align: middle;
    margin-bottom: 10px;
  }
  
  .tool-category-hero .tool-category-description {
    clear: both;
    margin-top: 0;
  }
}

/* 响应式布局 */
@media (max-width: 768px) {
  .tool-section-header {
    width: 100%;
  }
  
  .tool-category-list-icon
   {
    margin-right: 0px;
  }
  
  .tool-pagination-container {
    flex-direction: row;
    flex-wrap: wrap; /* 允许元素换行 */
    justify-content: center;
    gap: 10px; /* 按钮之间的间距 */
  }
  
  .tool-pagination-info {
    width: 100%; /* 让信息占据整行 */
    text-align: center;
    margin: 5px 0;
    order: -1; /* 让信息显示在最上面 */
  }
  
  .tool-pagination-btn {
    margin: 5px 0; /* 设置上下边距 */
  }
  
  .tool-category-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  
  .tool-grid {
    grid-template-columns: 1fr;
  }
  
  .tool-item {
    flex-direction: row;
    align-items: flex-start;
  }
  
  .tool-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
  }
  
  .tool-name {
    font-size: 16px;
    margin-bottom: 6px;
    white-space: normal;
    word-break: break-word;
  }
  
  .tool-vip-badge {
    padding: 2px 5px;
    font-size: 11px;
  }
  
  .tool-desc {
    font-size: 13px;
    margin-bottom: 8px;
  }
  
  .tool-meta {
    font-size: 12px;
  }
  
  .tool-info {
    flex-direction: column;
  }
  
  .tool-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tool-category-hero {
    flex-direction: column;
    text-align: center;
    padding: 25px 20px;
    width: 100%;
  }
  
  .tool-category-icon {
    margin-right: 0;
    margin-bottom: 15px;
  }
  
  .tool-category-description {
    max-width: 100%;
  }
  
  /* 移动端保持原有的垂直布局 */
  .tool-category-hero .tool-category-title {
    display: block;
    margin: 0 0 10px 0;
  }
  
  .tool-category-hero .tool-category-stats {
    display: inline-block;
    margin-bottom: 12px;
  }
  
  .tool-category-item {
    padding: 15px 12px;
    align-items: flex-start;
  }
  
  .tool-category-icon {
    width: 45px;
    height: 45px;
    min-width: 45px;
    margin-right: 12px;
  }
  
  .tool-category-name {
    font-size: 15px;
    margin-bottom: 4px;
    word-break: break-word;
  }
  
  .tool-category-desc {
    font-size: 12px;
    margin-bottom: 6px;
    line-height: 1.3;
  }
}

@media (max-width: 576px) {
  .tool-card-body {
    padding: 15px;
  }
  
  .tool-item {
    padding: 12px;
  }
  
  .tool-icon {
    width: 45px;
    height: 45px;
    min-width: 45px;
    margin-right: 12px;
    border-radius: 6px;
  }
  
  .tool-desc {
    -webkit-line-clamp: 2;
    font-size: 12px;
    line-height: 1.4;
  }
  
  .tool-meta {
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .tool-category-grid {
    grid-template-columns: 1fr;
  }
  
  .tool-section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .tool-section-actions {
    margin-top: 10px;
  }
  
  .tool-pagination-container {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  
  .tool-related-grid {
    grid-template-columns: 1fr;
  }
  
  .tool-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .tool-vip-badge {
    margin-left: 0;
    margin-top: 5px;
  }
  
  .tool-category-item {
    padding: 12px 10px;
  }
  
  .tool-category-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    margin-right: 10px;
  }
  
  .tool-category-desc {
    -webkit-line-clamp: 1;
  }
}

@media (max-width: 360px) {
  .tool-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    margin-right: 10px;
  }
  
  .tool-category-hero {
    padding: 20px 15px;
  }
  
  .tool-category-title {
    font-size: 24px;
  }
  
  .tool-category-description {
    font-size: 14px;
  }
  
  .tool-category-stats {
    font-size: 13px;
  }
  
  .tool-category-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    margin-right: 8px;
  }
  
  .tool-category-name {
    font-size: 14px;
  }
}
