/* 我们的日子 · 温馨简洁 / 移动端优先 */
:root {
  --pink: #f48fb1;
  --pink-deep: #e46f98;
  --pink-soft: #ffe6ef;
  --bg: #fff9fb;
  --card: #ffffff;
  --text: #4a3b41;
  --muted: #9b8790;
  --line: #f2e2e9;
  --danger: #e05a6a;
  --shadow: 0 4px 18px rgba(224, 130, 165, .12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.view { max-width: 720px; margin: 0 auto; padding: 16px 14px 60px; }
[hidden] { display: none !important; }

h1 { font-size: 24px; margin: 6px 0 2px; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 15px; margin: 0 0 10px; }
h4 { font-size: 14px; margin: 14px 0 6px; }
p { margin: 6px 0; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.center { text-align: center; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin: 0 0 14px;
  box-shadow: var(--shadow);
}
.card.soft { background: #fff5f9; box-shadow: none; margin-bottom: 0; }
hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* 按钮 */
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 9px 14px;
  transition: transform .08s, filter .15s;
}
button:active { transform: scale(.97); }
button.primary { background: var(--pink); color: #fff; border-color: var(--pink); font-weight: 600; }
button.primary:hover { filter: brightness(1.04); }
button.block { width: 100%; margin-top: 8px; }
button.small { padding: 7px 12px; font-size: 13px; }
button.mini { padding: 5px 10px; font-size: 12px; border-radius: 9px; }
button.danger { color: var(--danger); border-color: #f6cdd4; background: #fff6f7; }
button.icon-btn { border: none; background: transparent; font-size: 18px; padding: 4px 8px; }
button.nav-btn { border: none; background: transparent; font-size: 26px; line-height: 1; padding: 2px 12px; color: var(--pink-deep); }
button.link-btn { border: none; background: transparent; color: var(--muted); text-decoration: underline; font-size: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }

/* 表单 */
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=datetime-local], textarea, input[type=file] {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--pink); }
input[type=file] { font-size: 12px; padding: 8px; }
textarea { resize: vertical; }
.row { display: flex; gap: 10px; }
.row > label { flex: 1; }
.switch-row { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--text); font-size: 14px; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--pink); }

/* 登录页 */
.auth-card { margin-top: 8vh; text-align: left; padding: 24px 20px; }
.logo { font-size: 46px; text-align: center; }
.auth-card h1 { text-align: center; }
.sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.tabs { display: flex; background: var(--pink-soft); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.tabs button { flex: 1; border: none; background: transparent; border-radius: 9px; padding: 8px; }
.tabs button.active { background: #fff; color: var(--pink-deep); font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,.05); }
.divider { text-align: center; color: var(--muted); font-size: 12px; margin: 14px 0; }
.code-box { margin: 10px 0; padding: 10px 12px; background: #fff5f9; border-radius: 12px; word-break: break-all; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.code-box code { color: var(--pink-deep); font-weight: 600; }
.code-box .token { font-size: 11px; word-break: break-all; flex: 1; min-width: 180px; }

/* 顶栏 */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 14px; }
.brand { font-weight: 700; font-size: 17px; color: var(--pink-deep); }
.top-actions { display: flex; gap: 6px; }
.top-actions button { border: none; background: #fff; font-size: 17px; padding: 6px 10px; box-shadow: var(--shadow); }

/* 月份条 */
.month-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.month-label { flex: 1; text-align: center; font-weight: 700; font-size: 17px; }
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; color: var(--muted); font-size: 12px; padding: 4px 0 8px; }
.weekdays span:nth-last-child(-n+2) { color: var(--pink-deep); }

/* 日历 */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day {
  aspect-ratio: 1 / 1.12;
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #fff;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  position: relative;
}
.day.other { opacity: .35; }
.day.today { border-color: var(--pink); }
.day.selected { background: var(--pink-soft); border-color: var(--pink); }
.day .num { font-size: 13px; font-weight: 600; line-height: 1.3; }
.day.today .num { color: var(--pink-deep); }
.day .dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.day .dot { width: 6px; height: 6px; border-radius: 50%; }
.day .more { font-size: 9px; color: var(--muted); }

/* 当日详情 */
.day-panel { margin-top: 18px; }
.day-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.event-item {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-left-width: 5px;
  border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
  box-shadow: var(--shadow); cursor: pointer;
}
.event-item .ev-main { flex: 1; min-width: 0; }
.event-item .ev-title { font-weight: 600; word-break: break-word; }
.event-item .ev-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.event-item .ev-rem { font-size: 11px; color: var(--pink-deep); margin-top: 4px; word-break: break-word; }
.ev-tag { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: #fff0f5; color: var(--pink-deep); margin-left: 4px; }
.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 18px 0; }

/* 留言 */
.msg-block { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 16px; }
.msg-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.msg-item .m-head { font-size: 12px; color: var(--pink-deep); font-weight: 600; }
.msg-item .m-time { color: var(--muted); font-weight: 400; margin-left: 6px; }
.msg-item .m-body { margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.msg-item img { max-width: 100%; border-radius: 10px; margin-top: 8px; display: block; }
.msg-item a { color: var(--pink-deep); font-size: 13px; }
.msg-compose { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.compose-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.compose-row input[type=file] { flex: 1; margin: 0; }

/* 弹层 */
.modal-backdrop { position: fixed; inset: 0; background: rgba(60, 30, 42, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal {
  background: var(--bg); width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.colors .swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); padding: 0; }
.colors .swatch.active { box-shadow: 0 0 0 2px var(--text); }
.quick-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.quick-row .quick { font-size: 11px; padding: 5px 8px; background: #fff; }
.rem-row { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.rem-row input { flex: 1; margin: 0; }
.rem-row button { padding: 6px 9px; font-size: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-actions .primary { min-width: 110px; }

/* 订阅列表 */
.sub-item { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--line); }
.sub-item span { flex: 1; word-break: break-all; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: rgba(74, 59, 65, .94); color: #fff; padding: 10px 18px;
  border-radius: 20px; font-size: 13px; z-index: 100; max-width: 86vw; text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

/* v1.2 照片仓库：状态条与电脑离线时的占位卡片 */
.photo-status {
  font-size: 12px; line-height: 1.65; padding: 9px 12px; border-radius: 10px;
  margin: 0 0 10px; word-break: break-all;
}
.photo-status.ok  { background: #eef8f0; border: 1px solid #cfe8d5; color: #3f6b4b; }
.photo-status.off { background: #fff7e8; border: 1px solid #f2dfb7; color: #8a6a32; }
.photo-offline {
  font-size: 12px; color: var(--muted); background: #faf6f8;
  border: 1px dashed var(--line); border-radius: 10px;
  padding: 10px 12px; margin: 6px 0; line-height: 1.6; word-break: break-all;
}

@media (min-width: 600px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 22px; max-height: 86vh; }
  .day { min-height: 72px; }
  .day .num { font-size: 15px; }
}
