/* Spark · 思想碰撞 */

.journal-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 100px;
}

.journal-header {
  padding: 16px 4px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.journal-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-dark);
  letter-spacing: 0.5px;
}

.journal-subtitle {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.journal-fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-coral) 0%, var(--accent-warm) 100%);
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(255, 138, 154, 0.4);
  position: fixed;
  right: 16px;
  bottom: 90px;
  z-index: 50;
  transition: transform 0.2s ease;
}

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

/* 时间轴 */
.timeline {
  position: relative;
  padding-left: 36px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg,
    var(--accent-coral) 0%,
    rgba(255, 138, 154, 0.3) 5%,
    rgba(255, 138, 154, 0.3) 95%,
    transparent 100%);
}

/* 时间分组标签 */
.timeline-group-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-fade);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 20px 0 12px -36px;
  padding-left: 36px;
  position: relative;
}

.timeline-group-label::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-cream);
  border: 2.5px solid var(--accent-coral);
  z-index: 1;
}

/* 帖子卡片 */
.post-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--r-xl);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  position: relative;
}

.post-card.post-hangzhou {
  border-left: 3px solid var(--accent-coral);
}

.post-card.post-shenyang {
  border-left: 3px solid var(--accent-warm);
}

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

.post-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-peach);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

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

.post-meta {
  flex: 1;
  min-width: 0;
}

.post-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-dark);
}

.post-side-label {
  font-size: 10px;
  color: var(--ink-fade);
  letter-spacing: 0.5px;
  margin-top: 1px;
}

.post-time {
  font-size: 11px;
  color: var(--ink-fade);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.post-content {
  font-size: 14px;
  color: var(--ink-dark);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 引用块 */
.post-quote {
  background: var(--bg-pink);
  border-left: 3px solid var(--accent-coral);
  padding: 10px 12px;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin: 10px 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
  cursor: pointer;
  position: relative;
}

.post-quote-author {
  font-size: 11px;
  color: var(--accent-coral);
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 操作栏 */
.post-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(43, 38, 34, 0.06);
}

.post-action {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--ink-fade);
  transition: background 0.2s ease;
}

.post-action:active {
  background: var(--bg-peach);
}

.post-action.active {
  color: var(--accent-coral);
  font-weight: 600;
}

.post-action.danger {
  color: var(--ink-fade);
  margin-left: auto;
}

.post-action.danger:active {
  background: rgba(231, 76, 60, 0.1);
  color: #c0392b;
}

.post-action.author-only {
  opacity: 0.5;
}

/* 评论列表 */
.comment-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(43, 38, 34, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment {
  display: flex;
  gap: 8px;
}

.comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-peach);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  overflow: hidden;
}

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

.comment-body {
  flex: 1;
  background: rgba(255, 244, 236, 0.5);
  border-radius: var(--r-md);
  padding: 8px 10px;
}

.comment-meta {
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 2px;
  font-weight: 600;
}

.comment-text {
  font-size: 13px;
  color: var(--ink-dark);
  line-height: 1.5;
  white-space: pre-wrap;
}

.comment-actions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  justify-content: flex-end;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.comment:hover .comment-actions {
  opacity: 1;
}

.comment-actions button {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink-fade);
  background: transparent;
  transition: all 0.15s ease;
}

.comment-actions button:active {
  background: var(--bg-pink);
  color: var(--accent-coral);
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.comment-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1.5px solid rgba(43, 38, 34, 0.1);
  font-size: 13px;
  font-family: var(--font-cn);
  color: var(--ink-dark);
  transition: border-color 0.2s ease;
}

.comment-input:focus {
  outline: none;
  border-color: var(--accent-coral);
}

.comment-send {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent-coral);
  color: white;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.comment-send:disabled {
  opacity: 0.5;
}

/* 引用某条时的提示 */
.quote-target {
  background: var(--bg-pink);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* ===== 全屏子页面（不是弹层，是独立页面） ===== */
.subpage {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg-cream);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.subpage[hidden] {
  display: none;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.subpage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(255, 244, 236, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(43, 38, 34, 0.06);
  position: sticky;
  top: 0;
  z-index: 5;
}

.subpage-back {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-coral);
  font-size: 15px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
}

.subpage-back:active {
  background: var(--bg-pink);
}

.subpage-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-dark);
  flex: 1;
  text-align: center;
  margin: 0 12px;
}

