- 全面采用临床数据仪表盘风格:IBM Plex Mono/Sans、teal 主色、无阴影设计 - theme.css 完整重写设计 token,支持亮色/暗色/跟随系统三挡切换 - ThemeControls 简化为图标三键切换组件 - NewsCard 临床风格重排:ALL CAPS 分类标签、INSIGHT 观点块 - NewsReader 精选栏:时间轴布局,蓝点 + 垂直轨道线 - AI日报全新排版:左侧 ARCHIVE 侧边栏 + 主区编辑版式 - 报头:中文数字日期、星期、PHARMA INTEL tagline - 分节:52px teal 编号 + 22px 中文分类 + 英文副标题 - 内容卡片:圆角12px,teal 标题,chips 行(来源/时间/评分) - 页脚统计:STORIES / PROCESSED / SOURCES - 全响应式:≤900px 平板、≤640px 移动端自适应 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
50 lines
1.2 KiB
Vue
50 lines
1.2 KiB
Vue
<template>
|
|
<router-view v-slot="{ Component }">
|
|
<component
|
|
:is="Component"
|
|
:theme-mode="themeMode"
|
|
:resolved-theme="resolvedTheme"
|
|
@set-theme-mode="setThemeMode"
|
|
/>
|
|
</router-view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { onMounted, onUnmounted, ref, watch } from 'vue'
|
|
|
|
const STORAGE_KEY = 'theme-mode'
|
|
const themeMode = ref(localStorage.getItem(STORAGE_KEY) || 'system')
|
|
const resolvedTheme = ref('light')
|
|
let mediaQuery
|
|
|
|
function getSystemTheme() {
|
|
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
|
|
}
|
|
|
|
function applyTheme() {
|
|
const nextTheme = themeMode.value === 'system' ? getSystemTheme() : themeMode.value
|
|
resolvedTheme.value = nextTheme
|
|
document.documentElement.dataset.theme = nextTheme
|
|
document.documentElement.style.colorScheme = nextTheme
|
|
}
|
|
|
|
function setThemeMode(mode) {
|
|
themeMode.value = mode
|
|
}
|
|
|
|
watch(themeMode, (mode) => {
|
|
localStorage.setItem(STORAGE_KEY, mode)
|
|
applyTheme()
|
|
})
|
|
|
|
onMounted(() => {
|
|
mediaQuery = window.matchMedia('(prefers-color-scheme: dark)')
|
|
mediaQuery.addEventListener('change', applyTheme)
|
|
applyTheme()
|
|
})
|
|
|
|
onUnmounted(() => {
|
|
mediaQuery?.removeEventListener('change', applyTheme)
|
|
})
|
|
</script>
|