/* System fonts for instant load */

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

:root {
  --primary-gradient: linear-gradient(135deg, #7C3AED 0%, #A855F7 30%, #D946EF 60%, #F59E0B 100%);
  --secondary-gradient: linear-gradient(135deg, #C084FC 0%, #E9D5FF 50%, #FDE68A 100%);
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-shadow: 0 2px 16px rgba(124, 58, 237, 0.10), 0 8px 32px rgba(0, 0, 0, 0.06);
  --text-primary: #1E1B4B;
  --text-secondary: #6D668E;
  --accent-gold: #EAB308;
  --accent-pink: #F472B6;
  --accent-blue: #6366F1;
    --accent-amber: #F59E0B;
    --accent-rose: #F43F5E;
    --accent-emerald: #10B981;
    --accent-cyan: #06B6D4;
}

body {
  font-family: 'Noto Sans SC', sans-serif;
  background: var(--primary-gradient);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 页面背景渐变统一由 body 绘制（两处原为同一渐变，重复绘制） */
.gradient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  transform: translateZ(0);
}

.floating-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.float-item {
  position: absolute;
  opacity: 0.5;
  animation: float 10s ease-in-out infinite;
  will-change: transform;
}

.float-item:nth-child(1) {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.float-item:nth-child(2) {
  width: 20px;
  height: 20px;
  background: rgba(255, 215, 0, 0.6);
  border-radius: 50%;
  top: 20%;
  right: 15%;
  animation-delay: 2s;
}

.float-item:nth-child(3) {
  width: 25px;
  height: 25px;
  background: rgba(255, 183, 178, 0.6);
  border-radius: 50%;
  bottom: 30%;
  left: 20%;
  animation-delay: 4s;
}

.float-item:nth-child(4) {
  width: 15px;
  height: 15px;
  background: rgba(178, 235, 242, 0.6);
  border-radius: 50%;
  top: 50%;
  right: 10%;
  animation-delay: 6s;
}

.float-item:nth-child(5) {
  width: 35px;
  height: 35px;
  background: rgba(200, 230, 201, 0.6);
  border-radius: 50%;
  bottom: 20%;
  right: 25%;
  animation-delay: 8s;
}

.float-item:nth-child(6) {
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  top: 70%;
  left: 15%;
  animation-delay: 1s;
}

.float-item:nth-child(7) {
  width: 22px;
  height: 22px;
  background: rgba(255, 215, 0, 0.4);
  border-radius: 50%;
  top: 30%;
  left: 50%;
  animation-delay: 3s;
}

.float-item:nth-child(8) {
  width: 16px;
  height: 16px;
  background: rgba(255, 183, 178, 0.4);
  border-radius: 50%;
  bottom: 10%;
  left: 60%;
  animation-delay: 5s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(180deg); }
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.header {
  text-align: center;
  margin-bottom: 50px;
}

.header-title {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 3.5rem; letter-spacing: 0.02em;
  color: white;
  text-shadow: 0 2px 24px rgba(245, 158, 11, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
}

.header-subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 300;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  contain: layout style;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.15);
}

.card-title {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 2rem;
  color: #7C3AED;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title::before {
  content: '';
  width: 6px;
  height: 30px;
  background: var(--primary-gradient);
  border-radius: 3px;
}

.gradient-btn {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.gradient-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(79, 70, 229, 0.4);
}

.gradient-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.gradient-btn:hover::before {
  left: 100%;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.nav-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.nav-card:hover::before {
  opacity: 1;
}

.nav-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.15);
  background: rgba(255, 255, 255, 0.95);
}

.nav-icon {
  font-size: 2.6rem;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 58, 237, 0.08);
  border-radius: 16px;
  transition: transform 0.25s ease, background 0.25s ease;
  margin-bottom: 0;
}

.nav-card:hover .nav-icon {
  transform: scale(1.1);
  background: rgba(124, 58, 237, 0.14);
}


.nav-text {
  flex: 1;
  min-width: 0;
}
.nav-title {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 1.8rem;
  color: #333;
  margin-bottom: 10px;
}

.nav-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.5;
}

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

.form-label {
  display: block;
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(79, 70, 229, 0.2);
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Noto Sans SC', sans-serif;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.6);
}

