body.admin { background: var(--paper); }

/* ---------- 登录 ---------- */

.login-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(rgba(25, 22, 18, 0.05) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--paper);
}

.login-card {
  width: min(400px, 100%);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 40px 34px 34px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.login-card .gate-kicker { color: var(--muted); }

.login-card h1 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.1em;
  margin: 12px 0 8px;
}

.login-card .gate-sub { color: var(--muted); font-size: 13px; margin: 0 0 26px; }

.login-card input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 10px;
  padding: 13px 15px;
  font-size: 15px;
  letter-spacing: 0.08em;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 6px;
}

.login-card input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(25, 22, 18, 0.06);
}

.login-card .btn { width: 100%; margin-top: 14px; }

.login-card .gate-error { min-height: 20px; margin-top: 10px; }

/* ---------- 后台框架 ---------- */

.admin-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100svh;
}

.sidebar {
  background: #17130f;
  color: #f3eee6;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.s-brand {
  padding: 8px 14px 22px;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.5;
}

.s-brand small {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.3em;
  opacity: 0.42;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: rgba(243, 238, 230, 0.64);
  font-size: 13.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}

.nav-item[hidden] { display: none; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, 0.11); color: #fff; }
.nav-item svg { width: 17px; height: 17px; opacity: 0.75; flex: none; }
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-foot .nav-item { font-size: 12.5px; color: rgba(243, 238, 230, 0.55); }
.sidebar-foot .nav-item:hover { color: #fff; }

.main {
  padding: 0 clamp(18px, 3vw, 42px) 70px;
  min-width: 0;
}

.main-head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 16px;
  background: linear-gradient(var(--paper) 72%, rgba(243, 238, 230, 0));
}

.main-head h1 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin: 0;
}

.main-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.main-head .head-actions { display: flex; gap: 10px; flex: none; }

/* ---------- 面板与表单 ---------- */

.panel {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  margin-bottom: 20px;
}

.panel h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

.panel .panel-sub {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.75;
  margin: 0 0 20px;
}

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

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field.full { grid-column: 1 / -1; }

.field > label {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="password"],
.field input[type="search"],
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(25, 22, 18, 0.05);
}

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

.hint { font-size: 11.5px; color: var(--muted); opacity: 0.9; line-height: 1.6; }

.text-input {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.text-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(25, 22, 18, 0.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--ink);
  color: var(--paper-soft);
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, opacity 0.2s;
  text-decoration: none;
  font-family: inherit;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: default; }

