/* 视奸梦末 · 界面样式 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --paper: #fdf8fa;
  --paper-deep: #f8f4fa;
  --card: #fffefe;
  --ink: #352a38;
  --ink-2: #67596d;
  --ink-3: #9a8ca4;
  --line: rgba(96, 62, 88, 0.12);
  --line-strong: rgba(96, 62, 88, 0.22);
  --rose: #e7a8c3;
  --rose-deep: #a94f76;
  --rose-soft: rgba(231, 168, 195, 0.14);
  --teal: #8ec9c6;
  --amber: #e0ac66;
  --lilac: #b6a3e0;
  --panel: rgba(255, 254, 254, 0.86);
  --panel-edge: rgba(255, 255, 255, 0.95);
  --shadow-lg: 0 30px 70px -46px rgba(120, 60, 92, 0.38);
  --shadow-sm: 0 12px 26px -20px rgba(120, 60, 92, 0.32);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei UI", "Hiragino Sans GB", system-ui, sans-serif;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 1.1s ease, color 1.1s ease;
}

.wash {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(980px 620px at 4% -14%, rgba(252, 224, 234, 0.85) 0%, rgba(252, 224, 234, 0) 60%),
    radial-gradient(860px 560px at 98% -8%, rgba(233, 226, 248, 0.75) 0%, rgba(233, 226, 248, 0) 58%),
    radial-gradient(1100px 700px at 56% 112%, rgba(226, 242, 241, 0.6) 0%, rgba(226, 242, 241, 0) 68%),
    linear-gradient(180deg, #fdf8fa 0%, #fdfbfc 52%, #faf7fc 100%);
  transition: opacity 1.1s ease, filter 1.1s ease;
}

[hidden] {
  display: none !important;
}

/* ---------------- 夜色：手机离线时整页入梦 ---------------- */

body[data-night="true"] {
  --paper: #241d2c;
  --paper-deep: #1e1826;
  --card: #2c2337;
  --ink: #ece2ee;
  --ink-2: #bcacc6;
  --ink-3: #8d7f99;
  --line: rgba(216, 190, 220, 0.16);
  --line-strong: rgba(216, 190, 220, 0.26);
  --rose: #c98bb0;
  --rose-deep: #e6b3cd;
  --rose-soft: rgba(201, 139, 176, 0.18);
  --panel: rgba(44, 35, 55, 0.78);
  --panel-edge: rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}

body[data-night="true"] .wash {
  opacity: 0.18;
  filter: hue-rotate(-18deg) saturate(0.7);
}

body[data-night="true"] .topbar {
  background: linear-gradient(180deg, rgba(36, 29, 44, 0.95), rgba(36, 29, 44, 0.6));
}

body[data-night="true"] .presence {
  background: rgba(255, 255, 255, 0.08);
}

body[data-night="true"] .orb[data-online="false"] .orb-ring {
  background: conic-gradient(
    from 180deg,
    rgba(201, 139, 176, 0.45) calc(var(--level, 0) * 1%),
    rgba(201, 139, 176, 0.14) 0
  );
}

