* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #ff4757;
  --primary-dark: #e8424e;
  --secondary: #ff6b81;
  --dark: #0a0a0f;
  --darker: #050508;
  --surface: #12121a;
  --surface-2: #1a1a25;
  --light: #ffffff;
  --gray: #8892b0;
  --success: #2ed573;
  --gradient: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
}

html, body {
  height: 100%;
}

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--darker);
  color: var(--light);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 600px;
  margin: 0 auto;
  background: var(--dark);
}

/* 顶部导航 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(180deg, var(--surface) 0%, transparent 100%);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  font-size: 24px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
}

.online-count {
  background: rgba(46, 213, 115, 0.2);
  color: var(--success);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

/* 主内容区 */
.main-content {
  flex: 1;
  padding: 10px 12px 80px;
}

/* 两列布局 */
.anchors-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* 主播卡片 */
.anchor-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  aspect-ratio: 3/4;
}

.anchor-card:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 25px rgba(255, 71, 87, 0.3);
}

.anchor-card:active {
  transform: scale(0.98);
}

/* 封面图 */
.anchor-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.anchor-card:hover .anchor-cover {
  transform: scale(1.05);
}

/* 默认封面（无图片时） */
.anchor-cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

/* 直播标识 */
.live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: liveGlow 2s infinite;
}

@keyframes liveGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 71, 87, 0.5); }
  50% { box-shadow: 0 0 15px rgba(255, 71, 87, 0.8); }
}

.live-dot {
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* 信息区域 */
.anchor-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 10px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
}

.anchor-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anchor-viewers {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  gap: 4px;
}

.viewer-icon {
  font-size: 10px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state.hidden {
  display: none;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state p {
  color: var(--gray);
  font-size: 16px;
}

.empty-hint {
  margin-top: 8px;
  font-size: 14px !important;
}

/* 加载状态 */
.loading-state {
  text-align: center;
  padding: 80px 20px;
}

.loading-state.hidden {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state p {
  color: var(--gray);
}

/* 底部提示 */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, var(--dark) 0%, transparent 100%);
  padding: 20px;
  text-align: center;
}

.footer p {
  background: var(--gradient);
  display: inline-block;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(255, 71, 87, 0.4);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* 响应式 - 超小屏幕单列 */
@media (max-width: 320px) {
  .anchors-grid {
    grid-template-columns: 1fr;
  }
}

/* 大屏幕优化 */
@media (min-width: 600px) {
  .app-container {
    border-left: 1px solid var(--surface-2);
    border-right: 1px solid var(--surface-2);
  }
  
  .footer {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
  }
}

