/* =========================================================
   打卡、任务、商城
   ========================================================= */
.tasks-view,
.shop-view {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding-top: 2px;
}

.tasks-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.tasks-heading h1 {
  margin-top: 8px;
  color: #473226;
  font-family: var(--serif);
  font-size: clamp(38px, 4.2vw, 55px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.18;
}

.coin-chip {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 14px 6px 8px;
  border: 1px solid rgba(208, 166, 128, .55);
  border-radius: 999px;
  background: rgba(255, 251, 243, .65);
  box-shadow: 0 8px 17px -14px rgba(125, 77, 46, .4);
  transform: rotate(-.4deg);
}

.coin-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: #f8e3b8;
  color: #b37c3f;
}

.coin-icon svg {
  width: 19px;
  height: 19px;
}

.coin-chip > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.coin-chip small {
  color: #a58b76;
  font-family: var(--hand);
  font-size: 9px;
  letter-spacing: .05em;
}

.coin-chip b {
  color: #98633b;
  font-family: "Trebuchet MS", var(--sans);
  font-size: 17px;
  letter-spacing: .03em;
}

.tasks-layout {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  align-items: start;
  gap: 18px;
  margin-top: 22px;
}

.checkin-panel,
.task-panel,
.shop-panel {
  position: relative;
  border: 1px solid rgba(201, 162, 128, .48);
  border-radius: 25px 29px 23px 27px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 255, 255, .58), rgba(255, 255, 255, 0) 46%),
    linear-gradient(180deg, #fffaf1, #fbf0df);
  box-shadow:
    0 22px 38px -34px rgba(126, 79, 47, .45),
    inset 0 1px 0 rgba(255, 255, 255, .7);
}

.checkin-panel,
.task-panel {
  padding: 24px 25px 22px;
}

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

.panel-head h2 {
  color: #503729;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.panel-sub {
  margin-top: 7px;
  color: #9d806c;
  font-family: var(--hand);
  font-size: 10.5px;
  line-height: 1.7;
}

.checkin-btn,
.panel-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(188, 108, 65, .32);
  border-radius: 999px;
  background: linear-gradient(180deg, #e9a37a, #da8b62);
  color: #fff9ef;
  font-family: var(--hand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 8px 15px -13px rgba(151, 78, 42, .65);
  transition: transform .2s, filter .2s, opacity .2s;
}

.checkin-btn:hover,
.panel-action:hover {
  filter: saturate(1.04);
  transform: translateY(-1px);
}

.checkin-btn:disabled {
  cursor: default;
  opacity: .55;
  transform: none;
}

.panel-action svg {
  width: 13px;
  height: 13px;
}

.checkin-goal {
  margin-top: 14px;
  color: #806552;
  font-family: var(--hand);
  font-size: 12px;
  letter-spacing: .01em;
}

.checkin-goal b {
  color: #c47f54;
  font-weight: 700;
}

.streak-pill {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f7e2cd;
  color: #ac704b;
  font-size: 9.5px;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
}

.calendar-head b {
  color: #705544;
  font-family: var(--hand);
  font-size: 14px;
  letter-spacing: .05em;
}

.calendar-arrow {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(198, 162, 131, .35);
  border-radius: 50%;
  color: #a58772;
  background: rgba(255, 251, 243, .5);
}

.calendar-arrow svg {
  width: 11px;
  height: 11px;
}

.calendar-arrow:first-child svg {
  transform: rotate(180deg);
}

.calendar-weekdays,
.checkin-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.calendar-weekdays {
  margin-top: 12px;
  color: #a68a75;
  font-family: var(--hand);
  font-size: 10.5px;
  text-align: center;
}

.checkin-calendar {
  margin-top: 5px;
}

.calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1.05;
  min-height: 35px;
  border: 1px solid rgba(224, 201, 177, .45);
  border-radius: 9px;
  background: rgba(255, 252, 246, .45);
  color: #7e6452;
  font-family: var(--hand);
  font-size: 13px;
  transition: background .2s, border-color .2s, transform .2s;
}

.calendar-day.is-blank {
  border-color: transparent;
  background: transparent;
}

.calendar-day.is-checked {
  border-color: rgba(222, 168, 125, .55);
  background: linear-gradient(145deg, #f8d9bd, #f3c39d);
  color: #8e5939;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}

.calendar-day.is-checked::after {
  content: "✓";
  position: absolute;
  right: 4px;
  bottom: 1px;
  color: rgba(174, 101, 61, .62);
  font-family: var(--sans);
  font-size: 8px;
}

.calendar-day.is-today {
  border-color: #d9865f;
  box-shadow: 0 0 0 2px rgba(217, 134, 95, .13);
}

.calendar-day.is-future {
  color: #c2ae9d;
  background: rgba(255, 252, 246, .2);
}

.calendar-day .paw-mark {
  position: absolute;
  right: 3px;
  bottom: 0;
  color: rgba(182, 125, 82, .26);
  font-size: 10px;
}

.checkin-reward {
  margin-top: 12px;
  color: #ae927e;
  font-family: var(--hand);
  font-size: 9.5px;
  line-height: 1.6;
}

.checkin-reward span {
  color: #dca080;
  margin-right: 3px;
}

.currency-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 11px;
}

.currency-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border: 1px solid rgba(207, 169, 135, .38);
  border-radius: 999px;
  background: rgba(255, 250, 242, .6);
  color: #8d705b;
  font-family: var(--hand);
  font-size: 9.5px;
}