body[data-night="true"] .orb::before {
  background: radial-gradient(circle at 50% 34%, #4a3b56 0%, #33293f 52%, #251c30 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 22px 44px -26px rgba(0, 0, 0, 0.8);
}

body[data-night="true"] .orb-value {
  color: #f4e7ef;
}

/* ---------------- 樱瓣 ---------------- */

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

.petals i {
  position: absolute;
  top: -6vh;
  width: 13px;
  height: 13px;
  border-radius: 50% 6% 50% 6%;
  background: linear-gradient(140deg, #f7c8db 0%, #e9a3c3 100%);
  opacity: 0;
  animation: petal-fall linear infinite;
}

.petals i:nth-child(1) { left: 6%;  animation-duration: 17s; animation-delay: 0s;   }
.petals i:nth-child(2) { left: 18%; animation-duration: 21s; animation-delay: -4s;  width: 10px; height: 10px; }
.petals i:nth-child(3) { left: 31%; animation-duration: 15s; animation-delay: -9s;  }
.petals i:nth-child(4) { left: 47%; animation-duration: 23s; animation-delay: -2s;  width: 16px; height: 16px; }
.petals i:nth-child(5) { left: 62%; animation-duration: 19s; animation-delay: -13s; }
.petals i:nth-child(6) { left: 74%; animation-duration: 25s; animation-delay: -6s;  width: 11px; height: 11px; }
.petals i:nth-child(7) { left: 88%; animation-duration: 18s; animation-delay: -16s; }

@keyframes petal-fall {
  0%   { transform: translate3d(0, -8vh, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: 0.65; }
  50%  { transform: translate3d(34px, 52vh, 0) rotate(160deg); opacity: 0.5; }
  92%  { opacity: 0.35; }
  100% { transform: translate3d(-18px, 108vh, 0) rotate(320deg); opacity: 0; }
}

body[data-night="true"] .petals i {
  background: linear-gradient(140deg, #d5a8e0 0%, #9d7cc0 100%);
  box-shadow: 0 0 10px 2px rgba(201, 160, 220, 0.35);
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(20px, 5vw, 56px);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(251, 243, 247, 0.94), rgba(251, 243, 247, 0.55));
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 1.1s ease;
}

.topbar[data-scrolled="true"] {
  border-bottom-color: var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink);
  text-decoration: none;
  padding-right: 6px;
}

.wordmark svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--rose);
  filter: drop-shadow(0 0 6px rgba(227, 154, 185, 0.55));
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
  font-size: 13px;
  color: var(--ink-2);
}

