:root {
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: #17252c;
  background: #fff;
  --ink: #17252c;
  --muted: #52636a;
  --line: #dce4e5;
  --soft: #f5f8f7;
  --green: #185847;
  --green-dark: #114537;
  --focus: #32836d;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; line-height: 1.55; }
a { color: var(--green); text-underline-offset: 0.18em; }
a:hover { color: var(--green-dark); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.62; cursor: wait; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.45rem, 3vw, 1.85rem); line-height: 1.25; font-weight: 720; }
h2 { font-size: 1.18rem; font-weight: 690; }

.topbar {
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.6rem clamp(1rem, 5vw, 4rem);
}
.brand { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--ink); text-decoration: none; font-size: 1.04rem; font-weight: 720; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; flex: 0 0 30px; background: var(--green); display: grid; place-items: center; border-radius: 7px; }
.brand-mark::before {
  content: "";
  width: 15px;
  height: 14px;
  border: 1.5px solid #fff;
  border-radius: 2px;
  background: linear-gradient(#fff, #fff) 4px 0 / 1px 100% no-repeat, linear-gradient(#fff, #fff) 0 4px / 100% 1px no-repeat;
}
.account { min-width: 0; display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; color: var(--muted); }
.account span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 16rem; }

.panel { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.login-main { padding: clamp(2.5rem, 12vh, 7.5rem) 1rem 2rem; }
.login-card { max-width: 424px; margin-inline: auto; padding: clamp(1.35rem, 5vw, 2rem); box-shadow: 0 12px 36px #17252c0b; }
.login-card h1 { margin-block: 1.4rem 1.15rem; }
.segmented { display: inline-flex; gap: 0.15rem; padding: 0.21rem; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; }
.segmented button { padding: 0.35rem 1.18rem; color: var(--muted); border: 1px solid transparent; border-radius: 5px; background: transparent; font-size: 0.9rem; }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--green); border-color: var(--line); font-weight: 700; }
#auth-form { display: grid; gap: 0.48rem; }
#auth-form input { margin-bottom: 0.7rem; }
#auth-form button { margin-top: 0.3rem; }

