:root {
  --bg: #f7f0df;
  --paper: #fffaf0;
  --panel: #ffffff;
  --ink: #2f2b25;
  --muted: #766f63;
  --line: #eadfc9;
  --primary: #d67843;
  --primary-dark: #b95d2d;
  --mint: #97c9a8;
  --blue: #8bb8d8;
  --yellow: #f2c763;
  --danger: #cb6b5c;
  --shadow: 0 14px 34px rgba(70, 49, 21, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(242, 199, 99, 0.22), transparent 30%),
    linear-gradient(135deg, #fbf4e4 0%, #f4ecd9 52%, #eef3ec 100%);
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 44px;
}

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

.brand-button,
.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-button {
  color: var(--ink);
  background: transparent;
  font-size: 1.22rem;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topnav {
  padding: 6px;
  border: 1px solid rgba(234, 223, 201, 0.8);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.82);
}

.topnav button {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.topnav button:hover,
.topnav button.active {
  color: var(--ink);
  background: #fff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: stretch;
}

.hero-card,
.card {
  border: 1px solid rgba(234, 223, 201, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.92);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 32px;
  min-height: 420px;
}

.hero-card::after {
  content: "打卡";
  position: absolute;
  right: 24px;
  bottom: -10px;
  color: rgba(214, 120, 67, 0.08);
  font-size: 8rem;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary-dark);
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  max-width: 720px;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

h3 {
  font-size: 1.1rem;
}

.lead {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(70, 49, 21, 0.08);
}

.btn.primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.soft {
  background: #f5ead7;
}

.btn.danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.btn.small {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.side-stack {
  display: grid;
  gap: 16px;
}

.card {
  padding: 20px;
}

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

.stat {
  min-height: 88px;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.35rem;
}

.desk {
  min-height: 210px;
  display: grid;
  align-content: end;
  gap: 14px;
  margin-top: 16px;
  padding: 22px;
  border-radius: 18px;
  background:
    linear-gradient(#fff8e8, #fff8e8) padding-box,
    repeating-linear-gradient(90deg, #e8d3b6 0 22px, #d7b991 22px 44px) border-box;
  border: 12px solid transparent;
}

.desk-surface {
  min-height: 58px;
  border-radius: 16px;
  background: linear-gradient(180deg, #d6a56f, #b9814d);
  box-shadow: inset 0 6px rgba(255, 255, 255, 0.15);
}

.decorations {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  min-height: 64px;
}

.decoration {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 1.9rem;
  box-shadow: 0 10px 16px rgba(70, 49, 21, 0.09);
}

.empty-desk {
  color: var(--muted);
  line-height: 1.6;
}

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

.page-head p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 18px;
}

.layout-two > *,
.card,
.task-section {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.form-grid,
.option-grid,
.shop-grid,
.record-list {
  display: grid;
  gap: 14px;
}

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

.option-card {
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  text-align: left;
}

.option-card.selected {
  border-color: var(--primary);
  background: #fff3df;
}

.option-card strong,
.shop-item strong {
  display: block;
}

.option-card span,
.shop-item p,
.task-meta,
.subtle {
  color: var(--muted);
  line-height: 1.6;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

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

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

.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(104px, 0.8fr) minmax(88px, 0.7fr) auto;
  gap: 12px;
  align-items: end;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.task-list,
.pay-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 14px;
}

.task-field,
.task-row input,
.task-row select {
  min-width: 0;
  width: 100%;
}

.task-row input,
.task-row select {
  font-size: 0.95rem;
}

.delete-task-btn {
  align-self: end;
  min-width: 64px;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  white-space: nowrap;
}

.task-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.work-task {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.work-task.done {
  background: #eef8ef;
  border-color: #c4e2c7;
}

.work-task.done .task-name {
  text-decoration: line-through;
}

.progress-wrap {
  margin-top: 14px;
}

.progress-bar {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #efe3cd;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--primary));
  transition: width 0.25s ease;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 700;
}

.pay-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.pay-row.total {
  border-bottom: 0;
  font-size: 1.35rem;
  font-weight: 900;
}

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

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

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

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

.record {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.record-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  max-width: min(520px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  color: #fff;
  background: rgba(47, 43, 37, 0.92);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

@media (max-width: 880px) {
  .hero-grid,
  .layout-two,
  .option-grid,
  .shop-grid {
    grid-template-columns: 1fr;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
  }

  .delete-task-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topnav {
    justify-content: space-between;
  }

  .topnav button {
    flex: 1;
    padding-inline: 10px;
  }

  .hero-card,
  .card {
    padding: 16px;
  }

  .hero-card {
    min-height: auto;
  }

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