:root {
  --primary: #31528b;
  --primary-mid: #2c4a80;
  --primary-active: #244174;
  --primary-soft: #f2f6fc;
  --primary-border: #dde7f5;
  --accent: #c0883b;
  --accent-dark: #854f0b;
  --accent-light: #f0c878;
  --accent-soft: #faeeda;
  --page: #f7f5f0;
  --card: #fffefb;
  --field: #f7f8fa;
  --text: #202735;
  --text-strong: #151b26;
  --muted: #70798a;
  --hint: #9aa2af;
  --line: #e8e3da;
  --white: #fff;
  --danger: #b9473f;
  --success: #237a5a;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(29, 36, 51, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--page);
}

* {
  box-sizing: border-box;
}

html {
  background: #dfe3e9;
}

body {
  width: 100%;
  max-width: 390px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

button,
select,
input {
  font: inherit;
}

button {
  border: 0;
}

.app {
  min-height: 100vh;
  padding-bottom: 40px;
  overflow: hidden;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 52px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 0 10px;
  color: var(--white);
  background: var(--primary);
}

.nav-title {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav-back,
.nav-more {
  color: var(--white);
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.nav-more {
  font-size: 20px;
  letter-spacing: 2px;
}

.page {
  padding: 14px 14px 30px;
}

.member-card {
  position: relative;
  min-height: 222px;
  overflow: hidden;
  padding: 22px 20px 19px;
  border-radius: 16px;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary), var(--primary-active));
  box-shadow: 0 10px 24px rgba(36, 65, 116, 0.22), inset 0 0 0 1px rgba(240, 200, 120, 0.26);
}

.member-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.09;
  pointer-events: none;
  background: repeating-linear-gradient(58deg, rgba(255, 255, 255, 0.8) 0 1px, transparent 1px 9px);
}

.member-card::after {
  content: "";
  position: absolute;
  top: -70px;
  right: -105px;
  width: 210px;
  height: 360px;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.13), transparent);
  pointer-events: none;
}

.card-layer {
  position: relative;
  z-index: 2;
}

.card-top,
.card-person,
.section-head,
.resume-primary,
.resume-meta,
.sheet-head,
.field-label,
.record-line,
.intention-head {
  display: flex;
  align-items: center;
}

.card-top {
  justify-content: space-between;
}

.member-no {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: 0.17em;
}

.brand-logo {
  width: 84px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.member-since {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 23px;
  color: var(--accent-light);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.member-since::before {
  content: "";
  width: 2px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent-light);
}

.card-rule {
  height: 1px;
  margin: 18px 0 15px;
  background: rgba(240, 200, 120, 0.25);
}

.card-person {
  gap: 12px;
}

.avatar {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--white);
  border-radius: 50%;
  color: var(--primary);
  background: #e5edf8;
  font-size: 18px;
  font-weight: 750;
}

.avatar-photo {
  display: block;
  object-fit: cover;
  object-position: center;
}

.person-main {
  min-width: 0;
  flex: 1;
}

.person-name {
  font-size: 17px;
  font-weight: 750;
}

.person-expiry {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
}

.card-tap {
  padding: 6px 0 6px 10px;
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.info-card {
  margin-top: 14px;
  padding: 18px 16px;
  border: 1px solid rgba(232, 227, 218, 0.72);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.section-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 750;
}

.section-title::before {
  content: "";
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--primary);
}

.section-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.edit-link {
  padding: 5px;
  color: var(--primary);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #eff1f5;
}

.choice button {
  height: 34px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.choice button.active {
  color: var(--white);
  background: var(--primary);
  box-shadow: 0 3px 8px rgba(49, 82, 139, 0.18);
}

.resume-list {
  margin-top: 15px;
}

.unified-resume-list {
  position: relative;
  margin-top: 12px;
  padding-left: 18px;
}

.unified-resume-list::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 5px;
  width: 1px;
  background: #d8c49f;
}

