:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0c1136;
  color: #0b1728;
  --g1: #5533ff;
  --g2: #00aaff;
  --g3: #33ccff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #0c1136;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #0c1136;
  pointer-events: none;
}

.bg-gradient::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(85, 100, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(85, 100, 255, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
}

.bg-gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(80, 60, 255, 0.28) 0%, transparent 60%),
    radial-gradient(ellipse 55% 40% at 85% 15%, rgba(0, 160, 255, 0.2) 0%, transparent 55%),
    radial-gradient(ellipse 60% 35% at 50% 90%, rgba(60, 80, 255, 0.14) 0%, transparent 50%);
}

button,
input,
select {
  font: inherit;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 16px 12px 30px;
}

.view {
  display: grid;
  gap: 11px;
}

#loginView {
  min-height: calc(100vh - 46px);
  align-content: center;
}

.hidden {
  display: none !important;
}

.view:not(.hidden),
.panel:not(.hidden),
.message:not(.hidden) {
  animation: viewIn 0.28s ease;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loadingView {
  display: grid;
  place-items: center;
  min-height: 40vh;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 12px);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(10, 20, 40, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: rgba(120, 20, 20, 0.92);
}

.brand,
.topbar {
  padding: 14px 2px 2px;
  color: #fff;
}

#loginView .brand,
#loginView .panel {
  width: 100%;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.topbarActions {
  display: flex;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: 0;
  text-shadow: 0 1px 14px rgba(0, 166, 255, 0.25);
}

h1 span {
  font-variant-numeric: tabular-nums;
}

h2 {
  margin-bottom: 0;
  color: #081b32;
  font-size: 17px;
  font-weight: 820;
}

.hint,
.hello,
.soft,
.notice {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.panel,
.block,
.recent,
.message {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(18, 64, 120, 0.12);
  border-radius: 5px;
  box-shadow: 0 10px 26px rgba(2, 16, 38, 0.14);
}

.panel,
.block,
.recent,
.message {
  padding: 12px;
}

.compactBlock {
  padding: 10px;
}

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

label {
  color: #1a3150;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #b8c7d8;
  border-radius: 4px;
  background: #fbfdff;
  color: #0b1728;
  padding: 0 8px;
  outline: none;
}

input:focus,
select:focus {
  border-color: #008cff;
  box-shadow: 0 0 0 2px rgba(0, 140, 255, 0.22);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.34) 0%, transparent 28%),
    linear-gradient(135deg, #00a3ff 0%, #006ee8 48%, #003e97 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 8px 20px rgba(0, 88, 190, 0.28);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

button:active:not(:disabled) {
  transform: scale(0.96);
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.ghost {
  min-height: 32px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: none;
}

.message {
  background: #fff7df;
  border-color: #ead28b;
  color: #6d561c;
  line-height: 1.5;
}

.blockTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.drinkGrid {
  display: grid;
  grid-template-columns: 62px 1fr 1fr;
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.drinkHead {
  min-height: 24px;
  display: grid;
  place-items: center;
  color: #0b1728;
  font-size: 13px;
  font-weight: 800;
  border-right: 1px solid #d7e1ec;
  border-bottom: 1px solid #d7e1ec;
  background: transparent;
}

.drinkHead:nth-child(3) {
  border-right: 0;
}

.drinkDate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 50px;
  border-radius: 0;
  background: transparent;
  color: #0c2445;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
  border-right: 1px solid #d7e1ec;
  border-bottom: 1px solid #d7e1ec;
}

.drinkCell {
  min-height: 50px;
  display: grid;
  align-items: center;
  padding: 5px;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-right: 1px solid #d7e1ec;
  border-bottom: 1px solid #d7e1ec;
}

.drinkCell:nth-child(3n) {
  border-right: 0;
}

.drinkDate:nth-last-child(-n + 3),
.drinkCell:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.drinkCell.selected {
  background: linear-gradient(180deg, rgba(224, 242, 255, 0.85) 0%, rgba(179, 222, 255, 0.32) 100%);
  box-shadow: inset 3px 0 0 #008cff;
}

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

.choiceRow {
  border-radius: 4px;
  background: #f8fbff;
  border: 1px solid #d2deeb;
}

.choiceRow.selected {
  border-color: #008cff;
  background: linear-gradient(180deg, #f2f9ff 0%, #e5f2ff 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 140, 255, 0.28);
}

.rowLabel {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #132b49;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.weekdayBadge {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 3px;
  background: linear-gradient(135deg, #00b7ff 0%, #006ee8 58%, #003e97 100%);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.weekdayBadge.sun {
  background: linear-gradient(135deg, #ff9f43 0%, #e8720b 58%, #973e00 100%);
}

.travelRow {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.travelHead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.travelLocation {
  flex: 0 0 92px;
  min-width: 0;
}

.reasonTrigger {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 10px;
  border-radius: 4px;
  background: #fbfdff;
  border: 1px solid #b8c7d8;
  color: #0b1728;
  text-align: left;
  box-shadow: none;
}

.reasonTrigger.placeholder {
  color: #92a1b5;
}

.reasonTriggerText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reasonTriggerIcon {
  flex-shrink: 0;
  color: #6f83a0;
  font-size: 12px;
  line-height: 1;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  visibility: hidden;
  pointer-events: none;
}

.sheet.open {
  visibility: visible;
  pointer-events: auto;
}

.sheetBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 14, 28, 0.42);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.sheet.open .sheetBackdrop {
  opacity: 1;
}

.sheetPanel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 14px 14px 0 0;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 30px rgba(2, 16, 38, 0.28);
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
}

.sheet.open .sheetPanel {
  transform: translateY(0);
}

.sheetHeader {
  text-align: left;
  padding: 4px 2px 10px;
}

.sheetDay {
  font-size: 15px;
  font-weight: 800;
  color: #0c2445;
}

.sheetSummary {
  margin-top: 3px;
  font-size: 13px;
  color: #61748d;
}

.sheetOptions {
  display: grid;
  gap: 6px;
}

.sheetPresetRow {
  display: flex;
  gap: 6px;
}

.sheetPresetRow .sheetOption {
  flex: 1;
  min-width: 0;
}

.sheetOtherRow {
  display: flex;
  gap: 6px;
}

.sheetOtherRow .sheetOption {
  flex: 1;
  min-width: 0;
  transition: flex-basis 0.16s ease;
}

.sheetOtherRow.expanded .sheetOption {
  flex: 0 0 auto;
  min-width: 56px;
}

.sheetOtherInput {
  flex: 1;
  min-width: 0;
  display: none;
}

.sheetOtherRow.expanded .sheetOtherInput {
  display: block;
}

.sheetOtherConfirm {
  flex: 0 0 auto;
  min-height: 46px;
  min-width: 46px;
  padding: 0 14px;
  display: none;
}

.sheetOtherRow.expanded .sheetOtherConfirm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sheetOption {
  min-height: 46px;
  border-radius: 8px;
  background: #f3f7fb;
  color: #132b49;
  font-weight: 700;
  border: 1px solid #e1e8f0;
  box-shadow: none;
}

.sheetOption.active {
  background: linear-gradient(180deg, #eaf5ff 0%, #cbe7ff 100%);
  border-color: #008cff;
  color: #04407c;
}

.sheetOption.clear {
  color: #8b9aad;
  font-weight: 600;
  background: transparent;
  border-style: dashed;
}

.sheetCancel {
  width: 100%;
  margin-top: 8px;
  background: #eef2f7;
  color: #4a5b72;
  box-shadow: none;
}

.drinkChoices {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.drinkOption {
  min-height: 30px;
  min-width: 42px;
  padding: 0 6px;
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
  color: #8b9aad;
  border: 1px solid #c7cfda;
  font-size: 13px;
  font-weight: 500;
}

.drinkOption.active {
  min-width: 58px;
  background: linear-gradient(180deg, #eaf5ff 0%, #cbe7ff 100%);
  color: #04407c;
  border-color: #008cff;
  font-weight: 850;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 0 0 1px rgba(0, 140, 255, 0.28),
    0 4px 10px rgba(0, 106, 209, 0.16);
}

.noteBlock input {
  min-height: 40px;
  box-shadow: 0 6px 16px rgba(8, 35, 70, 0.08);
}

.save {
  width: 100%;
  min-height: 48px;
  position: sticky;
  bottom: 12px;
  z-index: 4;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.34) 0%, transparent 30%),
    linear-gradient(135deg, #00b7ff 0%, #0075ff 44%, #003e97 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 12px 26px rgba(0, 86, 190, 0.34);
}

.recentHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.recentHeader h2 {
  margin-bottom: 0;
}

.withdrawBtn {
  min-height: 30px;
  padding: 0 12px;
  background: transparent;
  color: #b3261e;
  border: 1px solid #e4b8b4;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
}

.records {
  display: grid;
  gap: 4px;
}

.recordLine {
  color: #203b5d;
  font-size: 14px;
  line-height: 1.55;
}

.soft {
  margin-bottom: 0;
  color: #61748d;
  font-size: 13px;
}

.ghostDark {
  min-height: 34px;
  padding: 0 12px;
  background: #eef2f7;
  color: #24344c;
  border: 1px solid #ccd7e4;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
}

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

.lockStatusText {
  color: #24344c;
  font-weight: 700;
  font-size: 14px;
}

.lockToggle.locked {
  background: #fdeceb;
  color: #b3261e;
  border-color: #f0c4c0;
}

.lockDeadlineRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.lockDeadlineRow label {
  font-size: 13px;
  flex-shrink: 0;
}

.lockDeadlineRow input {
  flex: 1;
  min-width: 160px;
}

.lockDeadlineRow button {
  flex-shrink: 0;
  min-height: 34px;
  font-size: 13px;
}

details.block {
  padding: 0;
}

details.block summary {
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

details.block summary::-webkit-details-marker {
  display: none;
}

details.block summary .blockTitle {
  margin-bottom: 0;
}

details.block .blockBody {
  padding: 0 12px 12px;
}

.qrBlock {
  text-align: center;
}

.qrHeaderActions {
  display: flex;
  gap: 6px;
}

.qrHeaderActions button {
  min-height: 30px;
  font-size: 13px;
}

.qrGenerateWrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 31vh;
  transition: min-height 0.2s ease;
}

.qrGenerateWrap.compact {
  min-height: 0;
  padding: 6px 0;
}

.qrGenerateBtn {
  display: block;
  margin: 0 auto;
  min-width: 220px;
  min-height: 56px;
  font-size: 16px;
}

.qrImageWrapLarge svg {
  max-width: 320px;
}

.qrTextActions {
  display: flex;
  gap: 8px;
}

.qrTextActions button {
  flex: 1;
}

.qrResult {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.qrImageWrap {
  display: grid;
  place-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid #e1e8f0;
  border-radius: 8px;
}

.qrImageWrap svg {
  width: 100%;
  height: auto;
  max-width: 260px;
  display: block;
}

.qrTextWrap {
  display: grid;
  gap: 8px;
}

.qrTextArea {
  min-height: 72px;
  padding: 8px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.pendingList,
.overviewList {
  display: grid;
  gap: 8px;
}

.pendingItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e1e8f0;
  border-radius: 6px;
  background: #f8fbff;
}

.pendingInfo {
  color: #132b49;
  font-weight: 650;
  font-size: 14px;
}

.pendingActions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.pendingActions button {
  min-height: 30px;
}

.overviewPerson {
  padding: 10px;
  border: 1px solid #e1e8f0;
  border-radius: 6px;
  background: #f8fbff;
}

.overviewHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #0c2445;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 4px;
}

.overviewPerson.otherFocused {
  opacity: 0.7;
}

.overviewDivider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  color: #92a1b5;
  font-size: 12px;
}

.overviewDivider::before,
.overviewDivider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d7e1ec;
}

.focusHeart {
  min-height: 26px;
  min-width: 26px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  line-height: 1;
  color: #c9536a;
}

.focusHeart.active {
  color: #e0396c;
}

.copyDropdownWrap {
  position: relative;
}

.copyDropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  background: #fff;
  border: 1px solid #e1e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(2, 16, 38, 0.18);
  overflow: hidden;
  z-index: 20;
}

.copyDropdown button {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 0;
  background: #fff;
  color: #132b49;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  box-shadow: none;
  border-bottom: 1px solid #eef2f7;
}

.copyDropdown button:last-child {
  border-bottom: 0;
}

.passwordForm {
  display: grid;
  gap: 8px;
}

.passwordForm input {
  min-height: 36px;
}

.revealPhoneList {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.revealPhoneChip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: #eef2f7;
  border: 1px solid #ccd7e4;
  color: #24344c;
  font-size: 13px;
  font-weight: 650;
}

.revealPhoneChip button {
  min-height: 20px;
  min-width: 20px;
  padding: 0;
  border-radius: 50%;
  background: rgba(179, 38, 30, 0.12);
  color: #b3261e;
  font-size: 13px;
  line-height: 1;
  box-shadow: none;
}

.revealPhoneAdd {
  display: flex;
  gap: 8px;
}

.revealPhoneAdd input {
  flex: 1;
  min-width: 0;
}

@media (max-width: 370px) {
  .shell {
    padding-inline: 10px;
  }

  h1 {
    font-size: 24px;
  }

  .drinkGrid {
    grid-template-columns: 58px 1fr 1fr;
  }

  .travelRow {
    gap: 6px;
  }

  input,
  select,
  .drinkOption,
  .reasonTrigger {
    padding-inline: 5px;
    font-size: 13px;
  }
}
