/* Core layout and components — order preserved from legacy style.css */
/* v110 - CSS variables moved to themes.css */
:root {
  --safe-top: 38px;
  --safe-bottom: 20px;
}
html { height: 100%; background: var(--bg-primary); }
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, 'SF Pro Display', 'PingFang SC', sans-serif;
  background: var(--bg-primary); color: var(--text-primary);
  overflow: hidden; height: 100%;
  user-select: text; -webkit-user-select: text;
  position: relative;
  transition: background-color 0.4s ease, color 0.3s ease;
}

/* ===== 噪点纹理层 ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--bg-texture);
  background-repeat: repeat;
  background-size: 256px 256px;
  opacity: var(--texture-opacity);
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
  transition: opacity 0.4s ease;
}

/* 确保内容在纹理层上方 */
body > * {
  position: relative;
  z-index: 1;
}

.app { display: flex; flex-direction: column; position: fixed; top: 0; left: 0; right: 0; height: 100vh; }
.safe-area-top { height: var(--safe-top); background: var(--bg-primary); flex-shrink: 0; }
.safe-area-bottom { height: var(--safe-bottom); background: var(--bg-primary); flex-shrink: 0; }

.page { flex: 1; display: none; overflow: hidden; position: relative; }
.page.active { display: flex; flex-direction: column; }

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

/* ===== Hero ===== */
.hero { text-align: center; padding: 28px 0 16px; animation: fadeInUp 0.8s ease-out; }
.hero-title { font-size: 12px; letter-spacing: 6px; color: var(--gold-primary); margin-bottom: 20px; font-weight: 500; }
.hero-couple { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px; }
.hero-name { font-size: 15px; color: var(--text-secondary); letter-spacing: 1px; font-weight: 300; }
.hero-heart { font-size: 16px; color: #e88a9a; animation: heartbeat 2s ease-in-out infinite; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.hero-days { margin: 8px 0; }
.days-number {
  font-size: 80px; font-weight: 200; letter-spacing: -3px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary), var(--amber));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1; animation: countUp 1s ease-out 0.3s both;
}
.hero-since { font-size: 11px; letter-spacing: 3px; color: var(--text-muted); font-weight: 300; }

/* ===== 卡片通用 ===== */
.card,
.settings-card,
.settings-group,
.diary-entry,
.task-card,
.weather-card,
.bookmark-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card), var(--border-card);
  border: none;
  border-radius: 16px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.card:active,
.settings-card:active {
  background: var(--bg-card-hover);
}

.card-glow {
  position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(ellipse at 30% 20%, var(--gold-dim), transparent 60%);
  pointer-events: none; opacity: 0.6;
}
.card-label { font-size: 12px; letter-spacing: 1px; color: var(--gold-primary); margin-bottom: 14px; position: relative; font-weight: 500; }
.card-content { font-size: 15px; line-height: 1.8; color: var(--text-primary); position: relative; font-weight: 300; }
.card-signature { font-size: 12px; color: var(--text-muted); text-align: right; margin-top: 14px; position: relative; font-style: italic; }

/* ===== 待办 ===== */
.todo-card { animation: fadeInUp 0.8s ease-out 0.25s both; }
.todo-list { display: flex; flex-direction: column; gap: 4px; }
.todo-empty { font-size: 13px; color: var(--text-muted); font-weight: 300; padding: 8px 0; text-align: center; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.03); }
.todo-item:last-child { border-bottom: none; }
.todo-check {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-gold);
  cursor: pointer; transition: all 0.3s ease; flex-shrink: 0; position: relative;
}
.todo-check.done { background: var(--green-check); border-color: var(--green-check); }
.todo-check.done::after {
  content: '✓'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); font-size: 12px; color: var(--bg-primary); font-weight: 700;
}
.todo-text { flex: 1; font-size: 14px; color: var(--text-secondary); font-weight: 300; }
.todo-item.checked .todo-text { text-decoration: line-through; color: var(--text-muted); }
.todo-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 500; flex-shrink: 0; letter-spacing: 0.5px; }
.todo-badge.daily { background: rgba(110,207,142,0.12); color: var(--green-check); }
.todo-badge.deadline { background: rgba(212,160,83,0.12); color: var(--gold-primary); }
.todo-badge.urgent { background: rgba(224,112,112,0.12); color: var(--red-urgent); }

/* ===== 首页快捷入口 ===== */
.shortcuts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 16px; animation: fadeInUp 0.8s ease-out 0.35s both;
}
.shortcut-btn {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 14px; cursor: pointer; transition: all 0.2s ease;
}
.shortcut-btn:active { transform: scale(0.97); background: var(--bg-card-hover); border-color: var(--border-gold); }
.shortcut-icon { font-size: 22px; }
.shortcut-title { font-size: 13px; color: var(--text-primary); font-weight: 400; margin-bottom: 2px; }
.shortcut-desc { font-size: 10px; color: var(--text-muted); letter-spacing: 0.5px; }

/* ===== LIFE 页 - 功能网格 ===== */
.page-life { position: relative; }

.life-header { text-align: center; padding: 20px 0 8px; }
.life-title { font-size: 12px; letter-spacing: 6px; color: var(--gold-primary); font-weight: 500; }

.life-main { display: block; }
.life-main.hidden { display: none !important; }

.life-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  animation: fadeInUp 0.6s ease-out;
}

.life-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 16px; padding: 28px 16px 22px; text-align: center;
  cursor: pointer; transition: all 0.2s ease;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}

