:root {
  color-scheme: light;
  --green: #0f8b4c;
  --green-dark: #073f2a;
  --gold: #f4d37e;
  --mint: #e3f5eb;
  --text: #18211d;
  --muted: #718078;
  --line: #e2ebe6;
  --surface: #ffffff;
  --page: #eef5f0;
  --nav-height: 72px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: fixed;
  top: 0;
  bottom: var(--nav-height);
  left: 50%;
  width: min(100%, 520px);
  margin: 0 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 14px 18px;
  background: var(--page);
  scrollbar-width: none;
  transform: translateX(-50%);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.app-shell::-webkit-scrollbar {
  display: none;
}

.hero {
  min-height: 148px;
  margin: 0 -14px;
  padding: 28px 20px 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 16%, rgba(161, 235, 187, 0.45), transparent 34%),
    linear-gradient(135deg, #08311d 0%, #0f5636 60%, #0b3a25 100%);
}

.hero-title {
  margin: 0;
  max-width: 220px;
  color: var(--gold);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.18;
}

.hero-subtitle {
  margin: 10px 0 0;
  max-width: 220px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  line-height: 1.5;
}

.bracelet-visual {
  position: absolute;
  right: 8px;
  top: 18px;
  width: 140px;
  height: 106px;
}

.bracelet-ring {
  position: absolute;
  inset: 18px 8px 18px 10px;
  border: 18px solid transparent;
  border-top-color: #a8eaba;
  border-right-color: #4ed08c;
  border-bottom-color: #2ba366;
  border-left-color: #d0f8dc;
  border-radius: 50%;
  transform: rotate(-16deg);
  box-shadow: inset 0 0 14px rgba(5, 75, 40, 0.42), 0 10px 26px rgba(2, 18, 12, 0.35);
}

.bracelet-ring::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.34);
}

.bracelet-glow {
  position: absolute;
  right: 10px;
  bottom: 9px;
  width: 90px;
  height: 24px;
  border-radius: 999px;
  background: rgba(84, 205, 128, 0.22);
  filter: blur(10px);
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1d7d50;
  color: white;
  font-weight: 900;
}

.avatar.large {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  font-size: 23px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.app-card,
.mine-card,
.record-item,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.app-card {
  margin-top: -24px;
  position: relative;
  z-index: 2;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(16, 64, 38, 0.08);
}

.notice {
  margin-bottom: 13px;
  padding: 10px;
  border-radius: 8px;
  background: #fff9e7;
  color: #956717;
  font-size: 12px;
}

fieldset {
  margin: 0 0 15px;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 9px;
  color: #24362d;
  font-size: 14px;
  font-weight: 900;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.choice {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--text);
}

.choice.selected {
  border-color: var(--green);
  background: var(--mint);
}

.mini-bracelet {
  display: block;
  width: 31px;
  height: 19px;
  margin: 0 auto 7px;
  border: 4px solid #89caae;
  border-radius: 50%;
}

.choice strong {
  display: block;
  font-size: 12px;
}

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

.metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

select,
input[type="number"] {
  width: 100%;
  height: 39px;
  margin-top: 5px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--text);
  outline-color: var(--green);
}

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

.flaw-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: center;
}

.flaw-name {
  color: #24362d;
  font-size: 13px;
  font-weight: 900;
}

.flaw-levels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.flaw-level input {
  position: absolute;
  opacity: 0;
}

.flaw-level span {
  display: grid;
  place-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdfb;
  color: var(--text);
  font-size: 12px;
}

.flaw-level input:checked + span {
  border-color: var(--green);
  background: var(--mint);
  color: var(--green);
}

.result-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  margin: 4px 0 12px;
  padding: 13px;
  border-radius: 10px;
  background: #f1f8f4;
}

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

.result-panel strong {
  color: var(--green);
  font-size: 24px;
  line-height: 1;
}

.result-panel small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.primary-button {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-size: 15px;
  font-weight: 900;
}

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

.section-title h2 {
  margin: 0;
  font-size: 20px;
}

.section-title button,
.mine-grid button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--green);
  font-weight: 800;
}

.record-list {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
}

.record-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 13px;
}

.record-item strong,
.record-item span,
.record-item small {
  display: block;
}

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

.record-item span,
.record-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.record-item b {
  color: var(--green);
  font-size: 17px;
}

.empty-state {
  padding: 34px 16px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.mine-card {
  padding: 26px 16px;
  text-align: center;
}

.mine-card h2 {
  margin: 12px 0 6px;
  font-size: 21px;
}

.mine-card p {
  margin: 0;
  color: var(--muted);
}

.mine-card strong {
  color: var(--green);
}

.mine-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 520px);
  height: var(--nav-height);
  padding: 7px 20px 9px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 -8px 24px rgba(17, 58, 37, 0.08);
  transform: translateX(-50%);
  overflow: hidden;
}

.nav-item {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: #88958e;
  border-radius: 10px;
}

.nav-item.active {
  background: #eef8f3;
  color: var(--green);
}

.nav-item em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.nav-icon {
  width: 22px;
  height: 22px;
  position: relative;
}

.home-icon::before,
.list-icon::before,
.user-icon::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 6px;
}

.home-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.list-icon::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 8px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.user-icon::before {
  inset: 4px 6px 3px;
  border-radius: 50% 50% 7px 7px;
}

@media (min-width: 720px) {
  body {
    background:
      linear-gradient(90deg, rgba(15, 139, 76, 0.08), transparent 30%, transparent 70%, rgba(15, 139, 76, 0.08)),
      var(--page);
  }

  .app-shell {
    box-shadow: 0 0 0 1px rgba(12, 75, 43, 0.05);
  }
}