.currency-chip b {
  color: #bb7651;
  font-family: var(--sans);
  font-size: 10px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 12px;
}

.task-card {
  padding: 13px 13px 12px;
  border: 1px solid rgba(213, 181, 150, .5);
  border-radius: 14px 17px 13px 16px;
  background: rgba(255, 251, 244, .65);
  transition: border-color .2s, background .2s;
}

.task-card.is-done {
  background: rgba(247, 237, 224, .42);
  opacity: .78;
}

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

.task-card-title {
  color: #5b4132;
  font-family: var(--hand);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.task-card.is-done .task-card-title {
  text-decoration: line-through;
  text-decoration-color: rgba(161, 124, 94, .45);
}

.task-card-desc {
  margin-top: 3px;
  color: #9b7e69;
  font-family: var(--hand);
  font-size: 10px;
  line-height: 1.6;
}

.task-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  color: #b09682;
  font-family: var(--hand);
  font-size: 9px;
}

.task-reward {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f8e7d2;
  color: #af6f48;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
}

.task-reward svg {
  width: 11px;
  height: 11px;
}

.task-card-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}

.task-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #a18470;
  font-family: var(--hand);
  font-size: 9px;
}

.task-status.is-pending {
  color: #b57651;
}

.task-done-btn {
  margin-left: auto;
  min-height: 29px;
  padding: 0 11px;
  border: 1px solid rgba(190, 110, 66, .32);
  border-radius: 999px;
  background: #fff9ef;
  color: #b56f49;
  font-family: var(--hand);
  font-size: 10px;
  font-weight: 700;
}

.task-done-btn:hover {
  background: #fbe7d5;
}

.task-done-btn:disabled {
  opacity: .55;
  cursor: default;
}

.task-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 18px;
  padding: 22px 12px;
  border: 1px dashed rgba(198, 159, 124, .4);
  border-radius: 16px;
  background: rgba(255, 251, 243, .3);
  text-align: center;
}

.task-empty .empty-letter-icon {
  width: 38px;
  height: 38px;
}

.task-empty .empty-letter-icon svg {
  width: 18px;
  height: 18px;
}

.task-empty h3 {
  margin-top: 7px;
  color: #765946;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.task-empty p {
  margin-top: 2px;
  color: #a68a76;
  font-family: var(--hand);
  font-size: 10px;
}

/* 商城 */
.shop-tabs {
  display: flex;
  gap: 5px;
  width: max-content;
  margin-top: 22px;
  padding: 4px;
  border: 1px solid rgba(204, 166, 132, .38);
  border-radius: 999px;
  background: rgba(255, 251, 243, .4);
}

.shop-tab {
  min-height: 31px;
  padding: 0 15px;
  border-radius: 999px;
  color: #a08571;
  font-family: var(--hand);
  font-size: 11px;
  transition: background .2s, color .2s;
}

.shop-tab.is-active {
  background: #e8a077;
  color: #fff9ef;
  box-shadow: 0 5px 11px -10px rgba(151, 78, 42, .6);
}

.shop-panel {
  margin-top: 15px;
  padding: 23px 25px 25px;
}

.shop-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.shop-panel-head h2 {
  color: #51382a;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
}

.shop-panel-head p {
  margin-top: 5px;
  color: #9d806c;
  font-family: var(--hand);
  font-size: 10.5px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 166px;
  padding: 14px 15px 13px;
  border: 1px solid rgba(211, 177, 143, .48);
  border-radius: 16px 19px 15px 18px;
  background:
    radial-gradient(ellipse at 16% 0%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 50%),
    #fffaf2;
  box-shadow: 0 10px 20px -19px rgba(125, 77, 46, .45);
}

.shop-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 7px;
}

.shop-card-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f7e2c8;
  color: #b77a4e;
}

.shop-card-icon svg {
  width: 18px;
  height: 18px;
}

.shop-kind {
  padding: 2px 7px;
  border-radius: 999px;
  background: #f5e1d2;
  color: #ac7554;
  font-family: var(--hand);
  font-size: 8.5px;
}

.shop-kind.real {
  background: #e5eddf;
  color: #718862;
}

.shop-card h3 {
  margin-top: 10px;
  color: #5b4132;
  font-family: var(--hand);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.shop-card-media {
  position: relative;
  display: grid;
  place-items: center;
  height: 108px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(226, 201, 175, .4);
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255, 252, 245, .95), rgba(250, 239, 224, .65));
}

.shop-card-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-card-media.custom img {
  object-fit: cover;
}

.shop-card-media .shop-card-icon {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: transparent;
}

.shop-card-media .shop-card-icon svg {
  width: 30px;
  height: 30px;
}

