:root {
  --bg: #fbf7f4;
  --panel: #fffdfb;
  --ink: #2d2625;
  --muted: #867876;
  --line: #eadfd9;
  --rose: #b85d72;
  --rose-strong: #963d56;
  --gold: #c79a4b;
  --green: #315f52;
  --danger: #b23b3b;
  --shadow: 0 18px 45px rgba(70, 41, 38, 0.12);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(199, 154, 75, 0.14), transparent 32rem),
    linear-gradient(145deg, #fffaf5 0%, #f8eeee 42%, #f7f6f0 100%);
  color: var(--ink);
  min-height: 100vh;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app {
  width: min(1120px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.login-card {
  width: min(420px, 100%);
  background: rgba(255, 253, 251, 0.92);
  border: 1px solid rgba(234, 223, 217, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--green));
  font-size: 24px;
  margin-bottom: 18px;
}

.title {
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 8px;
  letter-spacing: 0;
}

.subtle {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: #5f5250;
  font-size: 13px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 46px;
  padding: 10px 12px;
  outline: none;
}

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

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(184, 93, 114, 0.7);
  box-shadow: 0 0 0 3px rgba(184, 93, 114, 0.1);
}

.btn {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: var(--rose);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.btn:hover {
  background: var(--rose-strong);
}

.btn.secondary {
  background: #f3ece7;
  color: var(--ink);
}

.btn.green {
  background: var(--green);
}

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

.btn.ghost {
  background: transparent;
  color: var(--rose-strong);
  border: 1px solid rgba(184, 93, 114, 0.28);
}

.btn.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 247, 244, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(234, 223, 217, 0.85);
  padding: 14px 16px 10px;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-name {
  margin: 0;
  font-size: 20px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-top: 12px;
  scrollbar-width: none;
}

.tab {
  white-space: nowrap;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 8px;
  background: transparent;
  color: #5d504e;
  border: 1px solid transparent;
}

.tab.active {
  background: #fff;
  color: var(--rose-strong);
  border-color: rgba(184, 93, 114, 0.2);
  box-shadow: 0 8px 20px rgba(80, 45, 40, 0.08);
}

.main {
  padding: 16px;
  display: grid;
  gap: 16px;
}

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

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

.stat {
  background: rgba(255, 253, 251, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.stat strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  margin-top: 8px;
}

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

.panel {
  background: rgba(255, 253, 251, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(70, 41, 38, 0.07);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-title h2 {
  margin: 0;
  font-size: 18px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
}

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

.card-filter {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.card-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 10px;
}

.filter-card {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 6px;
}

.filter-card strong {
  font-size: 16px;
}

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

.filter-card.selected,
.filter-card.active {
  border-color: rgba(184, 93, 114, 0.55);
  box-shadow: 0 0 0 3px rgba(184, 93, 114, 0.1);
}

.filter-card.active {
  background: #fff7f4;
}

.card-filter-actions {
  justify-content: flex-end;
}

.item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.item h3 {
  margin: 0;
  font-size: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 8px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--green);
  background: rgba(49, 95, 82, 0.1);
  white-space: nowrap;
}

.badge.gold {
  color: #8b6421;
  background: rgba(199, 154, 75, 0.14);
}

.badge.red {
  color: var(--danger);
  background: rgba(178, 59, 59, 0.1);
}

.detail-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}

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

.member-card {
  background: linear-gradient(135deg, #fff 0%, #fff7f0 100%);
  border: 1px solid rgba(199, 154, 75, 0.28);
  border-radius: 8px;
  padding: 15px;
}

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

.times {
  text-align: right;
}

.times strong {
  display: block;
  font-size: 30px;
  color: var(--rose-strong);
  line-height: 1;
}

.record {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(44, 35, 34, 0.36);
  display: grid;
  place-items: end center;
  padding: 16px;
}

.modal {
  width: min(560px, 100%);
  max-height: min(720px, 92vh);
  overflow: auto;
  background: var(--panel);
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
}

.modal-wide {
  width: min(760px, 100%);
}

.modal h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

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

.full {
  grid-column: 1 / -1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 80;
  background: #2d2625;
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  max-width: min(520px, calc(100vw - 28px));
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

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

@media (max-width: 760px) {
  .topbar {
    padding: 12px 12px 8px;
  }

  .main {
    padding: 12px;
  }

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

  .detail-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .actions .btn {
    flex: 1 1 130px;
  }

  .card-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-filter-actions .btn {
    flex: 1 1 120px;
  }

  .panel {
    padding: 14px;
  }

  .modal-backdrop {
    padding: 10px;
  }
}