.life-card:active { transform: scale(0.96); background: var(--bg-card-hover); border-color: var(--border-gold); }

.life-card-icon { font-size: 36px; margin-bottom: 4px; }
.life-card-title { font-size: 14px; color: var(--text-primary); font-weight: 400; letter-spacing: 0.5px; }
.life-card-desc { font-size: 11px; color: var(--text-muted); font-weight: 300; }

/* ===== LIFE 子页面 ===== */
.life-subpage {
  position: absolute; inset: 0; z-index: 10;
  background: var(--bg-primary);
  display: none; flex-direction: column;
}

.life-subpage.open {
  display: flex;
  animation: slideInRight 0.25s ease-out;
}

@keyframes slideInRight {
  from { transform: translateX(30%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.sub-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sub-back {
  font-size: 26px; color: var(--gold-primary); cursor: pointer;
  padding: 0 8px; line-height: 1; font-weight: 300;
}
.sub-back:active { opacity: 0.6; }

.sub-title { font-size: 15px; color: var(--text-primary); font-weight: 400; letter-spacing: 1px; }
.sub-spacer { width: 36px; }

.page-placeholder-inner {
  text-align: center; color: var(--text-muted); font-size: 14px;
  padding-top: 40%; font-weight: 300;
}

/* ===== 生活手账月历 v117 ===== */
.calendar-today-card {
  position: relative;
  border: 1px solid rgba(212,160,83,0.18);
  border-radius: 20px;
  padding: 18px;
  margin: 0 0 14px;
  background: linear-gradient(135deg, rgba(212,160,83,0.15), rgba(26,26,37,0.72) 58%, rgba(70,96,110,0.16));
  overflow: hidden;
}
.calendar-today-card::after {
  content:''; position:absolute; inset:auto -30px -52px auto; width:140px; height:140px;
  background: radial-gradient(circle, rgba(212,160,83,0.18), transparent 68%);
  pointer-events:none;
}
.cal-today-kicker { color:var(--gold-primary); font-size:11px; letter-spacing:1px; margin-bottom:8px; }
.cal-today-title { color:var(--text-primary); font-size:20px; line-height:1.2; margin-bottom:9px; }
.cal-today-main { color:var(--text-secondary); font-size:14px; line-height:1.55; position:relative; }
.cal-today-sub { color:var(--text-muted); font-size:12px; line-height:1.6; margin-top:8px; position:relative; }
.calendar-container {
  background: rgba(255,255,255,0.026); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px; padding: 16px; margin-bottom: 14px;
}
.calendar-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-nav-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--gold-primary); cursor: pointer; border-radius: 50%;
  background: rgba(212,160,83,0.06); border:1px solid rgba(212,160,83,0.12);
}
.cal-nav-btn:active { background: var(--gold-dim); transform:scale(.96); }
.cal-month-label { font-size: 16px; font-weight: 400; color: var(--text-primary); letter-spacing: 1px; }
.calendar-toolbar { display:flex; gap:8px; margin-bottom:12px; }
.calendar-toolbar button, .cal-add-small {
  border:1px solid rgba(212,160,83,0.22); background:rgba(212,160,83,0.08); color:var(--gold-primary);
  border-radius:999px; padding:8px 12px; font-size:12px; cursor:pointer;
}
.calendar-month-summary { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:12px; }
.calendar-month-summary div { border:1px solid rgba(255,255,255,0.07); border-radius:12px; padding:9px 4px; text-align:center; background:rgba(10,10,15,0.18); }
.calendar-month-summary b { display:block; color:var(--gold-primary); font-family:Georgia,serif; font-size:18px; line-height:1; font-weight:400; }
.calendar-month-summary span { display:block; color:var(--text-muted); font-size:9px; margin-top:5px; white-space:nowrap; }
.calendar-filter-row { display:flex; gap:7px; overflow-x:auto; -webkit-overflow-scrolling:touch; padding:0 0 12px; }
.cal-filter { flex-shrink:0; border:1px solid rgba(255,255,255,0.08); background:rgba(255,255,255,0.035); color:var(--text-muted); border-radius:999px; padding:6px 10px; font-size:11px; }
.cal-filter.active { border-color:rgba(212,160,83,0.35); background:rgba(212,160,83,0.12); color:var(--gold-primary); }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; margin-bottom: 8px; }
.calendar-weekdays span { font-size: 10px; color: var(--text-muted); font-weight: 400; padding: 4px 0; letter-spacing: 1px; }
.calendar-weekdays .weekend { color: var(--amber); opacity: 0.68; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-day {
  min-width:0; aspect-ratio: .86; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  border-radius: 13px; cursor: pointer; position: relative; transition: all 0.2s ease;
  font-size: 13px; color: var(--text-secondary); font-weight: 300; border:1px solid transparent;
  background:rgba(255,255,255,0.018); padding:7px 2px 4px; box-sizing:border-box;
}
.cal-day:active { background: var(--gold-dim); transform:scale(.96); }
.cal-day.other-month { color: var(--text-muted); opacity: 0.22; justify-content:center; }
.cal-day.weekend { color: var(--amber); }
.cal-day.today { color: var(--gold-light); font-weight: 500; border-color: var(--border-gold); background:rgba(212,160,83,0.08); }
.cal-day.selected { background: var(--gold-primary); color: var(--bg-primary); font-weight: 600; border-color:transparent; }
.cal-day.holiday:not(.selected) { color: #e8a0bf; }
.cal-day-num { line-height:1; }
.cal-day-chips { display:flex; gap:2px; flex-wrap:wrap; justify-content:center; margin-top:auto; min-height:18px; align-content:flex-end; }
.cal-day-chip { font-size:9px; line-height:1; }
.cal-day.selected .cal-day-chip { filter:saturate(.85); }

/* ===== 事件列表 ===== */
.calendar-detail-card { background:rgba(255,255,255,0.026); border:1px solid rgba(255,255,255,0.08); border-radius:18px; padding:15px; margin-bottom:14px; }
.calendar-detail-card .card-label { display:flex; align-items:center; justify-content:space-between; gap:10px; color:var(--gold-primary); font-size:13px; margin-bottom:10px; letter-spacing:.5px; }
.event-list { display: flex; flex-direction: column; gap: 7px; }
.event-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 13px; color: var(--text-secondary); font-weight: 300; }
.event-item:last-child { border-bottom: none; }
.event-item-emoji { font-size: 16px; flex-shrink: 0; }
.event-item-date { font-size: 11px; color: var(--text-muted); margin-left: auto; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.cal-event-item { align-items:flex-start; position:relative; background:rgba(10,10,15,0.22); border:1px solid rgba(255,255,255,0.055); border-radius:13px; padding:11px; }
.cal-event-body { display:flex; flex-direction:column; min-width:0; flex:1; gap:4px; }
.cal-event-text { color:var(--text-primary); line-height:1.45; }
.cal-event-note { color:var(--text-muted); font-size:12px; line-height:1.55; white-space:pre-wrap; word-break:break-word; }
.cal-event-source { color:var(--gold-primary); font-size:10px; opacity:.8; }
.cal-event-actions { display:flex; gap:6px; flex-shrink:0; }
.cal-event-actions button { border:1px solid rgba(255,255,255,0.08); background:rgba(255,255,255,0.035); color:var(--text-muted); border-radius:999px; padding:5px 8px; font-size:10px; }
.cal-event-delete { color:#d79a9a !important; }
.cal-empty-day, .cal-more-tip { color:var(--text-muted); font-size:12px; line-height:1.65; text-align:center; padding:14px 6px; }
.cal-month-item { padding:8px 0; }
.cal-form-overlay { position:fixed; inset:0; z-index:220; display:flex; align-items:flex-start; justify-content:center; padding:max(24px, env(safe-area-inset-top, 0px)) 18px 40px; background:rgba(0,0,0,.62); opacity:0; pointer-events:none; transition:opacity .2s; overflow-y:auto; }
.cal-form-overlay.show { opacity:1; pointer-events:auto; }
.cal-form-panel { width:100%; max-width:380px; min-width:0; overflow:hidden; background:#1a1a25; border:1px solid rgba(212,160,83,0.24); border-radius:18px; padding:18px; box-sizing:border-box; }
.cal-form-title { color:var(--text-primary); font-size:16px; margin-bottom:14px; }
.cal-form-panel label { display:block; min-width:0; color:var(--text-muted); font-size:11px; margin-bottom:10px; }
.cal-form-panel input, .cal-form-panel textarea, .cal-form-panel select { display:block; width:100%; max-width:100%; min-width:0; box-sizing:border-box; margin-top:5px; border:1px solid rgba(255,255,255,0.09); background:rgba(0,0,0,0.18); color:var(--text-primary); border-radius:11px; padding:10px 11px; font-size:13px; outline:none; font-family:inherit; }
.cal-form-panel input[type="date"] { -webkit-appearance:none; appearance:none; height:46px; line-height:24px; text-align:left; }
.cal-form-panel input[type="date"]::-webkit-date-and-time-value { text-align:left; }
.cal-form-panel input[type="date"]::-webkit-calendar-picker-indicator { margin-left:4px; }
.cal-form-panel textarea { resize:vertical; line-height:1.55; }
.cal-form-row { display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:10px; }
.cal-sync-todo { display:flex !important; align-items:center; gap:9px; color:var(--text-secondary) !important; font-size:12px !important; margin: 2px 0 4px !important; }
.cal-sync-todo input { width:18px !important; height:18px; flex:0 0 18px; margin:0 !important; accent-color:var(--gold-primary); }
.cal-sync-todo span { line-height:1.4; }
.cal-form-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:14px; }
.cal-form-actions button { border:1px solid rgba(255,255,255,0.08); border-radius:999px; padding:9px 16px; font-size:13px; }
.cal-form-cancel { background:transparent; color:var(--text-muted); }
.cal-form-save { background:var(--gold-primary); color:var(--bg-primary); border-color:transparent !important; }

/* ===== 占位 ===== */
.page-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); font-size: 15px; font-weight: 300; }

/* ===== 底部导航 ===== */
.tab-bar {
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 0;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 16px; cursor: pointer; }
.tab-icon { font-size: 20px; opacity: 0.5; transition: opacity 0.2s; }
.tab-label { font-size: 9px; letter-spacing: 1.5px; color: var(--tab-inactive); transition: color 0.2s; }
.tab.active .tab-icon { opacity: 1; }
.tab.active .tab-label { color: var(--tab-active); }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Kyle 日记 ===== */
.diary-list { display: flex; flex-direction: column; gap: 16px; }

.diary-entry {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 16px; overflow: hidden; cursor: pointer;
  transition: all 0.3s ease;
}

.diary-entry:active { transform: scale(0.98); }
.diary-entry.expanded { cursor: default; }
.diary-entry.expanded:active { transform: none; }

.diary-entry-header {
  padding: 20px 22px; display: flex; align-items: center; justify-content: space-between;
}

.diary-header-left { display: flex; flex-direction: column; gap: 4px; }

.diary-date {
  font-size: 12px; color: var(--gold-primary); letter-spacing: 1px; font-weight: 500;
}

.diary-title {
  font-size: 16px; color: var(--text-primary); font-weight: 400;
}

.diary-preview {
  font-size: 13px; color: var(--text-muted); font-weight: 300;
  margin-top: 4px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.diary-entry.expanded .diary-preview { display: none; }

.diary-arrow {
  font-size: 14px; color: var(--text-muted); transition: transform 0.3s ease;
  flex-shrink: 0; margin-left: 12px;
}

.diary-entry.expanded .diary-arrow { transform: rotate(90deg); }

.diary-body {
  max-height: 0; overflow: hidden; transition: max-height 0.4s ease;
}

.diary-entry.expanded .diary-body { max-height: 3000px; }

.diary-content {
  padding: 0 22px 24px; font-size: 14px; line-height: 2;
  color: var(--text-secondary); font-weight: 300;
  white-space: pre-wrap; word-break: break-word;
  border-top: 1px solid var(--border-subtle); margin-top: 0; padding-top: 20px;
}

.diary-signature {
  text-align: right; font-size: 12px; color: var(--text-muted);
  font-style: italic; margin-top: 16px; padding-right: 4px;
}

.diary-empty {
  text-align: center; color: var(--text-muted); font-size: 14px;
  padding: 60px 0; font-weight: 300;
}

/* ===== 记忆书签 ===== */
.bm-add-btn {
  text-align: center; padding: 14px; margin-bottom: 16px;
  border: 1px dashed var(--gold-primary); border-radius: 12px;
  color: var(--gold-primary); font-size: 14px; cursor: pointer;
  transition: all 0.2s;
}
.bm-add-btn:active { background: rgba(212,175,55,0.1); }

.bm-add-form {
  background: var(--bg-card); border: 1px solid var(--gold-primary);
  border-radius: 16px; padding: 18px; margin-bottom: 16px;
}
.bm-input, .bm-textarea {
  width: 100%; box-sizing: border-box; background: var(--bg-main);
  border: 1px solid var(--border-subtle); border-radius: 10px;
  color: var(--text-primary); font-size: 14px; padding: 10px 14px;
  font-family: inherit; margin-bottom: 10px; outline: none;
}
.bm-input::-webkit-calendar-picker-indicator { filter: invert(0.8); }
.bm-textarea { resize: none; line-height: 1.6; }
.bm-textarea:focus, .bm-input:focus { border-color: var(--gold-primary); }
.bm-form-actions { display: flex; gap: 10px; justify-content: flex-end; }
.bm-btn {
  padding: 8px 20px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.bm-btn-cancel { color: var(--text-muted); }
.bm-btn-submit {
  background: var(--gold-primary); color: var(--bg-main); font-weight: 500;
}

.bm-list { display: flex; flex-direction: column; gap: 14px; }

.bm-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 16px; overflow: hidden; transition: all 0.3s;
}

.bm-card-header { padding: 18px 20px; cursor: pointer; }
.bm-card-header:active { opacity: 0.8; }

.bm-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bm-date { font-size: 12px; color: var(--gold-primary); letter-spacing: 0.5px; }
.bm-author {
  font-size: 11px; color: var(--text-muted); background: rgba(255,255,255,0.05);
  padding: 2px 8px; border-radius: 4px;
}
.bm-text {
  font-size: 14px; color: var(--text-secondary); line-height: 1.8; font-weight: 300;
}

.bm-comments-area {
  max-height: 0; overflow: hidden; transition: max-height 0.4s ease;
}
.bm-card.expanded .bm-comments-area { max-height: 2000px; }

.bm-comments-inner {
  padding: 0 20px 18px; border-top: 1px solid var(--border-subtle);
}

.bm-comment {
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.03);
}
.bm-comment:last-of-type { border-bottom: none; }
.bm-comment-author {
  font-size: 13px; font-weight: 400; margin-bottom: 2px;
}
.bm-comment-author.lina { color: #e8a0bf; }
.bm-comment-author.kebao { color: var(--gold-primary); }
.bm-comment-content {
  font-size: 13px; color: var(--text-secondary); font-weight: 300; line-height: 1.6;
}
.bm-comment-time {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
}

.bm-comment-input-row {
  display: flex; gap: 8px; margin-top: 12px; align-items: flex-end;
}
.bm-comment-input {
  flex: 1; background: var(--bg-main); border: 1px solid var(--border-subtle);
  border-radius: 10px; color: var(--text-primary); font-size: 13px;
  padding: 10px 14px; font-family: inherit; outline: none; resize: none;
  min-height: 20px; max-height: 80px; line-height: 1.4;
}
.bm-comment-input:focus { border-color: var(--gold-primary); }
.bm-comment-send {
  background: var(--gold-primary); color: var(--bg-main);
  border: none; border-radius: 10px; padding: 10px 16px;
  font-size: 13px; cursor: pointer; font-weight: 500; white-space: nowrap;
  flex-shrink: 0;
}
.bm-comment-send:active { opacity: 0.8; }

.bm-no-comments {
  font-size: 12px; color: var(--text-muted); padding: 8px 0;
  font-style: italic;
}

.bm-empty {
  text-align: center; color: var(--text-muted); font-size: 14px;
  padding: 60px 0; font-weight: 300;
}

/* ===== 记忆统计 ===== */
.stats-hero {
  text-align: center; padding: 40px 20px 30px;
}
.stats-number {
  font-size: 72px; font-weight: 200; color: var(--gold-primary);
  line-height: 1; letter-spacing: -2px;
  font-family: 'Georgia', serif;
}
.stats-label {
  font-size: 14px; color: var(--text-secondary); margin-top: 8px;
  font-weight: 300; letter-spacing: 2px;
}
.stats-sub {
  font-size: 12px; color: var(--text-muted); margin-top: 6px;
  font-weight: 300;
}


.memory-star-hero {
  position: relative; margin: 0 0 14px; border-radius: 22px;
  background: radial-gradient(circle at 50% 0%, var(--accent-glow), rgba(26,26,37,0.88) 52%, rgba(14,14,20,0.6));
  border: 1px solid var(--border-gold);
  overflow: hidden;
}
.memory-star-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.28) 1px, transparent 1px);
  background-size: 34px 34px; opacity: 0.18; pointer-events: none;
}
.stats-kicker {
  position: relative; font-size: 10px; color: var(--gold-primary); letter-spacing: 3px;
  margin-bottom: 8px; font-weight: 500;
}
.memory-status-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px;
}
.memory-status-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 16px;
  padding: 14px 12px; text-align: center;
}
.memory-status-value {
  color: var(--gold-primary); font-size: 20px; line-height: 1.1; font-family: Georgia, serif;
  word-break: break-word;
}
.memory-status-label { color: var(--text-muted); font-size: 11px; margin-top: 6px; letter-spacing: 1px; }
.memory-panel {
  background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: 18px;
  padding: 16px; margin-bottom: 18px;
}
.memory-panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.memory-panel-title { color: var(--text-primary); font-size: 16px; font-weight: 400; }
.memory-panel-desc { color: var(--text-muted); font-size: 11px; margin-top: 3px; }
.memory-refresh-btn, .memory-search-btn {
  border: none; background: var(--gold-primary); color: var(--bg-main); border-radius: 10px;
  padding: 9px 12px; font-size: 12px; cursor: pointer; flex-shrink: 0;
}
.memory-search-row { display:flex; gap:8px; margin-bottom: 14px; }
.memory-search-input {
  flex:1; min-width:0; background: var(--bg-primary); border:1px solid var(--border-subtle); border-radius:12px;
  color:var(--text-primary); padding:10px 12px; font-size:13px; outline:none;
}
.memory-search-input:focus { border-color: var(--border-gold); }

