:root {
  --bg: #FFF9FA;
  --bg2: #FFF0F3;
  --bg3: #ffffff;
  --ink: #3D3D3D;
  --muted: #9A9A9A;
  --rule: #F0E0E5;
  --accent: #E8A0BF;
  --accent-light: #F5C8DB;
  --accent-soft: rgba(232, 160, 191, 0.12);
  --accent2: #A8D8EA;
  --accent2-light: #CDEEF8;
  --accent2-soft: rgba(168, 216, 234, 0.15);
  --danger: #F5A0A0;
  --danger-soft: rgba(245, 160, 160, 0.1);
  --shadow-sm: 0 2px 12px rgba(232, 160, 191, 0.08);
  --shadow: 0 6px 24px rgba(232, 160, 191, 0.12);
  --shadow-lg: 0 12px 40px rgba(232, 160, 191, 0.18);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-pill: 100px;
  --serif: 'Noto Serif SC', 'PingFang SC', 'Microsoft YaHei', serif;
  --sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: linear-gradient(180deg, #FFF0F3 0%, #FFF9FA 50%, #FAFBFD 100%);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea {
  font-family: inherit;
  color: inherit;
}

::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.gender-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 42, 38, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.gender-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.gender-modal {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 320px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform .3s;
}

.gender-modal-overlay.active .gender-modal {
  transform: scale(1);
}

.gender-modal h3 {
  font-family: var(--serif);
  font-size: 20px;
  text-align: center;
  margin-bottom: 8px;
}

.gender-modal p {
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  color: var(--muted);
  margin-bottom: 20px;
}

.gender-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.gender-option {
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .2s;
  border: 2px solid transparent;
}

.gender-option .emoji {
  font-size: 28px;
}

.gender-option .label {
  font-size: 12px;
  color: var(--muted);
}

.gender-option.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: scale(1.04);
}

.gender-option.selected .label {
  color: var(--accent);
}

.gender-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gender-actions .btn {
  width: 100%;
  padding: 13px;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  transition: opacity .25s ease, transform .25s ease;
  background: var(--bg);
}

.page.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.header {
  flex-shrink: 0;
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, rgba(255, 249, 250, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
  position: relative;
  z-index: 2;
  border-bottom: 1px solid rgba(232, 160, 191, 0.08);
}

.header-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.icon-btn:hover {
  background: var(--bg2);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  stroke: var(--ink);
  stroke-width: 1.8;
  fill: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  transition: transform .15s, box-shadow .2s, opacity .2s;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #D680A0 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(232, 160, 191, 0.4);
  position: relative;
  overflow: hidden;
}

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

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

.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(232, 160, 191, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg2);
  color: var(--ink);
  border: 1.5px solid rgba(232, 160, 191, 0.2);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 10px 16px;
  border: 1.5px solid var(--accent);
  transition: all 0.2s ease;
}

.btn-ghost:hover {
  background: var(--accent-soft);
}

.card {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(232, 160, 191, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-elevated {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(232, 160, 191, 0.12);
}

.scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 20px 100px;
}

.onboarding {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.onboarding-logo {
  flex: 0.4;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
}

.onboarding-logo-mark {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(196, 120, 90, 0.3);
  position: relative;
}

.onboarding-logo-mark::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.onboarding-logo-mark svg {
  width: 42px;
  height: 42px;
  stroke: #fff;
  stroke-width: 1.6;
  fill: none;
}

.onboarding-title {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}

.onboarding-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 36px;
}

.onboarding-section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.emotion-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 36px;
}

.emotion-pick {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all .2s;
  border: 2px solid transparent;
}

.emotion-pick .emoji {
  font-size: 24px;
}

.emotion-pick .label {
  font-size: 11px;
  color: var(--muted);
}

.emotion-pick.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: scale(1.04);
}

.emotion-pick.selected .label {
  color: var(--accent);
}

.tabbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(232, 160, 191, 0.15);
  display: flex;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  z-index: 10;
  box-shadow: 0 -4px 20px rgba(232, 160, 191, 0.08);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  color: var(--muted);
  transition: all 0.25s ease;
  border-radius: var(--radius-sm);
}

.tab:hover {
  background: rgba(232, 160, 191, 0.08);
}

.tab svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  transition: all 0.25s ease;
}

.tab-label {
  font-size: 11px;
  font-weight: 500;
}

.tab.active {
  color: var(--accent);
  background: rgba(232, 160, 191, 0.08);
}

.tab.active svg {
  stroke-width: 2;
  transform: translateY(-2px);
}

