/* ============================================================
   SMX.Y · 深海图鉴
   蓝调珊瑚礁 + 写实勿忘我 + 单只水母
   ============================================================ */

:root {
  --ink: #eef4fb;
  --muted: rgba(214, 232, 245, 0.64);
  --faint: rgba(186, 210, 228, 0.4);
  --line: rgba(194, 168, 120, 0.22);
  --gold: #c2a878;
  --violet: #a9d6ef;
  --slate: #b9cfe0;
  --mist: #3f7f9e;
}

body {
  background:
    radial-gradient(120% 70% at 50% -14%, rgba(58, 132, 178, 0.55), transparent 58%),
    radial-gradient(80% 55% at 12% 108%, rgba(26, 86, 122, 0.55), transparent 62%),
    linear-gradient(180deg, #06192b 0%, #082a45 46%, #04121d 100%);
  background-attachment: fixed;
}

.site,
.transmission {
  background: transparent;
}

.transmission::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.9;
  background-image: url('public/art/noise.png');
  background-size: 64px 64px;
  background-repeat: repeat;
}

/* ---------- 背景装饰 ---------- */

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

.rays {
  position: absolute;
  inset: -10% -20% auto -20%;
  height: 78%;
  opacity: 0.5;
  background:
    linear-gradient(112deg, transparent 12%, rgba(150, 210, 240, 0.09) 18%, transparent 24%),
    linear-gradient(96deg, transparent 34%, rgba(150, 210, 240, 0.07) 40%, transparent 46%),
    linear-gradient(126deg, transparent 56%, rgba(150, 210, 240, 0.08) 62%, transparent 70%);
  filter: blur(6px);
}

.reef {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 210px;
  opacity: 0.85;
}

.sprig {
  position: absolute;
  opacity: 0.85;
}

.sprig-tl {
  top: -26px;
  left: -66px;
  width: 250px;
  transform: rotate(-6deg);
}

.sprig-br {
  bottom: -34px;
  right: -70px;
  width: 250px;
  transform: rotate(184deg);
}

.sprig-tr-small {
  top: 84px;
  right: -18px;
  width: 128px;
  transform: rotate(14deg);
  opacity: 0.5;
}

/* 单只水母：居中偏下，斜 45° */
.jelly {
  position: absolute;
  left: 50%;
  top: 77%;
  width: min(66vw, 288px);
  transform: translate(-50%, -50%) rotate(45deg);
  opacity: 0.92;
  filter: drop-shadow(0 0 22px rgba(176, 138, 236, 0.34));
  animation: jelly-drift 13s ease-in-out infinite;
}

html[data-mode="day"] .jelly {
  opacity: 0.62;
  filter: drop-shadow(0 0 18px rgba(150, 120, 210, 0.22));
}

@keyframes jelly-drift {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(25deg) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) rotate(25deg) translateY(-18px);
  }
}

/* ---------- 时钟 ---------- */

.chrono {
  position: relative;
  z-index: 1;
  padding: 2px 0 14px;
  text-align: center;
}

.chrono-date {
  display: block;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.34em;
  color: rgba(194, 168, 120, 0.8);
}

.chrono-time {
  display: block;
  margin: 2px 0 4px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(46px, 14vw, 62px);
  line-height: 1.02;
  letter-spacing: 0.03em;
  color: #f2f7fd;
  text-shadow: 0 0 34px rgba(120, 190, 235, 0.35);
}

.chrono-week {
  display: block;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(200, 218, 235, 0.55);
}

/* ---------- 错落卡片 ---------- */

.cabinet {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.entry {
  position: relative;
  display: block;
  padding: 14px 16px 12px;
  min-height: 96px;
  text-align: left;
  border: 1px dashed rgba(194, 168, 120, 0.42);
  background: rgba(6, 24, 40, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  color: var(--ink);
  transition: transform 0.18s ease, background 0.18s ease;
}

.entry:active {
  background: rgba(12, 42, 64, 0.6);
}

.entry-chat {
  grid-column: 1 / -1;
  min-height: 104px;
  transform: rotate(-1.1deg);
}

.entry-letter {
  transform: rotate(1.5deg);
}

.entry-reply {
  transform: rotate(-1.7deg);
}

.entry-companion {
  transform: rotate(0.9deg);
}

.entry-profile {
  transform: rotate(-1.3deg);
  margin-top: 6px;
}

.entry-glyph {
  display: block;
  width: 24px;
  height: 24px;
  margin-bottom: 8px;
  color: #bfe3f5;
}

.entry-glyph svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.entry-cn {
  display: block;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: #f2e7cf;
}

.entry-en {
  position: absolute;
  top: 12px;
  right: 10px;
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.3em;
  writing-mode: vertical-rl;
  color: rgba(194, 168, 120, 0.62);
}

/* ---------- 文字与其他 ---------- */

.app-brand b,
.sheet-head h2,
.message-orb h3,
.x-subpage-shell h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.14em;
  color: #f2e7cf;
}

.app-brand span {
  letter-spacing: 0.3em;
  color: rgba(194, 168, 120, 0.6);
}

.app-greet strong {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #f2e7cf;
}

.btn-line {
  border-color: rgba(194, 168, 120, 0.3);
  background: rgba(6, 24, 40, 0.62);
  color: #eadfc8;
}

.message-primary {
  background: linear-gradient(135deg, #d7e9f2, #a3c6d8);
  color: #06202c;
}

.sheet-panel {
  border-color: rgba(194, 168, 120, 0.22);
  background: linear-gradient(180deg, #082638, #05161f);
}

.sheet-block h3 {
  color: rgba(194, 168, 120, 0.85);
  letter-spacing: 0.2em;
}

/* ---------- v3：整页双线框 + 花不裁切 ---------- */

.page-frame {
  position: fixed;
  inset: 12px;
  z-index: 1;
  pointer-events: none;
  border: 1px solid rgba(194, 168, 120, 0.34);
  border-radius: 10px;
  box-shadow: inset 0 0 44px rgba(0, 8, 16, 0.38);
}

.page-frame::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(194, 168, 120, 0.16);
  border-radius: 6px;
}

.transmission-wrap {
  padding: 40px 30px 0;
}

.chrono {
  margin-top: 10px;
  padding-bottom: 22px;
}

.sprig {
  position: absolute;
  width: 186px;
  opacity: 0.9;
}

.sprig-tr {
  top: 44px;
  right: 6px;
  transform: scaleY(-1) rotate(-4deg);
}

.sprig-bl {
  bottom: 58px;
  left: 6px;
}

/* 卡片不要再压到框外 */
.cabinet {
  margin-top: 2px;
}

/* ---------- 海底背景与昼夜 ---------- */

.water-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 压一层薄纱，保证文字可读 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(3, 14, 24, 0.42) 0%,
    rgba(3, 14, 24, 0.16) 42%,
    rgba(3, 14, 24, 0.5) 100%
  );
  transition: background 0.8s ease;
}