.clock {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.presence {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.presence i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 3px rgba(227, 154, 185, 0.2);
}

.presence[data-state="offline"] i {
  background: #b9c7d8;
  box-shadow: none;
}

.presence[data-state="connecting"] i {
  animation: pulse-dot 1.6s ease-in-out infinite;
}

.account {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.account a,
.account button {
  color: var(--rose-deep);
  text-decoration: none;
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.account a:hover,
.account button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account .who {
  color: var(--ink);
}

/* ---------------- 骨架 ---------------- */

.shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px) 72px;
}

.foot {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 0 20px 46px;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.foot span:first-child {
  font-family: var(--serif);
}

/* ---------------- 主视觉 ---------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(34px, 7vw, 76px) 0 clamp(26px, 4vw, 42px);
}

.hero-lead h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(38px, 5.4vw, 58px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0.02em;
}

.hero-model {
  margin: 0 0 clamp(20px, 3vw, 30px);
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.hero-sentence {
  margin: 0 0 12px;
  max-width: 26em;
  font-family: var(--serif);
  font-size: clamp(19px, 2.1vw, 23px);
  line-height: 1.62;
  color: var(--rose-deep);
}

.hero-meta {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-3);
}

.orb {
  position: relative;
  width: clamp(158px, 21vw, 208px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  isolation: isolate;
}

/* 猫耳：从球后面探出来 */
.orb-ears {
  position: absolute;
  top: -7%;
  left: 50%;
  translate: -50% 0;
  width: 74%;
  display: flex;
  justify-content: space-between;
  z-index: -1;
  pointer-events: none;
}

.orb-ears i {
  width: 24%;
  aspect-ratio: 1 / 1.3;
  background: linear-gradient(180deg, #f6cbdc 0%, #eab4cd 100%);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  border-radius: 6px;
  transform: rotate(-20deg);
  transform-origin: 50% 100%;
  filter: drop-shadow(0 4px 10px rgba(180, 90, 130, 0.14));
}

.orb-ears i:last-child {
  transform: rotate(20deg);
}

body[data-night="true"] .orb-ears i {
  background: linear-gradient(180deg, #7d6291 0%, #5b4670 100%);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5));
}

.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 180deg,
    var(--rose) calc(var(--level, 0) * 1%),
    rgba(227, 154, 185, 0.2) 0
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
}

.orb::before {
  content: "";
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 34%, #ffffff 0%, #fdf1f6 46%, #f5dde8 100%);
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 22px 44px -26px rgba(150, 70, 105, 0.5);
}

.orb[data-online="false"] .orb-ring {
  background: conic-gradient(from 180deg, rgba(120, 145, 175, 0.4) calc(var(--level, 0) * 1%), rgba(120, 145, 175, 0.12) 0);
}

.orb[data-online="false"]::before {
  background: radial-gradient(circle at 50% 34%, #ffffff 0%, #f2f6fa 46%, #e3ebf3 100%);
}

.orb[data-charging="true"]::after {
  content: "";
  position: absolute;
  inset: -4%;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(227, 154, 185, 0.22), 0 0 44px rgba(227, 154, 185, 0.34);
  animation: breathe 5.4s ease-in-out infinite;
}

.orb-face {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding-top: 4px;
}

.orb-value {
  font-family: var(--serif);
  font-size: clamp(38px, 4.8vw, 52px);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.orb-unit {
  font-size: 11px;
  letter-spacing: 0.26em;
  color: var(--ink-3);
}

.orb-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--rose-deep);
}

/* ---------------- 板块 ---------------- */

.block {
  padding: clamp(28px, 4vw, 42px) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 84px;
}

.block-title {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.block-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  transform: translateY(-4px);
}

/* ---------------- 两小时波形条 ---------------- */

.ribbon {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 104px;
  padding: 0;
}

.ribbon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--line-strong);
}

.ribbon-bar {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 1px 1px 0 0;
  background: var(--rose);
  opacity: 0.92;
  transition: height 0.55s cubic-bezier(0.22, 0.8, 0.3, 1), opacity 0.3s;
}

.ribbon-bar[data-screen="off"] {
  background: rgba(227, 154, 185, 0.26);
}

.ribbon-bar[data-gap="true"] {
  height: 0 !important;
  background: transparent;
  transition: none;
}

.ribbon-empty {
  margin: 0;
  padding: 26px 0;
  color: var(--ink-3);
  font-size: 14.5px;
}

.ribbon-scale {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.ribbon-legend {
  color: var(--ink-2);
}

/* ---------------- 细节 ---------------- */

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
  gap: 0 clamp(24px, 4vw, 56px);
  margin: 0;
}

.spec {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.spec dt {
  color: var(--ink-2);
  font-size: 14px;
  white-space: nowrap;
}

.spec dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

.spec dd small {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-3);
  margin-left: 6px;
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.spec dd .ellipsis {
  display: inline-block;
  max-width: 15ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* ---------------- 互动 ---------------- */

.composer {
  position: relative;
  display: grid;
  gap: 12px;
  padding: clamp(18px, 2.4vw, 24px);
  border-radius: 22px;
  background: var(--panel);
  border: 2px solid #f2e0e9;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* 四个角的小折角，像手账上的装订角 */
.composer::before,
.composer::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--rose);
  opacity: 0.55;
  pointer-events: none;
}

.composer::before {
  top: -2px;
  left: -2px;
  border-right: 0;
  border-bottom: 0;
  border-radius: 14px 0 0 0;
}

.composer::after {
  right: -2px;
  bottom: -2px;
  border-left: 0;
  border-top: 0;
  border-radius: 0 0 14px 0;
}

body[data-night="true"] .composer {
  border-color: #473350;
}

.composer-label {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

textarea,
input,
select {
  font-family: inherit;
  font-size: 15.5px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  width: 100%;
  min-height: 66px;
  resize: vertical;
  line-height: 1.6;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(227, 154, 185, 0.2);
}

.composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  font: inherit;
  font-size: 13px;
  color: var(--rose-deep);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.chip:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(180deg, #efa9c5, #d97ba4);
  box-shadow: 0 14px 26px -16px rgba(170, 70, 110, 0.75);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px -16px rgba(170, 70, 110, 0.8);
}

.btn-ghost {
  color: var(--rose-deep);
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  background: #ffffff;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  width: 100%;
}

.btn-small {
  padding: 6px 14px;
  font-size: 13px;
}

.gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  box-shadow: var(--shadow-lg);
}

.gate p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14.5px;
}

.thread {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.thread-empty {
  margin: 16px 0 0;
  color: var(--ink-3);
  font-size: 14px;
}

.msg {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 15px 20px 14px;
  border-radius: 18px;
  background: var(--card);
  border: 2px solid #f4e4ec;
  box-shadow: 0 10px 22px -20px rgba(120, 60, 92, 0.35);
  transition: border-color 0.25s ease;
}

.msg:hover {
  border-color: var(--rose);
}

body[data-night="true"] .msg {
  border-color: #473350;
}

.msg-text {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.pill {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose-deep);
}

.pill[data-status="shown"] {
  background: rgba(134, 197, 197, 0.2);
  color: #35726f;
}

.pill[data-status="failed"] {
  background: rgba(196, 96, 96, 0.14);
  color: #9c4a4a;
}

body[data-night="true"] .pill[data-status="shown"] {
  background: rgba(134, 197, 197, 0.18);
  color: #a5d9d6;
}

/* ---------------- 手机屏幕 ---------------- */

.shot-body {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(24px, 3vw, 48px);
}

.shot-side {
  display: grid;
  gap: 14px;
  justify-items: start;
  max-width: 40ch;
  padding-top: 6px;
}

.shot-bar .btn {
  flex: 0 0 auto;
}

.shot-bar .btn[disabled],
.shot-side .btn[disabled] {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.shot-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-3);
}

.shot-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-3);
  max-width: 32ch;
}

