:root {
  --primary: #d6336c;
  --primary-light: #fce4ec;
  --primary-dark: #b8205a;
  --bg-start: #fff5f7;
  --bg-end: #ffffff;
  --card-bg: #ffffff;
  --text: #333333;
  --text-secondary: #888888;
  --shadow: 0 4px 16px rgba(214, 51, 108, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 720px;
  --header-height: 64px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
  min-height: 100vh;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(214, 51, 108, 0.06);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}
.header-inner {
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.5px;
}
.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(214, 51, 108, 0.25);
}
.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
}
.btn-secondary:hover {
  background: #f8d7e0;
}
.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  padding: 6px 14px;
  font-size: 13px;
}
.btn-danger:hover {
  background: #fecaca;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary-light);
}
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 60px;
}
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}
.empty-state .heart-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  opacity: 0.6;
}
.empty-state p {
  font-size: 15px;
  line-height: 1.6;
}
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
  animation: fadeInUp 0.5s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(214, 51, 108, 0.12);
}
.card-inner {
  display: flex;
  min-height: 140px;
}
.card-image-wrap {
  width: 180px;
  min-width: 180px;
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: var(--primary-light);
}
.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
  color: #fff;
}
.card-body {
  flex: 1;
  padding: 20px 24px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.card-message {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.card-message-silent {
  font-size: 14px;
  color: #bbb;
  font-style: italic;
}
.card-time {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-overlay {
    position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  animation: modalSlideUp 0.3s ease;
  max-height: 90vh;
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
}
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.modal-close:hover {
  background: #f3f3f3;
}
.modal-body {
  padding: 20px 24px 30px;
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group input[type="password"],
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-group input[type="password"]:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}
.form-group textarea {
  resize: vertical;
  min-height: 80px;
}
.form-group input[type="file"] {
  width: 100%;
  font-size: 13px;
}
.form-group .hint {
  font-size: 12px;
  color: #aaa;
  margin-top: 4px;
}
.form-error {
  color: #dc2626;
  font-size: 13px;
  margin-top: 6px;
  display: none;
}
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}
.image-preview-inner {
  position: relative;
  display: inline-block;
}
.image-preview-inner img {
  border-radius: var(--radius-sm);
  max-height: 200px;
  width: auto;
}
.preview-clear {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  border: 2px solid #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.15s;
  padding: 0;
}
.preview-clear:hover {
  transform: scale(1.15);
}
.image-preview {
  margin-top: 10px;
  max-width: 200px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: none;
}
.upload-area {
  border: 2px dashed #f0d0d8;
  border-radius: var(--radius-sm);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fef9fb;
}
.upload-area:hover {
  border-color: var(--primary);
  background: #fef2f5;
}
.upload-area-icon {
  font-size: 30px;
  margin-bottom: 6px;
}
.upload-area-text {
  font-size: 14px;
  color: var(--text-secondary);
}
.image-preview {
  margin-top: 10px;
  max-width: 200px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: none;
}
.image-preview img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  display: none;
  animation: toastIn 0.3s ease;
  max-width: 90vw;
  text-align: center;
}
.toast.success {
  border-left: 4px solid #10b981;
  color: #065f46;
}
.toast.error {
  border-left: 4px solid #dc2626;
  color: #991b1b;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.admin-login {
  max-width: 380px;
  margin: 100px auto;
  text-align: center;
}
.admin-login h1 {
  color: var(--primary);
  font-size: 22px;
  margin-bottom: 8px;
}
.admin-login p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}
.admin-login .form-group {
  text-align: left;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.admin-header h1 {
  font-size: 20px;
  color: var(--primary);
}
.admin-table-wrap {
  overflow-x: auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th {
  text-align: left;
  padding: 14px 16px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f3f3;
  vertical-align: middle;
}
.admin-table tr:last-child td {
  border-bottom: none;
}
.admin-table .cell-image {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.admin-table .cell-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.admin-table .cell-message {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-table .cell-time {
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-secondary);
}
.header-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.5px;
}
.header-timer {
  font-size: 11px;
  color: var(--primary);
  opacity: 0.7;
  font-weight: 400;
  letter-spacing: 0.3px;
  white-space: nowrap;
  margin-top: 2px;
}
.card-text-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
  overflow: hidden;
}
.card-text-image-inner {
  font-size: 13px;
  color: #fff;
  text-align: center;
  line-height: 1.5;
  word-break: break-all;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

@media (max-width: 600px) {
  .header-title { font-size: 16px; }
  .header-timer { font-size: 10px; }
  .container { padding: 16px 12px 40px; }
  .card-inner { flex-direction: column; }
  .card-image-wrap { width: 100%; min-width: 100%; height: 220px; }
  .card-body { padding: 16px 18px; }
  .card-message { font-size: 14px; }
  .modal { max-width: 100%; margin: 10px; max-height: 85vh; }
  .modal-body { max-height: calc(85vh - 50px); padding: 16px 18px 24px; }
  .admin-table .cell-message { max-width: 100px; }
  .admin-table th, .admin-table td { padding: 10px 12px; }
}
@media (max-width: 400px) {
  .card-image-wrap { height: 180px; }
}
@media (max-width: 400px) {
  .card-image-wrap { height: 180px; }
}
@media (max-width: 400px) {
  .card-image-wrap { height: 180px; }
}
/* ===== 图片灯箱 ===== */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: zoom-out;
}
.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
  cursor: default;
  animation: lightboxIn 0.3s ease;
}
@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}
.lightbox-download {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
  z-index: 501;
}
.lightbox-download:hover {
  background: rgba(255, 255, 255, 0.3);
}
.card-text-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
  overflow: hidden;
}
.card-text-image-inner {
  font-size: 13px;
  color: #fff;
  text-align: center;
  line-height: 1.5;
  word-break: break-all;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

@media (max-width: 600px) {
  .lightbox-overlay { padding: 16px; }
  .lightbox-download { bottom: 20px; padding: 8px 18px; font-size: 13px; }
}

/* 防滚动穿透 */
.modal-overlay {
  touch-action: none;
  overflow: hidden;
}
.modal-body {
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
input, textarea {
  font-size: 16px !important;
}









