@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=Noto+Serif+SC:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Zhi+Mang+Xing&display=swap');

:root {
  --bg-base: #f7f6f0;                  /* 温润的天然燕麦色 / 暖白细砂色 */
  --bg-surface: #ffffff;               /* 宣纸白，高洁无瑕的卡片表盘 */
  --bg-accent-soft: #e9ece9;           /* 极淡的鼠尾草绿，用于次要交互与底色 */
  --primary: #6e8577;                  /* 核心主调：静谧鼠尾草绿 */
  --primary-rgb: 110, 133, 119;
  --primary-dark: #53665a;
  --secondary: #9fa8a3;                /* 辅调：水雾灰 / 干花灰 */
  --secondary-rgb: 159, 168, 163;
  --accent: #cfb095;                   /* 强调：暖木沙 / 晚霞色，主观延展打分 */
  --accent-rgb: 207, 176, 149;
  --danger: #b91c1c;                   /* 克制的朱红，用于清除和错误提示 */
  --text-main: #2f3a34;                /* 核心文字：深石墨绿，保护视力且极致温和 */
  --text-muted: #728277;               /* 辅助文字：淡水墨绿 */
  --border: rgba(110, 133, 119, 0.12); /* 极细极淡的灰绿边框 */
  --border-focus: rgba(110, 133, 119, 0.35);
  --shadow-main: 0 10px 40px -10px rgba(47, 58, 52, 0.05); /* 超级松软弥散的禅意阴影 */
  --shadow-hover: 0 16px 48px -8px rgba(47, 58, 52, 0.09);
  
  /* 字体族 */
  --font-title: 'Noto Serif SC', -apple-system, BlinkMacSystemFont, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif-en: 'Lora', Georgia, serif;
  --font-handwriting: 'Zhi Mang Xing', cursive, serif;

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 6px;
}

/* 基础复位 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-base);
  background-image: linear-gradient(180deg, #f7f6f0 0%, #eff2ee 100%);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.7;
}

/* 禅意背景微光色块 (极淡的色彩呼吸) */
.zen-bg-glow {
  position: absolute;
  top: 10%;
  left: 15%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 133, 119, 0.08) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  animation: zen-float 25s infinite alternate ease-in-out;
}

@keyframes zen-float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 40px) scale(1.15); }
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: rgba(110, 133, 119, 0.15);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* 极简容器 */
.container {
  max-width: 720px; /* INFJ 极简单列排版的核心约束宽度 */
  margin: 0 auto;
  padding: 40px 24px;
}