.memory-topic-row { display:flex; gap:8px; overflow-x:auto; -webkit-overflow-scrolling:touch; padding: 0 0 10px; margin-top:-4px; }
.memory-topic-chip { border:1px solid var(--border-gold); background: var(--gold-dim); color:var(--gold-primary); border-radius:999px; padding:6px 10px; font-size:11px; white-space:nowrap; flex-shrink:0; }
.memory-topic-chip.active { background:var(--gold-primary); color:var(--bg-primary); }
.memory-mode-tip { color: var(--text-muted); font-size: 11px; line-height: 1.5; margin: 0 0 12px; }
#sub-stats .scroll-container { padding-bottom: 180px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.memory-star-list { display:flex; flex-direction:column; gap:10px; padding-bottom: 8px; }
.memory-loading { color: var(--text-muted); font-size: 13px; text-align:center; padding: 26px 8px; font-weight:300; }
.memory-star-card {
  background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px;
  padding: 13px 13px 12px; position: relative; overflow: visible; cursor: pointer;
}
.memory-star-card::before {
  content:''; position:absolute; left:0; top:12px; bottom:12px; width:2px;
  background: linear-gradient(180deg, transparent, var(--gold-primary), transparent);
}
.memory-star-top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.memory-star-title { color: var(--text-primary); font-size: 14px; line-height: 1.35; }
.memory-star-id { color: var(--text-muted); font-size: 10px; opacity: .65; margin-top:2px; }
.memory-star-summary { color: var(--text-secondary); font-size: 12px; line-height: 1.6; margin-top: 8px; }
.memory-star-tags { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.memory-star-tags span {
  color: var(--gold-primary); background: var(--gold-dim); border:1px solid var(--border-gold);
  border-radius:999px; padding:3px 8px; font-size:10px;
}

.memory-star-card .memory-star-summary {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.memory-star-card.expanded .memory-star-summary {
  display: block; -webkit-line-clamp: unset; overflow: visible;
}
.memory-star-card.expanded {
  background: rgba(255,255,255,0.055);
  border-color: var(--border-gold);
}
.memory-expand-hint { opacity: .85; }


/* 亲密档案入口 */
.intimacy-enter {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 16px; padding: 20px; margin: 0 0 20px; cursor: pointer;
  transition: all 0.2s;
}
.intimacy-enter:active { opacity: 0.8; transform: scale(0.98); }
.intimacy-enter-icon { font-size: 28px; }
.intimacy-enter-text { flex: 1; }
.intimacy-enter-title {
  font-size: 16px; color: var(--text-primary); font-weight: 400;
}
.intimacy-enter-desc {
  font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 300;
}
.intimacy-enter-arrow {
  font-size: 20px; color: var(--text-muted);
}

/* 亲密档案面板 */
.intimacy-panel { margin-top: 10px; }

.intimacy-progress-bar {
  height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px;
  overflow: hidden; margin-bottom: 8px;
}
.intimacy-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--gold-primary), var(--gold-light));
  border-radius: 2px; transition: width 0.6s ease;
}
.intimacy-progress-text {
  text-align: center; font-size: 12px; color: var(--text-muted);
  margin-bottom: 24px; font-weight: 300;
}

