:root {
  --bg: #f5f6f7;
  --panel: #ffffff;
  --text: #16202a;
  --muted: #667085;
  --line: #e2e6ea;
  --primary: #176d5b;
  --primary-soft: #e9f5f1;
  --orange: #b55e19;
  --blue: #2563a8;
  --gray: #586471;
  --danger: #b42318;
  --shadow: 0 8px 22px rgba(17, 24, 39, 0.06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  background: #e9ecef;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 8px;
  height: 64px;
  padding: 8px 12px;
  background: rgba(245, 246, 247, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 18px;
  font-weight: 700;
}

.header-title {
  min-width: 0;
  text-align: center;
}

.header-title strong,
.header-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-title strong {
  font-size: 16px;
  line-height: 1.25;
}

.header-title span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.app-main {
  padding-bottom: 82px;
}

.screen {
  display: none;
  padding: 14px 14px 96px;
  animation: page-in 160ms ease-out;
}

.screen.active {
  display: block;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-panel,
.form-card,
.profile-card,
.module-note,
.card,
.quick-card,
.line-card,
.service-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 14px;
  align-items: stretch;
  padding: 15px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

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

h2 {
  font-size: 15px;
}

.hero-panel p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hero-meter {
  display: grid;
  place-items: center;
  padding: 12px 8px;
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.hero-meter strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  color: var(--primary);
}

.hero-meter span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

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

.quick-grid {
  margin-top: 12px;
}

.quick-card,
.line-card {
  min-height: 104px;
  padding: 12px;
  color: inherit;
  text-align: left;
}

.quick-card:active,
.line-card:active,
.service-card:active,
.primary-button:active,
.secondary-button:active,
.icon-button:active {
  transform: scale(0.985);
}

.mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.mark-green {
  background: var(--primary);
}

.mark-orange {
  background: var(--orange);
}

.mark-blue {
  background: var(--blue);
}

.mark-gray {
  background: var(--gray);
}

.quick-card strong,
.line-card strong {
  display: block;
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.3;
}

.quick-card small,
.line-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 2px 9px;
}

.section-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.text-button {
  color: var(--primary);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.stack {
  display: grid;
  gap: 8px;
}

.card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.card-body {
  min-width: 0;
}

.card strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.tag {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 11px;
  white-space: nowrap;
}

.tag.warn {
  color: var(--orange);
  background: #fff3e9;
}

.tag.blue {
  color: var(--blue);
  background: #eaf2ff;
}

.tag.gray {
  color: var(--gray);
  background: #eef0f2;
}

.toolbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

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

.chip {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}

.chip.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.form-card {
  display: grid;
  gap: 11px;
  padding: 12px;
}

.compact-form {
  margin-bottom: 12px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input,
select {
  height: 40px;
  padding: 0 10px;
}

textarea {
  min-height: 86px;
  padding: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 109, 91, 0.12);
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 7px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--primary);
}

.secondary-button {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
}

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

.service-card {
  min-height: 88px;
  padding: 10px 8px;
  text-align: center;
}

.service-card .mark {
  margin: 0 auto;
}

.service-card strong {
  display: block;
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.3;
}

.module-note,
.profile-card {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 13px;
}

.module-note strong,
.profile-card strong {
  font-size: 14px;
}

.module-note span,
.profile-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.danger strong {
  color: var(--danger);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(100%, 430px);
  transform: translateX(-50%);
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.05);
}

.nav-button {
  height: 60px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.nav-button span {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  line-height: 1;
}

.nav-button.active {
  color: var(--primary);
  background: #f4faf7;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 76px;
  z-index: 50;
  display: none;
  width: min(calc(100% - 36px), 360px);
  padding: 12px 14px;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(22, 32, 42, 0.95);
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}

.toast.show {
  display: block;
}

.empty {
  padding: 18px 12px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed #cfd6dd;
  border-radius: var(--radius);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 360px) {
  .hero-panel,
  .quick-grid,
  .split-actions,
  .form-actions,
  .service-grid {
    grid-template-columns: 1fr;
  }
}