/* 禅意头部 */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-text {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 24px;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 极简连击与点亮提示器 */
.streak-badge-minimal {
  font-family: var(--font-title);
  font-size: 13.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.stats-divider {
  color: var(--border);
  font-size: 10px;
}

/* 按钮系列 */
.btn-round {
  width: 38px;
  height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-main);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-round:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

/* 主面板：禅意单列聚焦 */
.main-focused {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* 3. 禅意环境与个性化折叠手风琴 */
.zen-accordion {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  overflow: hidden;
  transition: all 0.3s ease;
}

.zen-accordion-trigger {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-main);
  outline: none;
}

.zen-accordion-trigger::-webkit-details-marker {
  display: none;
}

.trigger-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trigger-chevron {
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.zen-accordion[open] .trigger-chevron {
  transform: rotate(180deg);
}

.zen-accordion-content {
  padding: 0 20px 20px 20px;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: zen-slide-down 0.3s ease;
}

@keyframes zen-slide-down {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 过滤行与控件 */
.filter-row {
  display: flex;
  gap: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* 极简温润表单输入 */
.input-text {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-accent-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 13.5px;
  outline: none;
  transition: all 0.3s;
}

.input-text:focus {
  background: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(110, 133, 119, 0.1);
}

select.input-text {
  appearance: none;
  cursor: pointer;
}

/* 极简芯片选择器 (Chips) */
.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  padding: 6px 14px;
  background: var(--bg-accent-soft);
  border: 1px solid transparent;
  border-radius: 50px;
  font-family: var(--font-title);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.filter-chip:hover {
  background: rgba(110, 133, 119, 0.1);
  color: var(--primary);
}

.filter-chip.selected {
  background: var(--primary);
  color: var(--bg-surface);
  box-shadow: 0 4px 12px -2px rgba(110, 133, 119, 0.25);
}

/* 模式切换 Tab (克制素雅风格) */
.mode-tabs {
  display: flex;
  background: var(--bg-accent-soft);
  padding: 4px;
  border-radius: 50px;
  gap: 4px;
}

.mode-tabs .btn {
  border: none;
  background: transparent;
  padding: 8px 16px;
  font-family: var(--font-title);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mode-tabs #mode-btn-solo.btn-primary,
.mode-tabs #mode-btn-buddy.btn-primary {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

/* 每日火花卡片 (The Serene Spark Card) */
.spark-card-container {
  perspective: 1500px;
  width: 100%;
  height: 380px;
}

.spark-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
  cursor: pointer;
}

.spark-card-container.revealed .spark-card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

/* 卡片正面：未揭晓的极致素雅 */
.card-front {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-main);
  overflow: hidden;
}

.card-front:hover {
  box-shadow: var(--shadow-hover);
}

.locked-spark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 2;
  text-align: center;
  padding: 32px;
}

.spark-orb {
  width: 64px;
  height: 64px;
  background: var(--bg-accent-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  transition: all 0.5s ease;
}

.card-front:hover .spark-orb {
  transform: scale(1.05) rotate(15deg);
  background: rgba(110, 133, 119, 0.15);
}

.locked-spark h2 {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
}

.locked-spark p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.5;
}

/* 卡片背面：火花详情手账面 */
.card-back {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transform: rotateY(180deg);
  box-shadow: var(--shadow-main);
  padding: 32px;
  justify-content: space-between;
}

/* 卡片背部排版细节 */
.card-header-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 50px;
  color: var(--primary);
  background: var(--bg-accent-soft);
}

.difficulty-indicator {
  display: flex;
  gap: 3px;
}

.diff-star {
  color: var(--bg-accent-soft);
  fill: var(--bg-accent-soft);
}

.diff-star.filled {
  color: var(--accent);
  fill: var(--accent);
}

.card-body {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-title {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}

.card-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.card-benefit {
  background: var(--bg-base);
  border-left: 2px solid var(--primary);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.5;
}

/* 按钮动作 */
.card-footer {
  display: flex;
  gap: 12px;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-title);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-primary {
  background: var(--primary);
  color: var(--bg-surface);
}

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

.btn-secondary {
  background: var(--bg-accent-soft);
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--primary);
}

.btn-accent {
  background: var(--accent);
  color: var(--bg-surface);
}

.btn-accent:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary:disabled, .btn-secondary:disabled, .btn-accent:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* 计时器与好友输入面板优化 */
.timer-glow {
  font-family: var(--font-serif-en) !important;
  font-size: 26px !important;
  font-weight: 600 !important;
  color: var(--primary) !important;
  letter-spacing: 1px;
}

/* 记忆手账画廊区域 */
.chronicle-section {
  margin-top: 48px;
}

.section-title-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 10px;
}

.section-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 禅意极简统计条 */
.zen-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-main);
  gap: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.stat-label {
  font-family: var(--font-title);
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.stat-value {
  font-family: var(--font-serif-en);
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.stat-divider-vertical {
  width: 1px;
  height: 28px;
  background: var(--border);
}

.dilation-progress-container {
  width: 100%;
  height: 6px;
  background: var(--bg-accent-soft);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 4px;
}

.dilation-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.polaroid-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.empty-chronicle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}

/* 极致极简卡片画册 (The Zen Paper Diary) */
.polaroid-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s;
}

