/* ============================================================
   TN-Meeting · 会议系统样式
   视觉规范沿用 GJ.html（黑灰主调 + 橙底白字导航 + PingFang）
   ============================================================ */

:root {
  --ink:    #000000;
  --panel:  #0a0a0a;
  --panel2: #141414;
  --line:   #1a1a1a;
  --line2:  #2a2a2a;
  --line3:  #3a3a3a;
  --neon1:  #ffffff;
  --neon2:  #cccccc;
  --neon3:  #888888;
  --muted:  #6a6a6a;
  --orange: #8b46d9;
  --orange2:#a96be8;
  --green:  #2cd87a;
  --red:    #ff4d4f;
  --blue:   #3b82f6;
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; height:100%; }
body {
  background: var(--ink);
  color: var(--neon1);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 导航（沿用 gz-orange-nav） ---------- */
.gz-orange-nav {
  background: var(--orange);
  color: #ffffff !important;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
}
.gz-orange-nav .nav-link {
  color: #ffffff !important;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background .15s ease;
}
.gz-orange-nav .nav-link:hover {
  background: rgba(0,0,0,.12);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 96px 24px 64px;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(139,70,217,.18), transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(169,107,232,.10), transparent 60%);
}
.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: -.02em;
  margin: 0 0 16px;
  background: linear-gradient(180deg, #ffffff 0%, #cccccc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: clamp(14px, 1.6vw, 18px);
  color: var(--neon3);
  margin: 0 auto;
  max-width: 640px;
}

/* ---------- Pill 标签（沿用 GJ pill） ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  font-size: 13px;
  color: var(--neon2);
  background: rgba(255,255,255,.02);
}
.pill__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .5; transform: scale(.8); }
}

/* ---------- 卡片（创建/加入会议） ---------- */
.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel2) 100%);
  border: 1px solid var(--line2);
  border-radius: 16px;
  padding: 28px;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
}
.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--neon1);
}
.card p {
  font-size: 13px;
  color: var(--neon3);
  margin: 0 0 20px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.btn-primary {
  background: var(--orange);
  color: #fff;
  width: 100%;
}
.btn-primary:hover { background: var(--orange2); }
.btn-primary:active { transform: scale(.98); }

.btn-secondary {
  background: var(--panel2);
  color: var(--neon1);
  border: 1px solid var(--line2);
}
.btn-secondary:hover { border-color: var(--line3); }

.btn-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--panel2);
  color: var(--neon1);
  border: 1px solid var(--line2);
}
.btn-icon:hover { border-color: var(--orange); }
.btn-icon.active { background: var(--orange); border-color: var(--orange); }
.btn-icon.danger { background: var(--red); border-color: var(--red); }

/* ---------- 输入框 ---------- */
.input {
  width: 100%;
  padding: 12px 14px;
  background: var(--ink);
  border: 1px solid var(--line2);
  border-radius: 10px;
  color: var(--neon1);
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s ease;
}
.input:focus {
  outline: none;
  border-color: var(--orange);
}

/* ---------- 房间号徽章 ---------- */
.room-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--panel2);
  border: 1px dashed var(--orange);
  border-radius: 8px;
  font-family: "SF Mono", "JetBrains Mono", monospace;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--orange);
}

/* ---------- 特性网格 ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.feature {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  transition: border-color .2s ease;
}
.feature:hover { border-color: var(--line3); }
.feature-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(139,70,217,.2), rgba(169,107,232,.05));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  font-size: 20px;
}
.feature h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--neon1);
}
.feature p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ---------- 历史会议列表 ---------- */
.history-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  color: var(--neon2);
  transition: border-color .15s ease;
}
.history-item:hover { border-color: var(--line3); }
.history-item .room-code {
  font-family: "SF Mono", monospace;
  color: var(--orange);
  font-weight: 600;
}

/* ============================================================
   room.html · 会议室
   ============================================================ */

.room-shell {
  display: grid;
  grid-template-rows: 56px 1fr 80px;
  grid-template-columns: 1fr 280px;
  grid-template-areas:
    "topbar topbar"
    "stage  sidebar"
    "controls sidebar";
  height: 100vh;
  background: var(--ink);
}

.room-topbar {
  grid-area: topbar;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}
.room-topbar .room-id {
  font-family: "SF Mono", monospace;
  font-weight: 700;
  color: var(--orange);
  font-size: 16px;
  letter-spacing: .12em;
}
.room-topbar .rec-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: pulse 1.5s ease-in-out infinite;
}
.room-topbar .timer {
  margin-left: auto;
  font-family: "SF Mono", monospace;
  color: var(--neon2);
  font-size: 14px;
}

.room-stage {
  grid-area: stage;
  background: #050505;
  display: flex;           /* v34: 改 flex, 不需要 grid (v31 已清空 dynamic tile) */
  position: relative;
  overflow: hidden;
  /* v34: stage 容器按 4:3 显示, 大窗铺满 stage (无黑边) */
  aspect-ratio: 4/3;
  max-width: 100%;
  max-height: 100%;
  margin: auto;            /* 在父 grid area 内居中 */
}
.participant-tile {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.participant-tile.main {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}
/* 9-16 v0.3: TRTC 远端视频 tile (多格排列) */
.participant-tile.trtc-tile {
  /* 跟普通 tile 一样, 但 grid 自动多列 */
}
.participant-tile.trtc-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
}

/* v25: 屏幕流大窗 — 绝对定位铺满整个 stage 区域 (inset:0), 不被 grid 切成小格
 *   参考腾讯会议: 屏幕共享时屏幕流占主区域, 摄像头流被覆盖 (简化版, 后期可做 PiP 角落小窗)
 *   关键: inline style 不能设 position/width/height, 否则会覆盖这条规则 (specificity 永远赢 inline) */
