:root {
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  background: #f4f7f7;
  color: #183449;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.page-header { background: #fff; border-bottom: 1px solid #d9e5e8; }
.header-inner, main { width: min(100% - 40px, 1160px); margin-inline: auto; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.header-inner h1 { margin: 0; font-size: clamp(1.15rem, 3vw, 1.4rem); }
main { padding-block: 28px 42px; }
.login {
  width: min(100%, 360px);
  margin: 7vh auto 0;
  padding: 26px;
  background: #fff;
  border: 1px solid #d9e5e8;
  border-radius: 14px;
  display: grid;
  gap: 14px;
}
.login h2 { margin: 0 0 4px; font-size: 1.15rem; }
.login label { display: grid; gap: 6px; }
input, .btn {
  font: inherit;
  color: inherit;
  border: 1px solid #b7c9ce;
  background: #fff;
  border-radius: 7px;
  padding: 8px 11px;
}
input { min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none; font-size: .88rem; }
.btn:hover { border-color: #187568; }
.btn.primary { background: #17665f; border-color: #17665f; color: #fff; }
.btn:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 2px solid #187568; outline-offset: 3px; }
.status:empty { display: none; }
.status { margin: 0 0 16px; padding: 10px 14px; background: #e4f3ef; color: #12554c; border-radius: 8px; }
.status[data-error] { background: #fff1ed; color: #8c3025; }

.survey-board {
  --survey-text: #183449;
  --survey-muted: #506779;
  --survey-line: #d9e5e8;
  --survey-panel: #fff;
  --survey-tint: #edf6f5;
  --survey-accent: #187568;
  --survey-ribbon: #133b48;
  display: grid;
  gap: 20px;
  color: var(--survey-text);
}
.survey-board :is(h2,p,dl,dd) { margin: 0; }
.survey-board h2 { font-size: 1.08rem; line-height: 1.4; font-weight: 700; }
.survey-metrics-panel { padding: 22px 26px; border-radius: 16px; background: var(--survey-ribbon); color: #f6fffe; }
.survey-metrics-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 18px; }
.survey-metrics-head > span { color: #c0dbda; font-size: .9rem; }
.survey-board .survey-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-top: 18px; }
.survey-metrics > div { padding: 4px 16px; border-inline-start: 1px solid #51747b; }
.survey-metrics > div:first-child { padding-inline-start: 0; border: 0; }
.survey-metrics dt { color: #c5dfdf; font-size: .92rem; }
.survey-metrics dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px; font-size: clamp(1.45rem,3vw,2.55rem); line-height: 1.25; font-weight: 700; font-variant-numeric: tabular-nums; }
.survey-metrics dd span { color: #d2e8e7; font-size: .83rem; font-weight: 500; }
.survey-columns { display: grid; grid-template-columns: minmax(0,1fr) minmax(260px, .36fr); gap: 20px; align-items: start; }
.survey-rank-board,.survey-source { background: var(--survey-panel); border: 1px solid var(--survey-line); border-radius: 14px; min-width: 0; }
.survey-rank-board > header { padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; justify-content: space-between; }
.survey-rank-board > header span,.survey-source p { color: var(--survey-muted); font-size: .88rem; }
.survey-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; font-size: .92rem; }
.survey-table th,.survey-table td { padding: 12px; text-align: left; overflow-wrap: anywhere; }
.survey-table thead { background: var(--survey-tint); color: var(--survey-muted); }
.survey-table thead th:first-child { width: 62px; text-align: center; }
.survey-table thead th:nth-child(2) { width: 105px; }
.survey-table thead th:last-child { width: 115px; }
.survey-table tbody tr + tr { border-top: 1px solid var(--survey-line); }
.survey-table tbody th { font-weight: 650; }
.survey-table .survey-rank { text-align: center; }
.survey-rank span { display: inline-grid; min-width: 26px; min-height: 26px; padding-inline: 4px; place-items: center; border-radius: 7px; color: var(--survey-accent); background: var(--survey-tint); font-variant-numeric: tabular-nums; }
.survey-progress { display: grid; grid-template-columns: minmax(30px,1fr) auto; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.survey-progress progress { width: 100%; height: 8px; accent-color: var(--survey-accent); border: 0; border-radius: 999px; overflow: hidden; background: var(--survey-tint); }
.survey-progress progress::-webkit-progress-bar { background: var(--survey-tint); }
.survey-progress progress::-webkit-progress-value { background: var(--survey-accent); border-radius: 999px; }
.survey-progress progress::-moz-progress-bar { background: var(--survey-accent); border-radius: 999px; }
.survey-progress small { color: var(--survey-muted); white-space: nowrap; }
.survey-remaining { color: var(--survey-muted); }
.survey-achieved { color: var(--survey-accent); }
.survey-source { display: grid; align-content: start; gap: 12px; padding: 18px 19px; }
.survey-source dl { display: grid; gap: 7px; font-size: .88rem; }
.survey-source dl div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; }
.survey-source dt { color: var(--survey-muted); }
.survey-source .btn { justify-self: start; }
.survey-source p { line-height: 1.5; }
.survey-editor { border-top: 1px solid var(--survey-line); padding-top: 11px; }
.survey-editor summary { cursor: pointer; font-weight: 650; }
.survey-editor form { margin-top: 9px; display: grid; gap: 8px; }
.survey-editor-labels,.survey-editor-row { display: grid; grid-template-columns: 1fr minmax(56px,.68fr) minmax(56px,.68fr); gap: 7px; align-items: center; }
.survey-editor-labels { color: var(--survey-muted); font-size: .86rem; }
.survey-editor-row input { width: 100%; min-width: 0; padding: 5px 7px; }
.survey-editor form .btn { margin-top: 4px; }

.survey-options {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.options-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding-inline: 2px;
}
.options-header h2 { font-size: 1.2rem; }
.options-header p, .options-header > span { color: var(--survey-muted); font-size: .87rem; }
.options-header p { margin-top: 3px; }
.option-cards {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 14px;
  align-items: start;
}
.option-card, .option-editor {
  min-width: 0;
  background: var(--survey-panel);
  border: 1px solid var(--survey-line);
  border-radius: 14px;
}
.option-card:first-child { grid-row: span 2; }
.option-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px 10px;
}
.option-card h3 { margin: 0; font-size: 1rem; line-height: 1.4; }
.option-card header > span { color: var(--survey-muted); font-size: .82rem; white-space: nowrap; }
.option-list { list-style: none; margin: 0; padding: 0 18px 8px; }
.option-list li {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(32px,.42fr) minmax(42px,auto);
  align-items: center;
  gap: 8px;
  padding-block: 7px;
  border-top: 1px solid var(--survey-line);
  font-size: .88rem;
}
.option-list li > :last-child { grid-column: 3; text-align: right; font-variant-numeric: tabular-nums; }
.option-list li > span:first-child { overflow-wrap: anywhere; }
.option-list meter { width: 100%; height: 7px; border: 0; }
.option-list meter::-webkit-meter-bar { height: 7px; background: var(--survey-tint); border: 0; }
.option-list meter::-webkit-meter-optimum-value { background: var(--survey-accent); }
.option-list meter::-moz-meter-bar { background: var(--survey-accent); }
.option-editor { padding: 12px 16px; }
.option-editor p { color: var(--survey-muted); font-size: .88rem; line-height: 1.5; }
.option-status { margin: 0; }
.option-fields { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); align-items: start; gap: 12px; }
.option-fields fieldset {
  min-width: 0;
  margin: 0;
  padding: 8px 11px 11px;
  border: 1px solid var(--survey-line);
  border-radius: 8px;
}
.option-fields legend { font-size: .88rem; font-weight: 650; }
.option-fields label {
  display: grid;
  grid-template-columns: minmax(0,1fr) 70px;
  align-items: center;
  gap: 6px;
  padding-block: 3px;
  font-size: .86rem;
}
.option-fields input { width: 100%; padding: 4px 6px; }
.option-editor .primary { justify-self: start; }

@media (max-width: 850px) {
  .survey-columns { grid-template-columns: minmax(0,1fr); }
  .option-fields { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 530px) {
  .header-inner, main { width: calc(100% - 28px); }
  .header-inner { min-height: 58px; }
  main { padding-block: 18px 32px; }
  .survey-metrics-panel { padding: 16px; }
  .survey-board .survey-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px 0; }
  .survey-metrics > div:nth-child(3) { border: 0; padding-inline-start: 0; }
  .survey-table th,.survey-table td { padding: 10px 6px; }
  .survey-table thead th:first-child { width: 39px; }
  .survey-table thead th:nth-child(2) { width: 74px; }
  .survey-table thead th:last-child { width: 75px; }
  .survey-progress { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .survey-progress progress { grid-row: 2; }
  .option-cards { grid-template-columns: minmax(0,1fr); grid-template-rows: none; }
  .option-card:first-child { grid-row: auto; }
  .option-card header { padding-inline: 12px; }
  .option-list { padding-inline: 12px; }
}