.polaroid-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.polaroid-img-container {
  width: 100%;
  height: 240px;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.polaroid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.polaroid-card:hover .polaroid-img {
  transform: scale(1.02);
}

.polaroid-img-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  background-color: var(--bg-accent-soft);
}

/* 挚友勋章与监督气泡 */
.polaroid-badge-verified {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: var(--bg-surface);
  font-family: var(--font-title);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 50px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.polaroid-date {
  font-family: var(--font-serif-en);
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}

.polaroid-caption {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.polaroid-dilation-badge {
  font-size: 11px;
  font-weight: 600;
  background: rgba(207, 176, 149, 0.15);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

.polaroid-diary {
  font-family: var(--font-title);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-main);
  white-space: pre-wrap;
  background: linear-gradient(rgba(110, 133, 119, 0.04) 1px, transparent 1px);
  background-size: 100% 28px;
  line-height: 28px;
  padding: 4px 0;
}

/* AI 评语微光便签 (Sticky comment) */
.polaroid-buddy-bubble {
  background: var(--bg-base);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-title);
  font-size: 12px;
  line-height: 1.6;
  color: var(--primary);
  margin-top: 4px;
}

.polaroid-remove-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  z-index: 5;
  transition: all 0.25s;
}

.polaroid-card:hover .polaroid-remove-btn {
  opacity: 1;
}

.polaroid-remove-btn:hover {
  background: #fee2e2;
  color: var(--danger);
  border-color: #fca5a5;
}

/* 禅意对话框 (Serene Modal Dialog) */
.form-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(47, 58, 52, 0.12); /* 柔和暗绿遮罩 */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.form-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.zen-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(47, 58, 52, 0.08);
  width: 100%;
  max-width: 520px;
  padding: 32px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.form-backdrop.active .zen-dialog {
  transform: scale(1);
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.form-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-main);
}

.active-spark-banner {
  background: var(--bg-base);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

/* 表单组 */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.upload-area {
  border: 1px dashed var(--primary);
  background: var(--bg-accent-soft);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.upload-area:hover {
  background: rgba(110, 133, 119, 0.1);
  border-color: var(--primary-dark);
}

.upload-icon {
  color: var(--primary);
}

.upload-text {
  font-family: var(--font-title);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.upload-preview-container {
  display: none;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 200px;
  background: var(--bg-base);
}

.upload-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
}

.upload-remove:hover {
  background: #fee2e2;
  color: var(--danger);
}

/* 滑块 Range 禅意重塑 */
.range-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.input-range {
  flex: 1;
  appearance: none;
  height: 6px;
  background: var(--bg-accent-soft);
  border-radius: 10px;
  outline: none;
}

.input-range::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(110, 133, 119, 0.3);
  transition: transform 0.2s;
}

.input-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-label {
  font-family: var(--font-serif-en);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  min-width: 20px;
}

/* 监督官性格卡片重构 */
.buddy-persona-card {
  background: var(--bg-accent-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.buddy-persona-card:hover {
  background: rgba(110, 133, 119, 0.1);
}

.buddy-persona-card.selected {
  background: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: var(--shadow-main);
}

.persona-icon {
  font-size: 22px;
  margin-bottom: 4px;
}

.persona-name {
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.persona-desc {
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 2px;
}

/* 设置 Tab 开关 */
.settings-tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.settings-tab-btn {
  background: transparent;
  border: none;
  font-family: var(--font-title);
  font-size: 13.5px;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  padding: 6px 2px;
}

.settings-tab-btn.active {
  color: var(--primary);
  font-weight: 600;
}

.settings-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -13px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  border-radius: 20px;
}

.api-key-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.api-key-toggle-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* 禅意 Toast 通知 */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(47, 58, 52, 0.08);
  border-radius: 50px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-main);
  animation: toast-in 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast-success i {
  color: var(--primary);
}

.toast-error i {
  color: var(--danger);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 极简页脚 */
footer {
  margin-top: 60px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-text {
  font-family: var(--font-title);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--primary);
  font-family: var(--font-title);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
  outline: none;
}

.btn-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* 骨架屏动画 */
.skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-line {
  height: 12px;
  background: var(--bg-accent-soft);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.skeleton-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  100% { transform: translateX(100%); }
}

/* 移动端细调 */
@media (max-width: 480px) {
  .container {
    padding: 24px 16px;
  }
  
  header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 16px;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .filter-row {
    flex-direction: column;
    gap: 12px;
  }
  
  .spark-card-container {
    height: 420px;
  }
}

/* ==========================================================================
   LIFE SPARKS V2 - 青春元气与 INFJ 融合设计系统 (Aesthetic Additions)
   ========================================================================== */

:root {
  /* V2 新活力点缀色 */
  --accent-coral: #ff7a59;       /* 元气珊瑚橙 - 象征热情、梦想与羁绊连接 */
  --accent-coral-rgb: 255, 122, 89;
  --accent-apricot: #ffb830;     /* 金黄杏仁色 - 用于星星、梦想发布和徽章 */
  --accent-sky: #5c93e6;         /* 轻柔晴空蓝 - 用于同城匹配和雷达扫描 */
  --accent-sky-rgb: 92, 147, 230;
}

/* 1. 粉彩梦幻微光流动背景 */
body {
  background: linear-gradient(-45deg, #f7f6f0, #ffe6e0, #e6f0fa, #edf7eb);
  background-size: 400% 400%;
  animation: gradient-flow 25s ease infinite;
}

@keyframes gradient-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* 2. Top Navigation Tabs (顶级双药丸 Tab 导航) */
.main-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 5px;
  border-radius: 50px;
  border: 1px solid rgba(110, 133, 119, 0.08);
  gap: 6px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px 0 rgba(110, 133, 119, 0.02);
}

.main-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 20px;
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
}

.main-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.5);
}