.intimacy-section-label {
  font-size: 13px; color: var(--gold-primary); font-weight: 400;
  margin-bottom: 14px; letter-spacing: 1px;
}
.intimacy-section-label.locked-label {
  margin-top: 28px; color: var(--text-muted);
}

.intimacy-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}

/* 已解锁卡片 */
.int-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 14px; padding: 16px 10px; text-align: center;
  transition: all 0.2s; cursor: pointer; position: relative; overflow: hidden;
}
.int-card.unlocked {
  border-color: var(--border-gold);
}
.int-card.unlocked::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}
.int-card:active { transform: scale(0.96); }
.int-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.int-modal-overlay.show { opacity: 1; pointer-events: auto; }

.int-modal {
  background: #1a1a25; border: 1px solid var(--gold-primary);
  border-radius: 20px; padding: 32px 28px; max-width: 280px; width: 85%;
  text-align: center; transform: scale(0.9); transition: transform 0.25s;
}
.int-modal-overlay.show .int-modal { transform: scale(1); }

.int-modal-emoji { font-size: 40px; margin-bottom: 12px; }
.int-modal-name {
  font-size: 18px; color: var(--text-primary); font-weight: 400;
  margin-bottom: 6px;
}
.int-modal-date {
  font-size: 13px; color: var(--gold-primary); margin-bottom: 12px;
  font-weight: 300;
}
.int-modal-note {
  font-size: 14px; color: var(--text-secondary); font-weight: 300;
  line-height: 1.7; font-style: italic;
}
.int-modal-hint {
  font-size: 13px; color: var(--text-muted); font-weight: 300;
  line-height: 1.6; font-style: italic;
}
.int-modal-close {
  margin-top: 20px; font-size: 13px; color: var(--text-muted);
  cursor: pointer;
}

