/* ============ 主容器 ============ */
#app {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  min-height: 100vh;
}

/* ============ 顶栏 (作品信息+按钮纵向叠右上) ============ */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: stretch;
  padding: 14px 18px;
  position: relative;
  transition: all 0.5s;
  min-height: 110px;
}
.mode-wu .topbar {
  background: rgba(0, 0, 0, 0.85);
  border-left: 6px solid var(--wu-red);
  border-right: 6px solid var(--wu-red);
}
.mode-wen .topbar {
  background: linear-gradient(135deg, var(--wen-blue-deep), rgba(0,0,0,0.7));
  border: 1px solid var(--wen-silver);
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(30, 144, 255, 0.25);
}

/* 左侧:作品信息+品牌 */
.work-info-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.brand-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 4px;
  font-weight: 700;
  font-family: 'Bebas Neue', sans-serif;
}
.mode-wu .brand-line { color: var(--wu-red); }
.mode-wen .brand-line { color: var(--wen-silver); font-family: 'Cinzel', serif; font-style: italic; }

.brand-line-divider {
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.3;
}

.work-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  flex-wrap: wrap;
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 4px;
  transition: background 0.2s;
}
.work-info:hover {
  background: rgba(255, 255, 255, 0.08);
}
.work-edit-hint {
  font-size: 12px;
  color: var(--text-mute);
  margin-left: auto;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.work-info:hover .work-edit-hint {
  opacity: 1;
}
.live-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.mode-wu .live-dot { background: var(--wu-red); box-shadow: 0 0 12px var(--wu-red); }
.mode-wen .live-dot { background: var(--wen-cyan); box-shadow: 0 0 12px var(--wen-cyan); }
.live-dot::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  animation: liveRing 1.6s ease-out infinite;
}
.mode-wu .live-dot::before { color: var(--wu-red); }
.mode-wen .live-dot::before { color: var(--wen-cyan); }
@keyframes liveRing {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

.work-id {
  font-family: 'Bebas Neue', monospace;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 2px;
}
.mode-wu .work-id { color: var(--wu-red); }
.mode-wen .work-id { color: var(--wen-cyan); font-family: 'Cinzel', serif; }
.work-name { font-size: 16px; }
.work-author {
  color: var(--text-dim);
  font-size: 12px;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 2px;
}
.mode-wen .work-author { font-family: 'Cinzel', serif; }

/* 右侧:模式按钮纵向叠 */
.mode-pills {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 200px;
  flex-shrink: 0;
}
.mode-cap {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text-mute);
  font-weight: 700;
  font-family: 'Bebas Neue', sans-serif;
  text-align: center;
  padding-bottom: 2px;
}
.mode-wen .mode-cap { font-family: 'Cinzel', serif; letter-spacing: 4px; }

.pill {
  position: relative;
  width: 100%;
  height: 56px;
  cursor: pointer;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 4px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--text-light);
  text-shadow: 0 0 8px rgba(0,0,0,0.95), 1px 1px 0 #000;
  z-index: 1;
  isolation: isolate;
  overflow: hidden;
}
.pill::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: -1;
  transition: filter 0.3s;
}
.pill.wu-style.has-img::before { background-image: url('https://pub-8df52e5e46f14a25ac93f93411edb534.r2.dev/wu/btn-mode.png'); }
.pill.wen-style.has-img::before { background-image: url('https://pub-8df52e5e46f14a25ac93f93411edb534.r2.dev/wen/btn-mode.png'); }

/* CSS兜底矩形按钮 (没图时也有P5R/P3R味) */
.pill.wu-style:not(.has-img) {
  background: linear-gradient(135deg, var(--wu-red-dark) 0%, var(--wu-red) 50%, #FF3030 100%);
  border: 2px solid var(--wu-white);
  box-shadow: 3px 3px 0 var(--wu-black);
  clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
}
.pill.wen-style:not(.has-img) {
  background: linear-gradient(135deg, var(--wen-blue-deep) 0%, var(--wen-blue) 100%);
  border: 1px solid var(--wen-silver);
  box-shadow: 0 0 15px rgba(30, 144, 255, 0.3);
}

/* 选中态 */
.pill.active {
  transform: scale(1.06);
}
.pill.active::before {
  filter: brightness(1.3) saturate(1.4);
}
.pill.active.wu-style {
  animation: wuPulseGlow 2s ease-in-out infinite;
}
.pill.active.wen-style {
  animation: wenBreathGlow 3s ease-in-out infinite;
}
@keyframes wuPulseGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(230, 0, 18, 0.5)); }
  50% { filter: drop-shadow(0 0 20px rgba(230, 0, 18, 0.95)); }
}
@keyframes wenBreathGlow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(192, 216, 255, 0.4)); }
  50% { filter: drop-shadow(0 0 25px rgba(192, 216, 255, 0.9)); }
}

.pill:not(.active) {
  filter: brightness(0.5);
  opacity: 0.55;
}
.pill:not(.active)::before {
  filter: grayscale(0.5) brightness(0.6);
}
.pill:not(.active):hover {
  filter: brightness(0.9);
  opacity: 0.9;
  transform: scale(1.03);
}

/* ============ 编辑作品 ============ */
.work-edit { display: none; gap: 10px; padding: 10px 16px; background: rgba(0, 0, 0, 0.85); }
.mode-wu .work-edit { border: 1px solid var(--wu-red); }
.mode-wen .work-edit { border: 1px solid var(--wen-silver); border-radius: 12px; }
.work-edit.show { display: flex; flex-wrap: wrap; }
.work-edit input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 12px;
  color: var(--text-light);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  flex: 1;
  min-width: 100px;
}
.work-edit input:focus { border-color: var(--text-light); }