.main-tab-btn.active {
  background: var(--primary);
  color: var(--bg-surface);
  box-shadow: 0 6px 15px -3px rgba(110, 133, 119, 0.25);
}

#main-tab-dream.active {
  background: var(--accent-coral);
  box-shadow: 0 6px 15px -3px rgba(255, 122, 89, 0.25);
}

/* Q弹的按钮与选项卡物理悬停反馈 */
.btn, .btn-round, .main-tab-btn, .filter-chip, .buddy-persona-card, .chat-quick-btn {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.btn:hover, .btn-round:hover, .filter-chip:hover:not(.selected), .buddy-persona-card:hover:not(.selected), .chat-quick-btn:hover {
  transform: scale(1.03) translateY(-2px);
}

.btn:active, .btn-round:active, .filter-chip:active {
  transform: scale(0.97) translateY(0);
}

.main-tab-btn:hover:not(.active) {
  transform: scale(1.02) translateY(-1px);
}

/* 3. 同城火花羁绊中心 (Same-City Spark Bond UI) */
#buddy-interface-container {
  background: rgba(255, 255, 255, 0.75) !important;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 15px 40px -10px rgba(47, 58, 52, 0.05) !important;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 雷达按钮与扫描脉冲 */
.btn-radar-pulse {
  position: relative;
  overflow: hidden;
}

.btn-radar-pulse::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: pulse-ring 2.2s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.2);
    opacity: 0;
  }
}

