:root {
  --sky: #bfe8ff;
  --sky-2: #e7f7ff;
  --pink: #ffd1e3;
  --pink-2: #fff0f7;
  --cream: #fff8df;
  --ink: #526070;
  --muted: #8a9bae;
  --blue: #68aeda;
  --purple: #9d83c6;
  --danger: #df6b8c;
  --ok: #78bf93;
  --shadow: rgba(102, 137, 166, .28);
  --font: "Microsoft YaHei", "PingFang SC", sans-serif;
  --hand: "KaiTi", "STKaiti", "Comic Sans MS", cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 209, 227, .62), transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(255, 248, 223, .72), transparent 30%),
    linear-gradient(135deg, #d8f2ff, #fff0f7 48%, #fff7d4);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.24) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .45;
}

button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.cursor-glow {
  position: fixed;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 185, 215, .85), transparent 68%);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}

.petal-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 9px;
  border-radius: 80% 10% 80% 10%;
  background: #ffb9d2;
  opacity: .66;
  animation: fall linear forwards;
}

@keyframes fall {
  to { transform: translateY(110vh) rotate(420deg); }
}

.restore-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 4;
}

.restore-card {
  width: min(1080px, 96vw);
  background: rgba(255, 255, 255, .78);
  border: 4px solid #fff;
  border-radius: 24px;
  box-shadow: 0 24px 80px var(--shadow);
  overflow: hidden;
}

.restore-titlebar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  color: #fff;
  background: linear-gradient(90deg, #73bce5, #d995c1);
  font-weight: 700;
}

.restore-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  padding: 26px;
}

.restore-left h1 {
  margin: 0 0 12px;
  color: #5e8fb7;
  font-family: var(--hand);
  font-size: clamp(30px, 5vw, 54px);
}

.progress-shell {
  height: 18px;
  border: 2px solid #fff;
  background: rgba(173, 216, 240, .45);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 0 8px rgba(90, 150, 190, .18);
}

