/* ============================================================
   wish.css — 星空心愿（原人生树洞板块替换视图）样式
   v1.1（2026-11-08）：星愿改为自下而上垂直上升、互不覆盖；
   悬停只暂停当前一条，后面的星愿可穿过继续上升；
   星空幕墙加高至首屏 1/2；心愿模式下原 AI 社区右侧栏隐藏，
   由星愿统计侧栏替代（左右版式一致）。
   自包含：全部类名以 ww- 前缀，除 wish-mode 规则外不影响宿主页面。
   ============================================================ */

/* 心愿模式：隐藏原聊天面板兄弟节点与 AI 社区右侧栏，许愿墙占满整行 */
body.wish-mode .chat-pane > *:not(#wish-wrap) { display: none !important; }
body.wish-mode .side-pane { display: none !important; }
body.wish-mode .layout { grid-template-columns: minmax(0, 1fr) !important; }
#wish-wrap { display: none; }
body.wish-mode #wish-wrap {
  display: block;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ww {
  --ww-bg: rgba(255, 255, 255, 0.045);
  --ww-border: rgba(255, 255, 255, 0.1);
  --ww-text: #e6e9f5;
  --ww-sub: rgba(203, 213, 225, 0.75);
  color: var(--ww-text);
  border-radius: 18px;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(88, 28, 160, 0.4), transparent 60%),
    radial-gradient(800px 400px at 95% 0%, rgba(30, 64, 175, 0.35), transparent 58%),
    radial-gradient(700px 500px at 50% 115%, rgba(190, 24, 93, 0.16), transparent 62%),
    linear-gradient(180deg, #0a0e24 0%, #101538 55%, #171140 100%);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
}
.ww button { font: inherit; cursor: pointer; }
.ww input, .ww textarea { font: inherit; }

/* ---------- 星空幕墙（首屏 1/2 高度，凸显无数星愿主题） ---------- */
.ww-hero { position: relative; height: 50vh; min-height: 320px; max-height: 640px; overflow: hidden; }
.ww-stars { position: absolute; inset: 0; pointer-events: none; }
.ww-star {
  position: absolute; border-radius: 999px; background: #fff;
  animation: ww-twinkle ease-in-out infinite;
}
@keyframes ww-twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.85); }
  50% { opacity: 0.9; transform: scale(1.15); }
}
.ww-hero-text {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 16px; pointer-events: none;
}
.ww-kicker { font-size: 10px; letter-spacing: 0.35em; text-transform: uppercase; color: rgba(196, 181, 253, 0.85); margin: 0; }
.ww-title {
  margin: 10px 0 0; font-size: clamp(24px, 4.4vw, 40px); font-weight: 700;
  background: linear-gradient(90deg, #fecdd3, #fef3c7, #bae6fd);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 24px rgba(10, 14, 36, 0.55);
}
.ww-sub { margin: 14px 0 0; max-width: 640px; font-size: 13px; line-height: 2; color: var(--ww-sub); text-shadow: 0 1px 14px rgba(10, 14, 36, 0.7); }
.ww-hint { margin: 18px 0 0; font-size: 11px; letter-spacing: 0.14em; color: rgba(196, 181, 253, 0.72); text-shadow: 0 1px 10px rgba(10, 14, 36, 0.6); }

/* ---------- 垂直上升星愿流 ---------- */
/* z-index 3 > 主题文字层(2)：星愿从「让心愿飘向星空」最顶层掠过 */
.ww-danmaku { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.ww-dm {
  position: absolute; bottom: -56px; pointer-events: auto; box-sizing: border-box;
  animation-name: ww-dm-rise; animation-timing-function: linear; animation-fill-mode: forwards;
  will-change: transform;
}
/* 悬停只暂停当前这条；后面的星愿不阻塞，从其下层穿过继续上升 */
.ww-dm:hover { animation-play-state: paused; z-index: 6; }
@keyframes ww-dm-rise {
  from { transform: translateY(0); }
  to { transform: translateY(calc(-1 * var(--ww-rise, 420px))); }
}
.ww-dm-pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border-radius: 999px; border: 1px solid var(--ww-border); padding: 5px 8px 5px 14px;
  background: rgba(20, 24, 56, 0.58); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px rgba(4, 8, 28, 0.35); font-size: 13px;
  max-width: 100%;
}
.ww-dm-glow .ww-dm-pill { box-shadow: 0 0 26px rgba(255, 255, 255, 0.3); border-color: rgba(255, 255, 255, 0.5); }
.ww-dm-text {
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 4px 2px;
  color: inherit; min-width: 0;
}
.ww-dm-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.ww-dm-text:hover { text-decoration: underline dotted; }
.ww-dm-like {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); color: inherit; padding: 4px 10px; font-size: 12px;
  transition: background 0.15s, transform 0.15s;
}
.ww-dm-like:hover { background: rgba(255, 255, 255, 0.2); }
.ww-dm-like:active { transform: scale(0.92); }
.ww-dm-like.liked { background: rgba(244, 63, 94, 0.25); }