/* 同城雷达脉冲水波纹 */
.radar-circle {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-wave {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid var(--accent-sky);
  border-radius: 50%;
  opacity: 0;
  animation: radar-pulsate 3s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

.radar-avatar-center {
  width: 52px;
  height: 52px;
  background: var(--accent-sky);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 25px rgba(92, 147, 230, 0.4);
  z-index: 2;
  animation: float-avatar 3s ease-in-out infinite;
}

@keyframes radar-pulsate {
  0% {
    transform: scale(0.3);
    opacity: 0.8;
  }
  50% {
    opacity: 0.45;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

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

/* 雷达发现的探索者卡片 */
.companion-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(110, 133, 119, 0.08);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: zen-slide-down 0.4s ease;
}

.companion-card:hover {
  border-color: var(--accent-sky);
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(92, 147, 230, 0.08);
}

.companion-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.companion-avatar {
  font-size: 24px;
  width: 42px;
  height: 42px;
  background: var(--bg-accent-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.companion-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.companion-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
}

.companion-distance {
  font-size: 11px;
  color: var(--text-muted);
}

.companion-spark-aim {
  font-size: 11.5px;
  color: var(--accent-sky);
  font-weight: 600;
}

/* 缔结羁绊双方卡片同框 */
.bond-partners {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  border: 1px solid rgba(110, 133, 119, 0.05);
}

.bond-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.bond-avatar {
  width: 52px;
  height: 52px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: var(--shadow-main);
  transition: all 0.3s;
}

.bond-member.me .bond-avatar {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(110, 133, 119, 0.2);
}

.bond-member.partner .bond-avatar {
  border-color: var(--accent-sky);
  box-shadow: 0 0 12px rgba(92, 147, 230, 0.2);
}

.bond-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
}

.bond-status {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-accent-soft);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.bond-status.active {
  background: rgba(110, 133, 119, 0.15);
  color: var(--primary-dark);
}

.bond-status.ready {
  background: rgba(92, 147, 230, 0.15);
  color: var(--accent-sky);
  animation: heartbeat-text 1.5s infinite;
}

@keyframes heartbeat-text {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* 红色命运羁绊丝线 */
.bond-line {
  position: relative;
  flex: 2;
  height: 4px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bond-line-glow {
  position: absolute;
  left: 0;
  width: 0%;
  height: 100%;
  background: #ff4d4d; /* 命运红丝线 */
  box-shadow: 0 0 8px rgba(255, 77, 77, 0.6);
  transition: width 2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bond-line.active .bond-line-glow {
  width: 100%;
}

.bond-heart {
  position: relative;
  font-size: 18px;
  z-index: 10;
  transition: transform 0.3s;
  cursor: default;
}

.bond-line.active .bond-heart {
  animation: heart-beat 1.2s infinite;
}

@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* 羁绊共享聊天区 */
.bond-chat-box {
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-md);
  border: 1px solid rgba(110, 133, 119, 0.06);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubbles {
  height: 160px;
  overflow-y: auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.5;
  font-family: var(--font-title);
  animation: zen-slide-down 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.chat-bubble.me {
  background: var(--primary);
  color: var(--bg-surface);
  align-self: flex-end;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 10px rgba(110, 133, 119, 0.15);
}

.chat-bubble.partner {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.chat-bubble.system {
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  align-self: center;
  text-align: center;
  max-width: 100%;
  font-style: italic;
  padding: 2px 8px;
}

.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px dashed rgba(110, 133, 119, 0.08);
  padding-top: 10px;
}

.chat-quick-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--font-title);
  box-shadow: var(--shadow-main);
}

.chat-quick-btn:hover {
  background: var(--bg-accent-soft);
  color: var(--primary-dark);
  border-color: var(--primary);
}

/* 4. 双人命运连线拍立得回忆卡 */
.polaroid-card.bond-card {
  border: 1.5px solid rgba(255, 77, 77, 0.12);
  box-shadow: 0 10px 30px rgba(255, 77, 77, 0.03);
}

.bond-polaroid-container {
  display: flex;
  gap: 20px;
  position: relative;
  padding: 10px 0;
}

.bond-polaroid-side {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(0,0,0,0.03);
  position: relative;
  transition: all 0.3s;
}

.bond-polaroid-side.me {
  transform: rotate(-3.5deg);
}

.bond-polaroid-side.partner {
  transform: rotate(3.5deg);
}

.polaroid-card:hover .bond-polaroid-side.me {
  transform: rotate(-1.5deg) translateY(-2px);
}

.polaroid-card:hover .bond-polaroid-side.partner {
  transform: rotate(1.5deg) translateY(-2px);
}

.bond-polaroid-img-box {
  width: 100%;
  height: 150px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-base);
}

.bond-polaroid-label {
  font-family: var(--font-handwriting);
  font-size: 18px;
  text-align: center;
  margin-top: 8px;
  font-weight: 500;
}

.me .bond-polaroid-label {
  color: var(--primary-dark);
}

.partner .bond-polaroid-label {
  color: var(--accent-sky);
}

/* 命运红丝线装饰 (Double Polaroid Red Knot) */
.destiny-red-string {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110px;
  height: 40px;
  background: transparent;
  border-top: 2.5px dashed #ff4d4d;
  border-radius: 50% 50% 0 0;
  transform: translate(-50%, -85%) rotate(-3deg);
  z-index: 10;
  pointer-events: none;
}

.destiny-red-string::after {
  content: '🎀';
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 15px;
}


/* ==========================================
   5. 梦想代理人板块样式 (Dream Proxy Section)
   ========================================== */

.dream-lobby-header {
  text-align: center;
  padding: 36px 24px;
  background: rgba(255, 122, 89, 0.04);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 122, 89, 0.09);
  margin-bottom: 24px;
  box-shadow: inset 0 2px 10px rgba(255, 122, 89, 0.01);
}

.dream-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
}

@media (max-width: 580px) {
  .dream-grid {
    grid-template-columns: 1fr;
  }
}

/* 梦想愿望大厅卡片 (孔明灯质感) */
.dream-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 122, 89, 0.08);
  padding: 22px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  box-shadow: 0 10px 30px rgba(255, 122, 89, 0.01);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
}

