/* ========== 全局重置与基础 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
  background-color: #FFF8E7;
  color: #4A4A4A;
  font-size: 14px;
  line-height: 1.6;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

/* 页面基础 */
.page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 56px;
  background-color: #FFF8E7;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: none;
  z-index: 1;
}

.page.active {
  display: block;
  animation: fadeIn 300ms ease;
}

.container {
  padding: 20px;
  min-height: 100%;
  box-sizing: border-box;
}

/* 动画 */
.fade-in {
  animation: fadeIn 300ms ease;
}

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

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* 滚动条隐藏 */
.page::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}

/* ========== 通用组件样式（来自 app.wxss）========== */

/* 大圆角卡片 */
.card {
  background-color: #FFFFFF;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* 主按钮 - 治愈系配色 */
.btn-primary {
  background-color: #F0B83D;
  color: #FFFFFF;
  border-radius: 24px;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  transition: all 150ms ease;
  box-shadow: 0 4px 12px rgba(240, 184, 61, 0.25);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary.disabled {
  background-color: #E0D5C0;
  color: #FFFFFF;
  box-shadow: none;
}

/* 次级按钮 */
.btn-secondary {
  background-color: #FFFFFF;
  color: #8B7E6A;
  border: 1px solid #F0E6D0;
  border-radius: 24px;
  padding: 12px 0;
  font-size: 15px;
  text-align: center;
  transition: all 150ms ease;
}

.btn-secondary:active {
  transform: scale(0.97);
  background-color: #FFF9F0;
}

/* 危险操作按钮 */
.btn-danger {
  background-color: #FFFFFF;
  color: #D4886A;
  border: 1px solid #F0D5C8;
  border-radius: 24px;
  padding: 12px 0;
  font-size: 15px;
  text-align: center;
  transition: all 150ms ease;
}

.btn-danger:active {
  transform: scale(0.97);
  background-color: #FDF8F6;
}

/* 列表功能条目 */
.list-item {
  background-color: #FFFFFF;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
  transition: all 150ms ease;
}

.list-item:active {
  background-color: #FFF9F0;
}

.list-item-text {
  font-size: 15px;
  color: #4A4A4A;
}

.list-item-arrow {
  color: #D4C8B0;
  font-size: 14px;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.empty-icon {
  width: 100px;
  height: 100px;
  margin-bottom: 16px;
  font-size: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-text {
  color: #B8A88A;
  font-size: 14px;
}

/* ========== 底部导航栏 ========== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: #FFFFFF;
  border-top: 1px solid rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  height: 100%;
  color: #B8A88A;
  transition: color 200ms ease;
}

.tab-bar-item.active {
  color: #F0B83D;
}

.tab-bar-icon {
  font-size: 20px;
  line-height: 1;
}

.tab-bar-text {
  font-size: 10px;
}

/* ========== 弹窗组件 ========== */
.dialog-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.dialog-mask.show {
  opacity: 1;
  pointer-events: auto;
}

.dialog-box {
  position: relative;
  width: 280px;
  background-color: #FFFFFF;
  border-radius: 16px;
  padding: 24px 20px 18px;
  text-align: center;
  transform: scale(0.85);
  transition: transform 250ms ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.dialog-mask.show .dialog-box {
  transform: scale(1);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 150ms ease;
}

.dialog-close:active {
  background-color: #F0F0F0;
}

.close-icon {
  font-size: 14px;
  color: #B8A88A;
  line-height: 1;
}

.dialog-title {
  font-size: 17px;
  font-weight: 600;
  color: #5D4E37;
  margin-bottom: 10px;
  padding: 0 10px;
}

.dialog-content {
  font-size: 14px;
  color: #8B7E6A;
  line-height: 1.7;
  margin-bottom: 18px;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.dialog-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: all 150ms ease;
}

.dialog-btn:active {
  transform: scale(0.96);
}

.dialog-cancel {
  background-color: #FFF8E7;
  color: #8B7E6A;
}

.dialog-confirm {
  background-color: #FDF8F6;
  color: #F0B83D;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background-color: rgba(0, 0, 0, 0.7);
  color: #FFFFFF;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 14px;
  text-align: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 200ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 120px;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.toast-icon {
  font-size: 28px;
}

/* ========== Loading ========== */
.loading-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.loading-mask.show {
  opacity: 1;
  pointer-events: auto;
}

.loading-box {
  background-color: rgba(0, 0, 0, 0.7);
  padding: 20px 24px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 120px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  color: #FFFFFF;
  font-size: 13px;
}

/* ========== 首页样式 ========== */
.index-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 40px 24px;
}

.brand-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

.brand-illustration {
  margin-bottom: 20px;
}

.brand-circle {
  width: 80px;
  height: 80px;
  background-color: #FFE082;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(255, 224, 130, 0.4);
}

.brand-icon {
  font-size: 36px;
}

.brand-title {
  font-size: 26px;
  font-weight: 600;
  color: #5D4E37;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.brand-slogan {
  font-size: 18px;
  color: #8B7E6A;
  font-weight: 400;
  margin-bottom: 6px;
}

.brand-subtitle {
  font-size: 13px;
  color: #B8A88A;
  letter-spacing: 2px;
}

.action-section {
  width: 100%;
  margin-bottom: 30px;
}

.main-btn-wrapper {
  margin-bottom: 20px;
}

.main-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 0;
}

.btn-icon {
  font-size: 18px;
}

.btn-label {
  font-size: 17px;
  font-weight: 500;
}

.btn-desc {
  text-align: center;
  font-size: 13px;
  color: #B8A88A;
  margin-top: 10px;
}

.secondary-btn-wrapper {
  width: 100%;
}

.diary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  transition: all 150ms ease;
}

.diary-card:active {
  transform: scale(0.98);
  background-color: #FFF9F0;
}

.diary-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.diary-icon {
  font-size: 24px;
}

.diary-card-text {
  display: flex;
  flex-direction: column;
}

.diary-card-title {
  font-size: 15px;
  color: #4A4A4A;
  font-weight: 500;
  margin-bottom: 3px;
}

.diary-card-sub {
  font-size: 12px;
  color: #B8A88A;
}

.privacy-hint {
  position: fixed;
  bottom: 80px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.privacy-hint-item {
  font-size: 11px;
  color: #D4C8B0;
}

/* ========== 聊天页样式 ========== */
#page-chat.active,
.chat-page {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  background-color: #FFF8E7;
}

.custom-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: #FFF9F0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.nav-content {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
}

.nav-back {
  display: flex;
  align-items: center;
  z-index: 1;
  padding: 8px;
  margin-left: -8px;
}

.back-arrow {
  font-size: 24px;
  color: #8B7E6A;
  line-height: 1;
}

.nav-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-title-text {
  font-size: 19px;
  font-weight: 700;
  color: #5D4E37;
}

.nav-title-icon {
  font-size: 16px;
}

.chat-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 8px 16px;
  background-color: #FFF9F0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-generate {
  font-size: 13px;
  color: #F0B83D;
  font-weight: 500;
}

.toolbar-clear {
  font-size: 13px;
  color: #B8A88A;
}

.chat-nav-placeholder {
  flex-shrink: 0;
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0;
}

.chat-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}

.chat-messages {
  padding: 0 12px;
}

.message {
  display: flex;
  margin-bottom: 16px;
  animation: fadeIn 300ms ease;
}

.message-content {
  max-width: 72%;
  padding: 10px 12px;
  border-radius: 12px;
  position: relative;
}

.message-text {
  font-size: 14px;
  line-height: 1.7;
  word-break: break-all;
}

.message-time {
  font-size: 10px;
  margin-top: 5px;
  opacity: 0.6;
}

.ai-message {
  align-items: flex-start;
}

.ai-avatar {
  width: 36px;
  height: 36px;
  background-color: #FFE082;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  flex-shrink: 0;
  font-size: 18px;
}

.ai-content {
  background-color: #FFFFFF;
  color: #4A4A4A;
  border-bottom-left-radius: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.ai-content .message-time {
  color: #B8A88A;
}

.user-message {
  justify-content: flex-end;
}

.user-content {
  background-color: #F0B83D;
  color: #FFFFFF;
  border-bottom-right-radius: 3px;
}

.user-content .message-time {
  color: rgba(255,255,255,0.7);
}

.typing-content {
  padding: 14px 16px;
}

.typing-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dot {
  width: 7px;
  height: 7px;
  background-color: #D4C8B0;
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

.chat-input-area {
  display: flex;
  align-items: flex-end;
  padding: 10px 12px 20px;
  background-color: #FFF9F0;
  border-top: 1px solid rgba(0,0,0,0.04);
  gap: 8px;
  flex-shrink: 0;
}

.input-wrapper {
  flex: 1;
  background-color: #FFFFFF;
  border-radius: 16px;
  padding: 8px 14px;
  max-height: 100px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.chat-textarea {
  width: 100%;
  min-height: 22px;
  max-height: 80px;
  font-size: 14px;
  line-height: 1.5;
  color: #4A4A4A;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: inherit;
}

.chat-textarea::placeholder {
  color: #D4C8B0;
  font-size: 14px;
}

.send-btn {
  background-color: #F0B83D;
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  transition: all 150ms ease;
  flex-shrink: 0;
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn.disabled {
  background-color: #E0D5C0;
  color: #FFFFFF;
}

.bottom-space {
  height: 10px;
}

/* ========== 日记列表页样式 ========== */
.diary-page {
  padding-bottom: 80px;
}

.diary-header {
  margin-bottom: 20px;
}

.diary-title {
  font-size: 20px;
  font-weight: 600;
  color: #5D4E37;
  margin-bottom: 4px;
}

.diary-subtitle {
  font-size: 13px;
  color: #B8A88A;
}

.diary-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.diary-list .diary-card {
  background-color: #FFFFFF;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: all 150ms ease;
}

.diary-list .diary-card:active {
  transform: scale(0.98);
  background-color: #FFF9F0;
}

.diary-card-content {
  flex: 1;
  min-width: 0;
  margin-right: 10px;
}

.diary-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.diary-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #5D4E37;
  line-height: 1.4;
  flex: 1;
  margin-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diary-card-tags {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.diary-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.chat-tag {
  background-color: #FFF3D6;
  color: #D4886A;
}

.diary-card-preview {
  font-size: 14px;
  color: #4A4A4A;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
  word-break: break-all;
}

.diary-card-time {
  font-size: 12px;
  color: #D4C8B0;
}

.diary-card-delete {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 150ms ease;
  flex-shrink: 0;
}

.diary-card-delete:active {
  background-color: #F0D5C8;
}

.empty-illustration {
  width: 90px;
  height: 90px;
  background-color: #FFE082;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.empty-illustration .empty-icon {
  font-size: 36px;
  width: auto;
  height: auto;
}

.empty-subtext {
  font-size: 13px;
  color: #D4C8B0;
  margin-top: 6px;
}

.fab-btn {
  position: fixed;
  right: 24px;
  bottom: 80px;
  width: 60px;
  height: 60px;
  background-color: #F0B83D;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(240, 184, 61, 0.35);
  transition: all 150ms ease;
  z-index: 100;
}

.fab-btn:active {
  transform: scale(0.92);
}

.fab-icon {
  color: #FFFFFF;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

/* ========== 日记编辑页样式 ========== */
.diary-edit-page {
  min-height: 100%;
  background-color: #FFF8E7;
  display: flex;
  flex-direction: column;
}

.edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background-color: #FFF9F0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.header-back {
  width: 40px;
  display: flex;
  align-items: center;
}

.edit-header .back-arrow {
  font-size: 24px;
  color: #8B7E6A;
  line-height: 1;
}

.header-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  color: #5D4E37;
  font-weight: 500;
}

.header-save {
  width: 40px;
  text-align: right;
}

.save-text {
  font-size: 14px;
  color: #F0B83D;
  font-weight: 500;
}

.edit-date {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background-color: #FFF9F0;
}

.date-icon {
  font-size: 14px;
}

.date-text {
  font-size: 13px;
  color: #B8A88A;
}

.edit-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: #FFF9F0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.edit-title-input {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #5D4E37;
  line-height: 1.4;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
}

.edit-title-input::placeholder {
  color: #D4C8B0;
  font-size: 16px;
  font-weight: 500;
}

.title-hint {
  font-size: 12px;
  color: #D4C8B0;
  flex-shrink: 0;
}

.edit-content-wrapper {
  flex: 1;
  padding: 12px 20px;
}

.edit-textarea {
  width: 100%;
  min-height: 50vh;
  font-size: 15px;
  line-height: 1.9;
  color: #4A4A4A;
  background-color: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
}

.edit-textarea::placeholder {
  color: #D4C8B0;
  font-size: 15px;
}

.word-count {
  text-align: right;
  padding: 8px 20px 20px;
  font-size: 12px;
  color: #D4C8B0;
}

/* ========== 个人中心页样式 ========== */
.profile-page {
  padding-bottom: 30px;
}

.profile-header {
  margin-bottom: 24px;
}

.avatar-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-circle {
  width: 60px;
  height: 60px;
  background-color: #FFE082;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(255, 224, 130, 0.4);
}

.avatar-icon {
  font-size: 28px;
}

.avatar-info {
  display: flex;
  flex-direction: column;
}

.avatar-title {
  font-size: 18px;
  font-weight: 600;
  color: #5D4E37;
  margin-bottom: 4px;
}

.avatar-subtitle {
  font-size: 13px;
  color: #B8A88A;
}

.profile-section {
  margin-bottom: 20px;
}

.section-title {
  font-size: 13px;
  color: #B8A88A;
  margin-bottom: 8px;
  padding-left: 4px;
}

.list-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.warning-item {
  border: 1px solid #F0D5C8;
}

.version-text {
  font-size: 13px;
  color: #D4C8B0;
}

.no-arrow .list-item-arrow {
  display: none;
}

.profile-footer {
  text-align: center;
  padding: 20px 0;
  font-size: 12px;
  color: #E0D5C0;
  letter-spacing: 2px;
}

/* ========== 隐私/关于页样式 ========== */
.privacy-page {
  min-height: 100%;
  background-color: #FFF8E7;
}

.privacy-tabs {
  display: flex;
  background-color: #FFF9F0;
  padding: 0 20px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 10;
}

.tab-item {
  flex: 1;
  text-align: center;
  padding: 14px 0;
  font-size: 15px;
  color: #B8A88A;
  position: relative;
  transition: all 200ms ease;
}

.tab-active {
  color: #5D4E37;
  font-weight: 500;
}

.tab-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background-color: #F0B83D;
  border-radius: 1px;
}

.privacy-content {
  padding: 20px;
}

.privacy-block {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.privacy-icon {
  font-size: 20px;
}

.privacy-title {
  font-size: 18px;
  font-weight: 600;
  color: #5D4E37;
}

.privacy-text-block {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.privacy-num {
  width: 22px;
  height: 22px;
  background-color: #F0B83D;
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.privacy-text {
  flex: 1;
}

.privacy-item-title {
  font-size: 15px;
  font-weight: 500;
  color: #4A4A4A;
  margin-bottom: 4px;
}

.privacy-item-desc {
  font-size: 14px;
  color: #8B7E6A;
  line-height: 1.7;
}

.privacy-footer {
  text-align: center;
  padding: 30px 0 20px;
  font-size: 12px;
  color: #D4C8B0;
}

.about-content {
  padding: 24px 20px;
}

.about-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.about-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.about-name {
  font-size: 20px;
  font-weight: 600;
  color: #5D4E37;
  margin-bottom: 4px;
}

.about-slogan {
  font-size: 14px;
  color: #B8A88A;
}

.about-card {
  background-color: #FFFFFF;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.about-section-title {
  font-size: 15px;
  font-weight: 500;
  color: #5D4E37;
  margin-bottom: 10px;
}

.about-desc {
  font-size: 14px;
  color: #8B7E6A;
  line-height: 1.8;
  margin-bottom: 8px;
}

.about-desc:last-child {
  margin-bottom: 0;
}

.about-feature-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.about-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #4A4A4A;
}

.feature-icon {
  font-size: 16px;
}

.about-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #FFF8E7;
  font-size: 14px;
  color: #4A4A4A;
}

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

.about-info-value {
  color: #B8A88A;
}

.about-footer {
  text-align: center;
  padding: 24px 0;
  font-size: 14px;
  color: #F0B83D;
}

.about-footer-sub {
  font-size: 12px;
  color: #D4C8B0;
  margin-top: 4px;
}

/* ========== 响应式适配（2026-07 修复：桌面端限宽居中 + 移动端视口高度修正）========== */

/* 真实视口高度：现代浏览器用动态视口单位，JS 会再写入 --app-h 兜底旧 webview */
body { height: 100dvh; }

/* 应用框：手机全宽；桌面端限宽 480px 居中，呈现手机 App 形态 */
#app {
  max-width: 480px;
  margin: 0 auto;
  background-color: #FFF8E7;
}

/* 所有 left:0/right:0 的 fixed 元素同步约束进应用框 */
.page,
.custom-nav,
.tab-bar,
.privacy-hint {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* 日记页悬浮按钮贴应用框右缘（而非浏览器右缘） */
.fab-btn {
  right: max(24px, calc((100vw - 480px) / 2 + 24px));
}

/* 聊天页高度直接锚定真实视口高度，不再依赖父级百分比链，
   修复某些环境下消息区被压成 0 高、输入框被挤没的问题 */
#page-chat.active,
.chat-page {
  height: calc(var(--app-h, 100dvh) - 56px);
}
.chat-page {
  min-height: 0;
}

/* 桌面端宽屏：应用框加描边投影，外侧背景略深形成对比 */
@media (min-width: 520px) {
  body { background-color: #EFE7D3; }
  #app {
    border-left: 1px solid rgba(0,0,0,0.06);
    border-right: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 0 30px rgba(0,0,0,0.08);
  }
}

/* ========== 聊天导航遮挡修复（2026-07 第二次）==========
   导航栏由 fixed 改为文档流：聊天页本身是 flex 列布局，
   只有消息区滚动，导航自然吸顶，不再需要 JS 测量占位高度，
   彻底消除测量误差导致的首条消息被遮挡问题 */
.chat-page .custom-nav {
  position: static;
  flex-shrink: 0;
}
.chat-nav-placeholder {
  display: none !important;
}

/* ========== 导航标题换行修复（2026-07 第三次）==========
   部分浏览器（360/旧版 Chromium）对 绝对定位+translateX 的
   收缩宽度计算有 bug，会把标题压窄导致英文按空格换行 */
.nav-title {
  white-space: nowrap;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 导航区视觉微调：标题行增高 4px，工具栏上下更透气 */
.nav-content {
  height: 48px;
}
.chat-toolbar {
  padding: 6px 16px 10px;
}

/* ========== 系统大字体适配（2026-07 第四次）==========
   手机系统/微信「字体大小」调大后，浏览器会等比放大网页文字，
   导致固定像素高度的导航栏、Tab 栏被挤爆、换行、溢出。
   锁定文字缩放（与微信小程序行为一致），版式不随系统字体变化 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Tab 栏溢出保护：内容超出时裁剪而非撑破布局 */
.tab-bar-item {
  min-width: 0;
  overflow: hidden;
}
