/* shared/css/base.css — 共享设计令牌与基础重置
 * 浅色为默认主题（:root），深色通过 <html class="dark"> 启用。
 * 语义变量命名与取值参考 monitor.css 的令牌风格。 */

/* ── 基础重置 ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── 设计令牌：浅色主题（:root） ──
 * v0.3.60 统一配色：以原前端（styles.css）配色为唯一标准。
 * 前端外观不变；dev 后台（只引 base.css）跟随统一。 */
:root {
  --bg: #f4f4f4;        /* 页面背景 */
  --card: #ffffff;      /* 卡片/容器背景 */
  --txt: #333333;       /* 主文本 */
  --acc: #409eff;       /* 强调色 */
  --ok: #67c23a;        /* 成功/正常 */
  --warn: #e6a23c;      /* 警告 */
  --bad: #f56c6c;       /* 错误/异常 */
  --line: #e8e8e8;      /* 边框/分隔线 */
  --dim: #666666;       /* 次要说明文字 */
  /* ── 衍生令牌 ── */
  --bg-soft: #eeeeee;   /* 未选中/次级表面 */
  --txt-meta: #999999;  /* 三级说明文字 */
  --cover: #222222;     /* 视频封面占位底色 */
  --img-ph: #f2f3f5;    /* 图片加载占位底色 */
  --ink: #ffffff;       /* 深色/彩色底上的白字 */
  --card-media: #ffffff;/* 视频大卡/小卡背景 */
  --scroll-track: #f1f1f1;
  --scroll-thumb: #888888;
  --scroll-thumb-hover: #555555;
  /* ── 反转面（激活胶囊/开关按钮，随主题翻转） ── */
  --pill-bg: #333333;
  --pill-fg: #ffffff;
  --toggle-bg: #333333;
  --toggle-fg: #ffffff;
  /* ── 深色按钮（查看个人页面）反转面 ── */
  --btn-inv-bg: #333333;
  --btn-inv-fg: #ffffff;
  --btn-inv-hover: #555555;
  /* ── 组件级：成员角标特殊色相 ── */
  --badge-purple: #9370db;
  --badge-teal: #17c3b2;
}

/* ── 设计令牌：深色主题（html.dark） ── */
html.dark {
  --bg: #121212;
  --card: #222222;
  --txt: #eeeeee;
  --acc: #409eff;
  --ok: #67c23a;
  --warn: #e6a23c;
  --bad: #f56c6c;
  --line: #333333;
  --dim: #cccccc;
  --bg-soft: #333333;
  --txt-meta: #aaaaaa;
  --cover: #222222;
  --img-ph: #232323;
  --ink: #ffffff;
  --card-media: #1e1e1e;
  --scroll-track: #333333;
  --scroll-thumb: #666666;
  --scroll-thumb-hover: #888888;
  --pill-bg: #ffffff;
  --pill-fg: #222222;
  --toggle-bg: #eeeeee;
  --toggle-fg: #333333;
  --btn-inv-bg: #eeeeee;
  --btn-inv-fg: #222222;
  --btn-inv-hover: #cccccc;
}

/* ==================== 公共组件样式（从 styles.css 移入） ==================== */

/* 深色模式导航栏及链接 */
html.dark .nav {
    background: var(--card);
}

html.dark .nav a {
    background: var(--bg-soft); /* 未选中项背景色，比导航栏深一级 */
	color: var(--txt);
}

/* 深色模式导航激活项反色 */
html.dark .nav a.active {
    background: var(--pill-bg);
	color: var(--pill-fg);
}

/* 深色模式页脚 */
html.dark footer {
    background: var(--card);
	color: var(--txt);
}

/* --------------------------
   顶部固定导航栏 公用样式
   -------------------------- */

/* v0.4.4 首页「点赞领奖台」：右上角下拉 3 头像（中 1 名最大 / 左 2 名 / 右 3 名）
   状态机：data-state=open（展开）/ rest（回缩留尾巴）；初始 3 秒后回缩，hover 重新展开 */
