:root {
  --ink: #2f3e42;
  --sub: #7b8a8e;
  --line: #e6e2dc;
  --teal: #2f5d62;
  --teal-soft: #e8f1f1;
  --rose: #b8556b;
  --rose-soft: #fbecf0;
  --bg: #f6f4f1;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  padding-bottom: 40px;
}

.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 14px;
}

header.site {
  background: linear-gradient(180deg, #fdfcfb, #f6f4f1);
  border-bottom: 1px solid var(--line);
  padding: 16px 0 12px;
  margin-bottom: 12px;
}
header.site h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 1px;
}
header.site p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--sub);
}

.notice {
  background: var(--rose-soft);
  color: #8d3b52;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

.tabs {
  display: flex;
  background: #eceae5;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 14px;
  position: sticky;
  top: 8px;
  z-index: 20;
}
.tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 9px 0;
  font-size: 14px;
  border-radius: 9px;
  color: var(--sub);
  font-family: inherit;
}
.tabs button.on {
  background: #fff;
  color: var(--teal);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
}

label.f {
  display: block;
  font-size: 13px;
  color: var(--sub);
  margin: 12px 0 5px;
}
input,
textarea,
select {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fdfdfc;
  color: var(--ink);
  font-family: inherit;
}
textarea {
  min-height: 84px;
  resize: vertical;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--teal);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}
.chip {
  padding: 6px 13px;
  border-radius: 18px;
  background: #f2f0ec;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
}
.chip.on {
  background: var(--teal-soft);
  color: var(--teal);
  border-color: #bcd6d6;
  font-weight: 600;
}

.btn {
  width: 100%;
  border: 0;
  background: var(--teal);
  color: #fff;
  padding: 13px;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  margin-top: 16px;
  font-weight: 500;
}
.btn:active {
  transform: scale(0.985);
}
.btn.ghost {
  background: #fff;
  color: var(--teal);
  border: 1px solid #cfe0e0;
}
.btn.rose {
  background: var(--rose);
}
.btn.sm {
  width: auto;
  padding: 8px 16px;
  font-size: 14px;
  margin-top: 0;
  border-radius: 9px;
}
.btn[disabled] {
  opacity: 0.55;
}

.grid-img {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.grid-img .cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f0eee9;
}
.grid-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.grid-img .del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 0;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.add-img {
  aspect-ratio: 1;
  border: 1px dashed #cfcac2;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sub);
  font-size: 24px;
  background: #fbfaf8;
  cursor: pointer;
}

/* 许愿卡 */
.wish {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  margin-bottom: 12px;
}
.wish .top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex: none;
}
.wish .who {
  font-size: 14px;
  font-weight: 500;
}
.wish .when {
  font-size: 12px;
  color: var(--sub);
  margin-left: auto;
}
.wish .text {
  white-space: pre-wrap;
  word-break: break-word;
}
.wish .imgs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 9px 0;
}
.wish .imgs img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 9px;
  display: block;
  background: #f0eee9;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tag {
  font-size: 12px;
  background: #f2f0ec;
  color: var(--sub);
  padding: 3px 9px;
  border-radius: 6px;
}
.tag.k {
  background: var(--teal-soft);
  color: var(--teal);
}
.wish .acts {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.endorse {
  border: 1px solid #e3ddd6;
  background: #fff;
  border-radius: 18px;
  padding: 5px 14px;
  font-size: 13px;
  color: var(--sub);
  font-family: inherit;
}
.endorse.on {
  background: var(--rose-soft);
  border-color: #f0cdd7;
  color: var(--rose);
  font-weight: 600;
}
.mini {
  border: 0;
  background: none;
  color: var(--sub);
  font-size: 12px;
  font-family: inherit;
  padding: 4px 6px;
}
.mini.danger {
  color: #c0392b;
}

/* 团购 */
.poll {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}
.poll .cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #efece7;
}
.poll .body {
  padding: 13px;
}
.poll h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.poll .desc {
  font-size: 13px;
  color: var(--sub);
  margin: 0 0 10px;
  white-space: pre-wrap;
}
.status {
  display: inline-block;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: 2px;
}
.status.voting {
  background: var(--teal-soft);
  color: var(--teal);
}
.status.draft {
  background: #f2f0ec;
  color: var(--sub);
}
.status.done {
  background: var(--rose-soft);
  color: var(--rose);
}
.status.closed {
  background: #eee;
  color: #999;
}

.item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  margin-bottom: 8px;
  align-items: center;
}
.item.picked {
  border-color: var(--teal);
  background: #f7fbfb;
}
.item .thumb {
  width: 62px;
  height: 62px;
  border-radius: 9px;
  object-fit: cover;
  background: #f0eee9;
  flex: none;
}
.item .info {
  flex: 1;
  min-width: 0;
}
.item .nm {
  font-size: 14px;
  font-weight: 500;
  word-break: break-word;
}
.item .meta {
  font-size: 12px;
  color: var(--sub);
  margin-top: 2px;
}
.item .pick {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid #d8d2ca;
  background: #fff;
  font-size: 15px;
  line-height: 1;
  padding: 0;
  color: transparent;
}
.item.picked .pick {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.bar {
  height: 7px;
  background: #efece7;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 5px;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--teal);
}

.empty {
  text-align: center;
  color: var(--sub);
  font-size: 14px;
  padding: 34px 10px;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row > * {
  flex: 1;
}

/* modal */
.wb-mask {
  position: fixed;
  inset: 0;
  background: rgba(30, 26, 22, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 18px;
}
.wb-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 400px;
  padding: 18px;
  max-height: 86vh;
  overflow: auto;
}
.wb-modal.wide {
  max-width: 520px;
}
.wb-modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}
.wb-modal-body {
  font-size: 14px;
}
.wb-modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
.wb-btn {
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 18px;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
}
.wb-btn.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
#wb-viewer img {
  max-width: 100%;
  max-height: 100%;
  transition: transform 0.12s;
}
#wb-viewer {
  background: rgba(0, 0, 0, 0.92);
  touch-action: none;
}

.kv {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.kv:last-child {
  border: 0;
}
.kv b {
  font-weight: 600;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.admin-head h1 {
  font-size: 17px;
  margin: 0;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  margin-bottom: 8px;
  background: #fff;
}
.list-row .grow {
  flex: 1;
  min-width: 0;
}
.list-row .t {
  font-size: 14px;
  word-break: break-word;
}
.list-row .s {
  font-size: 12px;
  color: var(--sub);
}
.pill {
  font-size: 11px;
  background: var(--teal-soft);
  color: var(--teal);
  padding: 2px 8px;
  border-radius: 6px;
}
.pill.g {
  background: #f2f0ec;
  color: var(--sub);
}
.pill.r {
  background: var(--rose-soft);
  color: var(--rose);
}
input[type="file"] {
  display: none;
}
.seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.seg button {
  flex: 1;
  min-width: 62px;
  padding: 8px 4px;
  font-size: 13px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  font-family: inherit;
  color: var(--sub);
}
.seg button.on {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
