/* ============================================================
   今天喝什么 · 前台样式
   奶油白打底，樱花粉 / 草莓红 / 薄荷绿 / 焦糖棕点缀。
   克制留白与细描边，不用大面积渐变、光球与嵌套卡片。
   ============================================================ */

:root {
  --cream:      #fffaf6;
  --cream-2:    #fff4ec;
  --paper:      #ffffff;
  --ink:        #3d3535;
  --ink-soft:   #7d7070;
  --ink-faint:  #a89c9c;
  --line:       #f0e2d8;
  --line-2:     #e6d5c8;

  --sakura:     #f2a8bd;
  --sakura-dp:  #e88ba6;
  --strawberry: #e0607a;
  --mint:       #8fcdb6;
  --caramel:    #b98a5f;
  --butter:     #f6d68a;

  --radius:     16px;
  --radius-sm:  10px;
  --shadow:     0 2px 10px rgba(190, 160, 140, .10);

  --tap:        44px;
  --wrap:       1120px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.3; }
p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--strawberry); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { width: 20px; height: 20px; flex: none; }
.icon--xl { width: 44px; height: 44px; }

/* ------------------------------------------------------------
   背景藏字线条（常驻设计）
   ------------------------------------------------------------ */
.bg-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  color: var(--caramel);
  opacity: .085;               /* 远看是装饰，凑近才认得出 */
  transition: opacity .6s ease;
}
.bg-lines svg { display: block; width: 100%; height: 100%; }

.bg-hidden-word {
  position: absolute;
  right: max(4vw, 24px);
  top: 46%;
  transform: rotate(-6deg);
  font-size: clamp(28px, 5.4vw, 62px);
  letter-spacing: .18em;
  font-weight: 600;
  color: transparent;
  -webkit-text-stroke: 1px var(--caramel);
  opacity: .5;
  white-space: nowrap;
  transition: opacity .5s ease, -webkit-text-stroke-color .5s ease;
}

/* 彩蛋触发后短暂加亮 */
.bg-lines.is-lit { opacity: .42; }
.bg-lines.is-lit .bg-hidden-word { opacity: 1; -webkit-text-stroke-color: var(--strawberry); }

.line-hotspot {
  position: fixed;
  width: 56px; height: 56px;
  border: 0; padding: 0;
  background: transparent;
  cursor: default;
  z-index: 1;
  opacity: 0;
}
.line-hotspot:focus-visible { opacity: 1; outline: 2px dashed var(--sakura); border-radius: 50%; }
.line-hotspot--a { left: 3vw;  top: 24vh; }
.line-hotspot--b { right: 6vw; top: 62vh; }
.line-hotspot--c { left: 42vw; bottom: 6vh; }

/* ------------------------------------------------------------
   顶部日期栏
   ------------------------------------------------------------ */