.shot-hint[data-state="waiting"] {
  color: var(--rose-deep);
}

.shot-hint[data-state="error"] {
  color: #9c4a4a;
}

.shot {
  margin: 0;
  display: grid;
  gap: 12px;
  max-width: 300px;
}
.shot-frame {
  display: grid;
  place-items: center;
  padding: 8px;
  min-height: 160px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(230, 239, 252, 0.66));
  border: 1px solid var(--panel-edge);
  box-shadow: var(--shadow-lg);
  transition: box-shadow 220ms ease;
}

.shot-frame[data-waiting="true"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(214, 230, 250, 0.7));
}

#shot-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: var(--paper-2);
  box-shadow: 0 18px 40px -28px rgba(20, 44, 78, 0.9);
}

.shot-empty {
  margin: 0;
  padding: 26px 14px;
  max-width: 30ch;
  text-align: center;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-3);
}

.shot-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.shot-caption-link {
  color: var(--rose-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--rose-soft);
}

.shot-caption-link:hover {
  border-bottom-color: var(--rose);
}

.shot-caption button {
  margin-left: 10px;
}

.where {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px 40px;
  padding-top: 4px;
}

.where-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.where-side {
  display: grid;
  gap: 10px;
  justify-items: start;
  max-width: 34ch;
}

.where-label {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

.where-coords {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.where-meta {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.7;
}

.where-link-row {
  margin: 0;
  font-size: 13.5px;
}

.where-link-row a {
  color: var(--rose-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--rose-deep) 35%, transparent);
}

.where-link-row a:hover {
  text-decoration-color: var(--rose-deep);
}

.where-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-3);
}