.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover:not(:disabled) { border-color: var(--ink); background: transparent; }
.btn.danger { background: #a33a28; }
.btn.sm { padding: 7px 15px; font-size: 12px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- 上传 ---------- */

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #fff;
}

.dropzone:hover,
.dropzone.dragover { border-color: var(--ink); background: #fdfbf8; }

.dropzone svg { width: 30px; height: 30px; opacity: 0.35; margin-bottom: 10px; }
.dropzone strong { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.dropzone span { font-size: 12px; color: var(--muted); }

.file-picked {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.file-picked img {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--paper-deep);
  flex: none;
}

.file-picked .name {
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picked .size { font-size: 11px; color: var(--muted); margin-top: 3px; }

.scene-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.scene-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.scene-row img {
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--paper-deep);
  flex: none;
}

.scene-row input {
  flex: 1 1 140px;
  min-width: 100px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.scene-row input:focus { outline: none; border-color: var(--ink); }

.scene-row .size {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.progress {
  height: 6px;
  background: var(--paper-deep);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 16px;
}

.progress > div {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
}

/* ---------- 列表 ---------- */

.list { display: flex; flex-direction: column; gap: 12px; }

.row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.row .thumb {
  width: 76px;
  height: 55px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--paper-deep);
  flex: none;
}

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

.row .info .t {
  font-size: 14px;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row .info .m {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.row .actions { display: flex; align-items: center; gap: 8px; flex: none; }

.switch { position: relative; width: 42px; height: 24px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.switch .track {
  position: absolute;
  inset: 0;
  background: #d3cabd;
  border-radius: 999px;
  transition: background 0.2s;
  cursor: pointer;
}

.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { transform: translateX(18px); }

.pill {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #6b3a24;
  white-space: nowrap;
}

.pill.off { background: #e7e1d7; color: var(--muted); }
.pill.dark { background: var(--ink); color: var(--paper); }

.empty-line {
  padding: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
}

/* ---------- 链接 ---------- */

.link-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  flex-wrap: wrap;
}

.link-item .grow { flex: 1; min-width: 230px; }
.link-item .title { font-size: 14.5px; margin-bottom: 4px; }

.link-item .url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  background: var(--paper);
  padding: 7px 10px;
  border-radius: 7px;
  display: inline-block;
  margin-top: 8px;
}

.link-item .meta {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}

.link-item .side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- 弹窗与提示 ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 17, 14, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal {
  width: min(470px, 100%);
  background: var(--paper-soft);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
  animation: rise 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  max-height: 88svh;
  overflow: auto;
}

.modal h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin: 0 0 6px;
}

.modal .modal-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 20px; line-height: 1.7; }
.modal .field + .field { margin-top: 14px; }
.modal .btn-row { justify-content: flex-end; margin-top: 24px; }

.modal.modal-lg { width: min(760px, 100%); }

.type-pill {
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-deep);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.type-pill.pano { background: #e3ece6; border-color: #c7d8cd; color: #3f6b52; }
.type-pill.photo { background: var(--accent-soft); border-color: #d9c2b0; color: #8a4b2f; }
.type-pill.pending { opacity: 0.65; cursor: default; }

.main-badge {
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper-soft);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.editor-add {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.scene-row .btn.sm { flex: none; }

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: var(--paper-soft);
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.05em;
  box-shadow: 0 12px 34px -12px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.3s ease both;
}

.toast.err { background: #a33a28; }
.toast.out { animation: toastOut 0.3s ease both; }

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

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px); }
}

/* ---------- 头像设置 ---------- */

.avatar-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-deep);
  border: 1px solid var(--line);
}

.avatar-preview.is-empty { display: grid; place-items: center; color: var(--muted); font-size: 11px; letter-spacing: 0.06em; }

.banner-preview {
  width: 180px;
  height: 68px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--paper-deep);
  border: 1px solid var(--line);
}

.banner-preview.is-empty { display: grid; place-items: center; color: var(--muted); font-size: 11px; letter-spacing: 0.06em; }

/* ---------- 硬装报价 ---------- */

.switch-line { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.switch-text { font-size: 13px; color: var(--ink); }

.quote-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.quote-editor { display: flex; flex-direction: column; gap: 12px; }
.quote-editor.is-off { opacity: 0.45; }
.quote-editor.is-off .quote-work-list,
.quote-editor.is-off .quote-included { pointer-events: none; }
.quote-tip { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.quote-work-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.quote-work-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  background: var(--paper-soft);
}
.quote-work-row + .quote-work-row { border-top: 1px solid var(--line); }
.qw-name {
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qw-price { text-align: right; padding: 8px 12px; }
.quote-label { font-size: 12.5px; color: var(--muted); letter-spacing: 0.04em; }
.quote-included {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
  outline: none;
}
.quote-included:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(25, 22, 18, 0.05);
}

.lead-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.lead-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 580px; }
.lead-table th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--paper-deep);
  padding: 9px 12px;
  white-space: nowrap;
}
.lead-table td { padding: 10px 12px; border-top: 1px solid var(--line); color: var(--ink); white-space: nowrap; }
.lead-table td.lead-total { font-weight: 600; }
.lead-table a { color: var(--accent); text-decoration: none; }
.lead-table a:hover { text-decoration: underline; }

/* ---------- 响应式 ---------- */

@media (max-width: 880px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 14px;
    gap: 2px;
  }
  .s-brand { width: 100%; padding: 4px 10px 10px; }
  .nav-item { width: auto; padding: 9px 12px; font-size: 12.5px; }
  .nav-badge { display: none; }
  .sidebar-foot {
    margin: 0 0 0 auto;
    border: 0;
    flex-direction: row;
    padding: 0;
    gap: 2px;
  }
  .main-head { padding-top: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
  .row .actions { width: 100%; justify-content: flex-end; }
  .quote-work-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .qw-price { text-align: left; }
}