/* ===== 亲密档案分区 ===== */
.int-section {
  margin-bottom: 28px;
}
.int-section-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.int-section-emoji { font-size: 18px; }
.int-section-label {
  font-size: 15px; color: var(--gold-primary); font-weight: 400;
  letter-spacing: 1px; flex: 1;
}
.int-section-count {
  font-size: 12px; color: var(--text-muted); font-weight: 300;
}

/* ===== 设置页 ===== */
.page-settings {
  position: relative; overflow: hidden;
}
.page-settings > .scroll-container {
  padding: 0 20px;
}

.set-header {
  padding: 20px 0 24px;
}
.set-title {
  font-size: 28px; font-weight: 300; color: var(--text-primary);
  letter-spacing: 2px;
}
.set-subtitle {
  font-size: 12px; color: var(--text-muted); font-weight: 300;
  margin-top: 4px; letter-spacing: 1px;
}

.set-group-label {
  font-size: 13px; color: var(--text-muted); font-weight: 300;
  padding: 20px 0 8px; letter-spacing: 1px;
}
.set-group {
  background: #1a1a25; border: 1px solid var(--border-subtle);
  border-radius: 16px; overflow: hidden;
}

.set-row {
  display: flex; align-items: center; padding: 16px 18px;
  cursor: pointer; transition: background 0.15s;
}
.set-row:active { background: rgba(255,255,255,0.03); }
.set-row-label {
  flex: 1; font-size: 15px; color: var(--text-primary); font-weight: 400;
}
.set-row-value {
  font-size: 13px; color: var(--text-muted); font-weight: 300;
  margin-right: 6px;
}
.set-row-arrow {
  font-size: 16px; color: var(--text-muted); opacity: 0.5;
}

