:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #382d32;
  background: #fff8f8;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, #ffe0e8 0, transparent 30%),
    radial-gradient(circle at 88% 18%, #ffeccf 0, transparent 27%),
    linear-gradient(150deg, #fffaf8, #fff1f5);
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}
body:before,
body:after {
  content: "♥";
  position: fixed;
  color: #ffb1c1;
  opacity: 0.25;
  z-index: -1;
}
body:before {
  font-size: 14rem;
  top: 30%;
  left: -4rem;
  transform: rotate(-18deg);
}
body:after {
  font-size: 10rem;
  right: -2rem;
  bottom: 5%;
  transform: rotate(20deg);
}
.shell {
  width: min(100%, 520px);
  margin: auto;
  padding: 42px 0;
}
.brand {
  text-align: center;
  margin-bottom: 24px;
}
.brand h1 {
  font-size: 2rem;
  margin: 5px 0;
  color: #d74462;
  letter-spacing: 0.15em;
}
.brand p {
  margin: 0;
  color: #8c7078;
  font-size: 0.92rem;
}
.mini-heart {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 25px #ff809c36;
  color: #ff5577;
  font-size: 1.5rem;
}
.card {
  background: #ffffffdc;
  border: 1px solid #fff;
  box-shadow: 0 18px 55px #9e526b1c;
  border-radius: 28px;
  padding: 24px;
  backdrop-filter: blur(12px);
}
h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}
.sub {
  margin: 0 0 22px;
  color: #866e76;
  line-height: 1.6;
}
.field {
  display: grid;
  gap: 7px;
  margin: 14px 0;
}
.field label {
  font-size: 0.85rem;
  color: #725c64;
  font-weight: 650;
}
.field input,
.field textarea {
  width: 100%;
  border: 1px solid #eadde1;
  background: #fffafd;
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  outline: none;
  transition: 0.2s;
}
.field input:focus,
.field textarea:focus {
  border-color: #ff7792;
  box-shadow: 0 0 0 4px #ff77921a;
}
.field textarea {
  resize: vertical;
  min-height: 82px;
}
.counter {
  text-align: right;
  color: #9b8189;
  font-size: 0.78rem;
}
.button {
  border: 0;
  border-radius: 15px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    opacity 0.15s;
}
.button:active {
  transform: scale(0.97);
}
.button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.primary {
  width: 100%;
  background: linear-gradient(135deg, #ff5577, #ff816d);
  color: #fff;
  box-shadow: 0 10px 24px #ff557740;
}
.ghost {
  background: #fff;
  color: #9b5362;
  border: 1px solid #f1dce2;
}
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dashboard {
  text-align: center;
}
.hello {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  margin-bottom: 18px;
}
.hello strong {
  color: #d74462;
}
.heart-button {
  position: relative;
  width: 190px;
  height: 190px;
  border: 0;
  border-radius: 50%;
  margin: 15px auto 24px;
  background: linear-gradient(145deg, #ff7892, #ff4d70);
  color: white;
  box-shadow:
    0 24px 50px #ff56774d,
    inset 0 2px 2px #ffffff70;
  cursor: pointer;
  transition: 0.18s;
}
.heart-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 30px 56px #ff56775c;
}
.heart-button:active,
.heart-button.pulse {
  transform: scale(0.92);
}
.heart-button span {
  display: block;
  font-size: 4.4rem;
  line-height: 1;
}
.heart-button b {
  display: block;
  margin-top: 8px;
  font-size: 1.05rem;
}
.today {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 18px 0 22px;
}
.score {
  background: #fff6f8;
  border-radius: 18px;
  padding: 13px 8px;
}
.score b {
  display: block;
  font-size: 1.65rem;
  color: #d74462;
}
.score small {
  color: #887078;
}
.versus {
  color: #c6a6ae;
  font-size: 0.8rem;
}
.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}
.history-head h3 {
  margin: 0;
}
.history {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  text-align: left;
}
.event {
  padding: 13px 15px;
  border-radius: 16px;
  background: #fff7f9;
  border: 1px solid #f6e5e9;
}
.event-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.83rem;
}
.event-name {
  font-weight: 700;
  color: #d74462;
}
.event-time {
  color: #a18991;
}
.event p {
  margin: 8px 0 0;
  color: #5f4a51;
  line-height: 1.45;
  word-break: break-word;
}
.empty {
  color: #9d858d;
  padding: 24px 0;
  text-align: center;
}
.loading {
  text-align: center;
  color: #9a737e;
  padding: 60px 0;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: #382d32;
  color: #fff;
  padding: 11px 18px;
  border-radius: 99px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 20;
  max-width: 90%;
  white-space: nowrap;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.footer-actions {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}
.error {
  color: #bf3651;
  font-size: 0.85rem;
  margin: 10px 0;
}
@media (max-width: 420px) {
  .shell {
    padding: 25px 0;
  }
  .card {
    padding: 20px;
    border-radius: 23px;
  }
  .heart-button {
    width: 165px;
    height: 165px;
  }
  .setup-grid {
    grid-template-columns: 1fr;
  }
  .brand h1 {
    font-size: 1.75rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0;
  color: #725c64;
  font-size: 0.9rem;
}
.check-row input {
  width: 18px;
  height: 18px;
  accent-color: #d74462;
}
.alias-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff7f9;
  border: 1px solid #f4e1e6;
}
.alias-panel strong {
  display: block;
  margin-top: 3px;
  color: #d74462;
  font-size: 1.08rem;
}
.button.small {
  padding: 8px 12px;
  font-size: 0.82rem;
}
.history-head {
  gap: 12px;
  flex-wrap: wrap;
}
.filters {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 99px;
  background: #f8e9ed;
}
.filter {
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: #846b73;
  padding: 7px 11px;
  cursor: pointer;
}
.filter.active {
  background: #fff;
  color: #c93655;
  box-shadow: 0 3px 12px #9341581c;
}
.history-list {
  display: grid;
  gap: 16px;
}
.history-day h4 {
  margin: 8px 0;
  color: #8a7179;
  font-size: 0.82rem;
  font-weight: 700;
}
.history-item {
  padding: 13px 15px;
  border-radius: 16px;
  background: #fff7f9;
  border: 1px solid #f6e5e9;
}
.history-item + .history-item {
  margin-top: 8px;
}
.history-item div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.history-item strong {
  color: #d74462;
  font-size: 0.88rem;
}
.history-item time {
  color: #a18991;
  font-size: 0.8rem;
}
.history-item p {
  margin: 7px 0 0;
  color: #5f4a51;
  line-height: 1.5;
  word-break: break-word;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
  color: #8a7179;
  font-size: 0.84rem;
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.alias-dialog {
  width: min(calc(100% - 32px), 420px);
  border: 0;
  border-radius: 24px;
  padding: 24px;
  color: #382d32;
  box-shadow: 0 22px 70px #66384642;
}
.alias-dialog::backdrop {
  background: #382d3266;
  backdrop-filter: blur(4px);
}
.alias-dialog h3 {
  margin: 0 0 8px;
}
.alias-dialog label {
  display: grid;
  gap: 7px;
  color: #725c64;
  font-size: 0.88rem;
}
.alias-dialog input {
  width: 100%;
  border: 1px solid #eadde1;
  background: #fff9fa;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}
@media (max-width: 420px) {
  .alias-panel {
    align-items: flex-start;
  }
  .history-head {
    align-items: flex-start;
  }
  .filters {
    width: 100%;
  }
  .filter {
    flex: 1;
  }
  .pagination {
    justify-content: space-between;
  }
}

/* 2026 mobile-first visual refresh */
.login-card {
  width: min(100%, 480px);
  padding: 36px;
  border-color: rgba(218, 111, 136, 0.18);
  box-shadow: 0 24px 70px rgba(111, 55, 70, 0.13);
}
.login-intro {
  display: grid;
  justify-items: center;
  margin-bottom: 28px;
  text-align: center;
}
.login-intro .eyebrow {
  margin-bottom: 10px;
  letter-spacing: 0.16em;
}
.login-intro h2 {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 6vw, 2.15rem);
}
.login-intro .sub {
  max-width: 25rem;
  margin: 0;
}
.login-form {
  display: grid;
  gap: 18px;
}
.login-form > label:not(.check-row) {
  display: grid;
  gap: 8px;
  color: #634d55;
  font-size: 0.88rem;
  font-weight: 700;
}
.login-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 52px;
  border: 1px solid #eadce1;
  border-radius: 16px;
  background: #fffafb;
  padding: 0 16px;
  color: #382d32;
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}
.login-form input:not([type="checkbox"]):focus {
  border-color: #df718b;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(215, 68, 98, 0.1);
}
.login-form .check-row {
  margin: -2px 0 0;
}
.login-submit {
  min-height: 54px;
  margin-top: 2px;
  border-radius: 16px;
  font-size: 1rem;
}
.topline > div {
  min-width: 0;
}
.topline h2 {
  text-wrap: balance;
}
.alias-panel {
  min-height: 74px;
}
.alias-panel .button,
.topline .button {
  flex: 0 0 auto;
  min-width: 64px;
}
.miss-form {
  display: grid;
  justify-items: center;
  gap: 20px;
  margin-top: 22px;
}
.message-panel {
  width: 100%;
  padding: 16px 16px 12px;
  border: 1px solid #f0dfe4;
  border-radius: 20px;
  background: linear-gradient(145deg, #fffafb, #fff5f7);
}
.message-field {
  gap: 9px;
  margin: 0;
}
.message-field > span {
  color: #684f58;
  font-size: 0.9rem;
  font-weight: 750;
}
.message-field textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 0;
  border-radius: 14px;
  background: #fff;
  padding: 14px 15px;
  box-shadow: inset 0 0 0 1px rgba(225, 190, 199, 0.76);
  font: inherit;
  font-size: 1rem;
  line-height: 1.6;
}
.message-field textarea:focus {
  box-shadow:
    inset 0 0 0 1px #df718b,
    0 0 0 4px rgba(215, 68, 98, 0.09);
}
.message-hint {
  display: block;
  margin-top: 8px;
  color: #a48a92;
  font-size: 0.76rem;
  text-align: right;
}
.miss-form .heart-button {
  margin: 0;
}
.today-counts {
  display: grid;
  justify-items: center;
  gap: 7px;
  margin: 22px 0 8px;
  padding: 16px;
  border-radius: 20px;
  background: #fff6f8;
  color: #684f58;
}
.count-line {
  font-size: 1rem;
  line-height: 1.5;
}
.count-value {
  margin-left: 4px;
  color: #d74462;
  font-size: 1.35rem;
  font-weight: 800;
}
.counts-heart {
  color: #ea6c86;
  font-size: 0.9rem;
  line-height: 1;
}

@media (max-width: 600px) {
  body {
    background:
      radial-gradient(
        circle at 50% -8%,
        rgba(255, 214, 224, 0.9),
        transparent 34%
      ),
      linear-gradient(180deg, #fff9fa 0%, #fff4f6 100%);
  }
  .app-shell {
    width: 100%;
    min-height: 100dvh;
    padding: max(20px, env(safe-area-inset-top)) 16px
      max(24px, env(safe-area-inset-bottom));
  }
  .brand {
    margin: 8px 0 22px;
    text-align: center;
  }
  .brand h1 {
    font-size: 1.65rem;
    letter-spacing: -0.03em;
  }
  .brand p {
    margin-top: 5px;
    font-size: 0.86rem;
  }
  .card {
    border-radius: 24px;
    padding: 24px 20px;
    box-shadow: 0 18px 50px rgba(111, 55, 70, 0.1);
  }
  .login-card {
    padding: 30px 22px 24px;
  }
  .login-intro {
    margin-bottom: 24px;
  }
  .login-form {
    gap: 16px;
  }
  .login-form input:not([type="checkbox"]) {
    min-height: 50px;
    border-radius: 14px;
  }
  .topline {
    align-items: flex-start;
    gap: 12px;
  }
  .topline h2 {
    margin-top: 5px;
    font-size: clamp(1.35rem, 6.3vw, 1.65rem);
    line-height: 1.25;
  }
  .topline .button {
    min-width: 58px;
    min-height: 40px;
    padding: 8px 12px;
  }
  .alias-panel {
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    padding: 13px 14px;
    border-radius: 17px;
  }
  .alias-panel .button {
    min-width: 58px;
    min-height: 40px;
    padding: 8px 12px;
  }
  #logout {
    min-width: 0;
  }
  .today-counts {
    gap: 5px;
    margin-top: 18px;
    padding: 13px 10px;
  }
  .count-line {
    font-size: 0.9rem;
  }
  .count-value {
    font-size: 1.2rem;
  }
  .message-panel {
    padding: 14px 14px 11px;
    border-radius: 18px;
  }
  .message-field textarea {
    min-height: 144px;
  }
  .heart-button {
    width: 126px;
    height: 126px;
  }
  .history {
    margin-top: 30px;
    padding-top: 24px;
  }
  .history-head {
    gap: 14px;
  }
  .history-head h3 {
    margin: 0;
  }
  .filters {
    padding: 3px;
    border-radius: 13px;
  }
  .filter {
    min-height: 40px;
    padding: 8px 11px;
    border-radius: 10px;
  }
  .history-item {
    padding: 14px;
    border-radius: 16px;
  }
  .pagination .button {
    min-height: 40px;
    padding-inline: 12px;
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding-inline: 12px;
  }
  .brand {
    margin-bottom: 18px;
  }
  .card {
    padding: 22px 17px;
    border-radius: 22px;
  }
  .login-card {
    padding: 27px 19px 22px;
  }
  .login-intro h2 {
    font-size: 1.7rem;
  }
  .login-intro .sub {
    font-size: 0.91rem;
  }
  .topline h2 {
    font-size: 1.38rem;
  }
  .alias-panel {
    padding-inline: 12px;
  }
  .today-counts {
    padding-inline: 7px;
  }
  .message-field textarea {
    min-height: 150px;
  }
  .history-head {
    align-items: stretch;
  }
  .filters {
    width: 100%;
  }
  .filter {
    flex: 1;
  }
  .pagination {
    justify-content: space-between;
  }
}