.chat-list-empty {
  text-align: center;
  padding: 80px 30px;
  color: var(--muted);
}

.chat-list-empty .emoji {
  font-size: 56px;
  display: block;
  margin-bottom: 16px;
  opacity: 0.5;
}

.chat-list-empty h3 {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
  margin-bottom: 8px;
  font-weight: 700;
}

.chat-list-empty p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 24px;
}

.chat-item {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg3);
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  align-items: center;
  transition: all 0.2s ease;
  border: 1px solid rgba(232, 160, 191, 0.08);
}

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

.chat-item:active {
  transform: scale(0.98);
}

.chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(196, 120, 90, 0.25);
  overflow: hidden;
}

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

.chat-content {
  flex: 1;
  min-width: 0;
}

.chat-content-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.chat-name {
  font-weight: 500;
  font-size: 15px;
}

.chat-time {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.chat-preview {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-emotion-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 500;
  flex-shrink: 0;
}

.fab {
  position: absolute;
  right: 20px;
  bottom: calc(84px + var(--safe-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(196, 120, 90, 0.4);
  z-index: 9;
  transition: transform .2s;
}

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

.fab svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.chat-detail .header {
  background: linear-gradient(180deg, rgba(255, 249, 250, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
  border-bottom: 1px solid rgba(232, 160, 191, 0.08);
  padding-top: 14px;
  padding-bottom: 12px;
}

.chat-detail-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-btn svg {
  width: 22px;
  height: 22px;
  stroke: var(--ink);
  stroke-width: 1.8;
  fill: none;
}

.chat-detail-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
}

.chat-detail-name {
  font-weight: 500;
  font-size: 15px;
}

.chat-detail-status {
  font-size: 11px;
  color: var(--accent2);
}

.chat-detail-status.offline {
  color: var(--muted);
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 100px;
}

.msg-day {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin: 12px 0;
}

.msg {
  display: flex;
  margin-bottom: 14px;
  gap: 8px;
  max-width: 100%;
  animation: msgIn .3s ease;
}

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

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

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

.msg-bubble {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 75%;
  word-break: break-word;
  position: relative;
}

.msg.ai .msg-bubble {
  background: var(--bg3);
  border-top-left-radius: 6px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(232, 160, 191, 0.08);
}

.msg.user {
  flex-direction: row-reverse;
}

.msg.user .msg-bubble {
  background: linear-gradient(135deg, var(--accent) 0%, #D680A0 100%);
  color: #fff;
  border-top-right-radius: 6px;
  box-shadow: 0 4px 12px rgba(232, 160, 191, 0.3);
}

.msg-time {
  font-size: 10px;
  color: var(--muted);
  align-self: flex-end;
  margin-bottom: 2px;
  padding: 0 4px;
}

.msg-crisis {
  max-width: 100%;
  margin: 16px 0;
}

.msg-crisis-card {
  background: var(--danger-soft);
  border: 1.5px solid var(--danger);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.msg-crisis-card h4 {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--danger);
  margin-bottom: 8px;
}

.msg-crisis-card p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 14px;
}

.msg-crisis-card .hotline-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.hotline-item {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.hotline-item .name {
  color: var(--ink);
}

.hotline-item .num {
  color: var(--danger);
  font-weight: 700;
  font-family: var(--serif);
}

.crisis-actions {
  display: flex;
  gap: 8px;
}

.crisis-actions .btn {
  flex: 1;
  padding: 11px;
  font-size: 14px;
}

.input-area {
  flex-shrink: 0;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.emotion-quick {
  display: flex;
  gap: 4px;
  align-items: center;
}

.emotion-quick button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  border: 1px solid rgba(232, 160, 191, 0.15);
  background: rgba(255, 255, 255, 0.7);
}

.emotion-quick button:hover {
  background: rgba(232, 160, 191, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232, 160, 191, 0.15);
}

.emotion-quick button:active {
  transform: scale(0.9);
}

.input-wrap {
  flex: 1;
  background: var(--bg3);
  border-radius: 22px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  min-height: 40px;
  box-shadow: var(--shadow-sm);
}

.input-wrap textarea {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 15px;
  line-height: 1.4;
  max-height: 100px;
  min-height: 22px;
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .2s, transform .15s;
}

.send-btn:disabled {
  opacity: 0.4;
}

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

.send-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  align-items: center;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing 1.2s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.post-item {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(232, 160, 191, 0.08);
  transition: all 0.25s ease;
}

.post-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.post-emotion-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
}

.post-time {
  font-size: 12px;
  color: var(--muted);
}

.post-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-visibility {
  font-size: 12px;
  color: var(--muted);
}

.post-actions {
  display: flex;
  gap: 4px;
}

.post-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg2);
  border: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.post-action-btn:active {
  background: var(--bg3);
  transform: scale(0.9);
}

.post-content {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 12px;
  word-break: break-word;
}

.post-ai-reply {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.post-ai-reply-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.post-ai-reply-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-ai-reply-content {
  flex: 1;
}

.post-ai-reply-name {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 2px;
}

.post-ai-reply-text {
  font-size: 14px;
  line-height: 1.6;
}

.publish-page {
  background: var(--bg);
  padding: 0;
}

.publish-textarea {
  width: 100%;
  /* min-height: 200px; */
  height: 150px;
  border: none;
  outline: none;
  resize: none;
  padding: 24px 20px;
  background: var(--bg3);
  border-radius: var(--radius);
  /* margin: 16px 20px; */
  margin: 16px 0;
  /* width: calc(100% - 40px); */
  font-size: 16px;
  line-height: 1.7;
  box-shadow: var(--shadow-sm);
}

.publish-section {
  /* padding: 0 20px; */
  margin-bottom: 24px;
}

.publish-section-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  letter-spacing: 0.06em;
}

.publish-emotion-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.publish-emotion-pick {
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all .2s;
  border: 2px solid transparent;
}

.publish-emotion-pick .emoji {
  font-size: 22px;
}

.publish-emotion-pick .label {
  font-size: 10px;
  color: var(--muted);
}

.publish-emotion-pick.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: scale(1.04);
}

.publish-emotion-pick.selected .label {
  color: var(--accent);
}

.publish-intensity {
  display: flex;
  gap: 8px;
}

.publish-intensity-pick {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  text-align: center;
  font-size: 13px;
  transition: all .2s;
  border: 2px solid transparent;
}

.publish-intensity-pick.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

.publish-visibility {
  display: flex;
  gap: 8px;
}

.publish-visibility-pick {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  text-align: center;
  font-size: 13px;
  transition: all .2s;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.publish-visibility-pick .icon {
  font-size: 16px;
}

.publish-visibility-pick.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

.publish-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 20px calc(14px + var(--safe-bottom));
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 10px;
}

.publish-actions .btn {
  flex: 1;
  padding: 13px;
}

.profile-hero {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(196, 120, 90, 0.3);
}

.profile-hero-info {
  flex: 1;
}

.profile-hero-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-hero-sub {
  font-size: 12px;
  color: var(--muted);
}

.edit-nickname-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg2);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.edit-nickname-btn:hover {
  background: var(--accent-soft);
}

.edit-nickname-btn svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent);
}

