:root {
  --color-bg: #fafdf7;
  --color-card: #ffffff;
  --color-primary: #7cb87a;
  --color-primary-dark: #5a9a58;
  --color-accent: #f5e6c8;
  --color-text: #3a3a3a;
  --color-text-light: #777;
  --color-border: #e8ede4;
  --color-cream: #fdf8f0;
  --color-danger: #e07070;
  --color-danger-dark: #c05050;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.10);
  --transition: all 0.3s ease;
  --font: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: url('/static/images/background.jpg') center/cover no-repeat fixed;
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(250, 253, 247, 0.88);
  z-index: -1;
}

a { color: var(--color-primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-logo .frog-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  animation: hop 2s ease-in-out infinite;
}

@keyframes hop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.header-nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.header-nav a {
  color: var(--color-text);
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.header-nav a:hover {
  background: var(--color-accent);
  text-decoration: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(124,184,122,0.3);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124,184,122,0.4);
}

.btn-secondary {
  background: var(--color-accent);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: #eddcb5;
}

.btn-danger {
  background: var(--color-danger);
  color: white;
}

.btn-danger:hover {
  background: var(--color-danger-dark);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Cards */
.card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* Hero section */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
}

.hero-title {
  font-size: 2.2rem;
  color: var(--color-primary-dark);
  margin-bottom: 12px;
  font-weight: 700;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-light);
  margin-bottom: 32px;
}

.hero-frog {
  width: 180px;
  height: 180px;
  margin: 0 auto 24px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  animation: float 3s ease-in-out infinite;
}

.hero-frog img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Stats */
.stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 24px 0;
  margin: 20px 0;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: 4px;
}

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.photo-card {
  cursor: pointer;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.photo-card-body {
  padding: 14px 16px;
}

.photo-card-location {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.photo-card-meta {
  font-size: 0.8rem;
  color: var(--color-text-light);
  display: flex;
  justify-content: space-between;
}

/* Fade-in animation for cards */
.photo-card {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.photo-card:nth-child(2) { animation-delay: 0.05s; }
.photo-card:nth-child(3) { animation-delay: 0.1s; }
.photo-card:nth-child(4) { animation-delay: 0.15s; }
.photo-card:nth-child(5) { animation-delay: 0.2s; }
.photo-card:nth-child(6) { animation-delay: 0.25s; }

/* Form */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-group .hint {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-top: 4px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: var(--transition);
  background: var(--color-card);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(124,184,122,0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Upload area */
.upload-area {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--color-cream);
}

.upload-area:hover {
  border-color: var(--color-primary);
  background: #f0f7ee;
}

.upload-area.has-image {
  padding: 16px;
  border-style: solid;
  border-color: var(--color-primary);
}

.upload-area img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-sm);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.upload-text {
  color: var(--color-text-light);
  font-size: 0.9rem;
}

/* Modal / Lightbox */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--color-card);
  border-radius: var(--radius);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0,0,0,0.5);
  color: white;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(0,0,0,0.7);
}

.modal-image {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  background: #f5f5f5;
}

.modal-body {
  padding: 24px;
}

.modal-body h3 {
  margin-bottom: 12px;
  color: var(--color-primary-dark);
}

.modal-detail {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.modal-detail .label {
  color: var(--color-text-light);
  margin-right: 8px;
}

.modal-message {
  margin-top: 16px;
  padding: 16px;
  background: var(--color-cream);
  border-radius: var(--radius-sm);
  font-style: italic;
  color: var(--color-text);
}

/* Login page */
.login-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.login-card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.login-card h2 {
  color: var(--color-primary-dark);
  margin-bottom: 8px;
}

.login-card .subtitle {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* Toast / Notification */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-text);
  color: white;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  z-index: 2000;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success { background: var(--color-primary); }
.toast.error { background: var(--color-danger); }

/* Admin table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.admin-table th {
  background: var(--color-cream);
  font-weight: 600;
  color: var(--color-text);
}

.admin-table img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.admin-table tr:hover {
  background: #f9fdf7;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--color-border);
}

.tab {
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  font-family: var(--font);
}

.tab.active {
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-primary);
}

.tab:hover {
  color: var(--color-text);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 24px 0;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-light);
  font-size: 0.8rem;
  border-top: 1px solid var(--color-border);
  margin-top: 40px;
}

.site-footer p { margin-bottom: 4px; }

/* Section title */
.section-title {
  font-size: 1.3rem;
  color: var(--color-primary-dark);
  margin-bottom: 20px;
  font-weight: 700;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--color-text-light);
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-light);
}

