* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f4f0;
  color: #2c3e2c;
  min-height: 100vh;
}

/* 顶栏 */
.topbar {
  background: linear-gradient(135deg, #2d5a2d, #3a7a3a);
  color: #fff;
  padding: 20px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.topbar h1 { font-size: 22px; font-weight: 600; }
.subtitle { font-size: 13px; opacity: .8; }

/* 用户信息 */
.user-info {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-name {
  font-size: 13px;
  opacity: .9;
}
.btn-logout {
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 4px;
  transition: background .2s;
}
.btn-logout:hover {
  background: rgba(255,255,255,.15);
}

/* 容器 */
.container {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 卡片 */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.card h2 {
  font-size: 17px;
  margin-bottom: 16px;
  color: #2d5a2d;
  border-left: 4px solid #5a9a5a;
  padding-left: 10px;
}

/* 上传区 */
.upload-rule {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #5d4037;
  line-height: 1.6;
}
.upload-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.file-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.file-btn {
  background: #e8f0e8;
  color: #2d5a2d;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  border: 1px solid #c0d8c0;
  transition: background .15s;
}
.file-btn:hover { background: #d8e8d8; }
.file-name {
  font-size: 14px;
  color: #888;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #555;
  cursor: pointer;
}
.checkbox-label input { width: 16px; height: 16px; cursor: pointer; }

.btn-primary {
  margin-left: auto;
  background: #4a8a4a;
  color: #fff;
  border: none;
  padding: 9px 22px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: #3a7a3a; }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; }

.upload-msg {
  font-size: 14px;
  min-height: 20px;
  margin-top: 4px;
}
.upload-msg.ok { color: #2d8a2d; }
.upload-msg.err { color: #c0392b; }

/* 列表 */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.list-header h2 { margin-bottom: 0; }
.btn-text {
  background: none;
  border: none;
  color: #4a8a4a;
  cursor: pointer;
  font-size: 14px;
}
.btn-text:hover { text-decoration: underline; }

.table-wrap { overflow-x: auto; }
.task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.task-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f5f8f5;
  color: #555;
  font-weight: 600;
  border-bottom: 2px solid #e0e8e0;
  white-space: nowrap;
}
.task-table td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}
.task-table tr:hover { background: #fafdfa; }
.td-name { max-width: 260px; word-break: break-all; }
.td-date { white-space: nowrap; color: #666; }
.td-comments { text-align: center; color: #888; }
.td-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.empty { text-align: center; color: #aaa; padding: 32px 0; }

/* 状态标签 */
.status {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.st-pending { background: #fff3cd; color: #856404; }
.st-running { background: #d1ecf1; color: #0c5460; }
.st-done    { background: #d4edda; color: #155724; }
.st-failed  { background: #f8d7da; color: #721c24; }

/* 错误信息 */
.err-info {
  margin-top: 4px;
  font-size: 12px;
  color: #c0392b;
  background: #fdf0f0;
  padding: 4px 8px;
  border-radius: 4px;
  word-break: break-all;
}

/* 操作按钮 */
.btn-small {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn-dl {
  background: #4a8a4a;
  color: #fff !important;
}
.btn-dl:hover { background: #3a7a3a; }
.btn-regen {
  background: #fff;
  color: #4a8a4a;
  border-color: #4a8a4a;
}
.btn-regen:hover { background: #e8f0e8; }
.btn-del {
  background: #fff;
  color: #c0392b;
  border-color: #c0392b;
}
.btn-del:hover { background: #fdf0f0; }

@media (max-width: 640px) {
  .topbar-inner { flex-direction: column; gap: 4px; }
  .btn-primary { margin-left: 0; width: 100%; }
  .upload-row { flex-direction: column; align-items: stretch; }
}

/* 汇总卡片醒目 */
.summary-card {
  border: 2px solid #4a8a4a;
  background: #f5faf5;
}
.summary-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.summary-hint {
  font-size: 14px;
  color: #555;
}
.btn-summary {
  background: #4a8a4a;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-summary:hover:not(:disabled) { background: #3a7a3a; }
.btn-summary:disabled { background: #aaa; cursor: not-allowed; }

/* 列表左对齐不限宽 */
.table-wrap { overflow-x: auto; }
.task-table { width: 100%; }
.th-check, .td-check { text-align: center; width: 40px; white-space: nowrap; }
.list-actions { display: flex; align-items: center; gap: 14px; }
.td-name { text-align: left; }

/* 隐藏状态列 */
.hidden {
  display: none;
}
