:root {
  color-scheme: light;
  --bg: #f8f2ea;
  --bg-accent: #f4e5da;
  --surface: #ffffff;
  --surface-soft: #fff9f3;
  --text: #4c3d35;
  --muted: #8a7c73;
  --primary: #f2b8a0;
  --primary-strong: #ec9f83;
  --secondary: #f7d7c5;
  --stroke: #efd7c9;
  --shadow: 0 14px 32px rgba(77, 60, 50, 0.1);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max-width: 420px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #fdf6ef 0%, var(--bg) 55%, #f1e5dc 100%);
  min-height: 100vh;
}

.app {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px calc(26px + env(safe-area-inset-bottom));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app--home {
  justify-content: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__logo {
  width: 46px;
  height: 46px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--secondary);
  color: #7c5443;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.brand__text h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

.brand__text p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.app__main {
  display: flex;
}

.app--home .app__main {
  flex: 0;
}

.app:not(.app--home) .app__main {
  flex: 1;
}

.view {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.35s ease;
}

.view--active {
  display: flex;
  width: 100%;
}

.view--center {
  justify-content: center;
}

.app:not(.app--home) .view--active {
  flex: 1;
}

#draw.view--active {
  justify-content: center;
  padding-top: 40px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.card--hero {
  background: linear-gradient(180deg, #fffaf6 0%, var(--surface) 100%);
}

.card--task {
  text-align: center;
  padding: 26px 22px 32px;
  border: 1px solid var(--stroke);
  position: relative;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
}

.card--task.is-stopped {
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(76, 61, 53, 0.14);
}

.task__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 600;
}

.task__desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 400;
  color: var(--text);
}

.task__note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.hero__mini {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
}

.mini-block {
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid rgba(239, 214, 200, 0.6);
  font-size: 13px;
}

.mini-block--button {
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mini-block--button:active {
  transform: scale(0.98);
}

.mini-block__label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mini-block__value {
  display: block;
  margin-top: 6px;
  font-weight: 600;
}

.progress {
  width: 100%;
  height: 12px;
  background: #f3e6dc;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.progress__bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-strong) 100%);
  width: 0;
  transition: width 0.4s ease;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  margin: 6px 0 10px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  min-height: 48px;
}

.btn--center {
  margin: 16px auto 0;
  display: block;
  width: 100%;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--primary);
  color: #623a2c;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(236, 159, 131, 0.35);
}

.btn--secondary {
  background: #f5e7de;
  color: #70493a;
  border: 1px solid rgba(236, 159, 131, 0.2);
}

.btn--ghost {
  background: #fff;
  color: #6b4c3c;
  border: 1px solid var(--stroke);
}

.btn--link {
  background: transparent;
  color: #8a6a5a;
  text-decoration: underline;
  min-height: auto;
  padding: 6px 4px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.tip {
  margin: 4px 2px 0;
  font-size: 12px;
  color: var(--muted);
}

.draw__foot {
  position: static !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: 100%;
  padding: 0;
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

#draw.view--active {
  display: flex !important;
  flex-direction: column;
  gap: 20px;
  justify-content: flex-start !important;
  align-items: stretch;
  min-height: 0;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.list li {
  background: var(--surface);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  display: flex;
  gap: 12px;
  font-size: 14px;
  align-items: flex-start;
}

.list__empty {
  justify-content: center;
  background: transparent;
  border: 1px dashed var(--stroke);
  color: var(--muted);
}

.list__id {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

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

.list__note {
  font-size: 12px;
  color: var(--muted);
}

.completed__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card--list {
  padding: 16px;
}

.card__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

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

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

.card__subtitle .muted {
  margin: 6px 0 0;
}

.btn--inline {
  min-height: auto;
  padding: 6px 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(76, 61, 53, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

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

@media (min-width: 680px) {
  .app {
    padding: 32px 24px 40px;
  }
}
.app--home #home {
  gap: 12px;
}