.dream-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--accent-coral);
  box-shadow: 0 15px 35px rgba(255, 122, 89, 0.08);
}

/* 卡片右上角梦幻微黄微光 */
.dream-card::before {
  content: '';
  position: absolute;
  top: -45px;
  right: -45px;
  width: 110px;
  height: 110px;
  background: radial-gradient(circle, rgba(255, 184, 48, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.dream-city-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-coral);
  background: rgba(255, 122, 89, 0.08);
  padding: 4px 10px;
  border-radius: 50px;
  align-self: flex-start;
  font-family: var(--font-title);
}

.dream-card-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.6;
}

.dream-card-reason {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px dashed rgba(255, 122, 89, 0.1);
  padding-top: 10px;
  font-style: italic;
}

.dream-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  border-top: 1px solid rgba(110, 133, 119, 0.05);
  padding-top: 10px;
}

.dream-author {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.dream-claim-btn {
  background: var(--accent-coral);
  color: white;
  border: none;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(255, 122, 89, 0.15);
}

.dream-claim-btn:hover {
  background: #ff6540;
  box-shadow: 0 6px 15px rgba(255, 122, 89, 0.25);
}

.dream-claim-btn.claimed {
  background: var(--bg-accent-soft);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
}

/* active dream task in header panel (认领梦想面板) */
#active-dream-quest-container {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px dashed var(--accent-coral) !important;
}

/* 6. 特效与动效 (V2 Transitions) */

/* 孔明灯向天空飞走 */
.lantern-fly-animation {
  animation: lantern-up 1.6s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

@keyframes lantern-up {
  0% {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: blur(0);
  }
  40% {
    transform: scale(0.6) translateY(-180px) rotate(4deg);
    opacity: 0.8;
    filter: blur(1px);
    box-shadow: 0 0 25px rgba(255, 184, 48, 0.7);
  }
  100% {
    transform: scale(0.05) translateY(-650px) rotate(8deg);
    opacity: 0;
    filter: blur(5px);
  }
}

/* 治愈来信信件投递滑动飞入效果 */
.letter-delivery-animation {
  animation: letter-slide-in 0.85s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes letter-slide-in {
  0% {
    transform: scale(0.2) rotate(-18deg) translateY(400px);
    opacity: 0;
  }
  70% {
    transform: scale(1.05) rotate(2deg) translateY(-10px);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0) translateY(0);
    opacity: 1;
  }
}

