/* ============================================================
   女友报备 · Couple Status PWA Demo
   Mobile-first pastel theme · 纯静态 · file:// 可用
   ============================================================ */

:root {
  /* 柔和粉紫渐变背景板 */
  --bg-gradient: linear-gradient(180deg, #ffe9f3 0%, #f7e6ff 34%, #e8f0ff 72%, #e6f6ff 100%);
  --card: rgba(255, 255, 255, 0.86);
  --card-solid: #ffffff;
  --ink: #4a3b52;
  --ink-soft: #8b7b93;
  --muted: #b7a8bf;

  --accent: #ff7fb0;          /* 她的粉色 / 强调 */
  --accent-soft: #ffe1ee;
  --accent-deep: #f0568e;
  --lavender: #b78ae8;
  --lavender-soft: #efe2ff;
  --sky: #6fb8e8;
  --sky-soft: #e1f1ff;
  --mint: #58c8a8;
  --neutral: #7d8aa0;         /* 自己的 / 中性灰蓝 */

  --shadow: 0 10px 28px -12px rgba(180, 130, 180, 0.35);
  --shadow-soft: 0 6px 16px -8px rgba(180, 130, 180, 0.25);

  --radius: 20px;
  --radius-lg: 24px;
  --radius-sm: 14px;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
          "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-gradient);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  max-width: 440px;
  margin: 0 auto;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.hidden { display: none !important; }

button { font-family: var(--font); cursor: pointer; border: none; background: none; color: inherit; }

/* ---------------- 顶部栏 ---------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: max(14px, env(safe-area-inset-top)) 20px 10px;
  background: rgba(255, 244, 250, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.6);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-emoji { font-size: 26px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-size: 19px; font-weight: 800; letter-spacing: 0.5px; }
.brand-sub { font-size: 11px; color: var(--ink-soft); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.75);
  box-shadow: var(--shadow-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
}
.gear { transform: translateY(-1px); }

/* ---------------- 页面容器 ---------------- */
.page { padding: 14px 16px 20px; }
.tab-page { display: none; animation: fadein 0.28s ease; }
.tab-page.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------- 通用卡片 ---------------- */
.card {
  background: var(--card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 800; letter-spacing: 0.3px; }

/* ---------------- Tab1 状态卡 ---------------- */
.status-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.status-state-chip {
  font-size: 12px; font-weight: 700; color: var(--accent-deep);
  background: var(--accent-soft); padding: 5px 12px; border-radius: 999px;
}
.status-updated { font-size: 11px; color: var(--muted); }
.status-body { display: flex; gap: 14px; align-items: center; }
.status-emoji {
  width: 58px; height: 58px; border-radius: 20px; font-size: 30px;
  background: var(--lavender-soft); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.status-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.status-title { font-size: 18px; font-weight: 800; }
.status-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 4px 10px; border-radius: 999px; }
.tag-cat { background: var(--sky-soft); color: #3f7fae; font-weight: 600; }
.tag-lg { background: var(--lavender-soft); color: var(--lavender); font-weight: 700; }
.status-extra { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 6px 12px; border-radius: 999px; background: #f7f2fb; color: var(--ink-soft); }
.chip-pink { background: var(--accent-soft); color: var(--accent-deep); }
.chip-mood { background: #fff3d9; color: #c98a2b; }
.chip-info { background: var(--sky-soft); color: #3f7fae; }
.chip b { font-weight: 800; }

/* 离线状态 */
.status-card.offline .status-emoji { background: #eceff3; color: #a8b0ba; }
.status-card.offline .offline-tag { background: #eceff3; color: #9aa2ac; }

/* ---------------- Feed toggle + list ---------------- */
.feed-toggle {
  display: flex; background: rgba(255,255,255,0.7); border-radius: 999px;
  padding: 4px; margin-bottom: 14px; box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255,255,255,0.8);
}
.feed-tab {
  flex: 1; padding: 9px; border-radius: 999px; font-size: 13px; font-weight: 700;
  color: var(--ink-soft);
}
.feed-tab.active { background: var(--accent); color: #fff; box-shadow: var(--shadow-soft); }
.feed-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.feed-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--card); border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow-soft);
}
.feed-item.mood-item { background: #fffdf5; }
.feed-time { font-size: 11px; color: var(--muted); font-weight: 700; padding-top: 2px; min-width: 40px; }
.feed-emoji { font-size: 20px; flex-shrink: 0; }
.feed-content { flex: 1; }
.feed-text { font-size: 13.5px; line-height: 1.5; font-weight: 600; }
.feed-meta { font-size: 11px; color: var(--ink-soft); margin-top: 3px; line-height: 1.5; }

/* ---------------- Chat ---------------- */
.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 15px; font-weight: 800; margin-bottom: 12px; flex-wrap: wrap;
}
.chat-note-chip { font-size: 10.5px; color: var(--lavender); background: var(--lavender-soft); padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.chat-body { display: flex; flex-direction: column; gap: 12px; max-height: 430px; overflow-y: auto; padding: 2px; margin-bottom: 12px; }

.bubble-row { display: flex; align-items: flex-end; gap: 8px; }
.bubble-row.hers { justify-content: flex-end; }
.bubble-row.mine { justify-content: flex-start; }
.bubble-avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.bubble-row.hers .bubble-avatar { background: var(--accent-soft); }
.bubble-row.mine .bubble-avatar { background: #e8edf3; }
.bubble-wrap { max-width: 72%; display: flex; flex-direction: column; }
.bubble-row.hers .bubble-wrap { align-items: flex-end; }
.bubble-row.mine .bubble-wrap { align-items: flex-start; }
.bubble-name { font-size: 10px; color: var(--muted); margin-bottom: 3px; padding: 0 4px; }
.bubble {
  padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.5;
  word-break: break-word;
}
.bubble-row.hers .bubble {
  background: linear-gradient(135deg, var(--accent) 0%, #ff9cc2 100%);
  color: #fff; border-top-right-radius: 5px; box-shadow: var(--shadow-soft);
}
.bubble-row.mine .bubble {
  background: #f1f3f8; color: var(--ink); border-top-left-radius: 5px;
}
.bubble.time { background: none; box-shadow: none; color: var(--muted); font-size: 10.5px; padding: 2px 4px; }
.bubble.emoji-big { font-size: 30px; padding: 8px 12px; background: none; }
.bubble-row.hers .bubble.emoji-big { background: var(--accent-soft); }
.bubble-row.mine .bubble.emoji-big { background: #f1f3f8; }
.bubble img { max-width: 190px; max-height: 200px; border-radius: 12px; display: block; }
.bubble.system {
  background: var(--lavender-soft); color: #7a5cae; font-size: 12px;
  text-align: center; border-radius: 999px; padding: 8px 14px; max-width: 90%;
  align-self: center; box-shadow: none;
}
.bubble.system .sys-bold { font-weight: 800; }

/* quick emoji */
.chat-actions { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.quick-emoji { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-emoji button {
  width: 38px; height: 38px; border-radius: 12px; font-size: 20px;
  background: #fbf3ff; border: 1px solid #f2defa; box-shadow: var(--shadow-soft);
  transition: transform .12s;
}
.quick-emoji button:active { transform: scale(0.9); }

.chat-input { display: flex; align-items: center; gap: 8px; position: relative; }
.chat-text {
  flex: 1; padding: 11px 14px; border-radius: 999px; border: 1px solid #f0e2f6;
  background: #fdf9ff; font-size: 14px; color: var(--ink); outline: none;
}
.chat-text::placeholder { color: var(--muted); }
.img-btn {
  width: 40px; height: 40px; border-radius: 12px; background: var(--sky-soft);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  flex-shrink: 0; cursor: pointer;
}
.send-btn {
  padding: 10px 16px; border-radius: 999px; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 14px; box-shadow: var(--shadow-soft); flex-shrink: 0;
}
.send-btn:active { transform: scale(0.95); }

.img-preview {
  position: absolute; bottom: 52px; left: 46px; max-width: 120px;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 6px;
}
.img-preview img { width: 100%; max-height: 120px; object-fit: cover; border-radius: 8px; display: block; }
.img-preview-close {
  position: absolute; top: -8px; right: -8px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; line-height: 1;
}

/* ---------------- Tab2 今天 ---------------- */
.big-card {
  text-align: center; padding: 30px 20px 26px;
  background: linear-gradient(150deg, #ffdcef 0%, #eedbfc 55%, #dbe9ff 100%);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: 16px;
}
.big-label { font-size: 13px; color: var(--ink-soft); font-weight: 700; letter-spacing: 2px; }
.big-number { font-size: 54px; font-weight: 900; color: var(--accent-deep); line-height: 1.15; margin: 6px 0; letter-spacing: -1px; }
.big-number span { font-size: 34px; }
.big-sub { font-size: 12px; color: var(--ink-soft); }
.big-sub b { color: var(--accent-deep); }

.timeline-card { }
.timeline { position: relative; margin-top: 16px; padding-left: 6px; }
.tl-block { position: relative; margin-left: 15px; padding-left: 18px; }
.tl-block::before {
  content: ""; position: absolute; left: 2px; top: 8px; bottom: 8px; width: 3px;
  background: #f0e4f4; border-radius: 3px;
}
.tl-row { position: relative; margin-bottom: 14px; }
.tl-dot {
  position: absolute; left: -19px; top: 12px; width: 12px; height: 12px; border-radius: 50%;
  border: 3px solid #fff; box-shadow: var(--shadow-soft); background: var(--mint); z-index: 2;
}
.tl-dot.break { background: #ffcb7a; }
.tl-dot.work { background: var(--mint); }
.tl-dot.other { background: var(--sky); }
.tl-bar {
  border-radius: 10px; padding: 10px 14px; color: #fff; display: flex; flex-direction: column; gap: 3px;
  box-shadow: var(--shadow-soft);
}
.tl-bar.lg { min-height: 56px; background: linear-gradient(90deg, #6fd0b4, #58c8a8); }
.tl-bar.sm { background: #ffd59a; color: #a86a16; }
.tl-bar.other { background: linear-gradient(90deg, #8cc6ee, #6fb8e8); }
.tl-times { display: flex; justify-content: space-between; font-size: 11px; opacity: 0.92; font-weight: 700; }
.tl-name { font-size: 13.5px; font-weight: 800; }
.tl-cat { font-size: 10.5px; opacity: 0.75; font-weight: 600; }
.tl-gap { height: 16px; }

/* ---------------- Tab3 想法 ---------------- */
.ideas-card { }
.ideas-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ideas-state-chip { font-size: 11px; padding: 4px 12px; border-radius: 999px; background: #eceff3; color: #9aa2ac; font-weight: 700; }
.ideas-state-chip.approved { background: #dcf6ea; color: #2f9e72; }
.ideas-state-chip.pending { background: #fff0ce; color: #c98a2b; }
.ideas-state { text-align: center; padding: 8px 0 4px; }
.ideas-lock-emoji { font-size: 46px; margin-bottom: 10px; }
.ideas-msg { font-size: 14px; color: var(--ink-soft); margin-bottom: 16px; line-height: 1.6; }
.approved-banner { font-size: 12px; color: #2f9e72; background: #dcf6ea; padding: 7px 12px; border-radius: 999px; display: inline-block; margin-bottom: 14px; font-weight: 800; }
.idea-list { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.idea-item {
  background: #fffdf5; border: 1px solid #f9edd6; border-radius: var(--radius);
  padding: 12px 14px;
}
.idea-time { font-size: 11px; color: var(--muted); font-weight: 700; }
.idea-text { font-size: 13.5px; margin-top: 4px; line-height: 1.5; font-weight: 600; }

.dev-card { background: #fbeef7; }
.dev-hint { font-size: 11px; color: var(--muted); margin-top: 8px; }
.dev-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---------------- 按钮 ---------------- */
.primary-btn {
  padding: 11px 18px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), #ff9cc2);
  color: #fff; font-weight: 800; font-size: 14px; box-shadow: var(--shadow-soft);
  transition: transform .12s;
}
.primary-btn:active { transform: scale(0.95); }
.primary-btn.locked { background: var(--lavender); background: linear-gradient(135deg, var(--lavender), #c8a4f4); }

/* ---------------- 底部 Tab ---------------- */
.tab-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 440px; z-index: 40;
  display: flex; padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 -8px 24px -14px rgba(180,130,180,0.4);
}
.tab-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px; border-radius: 14px; color: var(--muted);
}
.tab-btn .tab-ico { font-size: 22px; transition: transform .18s; }
.tab-btn .tab-label { font-size: 11px; font-weight: 700; }
.tab-btn.active { color: var(--accent-deep); }
.tab-btn.active .tab-ico { transform: translateY(-2px); }
.tab-btn.active .tab-label { }

/* ---------------- 设置 sheet ---------------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 50; background: rgba(60, 40, 66, 0.35);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  animation: fadein .2s ease;
}
.sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 440px; z-index: 60;
  background: #fffdfe; border-radius: 26px 26px 0 0; padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px -12px rgba(120,60,120,0.4);
  max-height: 86vh; overflow-y: auto;
  animation: sheetup .3s cubic-bezier(.2,.8,.3,1);
}
@keyframes sheetup { from { transform: translateX(-50%) translateY(40%); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
.sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: #e6d9ed; margin: 4px auto 14px; }
.sheet-title { font-size: 17px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.sheet-section { margin-top: 18px; }
.section-label { font-size: 13px; font-weight: 800; color: var(--accent-deep); margin-bottom: 10px; }
.row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 2px; font-size: 14px; font-weight: 600; border-bottom: 1px solid #f5edf7;
}
.row .muted { color: var(--muted); font-size: 11px; font-weight: 500; }
.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 27px; border-radius: 999px; background: #e3d7e9; position: relative; transition: background .2s; flex-shrink: 0; cursor: pointer; }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.2); transition: left .2s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { left: 22px; }

.bind-box { background: #fbf6fd; border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; }
.bind-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.bind-row span { color: var(--ink-soft); }
.bind-row .ok { color: #2f9e72; }
.sheet-action {
  width: 100%; text-align: left; padding: 13px 14px; margin-bottom: 8px;
  background: #fbf6fd; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; color: var(--ink);
}
.sheet-action:active { background: #f3e7f9; }
.danger-btn {
  width: 100%; padding: 12px; border-radius: var(--radius-sm); background: #ffecec;
  color: #d9534f; font-weight: 700; font-size: 13.5px;
}
.sheet-close {
  width: 100%; margin-top: 20px; padding: 14px; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 15px;
}

/* ---------------- 演示面板 ---------------- */
.dev-panel { position: fixed; right: 12px; z-index: 46; bottom: calc(96px + env(safe-area-inset-bottom)); }
.dev-panel-toggle {
  background: rgba(71, 62, 84, 0.85); color: #fff; font-size: 12px; font-weight: 700;
  padding: 9px 14px; border-radius: 999px; box-shadow: var(--shadow); backdrop-filter: blur(6px);
}
.dev-panel-body {
  background: rgba(255,255,255,0.95); border-radius: 16px; padding: 12px; margin-bottom: 8px;
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; gap: 8px;
}
.dev-row { display: flex; gap: 8px; }
.dev-status { font-size: 11px; color: var(--ink-soft); text-align: center; font-weight: 700; }

@media (min-width: 441px) {
  body { border-left: 1px solid rgba(255,255,255,0.6); border-right: 1px solid rgba(255,255,255,0.6); }
}

/* ---------------- 配对门 ---------------- */
.pair-mask {
  position: fixed; inset: 0; z-index: 80; background: var(--bg-gradient);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.pair-card {
  width: 100%; max-width: 340px; background: var(--card-solid); border-radius: var(--radius-lg);
  padding: 28px 24px; box-shadow: var(--shadow); text-align: center;
}
.pair-emoji { font-size: 40px; margin-bottom: 8px; }
.pair-title { font-size: 18px; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.pair-msg { font-size: 13px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 18px; }
.pair-field { display: flex; flex-direction: column; gap: 6px; text-align: left; margin-bottom: 14px; }
.pair-field > span { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.pair-field input {
  padding: 13px 14px; border-radius: var(--radius-sm); border: 1.5px solid #eadcf0;
  font-size: 18px; letter-spacing: 6px; text-align: center; font-weight: 800; color: var(--ink);
}
.pair-err { color: #d9534f; font-size: 12.5px; margin-bottom: 10px; }
.pair-skip { background: none; color: var(--muted); font-size: 12.5px; margin-top: 14px; padding: 6px; }

/* ---------------- 网络横幅 ---------------- */
.net-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(74, 59, 82, 0.92); color: #fff; font-size: 13px; text-align: center;
}

/* ---------------- 空态 & 开启通知 ---------------- */
.empty { padding: 26px 14px; text-align: center; color: var(--muted); font-size: 13.5px; }
.push-enable { margin-bottom: 14px; }
.sheet-section:nth-of-type(1) { margin-top: 4px; }
.sheet-section > .push-enable .primary-btn { width: 100%; }