/* ===========================================================
   管理后台样式（移动优先）
   =========================================================== */

body.adm {
  background: #f7f7f5;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.adm-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 54px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.adm-top strong {
  font-size: 15px;
  letter-spacing: 0.3px;
}

.adm-top .spacer {
  margin-left: auto;
}

.adm-top a,
.adm-top button {
  color: var(--ink-2);
  border: 0;
  background: none;
  font-size: 13.5px;
  padding: 6px 2px;
}

/* ---------- 登录 ---------- */
.gate {
  max-width: 420px;
  margin: 0 auto;
  padding: 64px 22px 40px;
}

.gate h1 {
  font-size: 24px;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}

.gate p {
  color: var(--ink-3);
  font-size: 13.5px;
  margin: 0 0 26px;
  line-height: 1.7;
}

.gate input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  font-size: 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: #fff;
  outline: 0;
  transition: border-color 0.2s;
}

.gate input:focus {
  border-color: #9bc0a8;
}

.gate button {
  width: 100%;
  height: 50px;
  margin-top: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}

.gate button:disabled {
  opacity: 0.6;
}

.gate-error {
  color: #b4482c;
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}

.gate-hint-inline {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 22px;
  line-height: 1.7;
}

/* ---------- 列表 ---------- */
.adm-bar {
  position: sticky;
  top: 54px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f7f7f5;
}

.adm-count {
  font-size: 13px;
  color: var(--ink-3);
}

.btn-add {
  margin-left: auto;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 6px 16px rgba(47, 107, 79, 0.22);
}

.adm-list {
  list-style: none;
  margin: 0;
  padding: 0 16px 40px;
  max-width: 720px;
}

.adm-list li {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform 0.15s var(--ease);
}

.adm-list li:active {
  transform: scale(0.988);
}

.row-thumb {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper-warm);
  display: grid;
  place-items: center;
}

.row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row-thumb svg {
  width: 26px;
  opacity: 0.5;
}

.row-main {
  min-width: 0;
  flex: 1;
}

.row-name {
  font-size: 15px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.badge {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
}

.badge.draft {
  background: #f4efe6;
  color: #96773f;
}

.row-arrow {
  color: #c9c9c4;
  flex: none;
}

/* 导入提示 */
.seed {
  margin: 0 16px 16px;
  padding: 18px;
  border: 1px dashed #cfdcd3;
  border-radius: 14px;
  background: #fbfdfb;
}

.seed p {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.7;
}

.seed button {
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: #fff;
  color: var(--green);
  font-size: 14px;
}

/* ---------- 编辑抽屉 ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #f7f7f5;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.28s var(--ease);
}

@keyframes slideUp {
  from {
    transform: translateY(3%);
    opacity: 0.4;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sheet-top {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  flex: none;
}

.sheet-top strong {
  font-size: 15px;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-close,
.sheet-save,
.sheet-del {
  border: 0;
  background: none;
  font-size: 14.5px;
  padding: 8px 4px;
}

.sheet-close {
  color: var(--ink-2);
}

.sheet-save {
  color: var(--green);
  font-weight: 600;
}

.sheet-del {
  color: #b4482c;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 16px 80px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

/* 图片上传 */
.picker {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  border: 1px dashed #cfd8d2;
  background: #fff;
  overflow: hidden;
  margin-bottom: 8px;
}

.picker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.picker-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #9aa79e;
  font-size: 13px;
}

.picker-empty svg {
  width: 30px;
  opacity: 0.6;
}

.picker input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.picker-tools {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}

.picker-tools button {
  flex: 1;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 13px;
  color: var(--ink-2);
}

/* 表单 */
.field {
  margin-bottom: 14px;
}

.field > label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.field input[type="text"],
.field input[type="number"],
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: #fff;
  padding: 12px 13px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  outline: 0;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.field textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.7;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #9bc0a8;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chips button {
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 13.5px;
  color: var(--ink-2);
}

.chips button.on {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  font-size: 14.5px;
}

.switch input {
  width: 22px;
  height: 22px;
  accent-color: var(--green);
}

.group-title {
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 1px;
  margin: 26px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-2);
}

/* 底部保存条 */
.save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  flex: none;
}

.save-bar button {
  height: 48px;
  border-radius: 12px;
  border: 0;
  font-size: 15.5px;
  font-weight: 500;
}

.save-bar .primary {
  flex: 1;
  background: var(--green);
  color: #fff;
}

.save-bar .ghost {
  padding: 0 20px;
  background: #f1f1ee;
  color: var(--ink-2);
}

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translate(-50%, 12px);
  background: rgba(27, 27, 27, 0.9);
  color: #fff;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.26s var(--ease);
  z-index: 120;
  max-width: 82vw;
  text-align: center;
}

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

.loading {
  padding: 60px 0;
  text-align: center;
  color: var(--ink-3);
  font-size: 13.5px;
}