.msg-replies {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.msg-reply {
  position: relative;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

/* 手机说的那句：一块浅粉气泡，前面一枚「手机」小签 */
.msg-reply-text {
  position: relative;
  padding: 6px 14px;
  background: var(--rose-soft);
  border-radius: 14px;
}

.msg-reply-time {
  font-size: 12.5px;
  color: var(--ink-3);
}

.msg-reply .tag {
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 1px 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose-deep);
}

/* ---------------- 登录 ---------------- */

.card {
  position: relative;
  width: min(430px, 100%);
  margin: clamp(40px, 9vh, 104px) auto;
  padding: clamp(26px, 4vw, 38px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #f4e4ec;
  box-shadow: 0 44px 96px -56px rgba(150, 70, 110, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* 登录卡右上角一枚小小的折角，和输入区的装订角对上 */
.card::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--rose);
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 14px 0 0;
  opacity: 0.55;
  pointer-events: none;
}

body[data-night="true"] .card {
  border-color: #473350;
  background: rgba(48, 38, 58, 0.9);
}

.card h1 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.card-sub {
  margin: 0 0 26px;
  font-size: 14px;
  color: var(--ink-2);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field span {
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: 0.04em;
}

.form-error {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: #a14b4b;
}

.auth .btn {
  margin-top: 6px;
}

.auth-back {
  display: block;
  margin: 18px 0 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-3);
  text-decoration: none;
}

.auth-back:hover {
  color: var(--rose-deep);
}

/* ---------------- 后台 ---------------- */

.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px 24px;
  padding: clamp(34px, 6vw, 62px) 0 clamp(10px, 2vw, 18px);
}

.admin-head > a {
  flex: 0 0 auto;
  margin-top: 8px;
}

.admin-head h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.admin-head p {
  margin: 0;
  max-width: 44em;
  color: var(--ink-2);
  font-size: 14.5px;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.inline-form > input {
  flex: 1 1 170px;
  min-width: 0;
}

.inline-form > select {
  flex: 0 0 100px;
}

.inline-form > button {
  flex: 0 0 auto;
}

.inline-form > input,
.inline-form > select {
  height: 50px;
  min-width: 0;
}

.inline-form .btn {
  height: 50px;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 560px;
}

.table th {
  padding: 0 12px 10px 0;
  text-align: left;
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-strong);
}

.table td {
  padding: 13px 12px 13px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table td:last-child,
.table th:last-child {
  padding-right: 0;
}

.col-actions {
  text-align: right;
}

.table .row-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--rose-deep);
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn[data-danger="true"] {
  color: #9c4a4a;
}

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose-deep);
}

.tag[data-role="admin"] {
  background: rgba(58, 100, 170, 0.16);
}

.tag[data-off="true"] {
  background: rgba(140, 155, 175, 0.18);
  color: var(--ink-2);
}

.device-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px 28px;
  padding: 22px 24px;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  box-shadow: var(--shadow-sm);
}

.device-card .kv span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

.device-card .kv strong {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.device-card .kv-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  padding-top: 4px;
}

/* ---------------- 提示 ---------------- */

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: grid;
  gap: 10px;
  z-index: 60;
  width: max-content;
  max-width: calc(100vw - 40px);
}

.toast {
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(22, 38, 60, 0.9);
  color: #f2f7fd;
  font-size: 14px;
  box-shadow: 0 20px 40px -24px rgba(10, 25, 45, 0.9);
  animation: toast-in 0.28s ease-out;
  text-align: center;
}

.toast[data-kind="error"] {
  background: rgba(122, 52, 52, 0.92);
}

/* ---------------- 对话框 ---------------- */

.modal {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 50px 110px -60px rgba(20, 45, 80, 0.9);
  color: var(--ink);
}

.modal::backdrop {
  background: rgba(30, 55, 90, 0.32);
  backdrop-filter: blur(4px);
}

.modal-body {
  padding: 28px;
  display: grid;
  gap: 10px;
}

.modal-body h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.modal-body p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

.modal-fields {
  display: grid;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* ---------------- 动效 ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: reveal 0.72s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 2px;
  border-radius: 6px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------------- 窄屏 ---------------- */

@media (max-width: 780px) {
  .hero {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 26px;
  }

  .orb {
    justify-self: center;
    order: -1;
    width: 144px;
  }

  .hero-lead h1 {
    font-size: clamp(32px, 9vw, 40px);
  }

  .clock {
    display: none;
  }

  .shot {
    max-width: none;
  }

  .shot-body {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .shot-side {
    order: -1;
    max-width: none;
  }

  .where {
    flex-direction: column;
  }

  .shot-frame {
    padding: 8px;
    border-radius: 20px;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-form > input,
  .inline-form > select {
    flex: 0 0 auto;
  }

  .specs {
    grid-template-columns: 1fr;
  }

  .ribbon {
    height: 80px;
  }

  .ribbon-legend {
    display: none;
  }

  .gate {
    flex-direction: column;
    align-items: flex-start;
  }

  .table {
    min-width: 520px;
  }
}