.topbar {
  position: relative;
  z-index: 3;
  background: rgba(255, 250, 246, .92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
  padding: 14px 0 12px;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.topbar__today {
  font-size: clamp(17px, 2.6vw, 21px);
  font-weight: 600;
  letter-spacing: .02em;
}
.topbar__sub {
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  /* 专属文案不允许挤占日历空间，超出一行直接截断 */
  max-width: 46ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar__anniv { color: var(--strawberry); }

.monthnav {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.monthnav__label {
  min-width: 116px;
  height: var(--tap);
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-weight: 600;
  cursor: pointer;
}
.monthnav__picker {
  position: absolute;
  left: 44px; top: 4px;
  width: 116px; height: 36px;
  opacity: 0;
  border: 0;
  cursor: pointer;
}

.iconbtn {
  width: var(--tap); height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.iconbtn:hover { background: var(--cream-2); border-color: var(--sakura); }
.iconbtn--ghost { border-style: dashed; }
.iconbtn:focus-visible, .btn:focus-visible, .seg:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--sakura-dp);
  outline-offset: 2px;
}

.topbar__notice {
  max-width: var(--wrap);
  margin: 10px auto 0;
  padding: 8px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: var(--caramel);
  background: #fdf3e6;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
}
.topbar__notice button {
  border: 0; background: none; color: var(--strawberry);
  text-decoration: underline; cursor: pointer; padding: 4px;
}

/* ------------------------------------------------------------
   通用面板
   ------------------------------------------------------------ */
main { position: relative; z-index: 2; padding-bottom: 90px; }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}
.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.panel__head h2 {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 16px;
}
.panel__head h2 .icon { color: var(--caramel); }

.btn {
  min-height: var(--tap);
  padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--cream-2); border-color: var(--sakura); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--strawberry); border-color: var(--strawberry); color: #fff; }
.btn--primary:hover { background: #d3546e; border-color: #d3546e; }
.btn--ghost { background: transparent; }
.btn--sm { min-height: 34px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.segmented { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.seg {
  min-height: 36px; padding: 0 14px;
  border: 0; background: var(--paper); cursor: pointer; font-size: 13px;
  border-right: 1px solid var(--line);
}
.seg:last-child { border-right: 0; }
.seg.is-on { background: var(--sakura); color: #fff; }

.hint { font-size: 12px; color: var(--ink-faint); }

/* ------------------------------------------------------------
   月历
   ------------------------------------------------------------ */
.calendar__head,
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar__head {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-faint);
  text-align: center;
}
.calendar__head span:first-child,
.calendar__head span:last-child { color: var(--sakura-dp); }

.cell {
  position: relative;
  min-height: 84px;
  padding: 5px 5px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.cell:hover { border-color: var(--sakura); }
.cell:active { transform: scale(.985); }
.cell--out { background: #fdfbf9; border-style: dashed; opacity: .5; cursor: default; }
.cell--out:hover { border-color: var(--line); }
.cell--today { border-color: var(--strawberry); box-shadow: inset 0 0 0 1px var(--strawberry); }
.cell--future .cell__num { color: var(--ink-faint); }
.cell--empty { cursor: default; }

.cell__num { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.cell--today .cell__num { color: var(--strawberry); }

.cell__count {
  position: absolute; top: 4px; right: 6px;
  font-size: 11px; color: var(--caramel);
  background: #fdf1e4; border-radius: 8px; padding: 0 5px;
}

.cell__thumbs { display: flex; gap: 3px; margin-top: 4px; }
.cell__thumb {
  width: 100%; aspect-ratio: 3 / 4;
  max-width: 32px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--cream-2);
  display: block;
}
.cell__more {
  align-self: center;
  font-size: 11px; color: var(--ink-soft);
  background: var(--cream-2);
  border-radius: 6px; padding: 2px 4px;
}

/* 热力底色：一眼看出哪一周喝疯了 */
.cell--h1 { background: #fff6f1; }
.cell--h2 { background: #ffeee4; }
.cell--h3 { background: #ffe3d4; }
.cell--h4 { background: #ffd7c3; }

.calendar__hint { margin-top: 10px; font-size: 12px; color: var(--ink-faint); text-align: center; }

/* 从上方轻柔落入所属日期格 */
@keyframes dropin {
  0%   { transform: translateY(-58vh) rotate(-9deg); opacity: 0; }
  62%  { transform: translateY(4px)   rotate(2deg);  opacity: 1; }
  80%  { transform: translateY(-3px)  rotate(-1deg); }
  100% { transform: translateY(0)     rotate(0);     opacity: 1; }
}
.is-dropping .cell__thumb {
  animation: dropin .78s cubic-bezier(.24, .84, .38, 1.02) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

/* ------------------------------------------------------------
   摘要 + 轮播
   ------------------------------------------------------------ */
.midrow {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 16px;
  align-items: start;
}
.summary { display: grid; gap: 12px; align-content: start; }

.statbox {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream-2);
}
.statbox__icon { grid-row: span 2; color: var(--caramel); display: flex; }
.statbox__icon .icon { width: 26px; height: 26px; }
.statbox__num { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--strawberry); }
.statbox__label { font-size: 12px; color: var(--ink-soft); }

.carousel { display: flex; flex-direction: column; }
.carousel__stage {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--cream-2);
}
.carousel__slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity .5s ease;
}
.carousel__slide.is-on { opacity: 1; }
.carousel__slide img {
  width: 100%; height: 100%;
  object-fit: cover;          /* 统一比例，不拉伸变形 */
  display: block;
}
.carousel__meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 12px 10px;
  background: linear-gradient(to top, rgba(50, 35, 35, .62), transparent);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.5;
}
.carousel__meta b { font-size: 14px; font-weight: 600; }
.carousel__empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--ink-faint); text-align: center;
}
.carousel__empty p { color: var(--ink-soft); }
.carousel__bar {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px;
}
.carousel__count { margin-left: auto; font-size: 12px; color: var(--ink-faint); }

/* ------------------------------------------------------------
   统计
   ------------------------------------------------------------ */
.stats__range {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 10px; font-size: 13px;
}
.stats__range input {
  min-height: 38px; padding: 0 8px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--paper);
}
.stats__filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}
.stats__filters select {
  min-height: 38px; max-width: 46vw;
  padding: 0 8px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--paper); font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.metric {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream-2);
}
.metric__v { font-size: 20px; font-weight: 700; color: var(--caramel); }
.metric__k { font-size: 12px; color: var(--ink-soft); }
.metric__x { font-size: 11px; color: var(--ink-faint); }

.charts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.chartcard {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.chartcard h3 { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 10px; }
.chartcard--wide { grid-column: 1 / -1; }

/* 排行条：颜色之外一定有文字与数值 */
.rankrow { margin-bottom: 9px; }
.rankrow__top { display: flex; justify-content: space-between; font-size: 12.5px; gap: 8px; }
.rankrow__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rankrow__val { color: var(--ink-soft); flex: none; }
.rankrow__bar { height: 8px; border-radius: 4px; background: var(--cream-2); margin-top: 3px; overflow: hidden; }
.rankrow__fill { height: 100%; border-radius: 4px; background: var(--sakura); transition: width .5s ease; }

.donutwrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.donutwrap svg { flex: none; }
.legend { font-size: 12px; display: grid; gap: 3px; }
.legend__i { display: flex; align-items: center; gap: 6px; }
.legend__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.legend__n { color: var(--ink-faint); }

.linewrap { width: 100%; overflow-x: auto; }
.linewrap svg { display: block; }

.empty { color: var(--ink-faint); font-size: 13px; padding: 10px 0; }

.report { margin-top: 16px; text-align: center; }

/* ------------------------------------------------------------
   城市
   ------------------------------------------------------------ */
.citylist { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.citycard {
  display: flex; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px; background: var(--cream-2);
}
.citycard img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; }
.citycard__ph {
  width: 48px; height: 48px; border-radius: 8px; flex: none;
  background: var(--paper); display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint);
}
.citycard__n { font-weight: 600; font-size: 14px; }
.citycard__m { font-size: 12px; color: var(--ink-soft); }

/* ------------------------------------------------------------
   时间线
   ------------------------------------------------------------ */
.searchbox {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 0 10px; background: var(--paper); color: var(--ink-faint);
}
.searchbox input {
  border: 0; outline: 0; background: transparent;
  min-height: 38px; width: min(52vw, 240px); font-size: 13px; color: var(--ink);
}

.tl { display: grid; gap: 10px; }
.tlrow {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 10px;
  align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px;
}
.tlrow img, .tlrow__ph {
  width: 56px; height: 56px; border-radius: 8px; object-fit: cover;
  background: var(--cream-2);
  display: flex; align-items: center; justify-content: center; color: var(--ink-faint);
}
.tlrow__t { font-weight: 600; font-size: 14px; }
.tlrow__m { font-size: 12px; color: var(--ink-soft); }
.tlrow__d { font-size: 12px; color: var(--ink-faint); text-align: right; white-space: nowrap; }
.tlrow__again {
  border: 1px dashed var(--line-2); background: transparent;
  border-radius: 8px; padding: 4px 8px; font-size: 12px; cursor: pointer; color: var(--caramel);
}
.tlrow__again:hover { border-color: var(--sakura); background: var(--cream-2); }
.tl__more { text-align: center; margin-top: 12px; }
.tl__end { font-size: 12px; color: var(--ink-faint); }

/* ------------------------------------------------------------
   悬浮按钮
   ------------------------------------------------------------ */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  min-height: 52px;
  padding: 0 20px 0 16px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: 26px;
  background: var(--strawberry); color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(224, 96, 122, .34);
  cursor: pointer;
}
.fab:active { transform: translateY(1px); }

