* {
  box-sizing: border-box;
}

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #fbfcff;
  --text: #17181c;
  --muted: #7b8190;
  --faint: #a2a8b5;
  --line: #e8ebf0;
  --line-strong: #dfe3ea;
  --accent: #4d6bfe;
  --accent-soft: #eef2ff;
  --danger: #a4574d;
  --danger-soft: #f3e8e6;
  --ion-font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  font-family: var(--ion-font-family);
  letter-spacing: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #dfe2e0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

#capture,
.phone {
  width: 390px;
  height: 844px;
  overflow: hidden;
}

.phone {
  position: relative;
  padding: 14px 16px 78px;
  background: var(--bg);
  color: var(--text);
}

.statusbar,
.statusbar div,
.topbar,
.section-head,
.field-row,
.action-btn,
.data-row,
.tabs,
.tabs a {
  display: flex;
  align-items: center;
}

.statusbar {
  height: 22px;
  justify-content: space-between;
  color: #191a1a;
  font-size: 12px;
  font-weight: 600;
}

.statusbar div {
  gap: 5px;
}

.signal {
  display: grid;
  grid-template-columns: repeat(4, 3px);
  align-items: end;
  gap: 2px;
  height: 10px;
}

.signal i {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: currentColor;
}

.signal i:nth-child(1) {
  height: 4px;
}

.signal i:nth-child(2) {
  height: 6px;
}

.signal i:nth-child(3) {
  height: 8px;
}

.signal i:nth-child(4) {
  height: 10px;
}

.battery {
  width: 22px;
  height: 11px;
  padding: 1px;
  border: 1.3px solid currentColor;
  border-radius: 3px;
}

.battery::after {
  content: "";
  display: block;
  width: 74%;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
}

.topbar {
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 10px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #262827;
  font-size: 18px;
}

.title-wrap {
  min-width: 0;
  flex: 1;
  text-align: center;
}

.title-wrap span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.title-wrap h1 {
  margin: 3px 0 0;
  font-size: 24px;
  line-height: 1.12;
  font-weight: 600;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.summary {
  min-height: 136px;
  padding: 15px 16px 13px;
}

.summary.compact {
  min-height: 100px;
}

.summary > span,
.metric span,
.compare span,
.scan-copy span,
.muted-panel span,
.reason-panel label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.summary h2 {
  margin: 12px 0 15px;
  font-size: 34px;
  line-height: 1;
  font-weight: 560;
  letter-spacing: 0;
}

.summary.compact h2 {
  margin: 11px 0 13px;
  font-size: 25px;
  line-height: 1.16;
}

.summary div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  color: var(--muted);
}

.summary p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.soft-segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f0f1ef;
}

.soft-segment button {
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.soft-segment .active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.metric-grid,
.compare-panel,
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.metric,
.compare {
  min-height: 82px;
  padding: 11px 13px 9px;
}

.metric strong,
.compare strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: 21px;
  line-height: 1;
  font-weight: 570;
}

.metric em,
.compare em,
.data-row em {
  display: inline-flex;
  width: fit-content;
  margin-top: 9px;
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

.trend-panel {
  padding: 12px 13px 4px;
}

.section-head {
  justify-content: space-between;
  gap: 12px;
  min-height: 22px;
}

.section-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 560;
}

.section-head span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
}

.trend {
  width: 100%;
  height: 92px;
  display: block;
  margin-top: 2px;
}

.guide {
  fill: none;
  stroke: #eef0ed;
  stroke-linecap: round;
}

.trend-area {
  fill: rgba(71, 103, 93, 0.07);
}

.trend-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend circle {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
}

.list-panel,
.form-panel,
.reason-panel,
.muted-panel {
  padding: 4px 0;
}

.data-row,
.field-row {
  min-height: 44px;
  justify-content: space-between;
  gap: 12px;
  padding: 0 13px;
  border-top: 1px solid var(--line);
}

.field-row {
  min-height: 38px;
}

.data-row:first-child,
.field-row:first-child,
.section-head + .data-row {
  border-top: 0;
}

.list-panel .section-head {
  padding: 10px 13px 7px;
}

.data-row div {
  min-width: 0;
}

.data-row strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 540;
}

.data-row span,
.field-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.field-row strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 540;
  text-align: right;
}

.data-row em {
  flex: 0 0 auto;
  margin-top: 0;
}

.org-panel {
  padding: 7px 0;
}

.org-node {
  position: relative;
  min-height: 54px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  padding: 0 14px;
}

.org-node::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 34px;
  bottom: -18px;
  width: 1px;
  background: var(--line);
}

.org-node:last-child::before {
  display: none;
}

.org-node i {
  width: 10px;
  height: 10px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.org-node.root i {
  border-color: var(--accent);
  background: var(--accent);
}

.org-node strong {
  display: block;
  font-size: 14px;
  font-weight: 550;
}

.org-node span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.scan-panel {
  min-height: 122px;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 9px;
}

.receipt-mini,
.scan-copy {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.receipt-mini {
  display: flex;
  flex-direction: column;
  padding: 14px 15px;
}

.receipt-mini span {
  color: var(--muted);
  font-size: 12px;
}

.receipt-mini b {
  margin: 8px 0 8px;
  color: var(--text);
  font-size: 23px;
  font-weight: 560;
}

.receipt-mini i {
  height: 6px;
  margin-top: 8px;
  border-radius: 99px;
  background: #eceeeb;
}

.receipt-mini i:last-child {
  width: 62%;
}

.scan-copy {
  padding: 15px;
}

.scan-copy strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
  font-weight: 570;
}

.scan-copy p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.approval-hero {
  min-height: 144px;
  padding: 17px 16px;
  background: linear-gradient(180deg, #fff 0%, #fdfafa 100%);
  border-color: #eadbd8;
}

.approval-hero span {
  color: var(--muted);
  font-size: 12px;
}

.approval-hero h2 {
  margin: 18px 0 12px;
  color: var(--danger);
  font-size: 37px;
  line-height: 1;
  font-weight: 560;
}

.approval-hero p {
  margin: 0;
  color: #8c706b;
  font-size: 12px;
}

.reason-panel {
  padding: 13px;
}

.reason-panel div {
  min-height: 48px;
  margin-top: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: #505452;
  font-size: 13px;
  line-height: 1.45;
}

.profile {
  display: grid;
  justify-items: center;
  padding: 20px 0 10px;
  text-align: center;
}

.avatar {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font-size: 24px;
  font-weight: 560;
}

.profile h2 {
  margin: 12px 0 4px;
  font-size: 24px;
  font-weight: 560;
}

.profile p,
.muted-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.muted-panel {
  padding: 14px;
}

.muted-panel strong {
  display: block;
  margin: 9px 0 6px;
  font-size: 22px;
  font-weight: 560;
}

.action-btn {
  height: 42px;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: #2a2c2b;
  font-size: 14px;
  font-weight: 540;
}

.action-btn ion-icon {
  font-size: 17px;
}

.action-btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.action-btn.danger {
  border-color: var(--danger-soft);
  background: var(--danger-soft);
  color: var(--danger);
}

.tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58px;
  justify-content: space-around;
  gap: 3px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.tabs a {
  flex: 1;
  height: 49px;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  border-radius: 7px;
  color: #8b908e;
  text-decoration: none;
}

.tabs ion-icon {
  font-size: 19px;
}

.tabs span {
  font-size: 10px;
  font-weight: 500;
}

.tabs .active {
  background: var(--accent-soft);
  color: var(--accent);
}