#screenStage,
#cameraStage {       /* v32: 摄像头流大窗跟屏幕流同结构, 互斥显示 */
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #050505;
  display: flex;            /* v34: 拉伸填满 stage (stage 容器已是 4:3) */
  align-items: stretch;
  justify-content: stretch;
}
#screenStage .participant-tile.screen-tile,
#cameraStage .participant-tile.camera-tile {    /* v34: 铺满 stage 容器 (无黑边) */
  width: 100%;
  height: 100%;
  aspect-ratio: auto;       /* v34: 跟随 stage 4:3 (stage 容器按 4/3 显示) */
  border: none;
  background: #000;
}
#screenStage video,
#cameraStage video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;   /* v34: 视频铺满不留黑边 */
  background: #000;
}
}
.participant-tile .avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--orange2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
}
.participant-tile.main .avatar {
  width: 140px; height: 140px;
  font-size: 56px;
}
.participant-tile .name-tag {
  position: absolute;
  bottom: 10px; left: 10px;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #fff;
}
.participant-tile .mic-status {
  position: absolute;
  top: 10px; right: 10px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.participant-tile .mic-status.muted { color: var(--red); }
.participant-tile .mic-status.live  { color: var(--green); }

.placeholder-tile {
  border: 1px dashed var(--line3);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

.room-sidebar {
  grid-area: sidebar;
  background: var(--panel);
  border-left: 1px solid var(--line);
  overflow-y: auto;
}
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.sidebar-tabs button {
  flex: 1;
  padding: 12px 0;
  background: transparent;
  border: none;
  color: var(--neon3);
  font-size: 13px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.sidebar-tabs button.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}
.sidebar-panel { padding: 12px; }
.participant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--neon2);
}
.participant-row:hover { background: var(--line); }
.participant-row .mini-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--orange2));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}

.room-controls {
  grid-area: controls;
  background: var(--panel);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
}

.captions {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(12px);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 16px;
  color: #fff;
  text-align: center;
  border: 1px solid var(--line2);
  display: none;
}
.captions.show { display: block; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .room-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr auto 80px;
    grid-template-areas:
      "topbar"
      "stage"
      "sidebar"
      "controls";
  }
  .room-sidebar {
    border-left: none;
    border-top: 1px solid var(--line);
    max-height: 200px;
  }
}

/* ---------- 模态框 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 16px;
  padding: 32px;
  max-width: 440px;
  width: 90%;
}
.modal h3 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
}

/* ============================================================
   白板 (原生 Canvas)
   ============================================================ */
.wb-modal {
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 12px;
  width: 92vw;
  height: 88vh;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wb-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  background: var(--panel);
}
.wb-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--panel2);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.wb-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-right: 1px solid var(--line);
}
.wb-group:last-child { border-right: none; }
.wb-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--neon2);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.wb-btn:hover {
  background: var(--line);
  border-color: var(--line2);
}
.wb-btn.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}
.wb-btn-primary {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}
.wb-btn-primary:hover {
  background: var(--orange2);
}
.wb-color {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.wb-color:hover { transform: scale(1.15); }
.wb-color.active {
  border-color: var(--orange);
  transform: scale(1.1);
}
.wb-width {
  width: 36px;
  height: 28px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--neon2);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
}
.wb-width:hover { background: var(--line); }
.wb-width.active {
  background: var(--line);
  border-color: var(--orange);
  color: var(--orange);
}
.wb-canvas-wrap {
  flex: 1;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

/* v27: 实况视图 (右侧栏 tab) — grid 2 列, 显示所有人摄像头实时视频 */
.live-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
}
.live-tile {
  position: relative;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.live-tile.me {
  border-color: var(--orange);   /* 自己的 tile 用紫色边框区分 */
}
.live-container {
  width: 100%;
  height: 100%;
  background: #000;
}
.live-container video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}
.live-name-tag {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.75);
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  max-width: calc(100% - 32px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-mic {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.75);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1;
}
.live-mic.off {
  opacity: 0.6;
}
.live-tile.selected {                            /* v32: 实况选中态 — 跟 share-tile.selected 同样视觉 */
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(139, 70, 217, 0.5);
  position: relative;
}
.live-tile.selected::after {
  content: '✦ 放大';
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  z-index: 2;
}
.live-tile:hover {
  border-color: var(--orange2);
  transform: scale(1.02);
  transition: transform .15s ease;
}

/* v28: 共享视图 (右侧栏 tab) — grid 2 列, 显示所有人屏幕共享内容 */
.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
}
.share-tile {
  position: relative;
  aspect-ratio: 16/9;     /* 屏幕流一般是 16:9, 跟摄像头 4:3 区分 */
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-tile.me {
  border-color: var(--orange);   /* 自己的屏幕流用紫色边框 */
}
.share-tile.selected {
  border-color: var(--orange);                        /* v30: 选中状态 — 紫色边框 */
  box-shadow: 0 0 0 2px rgba(139, 70, 217, 0.5);     /* 加紫色光晕 */
  position: relative;
}
.share-tile.selected::after {                          /* 角标 */
  content: '✦ 放大';
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.share-tile:hover {
  border-color: var(--orange2);
  transform: scale(1.02);                              /* 悬停轻微放大提示可点击 */
  transition: transform .15s ease;
}
.share-container {
  width: 100%;
  height: 100%;
  background: #000;
}
.share-container video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;  /* 屏幕内容按比例完整显示 */
  display: block;
  background: #000;
}
.share-name-tag {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.75);
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  max-width: calc(100% - 16px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}