:root {
  color-scheme: dark;
  --bg: #080b0d;
  --panel: #11171c;
  --panel-2: #151d23;
  --panel-3: #0c1115;
  --panel-glass: rgba(17, 23, 28, 0.92);
  --line: #2a3742;
  --line-strong: #3e505d;
  --text: #eef5f8;
  --muted: #94a5b0;
  --dim: #687783;
  --teal: #59d2c6;
  --green: #79d28a;
  --amber: #e8bd5d;
  --rose: #ff718b;
  --blue: #7bb8ff;
  --input-caret: #ffffff;
  --input-selection: rgba(89, 210, 198, 0.35);
  --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.24);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  --shell-width: 1180px;
  --shell-height: 832px;
  --result-row-height: 32px;
  --row-gap: 4px;
  --party-table-height: 313px;
  --manual-list-height: 218px;
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: var(--shell-width);
  min-height: var(--shell-height);
  overflow: auto;
  background: linear-gradient(180deg, #0a0f12 0%, var(--bg) 62%, #06080a 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(26, 36, 44, 0.98), rgba(16, 24, 31, 0.98));
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-inset);
}

button:hover {
  border-color: var(--teal);
  background: linear-gradient(180deg, rgba(31, 45, 54, 0.98), rgba(18, 29, 36, 0.98));
}

button:disabled {
  cursor: wait;
  opacity: 0.56;
}

input,
select {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(180deg, #0b1217, #080d11);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--input-caret);
  padding: 0 8px;
  font-size: 12px;
  line-height: 28px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--teal);
  background: #101923;
  box-shadow: 0 0 0 1px rgba(89, 210, 198, 0.28);
}

input::selection {
  background: var(--input-selection);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

.progress-shell {
  position: relative;
  width: var(--shell-width);
  height: var(--shell-height);
  display: grid;
  grid-template-rows: 58px 64px minmax(0, 1fr) 34px 26px;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(13, 19, 23, 0.72), rgba(8, 11, 13, 1));
}

.topbar,
.quickbar,
.party-panel,
.side-card,
.advanced-panel,
.status-line {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 26, 32, 0.96), var(--panel-glass));
  border-radius: 8px;
  box-shadow: var(--shadow-inset), var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
}

.title-block {
  min-width: 0;
}

.version,
.section-head span,
.toolbar span,
.field span,
.usage-grid dt,
.usage-grid dd,
.progress-card em,
.advanced-panel summary,
.status-line {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.05;
}

h2 {
  font-size: 14px;
}

.status-chips {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(180deg, #0f171d, #0a1014);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.chip.good {
  color: var(--green);
  border-color: rgba(121, 210, 138, 0.52);
}

.chip.warn {
  color: var(--amber);
  border-color: rgba(232, 189, 93, 0.52);
}

.chip.danger {
  color: var(--rose);
  border-color: rgba(255, 113, 139, 0.52);
}

.quickbar {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 232px;
  align-items: end;
  gap: 10px;
  padding: 9px 10px;
}

.field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.quick-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px 54px 54px;
  align-items: end;
  gap: 7px;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
}

.content-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 8px;
}

.party-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: 30px var(--party-table-height) var(--manual-list-height);
  gap: 6px;
  padding: 10px;
  overflow: hidden;
}

.toolbar,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.progress-table {
  min-height: var(--party-table-height);
  display: grid;
  grid-template-rows: 24px minmax(0, 1fr);
  overflow: hidden;
}