.progress-fill {
  width: 32%;
  height: 100%;
  background: repeating-linear-gradient(45deg, #8bd2f6 0 10px, #ffbad3 10px 20px);
  transition: width .4s ease;
}

.restore-log {
  margin: 18px 0;
  padding: 14px;
  background: rgba(255, 248, 223, .72);
  border: 1px dashed #e2b5ca;
  border-radius: 14px;
  font-size: 14px;
}

.password-row, .form-line {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.blog-input, .blog-textarea, select {
  border: 2px solid #fff;
  background: rgba(255, 255, 255, .86);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  box-shadow: 0 4px 12px rgba(118, 166, 196, .12);
}

.blog-input:focus, .blog-textarea:focus, select:focus {
  border-color: #ffabd0;
  box-shadow: 0 0 0 4px rgba(255, 171, 208, .18);
}

.blog-input.small { width: 190px; padding: 8px 10px; }
.blog-textarea { width: min(700px, 100%); min-height: 116px; resize: vertical; line-height: 1.75; }

.blog-btn, .mini-link, .friend-link {
  border: 2px solid #fff;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #e7f7ff);
  color: #5b7d9b;
  padding: 9px 13px;
  box-shadow: 0 5px 14px rgba(90, 150, 190, .16);
  transition: transform .12s ease, box-shadow .12s ease;
}

.blog-btn:hover, .mini-link:hover, .friend-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(90, 150, 190, .22);
}

.blog-btn.primary {
  color: #fff;
  background: linear-gradient(180deg, #74c1eb, #d796c3);
}

.blog-btn.danger { color: #bd5575; }
.blog-btn.wide { width: 100%; margin-top: 10px; }

.metadata-card {
  background: rgba(255, 248, 223, .72);
  border: 2px dashed #ffb9d2;
  border-radius: 20px;
  padding: 18px;
  position: relative;
}

.metadata-card h2 { margin-top: 0; color: #8e84bc; }
.metadata-card dl { margin: 0; }
.metadata-card dt { color: var(--muted); font-size: 13px; }
.metadata-card dd { margin: 2px 0 10px; font-weight: 700; }
.metadata-card .important { color: #df6b8c; }
.meta-avatar { width: 112px; display: block; margin: 10px auto 0; transform: rotate(3deg); }

.blog-screen {
  width: min(1240px, calc(100vw - 24px));
  margin: 18px auto 28px;
  position: relative;
  z-index: 4;
}

.blog-header, .blog-footer, .blog-sidebar, .blog-main {
  background: rgba(255, 255, 255, .72);
  border: 3px solid #fff;
  border-radius: 22px;
  box-shadow: 0 16px 46px var(--shadow);
}

.blog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px;
  margin-bottom: 14px;
  background:
    linear-gradient(90deg, rgba(191,232,255,.9), rgba(255,209,227,.9)),
    rgba(255,255,255,.75);
}

.blog-banner { display: flex; align-items: center; gap: 14px; }
.blog-banner img { width: 76px; height: 76px; border-radius: 18px; }
.blog-banner h1 { margin: 0; font-family: var(--hand); color: #5e8fb7; font-size: 40px; }
.blog-banner p { margin: 4px 0 0; color: #7590a6; }
.header-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.blog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
}

.blog-sidebar { padding: 14px; align-self: start; }
.widget {
  background: rgba(255, 248, 223, .62);
  border: 2px dashed rgba(255, 185, 210, .75);
  border-radius: 18px;
  padding: 13px;
  margin-bottom: 12px;
}

.widget h3 { margin: 0 0 10px; color: #9d83c6; font-family: var(--hand); font-size: 22px; }
.profile-widget img { width: 96px; display: block; margin: 0 auto 8px; }
.widget p { margin: 8px 0; font-size: 13px; line-height: 1.55; }

.meter {
  height: 13px;
  background: rgba(140, 188, 219, .24);
  border: 2px solid #fff;
  border-radius: 999px;
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #78bf93, #73bce5, #ffb3cf);
  transition: width .25s ease;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}
.calendar-grid button {
  border: 1px solid #fff;
  border-radius: 8px;
  padding: 6px 0;
  color: #6a7a8c;
  background: rgba(255, 255, 255, .76);
}
.calendar-grid button.selected { background: #ffbfd8; color: #fff; }
.calendar-grid button.fixed { background: #c6ead4; }

.player-screen {
  padding: 10px;
  border-radius: 12px;
  background: #f9f0ff;
  color: #8369ad;
  margin-bottom: 8px;
  border: 1px solid #fff;
}

.friend-link, .mini-link {
  display: block;
  width: 100%;
  margin-bottom: 7px;
  text-align: left;
}
.hidden-link { opacity: .28; }

.counter {
  border: 3px inset #b9d8ed;
  background: #1d3550;
  color: #a8ffbd;
  font-family: Consolas, monospace;
  font-size: 24px;
  letter-spacing: 2px;
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}

.blog-main { padding: 14px; overflow: hidden; }
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tab {
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, .74);
  color: #7394ad;
}
.tab.active { background: linear-gradient(90deg, #bfe8ff, #ffd1e3); color: #5c6386; font-weight: 700; }
.tab.locked { opacity: .48; }
.tab.locked::after { content: " 🔒"; }

.tab-page { display: none; }
.tab-page.active { display: block; }

.blog-post, .puzzle-card, .message-board {
  position: relative;
  background:
    linear-gradient(90deg, rgba(255,255,255,.38), transparent 65%),
    rgba(255, 255, 255, .76);
  border: 2px solid #fff;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(125, 163, 190, .15);
}

.blog-post::before, .puzzle-card::before, .message-board::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image: linear-gradient(rgba(104,174,218,.06) 1px, transparent 1px);
  background-size: 100% 30px;
}

.post-date {
  color: #d780a4;
  font-family: Consolas, monospace;
  font-size: 13px;
  margin-bottom: 8px;
}

.blog-post h2, .puzzle-card h2, .message-board h2 {
  margin: 0 0 10px;
  font-family: var(--hand);
  color: #6e8db1;
  font-size: 30px;
}

.blog-post p, .puzzle-card p, .message-board p {
  line-height: 1.8;
  margin: 9px 0;
}

.damaged {
  background:
    repeating-linear-gradient(45deg, rgba(160,160,160,.1) 0 8px, rgba(255,255,255,.3) 8px 16px),
    rgba(255, 255, 255, .75);
}

.recovered-days {
  background: rgba(255, 248, 223, .7);
  border-left: 5px solid #ffb9d2;
  padding: 12px;
  border-radius: 10px;
}

.mars { color: #d86d98; font-weight: 700; }
.soft { color: var(--muted); }
.doodle-btn {
  border: 0;
  background: transparent;
  color: #d780a4;
  text-decoration: underline;
  padding: 0;
}

.message-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border-bottom: 1px dashed rgba(157, 131, 198, .25);
}
.message-row.muted { color: var(--muted); grid-template-columns: 1fr; }

.album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.photo-card {
  position: relative;
  z-index: 1;
  margin: 0;
  background: #fff;
  padding: 10px 10px 12px;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(125, 163, 190, .2);
  transform: rotate(-.5deg);
}
.photo-card:nth-child(even) { transform: rotate(.7deg); }
.photo-card img {
  width: 100%;
  display: block;
  border-radius: 10px;
  border: 1px solid #edf3f8;
}
.photo-card figcaption {
  margin-top: 8px;
  color: #7b8fa4;
  font-size: 13px;
  line-height: 1.5;
}
.locked-photo { filter: blur(.2px) grayscale(.25); opacity: .7; }

.timeline-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.timeline-item {
  position: relative;
  z-index: 1;
  padding: 11px 12px;
  border: 2px solid #fff;
  border-radius: 13px;
  background: rgba(255, 248, 223, .75);
}
.timeline-item.selected {
  border-color: #ff99c2;
  background: #fff0f7;
}
.timeline-item b {
  display: inline-block;
  min-width: 98px;
  color: #d780a4;
}

.blog-footer {
  margin-top: 14px;
  padding: 14px;
  text-align: center;
  color: #9aa8b6;
  font-size: 13px;
}
.admin-entry {
  border: 0;
  background: transparent;
  color: rgba(154, 168, 182, .35);
  margin-right: 12px;
}
.admin-entry:hover { color: #d780a4; text-decoration: underline; }

.clue-panel {
  position: fixed;
  right: 24px;
  top: 90px;
  bottom: 34px;
  width: min(380px, calc(100vw - 48px));
  background: rgba(255, 255, 255, .95);
  border: 3px solid #fff;
  border-radius: 20px;
  box-shadow: 0 20px 70px var(--shadow);
  z-index: 8000;
  transform: translateX(calc(100% + 40px));
  transition: transform .24s ease;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}
.clue-panel.open { transform: translateX(0); }
.clue-head {
  display: flex;
  justify-content: space-between;
  padding: 13px 15px;
  background: linear-gradient(90deg, #bfe8ff, #ffd1e3);
  font-weight: 700;
  color: #697895;
}
.clue-head button { border: 0; background: transparent; font-size: 22px; color: #697895; }
.clue-list { overflow: auto; padding: 12px; }
.clue-item {
  background: #fff8df;
  border: 1px dashed #ffb9d2;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 9px;
}
.clue-title { color: #d780a4; font-weight: 700; margin-bottom: 4px; }
.clue-desc { font-size: 13px; line-height: 1.55; color: #697895; }

.dialog-overlay, .ending-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(95, 126, 158, .35);
  backdrop-filter: blur(4px);
}
.dialog-box, .ending-box {
  width: min(760px, 100%);
  max-height: 86vh;
  overflow: auto;
  border: 4px solid #fff;
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 80px var(--shadow);
}
.dialog-title, .ending-title {
  padding: 15px 18px;
  background: linear-gradient(90deg, #bfe8ff, #ffd1e3);
  color: #657899;
  font-family: var(--hand);
  font-size: 28px;
}
.dialog-content, .ending-content { padding: 18px; line-height: 1.8; }
.dialog-actions, .ending-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 0 18px 18px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 9500;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  background: rgba(255, 255, 255, .95);
  border: 3px solid #fff;
  border-radius: 999px;
  padding: 12px 18px;
  box-shadow: 0 12px 38px var(--shadow);
  color: #657899;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { color: #c75479; }
.toast.success { color: #4f9a70; }

@media (max-width: 900px) {
  .restore-body, .blog-layout { grid-template-columns: 1fr; }
  .blog-header { align-items: flex-start; flex-direction: column; }
  .album-grid { grid-template-columns: 1fr; }
  .message-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .password-row, .form-line, .header-tools { align-items: stretch; flex-direction: column; }
  .blog-input, .blog-btn, select { width: 100%; }
  .blog-banner h1 { font-size: 30px; }
}