.unified-record {
  position: relative;
  min-height: 58px;
  display: grid;
  grid-template-columns: 50px 1fr 18px;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.unified-record:last-child {
  border-bottom: 0;
}

.unified-record::before {
  content: "";
  position: absolute;
  left: -17px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px #d8c49f;
}

.unified-edition {
  color: var(--accent-dark);
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  font-weight: 750;
}

.unified-role {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 650;
}

.unified-detail {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.resume-extra {
  display: none;
}

.resume-extra.show {
  display: grid;
}

.resume-toggle {
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  border-radius: 9px;
  color: var(--primary);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  outline: none;
}

.resume-toggle:active {
  background: var(--primary-soft);
}

.resume-toggle:focus-visible {
  box-shadow: 0 0 0 2px var(--primary-border);
}

.consent-note {
  display: flex;
  gap: 8px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.consent-dot {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-top: 1px;
  border-radius: 50%;
  color: var(--white);
  background: var(--success);
  font-size: 9px;
}

.resume-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.resume-item:last-child {
  border-bottom: 0;
}

.resume-item.unified-record {
  padding: 8px 0;
}

.resume-primary {
  justify-content: space-between;
  gap: 10px;
}

.resume-edition {
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 750;
}

.resume-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 650;
}

.resume-tag.blue {
  color: var(--primary-active);
  background: var(--primary-soft);
}

.resume-meta {
  gap: 7px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--hint);
}

.chevron {
  color: var(--hint);
  font-size: 20px;
  font-weight: 400;
}

.add-btn,
.primary-btn {
  width: 100%;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  cursor: pointer;
}

.add-btn {
  margin-top: 14px;
  border: 1px dashed var(--primary-border);
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 14px;
  font-weight: 650;
}

.primary-btn {
  color: var(--white);
  background: linear-gradient(135deg, var(--primary), var(--primary-active));
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 5px 12px rgba(49, 82, 139, 0.18);
}

.profile-row {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.profile-row:last-child {
  border-bottom: 0;
}

.profile-label {
  font-size: 14px;
}

.profile-value {
  color: var(--muted);
  font-size: 13px;
}

.intention {
  display: none;
  margin-top: 15px;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(140deg, #f8f3e9, #fffdf8);
  border: 1px solid #eee1c9;
}

.intention-head {
  gap: 9px;
  color: var(--text-strong);
  font-weight: 700;
}

.intention-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 12px;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 13px;
}

.year-grid button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--white);
  cursor: pointer;
}

.year-grid button.active {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-weight: 700;
}

.year-note {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  opacity: 0.75;
}

.mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: rgba(16, 22, 33, 0.48);
}

.mask.show {
  display: block;
}

.sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  max-width: 390px;
  max-height: 88vh;
  margin: 0 auto;
  overflow-y: auto;
  padding: 11px 18px calc(20px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: var(--card);
  transform: translateY(105%);
  transition: transform 220ms ease;
}

.sheet.show {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 99px;
  background: #d9dce2;
}

.sheet-head {
  justify-content: space-between;
  margin-bottom: 18px;
}

.sheet-title {
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 750;
}

.sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--muted);
  background: var(--field);
  font-size: 21px;
  cursor: pointer;
}

.field {
  margin-bottom: 18px;
}

.field-label {
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
}

.field-hint {
  color: var(--hint);
  font-size: 11px;
  font-weight: 400;
}

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

.chip-grid.identity {
  grid-template-columns: repeat(2, 1fr);
}

.chip-grid.position {
  grid-template-columns: repeat(3, 1fr);
}

.chip {
  min-height: 38px;
  padding: 7px 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--white);
  font-size: 12px;
  cursor: pointer;
}

.chip.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
  font-weight: 700;
}

.field.member-only.hidden {
  display: none;
}

.select-control {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--text-strong);
  background: var(--white);
  font-size: 14px;
}

.select-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.business-note {
  margin-top: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--muted);
  background: var(--field);
  font-size: 11px;
  line-height: 1.55;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  display: none;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--white);
  background: rgba(26, 32, 43, 0.92);
  font-size: 12px;
}

.toast.show {
  display: block;
}

@media (min-width: 600px) {
  body {
    min-height: 844px;
    margin-top: 22px;
    margin-bottom: 22px;
    box-shadow: 0 18px 48px rgba(25, 31, 42, 0.22);
  }
}
