/* 人生年轮个人事件记录软件 V1.0 · 全站样式
   设计基调：暖粉主色 + 米白背景，卡片圆角 16px，触控目标 ≥ 44px。
   断点：≥1024px 左侧固定侧边栏，<760px 顶部标题栏 + 底部 Tab + 悬浮按钮。 */

:root {
  --bg: #F4F6FB;
  --card: #FFFFFF;
  --ink: #0F172A;
  --sub: #475569;
  --muted: #94A3B8;
  --line: #E6EAF2;
  --radius: 16px;
  --radius-sm: 12px;
  --accent: #F472B6;
  --accent-soft: #FCE7F3;
  --accent-ink: #BE185D;
  --warn: #F59E0B;
  --danger: #EF4444;
  --ok: #22C55E;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.16);
  --font: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

a {
  color: var(--accent-ink);
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------- 布局外壳 ---------------------------- */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 20px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FBCFE8, #F472B6);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(244, 114, 182, 0.32);
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-ver {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.6px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--sub);
  font-size: 14px;
  transition: background 160ms ease, color 160ms ease;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: #F8FAFC;
  color: var(--ink);
}

.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.nav-icon {
  width: 22px;
  text-align: center;
  font-size: 16px;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}

.side-foot {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.side-user {
  flex: 1;
  min-width: 0;
}

.side-user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-user-mail {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sub);
  font-size: 16px;
  transition: background 160ms ease;
}

.icon-btn:hover {
  background: #F1F5F9;
  color: var(--ink);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 68px;
  flex: 0 0 68px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  border-bottom: 1px solid transparent;
}

.topbar-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

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

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.view {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 4px 32px 88px;
}

.tabbar {
  display: none;
}

.fab {
  display: none;
}

/* ---------------------------- 基础控件 ---------------------------- */

.btn {
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--sub);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 120ms ease, background 160ms ease;
  white-space: nowrap;
}

.btn:hover {
  background: #F8FAFC;
}

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

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(244, 114, 182, 0.28);
}

.btn-primary:hover {
  background: #EC4899;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-danger {
  color: var(--danger);
  border-color: #FECACA;
  background: #FEF2F2;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 10px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-pad {
  padding: 18px 20px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--sub);
  font-size: 12px;
  white-space: nowrap;
  transition: all 160ms ease;
}

.chip:hover {
  border-color: #FBCFE8;
  color: var(--accent-ink);
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #F1F5F9;
  color: var(--sub);
  font-size: 11px;
}

.tag-lock {
  background: #FEF3C7;
  color: #92400E;
}

.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  background: #F8FAFC;
  border: 1px solid var(--line);
  color: var(--sub);
  font-size: 12px;
}

.person-chip .avatar {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

.person-chip:hover {
  border-color: #FBCFE8;
}

.emotion-bar {
  width: 4px;
  border-radius: 999px;
  flex: 0 0 4px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--sub);
}

.empty-emoji {
  font-size: 34px;
  display: block;
  margin-bottom: 10px;
}

.empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.skeleton {
  height: 96px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #EEF2F7, #F8FAFC, #EEF2F7);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ---------------------------- 时间轴 ---------------------------- */

.timeline-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 24px;
  align-items: start;
}

.otd {
  border-radius: var(--radius);
  padding: 16px 20px;
  background: linear-gradient(120deg, #FDF2F8, #F5F3FF 70%, #EFF6FF);
  border: 1px solid #FBCFE8;
  margin-bottom: 20px;
}

.otd-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-ink);
  margin-bottom: 8px;
}

.otd-empty {
  font-size: 13px;
  color: var(--sub);
}

.otd-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.otd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink);
  padding: 6px 8px;
  border-radius: 10px;
  text-align: left;
  width: 100%;
}

.otd-item:hover {
  background: rgba(255, 255, 255, 0.7);
}

.otd-ago {
  font-size: 11px;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 1px 8px;
  flex: 0 0 auto;
}

.otd-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.year-group {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

.year-rail {
  text-align: right;
  padding-top: 2px;
}

.year-num {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.year-count {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.year-stem {
  border-left: 1px solid var(--line);
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.year-rail-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, #F9A8D4);
  margin: 10px 0 0 auto;
  width: 56px;
  border-radius: 2px;
}

.event-card {
  display: flex;
  gap: 12px;
  padding: 14px 16px 14px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
  text-align: left;
  width: 100%;
}

.event-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.event-card .emotion-bar {
  align-self: stretch;
  margin-left: 0;
}

.event-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex: 0 0 auto;
}

.event-body {
  flex: 1;
  min-width: 0;
}

.event-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.event-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-date {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.event-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.event-lock {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px dashed #FCD34D;
  background: #FFFBEB;
  border-radius: var(--radius);
  color: #92400E;
  font-size: 13px;
  text-align: left;
  width: 100%;
}

.rail {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rail-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.rail-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rail-person {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px;
  border-radius: 10px;
  text-align: left;
}

.rail-person:hover {
  background: #F8FAFC;
}

.rail-person-name {
  font-size: 12px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-person-count {
  font-size: 11px;
  color: var(--muted);
}

.type-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.type-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--sub);
  overflow: hidden;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
}

/* ---------------------------- 事件详情 ---------------------------- */

.detail-head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 24px;
}

.detail-icon {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  flex: 0 0 auto;
}

.detail-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.3;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--sub);
}

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}