.shop-card-desc {
  margin-top: 3px;
  color: #a08470;
  font-family: var(--hand);
  font-size: 9.5px;
  line-height: 1.55;
}

.shop-card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

.shop-price {
  color: #aa6c46;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
}

.shop-price small {
  margin-left: 2px;
  color: #ad907a;
  font-family: var(--hand);
  font-size: 8.5px;
  font-weight: 400;
}

.shop-buy-btn {
  min-height: 29px;
  padding: 0 11px;
  border: 1px solid rgba(190, 110, 66, .32);
  border-radius: 999px;
  background: #fff9ef;
  color: #b56f49;
  font-family: var(--hand);
  font-size: 10px;
  font-weight: 700;
}

.shop-buy-btn:hover {
  background: #fbe7d5;
}

.shop-buy-btn:disabled {
  cursor: default;
  opacity: .45;
}

.shop-seller {
  margin-top: 7px;
  color: #b19884;
  font-family: var(--hand);
  font-size: 8.5px;
}

.shop-empty {
  grid-column: 1 / -1;
  padding: 30px 15px;
  border: 1px dashed rgba(198, 159, 124, .4);
  border-radius: 16px;
  color: #a68a76;
  font-family: var(--hand);
  font-size: 11px;
  text-align: center;
}

/* 任务 / 商品弹窗 */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(63, 41, 29, .3);
  backdrop-filter: blur(6px);
  animation: modal-fade .22s ease both;
}

.sheet-backdrop[hidden] {
  display: none;
}

.sheet-modal {
  position: relative;
  width: min(520px, 100%);
  max-height: min(90vh, 760px);
  overflow: auto;
  padding: 30px 31px 24px;
  border: 1px solid rgba(204, 164, 128, .6);
  border-radius: 26px 30px 24px 28px;
  background: linear-gradient(180deg, #fffcf5, #fdf4e7);
  box-shadow: 0 30px 60px -30px rgba(75, 44, 27, .45);
  animation: modal-in .32s var(--ease) both;
}

.sheet-modal h2 {
  margin-top: 8px;
  color: #4f3829;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -.035em;
}

.sheet-modal .modal-copy {
  margin-top: 5px;
  color: #9c806c;
  font-family: var(--hand);
  font-size: 11px;
  line-height: 1.6;
}

.sheet-modal .modal-label {
  margin-top: 13px;
}

.modal-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #a78369 50%), linear-gradient(135deg, #a78369 50%, transparent 50%);
  background-position: calc(100% - 16px) 20px, calc(100% - 11px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.modal-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-inline > div {
  min-width: 0;
}

.field-hint {
  margin-top: 5px;
  color: #b09682;
  font-family: var(--hand);
  font-size: 9px;
  line-height: 1.5;
}

.shop-image-picker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
}

.shop-image-pick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px dashed rgba(195, 150, 112, .6);
  border-radius: 999px;
  background: rgba(255, 251, 243, .7);
  color: #a4775a;
  font-family: var(--hand);
  font-size: 10px;
}

.shop-image-pick svg {
  width: 14px;
  height: 14px;
}

.shop-image-pick:hover {
  border-color: #c27e57;
  background: #fff9ef;
}

.shop-image-hint {
  color: #b29a86;
  font-family: var(--hand);
  font-size: 8.5px;
}

.shop-image-preview {
  position: relative;
  width: 112px;
  height: 88px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(204, 165, 132, .55);
  border-radius: 10px;
  background: #fffaf2;
}

.shop-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-currency-field input:disabled {
  background: #fbf0e2;
  color: #a98c75;
}

/* 响应式 */
@media (max-width: 960px) {
  .tasks-layout {
    grid-template-columns: 1fr;
  }

  .task-panel {
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .tasks-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .tasks-heading h1 {
    font-size: 38px;
  }

  .coin-chip {
    align-self: flex-end;
    min-height: 40px;
  }

  .tasks-layout {
    margin-top: 14px;
    gap: 12px;
  }

  .checkin-panel,
  .task-panel,
  .shop-panel {
    padding: 19px 16px;
    border-radius: 20px 23px 19px 22px;
  }

  .panel-head h2 {
    font-size: 24px;
  }

  .panel-head {
    gap: 7px;
  }

  .checkin-btn,
  .panel-action {
    min-height: 31px;
    padding: 0 9px;
    font-size: 9.5px;
  }

  .calendar-day {
    min-height: 31px;
    font-size: 12px;
  }

  .shop-tabs {
    width: 100%;
    margin-top: 15px;
  }

  .shop-tab {
    flex: 1;
    padding: 0 8px;
    font-size: 10px;
  }

  .shop-panel-head {
    flex-direction: column;
    gap: 9px;
  }

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

  .shop-card {
    min-height: 155px;
    padding: 11px;
  }

  .shop-card h3 {
    font-size: 13px;
  }

  .shop-card-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .shop-buy-btn {
    width: 100%;
  }

  .sheet-modal {
    padding: 25px 18px 20px;
    border-radius: 22px 25px 20px 23px;
  }

  .sheet-modal h2 {
    font-size: 27px;
  }

  .modal-inline {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