#nicknameInput {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: var(--bg2);
  color: var(--ink);
  margin: 16px 0;
  outline: none;
  transition: border-color 0.2s ease;
}

#nicknameInput:focus {
  border-color: var(--accent);
}

#nicknameInput::placeholder {
  color: var(--muted);
}

.profile-section-title {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 16px 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-section-title::before {
  content: '';
  width: 4px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}

.menu-list {
  background: var(--bg3);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.menu-item {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--rule);
  transition: background .15s;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:active {
  background: var(--bg2);
}

.menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  stroke-width: 1.8;
  fill: none;
}

.menu-text {
  flex: 1;
  font-size: 15px;
}

.menu-arrow {
  color: var(--muted);
  font-size: 18px;
}

.menu-value {
  font-size: 13px;
  color: var(--muted);
}

.role-form {
  padding: 0 20px 100px;
}

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

.form-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--bg3);
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
  font-family: var(--sans);
  resize: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 160, 191, 0.1);
}

.hidden {
  display: none !important;
}

.form-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.form-option {
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 2px solid var(--rule);
  text-align: center;
  font-size: 14px;
  transition: all .2s;
}

.form-option.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 140px;
}

.avatar-pick {
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  transition: all .2s;
  position: relative;
}

.avatar-pick img {
  width: 75px;
  height: 75px;
  border-radius: 50%;
}

.timeline-month {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin: 8px 4px 16px;
}

.timeline-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 24px;
}

.timeline-day-header {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0;
}

.timeline-day {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  transition: all .2s;
  cursor: pointer;
  position: relative;
}

.timeline-day.has-emotion {
  color: #fff;
  font-weight: 500;
}

