/* ========== 童年毕业通讯录 - 同学录风格 ========== */
@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=ZCOOL+XiaoWei&display=swap');

:root {
  --paper: #faf6ef;
  --paper-dark: #f0e8d8;
  --ink: #4a3728;
  --ink-light: #7a6550;
  --accent: #c17b4a;
  --accent-light: #e0a878;
  --tape: rgba(200, 170, 130, 0.4);
  --sticky-yellow: #fdf6b2;
  --sticky-pink: #fdd8d8;
  --sticky-blue: #c8e0f0;
  --sticky-green: #d0ecc8;
  --border: #d4c4a8;
  --shadow: rgba(74, 55, 40, 0.15);
}

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

body {
  font-family: 'ZCOOL XiaoWei', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.7;
}

/* Paper texture background */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(180,160,130,0.03) 2px, rgba(180,160,130,0.03) 4px),
    radial-gradient(ellipse at 20% 20%, rgba(224,168,120,0.08), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(193,123,74,0.06), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  position: relative;
  z-index: 1;
}

/* ===== Header ===== */
.header {
  text-align: center;
  padding: 30px 16px 20px;
}

.header h1 {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 2.2em;
  color: var(--accent);
  text-shadow: 1px 1px 0 rgba(193,123,74,0.15);
  margin-bottom: 8px;
}

.header .subtitle {
  color: var(--ink-light);
  font-size: 0.95em;
}

/* ===== Navigation ===== */
.nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.nav button {
  background: var(--paper-dark);
  border: 2px solid var(--border);
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95em;
  color: var(--ink);
  transition: all 0.2s;
}

.nav button.active,
.nav button:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== Cards & Panels ===== */
.card {
  background: #fffdf8;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px var(--shadow);
  position: relative;
}

/* Tape decoration */
.card::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 80px;
  height: 22px;
  background: var(--tape);
  border-radius: 2px;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  color: var(--ink);
  font-size: 0.95em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  font-family: inherit;
  font-size: 1em;
  color: var(--ink);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

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

.btn {
  display: inline-block;
  padding: 10px 28px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1em;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #a06038;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

.btn-danger {
  background: #d96050;
  color: #fff;
}

.btn-danger:hover { background: #b84538; }

.btn-sm {
  padding: 4px 14px;
  font-size: 0.85em;
}

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

/* ===== Profile Section ===== */
.profile-card {
  text-align: center;
  padding: 30px 24px;
}

.avatar-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  color: #fff;
  margin: 0 auto 12px;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px var(--shadow);
}

.profile-name {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 1.6em;
  color: var(--accent);
  margin-bottom: 6px;
}

.profile-bio {
  color: var(--ink-light);
  font-size: 0.95em;
  margin-bottom: 12px;
}

.profile-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.9em;
  color: var(--ink-light);
}

/* ===== Message Wall (Sticky Notes) ===== */
.wall-title {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: 1.4em;
  color: var(--accent);
  margin: 24px 0 16px;
  text-align: center;
}

.message-note {
  background: var(--sticky-yellow);
  padding: 16px 18px;
  margin-bottom: 16px;
  border-radius: 2px;
  box-shadow: 2px 3px 10px var(--shadow);
  position: relative;
  transform: rotate(-0.5deg);
  transition: transform 0.2s;
}

.message-note:nth-child(3n+1) { background: var(--sticky-yellow); transform: rotate(0.8deg); }
.message-note:nth-child(3n+2) { background: var(--sticky-pink); transform: rotate(-1deg); }
.message-note:nth-child(3n+3) { background: var(--sticky-blue); transform: rotate(0.5deg); }

.message-note:hover {
  transform: rotate(0deg) scale(1.01);
  z-index: 2;
}

.message-note .note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85em;
  color: var(--ink-light);
}

.message-note .note-author {
  font-weight: bold;
  color: var(--ink);
}

.message-note .note-content {
  font-size: 1.05em;
  word-break: break-word;
  white-space: pre-wrap;
}

.message-note .note-emoji {
  font-size: 1.5em;
  margin-top: 8px;
}

.message-note .note-time {
  font-size: 0.8em;
  color: var(--ink-light);
  margin-top: 8px;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.8em;
  font-weight: bold;
}

.badge-pending { background: #fff3cd; color: #856404; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-hidden { background: #e2e3e5; color: #383d41; }

/* ===== Share Link ===== */
.share-box {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.share-box input {
  flex: 1;
  padding: 8px 12px;
  border: 2px dashed var(--border);
  border-radius: 6px;
  background: var(--paper);
  font-size: 0.9em;
  color: var(--ink);
}

/* ===== Emoji Picker ===== */
.emoji-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.emoji-btn {
  font-size: 1.4em;
  background: none;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 8px;
  transition: all 0.15s;
}

.emoji-btn.selected,
.emoji-btn:hover {
  border-color: var(--accent);
  background: var(--paper-dark);
}

/* ===== Toggle Switch ===== */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}

.toggle-row:last-child { border-bottom: none; }

.switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: #ccc;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.switch.on { background: var(--accent); }

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
}

.switch.on::after { left: 25px; }

/* ===== Stats ===== */
.stats-row {
  display: flex;
  justify-content: space-around;
  margin: 16px 0;
  flex-wrap: wrap;
  gap: 8px;
}

.stat-item {
  text-align: center;
  padding: 8px 16px;
}

.stat-num {
  font-size: 1.6em;
  font-weight: bold;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85em;
  color: var(--ink-light);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.pagination button {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--paper-dark);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

.pagination button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--ink);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 999;
  transition: transform 0.3s;
  font-size: 0.95em;
  max-width: 90%;
  text-align: center;
}

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

.toast.error { background: #b84538; }
.toast.success { background: #3a8a55; }

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

.empty-state .empty-icon {
  font-size: 3em;
  margin-bottom: 12px;
}

/* ===== Filter Tabs ===== */
.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  justify-content: center;
}

.filter-tabs button {
  padding: 5px 14px;
  border: 1px solid var(--border);
  background: var(--paper-dark);
  border-radius: 15px;
  cursor: pointer;
  font-size: 0.88em;
  font-family: inherit;
}

.filter-tabs button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== Mobile ===== */
@media (max-width: 480px) {
  .container { padding: 12px 12px 40px; }
  .header h1 { font-size: 1.7em; }
  .card { padding: 18px 16px; }
  .message-note { padding: 14px; }
  .nav button { padding: 6px 14px; font-size: 0.9em; }
  .profile-meta { flex-direction: column; gap: 4px; }
  .stats-row { gap: 4px; }
  .stat-item { padding: 6px 10px; }
  .stat-num { font-size: 1.3em; }
  .share-box { flex-direction: column; }
  .toggle-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

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

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4) infinite;
}

@keyframes dots {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
  100% { content: ''; }
}

/* ===== Checkbox ===== */
.msg-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 16px;
  align-items: center;
}
