:root {
  color-scheme: light;
  --bg: #eaf0ee;
  --surface: #ffffff;
  --surface-soft: #f6faf8;
  --ink: #17211d;
  --muted: #66756f;
  --line: #d9e4df;
  --accent: #0d7f74;
  --accent-dark: #075d55;
  --warm: #f4a43a;
  --blue: #4267d9;
  --danger: #b33c37;
  --shadow: 0 18px 46px rgba(30, 50, 45, 0.14);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(145deg, rgba(13, 127, 116, 0.14), transparent 34%),
    linear-gradient(320deg, rgba(244, 164, 58, 0.18), transparent 36%),
    var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.phone-app {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 12px 28px;
}

.app-topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 0 0 22px 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(30, 50, 45, 0.11);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 16px;
  object-fit: cover;
}

h1,
h2,
p {
  margin: 0;
}

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

h2 {
  font-size: 17px;
  line-height: 1.25;
}

.brand p,
.section-title p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.app-badge {
  flex: 0 0 auto;
  padding: 7px 9px;
  border-radius: 999px;
  background: #edf9f6;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.height-card,
.visual-card,
.metric-strip,
.input-card,
.process-card {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.height-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(244, 164, 58, 0.9), rgba(244, 164, 58, 0.22)),
    #fff8ea;
}

.height-card span {
  color: #6c4512;
  font-size: 13px;
  font-weight: 900;
}

.height-card strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 44px;
  line-height: 1;
}

.height-card p {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  color: #5b421e;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.height-card p.error {
  background: #fff0ef;
  color: var(--danger);
}

.visual-card,
.input-card,
.process-card {
  padding: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title > div {
  min-width: 0;
}

.section-title > span,
.section-title > strong {
  flex: 0 0 auto;
  padding: 7px 9px;
  border-radius: 999px;
  background: #eef4f2;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.compact-title {
  margin-bottom: 14px;
}

.geometry-view {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  overflow: hidden;
}

.svg-label,
.svg-note {
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 4px;
  stroke-linejoin: round;
  fill: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.svg-note {
  fill: #5b421e;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.metric-strip div {
  min-width: 0;
  padding: 12px 10px;
  background: rgba(255, 255, 255, 0.92);
}

.metric-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.metric-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.15;
  word-break: keep-all;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.input-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

input,
select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
}

select {
  appearance: auto;
}

input:disabled {
  color: var(--muted);
}

.input-wrap b {
  color: var(--muted);
  font-size: 12px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
  padding: 5px;
  border-radius: 16px;
  background: #eef4f2;
}

.mode-tab {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.mode-tab.active {
  background: var(--surface);
  color: var(--accent-dark);
  box-shadow: 0 7px 16px rgba(24, 58, 51, 0.11);
}

.mode-pane {
  display: none;
}

.mode-pane.active {
  display: block;
}

.segment-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.tool-button,
.delete-segment {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 900;
}

.tool-button span {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  margin-right: 4px;
  border-radius: 999px;
  background: rgba(13, 127, 116, 0.12);
  color: var(--accent-dark);
}

.tool-button.primary {
  border-color: rgba(13, 127, 116, 0.25);
  background: var(--accent);
  color: #fff;
}

.tool-button.primary span {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.segment-list {
  display: grid;
  gap: 10px;
}

.segment-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

.segment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

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

.field.compact {
  gap: 5px;
}

.delete-segment {
  padding: 0 12px;
  color: var(--danger);
}

.segment-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.process-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.process-list li {
  position: relative;
  min-height: 44px;
  padding: 11px 12px 11px 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.process-list li::before {
  position: absolute;
  top: 11px;
  left: 12px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  content: counter(step);
  counter-increment: step;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 370px) {
  .phone-app {
    padding-inline: 8px;
  }

  .height-card strong {
    font-size: 38px;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .segment-toolbar,
  .field-grid,
  .segment-row + .segment-row {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 720px) {
  body {
    padding: 28px 0;
  }

  .phone-app {
    min-height: auto;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.32);
    box-shadow: 0 28px 90px rgba(30, 50, 45, 0.18);
  }

  .app-topbar {
    top: 28px;
  }
}