/* ------------------------------------------------------------
   抽屉 / 弹窗
   ------------------------------------------------------------ */
.drawer, .modal, .egg { position: fixed; inset: 0; z-index: 40; }
.drawer__mask, .modal__mask, .egg__mask {
  position: absolute; inset: 0;
  background: rgba(60, 44, 44, .38);
  backdrop-filter: blur(2px);
}
.drawer__panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(460px, 92vw);
  background: var(--paper);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  animation: slidein .26s ease both;
}
@keyframes slidein { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }

.drawer__head, .modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.drawer__head h2, .modal__head h2 { font-size: 16px; }
.drawer__body { padding: 14px 16px; overflow-y: auto; }

.modal__panel {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius);
  animation: popin .22s ease both;
}
@keyframes popin { from { transform: translate(-50%, -48%) scale(.98); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.modal__panel--report { width: min(430px, 94vw); }

.daycard {
  display: grid; grid-template-columns: 84px 1fr; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px; margin-bottom: 10px;
}
.daycard img, .daycard__ph {
  width: 84px; height: 106px; border-radius: 8px; object-fit: cover;
  background: var(--cream-2);
  display: flex; align-items: center; justify-content: center; color: var(--ink-faint);
}
.daycard__t { font-weight: 600; }
.daycard__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tag {
  font-size: 11.5px; padding: 2px 7px;
  border-radius: 20px; background: var(--cream-2); color: var(--ink-soft);
  border: 1px solid var(--line);
}
.daycard__note { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; }
.daycard__foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

/* ------------------------------------------------------------
   表单
   ------------------------------------------------------------ */
.form { padding: 14px 16px 18px; }
.form__row { margin-bottom: 13px; }
.form__row > label {
  display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 5px;
}
.form__row > label i { color: var(--strawberry); font-style: normal; margin-left: 2px; }
.form__row > label .hint { margin-left: 6px; }
.form__grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form input[type="text"], .form input[type="date"], .form input[type="number"],
.form input[type="search"], .form select, .form textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 15px;               /* 手机上小于 16px 会触发缩放，这里保持 15 并配合 viewport 处理 */
  color: var(--ink);
}
.form textarea { min-height: 62px; resize: vertical; }

.withnew { display: flex; gap: 8px; align-items: stretch; }
.withnew select { flex: 1; }
.newinput { margin-top: 8px; }

.combo { position: relative; }
.combo__list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  z-index: 5;
  max-height: 240px; overflow-y: auto;
  margin: 0; padding: 4px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 22px rgba(160, 130, 110, .16);
}
.combo__list li {
  padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px;
  display: flex; justify-content: space-between; gap: 8px;
}
.combo__list li:hover, .combo__list li.is-cur { background: var(--cream-2); }
.combo__list li small { color: var(--ink-faint); }
.combo__list li.is-new { color: var(--strawberry); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  border: 1px solid var(--line-2); background: var(--paper);
  border-radius: 20px; padding: 6px 12px; font-size: 13px; cursor: pointer;
  min-height: 34px;
}
.chip.is-on { background: var(--sakura); border-color: var(--sakura); color: #fff; }

.rating { display: flex; gap: 2px; }
.rating__star {
  width: 38px; height: 38px;
  border: 0; background: none; cursor: pointer;
  color: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.rating__star.is-on { color: var(--butter); }
.rating__star.is-on .icon { fill: var(--butter); }

.photopick { display: flex; align-items: center; gap: 12px; }
.photopick input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photopick__btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--tap); padding: 0 14px;
  border: 1px dashed var(--line-2); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 14px; color: var(--ink-soft);
}
.photopick__btn:hover { border-color: var(--sakura); background: var(--cream-2); }
.photopick__preview { position: relative; }
.photopick__preview img { width: 64px; height: 80px; object-fit: cover; border-radius: 8px; display: block; }
.photopick__preview button {
  position: absolute; top: -8px; right: -8px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--paper);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.photopick__preview button .icon { width: 14px; height: 14px; }