.form-input:focus {
  outline: none;
  border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(79, 70, 229, 0.2);
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Noto Sans SC', sans-serif;
  resize: vertical;
  min-height: 120px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.6);
}

.form-textarea:focus {
  outline: none;
  border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(79, 70, 229, 0.2);
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Noto Sans SC', sans-serif;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: #4F46E5;
}

.avatar-container {
  text-align: center;
  margin-bottom: 24px;
}

.avatar-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--secondary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  font-size: 3.5rem; letter-spacing: 0.02em;
  color: #fff;
}

.avatar-upload-btn {
  margin-top: 15px;
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.tag {
  background: var(--secondary-gradient);
  color: #333;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.tag:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tag.selected {
  background: var(--primary-gradient);
  color: white;
}

.custom-tag-input {
  display: flex;
  gap: 10px;
}

.hobby-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hobby-tag {
  background: rgba(33, 150, 243, 0.2);
  color: #2196F3;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
}

.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--primary-gradient);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
  animation: slideIn 0.5s ease-out backwards;
}

.timeline-item:nth-child(2) { animation-delay: 0.1s; }
.timeline-item:nth-child(3) { animation-delay: 0.2s; }
.timeline-item:nth-child(4) { animation-delay: 0.3s; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.timeline-dot {
  position: absolute;
  left: -34px;
  top: 10px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  border: 3px solid #E91E63;
  z-index: 1;
}

.timeline-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.timeline-date {
  font-size: 0.85rem;
  color: #2196F3;
  font-weight: 500;
  margin-bottom: 8px;
}

.timeline-title {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 1.4rem;
  color: #333;
  margin-bottom: 10px;
}

.timeline-content {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.6;
}

.timeline-type {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
}

.timeline-type.funny {
  background: rgba(255, 215, 0, 0.2);
  color: #FF8F00;
}

.timeline-type.touching {
  background: rgba(233, 30, 99, 0.2);
  color: #E91E63;
}

.timeline-type.memorable {
  background: rgba(0, 230, 118, 0.2);
  color: #00C853;
}

.story-input-section {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 24px;
}

.type-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.type-btn {
  padding: 8px 20px;
  border: 2px solid transparent;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.type-btn.active {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
}

.type-btn:not(.active) {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(233, 30, 99, 0.2);
}

.star-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, #0c0c1e, #1a1a3e, #2d1b4e);
  z-index: -2;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.meteor {
  position: absolute;
  width: 100px;
  height: 2px;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
  animation: meteorFall 3s ease-in-out infinite;
}

@keyframes meteorFall {
  0% { transform: translateX(-100px) rotate(-45deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateX(100vw) translateY(100vh) rotate(-45deg); opacity: 0; }
}

.dream-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 25px;
  transition: all 0.3s ease;
  animation: floatUp 0.6s ease-out backwards;
}

.dream-card:nth-child(2) { animation-delay: 0.15s; }
.dream-card:nth-child(3) { animation-delay: 0.3s; }
.dream-card:nth-child(4) { animation-delay: 0.45s; }

@keyframes floatUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.dream-card:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.dream-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.dream-title {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 1.6rem;
  color: #FFD700;
  margin-bottom: 10px;
}

.dream-content {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

.dream-category {
  display: inline-block;
  margin-top: 15px;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
  background: rgba(255, 215, 0, 0.2);
  color: #FFD700;
}

.future-form {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 32px;
}

.future-form .form-input,
.future-form .form-textarea,
.future-form .form-select {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.future-form .form-input::placeholder,
.future-form .form-textarea::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.future-form .form-label {
  color: rgba(255, 255, 255, 0.9);
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  animation: bubbleIn 0.5s ease-out backwards;
}

.message-card:nth-child(2) { animation-delay: 0.1s; }
.message-card:nth-child(3) { animation-delay: 0.2s; }
.message-card:nth-child(4) { animation-delay: 0.3s; }
.message-card:nth-child(5) { animation-delay: 0.4s; }

@keyframes bubbleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.message-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.message-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--secondary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.message-info {
  flex: 1;
}

.message-name {
  font-weight: 600;
  color: #333;
  font-size: 1.1rem;
}

.message-date {
  font-size: 0.8rem;
  color: #999;
}

.message-content {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 15px;
}

.message-signature {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 1.2rem;
  color: #4F46E5;
  text-align: right;
}

.message-input-section {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 24px;
}

.signature-wall {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 32px;
  min-height: 200px;
}

.signature-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

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

.signature-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--secondary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 1.8rem;
}

.signature-name {
  font-size: 0.9rem;
  color: #333;
  font-weight: 500;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: white;
  text-decoration: none;
  font-size: 1rem;
  margin-bottom: 24px;
  transition: all 0.3s ease;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-5px);
}

/* ── Page top bar (back link + logout) ─────────────────────────── */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

/* ── Modal overlay (toggled by JS via inline display) ──────────── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

/* ── Outline buttons (override .gradient-btn colors) ───────────── */
.btn-outline-pink {
  background: #FAFAFA;
  color: #E91E63;
  border: 2px solid #E91E63;
}

.btn-outline-blue {
  background: #FAFAFA;
  color: #2196F3;
  border: 2px solid #2196F3;
}

/* ── Admin card section head ────────────────────────────────────── */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* ── Privacy radio group ────────────────────────────────────────── */
.privacy-radios {
  display: flex;
  gap: 10px;
}

.privacy-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 16px;
  border: 2px solid #9E9E9E;
  border-radius: 12px;
  background: rgba(158, 158, 158, 0.05);
}

.privacy-option input {
  accent-color: #9E9E9E;
}

.privacy-option.pink {
  border-color: #E91E63;
  background: rgba(233, 30, 99, 0.05);
}

.privacy-option.pink input {
  accent-color: #E91E63;
}

.privacy-option.blue {
  border-color: #2196F3;
  background: rgba(33, 150, 243, 0.05);
}

.privacy-option.blue input {
  accent-color: #2196F3;
}

.privacy-option.gold {
  border-color: #FFD700;
  background: rgba(255, 215, 0, 0.05);
}

.privacy-option.gold input {
  accent-color: #FFD700;
}

.privacy-hint {
  font-size: 0.8rem;
  color: #999;
  margin-top: 5px;
}

/* ── Tips / inspiration card grid ───────────────────────────────── */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.tips-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.tip-card {
  padding: 15px;
  border-radius: 12px;
}

.tip-card.pink { background: rgba(233, 30, 99, 0.1); }
.tip-card.blue { background: rgba(33, 150, 243, 0.1); }
.tip-card.green { background: rgba(0, 230, 118, 0.1); }
.tip-card.gold { background: rgba(255, 215, 0, 0.1); }

.tip-icon {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.tips-grid.compact .tip-icon {
  font-size: 1.5rem;
}

.tip-title {
  font-weight: 500;
  color: #333;
}

.tip-desc {
  font-size: 0.85rem;
  color: #666;
}

/* ── Dark pages (gallery / signature / whiteboard) ──────────────── */
body.dark-page {
  font-family: -apple-system, sans-serif;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
}

.dark-page .header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 30px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dark-page .header h2 {
  color: white;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dark-page .header .btn-back {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.9rem;
}

.dark-page .header .btn-back:hover {
  background: rgba(255, 255, 255, 0.2);
}

.dark-page .toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 12px;
  color: white;
  font-size: 0.9rem;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.dark-page .toast.show {
  opacity: 1;
}

.dark-page .toast.success {
  background: #4CAF50;
}

.dark-page .toast.error {
  background: #F44336;
}

.profile-display {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 30px;
  align-items: start;
}

.profile-avatar-large {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--secondary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-placeholder-large {
  font-size: 5rem;
  color: #fff;
}

.profile-info {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 32px;
}

.profile-row {
  display: flex;
  margin-bottom: 15px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.profile-label {
  width: 100px;
  font-weight: 500;
  color: #999;
  font-size: 0.9rem;
}

.profile-value {
  flex: 1;
  color: #333;
  font-size: 1rem;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-tag {
  background: var(--secondary-gradient);
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
  color: #333;
}

.intro-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 32px;
}

.intro-text {
  font-size: 1rem;
  color: #555;
  line-height: 1.8;
  text-align: justify;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 3.5rem; letter-spacing: 0.02em;
  margin-bottom: 20px;
  opacity: 0.6;
}

.empty-text {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
}

.success-msg {
  background: rgba(0, 230, 118, 0.2);
  color: #00C853;
  padding: 15px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

.error-msg {
  background: rgba(255, 82, 82, 0.2);
  color: #FF5252;
  padding: 15px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}


/* ── Form Validation Styles ────────────────────────────────── */
.field-error {
  color: #EF4444;
  font-size: 0.8rem;
  margin-top: 4px;
  min-height: 1.2em;
  animation: fadeIn 0.3s ease;
}

.form-input.error,
.form-textarea.error,
.form-select.error {
  border-color: #EF4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-input.success,
.form-textarea.success,
.form-select.success {
  border-color: #22C55E !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1) !important;
}

/* ── Auto-save Indicator ───────────────────────────────────── */
.auto-save-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(79, 70, 229, 0.9);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}

/* ── Touch Feedback & disable hover effects on touch devices ──── */
@media (hover: none) {
  .gradient-btn:active,
  .nav-card:active,
  .tag:active {
    transform: scale(0.97) !important;
    transition: transform 0.1s !important;
  }
  
  .form-input:focus,
  .form-textarea:focus,
  .form-select:focus {
    font-size: 16px !important; /* Prevent iOS zoom */
  }

  .card:hover {
    transform: none;
    box-shadow: var(--card-shadow);
  }
  .nav-card:hover {
    transform: none;
    box-shadow: none;
  }
  .nav-card:hover::before {
    transform: scaleX(0);
  }
  .gradient-btn:hover {
    transform: none;
    box-shadow: none;
  }
  .gradient-btn:hover::before {
    left: -100%;
  }
  .tag:hover {
    transform: none;
    box-shadow: none;
  }
  .back-link:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.1);
  }
  .data-card:hover {
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
  }
  .stat-card:hover {
    background: #FFFFFF !important;
    transform: none;
    box-shadow: var(--card-shadow);
  }
}

/* ── Keyboard Navigation Focus ─────────────────────────────── */
.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible,
.gradient-btn:focus-visible {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
}

.nav-card:focus-visible {
  outline: 3px solid #4F46E5;
  outline-offset: 3px;
}

/* ── Toast Animation ───────────────────────────────────────── */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Table scroll wrapper ───────────────────────────────────── */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -20px;
  padding: 0 20px;
}

/* ── Responsive: Tablet (≤768px) ────────────────────────────── */
@media (max-width: 768px) {
  .page-container {
    padding: 20px 15px;
    padding-bottom: env(safe-area-inset-bottom, 20px);
  }
  
  .header-title {
    font-size: 2.2rem;
    line-height: 1.3;
    word-break: break-all;
  }
  
  .header-subtitle {
    font-size: 1rem;
  }
  
  .nav-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .nav-card {
    padding: 24px 20px;
  }
  
  .nav-icon {
    font-size: 2.8rem;
  }
  
  .nav-title {
    font-size: 1.5rem;
  }
  
  .card {
    padding: 20px;
  }
  
  .card:hover {
    transform: none;
    box-shadow: var(--card-shadow);
  }
  
  .nav-card:hover {
    transform: translateY(-4px) scale(1.01);
  }
  
  .profile-display {
    grid-template-columns: 1fr;
  }
  
  .profile-avatar-large {
    width: 140px;
    height: 140px;
  }
  
  .timeline {
    padding-left: 28px;
  }
  
  .timeline::before {
    left: 10px;
  }
  
  .timeline-dot {
    left: -23px;
    width: 12px;
    height: 12px;
  }
  
  .admin-table th,
  .admin-table td {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .stat-card {
    padding: 18px;
  }
  
  /* Touch-friendly forms */
  .form-input,
  .form-textarea,
  .form-select {
    font-size: 16px; /* prevent iOS zoom on focus */
    padding: 14px 16px;
  }
  
  .gradient-btn {
    padding: 14px 24px;
    min-height: 44px;
  }
  
  .tag {
    padding: 10px 18px;
    font-size: 0.95rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  
  .table-responsive {
    margin: 0 -16px;
    padding: 0 16px;
  }
}

/* ── Responsive: Small phone (≤480px) ────────────────────────── */
@media (max-width: 480px) {
  .page-container {
    padding: 16px 12px;
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }
  
  .header-title {
    font-size: 1.8rem;
  }
  
  .header-subtitle {
    font-size: 0.9rem;
  }
  
  .nav-icon {
    font-size: 2.2rem;
  }
  
  .nav-title {
    font-size: 1.25rem;
  }
  
  .nav-desc {
    font-size: 0.85rem;
  }
  
  .card {
    padding: 16px;
    border-radius: 16px;
  }
  
  .card-title {
    font-size: 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .data-grid {
    grid-template-columns: 1fr;
  }
  
  .timeline {
    padding-left: 22px;
  }
  
  .timeline::before {
    left: 7px;
  }
  
  .timeline-dot {
    left: -19px;
    width: 10px;
    height: 10px;
  }
  
  .timeline-content {
    font-size: 0.9rem;
  }
  
  .nav-card {
    padding: 20px 16px;
  }
}

/* ── Responsive: Tiny phone (≤360px) ─────────────────────────── */
@media (max-width: 360px) {
  .header-title {
    font-size: 1.5rem;
  }
  
  .nav-card {
    padding: 16px 12px;
  }
  
  .nav-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
  }
}

/* ── Safe area support for notched iPhones ──────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .page-container {
    padding-bottom: max(40px, env(safe-area-inset-bottom));
  }
  
  body {
    min-height: -webkit-fill-available;
  }
}

/* ── Admin stats grid & cards ─────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

/* background/box-shadow 被文末 ADMIN PANEL !important 浅色规则完全覆盖（死代码已删），此处只保留生效属性 */
.stat-card {
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-value {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* stat-value accent colors — 需压过下方 ADMIN PANEL 的 .stat-value !important 默认色 */
.stat-value.stat-pink { color: var(--accent-pink) !important; }
.stat-value.stat-blue { color: var(--accent-blue) !important; }
.stat-value.stat-green { color: var(--accent-emerald) !important; }
.stat-value.stat-purple { color: #A855F7 !important; }
.stat-value.stat-orange { color: var(--accent-amber) !important; }
.stat-value.stat-teal { color: var(--accent-cyan) !important; }
.stat-value.stat-gold { color: var(--accent-gold) !important; }

/* ── Admin data table ─────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.admin-table th,
.admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #F0F0F0;
}

.admin-table thead th {
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(124, 58, 237, 0.06);
  white-space: nowrap;
}

.admin-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.04);
}


/* ── Data Card Grid (admin panels) ────────────────────────────── */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* 颜色类声明被文末 ADMIN PANEL !important 浅色规则完全覆盖（死代码已删），此处只保留生效的布局属性 */
.data-card {
  border-radius: 14px;
  padding: 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.data-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.data-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-card-title .avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  overflow: hidden;
}
.data-card-title .avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
}
.data-row:last-child { border-bottom: none; }

.data-label {
  font-size: 0.82rem;
  flex-shrink: 0;
  margin-right: 12px;
}

.data-value {
  font-size: 0.9rem;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.data-tag {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid transparent;
}

/* ── Responsive for data cards ──────────────────────────────── */
@media (max-width: 640px) {
  .data-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .data-card { padding: 14px; }
  .data-card-title { font-size: 1rem; }
}

/* ── Reduced motion (accessibility) ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ══════════════════════════════════════════════════════════════════
   ADMIN PANEL — dark text on light cards
   ══════════════════════════════════════════════════════════════════ */

.data-card, .stat-card {
  background: #FFFFFF !important;
  border: 1px solid #E8E8E8 !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
}
.data-card:hover { border-color: #D0D0D0 !important; box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important; }
.stat-card:hover { background: #FFF5F8 !important; }

.data-card-header { border-bottom: 1px solid #F0F0F0 !important; }
.data-card-title { color: #4F46E5 !important; }
.data-card-title .avatar-sm { background: #F5F5F5 !important; }
.data-row { border-bottom: 1px solid #F5F5F5 !important; }
.data-label { color: #888888 !important; }
.data-value { color: #333333 !important; }
.data-tag { background: rgba(79, 70, 229, 0.08) !important; color: #4F46E5 !important; border-color: rgba(79, 70, 229, 0.15) !important; }

.stat-value { color: #4F46E5 !important; }
.stat-label { color: #888888 !important; }

/* Admin card sections */
#students-list, #evaluations-list, #messages-list-admin,
#memories-list-admin, #dreams-list-admin, #photos-list-admin,
#users-list {
  color: #333333 !important;
}