html[data-mode="day"] body::after {
  background: linear-gradient(
    180deg,
    rgba(4, 26, 40, 0.22) 0%,
    rgba(4, 26, 40, 0.04) 40%,
    rgba(4, 26, 40, 0.28) 100%
  );
}

/* 日间：整体略提亮 */
html[data-mode="day"] {
  --ink: #f7fbff;
}

html[data-mode="day"] .page-frame {
  border-color: rgba(236, 214, 168, 0.5);
}

html[data-mode="day"] .entry {
  background: rgba(6, 34, 52, 0.34);
  border-color: rgba(236, 214, 168, 0.5);
}

/* 昼夜按钮 */
.app-mode {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(194, 168, 120, 0.3);
  border-radius: 50%;
  background: rgba(6, 24, 40, 0.45);
  color: #eadfc8;
}

.app-mode svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-mode .icon-sun {
  display: none;
}

html[data-mode="day"] .app-mode .icon-sun {
  display: block;
}

html[data-mode="day"] .app-mode .icon-moon {
  display: none;
}

/* 原版装饰环（repeating-radial-gradient 同心圆）删除 */
.transmission-wrap::before {
  display: none !important;
}

.transmission-wrap::after {
  opacity: 0.35;
}

/* 首页动画结束后清除 transform，避免 fixed 装饰被限制在首页容器内 */
.x-link-home.show {
  transform: none !important;
}

.jelly {
  top: 70%;
  width: min(56vw, 244px);
}

/* 装饰层移到 body 下，由首页可见性控制 */
.ornaments {
  display: none;
}

body.x-home:not(.x-clean-page) .ornaments {
  display: block;
}

.jelly {
  left: 50%;
  top: 82%;
  width: min(52vw, 210px);
  transform: translate(-50%, -50%) rotate(18deg);
  opacity: 0.55;
  filter: drop-shadow(0 0 26px rgba(176, 138, 236, 0.3));
}

html[data-mode="night"] .jelly {
  opacity: 0.8;
}

.jelly {
  position: absolute;
  left: 50%;
  top: 78%;
  width: min(54vw, 218px);
  height: auto;
  transform: translate(-50%, -50%) rotate(25deg);
  opacity: 0.85;
  filter: drop-shadow(0 0 28px rgba(178, 140, 238, 0.35));
  animation: jelly-drift 13s ease-in-out infinite;
  pointer-events: none;
}

html[data-mode="day"] .jelly {
  opacity: 0.7;
}

/* 水母放大 */
.jelly {
  width: min(74vw, 300px);
  top: 76%;
}

.jelly {
  top: 80%;
}

/* 边框移到最外层 */
.page-frame {
  inset: 0;
  border-radius: 0;
  border-color: rgba(194, 168, 120, 0.42);
  box-shadow: none;
}

.page-frame::before {
  inset: 5px;
  border-radius: 0;
  border-color: rgba(194, 168, 120, 0.2);
}

html.no-splash #splash {
  display: none !important;
}

html.no-splash body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  max-height: none !important;
}

.corner {
  position: absolute;
  top: 0;
  width: 178px;
  height: 152px;
  pointer-events: none;
  opacity: 0.95;
}

.corner-tl {
  left: 0;
}

.corner-tr {
  right: 0;
  transform: scaleX(-1);
}

/* 防止顶栏把文档撑宽 */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

.app-head {
  min-width: 0;
}

.app-brand {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.app-brand b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-tools {
  flex: 0 0 auto;
  min-width: 0;
  gap: 8px;
}

@media (max-width: 480px) {
  .app-brand b {
    font-size: 18px;
    letter-spacing: 0.06em;
  }

  .app-status {
    font-size: 10px;
    letter-spacing: 0.06em;
  }

  .app-mode,
  .app-gear {
    width: 30px;
    height: 30px;
  }

  .transmission-wrap {
    padding-left: 22px;
    padding-right: 22px;
  }
}

/* 栅格用 minmax(0,1fr)，避免内容把整页撑宽 */
.cabinet {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
}

.entry {
  min-width: 0;
  max-width: 100%;
}

.transmission-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 角饰略提亮，花簇下移让开齿轮 */
.corner {
  opacity: 0.82;
  height: 140px;
}

.sprig-tr {
  top: 96px;
}
