/* ============================================================
 *  家庭打卡系统 - 电视大屏展示样式
 *  设计尺寸：1920 × 1080 (16:9)
 *  原则：大字体、高对比、远距离可读
 * ============================================================ */

/* ========== 基础 & 背景 ========== */
.tv-body {
  background: linear-gradient(135deg, #1A1A2E 0%, #16213E 50%, #0F3460 100%);
  color: #fff;
  min-height: 100vh;
  overflow: hidden;
  background-attachment: fixed;
}

#tv-app {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 30px 60px;
}

/* ========== 顶部栏 ========== */
.tv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

.tv-header-left {
  flex: 1;
}

.tv-logo {
  font-size: 40px;
  font-weight: 700;
  background: linear-gradient(135deg, #FFD700, #FF8C42);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tv-header-center {
  flex: 1;
  text-align: center;
}

.tv-date {
  font-size: 36px;
  font-weight: 600;
}

.tv-weekday {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

.tv-header-right {
  flex: 1;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.tv-time {
  font-size: 56px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", monospace;
  letter-spacing: 2px;
  line-height: 1;
}

.tv-refresh-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.5);
}

.refresh-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #52C41A;
  box-shadow: 0 0 8px rgba(82, 196, 26, 0.6);
  animation: pulse 2s ease-in-out infinite;
}

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

/* ========== 用户选择条 ========== */
.tv-user-bar {
  margin-bottom: 24px;
}

.tv-user-tabs {
  display: flex;
  gap: 16px;
}

.tv-user-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tv-user-tab:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tv-user-tab.active {
  background: rgba(255, 140, 66, 0.2);
  border-color: #FF8C42;
  box-shadow: 0 0 24px rgba(255, 140, 66, 0.3);
}

.tv-user-tab-avatar {
  font-size: 36px;
}

.tv-user-tab-name {
  font-size: 24px;
  font-weight: 600;
}

.tv-user-tab-stars {
  font-size: 20px;
  color: #FFD700;
  margin-left: 8px;
}

/* ========== 主内容区 ========== */
.tv-main {
  flex: 1;
  display: flex;
  gap: 40px;
  min-height: 0;
}

/* ========== 左侧边栏 ========== */
.tv-sidebar {
  width: 420px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* 用户卡片 */
.tv-user-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 28px;
  padding: 40px 32px;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tv-user-avatar {
  font-size: 80px;
  margin-bottom: 16px;
}

.tv-user-name {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 24px;
}

.tv-stars-display {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tv-stars-icon {
  filter: drop-shadow(0 4px 16px rgba(255, 215, 0, 0.5));
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}

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

.tv-stars-number {
  font-size: 72px;
  font-weight: 700;
  color: #FFD700;
  line-height: 1;
  text-shadow: 0 2px 20px rgba(255, 215, 0, 0.4);
}

.tv-stars-label {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 8px;
}

/* 统计卡片 */
.tv-stats-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 28px;
  padding: 32px;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tv-stats-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 24px;
}

.tv-stats-circle {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 20px;
}

.progress-ring {
  width: 100%;
  height: 100%;
}

.progress-ring circle:nth-child(2) {
  transition: stroke-dashoffset 0.8s ease;
}

.tv-stats-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.tv-stats-percent {
  font-size: 48px;
  font-weight: 700;
  color: #52C41A;
  line-height: 1;
}

.tv-stats-count {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

.tv-stats-stars {
  font-size: 26px;
  color: #FFD700;
  font-weight: 600;
}

/* ========== 任务区 ========== */
.tv-task-section {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.tv-task-header {
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 16px;
}

.tv-task-title {
  font-size: 40px;
  font-weight: 700;
}

.tv-task-count {
  font-size: 32px;
  font-weight: 600;
  color: #FFD700;
}

.tv-task-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  padding-right: 12px;
  padding-right: 8px;
}

/* 滚动条 */
.tv-task-list::-webkit-scrollbar {
  width: 6px;
}

.tv-task-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.tv-task-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* 任务卡片 */
.tv-task-item {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.tv-task-item.completed {
  opacity: 0.55;
  border-color: rgba(82, 196, 26, 0.3);
  background: rgba(82, 196, 26, 0.08);
}

.tv-task-item.failed {
  border-color: rgba(255, 77, 79, 0.3);
  background: rgba(255, 77, 79, 0.08);
}

.tv-task-check {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: all 0.3s ease;
}

.tv-task-item.completed .tv-task-check {
  background: #52C41A;
  border-color: #52C41A;
  box-shadow: 0 0 16px rgba(82, 196, 26, 0.5);
}

.tv-task-item.failed .tv-task-check {
  background: #FF4D4F;
  border-color: #FF4D4F;
}

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

.tv-task-name {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tv-task-item.completed .tv-task-name {
  text-decoration: line-through;
}

.tv-task-meta {
  display: flex;
  gap: 20px;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.6);
  flex-wrap: wrap;
}

.tv-task-meta .duration {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tv-task-star {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 28px;
  font-weight: 700;
  color: #FFD700;
}

.tv-task-star svg {
  filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.6));
}

/* 状态标签（电视端） */
.tv-status-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 500;
  margin-left: 12px;
}

.tv-status-completed {
  background: rgba(82, 196, 26, 0.2);
  color: #52C41A;
}

.tv-status-failed {
  background: rgba(255, 77, 79, 0.2);
  color: #FF4D4F;
}

/* 加载中 */
.tv-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.tv-loading .spinner-ring {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #FF8C42;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 空状态 */
.tv-empty {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.4);
}

.tv-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.tv-empty-text {
  font-size: 24px;
}

/* ========== 底部 ========== */
.tv-footer {
  text-align: center;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tv-footer-text {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 2px;
}

/* ========== 数据刷新动画 ========== */
.tv-fade-in {
  animation: tvFadeIn 0.6s ease;
}

@keyframes tvFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 星星数字变化高亮 */
.stars-highlight {
  animation: starHighlight 1s ease;
}

@keyframes starHighlight {
  0% { transform: scale(1); }
  50% {
    transform: scale(1.15);
    color: #FFD700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
  }
  100% { transform: scale(1); }
}
