﻿:root {
  --douyin-red: #FE2C55;
  --douyin-blue: #25F4EE;
  --douyin-bg: #000000;
  --douyin-text-primary: #FFFFFF;
  --douyin-text-secondary: rgba(255, 255, 255, 0.7);
  --douyin-text-tertiary: rgba(255, 255, 255, 0.5);
  --douyin-border: rgba(255, 255, 255, 0.12);
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --top-nav-height: 44px;
  --bottom-tab-height: 49px;
  --tab-active-font-size: 19px;
  --tab-normal-font-size: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--douyin-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'SF Pro Text', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: var(--douyin-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  width: 100%;
  height: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--douyin-bg);
}

/* 顶部导航 */
.top-nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: calc(var(--top-nav-height) + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 12px;
  padding-right: 12px;
  z-index: 100;
}

.top-nav-left,
.top-nav-right {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.tab-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
}

.tab-nav .tab-item {
  font-size: var(--tab-normal-font-size);
  color: var(--douyin-text-secondary);
  font-weight: 500;
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  letter-spacing: 0.5px;
}

.tab-nav .tab-item.active {
  color: var(--douyin-text-primary);
  font-size: var(--tab-active-font-size);
  font-weight: 600;
}

.tab-arrow {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
}

/* 视频容器 */
.video-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.video-slide {
  width: 100%;
  height: 100%;
}

.video-card {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.video-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-cover {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(180deg, rgba(26, 26, 46, 1) 0%, rgba(22, 33, 62, 1) 50%, rgba(15, 52, 96, 1) 100%);
  transition: opacity 0.3s ease;
}

.video-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
  pointer-events: none;
}

/* 右侧交互按钮 */
.side-actions {
  position: absolute;
  right: 12px;
  bottom: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 10;
}

.side-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.side-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #fff;
  overflow: visible;
  position: relative;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.follow-plus {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: var(--douyin-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(254, 44, 85, 0.4);
}

.like-icon,
.comment-icon,
.share-icon {
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
  transition: all 0.2s ease;
}

.side-count {
  font-size: 12px;
  color: var(--douyin-text-primary);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  font-weight: 400;
}

.music-action {
  margin-top: 4px;
}

.music-disc {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #333;
  padding: 2px;
  animation: rotate 5s linear infinite;
}

.disc-outer {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #444;
}

.disc-inner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* 底部用户信息 */
.bottom-info {
  position: absolute;
  left: 12px;
  right: 80px;
  bottom: 72px;
  z-index: 10;
}

.user-info-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.user-at {
  font-size: 15px;
  font-weight: 700;
  color: var(--douyin-text-primary);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.user-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--douyin-text-primary);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.video-desc-row {
  max-width: 260px;
  margin-bottom: 10px;
}

.desc-text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--douyin-text-primary);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.music-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.music-icon-small {
  color: var(--douyin-text-primary);
}

.music-marquee {
  overflow: hidden;
  max-width: 180px;
}

.marquee-text {
  font-size: 13px;
  color: var(--douyin-text-primary);
  white-space: nowrap;
  display: inline-block;
  animation: marquee 8s linear infinite;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* 进度条 */
.progress-bar {
  position: absolute;
  bottom: 49px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,0.15);
  z-index: 50;
}

.progress-fill {
  height: 100%;
  background: var(--douyin-text-primary);
  width: 0%;
  border-radius: 1px;
  transition: width 0.1s linear;
}

/* 页面通用 */
.page {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(calc(-50% + 100%));
  width: 100%;
  max-width: 430px;
  height: 100%;
  background: var(--douyin-bg);
  z-index: 200;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page.active {
  transform: translateX(-50%);
}

/* 搜索页面 */
.page-search {
  background: #121212;
}

.search-header {
  position: sticky;
  top: 0;
  background: #121212;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: calc(8px + var(--safe-top));
  z-index: 10;
}

.search-input-wrap {
  flex: 1;
  height: 36px;
  background: #2a2a2a;
  border-radius: 18px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-icon {
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--douyin-text-primary);
  font-size: 15px;
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--douyin-text-tertiary);
}

.search-cancel {
  background: none;
  border: none;
  color: var(--douyin-text-primary);
  font-size: 15px;
  cursor: pointer;
  padding: 8px;
  font-family: inherit;
}

.search-content {
  padding: 20px 16px;
}

.hot-search-section {
  margin-top: 8px;
}

.hot-search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.hot-search-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--douyin-text-primary);
}

.refresh-icon {
  color: var(--douyin-text-tertiary);
}

.hot-list {
  display: flex;
  flex-direction: column;
}

.hot-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--douyin-border);
}

.hot-rank {
  width: 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--douyin-text-tertiary);
  text-align: center;
  flex-shrink: 0;
}

.hot-rank.rank-1 {
  color: var(--douyin-red);
}

.hot-rank.rank-2 {
  color: #FF6B6B;
}

.hot-rank.rank-3 {
  color: #FFA94D;
}

.hot-text {
  flex: 1;
  font-size: 15px;
  color: var(--douyin-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.hot-badge.hot {
  background: var(--douyin-red);
  color: #fff;
}

.hot-badge.new {
  background: #3B82F6;
  color: #fff;
}

.hot-badge.top {
  background: #FF9500;
  color: #fff;
}

/* 消息页面 */
.page-message {
  background: var(--douyin-bg);
}

.message-header {
  position: sticky;
  top: 0;
  background: var(--douyin-bg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--douyin-border);
  padding-top: calc(12px + var(--safe-top));
  z-index: 10;
}

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

.message-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--douyin-text-primary);
}

