:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --line: #e8ecef;
  --line-strong: #dfe5e9;
  --text: #15171c;
  --muted: #87909a;
  --muted-2: #a6adb6;
  --green: #159a72;
  --green-dark: #09815f;
  --green-soft: #eaf8f2;
  --amber: #f3aa2a;
  --blue: #65a8ff;
  --rose: #e65364;
  --shadow: 0 10px 26px rgba(20, 30, 45, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(20px, 4vw, 52px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 72px;
  height: 60px;
  display: block;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 10px 24px rgba(20, 30, 45, 0.08);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.brand h1 {
  font-size: 23px;
  line-height: 1.2;
  font-weight: 800;
}

.brand p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  word-spacing: 8px;
}

.status {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.status span {
  color: var(--green);
  background: #f0fff8;
  border: 1px solid #83ddb9;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  padding: 5px 10px;
  font-size: 12px;
}

.status p {
  font-size: 12px;
}

.shell {
  width: min(1060px, calc(100% - 40px));
  margin: 46px auto 80px;
}

.tabs {
  display: flex;
  gap: 26px;
  align-items: end;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  flex: 0 0 auto;
  height: 42px;
  padding: 0 4px;
  color: #737b86;
  background: transparent;
  border: 0;
  font-size: 16px;
}

.tab.active {
  color: var(--text);
  font-weight: 800;
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--green);
}

.panel,
.work-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.panel {
  display: none;
  padding: 32px;
}

.panel.active {
  display: block;
}

.panel.compact {
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.panel-head h2 {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}

.panel-head p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.icon-box {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: #eefbf5;
  border: 1px solid #d6f1e7;
}

.icon-box.amber {
  background: #fff9e8;
  border-color: #f5e8bd;
}

.icon-box.blue {
  background: #eef6ff;
  border-color: #d9eaff;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 24px 0 26px;
}

label {
  display: block;
}

label span,
.field-title {
  display: block;
  color: #858d96;
  margin-bottom: 9px;
  line-height: 1.35;
}

strong {
  color: var(--rose);
}

input,
select,
textarea {
  width: 100%;
  min-height: 34px;
  color: #222832;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  padding: 8px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select {
  appearance: auto;
}

textarea {
  min-height: 184px;
  resize: vertical;
  line-height: 1.7;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #83d9bd;
  box-shadow: 0 0 0 3px rgba(21, 154, 114, 0.12);
}

.form-row-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.form-row-inline label {
  color: #858d96;
}

.link-button {
  border: 0;
  background: transparent;
  color: #157caa;
  padding: 0;
}

.settings-card {
  margin-top: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.grid {
  display: grid;
  gap: 18px 20px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checks {
  display: flex;
  gap: 34px;
  min-height: 34px;
  align-items: center;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #222832;
  white-space: nowrap;
}

.checks input {
  width: 14px;
  min-height: 14px;
  accent-color: #1a9f76;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.primary,
.ghost,
.mini {
  border: 0;
  border-radius: 4px;
  min-height: 42px;
  padding: 0 28px;
  font-weight: 800;
}

.primary {
  color: #fff;
  background: linear-gradient(180deg, #1eaa7e, #0f946c);
  box-shadow: 0 12px 22px rgba(21, 154, 114, 0.24);
}

.primary.small {
  min-height: 34px;
  padding-inline: 20px;
}

.ghost {
  min-height: 34px;
  color: #5e6873;
  background: #f2f5f7;
  padding-inline: 18px;
  font-weight: 500;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 320px) auto 1fr;
  gap: 18px;
  align-items: end;
}

.toolbar .primary {
  justify-self: end;
}

.work-list {
  display: none;
}

.work-list.active {
  display: grid;
  gap: 16px;
}

.work-card {
  padding: 22px 24px;
}

.work-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.work-card h3 {
  font-size: 16px;
  line-height: 1.5;
}

.chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip,
.mini {
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 4px;
  color: #6b747e;
  background: #f3f5f6;
  font-size: 12px;
}

.chip.flat {
  color: var(--green);
  background: #ecf8f3;
  font-weight: 800;
}

.chip.hot {
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.mini {
  border: 0;
  font-weight: 500;
}

.mini.danger {
  color: #e4565d;
  background: #fff0f0;
}

.empty-card {
  color: var(--muted);
  text-align: center;
}

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

.copy {
  margin-top: 15px;
  color: #5d6671;
  line-height: 1.8;
}

.metrics {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #ddf1ea;
  border-radius: 8px;
  background: #f3fbf8;
  color: #6c747c;
}

.metrics b {
  color: #1f2833;
}

.metrics strong {
  margin-left: auto;
  color: var(--green);
  background: #e8f7f2;
  border: 1px solid #ccebe1;
  padding: 6px 14px;
  border-radius: 999px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stats div {
  min-height: 100px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(20, 30, 45, 0.04);
}

.stats span {
  display: block;
  color: var(--muted);
  margin-bottom: 14px;
}

.stats strong {
  color: var(--text);
  font-size: 30px;
  letter-spacing: 0;
}

.stats strong.green {
  color: var(--green);
  font-size: 24px;
}

.stats em {
  font-style: normal;
  color: #6d7680;
  margin-left: 5px;
}

.advice {
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid #cfeee3;
  background: #ecfbf5;
  border-radius: 8px;
  color: #46515d;
}

.advice h3 {
  color: var(--green);
  font-size: 15px;
  margin-bottom: 10px;
}

.advice p + p {
  margin-top: 8px;
}

.bars {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.bar-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding-bottom: 20px;
}

.bar-row span {
  font-weight: 800;
}

.bar-row small {
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
}

.bar-row b {
  color: var(--green);
}

.bar-row::after,
.bar-row i {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  border-radius: 999px;
}

.bar-row::after {
  background: #f0f2f5;
}

.bar-row i {
  width: var(--w);
  right: auto;
  background: linear-gradient(90deg, #21b685, #169d73);
  z-index: 1;
}

.result-list,
.title-output {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.result-list.hidden,
.title-output.hidden {
  display: none;
}

.result-item,
.title-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  line-height: 1.8;
}

.result-item.warning {
  border-color: #f0d29b;
  background: #fff8eb;
}

.title-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.title-item b {
  color: var(--green);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 20, 28, 0.42);
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  width: min(840px, 100%);
  max-height: min(92vh, 920px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 26px 80px rgba(16, 28, 40, 0.22);
  padding: 26px;
}

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

.modal-head h2 {
  font-size: 21px;
  line-height: 1.25;
}

.modal-head p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fa;
  color: #707984;
  font-size: 22px;
  line-height: 1;
}

.modal-grid textarea {
  min-height: 128px;
}

.full {
  grid-column: 1 / -1;
}

.upload-card {
  display: grid;
  place-items: center;
  gap: 8px;
  margin-top: 18px;
  min-height: 132px;
  border: 1px dashed #b9d8ce;
  border-radius: 12px;
  background: #f7fcfa;
  color: #52606b;
  text-align: center;
}

.upload-card input {
  display: none;
}

.upload-icon {
  display: block;
  margin: 0;
  font-size: 28px;
}

.upload-card b {
  color: #26313b;
}

.upload-card em {
  max-width: 560px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.6;
}

.metrics-editor {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric-field span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.metric-field input {
  min-height: 36px;
  padding-inline: 10px;
}

.auto-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.auto-tags span {
  color: #197a5d;
  background: #edf9f4;
  border: 1px solid #cdeee3;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
}

.form-message {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.6;
}

.form-message.hidden {
  display: none;
}

.form-message.warning {
  color: #8a5b16;
  background: #fff7e8;
  border: 1px solid #efd19c;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

@media (max-width: 760px) {
  .topbar,
  .status,
  .work-top {
    align-items: flex-start;
  }

  .topbar,
  .status {
    flex-direction: column;
  }

  .shell {
    width: min(100% - 24px, 1060px);
    margin-top: 28px;
  }

  .panel {
    padding: 22px 18px;
  }

  .grid.two,
  .stats,
  .toolbar,
  .work-top,
  .metrics-editor {
    grid-template-columns: 1fr;
  }

  .toolbar .primary,
  .metrics strong {
    justify-self: stretch;
    margin-left: 0;
  }

  .checks,
  .metrics {
    align-items: flex-start;
    gap: 12px;
  }

  .checks {
    flex-direction: column;
  }

  .actions {
    justify-content: stretch;
  }

  .primary {
    width: 100%;
  }

  .modal-backdrop {
    align-items: start;
    padding: 12px;
  }

  .modal {
    padding: 20px 16px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

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