.detail-desc {
  font-size: 14px;
  line-height: 1.9;
  color: var(--sub);
  white-space: pre-wrap;
  word-break: break-word;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--line);
}

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

.meta-label {
  color: var(--muted);
  flex: 0 0 72px;
}

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

.emotion-seg {
  width: 26px;
  height: 8px;
  border-radius: 999px;
  background: #E2E8F0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.photo {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #F1F5F9;
  border: 1px solid var(--line);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-add {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.photo-add:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* ---------------------------- 人物 ---------------------------- */

.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 14px;
}

.person-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.person-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.person-card .avatar {
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.person-name {
  font-size: 14px;
  font-weight: 600;
}

.person-sub {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relation-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 12px;
}

.relation-name {
  font-size: 13px;
  font-weight: 700;
}

.relation-count {
  font-size: 11px;
  color: var(--muted);
}

.person-hero {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 24px;
}

.person-hero .avatar {
  width: 72px;
  height: 72px;
  font-size: 28px;
}

.stat-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.stat-box {
  flex: 1;
  background: #F8FAFC;
  border-radius: 12px;
  padding: 10px 12px;
}

.stat-num {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

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

/* ---------------------------- 搜索 ---------------------------- */

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.filter-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-label {
  font-size: 12px;
  color: var(--muted);
  flex: 0 0 44px;
}

.result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 12px;
  font-size: 13px;
  color: var(--sub);
}

.result-count {
  font-weight: 700;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}

mark {
  background: #FEF08A;
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.result-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  text-align: left;
  width: 100%;
  margin-bottom: 10px;
}

.result-card:hover {
  border-color: #FBCFE8;
}

/* ---------------------------- 统计 ---------------------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.summary-value {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.summary-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.chart-wrap {
  width: 100%;
  overflow: hidden;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--sub);
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.bar-name {
  flex: 0 0 96px;
  font-size: 11.5px;
  color: var(--sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #F1F5F9;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
}

.bar-value {
  flex: 0 0 40px;
  text-align: right;
  font-size: 12px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------- 设置 ---------------------------- */

.setting-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

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

.setting-main {
  flex: 1;
}

.setting-name {
  font-size: 13px;
  font-weight: 600;
}

.setting-desc {
  font-size: 11px;
  color: var(--muted);
}

.switch {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #CBD5E1;
  position: relative;
  transition: background 160ms ease;
  flex: 0 0 auto;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.24);
}

.switch.is-on {
  background: var(--accent);
}

.switch.is-on::after {
  transform: translateX(20px);
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.16);
}

textarea.input {
  height: auto;
  padding: 10px 12px;
  line-height: 1.7;
  resize: vertical;
  min-height: 88px;
}

.field {
  margin-bottom: 14px;
}

.field-label {
  font-size: 12px;
  color: var(--sub);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  min-height: 16px;
}

.word-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
}

.word-tag button {
  color: var(--accent-ink);
  font-size: 13px;
}

/* ---------------------------- 登录 ---------------------------- */

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.login-brand {
  background: linear-gradient(150deg, #FDF2F8, #FCE7F3 45%, #EEF2FF);
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-brand::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(244, 114, 182, 0.28);
  right: -120px;
  bottom: -140px;
  box-shadow: 0 0 0 60px rgba(244, 114, 182, 0.06),
    0 0 0 120px rgba(244, 114, 182, 0.04);
}

.login-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #831843;
}

.login-slogan {
  font-size: 14px;
  color: #9D174D;
  margin-top: 10px;
  max-width: 380px;
  line-height: 1.9;
}

.login-points {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-point {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: #831843;
}

.login-point-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex: 0 0 auto;
}

.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-form {
  width: 100%;
  max-width: 340px;
}

.login-form-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-form-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 24px;
}

.login-hint {
  margin-top: 16px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  background: #F8FAFC;
  border-radius: 10px;
  padding: 10px 12px;
}

/* ---------------------------- 抽屉与弹层 ---------------------------- */

.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.sheet {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 520px;
  max-width: 100vw;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

@keyframes slide-in {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sheet-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sheet-title {
  font-size: 16px;
  font-weight: 700;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 24px;
}

.sheet-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--card);
}

.sheet-foot .btn-primary {
  flex: 1;
}

.dialog {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.dialog-card {
  position: relative;
  width: 380px;
  max-width: calc(100vw - 40px);
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-lg);
}

.dialog-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.dialog-desc {
  font-size: 13px;
  color: var(--sub);
  line-height: 1.8;
  margin-bottom: 18px;
  white-space: pre-wrap;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 180ms ease;
  max-width: 78vw;
}

.toast.is-error {
  background: rgba(185, 28, 28, 0.94);
}

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(8, 11, 20, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 20px;
}

