* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; color: #1f2937; background: #f6f7f9; }
a { color: #1d4ed8; text-decoration: none; }
.topbar { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: #111827; color: #fff; }
.topbar a { color: #e5e7eb; margin-left: 16px; }
.brand { font-weight: 700; }
.container { max-width: 1180px; margin: 24px auto; padding: 0 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-actions { display: flex; align-items: center; gap: 10px; }
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 18px; margin-top: 24px; }
.button, button { border: 0; background: #2563eb; color: #fff; padding: 9px 14px; border-radius: 6px; cursor: pointer; font-size: 14px; line-height: 1.2; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; }
.button.secondary, button.secondary { background: #eef2ff; color: #1e40af; border: 1px solid #c7d2fe; }
button.danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
button:disabled { background: #9ca3af; cursor: not-allowed; border-color: #9ca3af; color: #fff; }
.panel, table { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; }
.panel { padding: 18px; max-width: 620px; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input, select { width: 100%; padding: 9px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
.readonly-field { width: 100%; min-height: 38px; padding: 9px 10px; border: 1px solid #d1d5db; border-radius: 6px; background: #f9fafb; color: #374151; font-size: 14px; display: flex; align-items: center; overflow-wrap: anywhere; }
table { width: 100%; border-collapse: collapse; overflow: hidden; }
th, td { padding: 10px 12px; border-bottom: 1px solid #e5e7eb; text-align: left; font-size: 14px; vertical-align: top; }
th { background: #f3f4f6; font-weight: 700; }
.empty { text-align: center; color: #6b7280; }
.status { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #e5e7eb; font-size: 12px; }
.status.queued { background: #fef3c7; color: #92400e; }
.status.running { background: #dbeafe; color: #1e40af; }
.status.success { background: #dcfce7; color: #166534; }
.status.failed { background: #fee2e2; color: #991b1b; }
.hint { margin-top: 12px; color: #4b5563; }
.file-hint { margin-top: 8px; color: #4b5563; font-size: 13px; }
.file-hint.warning { color: #991b1b; background: #fee2e2; border: 1px solid #fecaca; border-radius: 6px; padding: 8px 10px; }
.subtle { color: #6b7280; font-size: 14px; margin-top: 6px; }
.error { background: #fee2e2; color: #991b1b; padding: 8px 10px; border-radius: 6px; margin: 10px 0; }
.login-page { min-height: 100vh; display: grid; place-items: center; }
.compact-login { min-height: calc(100vh - 104px); }
.login-card { width: 360px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 24px; }
.login-card h1 { margin-bottom: 8px; }
.login-card button { width: 100%; margin-top: 16px; }
.meta { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; }
.meta dt { font-weight: 700; color: #374151; }
.meta dd { margin: 0; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filters a { color: #374151; background: #fff; border: 1px solid #d1d5db; border-radius: 6px; padding: 7px 10px; font-size: 13px; }
.filters a.active { color: #1e40af; background: #eef2ff; border-color: #c7d2fe; font-weight: 700; }
.admin-page-head { width: calc(100vw - 48px); max-width: 1540px; margin-left: 50%; transform: translateX(-50%); }
.admin-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.admin-toolbar .filters { justify-content: flex-end; }
.admin-toolbar button { min-height: 34px; padding: 7px 12px; font-size: 13px; }
.form-wrap { display: flex; justify-content: center; padding-top: 18px; }
.upload-panel { width: min(100%, 780px); max-width: 780px; padding: 28px; box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 20px; }
.field.full { grid-column: 1 / -1; }
.field label { margin-top: 0; }
.form-footer { display: flex; align-items: center; gap: 16px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #e5e7eb; }
.form-footer .hint { margin-top: 0; }
.detail-panel { max-width: 900px; padding: 24px; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid #e5e7eb; }
.detail-header h2 { margin: 4px 0 0; font-size: 16px; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.detail-item { border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px; background: #f9fafb; }
.detail-item span { display: block; color: #6b7280; font-size: 13px; margin-bottom: 8px; }
.detail-item strong { font-size: 18px; }
.detail-meta { grid-template-columns: 96px 1fr; padding-top: 4px; }
.detail-meta dd { overflow-wrap: anywhere; }
.detail-actions { margin-top: 20px; padding-top: 18px; border-top: 1px solid #e5e7eb; }
.admin-table-wrap { width: calc(100vw - 48px); max-width: 1540px; margin-left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04); }
.admin-table { width: 100%; min-width: 0; border: 0; border-radius: 0; table-layout: fixed; }
.admin-table th, .admin-table td { padding: 10px 8px; vertical-align: middle; font-size: 13px; }
.admin-table th { color: #374151; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.admin-table td { color: #1f2937; }
.admin-table tbody tr:hover { background: #f9fafb; }
.admin-table .col-team { width: 7%; }
.admin-table .col-task { width: 6%; }
.admin-table .col-attempt { width: 4%; }
.admin-table .col-status { width: 7%; }
.admin-table .col-worker { width: 8%; }
.admin-table .col-slot { width: 6%; }
.admin-table .col-time { width: 11%; }
.admin-table .col-error { width: 16%; }
.admin-table .col-actions { width: 10%; }
.strong-cell { font-weight: 700; }
.mono-cell { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: #4b5563; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time-cell { font-size: 12px; line-height: 1.45; color: #4b5563; white-space: normal; overflow-wrap: anywhere; }
.error-cell { color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-group { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
.action-group button { flex: 0 0 auto; }
.action-group button { min-height: 30px; padding: 6px 9px; font-size: 12px; }

@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .container { margin: 18px auto; padding: 0 14px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; justify-content: space-between; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .upload-panel { padding: 20px; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .form-footer button { width: 100%; }
  .detail-header { flex-direction: column; }
  table { display: block; overflow-x: auto; }
  .filters { width: 100%; }
  .admin-page-head { width: 100%; margin-left: 0; transform: none; }
  .admin-toolbar { width: 100%; align-items: stretch; flex-direction: column; }
  .admin-toolbar .filters { justify-content: flex-start; }
  .admin-toolbar button { width: 100%; }
  .admin-table-wrap { width: 100%; }
  .admin-table { display: table; overflow: hidden; }
  .admin-table col:nth-child(5),
  .admin-table col:nth-child(6),
  .admin-table col:nth-child(8),
  .admin-table col:nth-child(9),
  .admin-table col:nth-child(10),
  .admin-table th:nth-child(5),
  .admin-table th:nth-child(6),
  .admin-table th:nth-child(8),
  .admin-table th:nth-child(9),
  .admin-table th:nth-child(10),
  .admin-table td:nth-child(5),
  .admin-table td:nth-child(6),
  .admin-table td:nth-child(8),
  .admin-table td:nth-child(9),
  .admin-table td:nth-child(10) { display: none; }
}
