* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background: #f5f6f8;
  color: #222;
}

/* ---------- 前台展示页 ---------- */
.content-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px;
}
.content-block {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  text-align: center;
}
.content-block h2 {
  margin-top: 0;
}
.content-block img {
  max-width: 100%;
  border-radius: 6px;
  display: block;
  margin: 12px auto;
}
.body-text {
  line-height: 1.7;
  white-space: pre-wrap;
}
.empty {
  text-align: center;
  color: #888;
  padding: 60px 0;
}
.view-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 36px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  text-align: center;
  border-radius: 999px;
  background: linear-gradient(145deg, #8afbc7 0%, #5ac13f 45%, #2aa951 100%);
  border: none;
  cursor: pointer;
  transition: transform .08s ease, filter .08s ease;
}
.view-btn:hover {
  filter: brightness(1.05);
}
.view-btn:active {
  transform: translateY(2px);
}

/* ---------- 登录页 ---------- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
.login-box {
  background: #fff;
  padding: 32px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
  width: 320px;
}
.login-box h1 {
  font-size: 20px;
  text-align: center;
  margin-top: 0;
}
.login-box label {
  display: block;
  margin-bottom: 14px;
  font-size: 14px;
  color: #555;
}
.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%;
  padding: 8px 10px;
  margin-top: 6px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}
.captcha-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.captcha-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.captcha-row img {
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
}
.login-box button {
  width: 100%;
  padding: 10px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}
.login-box button:hover {
  background: #1d4ed8;
}
.alert {
  background: #fef2f2;
  color: #b91c1c;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 14px;
}
.alert-success {
  background: #f0fdf4;
  color: #15803d;
}
.alert-info {
  background: #eff6ff;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #16a34a;
  color: #fff;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 1000;
}
.toast.show {
  opacity: 1;
}
.link-display {
  flex: 1;
  min-width: 200px;
  padding: 6px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #fff;
  color: #1d4ed8;
  font-size: 13px;
}

/* ---------- 后台管理 ---------- */
.admin-layout {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}
.admin-sidebar {
  width: 210px;
  flex-shrink: 0;
  background: #1e293b;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
}
.sidebar-brand {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  padding: 0 24px 24px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.sidebar-nav a {
  padding: 12px 24px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: #334155;
  color: #fff;
}
.sidebar-nav a.logout-link {
  margin-top: auto;
  color: #fca5a5;
}
.sidebar-nav a.logout-link:hover {
  background: #334155;
  color: #fca5a5;
}
.sidebar-user {
  padding: 16px 24px 0;
  margin-top: 16px;
  border-top: 1px solid #334155;
  font-size: 12px;
  color: #94a3b8;
}
.admin-main {
  flex: 1;
  padding: 30px 40px;
  max-width: 900px;
}
.admin-main h1 {
  margin-top: 0;
}
.admin-actions {
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
}
.btn {
  display: inline-block;
  padding: 8px 16px;
  background: #2563eb;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  border: none;
  cursor: pointer;
}
.btn:hover { background: #1d4ed8; }
.btn-outline {
  background: #fff;
  color: #2563eb;
  border: 1px solid #2563eb;
}
.btn-outline:hover { background: #eff6ff; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.admin-table th, .admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  text-align: left;
}
.admin-table th {
  background: #f9fafb;
}
.thumb {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}
.inline-form { display: inline; }
.muted { color: #999; font-size: 13px; }
.section-title { margin-top: 32px; }
.link-btn {
  background: none;
  border: none;
  color: #b91c1c;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
}
.edit-form {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  max-width: 600px;
}
.edit-form label {
  display: block;
  margin-bottom: 16px;
  font-size: 14px;
  color: #444;
}
.edit-form input[type="text"],
.edit-form input[type="number"],
.edit-form textarea {
  width: 100%;
  padding: 8px 10px;
  margin-top: 6px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.thumb-preview {
  max-width: 200px;
  border-radius: 6px;
  display: block;
  margin-bottom: 8px;
}
.inline-label {
  font-size: 13px;
  color: #b91c1c;
}
