This commit is contained in:
fuenmao
2026-11-13 14:03:38 +08:00
parent db0c578890
commit 09e8bded7e
22 changed files with 1309 additions and 607 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
<meta name="theme-color" content="#0c5045" />
<meta name="theme-color" content="#1677ff" />
<title>常青树健康管理</title>
<script>
function hideWxToolbar() {
Binary file not shown.

After

Width:  |  Height:  |  Size: 496 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

+57 -3
View File
@@ -144,8 +144,9 @@ test('late login response cannot write a token or navigate after leaving the aut
const server = await createServer({ configFile: false, root: path.dirname(root), plugins: [vuePlugin()], appType: 'custom',
server: { middlewareMode: true, hmr: false }, optimizeDeps: { noDiscovery: true, include: [] } })
after(() => server.close())
async function render(name, values = {}, routePath = '/dashboard') {
const { default: view } = await server.ssrLoadModule(`/src/views/${name}.vue`)
async function render(name, values = {}, routePath = '/dashboard', props = {}) {
const componentPath = name.includes('/') ? name : `views/${name}`
const { default: view } = await server.ssrLoadModule(`/src/${componentPath}.vue`)
const component = { ...view, setup(props, context) {
const state = view.setup(props, context)
for (const [key, value] of Object.entries(values)) { assert.ok(isRef(state[key]), key); state[key].value = value }
@@ -153,7 +154,7 @@ async function render(name, values = {}, routePath = '/dashboard') {
} }
const router = createRouter({ history: createMemoryHistory(), routes: [{ path: '/:pathMatch(.*)*', component }] })
await router.push(routePath); await router.isReady()
const app = createSSRApp({ render: () => h(component) }); app.use(router)
const app = createSSRApp({ render: () => h(component, props) }); app.use(router)
return renderToString(app)
}
@@ -171,6 +172,59 @@ test('home renders a prominent scene, collapsed presets, a real profile entry an
assert.ok(html.indexOf('健康评估</span>') < html.indexOf('我的</span>'))
})
test('automation card separates the rule switch from physical readback and preserves previous results while stopped', async () => {
const state = { available: true, enabled: false, actionLabel: '关闭窗帘', targetLabel: '美百帘窗帘', records: [
{ id: 'one', actionKey: 'curtain-close', targetLabel: '美百帘窗帘', triggeredAtMs: 1794380000000, result: 'readback-confirmed' },
{ id: 'two', actionKey: 'curtain-close', targetLabel: '美百帘窗帘', triggeredAtMs: 1794381000000, result: 'sent-readback-unconfirmed' },
] }
const props = { bindingId: 'simulation-left' }
const stopped = await render('components/Ib43AutomationCard', { status: state }, '/sleep-data', props)
assert.match(stopped, /已停止/)
assert.match(stopped, /开启联动/)
assert.match(stopped, /美百帘窗帘 · 已确认关闭/)
assert.match(stopped, /已发出关帘指令,未确认关闭/)
const started = await render('components/Ib43AutomationCard', { status: { ...state, enabled: true } }, '/sleep-data', props)
assert.match(started, /停止联动/)
assert.doesNotMatch(started, /开启联动/)
const both = await render('components/Ib43AutomationCard', { status: {
...state,
rules: [
{ actionKey: 'curtain-close', actionLabel: '关闭窗帘', enabled: false, targetLabel: '美百帘窗帘' },
{ actionKey: 'dehumidifier-humidity-preview', actionLabel: '湿度偏高时开启除湿机', enabled: true,
targetLabel: '除湿机', previewOnly: true, conditionLabel: '室内相对湿度超过 55% 时记录开机计划。' },
{ actionKey: 'dehumidifier-humidity-start', actionLabel: '湿度偏高时开启除湿机', enabled: false,
targetLabel: '除湿机', previewOnly: false, conditionLabel: '室内相对湿度超过 55% 且除湿机关机时,发送开机指令。' },
{ actionKey: 'climate-temperature-preview', actionLabel: '按室温判断空调模式', enabled: false,
targetLabel: '空调温控器2', previewOnly: true, conditionLabel: '室温高于 25℃ 时计划制冷,低于 22℃ 时计划制热。' },
{ actionKey: 'climate-heat-start', actionLabel: '室温偏低时开启空调制热', enabled: false,
targetLabel: '空调温控器2', previewOnly: false, conditionLabel: '室温低于 22℃ 且空调关机时,开启制热并设为 22℃。' },
{ actionKey: 'wake-fragrance-quick-release', actionLabel: '让香氛机「唤醒」出香一次', enabled: false,
targetLabel: '香氛机 唤醒', previewOnly: false },
{ actionKey: 'speaker-sleep-music', actionLabel: '用 Xiaomi Sound Pro 播放舒睡音乐', enabled: false,
targetLabel: 'Xiaomi Sound Pro', previewOnly: false },
],
records: [...state.records,
{ id: 'three', actionKey: 'dehumidifier-humidity-preview', targetLabel: '除湿机',
triggeredAtMs: 1794382000000, result: 'preview-would-start' },
{ id: 'four', actionKey: 'dehumidifier-humidity-start', targetLabel: '除湿机',
triggeredAtMs: 1794383000000, result: 'readback-confirmed' },
{ id: 'five', actionKey: 'climate-temperature-preview', targetLabel: '空调温控器2',
triggeredAtMs: 1794384000000, result: 'preview-climate-cool' },
{ id: 'six', actionKey: 'climate-heat-start', targetLabel: '空调温控器2',
triggeredAtMs: 1794385000000, result: 'readback-confirmed' },
{ id: 'seven', actionKey: 'wake-fragrance-quick-release', targetLabel: '香氛机 唤醒',
triggeredAtMs: 1794386000000, result: 'fragrance-release-sent' },
{ id: 'eight', actionKey: 'speaker-sleep-music', targetLabel: 'Xiaomi Sound Pro',
triggeredAtMs: 1794387000000, result: 'speaker-playback-sent' }],
} }, '/sleep-data', props)
for (const text of ['开启联动', '停止预演', '超过 55% 且除湿机关机时', '除湿机 · 已确认开启', '除湿机 · 预演通过,计划开启除湿机',
'按室温判断空调模式(预演)', '高于 25℃ 时计划制冷', '空调温控器2 · 预演通过,计划制冷',
'室温偏低时开启空调制热', '低于 22℃ 且空调关机时', '空调温控器2 · 已确认制热至 22℃',
'香氛机 唤醒 · 已发送一次快速出香指令', 'Xiaomi Sound Pro · 已发送舒睡音乐播放指令'])
assert.ok(both.includes(text), text)
})
const sleepBed = { id: 'left-bed', bedName: '卧室左侧', side: 'left', simulation: true, endedAtMs: null }
const rightBed = { id: 'right-bed', bedName: '卧室右侧', side: 'right', simulation: false, endedAtMs: null }
+8 -8
View File
@@ -81,12 +81,12 @@ test('parameter conversion rejects junk and unavailable data; light zero and har
const { createDeviceParameterState, syncDeviceParameters } = env.load('devices/parameterRegistry')
const params = createDeviceParameterState()
syncDeviceParameters(params, { brightness: control('off'), color_temp: control('on', { color_temp_kelvin: 6500 }),
volume: control('on', { volume_level: .56 }), fragrance_auto_light: control('on') })
volume: control('on', { volume_level: .56 }), uv: control('on') })
assert.equal(params.lightBrightness, 0); assert.equal(params.lightColorTemp, 5000)
assert.equal(params.speakerVolume, 56)
assert.equal(params.fragranceAutoLight, true)
syncDeviceParameters(params, { fragrance_auto_light: control('unavailable', {}, false), volume: control('on', { volume_level: 'NaN' }) })
assert.equal(params.fragranceAutoLight, true); assert.equal(params.speakerVolume, 56)
assert.equal(params.dehumidifierUv, true)
syncDeviceParameters(params, { uv: control('unavailable', {}, false), volume: control('on', { volume_level: 'NaN' }) })
assert.equal(params.dehumidifierUv, true); assert.equal(params.speakerVolume, 56)
})
test('parameter availability is scoped to the actual device; missing numeric attributes are not default readings', () => {
@@ -150,13 +150,13 @@ test('all-off can interrupt start; a late start result cannot overwrite off feed
})
test('failed parameter command restores last known reading even if refresh itself fails', async () => {
const env = environment({ homeAssistantStatus: async () => status({ fragrance_auto_light: control('off') }),
const env = environment({ homeAssistantStatus: async () => status({ uv: control('off') }),
setParameter: async () => ({ success: false, message: '失败' }) })
const hook = env.load('composables/useDeviceControl').useDeviceControl()
await hook.loadStatus(); hook.localParams.fragranceAutoLight = true
await hook.loadStatus(); hook.localParams.dehumidifierUv = true
env.healthApi.homeAssistantStatus = async () => { throw new Error('离线') }
assert.equal(await hook.applyParam('fragrance', 'fragrance_auto_light', true), false)
assert.equal(hook.localParams.fragranceAutoLight, false)
assert.equal(await hook.applyParam('dehumidifier', 'uv', true), false)
assert.equal(hook.localParams.dehumidifierUv, false)
assert.equal(hook.actionFeedback.value.message, '失败')
env.dispose(); assert.equal(env.timeouts.size, 0)
})
+24
View File
@@ -303,6 +303,30 @@ test('fragrance detail retains separate nightlight and unavailable quick-release
assert.ok(!html.includes('演示智能床垫'))
})
test('wake and sleep fragrance details share controls and show their own readings', async () => {
const sleepDuration = reading('number.sleep_duration', 'number', '3')
const wakeDuration = reading('number.wake_duration', 'number', '5')
const wakeButton = reading('button.wake_release', 'button', 'unknown')
const sleep = { ...devices[2], entities: [...devices[2].entities, sleepDuration] }
const wake = device('wake', '香氛机 唤醒', 'wake-fragrance', 'Fragrance',
[reading('switch.wake', 'switch', 'on'), wakeDuration, wakeButton], { primaryControlEntityId: 'switch.wake' })
const haStatus = ref({ connected: true, devices: [sleep, wake], controlParameters: {
fragrance_duration: sleepDuration, wake_fragrance_duration: wakeDuration, wake_fragrance_quick_release: wakeButton,
} })
const sleepHtml = (await render('/device-control/fragrance', { haStatus })).html
const wakeHtml = (await render('/device-control/wake', { haStatus })).html
for (const label of ['单次出香时长', '自动出香间隔', '香薰氛围灯', '人来增香', '感应夜灯', '无人时自动关灯', '立即出香']) {
assert.ok(sleepHtml.includes(label), label)
assert.ok(wakeHtml.includes(label), label)
}
assert.match(sleepHtml, />3 秒</)
assert.doesNotMatch(sleepHtml, />5 秒</)
assert.match(wakeHtml, />5 秒</)
assert.doesNotMatch(wakeHtml, />3 秒</)
assert.match(wakeHtml, /快速出香/)
assert.doesNotMatch(wakeHtml, /查看全部能力/)
})
test('each registered device detail renders its own parameters without requesting the network', async () => {
const cases = [
[devices[0], ['灯光亮度', '灯光色温调节']],
Binary file not shown.

After

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

+4 -4
View File
@@ -109,14 +109,14 @@ function navigate(target: string) {
background: rgba(255, 255, 255, 0.98);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border-top: 1px solid rgba(18, 63, 55, 0.08);
border-top: 1px solid #eef2f6;
display: flex;
justify-content: space-around;
align-items: flex-start;
padding-top: 6px;
padding-bottom: env(safe-area-inset-bottom, 0px);
z-index: 999;
box-shadow: 0 -4px 16px rgba(18, 63, 55, 0.04);
box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.04);
}
.tab-item {
@@ -129,7 +129,7 @@ function navigate(target: string) {
justify-content: center;
flex: 1;
height: 44px;
color: #7d8e87;
color: #94a3b8;
cursor: pointer;
transition: color 0.2s ease;
user-select: none;
@@ -152,7 +152,7 @@ function navigate(target: string) {
}
.tab-item.active {
color: #0c5045;
color: #0284c7;
}
.tab-item.active .tab-label {
+182
View File
@@ -0,0 +1,182 @@
<script setup lang="ts">
import { computed, onMounted, onUnmounted, ref } from 'vue'
import { usePageRequest } from '../composables/usePageRequest'
import { formatIb43Time, ib43Api, type Ib43Automation, type Ib43AutomationRecord, type Ib43AutomationRule } from '../services/ib43'
const props = defineProps<{ bindingId: string }>()
const status = ref<Ib43Automation>()
const loading = ref(false)
const updatingKey = ref<string | null>(null)
const updating = computed(() => updatingKey.value !== null)
const loadError = ref('')
const actionError = ref('')
const requests = usePageRequest()
let timer: ReturnType<typeof setInterval>
const rules = computed<Ib43AutomationRule[]>(() => {
if (!status.value) return []
if (status.value.rules) return status.value.rules
const { available, enabled, actionLabel, targetLabel } = status.value
return available ? [{ actionKey: '', enabled, actionLabel, targetLabel, previewOnly: false }] : []
})
const resultLabels: Record<string, string> = {
pending: '尚未记录结果',
'readback-confirmed': '已回读确认',
'already-closed': '窗帘已关闭,跳过',
'already-closing': '窗帘正在关闭,跳过',
'already-running': '动作已在运行,跳过',
'state-not-open': '当前状态不适合关帘,跳过',
'sent-readback-unconfirmed': '已发出指令,回读未确认',
'target-not-configured': '目标设备未配置',
'cancelled-unconfirmed': '已取消或超时,结果未确认',
'failed-unconfirmed': '动作未确认',
expired: '事件已过期,跳过',
'preview-would-start': '预演通过,计划开启除湿机',
'preview-humidity-normal': '预演跳过,湿度未超过阈值',
'preview-humidity-unavailable': '预演跳过,湿度读数缺失或不可用',
'preview-humidity-stale': '预演跳过,湿度读数过期或时间无效',
'preview-humidity-invalid': '预演跳过,湿度读数或单位无效',
'humidity-normal': '湿度未超过阈值,跳过',
'humidity-unavailable': '湿度读数缺失或不可用,跳过',
'humidity-stale': '湿度读数过期或时间无效,跳过',
'humidity-invalid': '湿度读数或单位无效,跳过',
'dehumidifier-unavailable': '除湿机不可用,跳过',
'dehumidifier-already-on': '除湿机已开启,跳过',
'dehumidifier-state-not-off': '无法确认除湿机已关机,跳过',
'preview-climate-cool': '预演通过,计划制冷',
'preview-climate-heat': '预演通过,计划制热',
'preview-temperature-within-range': '预演跳过,室温在设定区间内',
'preview-temperature-unavailable': '预演跳过,室温读数缺失或不可用',
'preview-temperature-stale': '预演跳过,室温读数过期或时间无效',
'preview-temperature-invalid': '预演跳过,室温读数或单位无效',
'temperature-not-low': '室温未低于 22℃,跳过',
'temperature-unavailable': '室温读数缺失或不可用,跳过',
'temperature-stale': '室温读数过期或时间无效,跳过',
'temperature-invalid': '室温读数或单位无效,跳过',
'climate-unavailable': '空调不可用,跳过',
'climate-not-off': '空调当前未关机,跳过',
'climate-heat-unsupported': '空调不支持制热或 22℃ 目标温度,跳过',
'climate-heat-mode-unconfirmed': '已发出制热指令,未确认制热模式',
'climate-heat-state-changed': '制热状态已改变或不可用,跳过设温',
'climate-heat-target-unconfirmed': '已确认制热,未确认维持制热并设为 22℃',
'fragrance-release-sent': '已发送一次快速出香指令',
'fragrance-release-unavailable': '快速出香按钮不可用,跳过',
'speaker-music-not-configured': '舒睡曲目或音箱网关未配置,跳过',
'speaker-state-unavailable': '音箱状态不可用,跳过',
'speaker-not-idle': '音箱当前非空闲,跳过',
'speaker-playback-sent': '已发送舒睡音乐播放指令',
}
function resultLabel(row: Ib43AutomationRecord) {
if (row.actionKey === 'curtain-close' && row.result === 'readback-confirmed') return '已确认关闭'
if (row.actionKey === 'curtain-close' && row.result === 'sent-readback-unconfirmed') return '已发出关帘指令,未确认关闭'
if (row.actionKey === 'dehumidifier-humidity-start' && row.result === 'readback-confirmed') return '已确认开启'
if (row.actionKey === 'dehumidifier-humidity-start' && row.result === 'sent-readback-unconfirmed') return '已发出开机指令,未确认开启'
if (row.actionKey === 'climate-heat-start' && row.result === 'readback-confirmed') return '已确认制热至 22℃'
return resultLabels[row.result] || '结果未知'
}
async function load() {
if (updating.value || loading.value) return
const request = requests.begin()
loading.value = true
try {
const result = await ib43Api.automation(props.bindingId)
if (!requests.isCurrent(request)) return
status.value = result
loadError.value = ''
} catch (error) {
if (requests.isCurrent(request)) loadError.value = error instanceof Error ? error.message : '暂时无法读取联动状态'
} finally {
if (requests.isCurrent(request)) loading.value = false
}
}
async function toggle(rule: Ib43AutomationRule) {
const enabled = !rule.enabled
if (!status.value || updating.value || (enabled && loadError.value)) return
const request = requests.begin()
updatingKey.value = rule.actionKey
loading.value = false
actionError.value = ''
try {
if (enabled) await ib43Api.startAutomation(props.bindingId, rule.actionKey || undefined)
else await ib43Api.stopAutomation(props.bindingId, rule.actionKey || undefined)
if (!requests.isCurrent(request)) return
const previous = status.value
status.value = previous.rules
? { ...previous, rules: previous.rules.map(item => item.actionKey === rule.actionKey ? { ...item, enabled } : item) }
: { ...previous, enabled }
} catch (error) {
if (requests.isCurrent(request)) actionError.value = error instanceof Error ? error.message : '更新联动状态失败'
} finally {
if (requests.isCurrent(request)) {
updatingKey.value = null
void load()
}
}
}
onMounted(() => {
void load()
timer = setInterval(() => {
if (!document.hidden && (rules.value.some(rule => rule.enabled) || status.value?.records.some(row =>
row.result === 'pending' && Date.now() - Number(row.triggeredAtMs) < 90000))) void load()
}, 5000)
})
onUnmounted(() => clearInterval(timer))
</script>
<template>
<section class="section-card automation-card" aria-labelledby="ib43-automation-title">
<div class="automation-heading">
<h2 id="ib43-automation-title">家具联动</h2>
<button class="automation-button" type="button" :disabled="loading || updating" @click="load">刷新记录</button>
</div>
<p v-if="!status && loading" class="automation-muted" role="status">正在读取联动状态…</p>
<p v-if="loadError" class="automation-error" role="alert">{{ loadError }}</p>
<template v-if="status">
<p v-if="!rules.length" class="automation-muted">该床位当前未启用可管理的家具规则。</p>
<div v-for="rule in rules" :key="rule.actionKey" class="automation-rule">
<div class="automation-heading">
<strong>上床后{{ rule.actionLabel }}{{ rule.previewOnly ? '(预演)' : '' }}</strong>
<span class="automation-state" :class="{ enabled: rule.enabled }">{{ rule.enabled ? '已开启' : '已停止' }}</span>
</div>
<p v-if="rule.previewOnly">预演只读取数据并记录结果。{{ rule.conditionLabel }}</p>
<p v-else-if="rule.conditionLabel">{{ rule.conditionLabel }}</p>
<p v-else>模拟床位从离床变为在床时,对{{ rule.targetLabel }}执行此动作。</p>
<button class="automation-button" :class="{ primary: !rule.enabled }" type="button"
:disabled="updating || (!rule.enabled && !!loadError)" @click="toggle(rule)">
{{ updatingKey === rule.actionKey ? '正在更新…' : rule.previewOnly
? (rule.enabled ? '停止预演' : '开启预演') : (rule.enabled ? '停止联动' : '开启联动') }}
</button>
</div>
<p v-if="actionError" class="automation-error" role="alert">{{ actionError }}</p>
<h3>最近执行记录</h3>
<p v-if="status.records.length === 0" class="automation-muted">暂无执行记录。</p>
<ol v-else class="automation-records">
<li v-for="row in status.records" :key="row.id">
<span>{{ row.targetLabel }} · {{ resultLabel(row) }}</span>
<time>{{ formatIb43Time(row.triggeredAtMs) }}</time>
</li>
</ol>
</template>
</section>
</template>
<style scoped>
.automation-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
h2 { margin: 0; font-size: 17px; }
h3 { margin: 16px 0 8px; font-size: 14px; }
.automation-button { min-height: 44px; border: 1px solid #bae6fd; border-radius: 12px; background: #f0f9ff; color: #0284c7; padding: 8px 12px; font: inherit; font-size: 13px; }
.automation-button.primary { color: #fff; background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%); border-color: transparent; box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25); }
.automation-button:disabled { opacity: .55; }
.automation-rule { margin-top: 12px; padding: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 13px; }
.automation-rule p, .automation-muted, .automation-records time { color: var(--muted-text); font-size: 13px; }
.automation-state { flex-shrink: 0; border-radius: 8px; padding: 4px 8px; background: #f1f5f9; color: #64748b; font-size: 12px; }
.automation-state.enabled { background: #f0f9ff; color: #0284c7; }
.automation-error { color: #8b432f; font-size: 13px; overflow-wrap: anywhere; }
.automation-records { list-style: none; padding: 0; margin: 0; }
.automation-records li { display: grid; gap: 5px; border-top: 1px solid #e2e8f0; padding: 10px 0; font-size: 14px; overflow-wrap: anywhere; }
</style>
+39 -12
View File
@@ -1,20 +1,47 @@
<script setup lang="ts">
import { toRefs } from 'vue'
import { reactive, toRefs, watchEffect } from 'vue'
import { Button as VanButton, Slider as VanSlider } from 'vant'
import type { HomeAssistantDiscoveredDevice } from '../../services/health'
import { useDeviceControlContext } from '../../devices/controlContext'
import { useDeviceCardState } from '../../devices/useDeviceCardState'
import { defaults, labels, sync } from '../../devices/fragrance/parameters'
import type { ParameterSnapshot } from '../../devices/parameterState'
const props = defineProps<{ device: HomeAssistantDiscoveredDevice }>()
const { device: fragranceDevice } = toRefs(props)
const { localParams, operationBusy, switchingDeviceId, isDeviceTurnedOn, toggleDevice, applyParam, settingParam } = useDeviceControlContext()
const state = useDeviceCardState(() => props.device)
const { haStatus, operationBusy, switchingDeviceId, isDeviceTurnedOn, toggleDevice,
applyParam: setParameter, settingParam } = useDeviceControlContext()
const localParams = reactive({ ...defaults })
const parameterKey = (key: string) => props.device.moduleKey === 'wake-fragrance' ? `wake_${key}` : key
const card = useDeviceCardState(() => props.device)
const state = {
...card,
available: (key: string) => card.available(parameterKey(key)),
readable: (key: string) => card.readable(parameterKey(key)),
display: (key: string, value: unknown, suffix = '') => card.display(parameterKey(key), value, suffix),
}
function syncReadings() {
const controls: ParameterSnapshot = {}
for (const key of Object.keys(labels)) {
const reading = haStatus.value?.controlParameters?.[parameterKey(key)]
if (reading && state.available(key)) controls[key] = reading
}
Object.assign(localParams, defaults)
sync(localParams, controls)
}
watchEffect(syncReadings)
async function applyParam(key: string, value: unknown) {
await setParameter(props.device.deviceId, parameterKey(key), value)
syncReadings()
}
</script>
<template>
<section class="device-card" v-if="fragranceDevice">
<div class="device-head">
<div class="dev-info">
<span class="category-tag">香氛助眠</span>
<span class="category-tag">香氛控制</span>
<h3>{{ fragranceDevice.name }}</h3>
<span class="status-dot" :class="{ online: fragranceDevice.online }">
{{ fragranceDevice.online ? '设备在线' : '设备离线' }}
@@ -47,7 +74,7 @@ const state = useDeviceCardState(() => props.device)
:max="6"
:step="1"
:disabled="operationBusy || !state.available('fragrance_duration')"
@change="applyParam(fragranceDevice.deviceId, 'fragrance_duration', localParams.fragranceDuration)"
@change="applyParam('fragrance_duration', localParams.fragranceDuration)"
/>
<div class="range-labels"><span>2 秒</span><span>4 秒</span><span>6 秒</span></div>
</div>
@@ -63,7 +90,7 @@ const state = useDeviceCardState(() => props.device)
:max="20"
:step="5"
:disabled="operationBusy || !state.available('fragrance_interval')"
@change="applyParam(fragranceDevice.deviceId, 'fragrance_interval', localParams.fragranceInterval)"
@change="applyParam('fragrance_interval', localParams.fragranceInterval)"
/>
<div class="range-labels"><span>10 分钟</span><span>15 分钟</span><span>20 分钟</span></div>
</div>
@@ -77,7 +104,7 @@ const state = useDeviceCardState(() => props.device)
class="mini-toggle"
:class="{ active: state.readable('fragrance_light') && localParams.fragranceLight }"
:disabled="operationBusy || !state.available('fragrance_light')"
@click="localParams.fragranceLight = !localParams.fragranceLight; applyParam(fragranceDevice.deviceId, 'fragrance_light', localParams.fragranceLight)"
@click="applyParam('fragrance_light', !localParams.fragranceLight)"
>{{ state.display('fragrance_light', localParams.fragranceLight ? '已开启' : '已关闭') }}</button>
</div>
@@ -90,7 +117,7 @@ const state = useDeviceCardState(() => props.device)
class="mini-toggle"
:class="{ active: state.readable('fragrance_auto_release') && localParams.fragranceAutoRelease }"
:disabled="operationBusy || !state.available('fragrance_auto_release')"
@click="localParams.fragranceAutoRelease = !localParams.fragranceAutoRelease; applyParam(fragranceDevice.deviceId, 'fragrance_auto_release', localParams.fragranceAutoRelease)"
@click="applyParam('fragrance_auto_release', !localParams.fragranceAutoRelease)"
>{{ state.display('fragrance_auto_release', localParams.fragranceAutoRelease ? '已开启' : '已关闭') }}</button>
</div>
@@ -103,7 +130,7 @@ const state = useDeviceCardState(() => props.device)
class="mini-toggle"
:class="{ active: state.readable('fragrance_auto_light') && localParams.fragranceAutoLight }"
:disabled="operationBusy || !state.available('fragrance_auto_light')"
@click="localParams.fragranceAutoLight = !localParams.fragranceAutoLight; applyParam(fragranceDevice.deviceId, 'fragrance_auto_light', localParams.fragranceAutoLight)"
@click="applyParam('fragrance_auto_light', !localParams.fragranceAutoLight)"
>{{ state.display('fragrance_auto_light', localParams.fragranceAutoLight ? '已开启' : '已关闭') }}</button>
</div>
@@ -116,7 +143,7 @@ const state = useDeviceCardState(() => props.device)
class="mini-toggle"
:class="{ active: state.readable('fragrance_light_auto_off') && localParams.fragranceLightAutoOff }"
:disabled="operationBusy || !state.available('fragrance_light_auto_off')"
@click="localParams.fragranceLightAutoOff = !localParams.fragranceLightAutoOff; applyParam(fragranceDevice.deviceId, 'fragrance_light_auto_off', localParams.fragranceLightAutoOff)"
@click="applyParam('fragrance_light_auto_off', !localParams.fragranceLightAutoOff)"
>{{ state.display('fragrance_light_auto_off', localParams.fragranceLightAutoOff ? '已开启' : '已关闭') }}</button>
</div>
@@ -130,9 +157,9 @@ const state = useDeviceCardState(() => props.device)
round
plain
color="#0c5045"
:loading="settingParam === `${fragranceDevice.deviceId}_fragrance_quick_release`"
:loading="settingParam === `${fragranceDevice.deviceId}_${parameterKey('fragrance_quick_release')}`"
:disabled="operationBusy || !state.available('fragrance_quick_release')"
@click="applyParam(fragranceDevice.deviceId, 'fragrance_quick_release', true)"
@click="applyParam('fragrance_quick_release', true)"
>{{ state.available('fragrance_quick_release') ? '快速出香' : '暂不可用' }}</VanButton>
</div>
</div>
+1
View File
@@ -7,6 +7,7 @@ const legacyCategories: Record<string, string> = {
/** 新接口未绑定模块时不借用另一台同类设备的参数;仅兼容旧接口没有 moduleKey 的情况。 */
export function deviceModuleKey(device: HomeAssistantDiscoveredDevice): string {
if (device.moduleKey === 'wake-fragrance') return 'fragrance'
return device.moduleKey === undefined ? legacyCategories[device.category] ?? '' : device.moduleKey
}
+2 -2
View File
@@ -9,15 +9,15 @@ import type { ParameterSnapshot } from './parameterState'
export const parameterLabels: Record<string, string> = {
...dehumidifier.labels, ...lighting.labels, ...audio.labels, ...fragrance.labels,
...Object.fromEntries(Object.entries(fragrance.labels).map(([key, label]) => [`wake_${key}`, label])),
...climate.labels, ...curtain.labels
}
export function createDeviceParameterState() {
return reactive({ ...dehumidifier.defaults, ...lighting.defaults, ...audio.defaults,
...fragrance.defaults, ...climate.defaults, ...curtain.defaults })
...climate.defaults, ...curtain.defaults })
}
export type DeviceParameterState = ReturnType<typeof createDeviceParameterState>
export function syncDeviceParameters(state: DeviceParameterState, controls: ParameterSnapshot) {
dehumidifier.sync(state, controls); lighting.sync(state, controls); audio.sync(state, controls)
fragrance.sync(state, controls)
climate.sync(state, controls); curtain.sync(state, controls)
}
+31
View File
@@ -34,6 +34,32 @@ export type Ib43HistoryItem = {
type Ib43History = { items: Ib43HistoryItem[]; nextBeforeId?: number | string | null }
export type Ib43HistoryQuery = { fromMs: number; toMs: number; beforeId?: number | string; take: number }
export type Ib43AutomationRecord = {
id: string
actionKey: string
targetLabel: string
triggeredAtMs: number | string
completedAtMs?: number | string | null
result: string
}
export type Ib43AutomationRule = {
actionKey: string
enabled: boolean
actionLabel: string
targetLabel: string
previewOnly: boolean
conditionLabel?: string | null
}
export type Ib43Automation = {
available: boolean
enabled: boolean
actionLabel: string
targetLabel: string
records: Ib43AutomationRecord[]
rules?: Ib43AutomationRule[]
}
const bindingsUrl = '/api/health/ib43/bindings'
const bedUrl = (id: string) => `${bindingsUrl}/${encodeURIComponent(id)}`
@@ -42,6 +68,11 @@ export const ib43Api = {
bindings: () => http.get<never, Ib43Bed[]>(bindingsUrl),
current: (id: string) => http.get<never, Ib43Current>(`${bedUrl(id)}/current`),
history: (id: string, params: Ib43HistoryQuery) => http.get<never, Ib43History>(`${bedUrl(id)}/history`, { params }),
automation: (id: string) => http.get<never, Ib43Automation>(`${bedUrl(id)}/automation`),
startAutomation: (id: string, actionKey?: string) =>
http.post<never, void>(`${bedUrl(id)}/automation/start`, undefined, { params: { actionKey } }),
stopAutomation: (id: string, actionKey?: string) =>
http.post<never, void>(`${bedUrl(id)}/automation/stop`, undefined, { params: { actionKey } }),
}
export function displayIb43Value(metric: Ib43Metric, value?: number | null) {
+318 -152
View File
@@ -1,13 +1,23 @@
:root {
font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
color: #173a34;
background: #f2f0e9;
font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
color: #0f172a;
background: #f8fafc;
font-synthesis: none;
--green: #0c5045;
--deep: #123f37;
--cream: #f8f4e8;
--gold: #d6a657;
--line: rgba(18, 63, 55, 0.12);
--primary: #0284c7;
--primary-light: #f0f9ff;
--primary-border: #bae6fd;
--primary-dark: #0369a1;
--green: #0284c7;
--deep: #0f172a;
--text-main: #0f172a;
--text-body: #334155;
--text-muted: #64748b;
--cream: #f8fafc;
--gold: #0284c7;
--line: #e2e8f0;
--card-bg: #ffffff;
--card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
--card-radius: 16px;
}
* { box-sizing: border-box; }
@@ -16,7 +26,7 @@ html, body {
padding: 0;
min-width: 320px;
min-height: 100vh;
background: #e8e6df;
background: #f1f5f9;
overflow-x: hidden;
-webkit-text-size-adjust: 100%;
}
@@ -25,8 +35,8 @@ html, body {
margin: 0 auto;
min-height: 100vh;
position: relative;
background: #f2f0e9;
box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
background: linear-gradient(180deg, #bfe3fc 0%, #e0f2fe 22%, #f0f9ff 48%, #f8fafc 100%);
box-shadow: 0 0 32px rgba(15, 23, 42, 0.06);
overflow-x: hidden;
}
button, input, textarea { font: inherit; }
@@ -34,98 +44,246 @@ button { cursor: pointer; }
.eyebrow {
margin: 0 0 8px;
color: #b68b48;
color: #0284c7;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.16em;
}
.auth-page { min-height: 100vh; background: var(--cream); }
.brand-panel {
padding: 46px 24px 46px;
color: #fff;
.auth-page {
min-height: 100vh;
background:
radial-gradient(circle at 82% 12%, rgba(236, 202, 137, .28), transparent 28%),
linear-gradient(145deg, #0b5548, #123d37 74%);
border-radius: 0 0 36px 36px;
radial-gradient(circle at 85% 10%, rgba(178, 225, 255, 0.45) 0%, rgba(224, 242, 254, 0.25) 35%, transparent 70%),
linear-gradient(180deg, #bfe3fc 0%, #e0f2fe 25%, #f8fafc 55%, #f1f5f9 100%);
padding: 20px 16px 40px;
}
.brand-panel {
max-width: 440px;
margin: 0 auto;
padding: 16px 4px 20px;
color: #0f172a;
background: transparent;
border-radius: 0;
}
.brand-badge {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 5px 14px 5px 6px;
background: rgba(255, 255, 255, 0.12);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 24px;
padding: 4px 12px 4px 4px;
background: rgba(255, 255, 255, 0.85);
border: 1px solid rgba(191, 219, 254, 0.8);
border-radius: 20px;
font-size: 12px;
margin-bottom: 20px;
font-weight: 600;
color: #075985;
margin-bottom: 14px;
box-shadow: 0 2px 8px rgba(2, 132, 199, 0.06);
backdrop-filter: blur(8px);
}
.brand-badge-icon {
width: 24px;
height: 24px;
background: var(--gold);
width: 22px;
height: 22px;
background: #0284c7;
color: #fff;
border-radius: 50%;
display: grid;
place-items: center;
font-family: serif;
font-weight: 700;
font-size: 13px;
font-size: 11px;
}
.brand-mark {
display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 28px;
border: 1px solid rgba(255,255,255,.42); border-radius: 50%; font-family: serif; font-size: 24px;
display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 24px;
border: 1px solid rgba(2, 132, 199, 0.3); border-radius: 50%; font-family: serif; font-size: 24px; color: #0284c7;
}
.brand-panel .eyebrow {
margin: 0 0 6px;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.14em;
color: #0284c7;
}
.brand-panel h1 {
max-width: 560px;
margin: 0;
font-size: clamp(26px, 7vw, 32px);
line-height: 1.25;
font-weight: 800;
color: #0f172a;
letter-spacing: -0.02em;
}
.brand-copy {
max-width: 480px;
margin: 10px 0 16px;
color: #475569;
line-height: 1.6;
font-size: 13px;
}
.feature-row, .feature-pill-row {
display: flex;
gap: 8px;
flex-wrap: wrap;
margin-bottom: 6px;
}
.feature-row span, .feature-pill-row span {
padding: 5px 12px;
background: rgba(255, 255, 255, 0.85);
border: 1px solid rgba(191, 219, 254, 0.75);
border-radius: 18px;
font-size: 12px;
font-weight: 600;
color: #0284c7;
box-shadow: 0 2px 6px rgba(2, 132, 199, 0.04);
backdrop-filter: blur(6px);
}
.brand-panel h1 { max-width: 560px; margin: 0; font-family: "Songti SC", serif; font-size: clamp(32px, 8vw, 54px); line-height: 1.2; font-weight: 500; }
.brand-copy { max-width: 480px; margin: 14px 0 16px; color: rgba(255,255,255,.78); line-height: 1.6; }
.feature-row, .feature-pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.feature-row span, .feature-pill-row span { padding: 6px 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 20px; font-size: 12px; }
.auth-card { position: relative; width: calc(100% - 32px); max-width: 440px; margin: -16px auto 32px; padding: 24px 20px; background: #fff; border-radius: 24px; box-shadow: 0 14px 40px rgba(24,59,52,.12); }
.auth-card {
position: relative;
width: 100%;
max-width: 440px;
margin: 0 auto 32px;
padding: 24px 20px 28px;
background: #ffffff;
border-radius: 22px;
border: 1px solid rgba(226, 232, 240, 0.85);
box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.06), 0 4px 12px -2px rgba(15, 23, 42, 0.02);
}
.auth-tab-switch {
display: flex;
background: #f1efea;
background: #f1f5f9;
border-radius: 12px;
padding: 3px;
padding: 4px;
margin-bottom: 20px;
}
.auth-tab-switch button {
flex: 1;
padding: 9px 0;
padding: 10px 0;
border: 0;
font-size: 14px;
font-weight: 600;
border-radius: 9px;
color: #72847d;
color: #64748b;
background: transparent;
cursor: pointer;
transition: all 0.2s ease;
}
.auth-tab-switch button.active {
background: #ffffff;
color: var(--green);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
color: #0284c7;
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.auth-heading h2 {
margin: 0;
font-size: 22px;
font-weight: 700;
color: #0f172a;
}
.auth-heading > p:last-child {
margin: 6px 0 20px;
color: #64748b;
font-size: 13px;
}
.auth-card .van-field {
position: relative;
margin-bottom: 16px;
padding: 12px 14px;
background: #f8fafc;
border-radius: 12px;
border: 1px solid #e2e8f0;
transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, margin-bottom 0.2s ease;
min-height: 48px;
}
.auth-card .van-field:focus-within {
background: #ffffff;
border-color: #0284c7;
box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}
.auth-card .van-field__value {
position: static;
overflow: visible;
}
.auth-card .van-field__label {
color: #334155;
font-weight: 600;
width: 4.8em;
margin-right: 8px;
}
.auth-card .van-field__control {
color: #0f172a;
font-weight: 500;
font-size: 15px;
}
.auth-card .van-field__error-message {
position: absolute;
top: calc(100% + 4px);
left: 12px;
font-size: 12px;
line-height: 1.4;
color: #ef4444;
font-weight: 500;
white-space: nowrap;
display: flex;
align-items: center;
gap: 4px;
z-index: 2;
}
.auth-card .van-field__error-message::before {
content: "⚠";
font-size: 11px;
}
.auth-card .van-field:has(.van-field__error-message),
.auth-card .van-field--error {
margin-bottom: 26px !important;
border-color: #ef4444 !important;
background-color: #fffafa !important;
}
.auth-card .van-field:has(.van-field__error-message):focus-within,
.auth-card .van-field--error:focus-within {
border-color: #ef4444 !important;
box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}
.auth-card .van-button {
margin-top: 20px;
height: 48px;
font-size: 15px;
font-weight: 600;
background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%) !important;
border: none !important;
border-radius: 14px !important;
box-shadow: 0 8px 20px -3px rgba(2, 132, 199, 0.35);
color: #ffffff !important;
transition: transform 0.1s;
}
.auth-card .van-button:active {
transform: scale(0.985);
}
.text-button {
display: block;
margin: 18px auto 0;
border: 0;
background: transparent;
color: #0284c7;
font-size: 14px;
}
.privacy-note {
margin: 20px 0 0;
color: #94a3b8;
font-size: 11px;
line-height: 1.6;
text-align: center;
}
.auth-heading h2 { margin: 0; font-family: "Songti SC", serif; font-size: 24px; }
.auth-heading > p:last-child { margin: 8px 0 20px; color: #70817d; font-size: 13px; }
.auth-card .van-field { margin-bottom: 12px; padding: 14px 12px; background: #f7f7f3; border-radius: 12px; }
.auth-card .van-button { margin-top: 18px; height: 48px; font-size: 15px; font-weight: 600; }
.text-button { display: block; margin: 18px auto 0; border: 0; background: transparent; color: var(--green); font-size: 14px; }
.privacy-note { margin: 18px 0 0; color: #9a9f9c; font-size: 11px; line-height: 1.6; text-align: center; }
.page-shell { min-height: 100vh; padding: 28px 16px 110px; background: #f3f1ea; }
.page-header, .dashboard-header { max-width: 760px; margin: 0 auto 24px; padding: 12px 4px; }
.page-header h1, .dashboard-header h1 { margin: 0; font-family: "Songti SC", serif; font-size: 30px; font-weight: 600; }
.page-header > p:last-child, .dashboard-header > div > p:last-child { color: #73817d; line-height: 1.6; }
.page-shell { min-height: 100vh; padding: 20px var(--page-gutter, 16px) calc(88px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, #bfe3fc 0%, #e0f2fe 22%, #f0f9ff 48%, #f8fafc 100%); }
.page-header, .dashboard-header { max-width: 760px; margin: 0 auto 20px; padding: 12px 4px; }
.page-header h1, .dashboard-header h1 { margin: 0; font-size: 28px; font-weight: 700; color: #0f172a; }
.page-header > p:last-child, .dashboard-header > div > p:last-child { color: #64748b; line-height: 1.6; }
.section-card, .hero-card, .metric-strip { max-width: 760px; margin: 0 auto 16px; padding: 20px; background: #fff; border: 1px solid rgba(18,63,55,.06); border-radius: 20px; box-shadow: 0 8px 24px rgba(31,66,58,.05); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title > span { font-size: 18px; font-weight: 700; }
.section-title small { color: #82908c; }
.section-card, .hero-card, .metric-strip { max-width: 760px; margin: 0 auto 16px; padding: 20px; background: #fff; border: 1px solid rgba(2, 132, 199, 0.06); border-radius: 18px; box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title > span { font-size: 17px; font-weight: 700; color: #0f172a; }
.section-title small { color: #64748b; }
.section-title button {
border: 0;
background: rgba(12, 80, 69, 0.08);
background: rgba(2, 132, 199, 0.08);
color: var(--green);
padding: 4px 10px;
border-radius: 12px;
@@ -141,13 +299,13 @@ button { cursor: pointer; }
display: flex;
flex-direction: column;
align-items: center;
border: 1px solid var(--line);
border: 1px solid #e2e8f0;
border-radius: 16px;
background: #f8f8f4;
background: #f8fafc;
color: var(--deep);
transition: .2s;
}
.module-card.selected { color: #fff; background: var(--green); transform: translateY(-2px); box-shadow: 0 12px 24px rgba(12,80,69,.18); }
.module-card.selected { color: #fff; background: var(--green); transform: translateY(-2px); box-shadow: 0 12px 24px rgba(2, 132, 199, 0.2); }
.module-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 10px; border: 1px solid currentColor; border-radius: 50%; font-size: 20px; flex-shrink: 0; }
.module-card strong { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.module-card small { display: flex; align-items: center; justify-content: center; min-height: 28px; margin-top: 2px; opacity: .7; line-height: 1.35; font-size: 11px; }
@@ -162,7 +320,7 @@ button { cursor: pointer; }
font-style: normal;
font-weight: 600;
white-space: nowrap;
background: rgba(18, 63, 55, 0.08);
background: #f1f5f9;
color: var(--deep);
}
.module-card.selected i {
@@ -172,42 +330,43 @@ button { cursor: pointer; }
.form-card .van-field { padding: 12px 0; border-bottom: 1px solid #eee; }
.form-card .van-field:last-of-type { border-bottom: 0; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.sticky-action { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; padding: 14px 20px max(14px, env(safe-area-inset-bottom)); background: rgba(248,246,240,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.sticky-action .van-button { max-width: 720px; height: 50px; margin: 0 auto; font-size: 15px; font-weight: 600; box-shadow: 0 6px 18px rgba(12,80,69,.2); }
.sticky-action { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; padding: 14px 20px max(14px, env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(14px); border-top: 1px solid rgba(2, 132, 199, 0.08); }
.sticky-action .van-button { max-width: 720px; height: 50px; margin: 0 auto; font-size: 15px; font-weight: 600; box-shadow: 0 6px 18px rgba(2, 132, 199, 0.2); }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; }
.avatar-button { width: 46px; height: 46px; color: #fff; border: 0; border-radius: 50%; background: var(--green); }
.hero-card { padding: 26px; color: #fff; background: linear-gradient(140deg, #0c5549, #163f38); }
.hero-card h2 { margin: 6px 0 12px; font-family: "Songti SC", serif; font-size: 28px; }
.hero-card > p:not(.eyebrow) { color: rgba(255,255,255,.72); line-height: 1.7; }
.avatar-button { width: 44px; height: 44px; color: #0284c7; border: 1.5px solid rgba(2, 132, 199, 0.2); border-radius: 50%; background: #f0f9ff; font-weight: 700; box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08); }
.hero-card { padding: 20px 18px; color: #0f172a; background: #ffffff; border: 1px solid #eef2f6; border-radius: 16px; box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05); }
.hero-card h2 { margin: 6px 0 10px; font-size: 20px; font-weight: 700; color: #0f172a; }
.hero-card > p:not(.eyebrow) { color: #64748b; line-height: 1.65; font-size: 13px; }
.tag-row { display: flex; gap: 8px; margin: 18px 0; }
.tag-row span { padding: 6px 12px; border-radius: 20px; background: rgba(255,255,255,.12); font-size: 12px; }
.tag-row span { padding: 6px 12px; border-radius: 20px; background: rgba(255,255,255,.16); font-size: 12px; }
.metric-strip { display: grid; grid-template-columns: repeat(3, 1fr); padding: 16px 8px; }
.metric-strip div { padding: 4px 14px; border-right: 1px solid var(--line); }
.metric-strip div:last-child { border-right: 0; }
.metric-strip small, .metric-strip strong { display: block; }
.metric-strip small { color: #80908b; font-size: 11px; }
.metric-strip small { color: #64748b; font-size: 11px; }
.metric-strip strong { margin-top: 7px; font-size: 21px; }
.metric-strip em { margin-left: 3px; font-size: 11px; font-style: normal; font-weight: 500; }
.plan-item { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid #edf0ec; }
.plan-item { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid #f1f5f9; }
.plan-item:first-of-type { border-top: 0; }
.plan-index { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--green); background: #e9f1ed; }
.plan-index { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--green); background: #f0f9ff; }
.plan-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.plan-heading span { color: #b1813f; font-size: 12px; text-align: right; }
.plan-item p, .scene-row p { margin: 7px 0 0; color: #75847f; font-size: 13px; line-height: 1.6; }
.status-dot { color: #a27639 !important; text-align: right; }
.status-dot.online { color: #1c806a !important; }
.plan-heading span { color: #0284c7; font-size: 12px; text-align: right; }
.plan-item p, .scene-row p { margin: 7px 0 0; color: #64748b; font-size: 13px; line-height: 1.6; }
.status-dot { color: #f59e0b !important; text-align: right; }
.status-dot.online { color: #10b981 !important; }
.device-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
/* Health Space Enhancement */
.ha-summary-bar {
display: flex;
align-items: center;
justify-content: space-around;
background: #fbfbf9;
background: #ffffff;
border-radius: 12px;
padding: 10px 12px;
margin-bottom: 14px;
border: 1px solid rgba(18, 63, 55, 0.06);
border: 1px solid rgba(2, 132, 199, 0.08);
box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}
.summary-item {
text-align: center;
@@ -221,18 +380,19 @@ button { cursor: pointer; }
top: 20%;
height: 60%;
width: 1px;
background: rgba(18, 63, 55, 0.08);
background: rgba(226, 232, 240, 0.8);
}
.summary-item span { display: block; font-size: 11px; color: #82908c; }
.summary-item strong { display: block; font-size: 16px; color: var(--green); margin-top: 2px; }
.summary-item em { font-size: 12px; font-style: normal; color: #82908c; font-weight: normal; }
.smart-subcard {
background: #fafaf8;
border: 1px solid rgba(18, 63, 55, 0.06);
background: #ffffff;
border: 1px solid rgba(2, 132, 199, 0.06);
border-radius: 14px;
padding: 13px;
margin-bottom: 12px;
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.02);
}
.smart-subcard:last-child { margin-bottom: 0; }
.subcard-header {
@@ -265,10 +425,10 @@ button { cursor: pointer; }
font-size: 11px;
font-weight: 500;
color: var(--green);
background: #edf7f3;
background: #f0f9ff;
padding: 3px 9px;
border-radius: 12px;
border: 1px solid rgba(12, 80, 69, 0.15);
border: 1px solid rgba(2, 132, 199, 0.2);
cursor: pointer;
transition: all 0.2s;
white-space: nowrap;
@@ -282,7 +442,7 @@ button { cursor: pointer; }
font-size: 11px;
font-weight: 500;
color: var(--green);
background: #edf7f3;
background: #f0f9ff;
padding: 2px 8px;
border-radius: 10px;
white-space: nowrap;
@@ -296,7 +456,7 @@ button { cursor: pointer; }
white-space: nowrap;
flex-shrink: 0;
}
.device-mini-status.green { background: #edf7f3; color: var(--green); }
.device-mini-status.green { background: #f0f9ff; color: var(--green); }
.device-mini-status.yellow { background: #fef7ec; color: #b8860b; }
.device-mini-status.gray { background: #f1f3f2; color: #82908c; }
@@ -305,7 +465,7 @@ button { cursor: pointer; }
font-weight: 500;
padding: 3px 9px;
border-radius: 10px;
border: 1px solid rgba(18, 63, 55, 0.15);
border: 1px solid rgba(2, 132, 199, 0.2);
background: #fff;
color: var(--green);
cursor: pointer;
@@ -314,7 +474,7 @@ button { cursor: pointer; }
transition: all 0.2s;
}
.sensor-mini-sync-btn:active {
background: #edf7f3;
background: #f0f9ff;
}
.sensor-mini-sync-btn:disabled {
opacity: 0.5;
@@ -329,8 +489,8 @@ button { cursor: pointer; }
padding: 12px 14px;
border-radius: 12px;
background: #fff;
border: 1px solid rgba(18, 63, 55, 0.06);
box-shadow: 0 1px 2px rgba(18, 63, 55, 0.02);
border: 1px solid rgba(2, 132, 199, 0.06);
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}
.scene-info {
flex: 1;
@@ -342,7 +502,7 @@ button { cursor: pointer; }
}
.scene-info p {
margin: 3px 0 0;
color: #75847f;
color: #64748b;
font-size: 12px;
line-height: 1.5;
white-space: nowrap;
@@ -358,17 +518,17 @@ button { cursor: pointer; }
white-space: nowrap;
flex-shrink: 0;
padding: 7px 15px;
border: 1px solid rgba(12, 80, 69, 0.2);
border: 1px solid rgba(2, 132, 199, 0.2);
border-radius: 16px;
color: var(--green);
background: #edf7f3;
background: #f0f9ff;
font-size: 12px;
font-weight: 600;
cursor: pointer;
transition: .2s;
}
.scene-row button:active { background: var(--green); color: #fff; }
.scene-row button.secondary { color: #6e604f; border-color: rgba(110,96,79,.2); background: #f6f3ee; }
.scene-row button.secondary { color: #475569; border-color: #cbd5e1; background: #f8fafc; }
.scene-row button:disabled { cursor: not-allowed; opacity: .45; }
.scene-device-list {
@@ -383,11 +543,11 @@ button { cursor: pointer; }
gap: 6px;
padding: 6px 9px;
background: #fff;
border: 1px solid rgba(18, 63, 55, 0.06);
border: 1px solid rgba(2, 132, 199, 0.06);
border-radius: 10px;
min-width: 0;
box-sizing: border-box;
box-shadow: 0 1px 2px rgba(18, 63, 55, 0.02);
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}
.scene-device-chip .dot {
width: 6px;
@@ -422,9 +582,9 @@ button { cursor: pointer; }
transition: all 0.2s;
}
.chip-toggle-btn.on {
background: #0c5045;
background: var(--primary);
color: #ffffff;
border-color: #0c5045;
border-color: var(--primary);
}
.chip-toggle-btn.disabled {
opacity: 0.45;
@@ -438,7 +598,7 @@ button { cursor: pointer; }
.scene-presets-panel {
margin-top: 12px;
padding-top: 10px;
border-top: 1px dashed rgba(18, 63, 55, 0.12);
border-top: 1px dashed rgba(2, 132, 199, 0.12);
}
.preset-panel-header {
display: flex;
@@ -462,13 +622,13 @@ button { cursor: pointer; }
}
.preset-card-item {
background: #ffffff;
border: 1px solid rgba(18, 63, 55, 0.06);
border: 1px solid rgba(2, 132, 199, 0.06);
border-radius: 10px;
padding: 8px 10px;
box-shadow: 0 1px 2px rgba(18, 63, 55, 0.02);
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
}
.preset-card-item.unavailable {
background: #f7f8f7;
background: #f8fafc;
opacity: 0.72;
}
.preset-card-top {
@@ -495,21 +655,21 @@ button { cursor: pointer; }
font-weight: 500;
padding: 1px 6px;
border-radius: 6px;
background: #edf7f3;
color: var(--green);
background: #f0f9ff;
color: var(--primary);
white-space: nowrap;
flex-shrink: 0;
}
.preset-detail {
margin: 3px 0 0 20px;
font-size: 11px;
color: #657470;
color: #64748b;
line-height: 1.4;
}
.preset-availability {
margin: 4px 0 0 20px;
font-size: 10px;
color: var(--green);
color: var(--primary);
}
.preset-availability.unavailable {
color: #9a6a38;
@@ -731,13 +891,13 @@ button { cursor: pointer; }
transition: all 0.2s;
}
.device-switch-pill.on {
background: #edf7f3;
border-color: rgba(16, 185, 129, 0.4);
color: var(--green);
background: #f0f9ff;
border-color: rgba(2, 132, 199, 0.4);
color: var(--primary);
}
.device-switch-pill.on .switch-knob {
background: #10b981;
box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
background: #0284c7;
box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}
.device-switch-pill.disabled {
opacity: 0.45;
@@ -749,15 +909,15 @@ button { cursor: pointer; }
font-weight: 500;
padding: 2px 8px;
border-radius: 10px;
border: 1px solid rgba(18, 63, 55, 0.15);
border: 1px solid rgba(2, 132, 199, 0.2);
background: #fff;
color: var(--green);
color: var(--primary);
cursor: pointer;
white-space: nowrap;
transition: all 0.2s;
}
.sensor-sync-pill:active {
background: #edf7f3;
background: #f0f9ff;
}
.sensor-sync-pill:disabled {
opacity: 0.5;
@@ -771,16 +931,16 @@ button { cursor: pointer; }
border-radius: 10px;
white-space: nowrap;
}
.status-pill.green { background: #edf7f3; color: var(--green); }
.status-pill.green { background: #f0f9ff; color: var(--primary); }
.status-pill.yellow { background: #fef7ec; color: #b8860b; }
.status-pill.gray { background: #f1f3f2; color: #82908c; }
.entity-count { font-size: 10px; color: #9aa4a1; }
.medical-note { max-width: 760px; margin: 24px auto; color: #969e9b; font-size: 11px; text-align: center; }
.loading-card { color: #73817d; text-align: center; }
.medical-note { max-width: 760px; margin: 24px auto; color: #94a3b8; font-size: 11px; text-align: center; }
.loading-card { color: #64748b; text-align: center; }
@media (max-width: 520px) {
.brand-panel { padding: 42px 20px 42px; }
.auth-card { margin-top: -16px; }
.brand-panel { padding: 16px 4px 20px; }
.auth-card { margin-top: 0; }
.plan-heading { display: block; }
.plan-heading span { display: block; margin-top: 5px; text-align: left; }
.device-grid { grid-template-columns: 1fr; }
@@ -791,6 +951,7 @@ button { cursor: pointer; }
.dashboard-page {
padding: 20px var(--page-gutter, 16px) calc(88px + env(safe-area-inset-bottom, 0px));
background: linear-gradient(180deg, #bfe3fc 0%, #e0f2fe 22%, #f0f9ff 48%, #f8fafc 100%);
}
.dashboard-header {
margin: 0 auto 20px;
@@ -808,12 +969,13 @@ button { cursor: pointer; }
/* 评估未填提醒卡片 */
.assessment-guide-banner {
background: linear-gradient(135deg, #b37318, #92580c);
color: #fff;
background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
color: #0f172a;
border-radius: 18px;
padding: 16px;
margin-bottom: 14px;
box-shadow: 0 6px 18px rgba(179, 115, 24, 0.22);
border: 1px solid rgba(2, 132, 199, 0.16);
box-shadow: 0 4px 14px rgba(2, 132, 199, 0.06);
cursor: pointer;
position: relative;
overflow: hidden;
@@ -825,18 +987,19 @@ button { cursor: pointer; }
bottom: -20px;
width: 100px;
height: 100px;
background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
background: radial-gradient(circle, rgba(2, 132, 199, 0.08) 0%, transparent 70%);
border-radius: 50%;
}
.guide-badge {
display: inline-block;
background: rgba(255, 255, 255, 0.22);
color: #fff;
background: #ffffff;
color: #0284c7;
font-size: 10px;
font-weight: 700;
padding: 2px 8px;
border-radius: 10px;
margin-bottom: 8px;
border: 1px solid rgba(2, 132, 199, 0.18);
}
.guide-body {
display: flex;
@@ -848,11 +1011,12 @@ button { cursor: pointer; }
margin: 0 0 4px;
font-size: 15px;
font-weight: 700;
color: #0f172a;
}
.guide-text p {
margin: 0;
font-size: 12px;
color: rgba(255, 255, 255, 0.88);
color: #64748b;
line-height: 1.4;
}
.guide-btn {
@@ -860,22 +1024,22 @@ button { cursor: pointer; }
padding: 8px 14px;
border-radius: 16px;
border: 0;
background: #ffffff;
color: #92580c;
background: #0284c7;
color: #ffffff;
font-size: 12px;
font-weight: 700;
cursor: pointer;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}
/* 个性化舒睡启动参数卡片 */
.personalized-startup-card {
background: #ffffff;
border: 1px solid rgba(12, 80, 69, 0.1);
border: 1px solid rgba(2, 132, 199, 0.08);
border-radius: 20px;
padding: 18px 16px;
margin-bottom: 14px;
box-shadow: 0 4px 16px rgba(18, 63, 55, 0.04);
box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}
.personalized-startup-card .section-title {
display: flex;
@@ -885,13 +1049,13 @@ button { cursor: pointer; }
.personalized-startup-card .section-title > span {
font-size: 17px;
font-weight: 700;
color: #143d36;
color: #0f172a;
letter-spacing: 0.01em;
}
.startup-card-desc {
margin: 0 0 14px;
font-size: 12px;
color: #72847e;
color: #64748b;
line-height: 1.55;
}
.startup-params-tags {
@@ -901,20 +1065,20 @@ button { cursor: pointer; }
margin-bottom: 14px;
}
.startup-param-badge {
background: #f7f6f2;
border: 1px solid rgba(18, 63, 55, 0.08);
background: #f8fafc;
border: 1px solid rgba(2, 132, 199, 0.08);
border-radius: 10px;
padding: 8px 10px;
}
.startup-param-badge .lbl {
display: block;
font-size: 10px;
color: #849690;
color: #64748b;
margin-bottom: 2px;
}
.startup-param-badge strong {
font-size: 12px;
color: #173d36;
color: #0f172a;
}
.startup-scene-actions {
display: grid;
@@ -934,21 +1098,23 @@ button { cursor: pointer; }
opacity: 0.45;
}
.startup-action-primary {
border: 1px solid #0c5045;
background: #0c5045;
border: none;
background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
color: #ffffff;
box-shadow: 0 6px 16px -2px rgba(2, 132, 199, 0.35);
border-radius: 14px;
}
.startup-action-secondary {
border: 1px solid rgba(12, 80, 69, 0.2);
background: #f7f6f2;
color: #335b53;
border: 1px solid #e2e8f0;
background: #f8fafc;
color: #475569;
}
.detail-entry-bar {
display: flex;
align-items: center;
justify-content: space-between;
background: #f8f7f2;
border: 1px solid rgba(18, 63, 55, 0.08);
background: #f8fafc;
border: 1px solid rgba(2, 132, 199, 0.06);
border-radius: 12px;
padding: 10px 12px;
margin-top: 12px;
@@ -956,7 +1122,7 @@ button { cursor: pointer; }
transition: all 0.2s;
}
.detail-entry-bar:active {
background: #f0eee7;
background: #f1f5f9;
}
.entry-left {
display: flex;
@@ -969,15 +1135,15 @@ button { cursor: pointer; }
.entry-left strong {
display: block;
font-size: 12px;
color: #173d36;
color: #0f172a;
}
.entry-left small {
display: block;
font-size: 11px;
color: #82928c;
color: #64748b;
}
.detail-entry-bar .arrow {
color: #a0ada7;
color: #94a3b8;
font-size: 14px;
}
@@ -986,8 +1152,8 @@ button { cursor: pointer; }
display: flex;
align-items: center;
justify-content: space-between;
background: linear-gradient(135deg, #edf6f3, #e5f0ec);
border: 1px solid rgba(12, 80, 69, 0.16);
background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
border: 1px solid rgba(2, 132, 199, 0.16);
border-radius: 14px;
padding: 12px 14px;
margin-top: 14px;
@@ -995,7 +1161,7 @@ button { cursor: pointer; }
transition: all 0.2s;
}
.all-control-banner:active {
background: #dbeef7;
background: #d4edff;
}
.ac-text {
display: flex;
@@ -1008,17 +1174,17 @@ button { cursor: pointer; }
.ac-text strong {
display: block;
font-size: 13px;
color: #0c5045;
color: #0284c7;
font-weight: 700;
}
.ac-text small {
display: block;
font-size: 11px;
color: #55756d;
color: #0284c7;
margin-top: 2px;
}
.ac-arrow {
font-size: 16px;
color: #0c5045;
color: #0284c7;
font-weight: 700;
}
+75 -70
View File
@@ -1,5 +1,5 @@
.control-page {
background: #f2f0e9;
background: linear-gradient(180deg, #bfe3fc 0%, #e0f2fe 22%, #f0f9ff 48%, #f8fafc 100%);
min-height: 100vh;
padding-bottom: 40px;
overflow-x: hidden;
@@ -15,7 +15,7 @@
padding: 14px 16px;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
border-bottom: 1px solid rgba(18, 63, 55, 0.08);
border-bottom: 1px solid rgba(2, 132, 199, 0.08);
}
.control-page .back-btn {
@@ -24,7 +24,7 @@
gap: 4px;
border: 0;
background: transparent;
color: #0c5045;
color: #0284c7;
font-size: 13px;
font-weight: 600;
cursor: pointer;
@@ -34,13 +34,13 @@
margin: 0;
font-size: 15px;
font-weight: 700;
color: #153e37;
color: #0f172a;
}
.control-page .refresh-btn {
border: 0;
background: transparent;
color: #0c5045;
color: #0284c7;
font-size: 13px;
font-weight: 600;
cursor: pointer;
@@ -58,19 +58,20 @@
/* 汇总卡片 */
.control-page .summary-box {
background: linear-gradient(135deg, #0c5045, #14443c);
color: #fff;
background: #ffffff;
color: #0f172a;
border-radius: 20px;
padding: 16px;
padding: 18px 16px;
margin-bottom: 14px;
box-shadow: 0 6px 20px rgba(12, 80, 69, 0.12);
border: 1px solid rgba(2, 132, 199, 0.08);
box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}
.control-page .summary-info {
display: flex;
justify-content: space-around;
padding-bottom: 14px;
border-bottom: 1px solid rgba(255, 255, 255, 0.15);
border-bottom: 1px solid #f1f5f9;
}
.control-page .stat-item {
@@ -81,16 +82,17 @@
display: block;
font-size: 22px;
font-weight: 700;
font-family: serif;
font-family: inherit;
color: #0f172a;
}
.control-page .stat-item .num.online {
color: #92eec4;
color: #0284c7;
}
.control-page .stat-item .label {
font-size: 11px;
color: rgba(255, 255, 255, 0.75);
color: #64748b;
}
.control-page .scene-actions-grid {
@@ -118,17 +120,20 @@
}
.control-page .sleep-btn {
background: rgba(214, 166, 87, 0.2);
background: #0284c7;
color: #fff;
border: 1px solid #0284c7;
box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}
.control-page .sleep-btn:active {
background: rgba(214, 166, 87, 0.35);
background: #0958d9;
}
.control-page .off-btn {
background: rgba(255, 255, 255, 0.08);
color: rgba(255, 255, 255, 0.85);
background: #f8fafc;
color: #475569;
border: 1px solid #e2e8f0;
}
.control-page .s-icon {
@@ -156,7 +161,7 @@
min-height: 38px;
padding: 9px 12px;
margin: -4px 2px 14px;
border: 1px solid rgba(12, 80, 69, 0.12);
border: 1px solid rgba(2, 132, 199, 0.12);
border-radius: 12px;
background: rgba(255, 255, 255, 0.72);
color: #536a62;
@@ -164,9 +169,9 @@
}
.control-page .operation-status.success {
border-color: rgba(12, 80, 69, 0.22);
background: #f0f8f5;
color: #0c5045;
border-color: rgba(2, 132, 199, 0.22);
background: #f0f9ff;
color: #0284c7;
}
.control-page .operation-status.fail {
@@ -204,8 +209,8 @@
.control-page .operation-spinner {
width: 15px;
height: 15px;
border: 2px solid rgba(12, 80, 69, 0.18);
border-top-color: #0c5045;
border: 2px solid rgba(2, 132, 199, 0.18);
border-top-color: #0284c7;
border-radius: 50%;
animation: operation-spin 0.75s linear infinite;
}
@@ -220,8 +225,8 @@
border-radius: 20px;
padding: 16px;
margin-bottom: 14px;
border: 1px solid rgba(18, 63, 55, 0.06);
box-shadow: 0 4px 16px rgba(18, 63, 55, 0.04);
border: 1px solid rgba(2, 132, 199, 0.06);
box-shadow: 0 4px 16px rgba(2, 132, 199, 0.04);
}
.control-page .device-head {
@@ -230,7 +235,7 @@
align-items: flex-start;
margin-bottom: 14px;
padding-bottom: 12px;
border-bottom: 1px solid rgba(18, 63, 55, 0.06);
border-bottom: 1px solid rgba(2, 132, 199, 0.06);
}
.control-page .speaker-actions {
@@ -241,8 +246,8 @@
.control-page .category-tag {
font-size: 10px;
color: #0c5045;
background: #eef6f3;
color: #0284c7;
background: #f0f9ff;
padding: 2px 6px;
border-radius: 4px;
font-weight: 700;
@@ -251,7 +256,7 @@
.control-page .dev-info h3 {
margin: 4px 0 2px;
font-size: 15px;
color: #173d36;
color: #0f172a;
font-weight: 700;
}
@@ -261,14 +266,14 @@
}
.control-page .status-dot.online {
color: #0c5045;
color: #0284c7;
font-weight: 600;
}
.control-page .text-refresh {
border: 0;
background: transparent;
color: #0c5045;
color: #0284c7;
font-size: 11px;
font-weight: 600;
}
@@ -307,14 +312,14 @@
.control-page .p-val {
font-size: 14px;
color: #0c5045;
color: #0284c7;
font-weight: 700;
line-height: 1.2;
}
.control-page .p-tip {
font-size: 11px;
color: #8fa099;
color: #64748b;
}
.control-page .light-mode-panel {
@@ -407,20 +412,20 @@
.control-page .btn-group button {
flex: 1;
padding: 8px 4px;
background: #f7f6f2;
border: 1px solid rgba(18, 63, 55, 0.1);
background: #f8fafc;
border: 1px solid rgba(2, 132, 199, 0.1);
border-radius: 8px;
font-size: 12px;
color: #4b5e57;
color: #334155;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
}
.control-page .btn-group button.active {
background: #0c5045;
background: #0284c7;
color: #fff;
border-color: #0c5045;
border-color: #0284c7;
font-weight: 700;
}
@@ -433,18 +438,18 @@
.control-page .mini-toggle {
padding: 6px 14px;
border-radius: 14px;
border: 1px solid rgba(18, 63, 55, 0.15);
background: #f4f3ef;
color: #6a7c76;
border: 1px solid rgba(2, 132, 199, 0.15);
background: #f8fafc;
color: #64748b;
font-size: 12px;
font-weight: 600;
cursor: pointer;
}
.control-page .mini-toggle.active {
background: #0c5045;
background: #0284c7;
color: #fff;
border-color: #0c5045;
border-color: #0284c7;
}
/* 传感器网格 */
@@ -455,7 +460,7 @@
}
.control-page .sensor-box {
background: #f8f7f2;
background: #f8fafc;
border-radius: 12px;
padding: 10px 8px;
text-align: center;
@@ -464,13 +469,13 @@
.control-page .s-label {
display: block;
font-size: 11px;
color: #798a83;
color: #64748b;
margin-bottom: 4px;
}
.control-page .sensor-box strong {
font-size: 14px;
color: #173d36;
color: #0f172a;
}
.control-page .sensor-box small {
@@ -481,17 +486,17 @@
.control-page .scale-note {
margin: 0;
font-size: 12px;
color: #72847d;
color: #64748b;
line-height: 1.6;
}
.control-page .tcm-guide-button {
width: 100%;
margin-top: 10px;
border: 1px solid rgba(255, 255, 255, .35);
border: 1px solid rgba(2, 132, 199, 0.2);
border-radius: 12px;
background: rgba(255, 255, 255, .12);
color: #fff;
background: #f0f9ff;
color: #0284c7;
min-height: 40px;
font-size: 12px;
font-weight: 700;
@@ -505,41 +510,41 @@
.control-page .top-nav h2 { min-width: 0; margin: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.control-page .back-btn, .control-page .refresh-btn { flex-shrink: 0; }
.control-page .device-list-heading { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 0; }
.control-page .device-list-heading h3 { margin: 0; color: #173d36; font-size: 18px; }
.control-page .device-list-heading h3 { margin: 0; color: #0f172a; font-size: 18px; }
.control-page .device-list-heading > span { color: #86948b; font-size: 12px; }
.control-page .device-list-hint { margin: 7px 2px 14px; color: #84948b; font-size: 12px; line-height: 1.6; }
.control-page .device-room-tabs { display: flex; gap: 22px; overflow-x: auto; padding: 0 2px; margin-bottom: 14px; scrollbar-width: none; }
.control-page .device-room-tabs button { flex-shrink: 0; border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 8px 0; color: #8a978f; font-size: 14px; cursor: pointer; }
.control-page .device-room-tabs button.active { color: #0c5045; font-weight: 700; border-bottom-color: #0c5045; }
.control-page .device-room-tabs button { flex-shrink: 0; border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 8px 0; color: #64748b; font-size: 14px; cursor: pointer; }
.control-page .device-room-tabs button.active { color: #0284c7; font-weight: 700; border-bottom-color: #0284c7; }
.control-page .device-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.control-page .device-overview-tile { position: relative; min-width: 0; background: #fff; border: 1px solid rgba(18, 63, 55, .06); border-radius: 20px; overflow: hidden; box-shadow: 0 3px 16px rgba(18, 63, 55, .025); }
.control-page .device-overview-tile.powered { border-color: #bfd7cb; }
.control-page .device-tile-open { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 230px; padding: 17px 14px 13px; border: 0; background: transparent; color: #31584a; text-align: left; cursor: pointer; }
.control-page .device-overview-tile { position: relative; min-width: 0; background: #fff; border: 1px solid rgba(2, 132, 199, .06); border-radius: 20px; overflow: hidden; box-shadow: 0 3px 16px rgba(2, 132, 199, .025); }
.control-page .device-overview-tile.powered { border-color: rgba(2, 132, 199, 0.3); }
.control-page .device-tile-open { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 230px; padding: 17px 14px 13px; border: 0; background: transparent; color: #0f172a; text-align: left; cursor: pointer; }
.control-page .device-tile-category { width: calc(100% - 42px); font-size: 10px; color: #87968c; }
.control-page .device-glyph { width: 76px; height: 76px; margin: 13px 0 9px; flex-shrink: 0; }
.control-page .device-tile-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; width: 100%; min-height: 38px; line-height: 19px; font-size: 14px; font-weight: 700; color: #203d32; overflow-wrap: anywhere; }
.control-page .device-tile-status { display: flex; align-items: center; gap: 5px; margin-top: 7px; color: #708279; font-size: 11px; line-height: 16px; }
.control-page .device-tile-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; width: 100%; min-height: 38px; line-height: 19px; font-size: 14px; font-weight: 700; color: #0f172a; overflow-wrap: anywhere; }
.control-page .device-tile-status { display: flex; align-items: center; gap: 5px; margin-top: 7px; color: #64748b; font-size: 11px; line-height: 16px; }
.control-page .device-tile-status i { width: 5px; height: 5px; border-radius: 50%; background: #bcc4be; flex-shrink: 0; }
.control-page .device-tile-status i.online { background: #609b7f; }
.control-page .device-tile-metric { margin-top: 3px; color: #9aa59d; font-size: 10px; line-height: 16px; }
.control-page .device-tile-footer { display: flex; justify-content: space-between; align-items: center; gap: 4px; width: 100%; padding-top: 10px; margin-top: auto; color: #a0aaa2; font-size: 10px; line-height: 15px; }
.control-page .device-tile-status i.online { background: #10b981; }
.control-page .device-tile-metric { margin-top: 3px; color: #64748b; font-size: 10px; line-height: 16px; }
.control-page .device-tile-footer { display: flex; justify-content: space-between; align-items: center; gap: 4px; width: 100%; padding-top: 10px; margin-top: auto; color: #64748b; font-size: 10px; line-height: 15px; }
.control-page .device-tile-footer > span { font-size: 18px; color: #738b7d; }
.control-page .device-tile-power { position: absolute; right: 11px; top: 12px; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f0f2ed; color: #849187; cursor: pointer; }
.control-page .device-tile-power.on { background: #e3f0e8; color: #0c5045; }
.control-page .device-tile-power { position: absolute; right: 11px; top: 12px; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f8fafc; color: #849187; cursor: pointer; }
.control-page .device-tile-power.on { background: #f0f9ff; color: #0284c7; }
.control-page .device-tile-power svg { width: 21px; height: 21px; }
.control-page .device-tile-power:disabled { opacity: .45; cursor: not-allowed; }
.control-page .device-overview-tile.offline .device-glyph { opacity: .45; }
.control-page .device-overview-tile.offline .device-tile-name { color: #8e9991; }
.control-page .device-tile-open:focus-visible, .control-page .device-tile-power:focus-visible, .control-page .device-room-tabs button:focus-visible { outline: 2px solid #649b82; outline-offset: -3px; }
.control-page .device-tile-skeleton { height: 252px; border-radius: 20px; background: #f9faf6; border: 1px solid rgba(18, 63, 55, .04); }
.control-page .device-empty-state { padding: 28px 20px; border-radius: 20px; background: #fff; text-align: center; color: #86968d; font-size: 13px; line-height: 1.7; }
.control-page .device-empty-state strong { display: block; color: #3f5e4d; font-size: 15px; }
.control-page .device-tile-open:focus-visible, .control-page .device-tile-power:focus-visible, .control-page .device-room-tabs button:focus-visible { outline: 2px solid #0284c7; outline-offset: -3px; }
.control-page .device-tile-skeleton { height: 252px; border-radius: 20px; background: #f9faf6; border: 1px solid rgba(2, 132, 199, .04); }
.control-page .device-empty-state { padding: 28px 20px; border-radius: 20px; background: #fff; text-align: center; color: #64748b; font-size: 13px; line-height: 1.7; }
.control-page .device-empty-state strong { display: block; color: #0f172a; font-size: 15px; }
.control-page .device-empty-state p { margin: 10px 0 16px; overflow-wrap: anywhere; }
.control-page .device-connection-note { padding: 11px 13px; margin-bottom: 14px; background: #fff5e5; border-radius: 12px; color: #a47b43; font-size: 12px; line-height: 1.6; }
.control-page .device-information { padding: 17px; border-radius: 20px; background: #fff; }
.control-page .device-information h3 { margin: 0 0 10px; font-size: 13px; color: #607a6b; }
.control-page .device-information p { display: flex; justify-content: space-between; gap: 16px; margin: 10px 0 0; font-size: 12px; color: #87968d; }
.control-page .device-information p span:last-child { color: #486657; text-align: right; overflow-wrap: anywhere; }
.control-page .device-information h3 { margin: 0 0 10px; font-size: 13px; color: #0f172a; }
.control-page .device-information p { display: flex; justify-content: space-between; gap: 16px; margin: 10px 0 0; font-size: 12px; color: #64748b; }
.control-page .device-information p span:last-child { color: #0f172a; text-align: right; overflow-wrap: anywhere; }
@media (max-width: 350px) {
.control-page .device-grid { gap: 8px; }
.control-page .device-tile-open { padding-left: 11px; padding-right: 11px; }
+83 -75
View File
@@ -1,25 +1,28 @@
/* Demo 的共用视觉层:沿用暖白 / 深绿,不改动设备参数或评分规则。 */
/* Demo 的共用视觉层:现代科技蓝 / 纯白轻卡片,不改动设备参数或评分规则。 */
:root {
--page-gutter: 16px;
--surface-radius: 20px;
--surface-shadow: 0 4px 18px rgba(18, 63, 55, .035);
--muted-text: #65776e;
--surface-shadow: 0 4px 20px rgba(15, 23, 42, .04);
--muted-text: #64748b;
}
button, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, summary:focus-visible, a:focus-visible {
outline: 2px solid #4d937b;
outline: 2px solid #0284c7;
outline-offset: 3px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
outline: 2px solid rgba(12, 80, 69, .35);
outline: 2px solid rgba(2, 132, 199, .35);
outline-offset: 1px;
}
button:disabled { cursor: not-allowed; }
button, input, textarea, select { max-width: 100%; }
input, textarea { accent-color: var(--green); }
#app :is(.page-shell, .assessment-page, .tcm-page, .profile-page) {
padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
#app :is(.page-shell, .dashboard-page, .assessment-page, .tcm-page, .profile-page) {
padding: 20px var(--page-gutter, 16px) calc(88px + env(safe-area-inset-bottom, 0px));
background: linear-gradient(180deg, #bfe3fc 0%, #e0f2fe 22%, #f0f9ff 48%, #f8fafc 100%);
min-height: 100vh;
box-sizing: border-box;
}
#app :is(.section-card, .profile-card, .tcm-card, .card-section) {
border-radius: var(--surface-radius);
@@ -32,82 +35,83 @@ input, textarea { accent-color: var(--green); }
}
#app .dashboard-header { gap: 16px; align-items: center; }
#app .dashboard-header > div { min-width: 0; }
#app .dashboard-header .eyebrow { margin-bottom: 7px; font-size: 10px; }
#app .avatar-button { flex-shrink: 0; font-weight: 700; box-shadow: 0 0 0 5px rgba(12, 80, 69, .045); }
#app .dashboard-header .eyebrow { margin-bottom: 7px; font-size: 10px; color: #0284c7; }
#app .avatar-button { flex-shrink: 0; font-weight: 700; box-shadow: 0 2px 8px rgba(2, 132, 199, .1); background: #f0f9ff; color: #0284c7; border: 1.5px solid rgba(2, 132, 199, 0.2); }
#app .dashboard-page .personalized-startup-card { padding: 20px 18px 16px; }
#app .personalized-startup-card .section-title { gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
#app .personalized-startup-card .section-title > span:first-child { font-size: 19px; }
#app .constitution-chip { background: #eaf3ed; padding: 5px 10px; border-radius: 20px; color: #0c5045; font-size: 12px; font-weight: 600; }
#app .constitution-chip { background: #f0f9ff; padding: 5px 10px; border-radius: 20px; color: #0284c7; font-size: 12px; font-weight: 600; }
#app .startup-card-desc { color: var(--muted-text); font-size: 12px; line-height: 1.7; margin: 0 0 12px; }
.scene-availability { margin: 0 0 14px; padding: 10px 12px; background: #f4f7f2; border-radius: 12px; color: #547263; font-size: 12px; line-height: 1.6; }
.scene-availability.unavailable { background: #faf5eb; color: #9a7647; }
.scene-availability { margin: 0 0 14px; padding: 10px 12px; background: #f1f5f9; border-radius: 12px; color: #475569; font-size: 12px; line-height: 1.6; }
.scene-availability.unavailable { background: #fff7ed; color: #c2410c; }
#app .startup-scene-actions { margin: 0; }
#app .startup-scene-actions button { min-height: 48px; font-size: 14px; border-radius: 14px; }
.scene-feedback { margin: 12px 0 0; font-size: 12px; line-height: 1.7; padding: 10px 12px; border-radius: 11px; background: #f4f7f2; color: #547263; overflow-wrap: anywhere; }
.scene-feedback.fail { color: #9b6144; background: #fff4ea; }
.scene-feedback.success { color: #0c5045; background: #eef7f1; }
.inline-link { border: 0; background: transparent; color: #0c5045; font-size: 13px; padding: 10px 0 0; min-height: 44px; font-weight: 600; }
#app .detail-entry-bar { width: 100%; text-align: left; margin-top: 16px; background: #f8f8f4; border: 1px solid #edf0e8; padding: 13px 12px; }
.scene-feedback { margin: 12px 0 0; font-size: 12px; line-height: 1.7; padding: 10px 12px; border-radius: 11px; background: #f1f5f9; color: #475569; overflow-wrap: anywhere; }
.scene-feedback.fail { color: #dc2626; background: #fef2f2; }
.scene-feedback.success { color: #0284c7; background: #f0f9ff; }
.inline-link { border: 0; background: transparent; color: #0284c7; font-size: 13px; padding: 10px 0 0; min-height: 44px; font-weight: 600; }
#app .detail-entry-bar { width: 100%; text-align: left; margin-top: 16px; background: #f8fafc; border: 1px solid rgba(2, 132, 199, 0.06); padding: 13px 12px; }
#app .entry-left { min-width: 0; gap: 12px; }
#app .entry-left strong { font-size: 14px; }
#app .entry-left small { font-size: 12px; margin-top: 3px; line-height: 1.5; }
.entry-symbol { width: 34px; height: 34px; display: grid; place-items: center; flex-shrink: 0; background: #e9f1e9; color: #0c5045; border-radius: 10px; font-size: 23px; }
.startup-preset-details { border-top: 1px solid #edf0e9; margin-top: 16px; padding-top: 1px; }
.startup-preset-details summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; list-style: none; color: #698172; font-size: 12px; cursor: pointer; }
.entry-symbol { width: 34px; height: 34px; display: grid; place-items: center; flex-shrink: 0; background: #f0f9ff; color: #0284c7; border-radius: 10px; font-size: 23px; }
.startup-preset-details { border-top: 1px solid #e2e8f0; margin-top: 16px; padding-top: 1px; }
.startup-preset-details summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; list-style: none; color: #64748b; font-size: 12px; cursor: pointer; }
.startup-preset-details summary::-webkit-details-marker { display: none; }
.startup-preset-details summary::after { content: '+'; color: #8da194; font-size: 18px; }
.startup-preset-details summary::after { content: '+'; color: #94a3b8; font-size: 18px; }
.startup-preset-details[open] summary::after { content: '−'; }
#app .startup-param-badge { border: 0; padding: 12px; }
#app .startup-param-badge .lbl { font-size: 11px; margin-bottom: 5px; }
#app .startup-param-badge strong { line-height: 1.6; font-weight: 600; }
#app .assessment-guide-banner { background: #faf5e9; color: #745d3e; box-shadow: none; border: 1px solid #efe4cd; padding: 16px; }
#app .guide-badge { background: #efe4cc; color: #8e7148; }
#app .guide-text p { color: #8a785b; font-size: 12px; line-height: 1.6; }
#app .guide-text h3 { font-size: 14px; }
#app .guide-btn { min-height: 42px; padding: 8px 12px; flex-shrink: 0; box-shadow: none; }
#app .health-advice-card { padding: 20px; border-radius: 20px; }
#app .health-advice-card .eyebrow { color: #e5c385; letter-spacing: .08em; }
#app .health-advice-card h2 { font-size: 22px; line-height: 1.4; }
#app .health-advice-card > p:not(.eyebrow) { font-size: 13px; line-height: 1.7; margin-bottom: 10px; }
.health-advice-link { background: transparent; border: 0; color: #e3d5b6; font-size: 12px; min-height: 36px; padding: 0; }
#app .startup-param-badge { border: 0; padding: 12px; background: #f8fafc; }
#app .startup-param-badge .lbl { font-size: 11px; margin-bottom: 5px; color: #64748b; }
#app .startup-param-badge strong { line-height: 1.6; font-weight: 600; color: #0f172a; }
#app .assessment-guide-banner { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); color: #0f172a; box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08); border: 1px solid rgba(2, 132, 199, 0.16); padding: 16px; }
#app .guide-badge { background: #ffffff; color: #0284c7; border: 1px solid rgba(2, 132, 199, 0.2); }
#app .guide-text p { color: #64748b; font-size: 12px; line-height: 1.6; }
#app .guide-text h3 { font-size: 14px; color: #0f172a; }
#app .guide-btn { min-height: 42px; padding: 8px 14px; flex-shrink: 0; box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25); color: #fff; background: #0284c7; }
#app .health-advice-card { padding: 20px 18px; border-radius: 20px; background: #ffffff; border: 1px solid rgba(2, 132, 199, 0.08); box-shadow: var(--surface-shadow); }
#app .health-advice-card .eyebrow { display: inline-block; background: #f0f9ff; color: #0284c7; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: .04em; margin-bottom: 8px; }
#app .health-advice-card h2 { font-size: 20px; line-height: 1.4; color: #0f172a; margin: 4px 0 8px; }
#app .health-advice-card > p:not(.eyebrow) { font-size: 13px; line-height: 1.65; margin-bottom: 12px; color: #64748b; }
.health-advice-link { background: transparent; border: 0; color: #0284c7; font-size: 13px; font-weight: 600; min-height: 36px; padding: 0; display: inline-flex; align-items: center; }
#app .metric-strip div { min-width: 0; padding: 4px 12px; }
#app .metric-strip strong { font-variant-numeric: tabular-nums; font-size: 22px; }
#app .medical-note { color: #829188; line-height: 1.7; margin: 20px 10px; }
#app .medical-note { color: #94a3b8; line-height: 1.7; margin: 20px 10px; }
#app :is(.page-load-state, .page-error-state) { text-align: center; padding: 28px 20px; font-size: 13px; color: var(--muted-text); line-height: 1.7; }
#app :is(.page-load-state, .page-error-state) p { margin: 10px 0; overflow-wrap: anywhere; }
#app .page-error-state :is(h2, h3) { margin: 0 0 10px; color: #315a4a; font-size: 16px; }
.page-loading-mark { display: block; width: 28px; height: 28px; margin: 0 auto 14px; border: 2px solid #dde9df; border-top-color: #34795e; border-radius: 50%; animation: page-spin .9s linear infinite; }
.retry-button { border: 1px solid #d3e1d5; border-radius: 12px; background: #f4f8f1; color: #0c5045; font-size: 13px; min-height: 44px; min-width: 126px; padding: 10px 18px; font-weight: 600; margin-top: 10px; }
#app .page-error-state :is(h2, h3) { margin: 0 0 10px; color: #0f172a; font-size: 16px; }
.page-loading-mark { display: block; width: 28px; height: 28px; margin: 0 auto 14px; border: 2px solid #bae6fd; border-top-color: #0284c7; border-radius: 50%; animation: page-spin .9s linear infinite; }
.retry-button { border: 1px solid rgba(2, 132, 199, 0.2); border-radius: 12px; background: #f0f9ff; color: #0284c7; font-size: 13px; min-height: 44px; min-width: 126px; padding: 10px 18px; font-weight: 600; margin-top: 10px; }
@keyframes page-spin { to { transform: rotate(360deg); } }
#app .profile-content, #app .assessment-content { padding-left: var(--page-gutter); padding-right: var(--page-gutter); }
#app .profile-header { padding: 30px 22px; border-radius: 0 0 28px 28px; box-shadow: none; }
#app .avatar-box { width: 56px; height: 56px; flex-shrink: 0; font-size: 24px; }
#app .profile-content, #app .assessment-content { padding-left: 0; padding-right: 0; }
#app .profile-header { padding: 4px 4px 20px; border-radius: 0; box-shadow: none; background: transparent; }
#app .avatar-box { width: 56px; height: 56px; flex-shrink: 0; font-size: 24px; background: #f0f9ff; color: #0284c7; border: 2px solid rgba(2, 132, 199, 0.2); box-shadow: 0 2px 10px rgba(2, 132, 199, 0.12); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif; }
#app .user-info { min-width: 0; }
#app .user-info h2 { overflow-wrap: anywhere; line-height: 1.4; }
#app .profile-card { padding: 20px 16px; }
#app .card-head { gap: 10px; }
#app .card-head h3 { min-width: 0; line-height: 1.5; }
#app .card-head h3 { min-width: 0; line-height: 1.5; color: #0f172a; }
#app .card-head :is(.status-indicator, .version-tag, .edit-btn) { flex-shrink: 0; }
#app .edit-btn { min-height: 36px; padding: 4px 0 4px 8px; }
#app .metric-item { padding: 12px 6px; min-width: 0; font-variant-numeric: tabular-nums; }
#app .edit-btn { min-height: 36px; padding: 4px 0 4px 8px; color: #0284c7; }
#app .metric-item { padding: 12px 6px; min-width: 0; font-variant-numeric: tabular-nums; background: #f8fafc; }
#app .bmi-metric { grid-column: 1 / -1; flex-direction: row; gap: 10px; padding: 12px 14px; }
#app .bmi-metric .m-label { margin: 0 auto 0 0; font-size: 12px; }
#app .bmi-metric .m-status-tag { margin: 0; padding: 4px 8px; }
#app .plan-summary-text { font-size: 13px; line-height: 1.7; }
#app .menu-item { width: 100%; background: #fff; border: 0; border-bottom: 1px solid #f0f2ec; text-align: left; font: inherit; padding: 15px 16px; gap: 12px; }
#app .plan-summary-text { font-size: 13px; line-height: 1.7; color: #64748b; }
#app .menu-item { width: 100%; background: #fff; border: 0; border-bottom: 1px solid #f1f5f9; text-align: left; font: inherit; padding: 15px 16px; gap: 12px; }
#app .menu-item:last-child { border-bottom: 0; }
#app .menu-item:active { background: #f6f8f2; }
#app .menu-item:active { background: #f8fafc; }
#app .menu-left { min-width: 0; }
#app .menu-icon { flex-shrink: 0; }
#app .menu-text { min-width: 0; line-height: 1.5; }
#app .menu-text small { font-size: 12px; }
#app .menu-text strong { color: #0f172a; }
#app .menu-text small { font-size: 12px; color: #64748b; }
#app .logout-wrap { margin-top: 20px; }
#app .logout-btn { min-height: 48px; box-shadow: none; }
#app .assessment-header { padding: 26px 22px 24px; }
#app .assessment-header h1 { font-size: 25px; margin-bottom: 12px; }
#app .assessment-header { padding: 4px 4px 16px; background: transparent; box-shadow: none; border-radius: 0; }
#app .assessment-header h1 { font-size: 25px; margin-bottom: 12px; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif; }
#app .header-desc { font-size: 13px; line-height: 1.7; }
#app .card-section { padding: 20px 16px; }
#app .section-subtitle { line-height: 1.65; }
@@ -120,38 +124,43 @@ input, textarea { accent-color: var(--green); }
#app .opt-head { gap: 8px; flex-wrap: wrap; }
#app .opt-desc { font-size: 12px; line-height: 1.65; }
#app :is(.saved-assessment-note, .tcm-dirty-note) { font-size: 12px; line-height: 1.7; }
#app .tcm-page { padding-left: var(--page-gutter); padding-right: var(--page-gutter); }
#app .tcm-header { padding: 14px 5px 22px; }
#app .tcm-page { padding: 20px var(--page-gutter, 16px) calc(88px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, #bfe3fc 0%, #e0f2fe 22%, #f0f9ff 48%, #f8fafc 100%); }
#app .tcm-header { padding: 4px 4px 16px; background: transparent; }
#app .tcm-header h1 { font-size: 26px; }
#app .tcm-card { padding: 20px 16px; }
#app .section-heading { gap: 10px; align-items: flex-start; }
#app .section-heading h2 { flex-shrink: 0; font-size: 18px; }
#app .section-heading p { line-height: 1.6; }
#app .choice-grid button { padding: 10px 8px; }
#app .note-label textarea { font-size: 16px; min-height: 80px; line-height: 1.6; background: #fbfcf8; }
#app .note-label textarea { font-size: 16px; min-height: 80px; line-height: 1.6; background: #f8fafc; }
#app .result-top { gap: 8px; flex-wrap: wrap; }
#app .recommendations div { align-items: flex-start; }
.assessment-progress { display: block; width: 100%; height: 5px; border: 0; border-radius: 4px; overflow: hidden; margin-top: 12px; background: #e4e9df; accent-color: #0c5045; }
.assessment-progress::-webkit-progress-bar { background: #e4e9df; border-radius: 4px; }
.assessment-progress::-webkit-progress-value { background: #0c5045; border-radius: 4px; }
.assessment-progress::-moz-progress-bar { background: #0c5045; border-radius: 4px; }
.assessment-progress { display: block; width: 100%; height: 5px; border: 0; border-radius: 4px; overflow: hidden; margin-top: 12px; background: #e2e8f0; accent-color: #0284c7; }
.assessment-progress::-webkit-progress-bar { background: #e2e8f0; border-radius: 4px; }
.assessment-progress::-webkit-progress-value { background: #0284c7; border-radius: 4px; }
.assessment-progress::-moz-progress-bar { background: #0284c7; border-radius: 4px; }
#app .auth-page { padding-bottom: env(safe-area-inset-bottom, 0px); }
#app .brand-panel { padding: 32px 24px 38px; border-radius: 0 0 30px 30px; }
#app .brand-panel h1 { font-size: 32px; line-height: 1.3; }
#app .brand-copy { font-size: 13px; line-height: 1.7; }
#app .feature-pill-row span { padding: 5px 10px; font-size: 11px; }
#app .auth-card { padding: 24px 20px; box-shadow: var(--surface-shadow); }
#app .auth-heading h2 { font-size: 22px; line-height: 1.4; }
#app .auth-heading p { font-size: 13px; line-height: 1.6; }
#app .auth-card .van-field__control { font-size: 16px; }
#app .auth-tab-switch button { min-height: 44px; }
#app .brand-panel { padding: 16px 4px 20px; border-radius: 0; background: transparent; }
#app .brand-panel h1 { font-size: 28px; line-height: 1.25; color: #0f172a; }
#app .brand-copy { font-size: 13px; line-height: 1.6; color: #475569; }
#app .feature-pill-row span { padding: 5px 12px; font-size: 12px; font-weight: 600; color: #0284c7; background: rgba(255, 255, 255, 0.85); border: 1px solid rgba(191, 219, 254, 0.75); }
#app .auth-card { padding: 24px 20px 28px; box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.06), 0 4px 12px -2px rgba(15, 23, 42, 0.02); border: 1px solid rgba(226, 232, 240, 0.85); border-radius: 22px; }
#app .auth-heading h2 { font-size: 22px; line-height: 1.4; color: #0f172a; font-weight: 700; }
#app .auth-heading p { font-size: 13px; line-height: 1.6; color: #64748b; }
#app .auth-card .van-field { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; }
#app .auth-card .van-field:focus-within { background: #ffffff; border-color: #0284c7; box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12); }
#app .auth-card .van-field__control { font-size: 15px; color: #0f172a; }
#app .auth-card .van-field__label { color: #334155; font-weight: 600; }
#app .auth-card .van-field__error-message { color: #ef4444; font-size: 12px; }
#app .auth-tab-switch button { min-height: 42px; }
#app .auth-tab-switch button.active { color: #0284c7; background: #ffffff; }
#app .auth-tab-switch button:disabled { opacity: .55; }
#app .privacy-note { color: #819086; }
#app .privacy-note { color: #94a3b8; }
#app .app-tab-bar { box-shadow: 0 -2px 12px rgba(18, 63, 55, .025); }
#app .app-tab-bar { box-shadow: 0 -2px 16px rgba(15, 23, 42, .04); }
#app .tab-item { margin: 0 4px; border-radius: 12px; }
#app .tab-item.active { background: #edf4ed; }
#app .tab-item.active { background: transparent; }
#app .tab-label { font-size: 11px; }
#app .control-page .control-content { padding: 16px; }
#app .control-page .param-row { padding-top: 17px; padding-bottom: 17px; }
@@ -159,11 +168,11 @@ input, textarea { accent-color: var(--green); }
#app .control-page .mini-toggle { min-height: 36px; }
#app .control-page .device-tile-power { width: 42px; height: 42px; }
#app .control-page .device-tile-category { width: calc(100% - 46px); }
#app .control-page .device-tile-status { font-size: 12px; color: #5e7467; }
#app .control-page .device-tile-metric { font-size: 11px; color: #6a7c70; }
#app .control-page .device-tile-footer { color: #718175; }
#app .control-page .device-information { border: 1px solid rgba(18, 63, 55, .05); }
.device-detail-hint { margin: 0 0 14px; padding: 0 3px; font-size: 12px; color: #758579; line-height: 1.7; }
#app .control-page .device-tile-status { font-size: 12px; color: #64748b; }
#app .control-page .device-tile-metric { font-size: 11px; color: #64748b; }
#app .control-page .device-tile-footer { color: #94a3b8; }
#app .control-page .device-information { border: 1px solid rgba(2, 132, 199, .05); }
.device-detail-hint { margin: 0 0 14px; padding: 0 3px; font-size: 12px; color: #64748b; line-height: 1.7; }
@media (max-width: 359px) {
:root { --page-gutter: 12px; }
@@ -174,7 +183,6 @@ input, textarea { accent-color: var(--green); }
#app .control-page .control-content { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
/* 停止动画,不把无限循环的加载图标加速;加载文字仍由页面正常显示。 */
*, *::before, *::after {
animation: none !important;
transition-duration: 0s !important;
+125 -108
View File
@@ -54,7 +54,7 @@ const bmiStatus = computed(() => {
const bmi = computedBmi.value
if (!bmi) return { label: '待填写', color: '#909399' }
if (bmi < 18.5) return { label: '偏瘦', color: '#e6a23c' }
if (bmi <= 23.9) return { label: '正常健康', color: '#0c5045' }
if (bmi <= 23.9) return { label: '正常健康', color: '#0284c7' }
if (bmi <= 27.9) return { label: '偏胖超重', color: '#e6a23c' }
return { label: '肥胖预警', color: '#f56c6c' }
})
@@ -766,7 +766,7 @@ onMounted(() => {
block
round
size="large"
color="#0c5045"
color="#0284c7"
:loading="submitting"
:disabled="submitting"
@click="handleSave"
@@ -784,76 +784,89 @@ onMounted(() => {
<style scoped>
.assessment-page {
padding-bottom: 90px;
background: #f2f0e9;
max-width: 480px;
margin: 0 auto;
padding: 20px var(--page-gutter, 16px) calc(88px + env(safe-area-inset-bottom));
background: linear-gradient(180deg, #bfe3fc 0%, #e0f2fe 22%, #f0f9ff 48%, #f8fafc 100%);
min-height: 100vh;
box-sizing: border-box;
}
.assessment-header {
background: linear-gradient(135deg, #0c5045, #14463d);
color: #fff;
padding: 32px 20px 24px;
border-radius: 0 0 28px 28px;
box-shadow: 0 10px 30px rgba(12, 80, 69, 0.12);
background: transparent;
color: #0f172a;
padding: 4px 4px 16px;
border-radius: 0;
box-shadow: none;
}
.brand-tag {
display: inline-block;
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 11px;
letter-spacing: 0.14em;
background: rgba(255, 255, 255, 0.15);
padding: 4px 10px;
font-weight: 600;
letter-spacing: 0.04em;
background: rgba(255, 255, 255, 0.9);
border: 1px solid #bae6fd;
padding: 4px 12px;
border-radius: 20px;
color: #eeddbb;
color: #0284c7;
margin-bottom: 10px;
backdrop-filter: blur(8px);
}
.assessment-header h1 {
margin: 0 0 10px;
margin: 0 0 8px;
font-size: 24px;
font-family: "Songti SC", serif;
font-weight: 600;
font-family: inherit;
font-weight: 700;
color: #0f172a;
letter-spacing: -0.02em;
}
.header-desc {
margin: 0;
font-size: 13px;
line-height: 1.6;
color: rgba(255, 255, 255, 0.8);
color: #64748b;
}
.assessment-content {
padding: 16px 14px;
padding: 0;
}
.assessment-form { min-width: 0; padding: 0; margin: 0; border: 0; }
.assessment-form[disabled] { opacity: .72; }
.saved-assessment-note { margin: 0 4px 14px; color: #527169; font-size: 12px; line-height: 1.6; }
.page-error-state h3 { margin: 0 0 8px; font-size: 16px; }
.page-error-state p { font-size: 13px; line-height: 1.6; }
.saved-assessment-note { margin: 0 4px 14px; color: #64748b; font-size: 12px; line-height: 1.6; }
.page-error-state h3 { margin: 0 0 8px; font-size: 16px; color: #0f172a; }
.page-error-state p { font-size: 13px; line-height: 1.6; color: #64748b; }
.card-section {
background: #ffffff;
border-radius: 20px;
padding: 18px 16px;
border-radius: 16px;
padding: 20px 16px;
margin-bottom: 16px;
box-shadow: 0 4px 18px rgba(18, 63, 55, 0.04);
border: 1px solid rgba(18, 63, 55, 0.06);
box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
border: 1px solid #eef2f6;
}
.section-title {
display: flex;
align-items: center;
gap: 8px;
display: flex !important;
align-items: center !important;
justify-content: flex-start !important;
gap: 8px !important;
margin-bottom: 4px;
}
.step-num {
display: inline-block;
background: #0c5045;
color: #fff;
font-size: 10px;
background: #f0f9ff;
color: #0284c7;
border: 1px solid #bae6fd;
font-size: 11px;
font-weight: 700;
padding: 2px 6px;
padding: 2px 7px;
border-radius: 6px;
}
@@ -861,13 +874,13 @@ onMounted(() => {
margin: 0;
font-size: 16px;
font-weight: 700;
color: #123f37;
color: #0f172a;
}
.section-subtitle {
margin: 4px 0 16px;
margin: 2px 0 16px;
font-size: 12px;
color: #7b8e88;
color: #64748b;
}
/* 基础信息表单 */
@@ -885,15 +898,16 @@ onMounted(() => {
.form-field label {
font-size: 12px;
color: #556b64;
color: #334155;
font-weight: 600;
}
.toggle-group {
display: flex;
background: #f1efea;
border-radius: 10px;
background: #f1f5f9;
border-radius: 12px;
padding: 3px;
border: 1px solid #e2e8f0;
}
.toggle-group button {
@@ -901,17 +915,18 @@ onMounted(() => {
padding: 8px 0;
border: 0;
background: transparent;
color: #6a7c76;
color: #64748b;
font-size: 13px;
font-weight: 600;
border-radius: 8px;
transition: all 0.2s;
border-radius: 9px;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-group button.active {
background: #0c5045;
color: #ffffff;
box-shadow: 0 2px 6px rgba(12, 80, 69, 0.2);
background: #ffffff;
color: #0284c7;
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
font-weight: 700;
}
.input-wrap {
@@ -922,34 +937,36 @@ onMounted(() => {
.input-wrap input {
width: 100%;
background: #f7f6f2;
border: 1px solid rgba(18, 63, 55, 0.1);
border-radius: 10px;
padding: 9px 36px 9px 12px;
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 12px;
padding: 10px 36px 10px 12px;
font-size: 15px;
font-weight: 600;
color: #123f37;
color: #0f172a;
outline: none;
transition: all 0.2s;
}
.input-wrap input:focus {
border-color: #0c5045;
border-color: #0284c7;
background: #ffffff;
box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}
.input-wrap .unit {
position: absolute;
right: 12px;
font-size: 12px;
color: #8c9e97;
color: #64748b;
}
.bmi-result-card {
grid-column: span 2;
background: #f7faf8;
border: 1px solid rgba(12, 80, 69, 0.14);
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 12px;
padding: 10px 14px;
padding: 12px 14px;
display: flex;
align-items: center;
justify-content: space-between;
@@ -964,28 +981,29 @@ onMounted(() => {
.bmi-val span {
font-size: 12px;
color: #7b8e88;
color: #64748b;
font-weight: 600;
}
.bmi-val strong {
font-size: 20px;
color: #0c5045;
font-family: serif;
font-size: 22px;
color: #0284c7;
font-family: inherit;
font-weight: 800;
}
.bmi-tag {
font-size: 12px;
font-weight: 700;
border: 1px solid currentColor;
padding: 2px 10px;
border-radius: 12px;
font-size: 11px;
font-weight: 600;
padding: 3px 9px;
border-radius: 20px;
background: #ffffff;
border: 1px solid currentColor;
}
.bmi-tip {
font-size: 11px;
color: #8a9c95;
color: #64748b;
}
/* 问答模块 */
@@ -1005,17 +1023,19 @@ onMounted(() => {
}
.q-badge {
background: #ebf3f0;
color: #0c5045;
background: #f0f9ff;
color: #0284c7;
border: 1px solid #bae6fd;
font-size: 10px;
font-weight: 800;
padding: 2px 6px;
font-weight: 700;
padding: 1px 6px;
border-radius: 4px;
}
.question-label strong {
font-size: 13px;
color: #173d36;
color: #0f172a;
font-weight: 600;
}
.options-grid {
@@ -1023,57 +1043,51 @@ onMounted(() => {
gap: 8px;
}
.options-grid.cols-1 {
grid-template-columns: 1fr;
}
.options-grid.cols-2 {
grid-template-columns: 1fr 1fr;
}
.options-grid.cols-3 {
grid-template-columns: 1fr 1fr 1fr;
}
.options-grid.cols-1 { grid-template-columns: 1fr; }
.options-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.options-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.option-pill {
padding: 10px 8px;
background: #f6f5f0;
border: 1.5px solid transparent;
border-radius: 10px;
padding: 11px 8px;
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 12px;
font-size: 12px;
color: #4b5e57;
color: #334155;
text-align: center;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
user-select: none;
font-family: inherit;
}
.option-pill.active {
background: #eef6f3;
border-color: #0c5045;
color: #0c5045;
background: #f0f9ff;
border: 1.5px solid #0284c7;
color: #0369a1;
font-weight: 700;
box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08);
}
.option-card {
padding: 12px;
background: #f9f8f4;
border: 1.5px solid transparent;
padding: 12px 14px;
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 12px;
cursor: pointer;
transition: all 0.2s ease;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
width: 100%;
font-family: inherit;
text-align: left;
}
.option-pill:focus-visible, .option-card:focus-visible { outline: 2px solid #0c5045; outline-offset: 3px; }
.option-pill:focus-visible, .option-card:focus-visible { outline: 2px solid #0284c7; outline-offset: 2px; }
.option-card.active {
background: #eef7f3;
border-color: #0c5045;
background: #f0f9ff;
border: 1.5px solid #0284c7;
box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08);
}
.opt-head {
@@ -1086,37 +1100,40 @@ onMounted(() => {
.opt-title {
font-size: 13px;
font-weight: 700;
color: #183d36;
color: #0f172a;
}
.opt-tag {
font-size: 11px;
color: #0c5045;
background: rgba(12, 80, 69, 0.08);
padding: 2px 8px;
font-size: 10px;
color: #0284c7;
background: #f0f9ff;
border: 1px solid #bae6fd;
padding: 1px 7px;
border-radius: 10px;
font-weight: 600;
}
.tag-cool {
color: #2b7bc4;
background: rgba(43, 123, 196, 0.1);
color: #0284c7;
background: #f0f9ff;
border-color: #bae6fd;
}
.tag-warm {
color: #c06927;
background: rgba(192, 105, 39, 0.1);
color: #d97706;
background: #fffbeb;
border-color: #fde68a;
}
.opt-desc {
margin: 0;
font-size: 11px;
color: #72847d;
color: #64748b;
line-height: 1.5;
}
.submit-action-bar {
margin-top: 20px;
margin-top: 24px;
margin-bottom: 24px;
}
</style>
+228 -26
View File
@@ -36,20 +36,22 @@ async function submit() {
if (pageRequest.isCurrent(requestId)) loading.value = false
}
}
function onFailed(errorInfo: { errors?: Array<{ message?: string }> }) {
const first = errorInfo?.errors?.[0]?.message
if (first) showToast(first)
}
</script>
<template>
<main class="auth-page">
<section class="brand-panel">
<div class="brand-badge">
<span class="brand-badge-icon">常</span>
<span>一人一方 · 康养管理</span>
</div>
<p class="eyebrow">EVERGREEN HEALTH</p>
<h1>一人一方<br />健康与空间协同</h1>
<p class="brand-copy">以睡眠为切入点,融合五感空间与动态健康方案,开启日常健康管理。</p>
<div class="feature-pill-row">
<span>体质评估</span><span>舒睡联动</span><span>健康档案</span>
<div class="banner-card-wrap">
<img
src="/header-banner.jpg"
alt="一人一方 · 康养管理 健康与空间协同"
class="banner-card-img"
/>
</div>
</section>
@@ -73,41 +75,65 @@ async function submit() {
</button>
</div>
<div class="auth-heading">
<h2>{{ title }}</h2>
<p>
{{ mode === 'login' ? '登录后查看今日健康方案与空间联动' : '第一步,填写信息创建您的专属健康档案' }}
</p>
</div>
<p class="auth-hint">
{{ mode === 'login' ? '登录后查看今日健康方案与智能空间联动' : '第一步,填写基本信息创建您的专属健康档案' }}
</p>
<van-form @submit="submit">
<van-form @submit="submit" @failed="onFailed">
<van-field
v-if="mode === 'register'"
v-model="form.displayName"
label="姓名"
:disabled="loading" autocomplete="name" maxlength="30"
placeholder="请输入姓名或称呼"
placeholder="请输入您的姓名或称呼"
:rules="[{ required: true, message: '请输入姓名' }]"
/>
>
<template #left-icon>
<span class="field-icon" aria-hidden="true">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" />
<circle cx="12" cy="7" r="4" />
</svg>
</span>
</template>
</van-field>
<van-field
v-model="form.phone"
type="tel"
:disabled="loading" autocomplete="username" inputmode="tel"
label="手机号"
maxlength="11"
placeholder="请输入 11 位手机号"
:rules="[{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号' }]"
/>
>
<template #left-icon>
<span class="field-icon" aria-hidden="true">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="5" y="2" width="14" height="20" rx="2" ry="2" />
<line x1="12" y1="18" x2="12.01" y2="18" />
</svg>
</span>
</template>
</van-field>
<van-field
v-model="form.password"
type="password"
:disabled="loading" :autocomplete="mode === 'register' ? 'new-password' : 'current-password'"
label="密码"
:placeholder="mode === 'register' ? '设置至少 8 位密码' : '请输入密码'"
:placeholder="mode === 'register' ? '设置至少 8 位登录密码' : '请输入登录密码'"
:rules="[{ required: true, message: '请输入密码' }, { validator: (value: string) => mode === 'login' || value.length >= 8, message: '注册密码至少 8 位' }]"
/>
<van-button block round color="#0c5045" native-type="submit" :loading="loading" :disabled="loading">
{{ mode === 'login' ? '登 录' : '创建档案并继续' }}
>
<template #left-icon>
<span class="field-icon" aria-hidden="true">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="11" width="18" height="11" rx="2" ry="2" />
<path d="M7 11V7a5 5 0 0 1 10 0v4" />
</svg>
</span>
</template>
</van-field>
<van-button block round color="#0284c7" native-type="submit" :loading="loading" :disabled="loading">
{{ mode === 'login' ? '立即登录' : '创建档案并继续' }}
</van-button>
</van-form>
@@ -115,3 +141,179 @@ async function submit() {
</section>
</main>
</template>
<style scoped>
.auth-page {
min-height: 100vh;
background:
radial-gradient(circle at 85% 10%, rgba(178, 225, 255, 0.45) 0%, rgba(224, 242, 254, 0.25) 35%, transparent 70%),
linear-gradient(180deg, #bfe3fc 0%, #e0f2fe 25%, #f8fafc 55%, #f1f5f9 100%);
padding: 16px 16px 40px;
}
.brand-panel {
max-width: 440px;
margin: 0 auto 16px;
padding: 0;
}
/* 顶部完整 3D 科技健康守护卡片 */
.banner-card-wrap {
width: 100%;
border-radius: 20px;
overflow: hidden;
box-shadow: 0 10px 28px -4px rgba(2, 132, 199, 0.15), 0 2px 8px rgba(15, 23, 42, 0.04);
background: transparent;
border: 1px solid rgba(186, 230, 253, 0.85);
display: block;
}
.banner-card-img {
width: 100%;
height: auto;
display: block;
object-fit: cover;
transition: transform 0.2s ease;
}
/* 登录白卡片 */
.auth-card {
position: relative;
width: 100%;
max-width: 440px;
margin: 0 auto 32px;
padding: 22px 20px 26px;
background: #ffffff;
border-radius: 24px;
border: 1px solid rgba(226, 232, 240, 0.85);
box-shadow: 0 12px 36px -4px rgba(15, 23, 42, 0.06), 0 4px 12px -2px rgba(15, 23, 42, 0.02);
}
.auth-tab-switch {
display: flex;
background: #f1f5f9;
border-radius: 12px;
padding: 4px;
margin-bottom: 14px;
}
.auth-tab-switch button {
flex: 1;
padding: 10px 0;
border: 0;
font-size: 14px;
font-weight: 600;
border-radius: 9px;
color: #64748b;
background: transparent;
cursor: pointer;
transition: all 0.2s ease;
}
.auth-tab-switch button.active {
background: #ffffff;
color: #0284c7;
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.auth-hint {
margin: 0 0 18px;
font-size: 12.5px;
color: #64748b;
line-height: 1.5;
text-align: center;
}
/* 现代化通栏输入框与左侧图标 */
:deep(.van-field) {
position: relative;
margin-bottom: 16px;
padding: 13px 14px;
background: #f8fafc !important;
border-radius: 14px;
border: 1px solid #e2e8f0;
transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, margin-bottom 0.2s ease;
min-height: 50px;
display: flex;
align-items: center;
}
:deep(.van-field::after) {
display: none;
}
:deep(.van-field:focus-within) {
background: #ffffff !important;
border-color: #0284c7 !important;
box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
:deep(.van-field:focus-within .field-icon) {
color: #0284c7;
}
.field-icon {
display: grid;
place-items: center;
color: #94a3b8;
margin-right: 10px;
transition: color 0.2s ease;
}
:deep(.van-field__value) {
position: static;
overflow: visible;
}
:deep(.van-field__control) {
color: #0f172a;
font-weight: 500;
font-size: 15px;
}
:deep(.van-field__control::placeholder) {
color: #94a3b8;
font-weight: normal;
font-size: 14px;
}
:deep(.van-field__error-message) {
position: absolute;
top: calc(100% + 4px);
left: 14px;
font-size: 12px;
line-height: 1.4;
color: #ef4444;
font-weight: 500;
white-space: nowrap;
display: flex;
align-items: center;
gap: 4px;
z-index: 2;
}
:deep(.van-field__error-message::before) {
content: "⚠";
font-size: 11px;
}
:deep(.van-field:has(.van-field__error-message)),
:deep(.van-field--error) {
margin-bottom: 26px !important;
border-color: #ef4444 !important;
background-color: #fffafa !important;
}
:deep(.van-field:has(.van-field__error-message):focus-within),
:deep(.van-field--error:focus-within) {
border-color: #ef4444 !important;
box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}
:deep(.van-button--primary) {
margin-top: 18px;
height: 50px;
font-size: 16px;
font-weight: 600;
letter-spacing: 0.02em;
background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%) !important;
border: none !important;
border-radius: 14px !important;
box-shadow: 0 8px 20px -3px rgba(2, 132, 199, 0.32);
color: #ffffff !important;
transition: transform 0.1s;
}
:deep(.van-button--primary:active) {
transform: scale(0.985);
}
.privacy-note {
margin: 18px 0 0;
color: #94a3b8;
font-size: 11px;
line-height: 1.6;
text-align: center;
}
</style>
+88 -107
View File
@@ -193,7 +193,7 @@ onUnmounted(() => { active = false })
type="primary"
size="small"
round
color="#0c5045"
color="#0284c7"
@click="router.replace('/assessment')"
>
立即进行健康评估
@@ -214,7 +214,7 @@ onUnmounted(() => { active = false })
<p class="plan-summary-text">香型建议:{{ dashboard.tcmResult.aromaRecommendation }};音乐建议:{{ dashboard.tcmResult.musicRecommendation }}</p>
</template>
<p v-else class="plan-summary-text">完成四诊后,才能一键启动体质相关的设备预设。</p>
<VanButton type="primary" size="small" round color="#0c5045" @click="router.push('/tcm-assessment')">
<VanButton type="primary" size="small" round color="#0284c7" @click="router.push('/tcm-assessment')">
{{ dashboard?.tcmResult?.hasCompleted ? '重新评估体质' : '去完成四诊' }}
</VanButton>
</section>
@@ -300,17 +300,20 @@ onUnmounted(() => { active = false })
<style scoped>
.profile-page {
padding-bottom: 90px;
background: #f2f0e9;
max-width: 480px;
margin: 0 auto;
padding: 20px var(--page-gutter, 16px) calc(88px + env(safe-area-inset-bottom));
background: linear-gradient(180deg, #bfe3fc 0%, #e0f2fe 22%, #f0f9ff 48%, #f8fafc 100%);
min-height: 100vh;
box-sizing: border-box;
}
.profile-header {
background: linear-gradient(135deg, #0c5045, #123d36);
color: #fff;
padding: 34px 20px 28px;
border-radius: 0 0 32px 32px;
box-shadow: 0 10px 30px rgba(12, 80, 69, 0.12);
background: transparent;
color: #0f172a;
padding: 4px 4px 20px;
border-radius: 0;
box-shadow: none;
}
.user-row {
@@ -320,52 +323,54 @@ onUnmounted(() => { active = false })
}
.avatar-box {
width: 60px;
height: 60px;
width: 58px;
height: 58px;
border-radius: 50%;
background: linear-gradient(135deg, #d6a657, #b88636);
color: #fff;
background: #f0f9ff;
color: #0284c7;
display: grid;
place-items: center;
font-size: 26px;
font-family: serif;
font-size: 24px;
font-weight: 700;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
border: 2px solid rgba(255, 255, 255, 0.4);
box-shadow: 0 2px 10px rgba(2, 132, 199, 0.12);
border: 2px solid #bae6fd;
}
.user-info h2 {
margin: 0 0 4px;
font-size: 20px;
font-weight: 700;
color: #0f172a;
}
.phone-text {
margin: 0 0 6px;
font-size: 12px;
color: rgba(255, 255, 255, 0.7);
color: #64748b;
}
.user-badge {
display: inline-block;
font-size: 11px;
background: rgba(255, 255, 255, 0.15);
color: #ffe6ba;
background: #f0f9ff;
color: #0284c7;
border: 1px solid #bae6fd;
font-weight: 600;
padding: 2px 8px;
border-radius: 12px;
}
.profile-content {
padding: 16px 14px;
padding: 0;
}
.profile-card {
background: #ffffff;
border-radius: 20px;
padding: 18px 16px;
border-radius: 16px;
padding: 20px 16px;
margin-bottom: 14px;
box-shadow: 0 4px 18px rgba(18, 63, 55, 0.04);
border: 1px solid rgba(18, 63, 55, 0.06);
box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
border: 1px solid #eef2f6;
}
.card-head {
@@ -378,14 +383,14 @@ onUnmounted(() => { active = false })
.card-head h3 {
margin: 0;
font-size: 15px;
color: #123f37;
color: #0f172a;
font-weight: 700;
}
.edit-btn {
border: 0;
background: transparent;
color: #0c5045;
color: #0284c7;
font-size: 12px;
font-weight: 600;
}
@@ -394,13 +399,14 @@ onUnmounted(() => { active = false })
font-size: 11px;
padding: 2px 8px;
border-radius: 10px;
background: #f0f0ed;
color: #88948e;
background: #f1f5f9;
color: #64748b;
}
.status-indicator.done {
background: #eef6f3;
color: #0c5045;
background: #f0f9ff;
color: #0284c7;
border: 1px solid #bae6fd;
font-weight: 600;
}
@@ -411,7 +417,8 @@ onUnmounted(() => { active = false })
}
.metric-item {
background: #f8f7f3;
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 12px;
padding: 10px 6px;
text-align: center;
@@ -422,30 +429,31 @@ onUnmounted(() => { active = false })
.m-label {
font-size: 11px;
color: #798a83;
color: #64748b;
margin-bottom: 4px;
}
.m-val {
font-size: 15px;
color: #173d36;
color: #0f172a;
font-weight: 700;
}
.m-val small {
font-size: 10px;
color: #8fa099;
color: #64748b;
}
.m-val.highlight {
color: #0c5045;
color: #0284c7;
font-size: 16px;
}
.m-status-tag {
font-size: 10px;
color: #0c5045;
background: rgba(12, 80, 69, 0.1);
color: #0284c7;
background: #f0f9ff;
border: 1px solid #bae6fd;
padding: 1px 6px;
border-radius: 8px;
margin-top: 4px;
@@ -466,40 +474,28 @@ onUnmounted(() => { active = false })
}
.profile-tag-item.theme-gold {
background: #fcf9f2;
border-color: rgba(214, 166, 87, 0.3);
}
.profile-tag-item.theme-gold .tag-title {
color: #9c6c19;
background: #fffbeb;
border-color: #fde68a;
}
.profile-tag-item.theme-gold .tag-title { color: #d97706; }
.profile-tag-item.theme-blue {
background: #f3f8fd;
border-color: rgba(66, 153, 225, 0.3);
}
.profile-tag-item.theme-blue .tag-title {
color: #2b6cb0;
background: #f0f9ff;
border-color: #bae6fd;
}
.profile-tag-item.theme-blue .tag-title { color: #0284c7; }
.profile-tag-item.theme-green {
background: #f1f8f5;
border-color: rgba(12, 80, 69, 0.2);
}
.profile-tag-item.theme-green .tag-title {
color: #0c5045;
background: #ecfdf5;
border-color: #a7f3d0;
}
.profile-tag-item.theme-green .tag-title { color: #10b981; }
.profile-tag-item.theme-purple {
background: #f8f4fd;
border-color: rgba(159, 122, 234, 0.3);
}
.profile-tag-item.theme-purple .tag-title {
color: #6b46c1;
background: #faf5ff;
border-color: #e9d5ff;
}
.profile-tag-item.theme-purple .tag-title { color: #9333ea; }
.tag-title {
font-size: 13px;
@@ -509,7 +505,7 @@ onUnmounted(() => { active = false })
.tag-desc {
font-size: 11px;
color: #60736c;
color: #64748b;
}
.empty-state {
@@ -520,15 +516,15 @@ onUnmounted(() => { active = false })
.empty-state p {
margin: 0 0 12px;
font-size: 12px;
color: #84968f;
color: #64748b;
line-height: 1.5;
}
/* 方案卡片 */
.version-tag {
font-size: 11px;
color: #0c5045;
background: #eef6f3;
color: #0284c7;
background: #f0f9ff;
border: 1px solid #bae6fd;
padding: 2px 8px;
border-radius: 8px;
font-weight: 600;
@@ -537,7 +533,7 @@ onUnmounted(() => { active = false })
.plan-summary-text {
margin: 0 0 14px;
font-size: 12px;
color: #556c64;
color: #475569;
line-height: 1.6;
}
@@ -548,7 +544,8 @@ onUnmounted(() => { active = false })
}
.plan-row {
background: #f9f8f4;
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 12px;
padding: 10px 12px;
}
@@ -564,28 +561,28 @@ onUnmounted(() => { active = false })
width: 6px;
height: 6px;
border-radius: 50%;
background: #0c5045;
background: #0284c7;
}
.plan-row-head strong {
font-size: 13px;
color: #173e37;
color: #0f172a;
}
.plan-target, .plan-advice {
margin: 2px 0;
font-size: 12px;
color: #697c75;
color: #64748b;
line-height: 1.4;
}
/* 菜单导航 */
.action-card-menu {
background: #ffffff;
border-radius: 20px;
border-radius: 16px;
overflow: hidden;
margin-bottom: 16px;
border: 1px solid rgba(18, 63, 55, 0.06);
border: 1px solid #eef2f6;
box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
}
.menu-item {
@@ -593,24 +590,15 @@ onUnmounted(() => { active = false })
align-items: center;
justify-content: space-between;
padding: 14px 16px;
border-bottom: 1px solid rgba(18, 63, 55, 0.05);
border-bottom: 1px solid #f1f5f9;
cursor: pointer;
transition: background 0.2s;
}
.menu-item:last-child {
border-bottom: none;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: #f8fafc; }
.menu-item:active {
background: #f8f7f3;
}
.menu-left {
display: flex;
align-items: center;
gap: 12px;
}
.menu-left { display: flex; align-items: center; gap: 12px; }
.menu-icon {
width: 36px;
@@ -621,51 +609,44 @@ onUnmounted(() => { active = false })
}
.icon-assess {
background: #eef7f3;
color: #0c5045;
background: #f0f9ff;
color: #0284c7;
}
.icon-device {
background: #fbf5e8;
color: #b07e26;
background: #f0fdf4;
color: #16a34a;
}
.menu-text strong {
display: block;
font-size: 13px;
color: #183e37;
color: #0f172a;
}
.menu-text small {
display: block;
font-size: 11px;
color: #7b8e88;
color: #64748b;
margin-top: 2px;
}
.arrow {
color: #b3bfb9;
color: #94a3b8;
font-size: 14px;
}
.logout-wrap {
margin-top: 24px;
}
.logout-wrap { margin-top: 24px; }
.logout-btn {
width: 100%;
padding: 13px 0;
border-radius: 14px;
border: 1px solid rgba(220, 70, 70, 0.25);
background: #ffffff;
color: #d64545;
border: 1px solid #fecaca;
background: #fff5f5;
color: #ef4444;
font-size: 14px;
font-weight: 600;
cursor: pointer;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
.logout-btn:active {
background: #fff5f5;
}
.logout-btn:active { background: #fee2e2; }
</style>
+9 -6
View File
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed, onMounted, onUnmounted, ref } from 'vue'
import AppTabBar from '../components/AppTabBar.vue'
import Ib43AutomationCard from '../components/Ib43AutomationCard.vue'
import { usePageRequest } from '../composables/usePageRequest'
import { displayIb43Value, formatIb43Time, ib43Api, ib43Metrics,
type Ib43Bed, type Ib43Current, type Ib43HistoryItem, type Ib43HistoryQuery } from '../services/ib43'
@@ -177,6 +178,8 @@ onUnmounted(() => clearInterval(refreshTimer))
</dl>
</section>
<Ib43AutomationCard v-if="selectedBed.simulation" :key="bedId" :binding-id="bedId" />
<section class="section-card" aria-labelledby="sleep-history-title">
<div class="sleep-section-title">
<h2 id="sleep-history-title">历史记录</h2>
@@ -219,23 +222,23 @@ onUnmounted(() => clearInterval(refreshTimer))
.sleep-back { display: inline-flex; align-items: center; min-height: 40px; color: var(--green); font-size: 13px; text-decoration: none; }
.sleep-section-title { margin-bottom: 14px; }
.sleep-data-page h2 { margin: 0; font-size: 17px; }
.sleep-button, .sleep-data-page select { min-height: 44px; border: 1px solid #d9e5dc; border-radius: 12px; background: #f4f8f2; color: #0c5045; padding: 8px 12px; font: inherit; font-size: 13px; }
.sleep-button, .sleep-data-page select { min-height: 44px; border: 1px solid #bae6fd; border-radius: 12px; background: #f0f9ff; color: #0284c7; padding: 8px 12px; font: inherit; font-size: 13px; }
.sleep-button:disabled { opacity: .55; }
.sleep-bed { display: grid; gap: 8px; overflow-wrap: anywhere; }
.sleep-bed label, .sleep-bed-status, .sleep-muted, .sleep-metrics small { font-size: 13px; color: var(--muted-text); }
.sleep-bed-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sleep-chip { display: inline-block; width: fit-content; padding: 4px 8px; border-radius: 8px; background: #e9f2e9; color: #235e49; font-size: 12px; }
.sleep-chip.stale { background: #f9eedc; color: #795324; }
.sleep-chip { display: inline-block; width: fit-content; padding: 4px 8px; border-radius: 8px; background: #f0f9ff; color: #0284c7; font-size: 12px; }
.sleep-chip.stale { background: #fef3c7; color: #92400e; }
.sleep-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.sleep-metrics > div { display: grid; align-content: start; gap: 5px; padding: 12px; border-radius: 13px; background: #f6f8f3; }
.sleep-metrics > div { display: grid; align-content: start; gap: 5px; padding: 12px; border-radius: 13px; background: #f8fafc; border: 1px solid #e2e8f0; }
.sleep-metrics dt, .sleep-history dt { color: var(--muted-text); font-size: 13px; }
.sleep-metrics dd { margin: 0; }
.sleep-metric-value { font-size: 22px; font-weight: 700; }
.sleep-metric-meta { display: grid; gap: 5px; }
.sleep-metrics small, .sleep-history time { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sleep-history { list-style: none; padding: 0; margin: 0; }
.sleep-history li { border-top: 1px solid #edf0e8; padding: 12px 0; }
.sleep-history time { color: #315a4a; font-size: 13px; font-weight: 600; }
.sleep-history li { border-top: 1px solid #e2e8f0; padding: 12px 0; }
.sleep-history time { color: #0f172a; font-size: 13px; font-weight: 600; }
.sleep-history dl { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 0; }
.sleep-history dl > div { display: flex; align-items: baseline; gap: 5px; }
.sleep-history dd { margin: 0; font-size: 14px; }
+34 -33
View File
@@ -212,42 +212,43 @@ async function submit() {
</template>
<style scoped>
.tcm-page { max-width: 480px; margin: 0 auto; padding: 18px 16px calc(100px + env(safe-area-inset-bottom)); color: #173d35; box-sizing: border-box; }
.tcm-header { padding: 18px 8px 20px; }
.eyebrow { color: #a37941; font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.tcm-header h1 { font-size: 26px; margin: 5px 0 8px; }
.tcm-header > p:not(.eyebrow) { color: #71837b; font-size: 13px; line-height: 1.65; }
.progress-row { display: flex; justify-content: space-between; color: #527169; font-size: 12px; margin-top: 18px; }
.tcm-card { background: #fff; border: 1px solid #e9eee9; box-shadow: 0 8px 26px rgba(18, 62, 55, .06); border-radius: 20px; padding: 20px; margin-bottom: 15px; }
.tcm-page { max-width: 480px; margin: 0 auto; padding: 20px var(--page-gutter, 16px) calc(88px + env(safe-area-inset-bottom)); color: #0f172a; box-sizing: border-box; background: linear-gradient(180deg, #bfe3fc 0%, #e0f2fe 22%, #f0f9ff 48%, #f8fafc 100%); min-height: 100vh; }
.tcm-header { padding: 4px 4px 16px; background: transparent; }
.eyebrow { color: #0284c7; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.tcm-header h1 { font-size: 26px; margin: 5px 0 8px; color: #0f172a; font-weight: 700; }
.tcm-header > p:not(.eyebrow) { color: #64748b; font-size: 13px; line-height: 1.65; }
.progress-row { display: flex; justify-content: space-between; color: #64748b; font-size: 12px; margin-top: 14px; }
.tcm-card { background: #ffffff; border: 1px solid #eef2f6; box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04); border-radius: 16px; padding: 20px 16px; margin-bottom: 15px; }
.tcm-form { min-width: 0; margin: 0; padding: 0; border: 0; }
.tcm-form[disabled] { opacity: .72; }
.page-error-state h2 { margin: 0 0 8px; font-size: 17px; }
.page-error-state p { color: #71837b; font-size: 13px; line-height: 1.6; }
.result-change-note { padding: 10px 12px; border-radius: 10px; background: rgba(238,221,187,.15); color: #f2e4c8; }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 1px solid #edf1ee; padding-bottom: 12px; }
.section-heading h2 { margin: 0; font-size: 19px; }
.section-heading p { margin: 0; color: #86958d; font-size: 11px; text-align: right; }
.question { padding: 15px 0; border-bottom: 1px solid #f0f2f0; scroll-margin-top: 80px; }
.question h3 { font-size: 14px; margin: 0 0 10px; }
.question small { color: #a88b5c; font-size: 10px; font-weight: 400; margin-left: 5px; }
.page-error-state h2 { margin: 0 0 8px; font-size: 17px; color: #0f172a; }
.page-error-state p { color: #64748b; font-size: 13px; line-height: 1.6; }
.result-change-note { padding: 10px 12px; border-radius: 10px; background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 1px solid #f1f5f9; padding-bottom: 12px; }
.section-heading h2 { margin: 0; font-size: 18px; color: #0f172a; font-weight: 700; }
.section-heading p { margin: 0; color: #64748b; font-size: 11px; text-align: right; }
.question { padding: 14px 0; border-bottom: 1px solid #f1f5f9; scroll-margin-top: 80px; }
.question h3 { font-size: 14px; margin: 0 0 10px; color: #0f172a; font-weight: 600; }
.question small { color: #d97706; font-size: 10px; font-weight: 600; margin-left: 5px; background: #fffbeb; padding: 1px 5px; border-radius: 4px; border: 1px solid #fde68a; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice-grid button { min-height: 39px; border: 1px solid #e4e9e5; border-radius: 11px; background: #f9fbf9; color: #496158; font-size: 13px; }
.choice-grid button.selected { border-color: #0c5045; background: #0c5045; color: #fff; font-weight: 700; }
.note-label { display: block; font-size: 13px; font-weight: 600; margin-top: 15px; }
.note-label textarea { display: block; width: 100%; min-height: 68px; resize: vertical; box-sizing: border-box; margin-top: 8px; border: 1px solid #e4e9e5; border-radius: 11px; padding: 10px; font: inherit; font-weight: 400; color: #173d35; }
.result-card { background: linear-gradient(150deg, #123e37, #0b5144); color: #fff; scroll-margin-top: 16px; }
.result-top { display: flex; justify-content: space-between; font-size: 12px; opacity: .8; }
.result-card h2 { font-size: 27px; margin: 14px 0 8px; }
.result-card p { font-size: 12px; line-height: 1.6; }
.choice-grid button { min-height: 42px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; color: #334155; font-size: 13px; font-weight: 500; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.choice-grid button.selected { border-color: #0284c7; background: #f0f9ff; color: #0369a1; font-weight: 700; box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08); }
.note-label { display: block; font-size: 12px; font-weight: 600; color: #334155; margin-top: 15px; }
.note-label textarea { display: block; width: 100%; min-height: 68px; resize: vertical; box-sizing: border-box; margin-top: 8px; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; font: inherit; font-weight: 400; color: #0f172a; background: #f8fafc; }
.note-label textarea:focus { border-color: #0284c7; background: #ffffff; outline: none; box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12); }
.result-card { background: #ffffff; color: #0f172a; border: 1px solid #bae6fd; box-shadow: 0 4px 20px -2px rgba(2, 132, 199, 0.08); border-radius: 16px; padding: 20px 16px; }
.result-top { display: flex; justify-content: space-between; font-size: 12px; color: #64748b; }
.result-card h2 { font-size: 26px; margin: 14px 0 8px; color: #0284c7; font-weight: 800; }
.result-card p { font-size: 12px; line-height: 1.6; color: #475569; }
.recommendations { display: grid; gap: 7px; margin: 16px 0; }
.recommendations div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.17); font-size: 12px; }
.recommendations span { opacity: .7; }
.recommendations strong { text-align: right; }
.capability-note { opacity: .78; }
.parameter-preview { background: rgba(255,255,255,.1); border-radius: 12px; padding: 12px; margin-top: 16px; }
.parameter-preview span { font-size: 12px; font-weight: 700; }
.parameter-preview p { margin: 6px 0 0; }
.submit-button { width: 100%; min-height: 49px; border: 0; border-radius: 25px; background: #0c5045; color: #fff; font-weight: 700; font-size: 15px; }
.recommendations div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1f5f9; font-size: 12px; }
.recommendations span { color: #64748b; }
.recommendations strong { color: #0f172a; text-align: right; }
.capability-note { color: #64748b; }
.parameter-preview { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; margin-top: 16px; }
.parameter-preview span { font-size: 12px; font-weight: 700; color: #0f172a; }
.parameter-preview p { margin: 6px 0 0; color: #64748b; }
.submit-button { width: 100%; min-height: 48px; border: 0; border-radius: 14px; background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%); color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 4px 14px rgba(2, 132, 199, 0.28); }
.submit-button:disabled { opacity: .55; }
.tcm-disclaimer { color: #8a9890; font-size: 11px; line-height: 1.6; text-align: center; margin: 14px 12px 0; }
.tcm-disclaimer { color: #94a3b8; font-size: 11px; line-height: 1.6; text-align: center; margin: 14px 12px 0; }
</style>