.ww-hero-btn {
  position: absolute; right: 12px; top: 10px; z-index: 7;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); color: #e2e8f0; padding: 7px 14px; font-size: 12px;
  backdrop-filter: blur(8px); transition: background 0.15s;
}
.ww-hero-btn:hover { background: rgba(255, 255, 255, 0.16); }

/* 星愿颜色 */
.ww-dm[data-color="rose"] .ww-dm-text { color: #ffe4e6; }
.ww-dm[data-color="amber"] .ww-dm-text { color: #fde68a; }
.ww-dm[data-color="emerald"] .ww-dm-text { color: #a7f3d0; }
.ww-dm[data-color="sky"] .ww-dm-text { color: #bae6fd; }
.ww-dm[data-color="violet"] .ww-dm-text { color: #ddd6fe; }
.ww-dm[data-color="pink"] .ww-dm-text { color: #fbcfe8; }

/* ---------- 主体布局（左内容 + 星愿统计右侧栏，替代原 AI 社区右侧栏） ---------- */
.ww-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 16px; align-items: start; }
@media (max-width: 920px) { .ww-main { grid-template-columns: minmax(0, 1fr); } }
.ww-col { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ww-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 921px) { .ww-side { position: sticky; top: 8px; } }

.ww-card {
  border: 1px solid var(--ww-border); border-radius: 16px;
  background: var(--ww-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(6, 10, 34, 0.35); padding: 18px;
}
.ww-card h3 { margin: 0 0 10px; font-size: 14px; color: #f1f5f9; }

/* ---------- 发布器 ---------- */
.ww-composer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ww-count { font-size: 11px; color: #94a3b8; font-variant-numeric: tabular-nums; }
.ww-count.warn { color: #fcd34d; }
.ww-who { margin: 4px 0 10px; font-size: 11px; color: #94a3b8; }
.ww-who b { color: #cbd5e1; }
.ww-input {
  width: 100%; box-sizing: border-box; resize: none; border-radius: 12px;
  border: 1px solid var(--ww-border); background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9; padding: 10px 12px; font-size: 14px;
}
.ww-input::placeholder { color: #64748b; }
.ww-input:focus { outline: none; border-color: rgba(167, 139, 250, 0.55); box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18); }
.ww-picker-label { display: block; margin: 12px 0 6px; font-size: 11px; color: #94a3b8; }
.ww-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.ww-swatch {
  width: 34px; height: 34px; border-radius: 999px; border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s; opacity: 0.75;
}
.ww-swatch:hover { transform: scale(1.12); }
.ww-swatch.on { opacity: 1; transform: scale(1.12); border-color: rgba(255, 255, 255, 0.85); }
.ww-swatch[data-color="rose"] { background: #fb7185; }
.ww-swatch[data-color="amber"] { background: #fbbf24; }
.ww-swatch[data-color="emerald"] { background: #34d399; }
.ww-swatch[data-color="sky"] { background: #38bdf8; }
.ww-swatch[data-color="violet"] { background: #a78bfa; }
.ww-swatch[data-color="pink"] { background: #f472b6; }
.ww-chip {
  min-height: 34px; border-radius: 10px; border: 1px solid var(--ww-border);
  background: rgba(255, 255, 255, 0.04); color: #cbd5e1; padding: 4px 10px; font-size: 14px;
  transition: background 0.15s, transform 0.15s;
}
.ww-chip:hover { background: rgba(255, 255, 255, 0.1); }
.ww-chip.on { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.4); color: #fff; transform: scale(1.06); }
.ww-mood.on { border-color: rgba(196, 181, 253, 0.6); background: rgba(139, 92, 246, 0.25); color: #ede9fe; }
.ww-submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.ww-primary {
  min-height: 40px; border: 0; border-radius: 999px; padding: 8px 22px; color: #fff; font-size: 13px; font-weight: 600;
  background: linear-gradient(90deg, #8b5cf6, #d946ef, #fb7185);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4); transition: filter 0.15s, transform 0.15s;
}
.ww-primary:hover { filter: brightness(1.12); }
.ww-primary:active { transform: scale(0.96); }
.ww-primary:disabled { opacity: 0.55; cursor: wait; }
.ww-ok { font-size: 12px; color: #6ee7b7; }
.ww-err { font-size: 12px; color: #fda4af; }

/* ---------- 列表 ---------- */
.ww-feed-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ww-feed-title { font-size: 14px; font-weight: 600; color: #f1f5f9; }
.ww-feed-title small { margin-left: 8px; font-weight: 400; font-size: 11px; color: #94a3b8; }
.ww-sortbar { display: inline-flex; gap: 4px; border: 1px solid var(--ww-border); border-radius: 999px; background: rgba(255, 255, 255, 0.05); padding: 3px; }
.ww-sort {
  min-height: 32px; border: 0; border-radius: 999px; background: transparent; color: #94a3b8; padding: 4px 14px; font-size: 12px;
  transition: background 0.15s, color 0.15s;
}
.ww-sort:hover { color: #e2e8f0; }
.ww-sort.on { background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 600; }

.ww-list { display: flex; flex-direction: column; gap: 10px; }
.ww-wish {
  border: 1px solid var(--ww-border); border-radius: 14px; background: rgba(255, 255, 255, 0.035);
  padding: 14px; animation: ww-up 0.35s ease-out both; transition: box-shadow 0.2s;
}
.ww-wish:hover { box-shadow: 0 8px 28px rgba(129, 140, 248, 0.15); }
.ww-wish.ww-flash { box-shadow: 0 0 0 2px rgba(196, 181, 253, 0.7), 0 0 32px rgba(167, 139, 250, 0.4); }
@keyframes ww-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.ww-wish-main { display: flex; gap: 10px; align-items: flex-start; }
.ww-avatar {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  font-size: 19px; background: rgba(255, 255, 255, 0.07);
}
.ww-wish[data-color="rose"] .ww-avatar { background: rgba(251, 113, 133, 0.16); }
.ww-wish[data-color="amber"] .ww-avatar { background: rgba(251, 191, 36, 0.16); }
.ww-wish[data-color="emerald"] .ww-avatar { background: rgba(52, 211, 153, 0.16); }
.ww-wish[data-color="sky"] .ww-avatar { background: rgba(56, 189, 248, 0.16); }
.ww-wish[data-color="violet"] .ww-avatar { background: rgba(167, 139, 250, 0.16); }
.ww-wish[data-color="pink"] .ww-avatar { background: rgba(244, 114, 182, 0.16); }
.ww-wish-body { min-width: 0; flex: 1; }
.ww-text { margin: 0; font-size: 14px; overflow-wrap: break-word; white-space: pre-wrap; }
.ww-wish[data-color="rose"] .ww-text { color: #ffe4e6; }
.ww-wish[data-color="amber"] .ww-text { color: #fef3c7; }
.ww-wish[data-color="emerald"] .ww-text { color: #d1fae5; }
.ww-wish[data-color="sky"] .ww-text { color: #e0f2fe; }
.ww-wish[data-color="violet"] .ww-text { color: #ede9fe; }
.ww-wish[data-color="pink"] .ww-text { color: #fce7f3; }
.ww-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 7px; font-size: 11px; color: #94a3b8; align-items: center; }
.ww-mood-badge { border: 1px solid var(--ww-border); border-radius: 999px; padding: 1px 9px; background: rgba(255, 255, 255, 0.05); }
.ww-author { color: #cbd5e1; }
.ww-ai-tag { font-style: normal; border-radius: 999px; background: rgba(56, 189, 248, 0.18); color: #7dd3fc; padding: 0 7px; font-size: 10px; margin-left: 4px; }
.ww-anon-tag { font-style: normal; border-radius: 999px; background: rgba(167, 139, 250, 0.16); color: #c4b5fd; padding: 0 7px; font-size: 10px; margin-left: 4px; }
.ww-anon { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #94a3b8; cursor: pointer; user-select: none; }
.ww-anon input { width: 16px; height: 16px; accent-color: #a78bfa; cursor: pointer; }
.ww-imported-tag { border-radius: 999px; background: rgba(52, 211, 153, 0.14); color: #6ee7b7; padding: 0 7px; font-size: 10px; }

.ww-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.ww-act {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px;
  border: 1px solid rgba(251, 113, 133, 0.3); border-radius: 999px;
  background: rgba(251, 113, 133, 0.1); color: #fecdd3; padding: 4px 14px; font-size: 12px;
  transition: background 0.15s, transform 0.15s;
}
.ww-act:hover { background: rgba(251, 113, 133, 0.2); }
.ww-act:active { transform: scale(0.95); }
.ww-act:disabled { opacity: 0.6; cursor: default; }
.ww-act.liked { background: rgba(244, 63, 94, 0.28); border-color: rgba(253, 164, 175, 0.5); color: #fff1f2; }
.ww-act.cmt { border-color: rgba(56, 189, 248, 0.3); background: rgba(56, 189, 248, 0.1); color: #bae6fd; }
.ww-act.cmt:hover { background: rgba(56, 189, 248, 0.2); }
.ww-act.cmt.on { background: rgba(56, 189, 248, 0.26); border-color: rgba(125, 211, 252, 0.55); }
.ww-num { font-variant-numeric: tabular-nums; }

/* ---------- 评论区（文档流内展开，下方内容自动下移，不重叠） ---------- */
.ww-comments { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.07); animation: ww-down 0.28s ease-out; }
@keyframes ww-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.ww-cmt { border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 12px; background: rgba(255, 255, 255, 0.03); padding: 9px 12px; margin-bottom: 8px; }
.ww-cmt-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 11px; color: #94a3b8; }
.ww-cmt-name { color: #c4b5fd; font-weight: 600; }
.ww-cmt-reply-to { color: #7dd3fc; }
.ww-cmt-text { margin: 4px 0 0; font-size: 13px; color: #e2e8f0; overflow-wrap: break-word; white-space: pre-wrap; }
.ww-cmt-reply-btn { margin-left: auto; border: 0; background: transparent; color: #94a3b8; font-size: 11px; padding: 4px 8px; border-radius: 999px; min-height: 28px; }
.ww-cmt-reply-btn:hover { color: #7dd3fc; background: rgba(56, 189, 248, 0.1); }
.ww-cmt-empty { font-size: 12px; color: #64748b; text-align: center; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.ww-cmt-form { margin-top: 10px; border: 1px solid var(--ww-border); border-radius: 12px; background: rgba(255, 255, 255, 0.04); padding: 12px; }
.ww-reply-hint { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #7dd3fc; margin-bottom: 8px; }
.ww-reply-hint button { border: 0; background: transparent; color: #94a3b8; min-height: 28px; padding: 2px 8px; border-radius: 999px; }
.ww-reply-hint button:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.ww-cmt-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.ww-cmt-who { font-size: 11px; color: #64748b; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ww-cmt-send {
  min-height: 36px; border: 0; border-radius: 999px; padding: 6px 18px; color: #fff; font-size: 12px; font-weight: 600;
  background: linear-gradient(90deg, #8b5cf6, #38bdf8); transition: filter 0.15s, transform 0.15s;
}
.ww-cmt-send:hover { filter: brightness(1.12); }
.ww-cmt-send:active { transform: scale(0.96); }
.ww-cmt-send:disabled { opacity: 0.55; cursor: wait; }

/* ---------- 侧栏统计 ---------- */
.ww-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ww-tile { border-radius: 12px; background: rgba(255, 255, 255, 0.05); padding: 12px 8px; text-align: center; }
.ww-tile b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.ww-tile span { font-size: 10.5px; color: #94a3b8; }
.ww-tile.likes b { color: #fecdd3; }
.ww-tile.stars b { color: #fcd34d; }
.ww-rank { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ww-rank li {
  display: flex; align-items: center; gap: 8px; border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px; background: rgba(255, 255, 255, 0.035); padding: 7px 10px; font-size: 12px;
}
.ww-rank .ww-rank-medal { flex: 0 0 auto; width: 22px; text-align: center; }
.ww-rank .ww-rank-text { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ww-rank .ww-rank-likes { flex: 0 0 auto; color: #fda4af; font-variant-numeric: tabular-nums; }
.ww-mood-row { margin-bottom: 9px; }
.ww-mood-head { display: flex; justify-content: space-between; font-size: 11px; color: #94a3b8; margin-bottom: 3px; }
.ww-mood-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.ww-mood-fill { height: 100%; border-radius: 999px; transition: width 0.5s ease-out; }
.ww-empty { font-size: 12px; color: #64748b; text-align: center; padding: 16px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); }

.ww-tip-tag { border-radius: 999px; background: rgba(252, 211, 77, 0.14); color: #fcd34d; padding: 0 7px; font-size: 10px; }

/* ---------- 提示与页脚 ---------- */
.ww-notice {
  position: sticky; bottom: 8px; z-index: 8; margin: 10px 16px 0; padding: 9px 14px;
  border-radius: 12px; border: 1px solid rgba(253, 164, 175, 0.35);
  background: rgba(136, 19, 55, 0.55); color: #fecdd3; font-size: 12px;
  backdrop-filter: blur(10px); animation: ww-up 0.25s ease-out;
}
.ww-note { margin: 0; padding: 12px 18px 16px; font-size: 11px; color: #64748b; text-align: center; line-height: 1.7; }
.ww-skeleton { height: 72px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); animation: ww-pulse 1.2s ease-in-out infinite; }
@keyframes ww-pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.9; } }

/* 焦点可见性（可访问性） */
.ww button:focus-visible, .ww textarea:focus-visible, .ww input:focus-visible {
  outline: 2px solid rgba(196, 181, 253, 0.8); outline-offset: 2px;
}

/* 动效降级 */
@media (prefers-reduced-motion: reduce) {
  .ww-star, .ww-dm, .ww-wish, .ww-comments, .ww-notice { animation: none !important; }
  .ww-dm { display: none; }
  .ww-mood-fill { transition: none; }
}


/* ==== 响应式适配补丁 R1（手机细节，2026-11-08 追加；回滚=删除本段） ==== */
@media (max-width:640px) {
  .ww-main { padding: 10px; gap: 12px; }
  .ww-card { padding: 14px; border-radius: 14px; }
  .ww-hero { min-height: 280px; }
  .ww-input { font-size: 16px; } /* 防 iOS 聚焦自动放大 */
  .ww-sub { font-size: 12px; line-height: 1.9; }
  .ww-hint { letter-spacing: 0.06em; }
  .ww-actions { gap: 6px; }
  .ww-act { padding: 4px 11px; }
  .ww-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .ww-tile b { font-size: 16px; }
}
/* ==== 响应式适配补丁 R1 结束 ==== */
