:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #dfe4ea;
  --line-strong: #c8d0da;
  --text: #1f2933;
  --muted: #667085;
  --brand: #1769e0;
  --brand-strong: #0f55ba;
  --good: #0f8f61;
  --warn: #a86900;
  --bad: #b42318;
  --blue-soft: #eef5ff;
  --green-soft: #eaf7f1;
  --yellow-soft: #fff7df;
  --red-soft: #fff0ee;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-page {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  min-height: 100%;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(320px, 440px) 380px;
  gap: 44px;
  align-items: center;
  width: min(960px, calc(100vw - 48px));
}

.auth-brand h1,
.topbar h1,
.section-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.auth-brand h1 {
  font-size: 42px;
  line-height: 1.15;
}

.auth-brand p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  background: var(--brand);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  border-radius: 8px;
}

.auth-panel,
.submit-panel,
.task-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.auth-panel {
  padding: 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 22px;
  padding: 4px;
  background: #eef2f6;
  border-radius: 8px;
}

.auth-tab {
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.auth-tab.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.form-stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  outline: none;
}

textarea {
  width: 100%;
  min-height: 92px;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}

input[type="file"] {
  height: auto;
  padding: 8px 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.12);
}

input.needs-choice,
select.needs-choice,
textarea.needs-choice {
  border-color: var(--bad);
  background: #fffafa;
}

input.needs-choice:focus,
select.needs-choice:focus,
textarea.needs-choice:focus {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

input.is-confirmed,
select.is-confirmed {
  border-color: #9fd7bd;
}

.field-hint {
  min-height: 15px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
}

.field-hint.is-warning {
  color: var(--bad);
}

.report-file-hint {
  min-height: 0;
  color: var(--bad);
  font-weight: 500;
}

.inline-guide-button {
  display: inline;
  margin: 0 0 0 4px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--bad);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-button,
.ghost-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.primary-button {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--brand-strong);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.ghost-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #344054;
}

.mini-button {
  width: 100%;
  min-height: 30px;
  margin-top: 8px;
  border: 1px solid #b8c8dd;
  background: #fff;
  color: #17324d;
  font-size: 12px;
  font-weight: 700;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.form-message.is-error {
  color: var(--bad);
}

.form-message.is-ok {
  color: var(--good);
}

.app-page,
.report-page {
  min-width: 1100px;
  height: 100%;
  overflow: hidden;
}

.shell-page {
  min-width: 1188px;
}

.workspace-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 88px;
  padding: 14px 10px;
  background: #111827;
  color: #cbd5e1;
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.06);
}

.workspace-brand {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 2px auto 22px;
  border-radius: 8px;
  background: #1769e0;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
}

.workspace-nav {
  display: grid;
  gap: 8px;
}

.workspace-nav-link {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 78px;
  padding: 10px 4px;
  border-radius: 8px;
  color: #b6c2d2;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.workspace-nav-link:hover,
.workspace-nav-link.is-active {
  background: #374151;
  color: #fff;
}

.workspace-nav-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 15px;
  font-weight: 900;
}

.workspace-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 1100px;
  height: 100%;
  margin-left: 88px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.topbar h1 {
  font-size: 20px;
}

.report-topbar,
.tool-topbar {
  align-items: center;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.breadcrumb-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.35;
}

.breadcrumb-nav a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb-nav a:hover {
  color: var(--brand);
}

.breadcrumb-nav span {
  color: #98a2b3;
  font-size: 24px;
  line-height: 1;
}

.breadcrumb-nav strong {
  color: #111827;
  font-weight: 800;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.tool-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - 104px);
  padding: 16px;
}

.submit-panel {
  height: 100%;
  padding: 18px;
  overflow: hidden;
}

.submit-panel .form-stack {
  gap: 11px;
  height: 100%;
  overflow-y: auto;
  padding-right: 4px;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.submit-panel .form-stack::-webkit-scrollbar {
  width: 8px;
}

.submit-panel .form-stack::-webkit-scrollbar-thumb {
  background: #c9d4e2;
  border-radius: 999px;
}

.submit-task-button,
#submit-task,
#voc-submit-task {
  width: 100%;
  min-height: 38px;
  height: 38px;
}

#task-message {
  min-height: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.product-key-fields {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}

.product-key-fields input {
  min-width: 0;
}

.product-summary {
  min-height: 64px;
  max-height: 112px;
  overflow: auto;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.product-summary strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
}

.usage-note {
  order: 30;
  padding: 10px 11px;
  border: 1px solid #d9e7f7;
  border-radius: 6px;
  background: #f3f8ff;
  color: #425466;
  font-size: 12px;
  line-height: 1.55;
}

.usage-note strong {
  display: block;
  margin-bottom: 4px;
  color: #17324d;
}

.usage-note p {
  margin: 4px 0 0;
}

.advanced-product-fields {
  border: 1px solid #d9e7f7;
  border-radius: 6px;
  background: #f8fbff;
  color: #425466;
  font-size: 12px;
  line-height: 1.55;
}

.advanced-product-fields summary {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  color: #17324d;
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}

.advanced-product-fields[open] summary {
  border-bottom: 1px solid #d9e7f7;
}

.advanced-product-fields {
  display: grid;
  gap: 10px;
}