.subpage-action {
  color: var(--accent-coral);
  font-size: 15px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
}

.subpage-action:disabled {
  color: var(--ink-fade);
}

.subpage-action:active:not(:disabled) {
  background: var(--bg-pink);
}

.subpage-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

/* ===== 富文本编辑器 ===== */
.editor {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--r-md);
  border: 1.5px solid rgba(43, 38, 34, 0.1);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.editor:focus-within {
  border-color: var(--accent-coral);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: rgba(255, 244, 236, 0.6);
  border-bottom: 1px solid rgba(43, 38, 34, 0.08);
  flex-wrap: wrap;
}

.editor-tool {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--ink-soft);
  transition: all 0.15s ease;
  user-select: none;
}

.editor-tool:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink-dark);
}

.editor-tool:active {
  background: var(--bg-pink);
}

.editor-tool.active {
  background: var(--bg-pink);
  color: var(--accent-coral);
}

.editor-tool.bold { font-weight: 700; }
.editor-tool.italic { font-style: italic; }
.editor-tool.underline { text-decoration: underline; }
.editor-tool.strike { text-decoration: line-through; }

.editor-tool-sep {
  width: 1px;
  height: 20px;
  background: rgba(43, 38, 34, 0.1);
  margin: 0 4px;
}

.editor-content {
  min-height: 160px;
  max-height: 400px;
  overflow-y: auto;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-dark);
  outline: none;
  font-family: var(--font-cn);
}

.editor-content:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-fade);
  pointer-events: none;
}

.editor-content h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 8px 0;
}

.editor-content h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 6px 0;
}

.editor-content blockquote {
  border-left: 3px solid var(--accent-coral);
  padding: 4px 0 4px 12px;
  margin: 8px 0;
  color: var(--ink-soft);
  font-style: italic;
  background: var(--bg-pink);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.editor-content ul, .editor-content ol {
  padding-left: 24px;
  margin: 6px 0;
}

.editor-content li {
  margin: 2px 0;
}

.editor-content a {
  color: var(--accent-coral);
  text-decoration: underline;
}

.editor-emoji-popup {
  position: absolute;
  background: white;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  z-index: 100;
  min-width: 240px;
  border: 1.5px solid rgba(43, 38, 34, 0.06);
}

.editor-emoji-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.editor-emoji-btn:active {
  background: var(--bg-pink);
}

.editor-toolbar-wrap {
  position: relative;
  flex: 1;
}

/* 身份切换 tab */
.side-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.side-tab.active {
  background: var(--bg-pink);
  color: var(--ink-dark);
  border-color: var(--accent-coral);
  box-shadow: 0 2px 8px rgba(255, 138, 154, 0.2);
}

.side-tab:active {
  transform: scale(0.97);
}

.side-tab-avatar {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 50%;
  background: white;
}

.quote-target-text {
  flex: 1;
  line-height: 1.5;
}

.quote-target-remove {
  font-size: 16px;
  color: var(--ink-fade);
  padding: 0 4px;
}

/* 空状态 */
.journal-empty {
  text-align: center;
  padding: 60px 24px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--r-xl);
  border: 1.5px dashed rgba(43, 38, 34, 0.1);
  margin-top: 24px;
}

.journal-empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.journal-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-dark);
  margin-bottom: 8px;
}

.journal-empty-sub {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}
/* subpage 顶部上下文条（用于告诉用户当前在哪个 tab） */
.subpage-context-bar {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-fade);
  letter-spacing: 4px;
  text-transform: uppercase;
  padding: 14px 0 6px;
  background: rgba(255, 244, 236, 0.85);
  position: sticky;
  top: 0;
  z-index: 6;
}

.journal-page-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-dark);
  letter-spacing: 2px;
  margin: 12px 0 16px;
  position: relative;
}

.journal-page-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent-coral);
  border-radius: 2px;
  margin: 8px auto 0;
}