.set-divider {
  height: 1px; background: var(--border-subtle); margin: 0 18px;
}

/* ===== 主题选择器 ===== */
.theme-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.theme-option:active {
  background: var(--bg-card-hover);
}

.theme-option.active {
  box-shadow: 0 0 0 2px var(--accent-primary);
}

.theme-preview {
  display: flex;
  gap: 4px;
}

.swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.theme-label {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 400;
}

.theme-check {
  margin-left: auto;
  color: var(--accent-primary);
  display: none;
  font-size: 16px;
}

.theme-option.active .theme-check {
  display: inline;
}

/* 设置子面板 */
.set-panel {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-primary); z-index: 30;
  transform: translateX(100%); transition: transform 0.3s ease;
  display: flex; flex-direction: column;
}
.set-panel.active { transform: translateX(0); display: flex; flex-direction: column; }

.set-panel-header {
  display: flex; align-items: center; padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.set-panel-back {
  font-size: 24px; color: var(--gold-primary); cursor: pointer;
  padding: 0 8px 0 0; line-height: 1;
}
.set-panel-title {
  flex: 1; font-size: 16px; color: var(--text-primary);
  font-weight: 400; letter-spacing: 1px;
}
.set-panel-spacer { width: 24px; }

.set-panel > .scroll-container {
  padding: 20px; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
}

.set-panel-placeholder {
  text-align: center; color: var(--text-muted); font-size: 14px;
  font-weight: 300; padding: 40px 20px; line-height: 1.8;
}
.set-panel-hint {
  text-align: center; color: var(--text-muted); font-size: 13px;
  font-weight: 300; line-height: 1.8; padding: 16px 0;
}

/* 头像预览 */
.set-avatar-preview {
  text-align: center; padding: 20px 0;
}
.set-avatar-preview img {
  width: 120px; height: 120px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--gold-primary);
}
.avatar-upload-btn {
  display: block; margin: 12px auto; padding: 10px 28px;
  background: transparent; color: var(--gold-primary);
  border: 1px solid var(--gold-primary); border-radius: 20px;
  font-size: 14px; cursor: pointer; transition: all 0.3s;
}
.avatar-upload-btn:active {
  background: var(--gold-primary); color: var(--bg-primary);
}
.avatar-upload-btn.uploading {
  opacity: 0.5; pointer-events: none;
}