label { display: block; font-weight: 650; font-size: 0.9rem; }
input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.55rem 0.72rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c6d2d2;
  border-radius: 7px;
}
input::placeholder { color: #687a82; opacity: 1; }
input[aria-invalid="true"] { border-color: #ad3928; }
input[type="file"] { padding: 0.28rem 0.6rem 0.28rem 0.3rem; font-size: 0.9rem; }
input::file-selector-button { margin-inline-end: 0.7rem; padding: 0.37rem 0.65rem; color: var(--ink); background: var(--soft); border: 0; border-radius: 5px; cursor: pointer; font: inherit; }
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0.52rem 0.92rem;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 660;
  white-space: nowrap;
}
.primary { color: #fff; background: var(--green); border-color: var(--green); }
.primary:hover:enabled { background: var(--green-dark); }
.secondary { border-color: #c6d2d2; background: #fff; }
.secondary:hover:enabled, a.secondary:hover, .quiet:hover:enabled { background: var(--soft); color: var(--green); }
.quiet { padding-inline: 0.5rem; color: var(--muted); }
.metadata, small { color: var(--muted); font-size: 0.875rem; }
.site-footer { margin-block: 2rem; text-align: center; font-size: 0.875rem; }
.site-footer a { color: var(--muted); }

.workspace, .report-workspace { margin-inline: auto; padding: 2rem clamp(1rem, 4vw, 3rem) 3.5rem; max-width: 1184px; }
.entry { padding: clamp(1rem, 3vw, 1.55rem); margin-bottom: 1.2rem; }
.task-form { display: grid; grid-template-columns: minmax(160px, 0.78fr) minmax(210px, 1.3fr) auto; align-items: start; gap: 1rem; margin-top: 1.1rem; }
.field { min-width: 0; display: grid; gap: 0.36rem; }
.submit-task { margin-top: calc(0.9rem * 1.55 + 0.36rem); min-height: 44px; }
.feedback { margin-top: 0.75rem; color: var(--muted); overflow-wrap: anywhere; }
.feedback[data-kind="error"] { color: #912c23; }
.feedback[data-kind="success"] { color: var(--green); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 1rem clamp(1rem, 3vw, 1.55rem); }
.section-head .metadata { margin-top: 0.15rem; }
.task-list-feedback { margin: 0 1.55rem 1rem; }
.scroll-x { max-width: 100%; overflow-x: auto; }
.tasks-table { width: 100%; min-width: 570px; table-layout: fixed; border-collapse: collapse; text-align: left; }
.tasks-table th { padding: 0.55rem 1rem; font-size: 0.88rem; color: var(--muted); background: var(--soft); }
.tasks-table td { padding: 0.67rem 1rem; border-top: 1px solid var(--line); }
.tasks-table td:nth-child(2) { font-weight: 650; font-variant-numeric: tabular-nums; }
.tasks-table td:last-child { font-size: 0.9rem; }
.tasks-table .reason { display: block; margin-top: 0.3rem; overflow-wrap: anywhere; }
.pill { display: inline-block; border-radius: 0.32rem; padding: 0.12rem 0.44rem; font-size: 0.875rem; font-weight: 650; max-width: 100%; }
.pill.waiting, .pill.observe { background: #edf1f2; color: #475962; }
.pill.running, .pill.test { background: #e8f0fb; color: #19477a; }
.pill.done, .pill.hold { background: #e4f3ea; color: #16573d; }
.pill.failed, .pill.review { background: #fbece8; color: #812c20; }
.pill.caution { background: #faf0d9; color: #6d4c06; }
.muted { color: var(--muted); }

.report-workspace { max-width: 1720px; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.15rem; }
.report-head h1 { overflow-wrap: anywhere; }
.report-head .metadata { margin-top: 0.45rem; }
.report-container { max-height: 72vh; overflow: auto; }
.report-table { table-layout: fixed; min-width: 124rem; width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: 0.875rem; }
.report-table th, .report-table td { padding: 0.53rem 0.65rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.report-table th { position: sticky; top: 0; z-index: 2; background: #ebf4ef; color: #1b4035; }
.report-table th:first-child, .report-table td:first-child { position: sticky; left: 0; width: 9.5rem; z-index: 1; border-right: 1px solid var(--line); }
.report-table th:first-child { z-index: 3; }
.report-table td:first-child { background: #f7faf8; font-weight: 680; }
.report-table th:nth-child(2) { width: 7.75rem; }
.report-table th:nth-child(3) { width: 10.75rem; }
.report-table th:nth-child(6) { width: 13rem; }
.report-table th:nth-child(7) { width: 7.25rem; }
.report-table th:nth-child(8) { width: 9rem; }
.report-table th:last-child { width: 15.5rem; }
.report-table .product { display: flex; align-items: center; gap: 0.4rem; margin-block: 0.1rem 0.2rem; }
.report-table .product > span { min-width: 0; }
.report-table img, .thumb-placeholder { width: 1.5rem; height: 1.5rem; flex: 0 0 1.5rem; object-fit: contain; }
.thumb-placeholder { display: inline-grid; place-items: center; color: var(--muted); background: var(--soft); border-radius: 4px; }
.report-table small { display: block; font-size: 0.8rem; }
.report-table summary { cursor: pointer; color: var(--green); font-weight: 620; }
.report-table details > div { font-variant-numeric: tabular-nums; }
.report-table td:last-child .pill { margin-bottom: 0.27rem; }

@media (max-width: 650px) {
  .topbar { min-height: 60px; }
  .account span { display: none; }
  .task-form { grid-template-columns: minmax(0, 1fr); }
  .submit-task { margin: 0; }
  .workspace, .report-workspace { padding-top: 1.3rem; }
  .report-head { gap: 0.65rem; }
  .report-container { max-height: none; }
  .report-table th:first-child, .report-table td:first-child { width: 7.5rem; }
}