.timeline-day.has-emotion::after {
  content: attr(data-emoji);
  position: absolute;
  font-size: 16px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.timeline-day .day-num {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 9px;
  opacity: 0.7;
}

.timeline-day.today {
  border: 1.5px solid var(--accent);
}

.emotion-color-low {
  background: #b8a99a;
}

.emotion-color-anxious {
  background: #c4785a;
}

.emotion-color-lonely {
  background: #8e9eb4;
}

.emotion-color-angry {
  background: #d97757;
}

.emotion-color-happy {
  background: #7a9e8e;
}

.emotion-color-neutral {
  background: #9ca3af;
}

.timeline-summary {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.timeline-summary h4 {
  font-family: var(--serif);
  font-size: 16px;
  margin-bottom: 10px;
}

.timeline-summary p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
}

.timeline-entry {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 12px;
  align-items: center;
}

.timeline-entry-emoji {
  font-size: 22px;
  flex-shrink: 0;
}

.timeline-entry-content {
  flex: 1;
  min-width: 0;
}

.timeline-entry-text {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-entry-time {
  font-size: 11px;
  color: var(--muted);
}

.crisis-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 42, 38, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.crisis-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.crisis-modal {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform .3s;
}

.crisis-overlay.active .crisis-modal {
  transform: scale(1);
}

.crisis-modal h3 {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--danger);
  text-align: center;
  margin-bottom: 12px;
}

.crisis-modal p {
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
  color: var(--ink);
  margin-bottom: 20px;
}

.crisis-hotline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.crisis-hotline {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.crisis-hotline-info {
  flex: 1;
}

.crisis-hotline-name {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 2px;
}

.crisis-hotline-num {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--danger);
}

.crisis-hotline-call {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crisis-hotline-call svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.toast {
  position: fixed;
  bottom: calc(100px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
  z-index: 200;
  white-space: nowrap;
}

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

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

.empty-state .emoji {
  font-size: 48px;
  opacity: 0.4;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-family: var(--serif);
  font-size: 18px;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  color: var(--muted);
}

.about-content {
  padding: 8px 0;
}

.about-section {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.about-section h4 {
  font-family: var(--serif);
  font-size: 16px;
  margin-bottom: 10px;
}

.about-section p {
  font-size: 14px;
  line-height: 1.7;
}

.feedback-section textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  resize: none;
  outline: none;
  transition: all 0.2s ease;
  font-family: var(--sans);
  /* box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05); */
  min-height: 120px;
  line-height: 1.6;
}

.feedback-section textarea:focus {
  border-color: var(--accent);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 0 0 3px rgba(239, 129, 129, 0.1);
}

.feedback-section textarea::placeholder {
  color: var(--muted);
}

.feedback-section input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: all 0.2s ease;
  font-family: var(--sans);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.feedback-section input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 0 0 3px rgba(239, 129, 129, 0.1);
}

.feedback-section input[type="text"]::placeholder {
  color: var(--muted);
}

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

.feedback-type-btn {
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  background: var(--bg2);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.feedback-type-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.feedback-type-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.feedback-textarea-wrap {
  position: relative;
}

.feedback-word-count {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 12px;
  color: var(--muted);
}

.feedback-card {
  background: var(--bg3);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  margin-top: 16px;
}

.feedback-section {
  padding: 8px 0;
}

.feedback-section h4 {
  font-family: var(--serif);
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--ink);
}

.feedback-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.hotline-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--danger-soft);
  border-radius: var(--radius-sm);
  color: var(--danger);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.about-version {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 16px;
}

.swipe-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.swipe-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  height: 80px;
}

.swipe-actions {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.swipe-content {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 2;
  background: var(--bg3);
  transition: transform 0.2s ease;
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  align-items: center;
}

.swipe-content:active {
  transform: scale(0.98);
}

.swipe-delete-btn {
  background: var(--danger);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  padding: 0 28px;
  height: 100%;
  width: 100px;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.danger-btn {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1.5px solid var(--danger);
  border-radius: var(--radius);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  margin-bottom: 10px;
}

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

.danger-btn:active {
  transform: scale(0.98);
}

.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 61, 61, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.confirm-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.confirm-modal {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 320px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform .3s;
}

.confirm-modal-overlay.active .confirm-modal {
  transform: scale(1);
}

.confirm-modal h3 {
  font-family: var(--serif);
  font-size: 20px;
  text-align: center;
  margin-bottom: 8px;
  color: var(--ink);
}

.confirm-modal p {
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  color: var(--muted);
  margin-bottom: 20px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions .btn {
  flex: 1;
  padding: 13px;
}

.btn-danger {
  background: linear-gradient(135deg, #FF8E8E 0%, #E86B6B 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255, 142, 142, 0.4);
}