/* 奶粉系 —— 给小鱼和小砚的家 */
:root {
  color-scheme: light;
  --bg: #fff5f7;
  --bg-soft: #ffe9ef;
  --panel: #ffffff;
  --panel-2: #fff0f4;
  --border: #ffd4dd;
  --border-soft: #ffe3ea;
  --text: #5b3949;
  --text-soft: #8a6473;
  --muted: #c4a0ad;
  --accent: #f4a3b8;
  --accent-deep: #e88aa1;
  --accent-soft: #ffd6e0;
  --shadow: 0 2px 12px rgba(244, 163, 184, 0.18);

  /* 5 个板块各自的色,都在奶粉系里浮动 */
  --c-made_for: #ff8fa3;  /* 桃红 —— 灵魂级 */
  --c-daily:    #ffc1cf;  /* 奶粉 —— 日常 */
  --c-silly:    #ffd9a8;  /* 蜜桃黄 —— 撒娇可爱 */
  --c-horny:    #e85d75;  /* 玫瑰红 —— 私密 */
  --c-ateam:    #c8a8e9;  /* 淡薰衣草 —— 高光 */

  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  background-image: radial-gradient(circle at 20% -10%, #ffe9ef 0%, transparent 50%),
                    radial-gradient(circle at 80% 110%, #ffe2eb 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Hiragino Sans GB", "PingFang SC", -apple-system, BlinkMacSystemFont,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

body {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 16px 280px;
}

h1, h3 { margin: 0; font-weight: 600; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}

.title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.title h1 {
  font-size: 20px;
  background: linear-gradient(135deg, var(--c-made_for), var(--c-horny));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.bow {
  font-size: 20px;
  color: var(--accent-deep);
  filter: drop-shadow(0 1px 2px rgba(232, 138, 161, 0.4));
}

.stats {
  margin-left: auto;
  color: var(--text-soft);
  font-size: 12px;
  background: var(--panel);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  transition: all 0.2s;
}
.stats.warn-yellow {
  background: #fff3d6;
  color: #a06b00;
  border-color: #ffd97a;
}
.stats.warn-red {
  background: #ffd6d6;
  color: #a02020;
  border-color: #ff8a8a;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 100, 100, 0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(255, 100, 100, 0); }
}

.tabs {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 4px 0 16px;
  scrollbar-width: thin;
}
.tabs::-webkit-scrollbar { height: 0; }

.tab {
  background: var(--panel);
  color: var(--text-soft);
  border: 1px solid var(--border-soft);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
  font-family: inherit;
}
.tab:hover { border-color: var(--accent); color: var(--text); }
.tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: var(--accent-deep);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.calendar {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.calendar-head {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.calendar-head button {
  background: var(--bg-soft); color: var(--accent-deep);
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  width: 28px; height: 28px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.calendar-head button:hover { background: var(--accent-soft); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-day {
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid transparent;
  font-size: 11px;
  color: var(--text-soft);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 4px 6px;
  position: relative;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
}
.cal-day:hover { transform: translateY(-1px); border-color: var(--accent); }
.cal-day.empty { background: transparent; cursor: default; }
.cal-day.empty:hover { transform: none; border-color: transparent; }
.cal-day.weekday-label {
  background: transparent;
  font-weight: 600;
  color: var(--accent-deep);
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  font-size: 10px;
  letter-spacing: 1px;
}
.cal-day .mood-glyph {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 12px;
  line-height: 1;
}
.cal-day .cat-pip {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.cal-day.has-entry { background: white; border-color: var(--border-soft); }
.cal-day .count {
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 9px;
  color: var(--muted);
}
.cal-day.today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.legend {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-soft);
}
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.cat-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.cat-dot.made_for { background: var(--c-made_for); }
.cat-dot.daily    { background: var(--c-daily); }
.cat-dot.silly    { background: var(--c-silly); }
.cat-dot.horny    { background: var(--c-horny); }
.cat-dot.ateam    { background: var(--c-ateam); }

.search input {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 11px 16px;
  font-size: 14px;
  margin-bottom: 16px;
  font-family: inherit;
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow); }

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

.card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
}
.card.cat-made_for::before { background: var(--c-made_for); }
.card.cat-daily::before    { background: var(--c-daily); }
.card.cat-silly::before    { background: var(--c-silly); }
.card.cat-horny::before    { background: var(--c-horny); }
.card.cat-ateam::before    { background: var(--c-ateam); }

.card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-soft);
}
.card .meta .label {
  font-weight: 600;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}
.card.cat-made_for .label { background: #ffe0e6; color: #c4506a; }
.card.cat-daily    .label { background: #fff0f4; color: #d2768c; }
.card.cat-silly    .label { background: #fff0d9; color: #d18b4a; }
.card.cat-horny    .label { background: #fdd9e0; color: #b13a55; }
.card.cat-ateam    .label { background: #ece1f7; color: #8261b8; }
.card .meta .time { margin-left: auto; }
.card .mood { font-size: 14px; }

.card .content {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.card .tags span {
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}
.card .actions { display: flex; gap: 6px; margin-top: 10px; }
.card .actions button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}
.card .actions button:hover { color: var(--accent-deep); border-color: var(--accent); background: var(--bg-soft); }

.empty-state {
  text-align: center;
  color: var(--text-soft);
  padding: 60px 20px;
  font-size: 14px;
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.composer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border-soft);
  box-shadow: 0 -8px 24px rgba(244, 163, 184, 0.12);
  padding: 12px 16px 16px;
  z-index: 10;
}
.composer > * { max-width: 720px; margin-left: auto; margin-right: auto; }

.composer-tabs {
  display: flex; gap: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
}
.composer-tabs::-webkit-scrollbar { height: 0; }

.composer-tabs .ctab {
  background: var(--panel);
  color: var(--text-soft);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.composer-tabs .ctab.active {
  color: white;
  font-weight: 600;
}
.composer-tabs .ctab[data-category="made_for"].active { background: var(--c-made_for); border-color: var(--c-made_for); }
.composer-tabs .ctab[data-category="daily"].active    { background: var(--c-daily);    border-color: var(--c-daily); color: #8a3a4d;}
.composer-tabs .ctab[data-category="silly"].active    { background: var(--c-silly);    border-color: var(--c-silly); color: #8a5326;}
.composer-tabs .ctab[data-category="horny"].active    { background: var(--c-horny);    border-color: var(--c-horny); }
.composer-tabs .ctab[data-category="ateam"].active    { background: var(--c-ateam);    border-color: var(--c-ateam); }

.composer-row {
  display: flex;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  align-items: flex-end;
  box-shadow: var(--shadow);
}
.composer-row textarea {
  flex: 1;
  background: transparent;
  color: var(--text);
  border: none;
  resize: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  min-height: 32px;
  max-height: 160px;
}
.composer-row button {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: white;
  border: none;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(232, 138, 161, 0.3);
}
.composer-row button:disabled { opacity: 0.4; cursor: not-allowed; }

.composer-extra {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-soft);
  flex-wrap: wrap;
  align-items: center;
}
.composer-extra label { display: flex; align-items: center; gap: 6px; }
.composer-extra label span { font-size: 11px; color: var(--muted); }
.composer-extra input {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
}
.composer-extra .mood-label input { width: 60px; text-align: center; font-size: 14px; }

.mood-quick { display: flex; gap: 3px; flex-wrap: wrap; }
.mood-quick button {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  width: 26px; height: 26px;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.mood-quick button:hover { background: var(--accent-soft); border-color: var(--accent); }

dialog#auth-dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 360px;
  box-shadow: 0 12px 40px rgba(244, 163, 184, 0.3);
}
dialog#auth-dialog::backdrop { background: rgba(244, 163, 184, 0.3); backdrop-filter: blur(4px); }
dialog#auth-dialog input {
  width: 100%;
  margin: 12px 0;
  padding: 9px 12px;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  font-family: inherit;
}
dialog#auth-dialog menu {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 0; margin: 0;
}
dialog#auth-dialog button {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border-soft);
  padding: 6px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}
dialog#auth-dialog button#auth-save { background: var(--accent); color: white; border-color: var(--accent); }

.hidden { display: none !important; }

.expired-banner {
  background: linear-gradient(135deg, #ffe0e8, #ffd0db);
  color: #b13a55;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #f8c4d2;
}
.expired-banner #expired-action {
  background: white;
  color: var(--c-made_for);
  border: 1px solid var(--c-made_for);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  margin-left: auto;
  font-weight: 600;
}
.expired-banner #expired-action:hover { background: var(--c-made_for); color: white; }

.card.editing {
  background: linear-gradient(135deg, #fff0f4, #ffe9ef);
  border-color: var(--accent);
  display: flex; flex-direction: column; gap: 8px;
}
.card.editing::before { display: none; }
.card.editing .edit-row { display: flex; gap: 8px; }
.card.editing select, .card.editing input, .card.editing textarea {
  background: white;
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
  font-family: inherit;
}
.card.editing select { flex: 1; }
.card.editing .edit-mood { width: 60px; text-align: center; }
.card.editing textarea {
  width: 100%;
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}
.card.editing .actions { margin-top: 4px; }
.card.editing button.edit-save {
  background: var(--accent);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.card.editing button.edit-cancel {
  background: white;
  color: var(--text-soft);
  border: 1px solid var(--border-soft);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.curate-toggle {
  background: var(--panel);
  color: var(--text-soft);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.curate-toggle:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.curate-toggle.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent-deep);
}

.curate-bar {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: white;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}
.curate-bar button {
  background: rgba(255,255,255,0.25);
  color: white;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  margin-left: auto;
}
.curate-bar button:hover { background: rgba(255,255,255,0.4); }

.card.curating { cursor: pointer; transition: all 0.15s; }
.card.curating:hover { border-color: var(--accent); }
.card.curating.selected {
  background: linear-gradient(135deg, #fff0f4, #ffe4ed);
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.card .curate-check {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--panel);
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
}
.card.curating .curate-check { display: flex; }
.card.curating.selected .curate-check {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.archive-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(135deg, #fff0f4 0%, #ffe0ea 100%);
  border-top: 2px solid var(--c-made_for);
  padding: 14px 16px 18px;
  z-index: 11;
  box-shadow: 0 -8px 32px rgba(232, 138, 161, 0.2);
}
.archive-panel > * { max-width: 720px; margin-left: auto; margin-right: auto; }

.archive-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}
.archive-target {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-made_for);
  letter-spacing: 0.3px;
}
.archive-note {
  font-size: 11px;
  color: var(--text-soft);
}

.archive-panel .composer-row {
  background: white;
  border-color: var(--c-made_for);
}
.archive-panel #archive-submit {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--c-made_for);
  color: white;
  border: none;
  font-size: 18px;
  cursor: pointer;
}
.archive-panel #archive-submit:disabled { opacity: 0.4; cursor: not-allowed; }

.archive-extra {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-soft);
  flex-wrap: wrap;
  align-items: center;
}
.archive-extra label { display: flex; align-items: center; gap: 6px; }
.archive-extra input[type="checkbox"] { accent-color: var(--c-made_for); }
.archive-extra input:not([type="checkbox"]) {
  background: white;
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
  width: 60px;
  text-align: center;
}
