:root {
  color-scheme: light;
  --ink: #1f2a2e;
  --muted: #6c7780;
  --line: #eadfca;
  --panel: #ffffff;
  --soft: #fff9ec;
  --brand: #f2b12f;
  --brand-dark: #c98512;
  --gold: #d89418;
  --coral: #d85f35;
  --danger: #b42318;
  --ok: #17803d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff7e7;
  color: var(--ink);
}

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

button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(201, 133, 18, 0.2);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

button:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(201, 133, 18, 0.22);
}

button.secondary {
  background: #e5eeee;
  color: var(--ink);
}

button.danger {
  background: var(--danger);
}

button.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

button.ghost.danger {
  color: var(--danger);
  border-color: #f2b8b5;
}

button.text-btn {
  width: 100%;
  margin-top: 12px;
  background: transparent;
  color: var(--brand-dark);
  box-shadow: none;
}

button.link-btn {
  display: inline;
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-dark);
  box-shadow: none;
  font-weight: 800;
  vertical-align: baseline;
}

button.full-btn {
  width: 100%;
  margin-top: 12px;
}

button:disabled {
  cursor: not-allowed;
  background: #b8c2c7;
  box-shadow: none;
  transform: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 11px 12px;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(242, 177, 47, 0.2);
  outline: none;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 24px 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.auth-wrap {
  display: grid;
  place-items: center;
  min-height: 58vh;
}

.auth-panel {
  width: min(100%, 430px);
}

.brand h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  background: #fffdf7;
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
}

.tab.active {
  background: #2f2a1f;
  color: #fff4d8;
  border-color: #2f2a1f;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 34px rgba(31, 42, 46, 0.06);
}

.panel h2,
.panel h3 {
  margin: 0 0 14px;
  letter-spacing: 0;
}

.user-hero {
  display: grid;
  grid-template-columns: minmax(320px, 430px) 1fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.hero-card {
  min-height: 260px;
  border-radius: 8px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 218, 130, 0.22), rgba(255, 255, 255, 0)),
    #332819;
  color: #fff;
  box-shadow: 0 18px 42px rgba(109, 72, 17, 0.2);
}

.member-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffd36a;
  color: #37260d;
  font-weight: 900;
  flex: 0 0 auto;
  overflow: hidden;
}

.avatar-image {
  background-position: center;
  background-size: cover;
  border: 2px solid rgba(255, 211, 106, 0.9);
}

.member-name {
  font-weight: 800;
  font-size: 17px;
}

.profile-link,
.profile-entry {
  min-height: auto;
  padding: 0;
  text-align: left;
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.profile-link:hover,
.profile-entry:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.member-phone,
.coin-label,
.hero-stats span {
  color: rgba(255, 255, 255, 0.68);
}

.profile-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 18px;
}

.profile-preview .avatar {
  width: 62px;
  height: 62px;
}

.profile-preview h2 {
  margin: 0;
}

.profile-preview p {
  margin: 4px 0 0;
  color: var(--muted);
}

.back-btn {
  min-height: 36px;
  padding: 0 12px;
  background: #fff4d4;
  color: #332819;
  box-shadow: none;
}

.back-btn:hover {
  background: #ffe7a8;
  color: #332819;
  box-shadow: none;
  transform: none;
}

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

