/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%);
  color: #1f2933;
}

.container {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 20px 32px;
}

.topbar {
  background: #0b5fff;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar a {
  color: #fff;
  text-decoration: none;
  margin-right: 12px;
  font-size: 16px;
  font-weight: 600;
}

.topbar a:last-child {
  margin-right: 0;
}

.topbar__brand .brand {
  font-weight: 700;
}

.topbar__nav .nav-btn {
  background: none;
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  margin-left: 12px;
  cursor: pointer;
  padding: 0;
}

.topbar__nav .nav-btn:hover {
  text-decoration: underline;
}

.topbar__nav .lang-toggle-link {
  font-weight: 600;
  color: #fff;
  text-decoration: none;
}

.inline-form {
  display: inline;
  margin: 0;
}

.table-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  background: #e8f1ff;
  border: 1px solid #c2d4ff;
}

.flash.alert {
  background: #ffe9e6;
  border-color: #ffc2ba;
}

.flash.notice {
  background: #e6ffed;
  border-color: #b7f5cc;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

th {
  background: #f3f4f6;
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
}

form textarea {
  min-height: 80px;
}

.input-textarea {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 14px;
}

form select {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
}

select[multiple] {
  min-height: 60px;
}

button, input[type="submit"] {
  background: #0b5fff;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
}

button:hover, input[type="submit"]:hover, a.button:hover {
  background: #094ecc;
}

a.button,
.btn-primary {
  background: #0b5fff;
  border: none;
}

.btn-primary.btn-lg {
  padding: 12px 18px;
  font-size: 16px;
  border-radius: 10px;
}

.btn-secondary {
  background: #eef2f8;
  color: #0b5fff;
  border: 1px solid #d5ddf3;
  transition: background 0.12s ease, transform 0.12s ease;
}

.btn-secondary:hover {
  background: #e0e8ff;
  transform: translateY(-1px);
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.upload-btn {
  min-width: 116px;
  height: 38px;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.upload-btn.visible {
  display: inline-flex;
}

a.button {
  display: inline-block;
  background: #0b5fff;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
}

.badge.queued { background: #6b7280; }
.badge.processing { background: #f59e0b; }
.badge.completed { background: #10b981; }
.badge.failed { background: #ef4444; }
.badge.terminated { background: #b91c1c; }
.badge.deleted { background: #9ca3af; }

.error-reason {
  color: #b91c1c;
  font-size: 13px;
  white-space: pre-line;
}

.error-details {
  margin: 0;
}

.error-summary {
  cursor: pointer;
  list-style: none;
}

.error-summary::-webkit-details-marker {
  display: none;
}

.error-summary::marker {
  content: "";
}

.error-summary:focus-visible {
  outline: 2px solid #fecdd3;
  outline-offset: 2px;
  border-radius: 4px;
}

.error-details[open] .error-summary {
  margin-bottom: 4px;
}

pre.error-message {
  background: #fff5f5;
  border: 1px solid #fecdd3;
  border-radius: 6px;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #991b1b;
  margin: 6px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.field {
  margin-bottom: 14px;
}

.tabs {
  display: inline-flex;
  gap: 10px;
  background: #eef2f8;
  padding: 4px;
  border-radius: 10px;
}

.tab {
  padding: 8px 12px;
  border-radius: 8px;
  color: #0b5fff;
  text-decoration: none;
  font-weight: 600;
}

.tab.active {
  background: #0b5fff;
  color: #fff;
}

.hint {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.announcement-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 10px 30px rgba(31, 41, 55, 0.08);
}

.announcement-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.announcement-item {
  border: 1px solid #e5e7eb;
}

.announcement-meta {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 10px;
}

.admin-password-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-password-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.admin-password-wrap form {
  margin: 0;
}

.admin-password-form .admin-password-input {
  width: 160px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12px;
}

.section-title {
  margin: 16px 0 8px;
}

.announcement-body {
  white-space: pre-wrap;
  line-height: 1.6;
  color: #1f2933;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.page-title {
  margin: 4px 0 6px;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  font-size: 13px;
}

.muted {
  color: #6b7280;
  margin: 0;
}

.task-page {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  width: 100%;
  align-items: start;
}

.form-grid {
  width: 100%;
}

.pane {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(31, 41, 55, 0.08);
}

.upload-pane {
  position: sticky;
  top: 12px;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.upload-row input[type="file"] {
  flex: 1;
  background: #fff;
  border: 1px solid #d1d5db;
  padding: 10px;
  border-radius: 12px;
}

.upload-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pane-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.upload-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 14px 12px;
  background: #fdfefe;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.upload-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 12px 26px rgba(31, 41, 55, 0.08);
}

.field-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2f8;
  color: #0b5fff;
  font-weight: 600;
  font-size: 13px;
}

.pill-strong {
  background: #0b5fff;
  color: #fff;
}

.pill-ghost {
  background: #f4f6fb;
  color: #4b5563;
}

.pill-solid {
  background: #111827;
  color: #fff;
}

.upload-status {
  color: #4b5563;
  font-size: 13px;
}

.upload-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.upload-notice {
  font-weight: 600;
  color: #2563eb;
  min-height: 20px;
}

.upload-notice[data-tone="success"] {
  color: #16a34a;
}

.upload-notice[data-tone="error"] {
  color: #dc2626;
}

.upload-all-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
}

.btn-secondary.full-width {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #d1d5db;
}

.btn-secondary.full-width:hover {
  background: #e5e7eb;
  color: #0f172a;
}

.unified-upload {
  border: 1px dashed #cbd5e1;
  background: #f9fbff;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2f8;
  color: #1f2937;
  font-weight: 600;
  font-size: 12px;
}

.select.multi {
  min-height: 120px;
  width: 100%;
}

.pill-select {
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #d5ddf3;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(31, 41, 55, 0.04);
}

.list-select {
  width: 100%;
  min-height: 36px;
  max-height: 44px;
  border: 1px solid #d5ddf3;
  border-radius: 12px;
  padding: 6px 10px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(31, 41, 55, 0.04);
  appearance: auto;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-label {
  margin-bottom: 0;
  white-space: nowrap;
}

.inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #374151;
  font-weight: 500;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.form-actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.settings-pane {
  min-height: 720px;
}

.pane h3 {
  margin-top: 0;
}
.title-with-step {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.title-with-link {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
}

.sample-link {
  font-size: 1.17em;
  font-weight: 700;
  color: #1a58f5;
  text-decoration: none;
}

.sample-link:hover {
  text-decoration: underline;
}
.input-compact {
  max-width: 260px;
}

.tabs {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tabs input[type="radio"] {
  display: none;
}

.tabs label {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  background: #eef2f8;
  cursor: pointer;
  font-weight: 700;
  color: #1f2933;
  transition: all 0.15s ease;
}


.tab-panels {
  width: 100%;
}

.tab-content {
  display: none;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
}

.tab-content.active {
  display: block;
}

/* Pure-CSS tab visibility (fallback if JS未执行) */
#tab-merge:checked ~ .tab-list label[for="tab-merge"],
#tab-classify:checked ~ .tab-list label[for="tab-classify"],
#tab-pmd:checked ~ .tab-list label[for="tab-pmd"],
#tab-pmd-single:checked ~ .tab-list label[for="tab-pmd-single"],
#tab-kegg:checked ~ .tab-list label[for="tab-kegg"] {
  background: #0b5fff;
  color: #fff;
  box-shadow: 0 10px 25px rgba(11, 95, 255, 0.2);
}

#tab-merge:checked ~ .tab-panels #content-merge,
#tab-classify:checked ~ .tab-panels #content-classify,
#tab-pmd:checked ~ .tab-panels #content-pmd,
#tab-pmd-single:checked ~ .tab-panels #content-pmd_single,
#tab-kegg:checked ~ .tab-panels #content-kegg {
  display: block;
}


@media (max-width: 1080px) {
  .task-page {
    grid-template-columns: 1fr;
  }

  .upload-pane {
    position: relative;
    top: 0;
  }

  .form-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-actions input[type="submit"] {
    width: 100%;
    text-align: center;
  }
}

.topbar__nav a {
  font-weight: 600;
}

.field strong {
  display: block;
  margin-bottom: 6px;
}

/* Auth pages */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 16px 48px;
}

.auth-notice {
  margin: 8px 0 20px;
  color: #b91c1c;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.auth-notice-url {
  color: #16a34a;
  font-size: 24px;
  font-weight: 700;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 12px;
  padding: 28px 26px;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
}

.auth-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.auth-subtitle {
  margin: 0 0 16px;
  color: #6b7280;
  font-size: 14px;
}

.auth-form .field {
  margin-bottom: 14px;
}

.auth-form .input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

.remember-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.auth-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-ghost {
  background: transparent;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn-ghost:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* Reference data box on task list */
.reference-box {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #eef5ff;
  border: 1px solid #d5e4ff;
  border-radius: 8px;
  line-height: 1.5;
  color: #1b2f50;
}

.reference-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.reference-box a {
  color: #1a58f5;
  text-decoration: none;
}

.pagination {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 16px;
}

.history-actions form {
  margin: 0;
}

.history-actions .btn-secondary,
.history-actions .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.history-actions .btn-ghost {
  border-color: #fca5a5;
  color: #b91c1c;
}

.history-actions .btn-ghost:hover {
  background: #fee2e2;
  border-color: #f87171;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  color: #1f2933;
  text-decoration: none;
  background: #fff;
  font-size: 13px;
}

.page-link.active {
  background: #0b5fff;
  color: #fff;
  border-color: #0b5fff;
}

.page-link.disabled {
  color: #9ca3af;
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.page-ellipsis {
  color: #9ca3af;
  padding: 0 4px;
}

.reference-box a:hover {
  text-decoration: underline;
}

.dev-contact {
  font-size: 16px;
  color: #5f6b7a;
  margin: 0 0 12px;
}

.site-footer {
  text-align: center;
  padding: 14px 12px 18px;
  font-size: 16px;
  color: #5f6b7a;
}
