/* ============================================================
   济源语音房 — 公共样式
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #E85D75;
  --primary-light: #f76565;
  --accent-purple: #7C5CFC;
  --accent-orange: #FD6E34;
  --gold:          #FFC107;
  --live-red:      #FF4757;
  --online-green:  #4ECDC4;
  --mint:          #98D8C8;

  --text-dark:     #333333;
  --text-mid:      #666666;
  --text-light:    #999999;

  --bg-white:      #FFFFFF;
  --bg-light:      #F8F8F8;
  --bg-screen:     #FEF8F0;

  --font-main:     "PingFang SC", "Helvetica Neue", "Inter", system-ui, sans-serif;
}

body {
  font-family: var(--font-main);
  background: #e8e8e8;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* 顶部状态栏安全区：占位给系统状态栏/刘海，真机用 env 适配 */
.status-safe {
  width: 100%;
  flex-shrink: 0;
  height: constant(safe-area-inset-top);
  height: env(safe-area-inset-top, 0px);
  min-height: constant(safe-area-inset-top);
  min-height: env(safe-area-inset-top, 0px);
  pointer-events: none;
}

/* 手机外壳 */
.phone {
  width: 589px;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  background: #FFF;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 0;
}

@media (max-width: 600px) {
  .phone {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
  body {
    display: block;
    align-items: stretch;
  }
}

/* ============================================================
   入口页样式
   ============================================================ */
.entry-bg {
  background: linear-gradient(160deg, #FDBD9A 0%, #FEA972 30%, #E85D75 70%, #C44D6A 100%);
}

.entry-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 28px 40px;
  text-align: center;
}

.entry-logo {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.entry-title {
  font-size: 26px;
  font-weight: 700;
  color: #FFF;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.entry-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 36px;
}

/* 导航网格 */
.nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  max-width: 480px;
  margin-bottom: 24px;
}

.nav-grid .full-width {
  grid-column: 1 / -1;
}

.nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  color: #FFF;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.nav-card:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.nav-card:active {
  transform: scale(0.97);
  transition: transform 0.1s;
}

.nav-card .icon {
  font-size: 32px;
  line-height: 1;
}

.nav-card .label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav-card .desc {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
}

/* 入口底部信息 */
.entry-footer {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: auto;
}

/* ============================================================
   页面通用标题栏
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  flex-shrink: 0;
}

.page-header .back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  text-decoration: none;
  color: var(--text-dark);
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.page-header .back-btn:hover { background: rgba(0,0,0,0.14); }

.page-header .page-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dark);
}

.page-header .spacer { width: 36px; }  /* 占位保持标题居中 */

/* 页面内容容器 */
.page-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

/* ============================================================
   底部 TabBar 导航
   ============================================================ */
.tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(80px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #FFFFFF;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid rgba(0,0,0,0.05);
  z-index: 100;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  padding: 6px 10px;
  transition: opacity 0.15s;
}

.tab-item:hover { opacity: 0.7; }

.tab-item .tab-icon {
  font-size: 20px;
  line-height: 1;
}

.tab-item .tab-label {
  font-size: 10px;
  font-weight: 500;
  color: #B0BEC5;
}

/* 当前页高亮 */
.tab-item.active .tab-label {
  color: #f76565;
  font-weight: 600;
}

/* ============================================================
   统一底部菜单：首页 / 动态 / 房间 / 消息 / 我的
   ============================================================ */
.app-tabbar {
  flex-shrink: 0;
  width: 100%;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  background: #FFFFFF;
  border-top: 1px solid #F0F0F0;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

/* 手机壳内始终贴底，避免随 page-body 滚动 */
.phone .app-tabbar,
.app-tabbar.fixed,
.app-tabbar[data-fixed="1"] {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}

.app-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
  padding: 2px 4px;
  cursor: pointer;
}

.app-tab-label {
  font-size: 12px;
  font-weight: 500;
  color: #999999;
  line-height: 1.2;
  white-space: nowrap;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.app-tab.active .app-tab-label {
  color: #E85D75;
  font-weight: 600;
}

.app-tab-dyn-icon {
  width: 28px;
  height: 26px;
  background: url("../assets/tab-dynamic.png") center/contain no-repeat;
}

.app-tab.active .app-tab-dyn-icon {
  filter: none;
  opacity: 1;
}

.app-tab:not(.active) .app-tab-dyn-icon {
  opacity: 0.85;
}

/* 设计稿 TabBar：底部安全区 */
[data-pencil-name="TabBar"] {
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  height: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
  box-sizing: border-box !important;
}
