/**
 * Web 玩家页外壳样式。
 *
 * 只负责「手机框 + 右侧玩家面板」。房间内部的布局与家具定位全部来自
 * `living.css`（= miniprogram/pages/living/index.wxss 的转换产物），
 * 不在这里重复一遍 —— 否则改家具位置又会变成两处。
 *
 * 类名统一 `pl-` 前缀，避免和 living.css 里的 `.panel` / `.toast` / `.shade`
 * （那套来自小程序页面的 WXML 结构）撞名。
 */

/* 带 `hidden` 的元素必须真的隐藏：`.pl-overlay` 等设了 `display:flex`，
 * 会覆盖 hidden 属性自带的 `display:none`，导致遮罩 `hidden` 后仍整屏挡点击。 */
[hidden] {
  display: none !important;
}

:root {
  color-scheme: dark;
  --pl-bg: #12161d;
  --pl-surface: #1a2028;
  --pl-surface-2: #212a35;
  --pl-line: #313d4c;
  --pl-text: #e3e9f1;
  --pl-dim: #93a2b4;
  --pl-accent: #d4783c;
  --pl-accent-2: #75c4bc;
  --pl-warn: #e0b155;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--pl-bg);
  color: var(--pl-text);
  font: 14px/1.6 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.pl-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--pl-line);
  background: var(--pl-surface);
  position: sticky;
  top: 0;
  z-index: 30;
}

.pl-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pl-accent);
}

.pl-topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pl-tag {
  font-size: 12px;
  color: var(--pl-dim);
  border: 1px solid var(--pl-line);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.pl-tag.is-warn {
  color: var(--pl-warn);
  border-color: #6a5426;
}

.pl-layout {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 24px 20px 60px;
  max-width: 1180px;
  margin: 0 auto;
}

.pl-room-col {
  position: sticky;
  top: 68px;
}

/* 手机框：与预览页同一组尺寸，房间按 390×844 排版（wxss 的 rpx 已按 0.5 换算） */
.pl-room-host .phone {
  width: 390px;
  height: 844px;
  overflow: hidden;
  border: 2px solid #111;
  border-radius: 26px;
  background: #1c1712;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  position: relative;
  display: flex;
  flex-direction: column;
}

.pl-room-host .phone .home {
  height: 100%;
  min-height: 100%;
  flex: 1;
}

.pl-room-host img.prop-img,
.pl-room-host img.room-bg {
  display: block;
  object-fit: contain;
}

.pl-room-host img.room-bg {
  object-fit: cover;
}

.pl-room-note,
.pl-note {
  color: var(--pl-dim);
  font-size: 12px;
  margin: 10px 0 0;
}

.pl-panel-col {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.pl-card {
  background: var(--pl-surface);
  border: 1px solid var(--pl-line);
  border-radius: 12px;
  padding: 14px 16px 16px;
}

.pl-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.pl-card-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.pl-pill {
  font-size: 12px;
  color: var(--pl-accent-2);
  border: 1px solid #2f4a49;
  background: #16211f;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.pl-moment {
  margin: 0 0 12px;
  color: #cfe0d8;
  font-size: 13px;
  min-height: 1.5em;
}

.pl-bars {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.pl-bar {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--pl-dim);
}

.pl-bar-track {
  height: 8px;
  border-radius: 999px;
  background: #10151c;
  overflow: hidden;
  border: 1px solid #26313d;
}

.pl-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.pl-bar-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--pl-text);
}

.pl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pl-btn {
  border: 1px solid #3c4a5b;
  background: var(--pl-surface-2);
  color: var(--pl-text);
  border-radius: 8px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.pl-btn:hover:not(:disabled) {
  border-color: #55697f;
  background: #26313d;
}

.pl-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pl-btn-primary {
  background: var(--pl-accent);
  border-color: #e08a4f;
  color: #23150c;
  font-weight: 700;
}

.pl-btn-primary:hover:not(:disabled) {
  background: #e08a4f;
}

.pl-btn-tiny {
  padding: 3px 9px;
  font-size: 12px;
}

.pl-list {
  display: grid;
  gap: 8px;
}

.pl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--pl-line);
  border-radius: 10px;
  padding: 9px 12px;
  background: #171d25;
}

.pl-item-main {
  min-width: 0;
}

.pl-item-name {
  font-size: 13px;
  font-weight: 600;
}

.pl-item-desc {
  font-size: 12px;
  color: var(--pl-dim);
}

.pl-log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
  font-size: 12.5px;
}

.pl-log li {
  color: #b9c8d8;
  border-left: 2px solid #2b3a4a;
  padding-left: 9px;
}

.pl-log li.is-warn {
  border-left-color: var(--pl-warn);
  color: #e8d5a8;
}

.pl-log time {
  color: #6f7f91;
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
}

.pl-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--pl-dim);
}

.pl-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 15, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.pl-overlay-card {
  background: var(--pl-surface);
  border: 1px solid var(--pl-line);
  border-radius: 14px;
  padding: 22px;
  width: min(360px, 90vw);
}

.pl-overlay-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.pl-overlay-card input {
  width: 100%;
  margin: 14px 0 4px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #3c4a5b;
  background: #10151c;
  color: var(--pl-text);
  font: inherit;
}

.pl-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #22303d;
  border: 1px solid #3c4a5b;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  z-index: 60;
  max-width: 80vw;
}

@media (max-width: 900px) {
  .pl-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .pl-room-col {
    position: static;
  }
  .pl-room-host .phone {
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
  }
}