.empty-state .emoji {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* Success state */
.success-state {
  text-align: center;
  padding: 60px 20px;
}

.success-state .emoji {
  font-size: 4rem;
  margin-bottom: 16px;
}

.success-state h2 {
  color: var(--color-primary-dark);
  margin-bottom: 8px;
}

.success-state p {
  color: var(--color-text-light);
  margin-bottom: 4px;
}

/* Responsive */
@media (max-width: 640px) {
  .hero-title { font-size: 1.6rem; }
  .hero-frog { width: 130px; height: 130px; }
  .stats { gap: 20px; }
  .stat-number { font-size: 1.5rem; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .header-nav { gap: 8px; }
  .header-nav a { padding: 6px 8px; font-size: 0.8rem; }
  .login-card { padding: 28px 20px; }
  .admin-table { font-size: 0.8rem; }
  .admin-table th, .admin-table td { padding: 8px 6px; }
}

/* Guidelines card */
.guidelines-card {
  background: #f0f7ee;
  border: 1px solid #d4e8d0;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.guidelines-card h3 {
  color: var(--color-primary-dark);
  font-size: 1rem;
  margin-bottom: 12px;
}

.guidelines-card ol {
  padding-left: 20px;
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.8;
}

.guidelines-card li {
  margin-bottom: 4px;
}

/* Upload status banner */
.upload-banner {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-banner.ok {
  background: #f0f7ee;
  border: 1px solid #d4e8d0;
  color: var(--color-primary-dark);
}

.upload-banner.blocked {
  background: #fff8f0;
  border: 1px solid #f0dcc0;
  color: #8a6d4b;
}

.upload-banner .icon { font-size: 1.3rem; }

/* Upload quota bar */
.quota-info {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.quota-info span {
  background: var(--color-cream);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

/* Admin dashboard cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.dash-card {
  background: var(--color-card);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.dash-card .dash-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.dash-card .dash-label {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: 4px;
}

.dash-card.warning .dash-value { color: var(--color-danger); }

/* Admin controls */
.admin-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--color-cream);
  border-radius: var(--radius-sm);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge.on { background: #e8f5e6; color: var(--color-primary-dark); }
.status-badge.off { background: #fde8e8; color: var(--color-danger); }

/* Campus network hint */
.campus-hint {
  margin-top: 12px;
  padding: 16px 20px;
  background: #f0f7ee;
  border: 1px solid #d4e8d0;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--color-text);
}

.campus-hint p {
  margin-bottom: 8px;
  line-height: 1.6;
}

.campus-hint p:last-of-type {
  margin-bottom: 12px;
}

.campus-hint strong {
  color: var(--color-primary-dark);
}

.campus-hint .btn {
  margin-top: 4px;
}

/* Feedback modal */
.feedback-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.feedback-modal {
  background: var(--color-card);
  border-radius: var(--radius);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-hover);
}

.feedback-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.feedback-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--color-primary-dark);
}

.feedback-modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--color-text-light);
  padding: 4px;
}

.feedback-modal-close:hover {
  color: var(--color-text);
}

.feedback-modal-body {
  padding: 20px;
  font-size: 0.9rem;
}

.feedback-modal-body p {
  margin-bottom: 12px;
}

.feedback-modal-body ul {
  margin: 12px 0;
  padding-left: 24px;
  color: var(--color-text-light);
}

.feedback-modal-body li {
  margin-bottom: 4px;
}

.feedback-limit {
  font-size: 0.8rem;
  color: var(--color-text-light);
  background: var(--color-cream);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.feedback-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
}

/* Multi-photo preview grid */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.preview-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  box-shadow: var(--shadow);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-index {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(224,112,112,0.85);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.preview-remove:hover {
  background: var(--color-danger);
}

/* Suggestion section */
.suggestion-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.suggestion-form {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