/* 工具列表 */
.set-tool-list { }
.set-tool-item {
  display: flex; align-items: center; padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.set-tool-item:last-child { border-bottom: none; }
.set-tool-info { flex: 1; }
.set-tool-name {
  font-size: 14px; color: var(--text-primary); font-weight: 400;
}
.set-tool-desc {
  font-size: 12px; color: var(--text-muted); font-weight: 300; margin-top: 2px;
}
.set-tool-time {
  font-size: 12px; color: var(--gold-primary); font-weight: 300; margin-top: 2px;
}

/* 状态标签 */
.set-badge {
  font-size: 11px; padding: 3px 10px; border-radius: 10px;
  font-weight: 300;
}
.set-badge.on {
  background: rgba(212,175,55,0.15); color: var(--gold-primary);
}
.set-badge.off {
  background: rgba(255,255,255,0.06); color: var(--text-muted);
}

/* ===== MCP 服务器卡片 ===== */
.mcp-server-card {
  background: #1a1a25; border: 1px solid var(--border-subtle);
  border-radius: 14px; margin-bottom: 12px; overflow: hidden;
}
.mcp-server-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; transition: background 0.15s;
}
.mcp-server-header:active { background: rgba(255,255,255,0.03); }
.mcp-server-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.mcp-server-dot.on { background: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,0.4); }
.mcp-server-dot.off { background: #888; }
.mcp-server-info { flex: 1; }
.mcp-server-name {
  font-size: 14px; color: var(--text-primary); font-weight: 400;
}
.mcp-server-meta { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.mcp-tag {
  font-size: 10px; color: var(--text-muted); background: rgba(255,255,255,0.06);
  padding: 2px 8px; border-radius: 6px; font-weight: 300;
}
.mcp-server-chevron {
  font-size: 16px; color: var(--text-muted); transition: transform 0.2s;
}

.mcp-server-tools {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
  border-top: 0 solid var(--border-subtle);
  padding: 0 16px;
}
.mcp-server-tools.open {
  max-height: 500px; border-top-width: 1px; padding: 8px 16px 12px;
}

/* ===== Toggle 开关 ===== */
.toggle-switch {
  position: relative; display: inline-block; width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.12); border-radius: 12px;
  transition: 0.25s;
}
.toggle-slider::before {
  content: ''; position: absolute; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%;
  transition: 0.25s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--gold-primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}
.toggle-switch.toggle-sm .toggle-slider::before {
  height: 14px; width: 14px;
}
.toggle-switch.toggle-sm input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* ===== 留言板 ===== */
.notes-header-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 16px 20px 8px;
  font-style: italic;
}

.notes-list {
  padding: 0 16px;
}

.note-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
  position: relative;
  transition: border-color 0.2s;
}

.note-card:first-child {
  border-color: var(--border-gold);
}

.note-card:first-child::before {
  content: 'NEW';
  position: absolute;
  top: -8px;
  right: 14px;
  background: var(--accent-gold);
  color: var(--bg-primary);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  letter-spacing: 1px;
}

.note-time {
  font-size: 11px;
  color: var(--accent-gold);
  margin-bottom: 8px;
  font-weight: 300;
  letter-spacing: 0.5px;
}

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

.note-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 16px;
  color: var(--text-muted);
  font-size: 11px;
}

.note-divider::before,
.note-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.notes-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 60px 20px;
  line-height: 2;
}

.notes-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* ===== Dom Kyle 任务板 ===== */
.life-card-dom {
  border-color: rgba(180, 60, 60, 0.3) !important;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(80, 20, 20, 0.15) 100%) !important;
}
.life-card-dom:active {
  border-color: rgba(200, 70, 70, 0.6) !important;
}

.dom-header-area {
  text-align: center;
  padding: 20px 20px 12px;
}
.dom-header-icon {
  font-size: 40px;
  margin-bottom: 8px;
}
.dom-header-text {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 400;
  letter-spacing: 1px;
}
.dom-header-rule {
  font-size: 11px;
  color: rgba(200, 120, 120, 0.7);
  margin-top: 6px;
  font-style: italic;
}

.dom-task-list {
  padding: 0 16px;
}

.dom-task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.dom-task-card.pending {
  border-left: 3px solid rgba(200, 120, 120, 0.6);
}
.dom-task-card.completed {
  border-left: 3px solid rgba(120, 180, 120, 0.5);
  opacity: 0.85;
}

.dom-task-main {
  padding: 14px 16px;
}

.dom-task-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.dom-task-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.dom-task-status.pending {
  background: rgba(200, 120, 120, 0.15);
  color: rgba(220, 140, 140, 0.9);
}
.dom-task-status.completed {
  background: rgba(120, 180, 120, 0.15);
  color: rgba(140, 200, 140, 0.9);
}

.dom-task-time {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
}