.message-header-right {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-content {
  padding-bottom: calc(var(--bottom-tab-height) + var(--safe-bottom) + 8px);
}

.message-shortcuts {
  display: flex;
  padding: 16px;
  border-bottom: 1px solid var(--douyin-border);
}

.shortcut-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.shortcut-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.system-notify {
  background: linear-gradient(135deg, #FF6B6B 0%, var(--douyin-red) 100%);
}

.interact-notify {
  background: linear-gradient(135deg, #FFA94D 0%, #FF6B6B 100%);
}

.fan-notify {
  background: linear-gradient(135deg, #4ECDC4 0%, #44CF6C 100%);
}

.comment-notify {
  background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
}

.shortcut-text {
  font-size: 11px;
  color: var(--douyin-text-secondary);
}

.shortcut-badge {
  position: absolute;
  top: -2px;
  right: calc(50% - 26px);
  background: var(--douyin-red);
  color: #fff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  font-weight: 600;
}

.message-list {
  padding: 4px 0;
}

.message-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
}

.message-item:active {
  background: rgba(255,255,255,0.05);
}

.message-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-info {
  flex: 1;
  min-width: 0;
}

.message-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--douyin-text-primary);
  margin-bottom: 4px;
}

.message-preview {
  font-size: 13px;
  color: var(--douyin-text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-meta {
  flex-shrink: 0;
}

.message-time {
  font-size: 12px;
  color: var(--douyin-text-tertiary);
}

/* 个人中心页面 */
.page-profile {
  background: var(--douyin-bg);
}

.profile-header-bg {
  height: 160px;
  background: linear-gradient(180deg, #1A1A2E 0%, #16213E 50%, #0F3460 100%);
  position: relative;
}

.profile-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(44px + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: 16px;
  padding-right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.profile-content {
  padding: 0 16px calc(var(--bottom-tab-height) + var(--safe-bottom) + 16px);
  margin-top: -52px;
  position: relative;
}

.profile-avatar-section {
  text-align: center;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 3px solid #fff;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.avatar-placeholder-large {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--douyin-text-primary);
  margin-bottom: 6px;
}

.profile-id {
  font-size: 13px;
  color: var(--douyin-text-tertiary);
  margin-bottom: 12px;
}

.profile-edit-btn {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  color: var(--douyin-text-primary);
  font-size: 13px;
  padding: 6px 20px;
  border-radius: 16px;
  font-weight: 500;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 24px;
  padding: 16px 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-num {
  font-size: 19px;
  font-weight: 600;
  color: var(--douyin-text-primary);
}

.stat-label {
  font-size: 12px;
  color: var(--douyin-text-tertiary);
}

.profile-tabs {
  display: flex;
  justify-content: center;
  gap: 72px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--douyin-border);
}

.profile-tab {
  width: 36px;
  height: 36px;
  color: var(--douyin-text-tertiary);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 12px;
}

.profile-tab.active {
  color: var(--douyin-text-primary);
}

.profile-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--douyin-text-primary);
  border-radius: 1.5px;
}

.profile-tab svg {
  width: 22px;
  height: 22px;
}

.profile-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 0 32px;
}

.empty-icon-svg {
  margin-bottom: 12px;
}

.profile-empty p {
  font-size: 14px;
  color: var(--douyin-text-tertiary);
}

/* 底部导航栏 */
.bottom-tab {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: calc(var(--bottom-tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: var(--douyin-bg);
  border-top: 1px solid var(--douyin-border);
  z-index: 150;
}

.bottom-tab .tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
  cursor: pointer;
  padding-top: 6px;
}

.tab-icon {
  width: 26px;
  height: 26px;
}

.tab-text {
  font-size: 10px;
  color: var(--douyin-text-tertiary);
  line-height: 1;
}

.bottom-tab .tab-item.active .tab-text {
  color: var(--douyin-text-primary);
  font-weight: 500;
}

.publish-tab {
  position: relative;
}

.publish-btn-wrap {
  width: 46px;
  height: 30px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.publish-bg-left {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--douyin-blue);
  border-radius: 6px 0 0 6px;
}

.publish-bg-right {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--douyin-red);
  border-radius: 0 6px 6px 0;
}

.publish-bg-center {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  bottom: 0;
  background: var(--douyin-text-primary);
  border-radius: 6px;
}

.publish-plus {
  position: relative;
  z-index: 1;
}

.tab-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 26px);
  background: var(--douyin-red);
  color: #fff;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 8px;
  min-width: 14px;
  text-align: center;
  font-weight: 600;
  line-height: 14px;
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* 响应式 */
@media (max-width: 430px) {
  #app {
    max-width: 100%;
  }
  
  .top-nav,
  .bottom-tab,
  .page {
    max-width: 100%;
    left: 0;
    transform: none;
  }
  
  .page.active {
    transform: none;
  }
}

/* 版本号标记 */
.20260524.140131-badge {
  position: fixed;
  bottom: calc(var(--bottom-tab-height) + var(--safe-bottom) + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 140;
  pointer-events: none;
  opacity: 0.6;
}

.20260524.140131-text {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
  letter-spacing: 0.5px;
}

.20260524.140131-date {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 400;
}
