* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #1d2f34;
  background: #f3f6f6;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 32px;
  color: white;
  background: #173b40;
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 650;
}

.topbar p {
  margin: 3px 0 0;
  color: #b9d4d3;
  font-size: 13px;
}

.connection {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #d8ecea;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e3b341;
}

.connection.online .status-dot {
  background: #58d3a2;
}

.connection.offline .status-dot {
  background: #f28b82;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(430px, 1fr);
  gap: 22px;
  width: min(1240px, calc(100% - 48px));
  margin: 26px auto 40px;
}

.tool-panel {
  min-width: 0;
  padding: 22px;
  background: white;
  border: 1px solid #d8e1e1;
  border-radius: 8px;
}

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

.section-head h2 {
  margin: 0;
  font-size: 17px;
}

.badge {
  padding: 4px 8px;
  color: #596f6f;
  background: #edf3f2;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.example {
  padding: 5px 8px;
  color: #33555a;
  background: #eaf2f1;
  border: 0;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.example:hover {
  background: #d8e8e6;
}

textarea {
  width: 100%;
  min-height: 106px;
  padding: 11px 12px;
  color: #1d2f34;
  background: #fbfdfd;
  border: 1px solid #c9d6d6;
  border-radius: 6px;
  font: inherit;
  font-size: 15px;
  resize: vertical;
}

textarea:focus {
  outline: 2px solid #6ba7a5;
  outline-offset: 1px;
}

.audio-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 104px;
  height: 38px;
  padding: 0 13px;
  color: #334b50;
  background: white;
  border: 1px solid #bcc9c9;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.command:hover {
  background: #f5f8f7;
}

.command:disabled {
  color: #98a6a6;
  background: #f0f2f2;
  border-color: #d7dede;
  cursor: not-allowed;
}

.command svg,
.primary svg,
.empty svg {
  width: 16px;
  height: 16px;
}

.command.record {
  color: #962f28;
  border-color: #d7aaa5;
}

.command.record.active {
  color: white;
  background: #a63930;
  border-color: #a63930;
}

.meter-row {
  display: grid;
  grid-template-columns: 1fr 52px;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.meter {
  height: 8px;
  overflow: hidden;
  background: #e4eaea;
  border-radius: 4px;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: #37867f;
  transition: width 80ms linear;
}

.timer {
  color: #607474;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  margin-top: 16px;
  color: white;
  background: #19706b;
  border: 0;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 620;
  cursor: pointer;
}

.primary:hover:not(:disabled) {
  background: #145e5a;
}

.primary:disabled {
  background: #a3b7b6;
  cursor: not-allowed;
}

.preview {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px;
  background: #f5f8f7;
  border-radius: 6px;
  font-size: 13px;
}

audio {
  width: 100%;
  height: 34px;
}

.message {
  margin-top: 14px;
  padding: 10px 12px;
  color: #84372f;
  background: #fbecea;
  border: 1px solid #e5b8b2;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 500px;
  color: #7d8f8f;
}

.empty svg {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  opacity: .6;
}

.empty p {
  margin: 0;
  font-size: 14px;
}

.summary {
  display: grid;
  grid-template-columns: 136px 1fr;
  align-items: center;
  gap: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e1e8e8;
}

.score-ring {
  --score-color: #19706b;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  color: var(--score-color);
  background:
    radial-gradient(closest-side, white 78%, transparent 79% 100%),
    conic-gradient(var(--score-color) calc(var(--progress) * 1%), #dfe7e7 0);
  border-radius: 50%;
}

.score-ring span {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.score-ring small {
  margin-top: 3px;
  color: #657878;
  font-size: 12px;
}

.score-label {
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 650;
}

.summary-info dl {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin: 0;
}

.dimensions-block,
.pause-block {
  margin-top: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e1e8e8;
}

.dimensions-block h3,
.pause-block h3,
.weak-block h3,
.phone-block h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.dimension-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.dimension-item {
  padding: 11px 12px;
  background: #f5f8f7;
  border-left: 4px solid #5c9d97;
  border-radius: 5px;
}

.dimension-item.warn {
  background: #fff7e9;
  border-left-color: #d69a2b;
}

.dimension-item.bad {
  background: #fdecea;
  border-left-color: #bf4a3f;
}

.dimension-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.dimension-head strong {
  font-size: 14px;
}

.dimension-head span {
  color: #5f7474;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dimension-item dl {
  display: grid;
  gap: 5px;
  margin: 0;
}

.dimension-item dl div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dimension-item dt {
  color: #667a7a;
  font-size: 12px;
}

.dimension-item dd {
  margin: 0;
  color: #344a4e;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.dimension-note {
  margin: 8px 0 0;
  color: #6d7b7b;
  font-size: 11px;
  line-height: 1.45;
}

.pause-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pause-item {
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding: 8px 10px;
  background: #f5f8f7;
  border-left: 4px solid #7b9a99;
  border-radius: 5px;
}

.pause-item strong {
  font-size: 13px;
}

.pause-item span {
  color: #667a7a;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.no-pause {
  color: #667a7a;
  font-size: 13px;
}

.summary-info dt {
  color: #667a7a;
  font-size: 12px;
}

.summary-info dd {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.weak-block,
.phone-block {
  margin-top: 20px;
}

.weak-block h3,
.phone-block h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.weak-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weak-item {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 8px;
  min-width: 78px;
  padding: 8px 10px;
  background: #fff6ed;
  border: 1px solid #edc99a;
  border-radius: 6px;
}

.weak-item.weak {
  background: #fdeceb;
  border-color: #e5a9a2;
}

.weak-item strong {
  font-size: 15px;
}

.weak-item span {
  color: #6d7b7b;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.sentence-words {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.word-item {
  min-width: 72px;
  padding: 9px 10px 8px;
  background: #f5f8f7;
  border-left: 4px solid #5c9d97;
  border-radius: 5px;
}

.word-item.warn {
  background: #fff7e9;
  border-left-color: #d69a2b;
}

.word-item.bad {
  background: #fdecea;
  border-left-color: #bf4a3f;
}

.word-item.nonspeech {
  opacity: .65;
  border-left-color: #9aabaa;
}

.word-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: #263d42;
  font-size: 15px;
  font-weight: 650;
}

.word-label span {
  color: #5f7474;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.word-phones {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.word-phone {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  min-width: 30px;
  padding: 4px 5px;
  background: white;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.word-phone strong {
  color: #263d42;
  font-size: 13px;
  font-weight: 600;
}

.word-phone code {
  color: #5f7474;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
}

.word-phone small {
  color: #667a7a;
  font-size: 11px;
}

.word-phone.warn strong {
  color: #8a5a10;
}

.word-phone.bad strong {
  color: #96352d;
}

.oov {
  margin-top: 18px;
  padding: 10px 12px;
  color: #7a5312;
  background: #fff6e5;
  border: 1px solid #e2c078;
  border-radius: 6px;
  font-size: 13px;
}

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 720px);
    margin-top: 16px;
  }

  .topbar {
    padding: 0 18px;
  }

  .section-head {
    flex-direction: column;
  }

  .examples {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .workspace {
    width: calc(100% - 20px);
  }

  .tool-panel {
    padding: 16px;
  }

  .command {
    flex: 1 1 100%;
  }

  .summary {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .summary-info dl {
    justify-content: center;
  }
}