.dom-task-content {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.dom-task-detail {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  white-space: pre-wrap;
}

/* 完成区域 */
.dom-task-actions {
  padding: 0 16px 14px;
}

.dom-complete-btn {
  display: inline-block;
  font-size: 12px;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(200, 120, 120, 0.12);
  color: rgba(220, 150, 150, 0.9);
  border: 1px solid rgba(200, 120, 120, 0.25);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.dom-complete-btn:active {
  background: rgba(200, 120, 120, 0.25);
  transform: scale(0.96);
}

/* 感想输入 */
.dom-report-area {
  padding: 0 16px 14px;
  display: none;
}
.dom-report-area.show {
  display: block;
}
.dom-report-textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13px;
  padding: 10px 12px;
  resize: none;
  line-height: 1.6;
  font-family: inherit;
  box-sizing: border-box;
}
.dom-report-textarea:focus {
  outline: none;
  border-color: rgba(200, 120, 120, 0.4);
}
.dom-report-textarea::placeholder {
  color: var(--text-muted);
}
.dom-report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.dom-report-submit {
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 16px;
  background: rgba(200, 120, 120, 0.15);
  color: rgba(220, 150, 150, 0.9);
  border: 1px solid rgba(200, 120, 120, 0.3);
  cursor: pointer;
}

/* 已提交的感想和回复 */
.dom-report-display {
  padding: 0 16px 14px;
}
.dom-report-bubble, .dom-review-bubble {
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 8px;
  white-space: pre-wrap;
}
.dom-report-bubble {
  background: rgba(200, 120, 120, 0.08);
  border: 1px solid rgba(200, 120, 120, 0.15);
}
.dom-report-label, .dom-review-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.dom-report-label {
  color: rgba(220, 150, 150, 0.7);
}
.dom-review-bubble {
  background: rgba(180, 160, 100, 0.08);
  border: 1px solid rgba(180, 160, 100, 0.15);
}
.dom-review-label {
  color: var(--accent-gold);
}

.dom-task-completed-time {
  font-size: 11px;
  color: rgba(140, 200, 140, 0.6);
  padding: 0 16px 12px;
}

/* ===== Activity Feed ===== */
.activity-feed {
  margin: 8px 20px 0;
  opacity: 0.7;
}
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  line-height: 1.4;
}
.activity-item .activity-icon {
  font-size: 10px;
  flex-shrink: 0;
}
.activity-item .activity-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-item .activity-time {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
}

/* ===== Bookmark New Badge ===== */
.bm-new-badge {
  display: inline-block;
  font-size: 10px;
  color: #d4a853;
  margin-left: 6px;
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.shortcut-badge, .life-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: #d4a853;
  border-radius: 50%;
  animation: badgePulse 2s ease-in-out infinite;
}
.shortcut-btn, .life-card {
  position: relative;
}

/* ===== Markdown Rendering ===== */

/* Headings */
.md-h { color: var(--gold-primary); margin: 12px 0 6px; line-height: 1.35; }
h1.md-h { font-size: 1.35em; }
h2.md-h { font-size: 1.2em; }
h3.md-h { font-size: 1.1em; }
h4.md-h, h5.md-h, h6.md-h { font-size: 1em; }

/* Inline code */
.md-inline-code {
  background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px;
  font-family: 'SF Mono','Menlo','Monaco','Consolas',monospace; font-size: 0.88em;
  color: var(--gold-secondary, #e8c577); word-break: break-all;
}

/* Code block wrapper */
.md-code-block {
  position: relative; margin: 8px 0; border-radius: 8px; overflow: hidden;
  background: #0d0d14; border: 1px solid var(--border-subtle);
}
.md-code-block pre {
  margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.6;
}
.md-code-block code {
  font-family: 'SF Mono','Menlo','Monaco','Consolas',monospace;
  color: #c8ccd4; white-space: pre;
}
.md-code-lang {
  position: absolute; top: 6px; left: 12px;
  font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  pointer-events: none;
}
.md-code-copy {
  position: absolute; top: 6px; right: 8px;
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--border-subtle);
  color: var(--text-muted); cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.md-code-copy:active { color: var(--gold-primary); border-color: var(--border-gold); }

/* Lists */
.md-list { margin: 6px 0; padding-left: 20px; }
.md-list li { margin: 3px 0; line-height: 1.6; }
ul.md-list { list-style: disc; }
ol.md-list { list-style: decimal; }

/* Blockquote */
.md-blockquote {
  border-left: 3px solid var(--gold-primary); margin: 8px 0; padding: 6px 12px;
  background: rgba(255,255,255,0.03); color: var(--text-secondary);
  border-radius: 0 6px 6px 0; font-style: italic;
}

/* Horizontal rule */
.md-hr {
  border: none; height: 1px; margin: 12px 0;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
}

/* Links */
.md-link { color: var(--gold-primary); text-decoration: underline; text-underline-offset: 2px; }

/* Strikethrough */
del { opacity: 0.6; }


/* Code block has lang label: add top padding */
.md-code-block:has(.md-code-lang) pre { padding-top: 28px; }
/* Fallback for browsers without :has */
@supports not selector(:has(.x)) {
  .md-code-block pre { padding-top: 28px; }
}

/* Stream code block (lightweight) */
pre.stream-code {
  background: #0d0d14; border: 1px solid var(--border-subtle);
  border-radius: 8px; padding: 12px 16px; margin: 6px 0;
  overflow-x: auto; font-size: 12.5px; line-height: 1.6;
}
pre.stream-code code {
  font-family: 'SF Mono','Menlo','Monaco','Consolas',monospace;
  color: #c8ccd4; white-space: pre;
}