.form__err {
  background: #fdeaee; border: 1px solid #f4c3ce; color: #b2405b;
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; margin-bottom: 12px;
}
.form__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.form__queue { margin-top: 10px; font-size: 12.5px; color: var(--caramel); }

/* ------------------------------------------------------------
   报告长图
   ------------------------------------------------------------ */
.reportbox { padding: 14px 16px; text-align: center; }
.reportbox img { width: 100%; border-radius: var(--radius-sm); display: block; }
.reportbox__loading { color: var(--ink-faint); padding: 40px 0; }
.modal__panel--report .hint { text-align: center; padding-bottom: 14px; }

/* ------------------------------------------------------------
   彩蛋
   ------------------------------------------------------------ */
.egg { z-index: 60; }
.egg__body {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(360px, 88vw);
  padding: 26px 22px 20px;
  border-radius: 22px;
  background: var(--paper);
  text-align: center;
  animation: eggpop .4s cubic-bezier(.2, .9, .3, 1.1) both;
}
@keyframes eggpop { from { transform: translate(-50%, -46%) scale(.9); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.egg__art { height: 76px; margin-bottom: 8px; position: relative; }
.egg__art img { height: 76px; object-fit: contain; }
.egg__lead { font-size: 13.5px; color: var(--ink-soft); }
.egg__main {
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 700; letter-spacing: .06em;
  color: var(--strawberry);
  margin: 8px 0 16px;
}

.heartbit {
  position: absolute; left: 50%; bottom: 0;
  width: 14px; height: 14px;
  color: var(--sakura-dp);
  animation: floatup 1.5s ease-out forwards;
}
@keyframes floatup {
  0%   { transform: translate(-50%, 0) scale(.5); opacity: 0; }
  25%  { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx, 0px)), -70px) scale(1.15); opacity: 0; }
}

