* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --ocean-dark: #0a2540;
  --ocean-mid: #0e4f7a;
  --ocean-light: #1a8fbf;
  --coral: #ff6b6b;
  --coral-dark: #e85555;
  --sand: #ffd89b;
  --white: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.22);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --card-bg: rgba(255, 255, 255, 0.95);
  --card-text: #1a2a3a;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: linear-gradient(160deg, var(--ocean-dark) 0%, var(--ocean-mid) 60%, var(--ocean-light) 100%);
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ── 顶部标题栏 ── */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  background: rgba(10, 37, 64, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.top-bar h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2px;
}

.top-bar .back-btn {
  position: absolute;
  left: 16px;
  font-size: 24px;
  color: var(--white);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 8px;
}

/* ── 底部导航 ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  background: rgba(10, 37, 64, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--glass-border);
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  cursor: pointer;
  font-size: 10px;
  color: var(--text-secondary);
  gap: 4px;
  transition: color 0.2s;
  text-decoration: none;
}

.nav-item.active,
.nav-item:active {
  color: var(--sand);
}

.nav-item .icon {
  font-size: 22px;
  line-height: 1;
}

/* ── 页面内容区 ── */
.page-content {
  padding-top: 56px;
  padding-bottom: 80px;
  min-height: 100vh;
}

/* ── 毛玻璃卡片 ── */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  padding: 20px;
  margin: 16px;
}

/* ── 白色内容卡片 ── */
.content-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 24px 20px;
  margin: 16px;
  color: var(--card-text);
  box-shadow: 0 8px 32px rgba(10, 37, 64, 0.3);
}

/* ── 按钮 ── */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 50px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.2s, transform 0.1s;
  letter-spacing: 1px;
}

.btn:active {
  opacity: 0.85;
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--coral) 0%, #ff8e53 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--white);
}

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

.btn + .btn {
  margin-top: 12px;
}

/* ── 输入框 ── */
.field-group {
  margin-bottom: 16px;
}

.field-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: block;
}

.field-label.dark {
  color: #5a7a9a;
}

textarea,
input[type="text"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--white);
  outline: none;
  resize: none;
  font-family: inherit;
  line-height: 1.5;
}

textarea::placeholder,
input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.content-card textarea,
.content-card input[type="text"] {
  background: #f0f5fa;
  border: 1px solid #dde8f0;
  color: var(--card-text);
  border-radius: 10px;
}

.content-card textarea::placeholder,
.content-card input::placeholder {
  color: #a0b8cc;
}

/* ── 性别选择 ── */
.gender-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.gender-btn {
  flex: 1;
  padding: 12px;
  border-radius: 50px;
  border: 2px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.gender-btn.selected {
  border-color: var(--coral);
  background: rgba(255, 107, 107, 0.15);
  color: var(--white);
}

/* ── 弹窗遮罩 ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 340px;
  color: var(--card-text);
}

.modal-box h2 {
  text-align: center;
  font-size: 18px;
  margin-bottom: 8px;
}

.modal-box p {
  text-align: center;
  font-size: 13px;
  color: #7a9ab8;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ── 波浪动画 ── */
.wave-container {
  position: relative;
  overflow: hidden;
  height: 60px;
  margin-top: -10px;
}

.wave {
  position: absolute;
  bottom: 0;
  width: 200%;
  height: 60px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60'%3E%3Cpath d='M0,30 C200,0 400,60 600,30 C800,0 1000,60 1200,30 L1200,60 L0,60 Z' fill='rgba(255,255,255,0.08)'/%3E%3C/svg%3E") repeat-x;
  animation: wave-anim 6s linear infinite;
}

.wave:nth-child(2) {
  animation-delay: -3s;
  opacity: 0.5;
}

@keyframes wave-anim {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── 漂流瓶动画 ── */
.bottle-float {
  animation: bottle-float 4s ease-in-out infinite;
  display: inline-block;
  font-size: 80px;
}

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

/* ── 标签/徽章 ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.badge-male {
  background: rgba(30, 144, 255, 0.2);
  color: #5bb8ff;
  border: 1px solid rgba(30, 144, 255, 0.3);
}

.badge-female {
  background: rgba(255, 107, 107, 0.2);
  color: #ff9a9a;
  border: 1px solid rgba(255, 107, 107, 0.3);
}

/* ── 分割线 ── */
.divider {
  height: 1px;
  background: var(--glass-border);
  margin: 16px 0;
}

.divider.dark {
  background: #dde8f0;
}

/* ── 空状态 ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 60px;
  margin-bottom: 16px;
  opacity: 0.7;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.8;
}

/* ── Toast提示 ── */
#toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  transition: all 0.3s;
  white-space: nowrap;
  pointer-events: none;
}

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

/* ── Tab切换 ── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 4px;
}

.tab-item {
  flex: 1;
  text-align: center;
  padding: 12px;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.tab-item.active {
  color: var(--sand);
}

.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 25%;
  right: 25%;
  height: 2px;
  background: var(--sand);
  border-radius: 2px;
}

/* ── 记录列表 ── */
.record-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  margin: 0 16px 12px;
}

.record-item .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.record-item .date {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
}

.record-item .message-preview {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.record-item .wechat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.record-item .wechat-masked {
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.record-item .unlock-btn {
  background: linear-gradient(135deg, var(--coral) 0%, #ff8e53 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.wechat-id-show {
  font-size: 14px;
  color: var(--sand);
  font-weight: 600;
  letter-spacing: 1px;
}

/* ── loading ── */
.loading-spinner {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 14px;
}