.like-podium {
	position: fixed;
	top: 56px;          /* 导航栏下方 */
	right: 16px;
	z-index: 9990;
	font-size: 0.8rem;
	color: var(--txt, #333);
}
.like-podium__handle {
	position: absolute;
	top: 0;
	right: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--line, #e5e5e5);
	background: var(--card, #fff);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
	transform: translateY(-6px);
}
/* 尾巴态：只露 🔥 圆钮 */
.like-podium[data-state="rest"] .like-podium__handle {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}
.like-podium__panel {
	position: relative;
	margin-right: 40px;          /* 给尾巴让位 */
	padding: 10px 14px 12px;
	background: var(--card, #fff);
	border: 1px solid var(--line, #e5e5e5);
	border-radius: 14px;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.10);
	overflow: hidden;
	transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.35s ease;
	max-height: 260px;
	opacity: 1;
}
.like-podium[data-state="rest"] .like-podium__panel {
	max-height: 0;
	opacity: 0;
	transform: translateY(-8px);
	pointer-events: none;
}
.like-podium__title {
	font-weight: 700;
	letter-spacing: 0.5px;
	color: #ff5a3c;
	margin-bottom: 8px;
	white-space: nowrap;
}
/* v0.4.6 维度切换：昨日 / 本周 / 累计 */
.like-podium__tabs {
	display: flex;
	gap: 4px;
	margin: -2px 0 8px;
}
.podium-tab {
	padding: 2px 9px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--txt-meta, #999);
	font-size: 12px;
	line-height: 1.7;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease;
}
.podium-tab:hover { color: #ff5a3c; }
.podium-tab.is-active {
	background: #ff5a3c;
	color: #fff;
}
.podium-tab.is-active:hover { color: #fff; }
.like-podium__row {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 10px;
}
.like-podium__pod {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
}
/* 1 名最高：padding 让头像整体抬升 */
.like-podium__pod--1 { padding-top: 14px; }
.like-podium__pod--2,
.like-podium__pod--3 { padding-top: 4px; }

.pod__avatar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--bg-soft, #f1f1f1);
	border: 2px solid var(--line, #e5e5e5);
}
.pod__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}
.like-podium__pod--1 .pod__avatar { width: 64px; height: 64px; }
.like-podium__pod--2 .pod__avatar { width: 48px; height: 48px; }
.like-podium__pod--3 .pod__avatar { width: 40px; height: 40px; }
/* 无 photo 时的图标占位（global.js getAvatarColor 的简化：固定底色 + 首字） */
.pod__fallback {
	display: none;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	font-style: normal;
	font-weight: 700;
	color: #fff;
	font-size: 0.9rem;
}
.like-podium__pod--1 .pod__fallback { font-size: 1.4rem; }
.like-podium__pod--2 .pod__fallback { font-size: 1.1rem; }
.like-podium__pod--3 .pod__fallback { font-size: 0.95rem; }

.pod__name {
	max-width: 72px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 0.72rem;
	color: var(--txt, #333);
}
.pod__likes {
	font-size: 0.7rem;
	color: #ff5a3c;
	font-weight: 600;
}
.pod__rank {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #9aa0a6;
	color: #fff;
	font-size: 0.65rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	z-index: 1;
}
.pod__rank--gold { background: #ffb400; }

/* 深色模式 */
html.dark .like-podium__handle,
html.dark .like-podium__panel {
	background: var(--card, #1e1e2f);
	border-color: var(--line, #333);
}
html.dark .pod__avatar { background: #2a2a3f; border-color: #333; }
html.dark .pod__name { color: var(--txt, #ddd); }
html.dark .like-podium__title { color: #ff7a5c; }

/* 手机：领奖台收窄、靠边距 */
html.mobile .like-podium { top: 52px; right: 10px; }
html.mobile .like-podium__pod--1 { padding-top: 8px; }
html.mobile .like-podium__pod--1 .pod__avatar { width: 52px; height: 52px; }
html.mobile .like-podium__pod--2 .pod__avatar { width: 40px; height: 40px; }
html.mobile .like-podium__pod--3 .pod__avatar { width: 34px; height: 34px; }

.nav {
    position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	background: var(--card);
	display: flex;
	justify-content: center;
	gap: 20px;
	padding: 15px 0;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	z-index: 10000;
}

/* 导航普通链接样式 */
.nav a {
    text-decoration: none;
	color: var(--txt);
	padding: 8px 14px;
	border-radius: 6px;
	background: var(--bg-soft);
}

/* 导航当前页面激活态 */
.nav a.active {
    background: var(--pill-bg);
	color: var(--pill-fg);
}

/* --------------------------
   页面容器 通用内边距样式
   -------------------------- */
/* 常规页面容器 */
.container {
    padding: 100px 20px;
}

.container-center {
    text-align: center;
}

/* 紧凑版页面容器 */
.containerd {
    padding: 60px 20px;
	text-align: center;
}

/* --------------------------
   深色模式切换按钮
   -------------------------- */
.dark-toggle {
    position: fixed;
	top: 12px;
	right: 20px;
	padding: 8px 12px;
	border-radius: 20px;
	border: none;
	background: var(--toggle-bg);
	color: var(--toggle-fg);
	cursor: pointer;
	z-index: 10000;
}

/* 深色模式下按钮反色 */
html.dark .dark-toggle {
    background: var(--toggle-bg);
	color: var(--toggle-fg);
}

/* --------------------------
   全局通用向上淡入动画
   -------------------------- */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
/* 页面整体入场动画 */
.animate-page {
    opacity: 0;
	animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

/* 列表项统一动画基类 */
.animate-item {
    opacity: 0;
	animation: fadeInUp 0.6s ease-out forwards;
}

/* 第1项延迟 */
.animate-item:nth-child(1) {
    animation-delay: 0.4s;
}

/* 第2项延迟 */
.animate-item:nth-child(2) {
    animation-delay: 0.6s;
}

/* --------------------------
   全局固定页脚样式
   -------------------------- */
footer {
    position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	background: var(--card);
	text-align: center;
	padding: 10px 0;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
	z-index: 1000;
}

footer p {
    margin: 0;
	font-size: 14px;
	color: var(--dim);
}

/* --------------------------
   移动端 768px 适配样式
   -------------------------- */
html.mobile .dark-toggle {
    top: auto;
		bottom: 55px;
		right: 10px;
		padding: 6px 10px;
		font-size: 12px;
		min-height: 34px;
		z-index: 9999;
}

html.mobile .nav {
    gap: 10px;
		padding: 5px 0;
		/* 窄屏换行，避免 360px 以下导航溢出 */
		flex-wrap: wrap;
		justify-content: center;
}

html.mobile .nav a {
    padding: 10px 12px;
		font-size: 14px;
		min-height: 40px;
		display: inline-flex;
		align-items: center;
}

/* ========== 手机布局：由 js/global.js 判定后给 html 加 mobile class（竖屏或 ≤640px），本文件不再用媒体查询判断手机 ========== */
html.mobile .video-wrap {
    padding: 0 15px;
	grid-template-columns: 1fr;
	grid-template-areas: "big"
		"rightList"
		"fullList";
}

html.mobile .big-card .box {
    padding-top: 56.25%;
}

html.mobile .right-small,
html.mobile .bottom-full-small {
    grid-template-columns: repeat(2, 1fr);
	gap: 15px;
}

html.mobile .item {
    width: auto;
	flex: 1;
}

/* 移动端: 媒体预览工具栏 右下角布局 */
html.mobile .modal-toolbar {
    position: fixed;
		right: 15px;
		bottom: 20px;
		top: auto;
		transform: none;
		flex-direction: row;
		gap: 8px;
}

html.mobile .modal-toolbar button {
    width: 40px;
		height: 40px;
		font-size: 16px;
}



/* ==================== 深色模式过渡动画 ==================== */
::view-transition-old(root),
::view-transition-new(root) {
	animation: none;
	mix-blend-mode: normal;
}
/* 深色模式层级 */
.dark::view-transition-old(root) {
	z-index: 1;
}
.dark::view-transition-new(root) {
	z-index: 999;
}
/* 浅色模式层级 */
::view-transition-old(root) {
	z-index: 999;
}
::view-transition-new(root) {
	z-index: 1;
}
