/* 灵异论坛讨论页：浅黑底、暗红警示色、固定左侧导航 */

:root {
  --page-bg: #272727;
  --panel-bg: #303030;
  --panel-deep: #222222;
  --text: #eeeeee;
  --muted: #aaaaaa;
  --line: #4a4a4a;
  --red: #990000;
  --blood: #dc0000;
  --sidebar-width: 230px;
  --hero-height: 160px;
  --detail-header-height: 58px;
}

* { box-sizing: border-box; }
html { background: #1a1a1a; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: linear-gradient(135deg, #303030 0%, #272727 60%, #202020 100%);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  overflow-x: hidden;
}

/* 轻微噪点，只保留压抑的旧档案质感 */
body::before {
  position: fixed;
  z-index: 10;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.025;
  background-image: radial-gradient(#eeeeee 0.45px, transparent 0.55px);
  background-size: 5px 5px;
}

/* 左侧导航栏始终独立存在 */
.sidebar {
  position: fixed;
  z-index: 3;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 28px 18px;
  overflow-y: auto;
  background: linear-gradient(180deg, #2c2c2c 0%, #202020 50%, #171717 100%);
  border-right: 1px solid var(--line);
}

.site-name {
  order: 0;
  display: block;
  padding: 2px 0 14px;
  color: #ff5555;
  font-size: 2.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.menu { display: flex; flex-direction: column; gap: 6px; }
.menu { order: 1; }
.menu-item {
  display: block;
  padding: 9px 10px;
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  background: #363636;
  border: 1px solid #505050;
  border-left: 3px solid #606060;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.menu-item:hover, .menu-item:focus-visible, .menu-item.is-active {
  background: var(--red);
  border-color: #bb0000;
  border-left-color: #eeeeee;
}
.menu-item:focus-visible { outline: 1px solid #eeeeee; outline-offset: 2px; }
.is-hidden { display: none !important; }

.account-panel {
  order: 2;
  margin-top: 18px;
  padding: 14px 12px;
  background: linear-gradient(180deg, rgba(61, 12, 12, 0.72), rgba(30, 30, 30, 0.92));
  border: 1px solid rgba(133, 42, 42, 0.44);
}
.account-kicker {
  margin: 0 0 9px;
  color: #ffb6b6;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.account-status {
  color: #e3dcdc;
  font-size: 0.82rem;
  line-height: 1.7;
}
.account-actions {
  display: grid;
  margin-top: 12px;
  gap: 8px;
}
.ghost-button,
.primary-button {
  padding: 10px 12px;
  color: #f6eded;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  background: linear-gradient(135deg, #5f0505, #220202);
  border: 1px solid rgba(255, 119, 119, 0.24);
}
.ghost-button:hover,
.primary-button:hover {
  background: linear-gradient(135deg, #7b0909, #300303);
}

.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.discussion-view {
  min-height: 100vh;
  padding-top: var(--hero-height);
}

/* 讨论区顶部：暗红背景与血字 */
.discussion-hero {
  position: fixed;
  z-index: 4;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  display: flex;
  min-height: var(--hero-height);
  padding: 42px clamp(28px, 6vw, 88px);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(20, 0, 0, 0.28) 0%, rgba(42, 0, 0, 0.18) 50%, rgba(20, 0, 0, 0.32) 100%),
    url("img/dahaishi.png") center 56% / cover no-repeat;
  border-bottom: 1px solid #850000;
}
.hero-title-group {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.discussion-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.32;
  background: repeating-linear-gradient(125deg, transparent 0 42px, #160000 43px 44px, transparent 45px 85px);
}
.discussion-hero h1 {
  position: relative;
  margin: 0;
  color: #ff2a2a;
  font-size: clamp(2rem, 4.1vw, 3.6rem);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.2em;
  line-height: 1;
  text-align: center;
  text-shadow: 0 2px 0 #530000, 0 5px 9px #130000;
}
.hero-subtitle {
  position: relative;
  left: 52px;
  color: #ffd7d7;
  font-size: 0.88rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-shadow: 0 1px 0 #3a0000, 0 2px 10px rgba(0, 0, 0, 0.4);
}
/* 两滴克制的血迹，用伪元素完成，无图片特效 */
.discussion-hero h1::before, .discussion-hero h1::after {
  position: absolute;
  top: 100%;
  width: 6px;
  content: "";
  background: linear-gradient(var(--blood), #740000);
  border-radius: 0 0 5px 5px;
}
.discussion-hero h1::before { left: 28%; height: 30px; }
.discussion-hero h1::after { left: 68%; height: 18px; }
.city-label {
  position: absolute;
  z-index: 1;
  left: clamp(28px, 6vw, 88px);
  bottom: 25px;
  color: #eeeeee;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

/* 聊天流式帖子区域 */
.discussion-list { max-width: 980px; padding: 30px 36px 62px; }
.discussion-card {
  margin-bottom: 14px;
  background: linear-gradient(135deg, #363636, var(--panel-bg));
  border: 1px solid var(--line);
  border-left: 3px solid #6e0000;
}
.post-open {
  display: grid;
  width: 100%;
  padding: 20px;
  gap: 16px;
  grid-template-columns: 52px minmax(0, 1fr);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}
.post-open:hover { background: #3b3b3b; }
.avatar { width: 52px; height: 52px; object-fit: cover; border: 1px solid #696969; }
.post-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 0.78rem; }
.post-meta strong { color: #ffffff; font-size: 0.95rem; }
.post-meta time::before { content: "·"; margin-right: 9px; color: #777777; }
.card-content h2 { margin: 8px 0 7px; font-size: 1.08rem; font-weight: 700; }
.card-content p, .detail-post p { margin: 0; color: #d2d2d2; font-size: 0.92rem; line-height: 1.8; }
.post-preview { display: block; width: min(320px, 100%); margin-top: 14px; border: 1px solid #555555; }
.audio-chip {
  display: inline-flex;
  margin-top: 12px;
  padding: 6px 10px;
  align-items: center;
  gap: 10px;
  color: #ffd1d1;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, rgba(93, 0, 0, 0.9), rgba(41, 0, 0, 0.95));
  border: 1px solid rgba(180, 54, 54, 0.5);
}
.read-more { display: inline-block; margin-top: 11px; color: #ff7777; font-size: 0.84rem; }
.card-actions { display: flex; padding: 10px 20px 13px 88px; gap: 25px; color: var(--muted); font-size: 0.76rem; border-top: 1px solid var(--line); }
.empty-state {
  padding: 26px;
  color: #d7c8c8;
  text-align: center;
  background: linear-gradient(135deg, rgba(60, 60, 60, 0.82), rgba(44, 44, 44, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.empty-state.is-error {
  color: #ffd0d0;
  border-color: rgba(158, 38, 38, 0.55);
}

/* 点击帖子后只在右侧显示的详情“新页面” */
.detail-view { display: none; }
.discussion-view.is-visible, .detail-view.is-visible { display: block; }
.discussion-list.is-hidden { display: none; }
.detail-header {
  min-height: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.back-button {
  position: fixed;
  z-index: 5;
  top: calc(var(--hero-height) + 26px);
  left: calc(var(--sidebar-width) + 18px);
  display: grid;
  width: 64px;
  min-height: 38px;
  padding: 6px 4px;
  color: #eeeeee;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: center;
  place-items: center;
  background: #3b3b3b;
  border: 1px solid #575757;
}
.back-button:hover { background: var(--red); border-color: #bb0000; }
#detail-city-line {
  display: none;
}
.detail-layout {
  display: grid;
  width: min(100%, 960px);
  margin: 18px 0 0;
  padding: 0 24px 34px 18px;
  align-items: start;
  grid-template-columns: 64px minmax(0, 780px);
  gap: 12px;
  justify-content: start;
}
.detail-actions {
  display: flex;
  position: sticky;
  z-index: 5;
  top: calc(var(--hero-height) + 84px);
  left: auto;
  width: 64px;
  height: min-content;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  justify-self: center;
  padding-top: 0;
}
.detail-actions button {
  display: grid;
  width: 100%;
  min-height: 54px;
  padding: 6px 4px;
  place-items: center;
  color: #eeeeee;
  cursor: pointer;
  font-size: 0.98rem;
  background: #343434;
  border: 1px solid #555555;
}
.detail-actions button:hover { color: #ff8888; background: #4a1515; border-color: var(--red); }
.detail-actions small { margin-top: 2px; font-size: 0.64rem; }
.detail-post {
  width: 100%;
  min-width: 0;
  padding: 26px 28px 32px;
  background: linear-gradient(135deg, #363636, var(--panel-bg));
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
}
.detail-post h1 { margin: 14px 0 16px; font-size: clamp(1.3rem, 2.2vw, 1.95rem); line-height: 1.32; letter-spacing: 0.02em; }
.detail-post p + p { margin-top: 18px; }
.detail-body {
  display: grid;
  gap: 18px;
}
.detail-body + .detail-body {
  margin-top: 18px;
}
.detail-body p {
  margin: 0;
}
.detail-media-block {
  margin: 2px 0 4px;
}
.detail-media-block figcaption {
  margin-top: 7px;
  color: #a99f9f;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
.detail-inline-media {
  display: block;
  width: min(680px, 100%);
  max-height: 70vh;
  object-fit: contain;
  background: #151515;
  border: 1px solid #555555;
}
.detail-inline-audio {
  width: min(520px, 100%);
}
.detail-image {
  display: block;
  width: min(680px, 100%);
  margin-top: 20px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid #555555;
}
.thread-updates {
  margin-top: 26px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.thread-updates.is-hidden { display: none; }
.thread-update {
  display: grid;
  padding: 18px 0;
  gap: 14px;
  grid-template-columns: 44px minmax(0, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.thread-update:last-child { padding-bottom: 6px; border-bottom: 0; }
.thread-update-avatar {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border: 1px solid #7b3c3c;
  border-radius: 50%;
}
.thread-update-body p {
  margin-top: 6px;
  color: #e0d7d7;
}
.thread-update-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #a8a0a0;
  font-size: 0.76rem;
}
.thread-update-meta strong {
  color: #ffffff;
  font-size: 0.9rem;
}
.thread-update-meta span {
  padding: 2px 7px;
  color: #ffdada;
  background: rgba(116, 8, 8, 0.5);
  border: 1px solid rgba(173, 51, 51, 0.35);
}
.audio-panel {
  margin-top: 24px;
  padding: 18px 18px 16px;
  background: linear-gradient(135deg, rgba(53, 9, 9, 0.96), rgba(27, 27, 27, 0.92));
  border: 1px solid rgba(163, 37, 37, 0.6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.audio-panel.is-hidden { display: none; }
.audio-panel-header {
  display: flex;
  margin-bottom: 14px;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.audio-panel-header strong {
  color: #ffffff;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.audio-panel-header span {
  color: #b8a3a3;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}
.audio-toggle {
  display: inline-flex;
  min-width: 156px;
  padding: 9px 14px;
  align-items: center;
  gap: 10px;
  color: #f5e6e6;
  cursor: pointer;
  font: inherit;
  background: linear-gradient(135deg, #6a0707, #280404);
  border: 1px solid rgba(255, 114, 114, 0.3);
}
.audio-toggle:hover {
  background: linear-gradient(135deg, #7f0a0a, #340505);
}
.audio-toggle-icon {
  display: inline-grid;
  width: 18px;
  place-items: center;
}
.audio-wave {
  display: grid;
  height: 34px;
  margin-top: 14px;
  align-items: end;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.audio-wave span {
  height: 10px;
  background: linear-gradient(180deg, #ff7070 0%, #7d0000 100%);
  opacity: 0.45;
  transform-origin: bottom center;
}
.audio-panel.is-playing .audio-wave span {
  opacity: 1;
  animation: audioPulse 1s ease-in-out infinite;
}
.audio-panel.is-playing .audio-wave span:nth-child(2) { animation-delay: 0.12s; }
.audio-panel.is-playing .audio-wave span:nth-child(3) { animation-delay: 0.24s; }
.audio-panel.is-playing .audio-wave span:nth-child(4) { animation-delay: 0.36s; }
.audio-panel.is-playing .audio-wave span:nth-child(5) { animation-delay: 0.48s; }
.audio-panel.is-playing .audio-wave span:nth-child(6) { animation-delay: 0.6s; }
.audio-note {
  margin-top: 14px;
  color: #cfbdbd;
  font-size: 0.82rem;
  line-height: 1.7;
}
.modal-backdrop {
  display: grid;
  position: fixed;
  z-index: 25;
  inset: 0;
  padding: 24px;
  overflow-y: auto;
  place-items: center;
  background: rgba(7, 2, 2, 0.72);
  backdrop-filter: blur(4px);
}
.modal-card {
  width: min(100%, 420px);
  max-height: calc(100vh - 48px);
  padding: 20px;
  overflow-y: auto;
  background: linear-gradient(160deg, #3f3f3f 0%, #2a2a2a 46%, #1f1f1f 100%);
  border: 1px solid rgba(177, 45, 45, 0.4);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}
.modal-card-wide { width: min(100%, 620px); }
.compose-card {
  position: relative;
  max-height: none;
  overflow: visible;
}
.modal-head {
  display: flex;
  position: sticky;
  z-index: 1;
  top: 0;
  margin-bottom: 16px;
  padding-bottom: 10px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(160deg, #3f3f3f 0%, #2a2a2a 46%, #1f1f1f 100%);
}
.compose-card .modal-head {
  position: static;
}
.modal-head h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.16rem;
}
.modal-close {
  width: 36px;
  height: 36px;
  padding: 0;
  color: #f3dada;
  cursor: pointer;
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  background: #491010;
  border: 1px solid rgba(255, 116, 116, 0.3);
}
.compose-close {
  position: absolute;
  top: 0;
  right: -42px;
}
.stack-form {
  display: grid;
  gap: 14px;
}
.form-field {
  display: grid;
  gap: 7px;
}
.form-field span,
.form-hint {
  color: #ddd3d3;
  font-size: 0.8rem;
  line-height: 1.6;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  color: #f0eded;
  font: inherit;
  background: rgba(18, 18, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.form-field textarea {
  resize: vertical;
  min-height: 120px;
}
.upload-panel {
  padding: 13px 14px;
  background: rgba(18, 18, 18, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.upload-title {
  margin: 0 0 5px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
}
.upload-hint {
  margin: 0 0 12px;
  color: #cdbebe;
  font-size: 0.78rem;
  line-height: 1.6;
}
.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.upload-button {
  display: inline-grid;
  min-width: 96px;
  padding: 8px 11px;
  place-items: center;
  color: #f5eaea;
  cursor: pointer;
  font-size: 0.8rem;
  background: linear-gradient(135deg, #4d0808, #1f1f1f);
  border: 1px solid rgba(255, 124, 124, 0.22);
}
.upload-button:hover {
  background: linear-gradient(135deg, #6d0b0b, #292929);
}
.upload-button input {
  display: none;
}
.form-feedback {
  min-height: 20px;
  margin: -4px 0 0;
  color: #ffb3b3;
  font-size: 0.8rem;
}
.toast {
  position: fixed;
  z-index: 30;
  top: 214px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  color: #fff7f7;
  background: rgba(104, 12, 12, 0.94);
  border: 1px solid rgba(255, 147, 147, 0.26);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.toast.is-error {
  background: rgba(58, 17, 17, 0.96);
}

@keyframes audioPulse {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1.75); }
}

@media (max-width: 760px) {
  .sidebar { position: relative; width: 100%; padding: 22px 18px; }
  .site-name { padding: 10px 0 12px; font-size: 1.8rem; }
  .menu { flex-direction: row; flex-wrap: wrap; }
  .menu-item { flex: 1 1 110px; }
  .main-content { margin-left: 0; }
  .discussion-view { padding-top: 0; }
  .account-panel { margin-top: 14px; }
  .discussion-hero {
    position: sticky;
    left: auto;
    right: auto;
    min-height: 135px;
    padding: 28px 24px;
  }
  :root {
    --hero-height: 135px;
  }
  .hero-title-group { gap: 8px; }
  .hero-subtitle { left: 36px; font-size: 0.8rem; letter-spacing: 0.32em; text-indent: 0.32em; }
  .discussion-list { padding: 20px 16px 42px; }
  .detail-header { padding: 0; }
  .detail-layout {
    width: 100%;
    margin-top: 18px;
    padding: 0 16px 32px;
    gap: 12px;
    grid-template-columns: 60px minmax(0, 1fr);
  }
  .back-button { top: calc(var(--hero-height) + 20px); left: 8px; width: 60px; min-height: 36px; padding: 6px 4px; }
  .detail-actions { top: calc(var(--hero-height) + 78px); width: 60px; gap: 7px; }
  .detail-post {
    padding: 24px 22px 26px;
  }
  .thread-update { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; }
  .thread-update-avatar { width: 40px; height: 40px; }
  .audio-panel-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .discussion-hero h1 { font-size: 2.25rem; letter-spacing: 0.12em; }
  .hero-subtitle { left: 24px; }
  .city-label { left: 18px; bottom: 18px; font-size: 0.84rem; }
  .modal-backdrop { padding: 14px; }
  .modal-card { padding: 16px; }
  .toast { top: 174px; max-width: min(320px, calc(100vw - 24px)); }
  .post-open { padding: 16px; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; }
  .avatar { width: 42px; height: 42px; }
  .card-actions { padding-left: 16px; gap: 15px; }
  .detail-layout {
    grid-template-columns: 1fr;
    padding-bottom: 108px;
  }
  .detail-actions {
    position: fixed;
    top: auto;
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
    flex-direction: row;
    padding-top: 0;
  }
  .back-button {
    position: static;
    width: auto;
    min-height: 52px;
  }
  .detail-post { overflow: visible; }
  .detail-header { grid-template-columns: 1fr; gap: 8px; }
  #detail-city-line { position: static; justify-self: start; }
  .detail-actions button { flex: 1; }
}