.table-row {
  display: grid;
  grid-template-columns: 92px minmax(170px, 1fr) 50px 66px minmax(185px, 1.12fr) 96px 48px 46px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.table-head {
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.table-body {
  min-height: 0;
  display: grid;
  grid-auto-rows: var(--result-row-height);
  gap: var(--row-gap);
  padding-top: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

#partyRows {
  overflow-y: hidden;
}

.result-row {
  padding: 0 8px;
  border: 1px solid rgba(42, 55, 66, 0.88);
  border-radius: 7px;
  background: linear-gradient(180deg, #0e151a, #0a1014);
  font-size: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.result-row[data-copy-summary] {
  cursor: copy;
}

.result-row[data-copy-summary]:hover {
  border-color: rgba(89, 210, 198, 0.66);
  background: linear-gradient(180deg, #102027, #0b1318);
}

.result-row.self {
  border-color: rgba(89, 210, 198, 0.66);
  background: #0d1b1d;
}

.result-row.manual {
  border-color: rgba(123, 184, 255, 0.48);
}

.job-badge {
  display: inline-grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-width: 84px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-2);
  font-size: 10px;
  font-weight: 900;
  padding: 0 5px;
}

.job-badge img {
  width: 19px;
  height: 19px;
  object-fit: contain;
}

.job-badge span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-badge.no-icon {
  grid-template-columns: minmax(0, 1fr);
}

.identity,
.status-cell,
.time-cell,
.estimate-cell,
.report-cell,
.manual-row strong,
.manual-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.identity > span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-line {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.metric-segment,
.metric-pair,
.percent-pair {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

.metric-segment {
  gap: 2px;
}

.metric-pair,
.percent-pair {
  gap: 1px;
}

.metric-dot {
  white-space: pre;
}

.metric-separator,
.percent-separator {
  color: var(--dim);
  font-weight: 700;
}

.percentile {
  display: inline;
  font-weight: 900;
}

.status-cell {
  color: var(--muted);
  font-size: 11px;
}

.status-cell.ready {
  color: var(--green);
}

.status-cell.loading {
  color: var(--blue);
}

.status-cell.warn {
  color: var(--amber);
}

.status-cell.error {
  color: var(--rose);
}

.phase-cell {
  font-size: 12px;
  font-weight: 900;
  color: var(--teal);
}

.phase-cell.clear {
  color: var(--green);
}

.phase-cell.none {
  color: var(--dim);
}

.time-cell,
.percent-cell {
  color: #c5d1da;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.estimate-cell {
  color: #d8e3e8;
  font-size: 11px;
}

.report-cell a {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.side-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: 76px 196px minmax(0, 1fr);
  gap: 8px;
}

.side-card {
  min-height: 0;
  padding: 8px 10px;
  overflow: hidden;
}

.progress-card {
  display: grid;
  grid-template-rows: 18px 8px 14px 10px;
  gap: 3px;
  padding-bottom: 6px;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #071014;
  border: 1px solid var(--line);
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--green));
  transition: width 160ms ease-out;
}

.progress-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 14px;
}

.progress-card em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  line-height: 10px;
}

.usage-card {
  display: grid;
  grid-template-rows: 18px minmax(0, 1fr);
  gap: 7px;
}

.usage-stack {
  min-height: 0;
  display: grid;
  grid-template-rows: 56px 58px 24px;
  gap: 6px;
}

.usage-ring-card {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 5px 7px;
  border: 1px solid rgba(42, 55, 66, 0.82);
  border-radius: 8px;
  background: linear-gradient(180deg, #0d151a, #0a1014);
  overflow: hidden;
}

.usage-ring {
  --usage-value: 0%;
  --ring-color: var(--teal);
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) var(--usage-value), rgba(62, 80, 93, 0.62) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 4px 12px rgba(0, 0, 0, 0.16);
}

.usage-ring::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: #0b1217;
  border: 1px solid rgba(42, 55, 66, 0.68);
}

.usage-ring b {
  position: relative;
  z-index: 1;
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.usage-ring.green {
  --ring-color: #33c875;
}

.usage-ring.blue {
  --ring-color: #4198ff;
}

.usage-ring-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.usage-ring-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.usage-ring-head strong {
  min-width: 0;
  color: var(--text);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.usage-ring-copy p {
  margin: 0;
  color: #c5d1da;
  font-size: 10px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.usage-ring-copy .usage-reset {
  color: var(--muted);
}

.usage-ring-copy b {
  color: var(--text);
  font-weight: 900;
}

.usage-grid {
  margin: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  overflow: hidden;
}

.usage-grid div {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 6px;
  border: 1px solid rgba(42, 55, 66, 0.82);
  border-radius: 7px;
  background: linear-gradient(180deg, #0d151a, #0a1014);
  overflow: hidden;
}

.usage-grid dt,
.usage-grid dd {
  margin: 0;
}

.usage-grid dd {
  color: var(--text);
  font-size: 10.5px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-card {
  display: grid;
  grid-template-rows: 20px minmax(0, 1fr);
  gap: 7px;
}

.manual-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: 22px minmax(0, 1fr);
  gap: 5px;
  padding-top: 6px;
  border-top: 1px solid rgba(42, 55, 66, 0.72);
}

.manual-table-body {
  display: grid;
  grid-auto-rows: var(--result-row-height);
  gap: var(--row-gap);
}

.manual-table-body .table-row {
  min-height: 32px;
}

.manual-empty,
.manual-row {
  padding: 6px 7px;
  border: 1px solid rgba(42, 55, 66, 0.88);
  border-radius: 7px;
  background: #0c1217;
}

.manual-empty {
  color: var(--muted);
  font-size: 11px;
}

.manual-row {
  display: grid;
  gap: 7px;
}

.manual-primary {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 34px 34px;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.manual-row .job-badge {
  min-width: 0;
  min-height: 22px;
  grid-template-columns: 18px minmax(0, 1fr);
  padding: 0 4px;
}

.manual-row .job-badge img {
  width: 17px;
  height: 17px;
}

.manual-row strong {
  font-size: 12px;
}

.manual-row span {
  color: var(--muted);
  font-size: 10px;
}

.manual-detail-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.manual-detail-grid div {
  min-width: 0;
  padding: 4px 5px;
  border: 1px solid rgba(42, 55, 66, 0.72);
  border-radius: 6px;
  background: var(--panel-3);
}

.manual-detail-grid .wide {
  grid-column: 1 / -1;
}

.manual-detail-grid dt,
.manual-detail-grid dd {
  margin: 0;
}

.manual-detail-grid dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.manual-detail-grid dd {
  margin-top: 1px;
  min-width: 0;
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-detail-grid .actual-progress {
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
}

.manual-detail-grid .metric-line {
  display: block;
  font-size: 10px;
}

.manual-primary .status-cell {
  justify-self: end;
  font-size: 10px;
}

.manual-report {
  justify-self: end;
  font-size: 10px;
}

.activity-log {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-auto-rows: min-content;
  align-content: start;
  gap: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.log-entry {
  padding: 6px 7px;
  border: 1px solid rgba(42, 55, 66, 0.88);
  border-left: 4px solid var(--line-strong);
  border-radius: 7px;
  background: #0c1217;
}

.log-entry.good {
  border-left-color: var(--green);
}

.log-entry.warn {
  border-left-color: var(--amber);
}

.log-entry.error {
  border-left-color: var(--rose);
}

.log-entry time {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.log-entry strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.2;
}

.advanced-panel {
  min-height: 34px;
  overflow: hidden;
}

.advanced-panel summary {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 11px;
  cursor: pointer;
  font-weight: 800;
}

.advanced-panel summary em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dim);
  font-style: normal;
}

.advanced-panel[open] {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 36px;
  z-index: 5;
  max-height: 260px;
  overflow: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.44);
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}

.compact-check {
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: end;
  gap: 7px;
}

.compact-check input {
  width: 15px;
  min-height: 15px;
  padding: 0;
  margin-bottom: 8px;
}

.credential-help {
  grid-column: span 2;
  min-width: 0;
  display: grid;
  grid-template-columns: 82px minmax(118px, 1fr);
  align-items: center;
  gap: 4px 8px;
  padding: 6px 8px;
  border: 1px solid rgba(89, 210, 198, 0.28);
  border-radius: 7px;
  background: rgba(89, 210, 198, 0.08);
}

.credential-help strong,
.credential-help span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.credential-help strong {
  color: var(--text);
}

.credential-help a {
  min-width: 0;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid rgba(89, 210, 198, 0.58);
  border-radius: 6px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.credential-help span {
  grid-column: 1 / -1;
  color: var(--muted);
}

.advanced-actions {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
}

.activity-debug {
  grid-column: 1 / -1;
  min-height: 0;
  display: grid;
  grid-template-rows: 20px minmax(0, auto);
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(42, 55, 66, 0.72);
}

.status-line {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-copy-panel {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 80;
  display: grid;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid rgba(89, 210, 198, 0.42);
  border-radius: 8px;
  background: rgba(9, 15, 19, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
}

.manual-copy-panel.hidden {
  display: none;
}

.manual-copy-head,
.manual-copy-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.manual-copy-head {
  justify-content: space-between;
}

.manual-copy-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-copy-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.manual-copy-panel textarea {
  width: 100%;
  min-height: 58px;
  max-height: 112px;
  padding: 8px;
  border: 1px solid rgba(89, 210, 198, 0.34);
  border-radius: 7px;
  background: #071015;
  color: var(--text);
  caret-color: var(--teal);
  font: 12px/1.45 Consolas, "Microsoft YaHei", sans-serif;
  resize: vertical;
  outline: none;
}

.manual-copy-panel textarea:focus {
  border-color: rgba(89, 210, 198, 0.78);
  box-shadow: 0 0 0 2px rgba(89, 210, 198, 0.14);
}

.manual-copy-actions {
  justify-content: flex-end;
}