.coin-value {
  margin-top: 4px;
  font-size: 58px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

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

.hero-stats div {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.hero-stats span,
.hero-stats strong {
  display: block;
}

.hero-stats strong {
  margin-top: 4px;
  font-size: 20px;
}

.quick-panel,
.shop-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 12px 34px rgba(31, 42, 46, 0.06);
}

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

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

.section-head span {
  color: var(--muted);
  font-size: 13px;
}

.shop-section {
  margin-bottom: 18px;
}

.user-page {
  padding-bottom: 86px;
}

.user-hero.single {
  grid-template-columns: minmax(0, 1fr);
}

.user-hero.single .hero-card {
  max-width: 620px;
}

.order-panel {
  margin-bottom: 18px;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

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

.admin-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
  margin-bottom: 6px;
}

.admin-nav-item {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 16px;
  background: #fffdf7;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.admin-nav-item:hover {
  background: #fff4d4;
  color: var(--ink);
  box-shadow: none;
  transform: none;
}

.admin-nav-item.active {
  background: #332819;
  color: #ffd66f;
  border-color: #332819;
}

.login-wrap {
  min-height: 56vh;
  display: grid;
  place-items: start center;
  padding-top: 34px;
}

.login-panel {
  width: min(420px, 100%);
}

.login-panel h2 {
  margin-bottom: 6px;
}

.points {
  background: #332819;
  color: #fff;
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 14px;
}

.points .label {
  color: #ffe4a7;
  font-size: 14px;
}

.points .value {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.1;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  background: var(--soft);
  border-radius: 8px;
  padding: 12px;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.form {
  display: grid;
  gap: 12px;
}

.form label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.gift,
.record,
.row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.gift {
  display: grid;
  gap: 12px;
  padding: 10px;
  box-shadow: 0 10px 24px rgba(31, 42, 46, 0.05);
}

.gift-art {
  height: 132px;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 208, 91, 0.55), rgba(255, 244, 209, 0.88)),
    #fff4d4;
  display: grid;
  place-items: center;
  color: #6e4610;
  font-weight: 900;
}

.gift-photo {
  height: 132px;
  border-radius: 8px;
  background-color: #fff4d4;
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(201, 133, 18, 0.18);
}

.gift-art span {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(201, 133, 18, 0.2);
}

.gift-body {
  min-height: 70px;
}

.gift h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  white-space: pre-line;
}

.gift p {
  margin: 8px 0 0;
  color: var(--gold);
}

.gift p strong {
  font-size: 24px;
  margin-right: 4px;
}

.gift p span {
  color: var(--muted);
  font-size: 13px;
}

.record {
  box-shadow: 0 6px 16px rgba(31, 42, 46, 0.04);
}

.record-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.search-box {
  display: block;
  margin: 12px 0 14px;
}

.search-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.check-line input {
  width: auto;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #e8f5ed;
  color: var(--ok);
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
}

.pill.warn {
  background: #fff3d8;
  color: var(--gold);
}

.pill.bad {
  background: #fee4e2;
  color: var(--danger);
}

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

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

.inline-form {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.inline-form input {
  min-width: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 13px 15px;
  max-width: 360px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.42);
  z-index: 10;
}

.modal {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head h2 {
  margin: 0;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.icon-btn {
  width: 36px;
  min-height: 36px;
  padding: 0;
  background: #e5eeee;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 8;
  width: min(420px, calc(100% - 28px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(190, 143, 50, 0.28);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 0 14px 44px rgba(93, 65, 17, 0.18);
  backdrop-filter: blur(16px);
}

.bottom-nav-item {
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 5px 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.bottom-nav-item:hover {
  background: #fff4d4;
  color: var(--ink);
  box-shadow: none;
  transform: none;
}

.bottom-nav-item.active {
  background: #332819;
  color: #ffd66f;
}

.bottom-nav-item span,
.bottom-nav-item strong {
  display: block;
  line-height: 1;
}

.bottom-nav-item span {
  font-size: 19px;
  font-weight: 900;
}

.bottom-nav-item strong {
  font-size: 12px;
}

.empty {
  color: var(--muted);
  padding: 16px;
  background: var(--soft);
  border-radius: 8px;
}

@media (max-width: 860px) {
  .shell {
    padding: 14px;
  }

  .topbar,
  .layout,
  .user-hero {
    display: block;
  }

  .hero-card,
  .quick-panel,
  .shop-section,
  .panel {
    margin-bottom: 12px;
  }

  .hero-card {
    min-height: auto;
    padding: 20px;
  }

  .member-line {
    margin-bottom: 20px;
  }

  .tabs {
    margin-top: 12px;
  }

  .coin-value {
    font-size: 46px;
  }

  .section-head {
    display: block;
  }

  .section-head span {
    display: block;
    margin-top: 4px;
  }

  .activity-grid {
    grid-template-columns: 1fr;
  }

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

  .gift {
    padding: 9px;
  }

  .gift-art {
    height: 108px;
  }

  .gift-photo {
    height: 108px;
  }

  .gift h3 {
    font-size: 14px;
  }

  .gift p strong {
    font-size: 21px;
  }

  .stats,
  .split,
  .hero-stats {
    grid-template-columns: 1fr;
  }
}