/* ---------------------------- 回溯向导 ---------------------------- */

.wizard-head {
  text-align: center;
  padding: 28px 20px 8px;
}

.wizard-title {
  font-size: 22px;
  font-weight: 800;
}

.wizard-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 24px;
}

.step-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #E2E8F0;
  color: var(--sub);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.step-dot.is-active .step-num {
  background: var(--accent);
  color: #fff;
}

.step-dot.is-done .step-num {
  background: #10B981;
  color: #fff;
}

.step-dot.is-active {
  color: var(--accent-ink);
  font-weight: 600;
}

.step-line {
  width: 36px;
  height: 1px;
  background: var(--line);
}

.wizard-card {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px;
}

.quick-dates {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.seg {
  display: inline-flex;
  padding: 3px;
  background: #F1F5F9;
  border-radius: 10px;
}

.seg button {
  height: 30px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--sub);
}

.seg button.is-active {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.date-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.date-row .input {
  flex: 1;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.type-btn {
  height: 50px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  position: relative;
}

.type-btn span {
  font-size: 9px;
  color: var(--muted);
  transform: scale(0.92);
}

.type-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px rgba(244, 114, 182, 0.2);
}

.emotion-picker {
  display: flex;
  gap: 8px;
}

.emotion-btn {
  flex: 1;
  height: 52px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  gap: 2px;
}

.emotion-btn span {
  font-size: 9px;
  color: var(--muted);
}

.emotion-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.person-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.person-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--sub);
}

.person-opt.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.person-opt .avatar {
  width: 20px;
  height: 20px;
  font-size: 10px;
}

.upload-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.upload-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #F1F5F9;
}

.upload-zone {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
  gap: 2px;
}

/* ---------------------------- 移动端 ---------------------------- */

@media (max-width: 1180px) {
  .timeline-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .rail-card {
    flex: 1 1 240px;
  }

  .detail-body {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1023px) {
  .sidebar {
    display: none;
  }

  .topbar {
    height: 58px;
    flex: 0 0 58px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: var(--card);
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .topbar-title {
    font-size: 16px;
  }

  .topbar-actions .btn-primary {
    display: none;
  }

  .view {
    padding: 14px 16px 96px;
  }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    background: var(--card);
    border-top: 1px solid var(--line);
    z-index: 30;
  }

  .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    color: var(--muted);
    min-height: 44px;
  }

  .tab-item.is-active {
    color: var(--accent-ink);
  }

  .tab-icon {
    font-size: 17px;
  }

  .fab {
    display: flex;
    position: fixed;
    right: 18px;
    bottom: 76px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 26px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 26px rgba(244, 114, 182, 0.45);
    z-index: 40;
  }

  .year-group {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 12px;
  }

  .year-num {
    font-size: 24px;
  }

  .year-stem {
    padding-left: 12px;
  }

  .stats-grid,
  .summary-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-row {
    grid-template-columns: 1fr 1fr;
  }

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-brand {
    padding: 34px 24px;
  }

  .login-points {
    display: none;
  }

  .sheet {
    width: 100%;
    top: auto;
    height: 88vh;
    border-radius: 18px 18px 0 0;
  }

  .type-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .detail-head {
    flex-direction: column;
    gap: 12px;
    padding: 18px;
  }

  .detail-title {
    font-size: 20px;
  }

  .detail-icon {
    width: 60px;
    height: 60px;
    font-size: 26px;
  }

  .person-hero {
    padding: 18px;
    gap: 12px;
  }

  .person-hero .avatar {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }

  .stat-row {
    flex-wrap: wrap;
  }

  .stat-box {
    flex: 1 1 40%;
  }
}

/* 时间轴：年/月折叠 + 按重要度变大小 */
.year-num{background:none;border:0;cursor:pointer;display:inline-flex;align-items:center;
  gap:6px;color:inherit;font:inherit;padding:0}
.year-num .ycaret{font-size:12px;color:#9ca3af}
.month-group{margin:4px 0 14px}
.month-head{display:flex;align-items:center;gap:8px;width:100%;background:none;border:0;
  padding:6px 0;cursor:pointer;color:#6b7280;font-size:13px;font-weight:600;text-align:left}
.month-head .caret{width:12px;font-size:11px;color:#9ca3af;flex:none}
.month-count{margin-left:auto;font-size:12px;color:#9ca3af;font-weight:400}
.event-card.is-large{padding:20px 22px}
.event-card.is-large .event-title{font-size:1.15em;font-weight:800}
.event-card.is-large .event-icon{transform:scale(1.15)}
.event-card.is-small{padding:8px 12px;opacity:.85}
.event-card.is-small .event-title{font-size:.88em}
.event-card.is-small .event-icon{transform:scale(.82)}
.tl-search{margin:12px 0 14px}
.tl-search input{width:100%;padding:11px 16px;border:1px solid #e5e7eb;border-radius:999px;
  font:inherit;background:#fff;outline:none}
.tl-search input:focus{border-color:#c7d2fe;box-shadow:0 0 0 3px #eef2ff}
