:root {
  --bg: #eef2f8;
  --surface: rgba(255, 255, 255, 0.86);
  --text: #10141b;
  --muted: #5b6470;
  --line: rgba(16, 20, 27, 0.12);
  --primary: #1f3d78;
  --danger: #9d2435;
  --shadow: 0 10px 30px rgba(18, 24, 34, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(170deg, #f4f7fb, #ecf1f7);
  font-family: "SF Pro Display", "Avenir Next", "PingFang SC", sans-serif;
}

.admin-topbar {
  width: min(1200px, calc(100% - 2rem));
  margin: 1rem auto 0;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  background: rgba(245, 249, 255, 0.75);
}

.admin-topbar h1 {
  margin: 0;
  font-size: 1.3rem;
}

.topbar-actions a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.admin-main {
  width: min(1200px, calc(100% - 2rem));
  margin: 1rem auto 1.4rem;
}

.card {
  padding: 1rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
  margin-bottom: 0.9rem;
}

.card h2 {
  margin: 0 0 0.8rem;
  font-size: 1.1rem;
}

.card h3 {
  margin: 0.5rem 0 0.5rem;
  font-size: 0.95rem;
}

.card p {
  margin: 0 0 0.7rem;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.grid {
  display: grid;
  gap: 0.7rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span2 {
  grid-column: span 2;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.row.wrap {
  flex-wrap: wrap;
}

.row.end {
  justify-content: flex-end;
}

label {
  display: block;
  font-size: 0.82rem;
  color: #3e4a5b;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.62rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  color: inherit;
}

textarea {
  resize: vertical;
  min-height: 86px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.checkbox input {
  margin: 0;
}

.btn {
  border: 1px solid rgba(16, 20, 27, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  padding: 0.45rem 0.82rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #1f3d78, #31579f);
}

.btn.danger {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #8f1f31, #b1354b);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.stats article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.8);
}

.stats p {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #152238;
}

.stats span {
  font-size: 0.75rem;
  color: var(--muted);
}

.slide-list table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.slide-list th,
.slide-list td {
  padding: 0.45rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.slide-list img {
  width: 72px;
  border-radius: 6px;
  display: block;
}

.photo-manager {
  margin-top: 0.9rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.7rem;
}

#r-photo-list {
  margin-top: 0.6rem;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
}

#r-photo-list table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

#r-photo-list th,
#r-photo-list td {
  border-bottom: 1px solid var(--line);
  padding: 0.42rem;
  text-align: left;
}

#r-photo-list img {
  width: 60px;
  border-radius: 6px;
  display: block;
}

.tip {
  font-size: 0.76rem;
}

.msg {
  margin-top: 0.55rem;
  min-height: 1.2rem;
  font-size: 0.82rem;
  color: #214a89;
}

@media (max-width: 980px) {
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .span2 {
    grid-column: auto;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}
