/* static/style.css */

/* ====================================================
   全局样式
======================================================= */
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4edf9 100%);
  margin: 0;
  padding: 0;
  color: #2c3e50;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 20px auto;
  background: #ffffff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

header h1 {
  margin: 0;
  text-align: center;
  font-size: 2em;
  color: #3498db;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

main {
  margin-top: 20px;
}

footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.9em;
  color: #7f8c8d;
}

/* ====================================================
   任务详情页样式
======================================================= */
.task-detail-card {
  border: 1px solid #d1dce5;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card-header {
  background: linear-gradient(120deg, #3498db, #2c3e50);
  color: #fff;
  padding: 20px;
  font-weight: 500;
}

.card-header h2,
.card-header h3 {
  margin: 0;
}

.card-body {
  padding: 20px;
}

.task-details dt {
  font-weight: 600;
  margin-top: 12px;
  color: #2c3e50;
}

.task-details dd {
  margin: 0 0 12px 20px;
  color: #34495e;
}

.download-section {
  margin-top: 25px;
  text-align: center;
  padding: 20px 0;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.download-btn {
  display: inline-block;
  background: linear-gradient(120deg, #2ecc71, #27ae60);
  color: #fff;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 30px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(39, 174, 96, 0.3);
  font-weight: 500;
}

.download-btn:hover {
  background: linear-gradient(120deg, #27ae60, #219653);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(39, 174, 96, 0.4);
}

.copy-link-btn {
  display: inline-block;
  background: linear-gradient(120deg, #3498db, #2980b9);
  margin-left: 15px;
  padding: 12px 24px;
  color: #fff;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(41, 128, 185, 0.3);
  font-weight: 500;
}

.copy-link-btn:hover {
  background: linear-gradient(120deg, #2980b9, #1f618d);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(41, 128, 185, 0.4);
}

.json-result {
  background-color: #fdfdfd;
  border: 1px solid #e1e8ed;
  padding: 15px;
  overflow-x: auto;
  font-family: Consolas, "Courier New", monospace;
  border-radius: 6px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.card-footer {
  text-align: right;
  padding: 20px;
  background-color: #f8f9fa;
}

.back-link {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.back-link:hover {
  background-color: #eef5fb;
  text-decoration: none;
  color: #2980b9;
}

/* ====================================================
   任务列表页样式（表格布局）
======================================================= */
.task-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding: 15px 20px;
  background: linear-gradient(120deg, #3498db, #2c3e50);
  color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.create-task-btn {
  background: linear-gradient(120deg, #2ecc71, #27ae60);
  color: #fff;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 30px;
  transition: all 0.3s ease;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(39, 174, 96, 0.3);
}

.create-task-btn:hover {
  background: linear-gradient(120deg, #27ae60, #219653);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(39, 174, 96, 0.4);
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 25px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.task-table th,
.task-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e1e8ed;
}

.task-table thead {
  background: linear-gradient(120deg, #3498db, #2c3e50);
  color: #fff;
  font-weight: 500;
}

.task-table tbody tr {
  transition: background-color 0.2s ease;
}

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

.task-table tbody tr:hover {
  background-color: #eef5fb;
}

.detail-btn {
  background: linear-gradient(120deg, #3498db, #2980b9);
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(41, 128, 185, 0.3);
}

.detail-btn:hover {
  background: linear-gradient(120deg, #2980b9, #1f618d);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(41, 128, 185, 0.4);
}

/* 固定列样式 */
.sticky-column {
  position: sticky;
  background-color: inherit;
  z-index: 1;
  font-weight: 500;
}

/* 第一列固定在左侧 */
tr td:first-child,
tr th:first-child {
  position: sticky;
  left: 0;
  background-color: inherit;
  box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.1);
}

/* 最后一列（操作列）固定在右侧 */
tr td:last-child,
tr th:last-child {
  position: sticky;
  right: 0;
  background-color: inherit;
  box-shadow: -2px 0 4px -1px rgba(0, 0, 0, 0.15);
}

/* ====================================================
   分页导航样式
======================================================= */
.pagination {
  margin-top: 30px;
  text-align: center;
  padding: 20px 0;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.pagination a,
.pagination span {
  display: inline-block;
  margin: 0 5px;
  padding: 10px 16px;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid #d1dce5;
  color: #3498db;
  transition: all 0.3s ease;
  font-weight: 500;
}

.pagination a:hover {
  background-color: #eef5fb;
  border-color: #3498db;
  transform: translateY(-2px);
}

.current-page {
  background: linear-gradient(120deg, #3498db, #2c3e50);
  color: #fff;
  border-color: #2c3e50;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.ellipsis {
  padding: 10px 16px;
  color: #7f8c8d;
  border: none;
  font-weight: 500;
}

/* ====================================================
   任务创建表单页样式
======================================================= */
.form-card {
  border: 1px solid #d1dce5;
  border-radius: 10px;
  padding: 25px;
  background-color: #fff;
  margin-bottom: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-card h2 {
  margin-top: 0;
  color: #2c3e50;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #d1dce5;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 16px;
}

.form-control:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.btn-submit {
  background: linear-gradient(120deg, #3498db, #2980b9);
  color: #fff;
  border: none;
  padding: 12px 25px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 16px;
  box-shadow: 0 2px 5px rgba(41, 128, 185, 0.3);
}

.btn-submit:hover {
  background: linear-gradient(120deg, #2980b9, #1f618d);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(41, 128, 185, 0.4);
}

/* ====================================================
   响应式调整
======================================================= */
@media (max-width: 600px) {
  .container {
    padding: 15px;
    margin: 15px;
    border-radius: 6px;
  }

  header h1 {
    font-size: 1.5em;
  }

  .create-task-btn,
  .detail-btn,
  .btn-submit {
    padding: 10px 15px;
    font-size: 0.9em;
    border-radius: 20px;
  }

  .task-table th,
  .task-table td {
    padding: 10px 8px;
    font-size: 0.85em;
  }

  .task-list-header {
    flex-direction: column;
    text-align: center;
  }

  .task-list-header a {
    margin-top: 10px;
  }

  .pagination a,
  .pagination span {
    padding: 8px 12px;
    font-size: 0.9em;
    margin: 0 2px;
  }

  .form-card {
    padding: 15px;
  }

  .form-control {
    padding: 10px 12px;
  }
}
/* ====================================================
   深色模式优化
======================================================= */

/* 深色模式下的链接颜色 */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #1a1f25 0%, #0d1117 100%);
  }
  
  .container {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
  
  .task-detail-card {
    border: 1px solid #334155;
    background: #1e293b;
  }
  
  .card-header {
    background: linear-gradient(120deg, #3498db, #2c3e50);
  }
  
  .task-table {
    background: #1e293b;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }
  
  .task-table thead {
    background: linear-gradient(120deg, #3498db, #2c3e50);
  }
  
  .task-table th,
  .task-table td {
    border-bottom: 1px solid #334155;
  }
  
  .task-table tbody tr:nth-child(even) {
    background-color: #162032;
  }
  
  .task-table tbody tr:hover {
    background-color: #2d3c57;
  }
  
  .pagination {
    background-color: #162032;
  }
  
  .pagination a,
  .pagination span {
    border: 1px solid #334155;
    color: #3498db;
  }
  
  .pagination a:hover {
    background-color: #2d3c57;
    border-color: #3498db;
  }
  
  .current-page {
    background: linear-gradient(120deg, #3498db, #2c3e50);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  }
  
  .form-card {
    background: #1e293b;
    border: 1px solid #334155;
  }
  
  .form-control {
    background: #0f172a;
    border: 2px solid #334155;
    color: #e2e8f0;
  }
  
  .form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
  }
  
  .download-section {
    background-color: #162032;
  }
  
  .json-result {
    background-color: #0f172a;
    border: 1px solid #334155;
  }
  
  .card-footer {
    background-color: #162032;
  }
  
  footer {
    background: #1e293b;
  }
  
  /* 固定列在深色模式下的背景 */
  .dark tbody tr td.sticky-column {
    background-color: #1e293b;
  }
  
  .dark thead tr th.sticky-column {
    background-color: #334155;
  }
  
  /* 深色模式下的悬停效果 */
  .dark tbody tr:hover td.sticky-column {
    background-color: #2d3c57;
  }
  
  /* 确保操作栏按钮在深色模式下可见 */
  .dark td button,
  .dark td a {
    font-weight: 500;
  }
  
  /* 增强深色模式下的阴影效果 */
  .dark tr td:last-child,
  .dark tr th:last-child {
    box-shadow: -2px 0 4px -1px rgba(0, 0, 0, 0.5);
  }
}