/* 长按日期时从杯子冒出的爱心 */
.cell__hearts { position: absolute; inset: 0; pointer-events: none; }

/* ------------------------------------------------------------
   Toast
   ------------------------------------------------------------ */
.toast {
  position: fixed;
  left: 50%; bottom: 92px;
  transform: translateX(-50%);
  z-index: 80;
  max-width: 88vw;
  padding: 10px 16px;
  border-radius: 22px;
  background: rgba(61, 53, 53, .93);
  color: #fff;
  font-size: 13.5px;
  animation: toastin .2s ease both;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.foot {
  position: relative; z-index: 2;
  text-align: center; padding: 20px 16px 30px;
  font-size: 12px; color: var(--ink-faint);
}

/* ------------------------------------------------------------
   响应式
   ------------------------------------------------------------ */
@media (max-width: 860px) {
  .midrow { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr 1fr; }
  .bg-hidden-word { top: 38%; font-size: clamp(22px, 8vw, 40px); }
}

@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 10px; }
  .panel { padding: 12px; border-radius: 14px; }
  .topbar__inner { gap: 10px; }
  .monthnav { width: 100%; justify-content: space-between; }
  .monthnav__label { flex: 1; min-width: 0; }
  .monthnav__picker { left: 48px; width: calc(100% - 140px); }

  .calendar__head, .calendar__grid { gap: 4px; }
  .cell { min-height: 62px; padding: 3px; border-radius: 10px; }
  .cell__thumb { max-width: 100%; }
  .cell__count { font-size: 10px; padding: 0 4px; }

  .form__grid2 { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .tlrow { grid-template-columns: 48px 1fr; }
  .tlrow img, .tlrow__ph { width: 48px; height: 48px; }
  .tlrow__d { grid-column: 2; text-align: left; }
  .searchbox input { width: 100%; }
  .panel__head { align-items: flex-start; }
  .drawer__panel { width: 100%; }
  .fab { right: 12px; }
  .line-hotspot { width: 44px; height: 44px; }
}

@media (max-width: 380px) {
  .summary { grid-template-columns: 1fr; }
  .statbox__num { font-size: 26px; }
}

/* ------------------------------------------------------------
   减少动态效果
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .is-dropping .cell__thumb { animation: none; }
}

/* 打印时去掉背景纹样 */
@media print {
  .bg-lines, .fab, .line-hotspot { display: none; }
}