.advanced-product-fields[open] {
  padding-bottom: 10px;
}

.advanced-product-fields label,
.advanced-product-fields .field-grid {
  margin: 0 10px;
}

.task-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  font-size: 18px;
}

.task-list {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
}

.task-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 86px 88px 104px;
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.task-card.is-supervisor-view {
  grid-template-columns: 150px minmax(0, 1fr) 86px 88px 136px 104px;
}

.task-card strong {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  font-size: 14px;
}

.task-label {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 700;
}

.task-meta {
  color: var(--muted);
  font-size: 12px;
}

.task-owner {
  color: #17324d;
  font-weight: 600;
}

.task-product {
  display: grid;
  gap: 7px;
  min-width: 0;
  overflow: visible;
  color: #344054;
  font-size: 12px;
  line-height: 1.45;
}

.task-product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-product-tags span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f3f6fa;
  color: #475467;
  white-space: nowrap;
}

.task-product-tags b {
  color: #17324d;
  font-weight: 700;
}

.task-product-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1f2933;
  font-weight: 600;
}

.status-pill,
.advice-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pending {
  background: var(--yellow-soft);
  color: var(--warn);
}

.status-running {
  background: var(--blue-soft);
  color: var(--brand-strong);
}

.status-done {
  background: var(--green-soft);
  color: var(--good);
}

.status-failed {
  background: var(--red-soft);
  color: var(--bad);
}

.task-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.task-actions .ghost-button {
  width: 92px;
  justify-content: center;
  white-space: nowrap;
}

.task-notice {
  grid-column: 2 / -1;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.task-card.is-supervisor-view .task-notice {
  grid-column: 2 / -1;
}

.choice-field {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.choice-field legend {
  padding: 0 4px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.choice-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.choice-field input {
  width: 16px;
  height: 16px;
}

.voc-layout {
  grid-template-columns: 330px minmax(0, 1fr);
}

.voc-submit-panel {
  padding: 18px;
}

.voc-submit-panel .form-stack {
  gap: 11px;
}

.voc-submit-panel textarea {
  min-height: 92px;
}

.voc-submit-panel .usage-note {
  order: initial;
}

.voc-task-card {
  grid-template-columns: 210px minmax(0, 1fr) 96px 88px 104px;
}

.voc-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf4;
}

.voc-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--good));
}

.report-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: calc(100vh - 104px);
  padding: 0 16px 16px;
}

.report-shell > .form-message:empty {
  display: none;
}

.report-summary {
  display: none;
  margin: 0 -16px;
  padding: 14px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.report-summary.is-ready {
  display: block;
}

.report-summary-inner {
  max-width: 1680px;
  margin: 0 auto;
}

.report-version {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.report-summary-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.report-summary-title-row h1 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.guide-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #174ea6;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.guide-button:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.report-summary-meta {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.report-frame {
  display: none;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.site-footer a:hover {
  color: var(--brand-strong);
}

.report-guide-dialog {
  width: min(1320px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.tool-guide-dialog {
  width: min(760px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.22);
}

.tool-guide-dialog::backdrop {
  background: rgba(15, 23, 42, 0.46);
}

.tool-guide-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 20px 20px;
  overflow: auto;
}

.tool-guide-body section {
  min-width: 0;
  padding: 14px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fbff;
}

.tool-guide-body h3 {
  margin: 0 0 8px;
  color: #17324d;
  font-size: 15px;
  line-height: 1.35;
}

.tool-guide-body p,
.tool-guide-body ol {
  margin: 0;
  color: #475467;
  font-size: 13px;
  line-height: 1.7;
}

.tool-guide-body ol {
  padding-left: 20px;
}

.tool-guide-body li + li {
  margin-top: 4px;
}

.report-guide-dialog::backdrop {
  background: rgba(15, 23, 42, 0.46);
}

.report-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.report-guide-head h2 {
  margin: 0;
  color: #111827;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: 0;
}

.dialog-close-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.report-guide-alert {
  margin: 0;
  padding: 14px 20px 0;
  color: var(--bad);
  font-size: 14px;
  font-weight: 800;
}

.report-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 14px 20px 20px;
  overflow: auto;
}

.report-guide-grid figure {
  position: relative;
  min-width: 0;
  margin: 0;
}

.report-guide-grid figcaption {
  margin-bottom: 8px;
  color: #17324d;
  font-size: 14px;
  font-weight: 800;
}

.report-guide-grid img {
  display: block;
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  object-position: top left;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.image-zoom-button {
  position: absolute;
  top: 34px;
  left: 10px;
  z-index: 2;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: #174ea6;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.image-zoom-button:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.image-zoom-dialog {
  width: min(1680px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.26);
}

.image-zoom-dialog::backdrop {
  background: rgba(15, 23, 42, 0.58);
}

.image-zoom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.image-zoom-head h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
}

.image-zoom-body {
  max-height: calc(100vh - 112px);
  padding: 14px;
  overflow: hidden;
  background: #f6f7f9;
}

.image-zoom-body img {
  display: block;
  width: 100%;
  max-width: none;
  height: calc(100vh - 140px);
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

@media (max-width: 760px) {
  .auth-shell {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .auth-brand h1 {
    font-size: 32px;
  }

  .report-guide-grid {
    grid-template-columns: 1fr;
  }
}
