/* 基础重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #f0f0f0;
  color: #333;
  line-height: 1.6;
  font-size: 14px;
  padding-bottom: 50px; /* 为页脚预留空间 */
}

/* 容器样式 */
.wrap-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  width: 100%;
}

/* 头部样式 */
.header {
  text-align: center;
  margin-bottom: 20px;
  padding: 25px 0;
  background: linear-gradient(to right, #7747cf, #5d7bf9);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.app-title {
  color: white;
  font-size: 2.2rem;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  margin: 0;
}

.github-link {
  text-decoration: none;
  color: #5d7bf9;
  font-size: 14px;
  transition: color 0.2s ease;
}

.github-link:hover {
  text-decoration: underline;
}

/* 页脚样式 */
.footer {
  margin-top: 0;
  padding: 0;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 10;
}

.footer .wrap-container {
  background-color: transparent;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  padding: 10px;
  text-align: center;
  width: 100%;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.divider {
  color: #999;
  font-size: 14px;
}

.copyright {
  color: #666;
  font-size: 14px;
}

/* 移除不再使用的github-container样式 */

/* 响应式设计 - 页脚 */
@media (max-width: 480px) {
  .footer-content {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

/* 屏幕高度较小时的处理 */
@media (max-height: 600px) {
  .footer {
    position: relative;
    margin-top: 20px;
  }
  
  body {
    padding-bottom: 0;
  }
}

/* 主要内容区域 */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 0;
  margin-bottom: 20px;
}

/* 容器样式 */
.container {
  margin-bottom: 20px;
  width: 100%;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 10px 15px;
  color: #333;
  background-color: #f8f8f8;
  border-left: 4px solid #5d7bf9;
  margin: 0;
}

/* 搜索容器 */
.search-container {
  display: flex;
  gap: 10px;
  margin: 15px;
  flex-wrap: wrap;
}

#downloadSearchName {
  flex: 1;
  min-width: 200px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

#downloadSearchName:focus {
  outline: none;
  border-color: #5d7bf9;
  box-shadow: 0 0 0 2px rgba(93, 123, 249, 0.2);
}

/* 按钮样式 */
.btn {
  padding: 6px 12px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background-color: #5d7bf9;
  color: white;
}

.btn-primary:hover {
  background-color: #4a67e3;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background-color: #5d7bf9;
  color: white;
}

.btn-secondary:hover {
  background-color: #4a67e3;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-search {
  background-color: #5d7bf9;
}

.btn-search:hover {
  background-color: #4a67e3;
}

.btn-danger {
  background-color: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background-color: #c0392b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 表格样式 */
.table-responsive {
  overflow-x: auto;
  padding: 0 15px 15px 15px;
}

.data-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  margin: 0;
  font-size: 14px;
  border: 1px solid #ddd;
}

.data-table thead {
  background-color: #5d7bf9;
  color: white;
}

.data-table th,
.data-table td {
  padding: 8px 12px;
  text-align: left;
  border: 1px solid #ddd;
  vertical-align: middle;
}

.data-table th {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background-color: #f0f8ff;
}

/* 交替行颜色 */
.data-table tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

.data-table tbody tr:nth-child(even) {
  background-color: #f2f7fa;
}

/* 响应式表格 */
@media (max-width: 768px) {
  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table th,
  .data-table td,
  .data-table tr {
    display: block;
  }

  .data-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .data-table tr {
    border: 1px solid #ccc;
    margin-bottom: 10px;
    border-radius: 5px;
    padding: 10px;
    background-color: white;
  }

  .data-table td {
    border: none;
    position: relative;
    padding-left: 50% !important;
  }
  
  .data-table td:before {
    content: attr(data-label) ": ";
    position: absolute;
    left: 15px;
    width: 45%;
    font-weight: bold;
    text-align: left;
  }
  
  /* 确保操作列中的按钮保持横排 */
  .data-table td[data-label="操作"] {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    padding-left: 50% !important;
  }
  
  .data-table td[data-label="操作"] .btn {
    width: auto;
    margin-right: 5px;
  }
}

/* 加载提示样式 */
.loading-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-container .content {
  text-align: center;
  color: white;
  background-color: rgba(30, 30, 30, 0.9);
  padding: 20px 30px;
  border-radius: 4px;
  max-width: 90%;
  width: 400px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.loading-icon {
  width: 40px;
  height: 40px;
  animation: rotate 1.5s linear infinite;
  margin-bottom: 15px;
  align-self: center;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

.text {
  font-size: 16px;
  margin: 10px 0;
  font-weight: bold;
}

/* 进度条样式 */
.progress-container {
  width: 100%;
  height: 18px;
  background-color: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin: 15px 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #5d7bf9 0%, #7747cf 100%);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 14px;
  color: #eee;
  margin-top: 5px;
  text-align: center;
}

/* 扩展容器 */
.download-container.expanded {
  flex: 1;
}

/* 章节列表进度表 - 隐藏 */
.chapter-list {
  display: none !important;
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
}

.chapter-item {
  display: none !important;
  visibility: hidden;
}

.chapter-item:last-child {
  border-bottom: none;
}

.chapter-item.success {
  color: #5d7bf9;
}

.chapter-item.failed {
  color: #e74c3c;
}

.chapter-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-status {
  margin-left: 10px;
  font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .wrap-container {
    padding: 10px;
  }

  .header {
    padding: 15px 0;
  }

  .app-title {
    font-size: 2rem;
  }

  .card {
    padding: 15px;
  }

  .search-container {
    flex-direction: column;
  }

  #downloadSearchName,
  .btn {
    width: 100%;
  }
  
  .loading-container .content {
    width: 90%;
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .app-title {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .btn {
    padding: 6px 10px;
    font-size: 0.9rem;
  }
  
  .progress-container {
    height: 15px;
  }
  
  .progress-text {
    font-size: 12px;
  }
}

/* 下载按钮组样式 */
.btn-download-epub,
.btn-download-txt {
  margin-right: 5px;
  margin-bottom: 5px;
  min-width: 80px;
  display: inline-block;
}

.btn-download-epub {
  background-color: #5d7bf9;
}

.btn-download-txt {
  background-color: #4CAF50;
}

.btn-download-epub:hover {
  background-color: #4a67e3;
}

.btn-download-txt:hover {
  background-color: #3e9142;
}

/* 表格操作列样式 */
.data-table td:last-child {
  text-align: left;
  white-space: nowrap;
}

.data-table td:last-child .btn {
  display: inline-block;
  margin-right: 5px;
}

/* 书籍链接样式 */
.book-link {
  color: #5d7bf9;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
  position: relative;
}

.book-link:hover {
  color: #4a67e3;
  text-decoration: underline;
}