/* =====================================================================
   心情点名墙 · 视觉样式
   深色霓虹 · 玻璃拟态
   ===================================================================== */

:root {
  --bg: #07070f;
  --bg-soft: #0c0c1a;
  --panel: rgba(20, 20, 38, 0.72);
  --panel-solid: #14142a;
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-strong: rgba(255, 255, 255, 0.16);

  --text: #f2f2fa;
  --text-2: #b9b9d4;
  --text-3: #7c7c9c;

  --brand-1: #6d6bff;
  --brand-2: #a855f7;
  --brand-3: #ff5fa2;
  --grad: linear-gradient(135deg, #6d6bff 0%, #a855f7 48%, #ff5fa2 100%);

  --happy: #ffd166;
  --calm: #4fd1c5;
  --tired: #8b93ff;
  --anxious: #ff8a5c;
  --bored: #b07cff;

  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- 背景光晕 ---------- */

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

.orbs i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.orbs i:nth-child(1) {
  width: 620px;
  height: 620px;
  top: -220px;
  left: -160px;
  background: radial-gradient(circle, #4f3bff 0%, transparent 68%);
}

.orbs i:nth-child(2) {
  width: 560px;
  height: 560px;
  top: 4%;
  right: -180px;
  background: radial-gradient(circle, #a13bff 0%, transparent 68%);
}

.orbs i:nth-child(3) {
  width: 680px;
  height: 680px;
  bottom: -300px;
  left: 26%;
  background: radial-gradient(circle, #ff3b8a 0%, transparent 70%);
  opacity: 0.32;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 0);
  background-size: 3px 3px;
}

.shell {
  position: relative;
  z-index: 2;
  max-width: 1360px;
  margin: 0 auto;
  padding: 34px 30px 70px;
}

/* ---------- 顶部 ---------- */

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #cfc9ff;
  background: rgba(109, 107, 255, 0.16);
  border: 1px solid rgba(109, 107, 255, 0.34);
}

.chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6d6bff;
  box-shadow: 0 0 10px 2px #6d6bff;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.topbar h1 {
  margin: 14px 0 8px;
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.1;
  background: linear-gradient(120deg, #ffffff 8%, #cbc6ff 52%, #ff9ecb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar .sub {
  margin: 0;
  max-width: 640px;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.75;
}

.topbar .sub b {
  color: #ffd9ec;
  font-weight: 600;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 19px;
  border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-ghost {
  background: transparent;
  border-color: var(--stroke);
  color: var(--text-2);
}

.btn-ghost:hover {
  color: var(--text);
}

/* ---------- 玻璃面板 ---------- */

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: var(--shadow);
  padding: 22px;
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.16), transparent 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.panel-head .meta {
  font-size: 12.5px;
  color: var(--text-3);
}

.panel-head .meta b {
  color: #c9c6ff;
}

/* ---------- 主布局 ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(340px, 420px) 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* ---------- 签到面板 ---------- */

.checkin {
  position: sticky;
  top: 24px;
}

@media (max-width: 980px) {
  .checkin {
    position: static;
  }
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 9px 3px;
}

.text-input,
.textarea {
  width: 100%;
  background: rgba(8, 8, 20, 0.72);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  padding: 13px 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  resize: none;
}

.text-input::placeholder,
.textarea::placeholder {
  color: #5c5c7a;
}

.text-input:focus,
.textarea:focus {
  border-color: rgba(139, 124, 255, 0.72);
  background: rgba(12, 12, 28, 0.9);
  box-shadow: 0 0 0 4px rgba(109, 107, 255, 0.14);
}

.textarea {
  min-height: 118px;
  line-height: 1.7;
}

.moods {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 8px 0 18px;
}

.mood {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px 8px 11px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mood .ico {
  font-size: 16px;
  line-height: 1;
  filter: grayscale(0.75) brightness(1.15);
  transition: filter 0.2s;
}

.mood:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
}

.mood:hover .ico {
  filter: none;
}

.mood[aria-pressed='true'] {
  color: #fff;
  border-color: transparent;
  background: var(--grad);
  box-shadow: 0 10px 26px -8px var(--mc, #6d6bff), 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

.mood[aria-pressed='true'] .ico {
  filter: none;
}

.mood[data-mood='happy'] { --mc: #ffb84d; }
.mood[data-mood='calm'] { --mc: #34c9bd; }
.mood[data-mood='tired'] { --mc: #7d86ff; }
.mood[data-mood='anxious'] { --mc: #ff7a4d; }
.mood[data-mood='bored'] { --mc: #a463ff; }

.submit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-primary {
  flex: 1;
  min-width: 190px;
  padding: 15px 24px;
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 15px;
  background: var(--grad);
  box-shadow: 0 16px 34px -12px rgba(138, 92, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-18deg);
  transition: left 0.55s ease;
}

.btn-primary:hover::after {
  left: 120%;
}

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

.tally {
  font-size: 13.5px;
  color: var(--text-2);
  white-space: nowrap;
}

.tally b {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0 2px;
}

/* ---------- 心情墙 ---------- */

.wall-wrap {
  min-height: 420px;
}

.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 12px;
  max-height: 620px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.wall::-webkit-scrollbar {
  width: 7px;
}

.wall::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 99px;
}

.card {
  position: relative;
  padding: 14px 15px;
  border-radius: 15px;
  border: 1px solid var(--stroke);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  animation: rise 0.45s cubic-bezier(0.2, 0.9, 0.3, 1) both;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--mc, #6d6bff);
  box-shadow: 0 0 14px 1px var(--mc, #6d6bff);
}

.card[data-mood='happy'] { --mc: #ffd166; }
.card[data-mood='calm'] { --mc: #4fd1c5; }
.card[data-mood='tired'] { --mc: #8b93ff; }
.card[data-mood='anxious'] { --mc: #ff8a5c; }
.card[data-mood='bored'] { --mc: #b07cff; }

.card.is-mine {
  border-color: rgba(139, 124, 255, 0.55);
  background: linear-gradient(160deg, rgba(109, 107, 255, 0.18), rgba(255, 95, 162, 0.07));
}

.card.flash {
  animation: flash 1.6s ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 95, 162, 0); }
  25% { box-shadow: 0 0 0 3px rgba(255, 95, 162, 0.6); }
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.card-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-time {
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.card-body {
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--text-2);
  word-break: break-word;
  white-space: pre-wrap;
  min-height: 22px;
}

.card-body.only-mood {
  color: var(--text-3);
  font-style: italic;
}

.mood-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 9px;
  background: color-mix(in srgb, var(--mc) 20%, transparent);
  color: var(--mc);
  border: 1px solid color-mix(in srgb, var(--mc) 40%, transparent);
}

.card-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.card:hover .card-del {
  opacity: 1;
}

.card-del:hover {
  background: rgba(255, 90, 120, 0.85);
  color: #fff;
}

.empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 300px;
  color: var(--text-3);
  font-size: 14px;
  text-align: center;
}

.empty .big {
  font-size: 42px;
  opacity: 0.55;
}

/* ---------- 词云 / 趋势 ---------- */

.section {
  margin-top: 20px;
}

.cloud-box {
  position: relative;
  width: 100%;
  height: 460px;
  border-radius: 15px;
  background: radial-gradient(ellipse at 50% 45%, rgba(109, 107, 255, 0.09), transparent 72%);
  overflow: hidden;
}

.cloud-box canvas {
  display: block;
  width: 100%;
}

.chart-box {
  width: 100%;
  overflow-x: auto;
}

.chart-box svg {
  display: block;
  width: 100%;
  height: auto;
}

.mood-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.mood-filter .btn {
  border-left-width: 3px;
}

.trend-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.lg-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.lg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-2);
}

.lg i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
}

.lg b {
  color: #fff;
  font-weight: 700;
}

.trend-note {
  font-size: 12.5px;
  color: var(--text-3);
}

.trend-note b {
  color: #d5d1ff;
}

.trend-svg {
  width: 100%;
}

.trend-svg svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- 弹层 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(4, 4, 12, 0.82);
  backdrop-filter: blur(10px);
}

.modal.open {
  display: flex;
  animation: fade 0.25s ease;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 420px;
  padding: 26px;
  border-radius: 22px;
  background: linear-gradient(165deg, #191934, #101024);
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow);
  text-align: center;
  animation: pop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-card h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
}

.modal-card p {
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.65;
}

.qr {
  display: inline-block;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  line-height: 0;
  margin-bottom: 16px;
}

.qr canvas {
  display: block;
  image-rendering: pixelated;
}

.url-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--stroke);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #a9e9ff;
  word-break: break-all;
  text-align: left;
  margin-bottom: 14px;
}

.picked {
  font-size: 34px;
  font-weight: 800;
  margin: 8px 0 4px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.picked-msg {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
  margin-top: 8px;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 26px);
  z-index: 90;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: rgba(24, 24, 46, 0.96);
  border: 1px solid var(--stroke-strong);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.ok {
  border-color: rgba(79, 209, 197, 0.5);
}

.toast.err {
  border-color: rgba(255, 110, 140, 0.6);
}

/* ---------- 连接状态 ---------- */

.conn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-3);
}

.conn .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4fd1c5;
  box-shadow: 0 0 8px 1px #4fd1c5;
}

.conn.off .dot {
  background: #ff6e8c;
  box-shadow: 0 0 8px 1px #ff6e8c;
}

/* ---------- 页脚 ---------- */

.foot {
  margin-top: 34px;
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.8;
}
