* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: #f5f3ee; color: #23231f; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.5;
  -webkit-user-select: none; user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }
.hidden { display: none !important; }
.page {
  max-width: 480px; margin: 0 auto;
  padding: 0 16px 188px;
  padding-top: 12px;
  padding-top: var(--content-top, 12px);
  min-height: 100vh;
}
.head { padding: 8px 2px 10px; }
.head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: 1px; }
.sub { margin: 2px 0 0; color: #7a776d; font-size: 13px; }

.steps { display: flex; margin: 14px 0 4px; padding: 0; }
.steps span {
  flex: 1; text-align: center; font-size: 12px; color: #9a968b;
  padding: 6px 0 8px; border-bottom: 2px solid #e7e3d9; letter-spacing: .5px;
}
.steps span.on { color: #23231f; font-weight: 600; border-bottom-color: #23231f; }

.lead { margin: 8px 2px 12px; font-size: 15px; color: #3a3833; }
.mini { color: #9a968b; font-size: 12px; }
.mini.block { display: block; margin: 8px 2px; }
.center { text-align: center; }

.add { display: flex; background: #fff; border: 1px solid #e2ded3; border-radius: 12px; overflow: hidden; }
.add input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  padding: 12px 12px; outline: none; font-size: 15px;
}
.add-btn {
  flex: none; border: 0; background: #23231f; color: #fff;
  padding: 0 16px; font-weight: 600; font-size: 14px;
}
.add-btn:active { opacity: .85; }
.add-btn:disabled { opacity: .35; }

.chips { display: flex; flex-wrap: wrap; margin: 10px 0 4px; }
.chip {
  border: 1px solid #e2ded3; background: #fff; border-radius: 16px;
  padding: 5px 12px; margin: 0 6px 6px 0; font-size: 13px; color: #4a4841;
}
.chip.on { border-color: #3d6b5c; background: #3d6b5c; color: #fff; }
.chip:active { opacity: .8; }
.chip.used { opacity: .4; }
.presets { margin-top: 10px; }

.item-list { list-style: none; margin: 8px 0 0; padding: 0; }
.item-list li {
  display: flex; align-items: center; background: #fff;
  border-radius: 12px; padding: 10px 12px; margin: 0 0 8px;
}
.item-list .no {
  flex: none; width: 22px; color: #9a968b; font-variant-numeric: tabular-nums; font-size: 12px;
}
.item-list .txt { flex: 1; min-width: 0; font-size: 15px; word-break: break-all; }
.item-list .rm {
  flex: none; border: 0; background: transparent; color: #9a968b;
  padding: 4px 2px 4px 10px; font-size: 18px; line-height: 1;
}

.resume {
  background: #fff; border-radius: 12px; padding: 12px 14px; margin: 0 0 14px;
  border: 1px solid #e2ded3;
}
.resume p { margin: 0 0 8px; font-size: 13px; color: #4a4841; }
.resume .rowbtns { display: flex; }
.resume .rowbtns button {
  flex: 1; border: 1px solid #e2ded3; background: #f7f5f0;
  border-radius: 9px; padding: 8px 0; font-size: 13px; font-weight: 600;
}
.resume .rowbtns button:first-child { margin-right: 8px; }
.resume .rowbtns button.main { background: #23231f; color: #fff; border-color: #23231f; }

.ask-card {
  background: #fff; border-radius: 12px; padding: 14px 14px 10px; margin: 0 0 10px;
}
.ask-card .name { font-size: 16px; font-weight: 600; margin: 0 0 10px; word-break: break-all; }
.ask-card .q { font-size: 12px; color: #7a776d; margin: 8px 0 6px; }
.ask-card .chips { margin: 0; }
.ask-card.done { box-shadow: inset 3px 0 0 #3d6b5c; }

.stat {
  margin: 0 2px 10px; font-size: 13px; color: #4a4841; font-weight: 600;
}
.banner {
  background: #f4ece3; color: #8a4b2a; border-radius: 10px;
  padding: 8px 12px; margin: 0 0 10px; font-size: 13px;
}

.pile { margin: 0 0 14px; }
.pile-h {
  display: flex; align-items: baseline; margin: 0 2px 6px;
}
.pile-h .t { font-weight: 600; font-size: 15px; }
.pile-h .n { margin-left: 6px; color: #9a968b; font-size: 12px; font-variant-numeric: tabular-nums; }
.pile.drop .t { color: #8a5346; }
.pile.freeze .t { color: #6b5a3a; }
.pile.keep .t { color: #2f564a; }
.pile-empty { color: #b3afa3; font-size: 13px; padding: 10px 4px; }

.sort-item {
  background: #fff; border-radius: 12px; padding: 10px 12px 8px; margin: 0 0 8px;
}
.sort-item .name { font-size: 15px; font-weight: 600; margin: 0 0 8px; word-break: break-all; }
.sort-item.drop .name { color: #7a776d; text-decoration: line-through; font-weight: 400; }
.sort-piles { display: flex; }
.sort-piles button {
  flex: 1; border: 1px solid #e2ded3; background: #fff; color: #4a4841;
  padding: 6px 0; font-size: 13px;
}
.sort-piles button:first-child { border-radius: 9px 0 0 9px; }
.sort-piles button:last-child { border-radius: 0 9px 9px 0; }
.sort-piles button.mid { border-left: 0; border-right: 0; }
.sort-piles button.on-drop { background: #8a5346; border-color: #8a5346; color: #fff; font-weight: 600; }
.sort-piles button.on-freeze { background: #6b5a3a; border-color: #6b5a3a; color: #fff; font-weight: 600; }
.sort-piles button.on-keep { background: #2f564a; border-color: #2f564a; color: #fff; font-weight: 600; }
.sort-date {
  display: flex; align-items: center; margin-top: 8px;
}
.sort-date label { font-size: 12px; color: #7a776d; margin-right: 8px; flex: none; }
.sort-date input {
  flex: 1; min-width: 0; border: 1px solid #e2ded3; background: #fbfaf7;
  border-radius: 8px; padding: 6px 8px; font-size: 13px;
}

.card-wrap {
  background: transparent; border-radius: 14px;
  overflow: hidden; box-shadow: 0 8px 28px rgba(35,35,31,.12);
}
.result-img {
  display: block; width: 100%; height: auto;
  -webkit-user-select: auto; user-select: auto;
  -webkit-touch-callout: default; pointer-events: auto;
  touch-action: manipulation; background: #f3efe4;
}

.credit { text-align: center; color: #b3afa3; font-size: 12px; margin: 28px 0 8px; letter-spacing: 1px; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 10px 16px 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(245,243,238,.94); border-top: 1px solid #e7e3d9;
}
.primary, .secondary {
  display: block; width: 100%; max-width: 448px; margin: 0 auto;
  border-radius: 12px; font-size: 16px; font-weight: 600; padding: 13px 0;
}
.primary { border: 0; background: #23231f; color: #fff; }
.primary:active, .secondary:active { opacity: .85; }
.primary:disabled, .secondary:disabled { opacity: .4; }
.secondary {
  margin-top: 8px; border: 1px solid #23231f; background: transparent;
  color: #23231f; padding: 11px 0;
}

.toast {
  position: fixed; left: 50%; bottom: 118px; transform: translateX(-50%);
  max-width: 86%; background: rgba(35,35,31,.9); color: #fff;
  padding: 9px 16px; border-radius: 10px; font-size: 13px; text-align: center; z-index: 30;
}

.link { border: 0; background: none; color: #3d6b5c; padding: 4px 10px; font-size: 13px; }
.card-links { margin-top: 14px; }
