:root {
  --paper: #f3ead8;
  --ink: #3d2c1e;
  --soft: #6b5344;
  --brass: #c4a35a;
  --moss: #5e7a4e;
  --wine: #a04545;
  --card: #fffaf0;
  --line: rgba(90, 60, 30, 0.18);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(196,163,90,0.18), transparent 40%),
    linear-gradient(180deg, #efe4cf, var(--paper));
  min-height: 100vh;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,250,240,0.75);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.04em;
}
.brand p {
  margin: 4px 0 0;
  color: var(--soft);
  font-size: 13px;
}
.auth {
  display: flex;
  align-items: end;
  gap: 8px;
}
.auth label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--soft);
}
input, select, button {
  font: inherit;
}
input, select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}
button {
  border: none;
  background: var(--moss);
  color: #fff;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
}
button.ghost {
  background: transparent;
  color: var(--soft);
  border: 1px solid var(--line);
}
button:hover { filter: brightness(1.05); }

.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
  padding: 18px 28px 40px;
}
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .top { flex-direction: column; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px 20px;
  box-shadow: 0 8px 24px rgba(60,40,20,0.06);
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}
.row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.row.batch { grid-template-columns: 1fr 1fr auto; align-items: end; }
.row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--soft);
}
.row label.grow { grid-column: 1 / -1; }
.actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.hint {
  margin: 10px 0 18px;
  font-size: 12px;
  color: var(--soft);
}

.list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.list-head h2 { margin: 0; }
#totalBadge {
  display: inline-block;
  background: var(--brass);
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  margin-left: 6px;
}
.pager {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--soft);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.card .thumb {
  aspect-ratio: 3/4;
  background: #e8dcc4;
  object-fit: cover;
  width: 100%;
  display: block;
}
.card .thumb.placeholder {
  display: grid;
  place-items: center;
  color: var(--soft);
  font-size: 12px;
}
.card .meta {
  padding: 8px 10px 10px;
  font-size: 13px;
}
.card .meta strong { display: block; margin-bottom: 2px; }
.card .meta span {
  color: var(--soft);
  font-size: 12px;
}
.card .ops {
  display: flex;
  gap: 6px;
  padding: 0 10px 10px;
}
.card .ops button {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
}
.card .ops .danger { background: var(--wine); }
.card.off { opacity: 0.55; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(44,36,28,0.92);
  color: #f7f0e2;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
  z-index: 20;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
