/* ========== B端仪表盘风格 CSS变量 ========== */
:root {
	/* 色彩系统 */
	--bpt-bg: #F5F6F8;
	--bpt-card-bg: #FFFFFF;
	--bpt-card-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
	--bpt-text: #1F2937;
	--bpt-text-secondary: #6B7280;
	--bpt-text-muted: #9CA3AF;
	--bpt-border: #E5E7EB;
	--bpt-divider: #F0F1F3;
	--bpt-input-bg: #FFFFFF;
	--bpt-input-border: #E5E7EB;
	--bpt-hover-bg: #F9FAFB;
	
	/* 强调色 */
	--bpt-accent: #FF6B35;
	--bpt-accent-light: #FFF1EA;
	--bpt-blue: #3B82F6;
	--bpt-green: #22C55E;
	--bpt-yellow: #F59E0B;
	--bpt-red: #EF4444;
	--bpt-purple: #8B5CF6;
	
	/* 按钮 */
	--bpt-btn-bg: #FF6B35;
	--bpt-btn-hover: #E85A25;
	--bpt-btn-secondary-bg: #F3F4F6;
	--bpt-btn-secondary-text: #374151;
	--bpt-btn-secondary-border: #E5E7EB;
	
	/* 顶栏 */
	--bpt-header-bg: #FFFFFF;
	--bpt-header-height: 56px;
}

/* ========== 深色主题 ========== */
[data-theme="dark"] {
	--bpt-bg: #111827;
	--bpt-card-bg: #1F2937;
	--bpt-card-shadow: 0 1px 3px rgba(0,0,0,.3);
	--bpt-text: #F9FAFB;
	--bpt-text-secondary: #D1D5DB;
	--bpt-text-muted: #9CA3AF;
	--bpt-border: #374151;
	--bpt-divider: #374151;
	--bpt-input-bg: #374151;
	--bpt-input-border: #4B5563;
	--bpt-hover-bg: #374151;
	--bpt-accent-light: #3D2515;
	--bpt-btn-secondary-bg: #374151;
	--bpt-btn-secondary-text: #F9FAFB;
	--bpt-btn-secondary-border: #4B5563;
	--bpt-header-bg: #1F2937;
}

/* ========== 全局重置 ========== */
html, body {
	margin: 0 !important;
	padding: 0 !important;
	overflow-x: hidden;
	background: var(--bpt-bg) !important;
}

/* 隐藏WordPress默认元素 */
#wpadminbar, .admin-bar,
.site-header, .site-footer, .site-content > .wrap,
#masthead, #colophon, #header, #footer,
.nav-links, .nav-menu, .widget-area, .menu,
.entry-header, .entry-footer, .entry-title, .page-title,
.comments-area, .comment-respond,
.primary-sidebar, .secondary-sidebar,
.breadcrumb, .breadcrumbs,
.site-branding, .site-navigation,
.page-header, .page-footer,
#site-navigation, #secondary {
	display: none !important;
}

body > header:not(.bpt-header),
body > footer:not(.bpt-footer),
body > nav,
body > aside,
.bpt-wrap ~ * {
	display: none !important;
}

.site-content, .hentry, .page-content, article,
.content-area, #content, #primary, #main {
	margin: 0 !important;
	padding: 0 !important;
	max-width: 100% !important;
	width: 100% !important;
	border: 0 !important;
	background: transparent !important;
	float: none !important;
}

/* ========== 页面布局 ========== */
.bpt-wrap {
	min-height: 100vh;
	background: var(--bpt-bg);
	font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--bpt-text);
	line-height: 1.6;
}

/* ========== 顶部导航 ========== */
.bpt-header {
	background: var(--bpt-header-bg);
	border-bottom: 1px solid var(--bpt-border);
	padding: 0 32px;
	height: var(--bpt-header-height);
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 1px 2px rgba(16,24,40,.04);
}

.bpt-header-left {
	display: flex;
	align-items: center;
	gap: 16px;
}

.bpt-header h2 {
	font-size: 16px;
	font-weight: 600;
	margin: 0;
	color: var(--bpt-text);
}

.bpt-header-right {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ========== 标签切换 ========== */
.bpt-tabs {
	display: inline-flex;
	gap: 2px;
	background: var(--bpt-divider);
	border-radius: 999px;
	padding: 3px;
}

.bpt-tab {
	background: transparent;
	border: 0;
	border-radius: 999px;
	padding: 6px 16px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	color: var(--bpt-text-secondary);
	transition: all .15s;
}

.bpt-tab.active {
	background: var(--bpt-accent);
	color: #fff;
	box-shadow: 0 1px 3px rgba(255,107,53,.3);
}

.bpt-tab:hover:not(.active) {
	color: var(--bpt-text);
	background: var(--bpt-hover-bg);
}

/* ========== 主体布局 ========== */
.bpt-main {
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 32px;
	display: grid;
	grid-template-columns: 1fr 360px;
	gap: 24px;
	align-items: start;
}

.bpt-content {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

.bpt-sidebar {
	display: flex;
	flex-direction: column;
	gap: 16px;
	position: sticky;
	top: 80px;
}

/* ========== 卡片 ========== */
.bpt-card {
	background: var(--bpt-card-bg);
	border-radius: 12px;
	padding: 20px 24px;
	box-shadow: var(--bpt-card-shadow);
	border: 1px solid var(--bpt-border);
}

.bpt-card h3 {
	font-size: 15px;
	font-weight: 600;
	color: var(--bpt-text);
	margin: 0 0 16px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.bpt-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.bpt-card-head h3 {
	margin: 0;
}

/* ========== KPI统计卡片 ========== */
.bpt-kpi-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 24px;
}

.bpt-kpi {
	background: var(--bpt-card-bg);
	border-radius: 12px;
	padding: 20px;
	box-shadow: var(--bpt-card-shadow);
	border: 1px solid var(--bpt-border);
}

.bpt-kpi-label {
	font-size: 12px;
	color: var(--bpt-text-muted);
	margin-bottom: 4px;
}

.bpt-kpi-value {
	font-size: 28px;
	font-weight: 700;
	color: var(--bpt-text);
	line-height: 1.2;
}

.bpt-kpi-unit {
	font-size: 14px;
	font-weight: 400;
	color: var(--bpt-text-secondary);
	margin-left: 4px;
}

.bpt-kpi-change {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	font-weight: 500;
	margin-top: 8px;
	padding: 2px 8px;
	border-radius: 999px;
}

.bpt-kpi-change.up {
	background: #FEF2F2;
	color: #DC2626;
}

.bpt-kpi-change.down {
	background: #F0FDF4;
	color: #16A34A;
}

.bpt-kpi-change.normal {
	background: var(--bpt-accent-light);
	color: var(--bpt-accent);
}

/* ========== 图表区域 ========== */
.bpt-card-chart {
	padding: 20px 24px;
}

.bpt-chart-wrap {
	position: relative;
	height: 280px;
}

.bpt-note {
	color: var(--bpt-text-muted);
	font-size: 12px;
	margin-top: 12px;
}

/* ========== 时间范围按钮 ========== */
.bpt-range {
	display: inline-flex;
	gap: 2px;
	background: var(--bpt-divider);
	border-radius: 999px;
	padding: 3px;
}

.bpt-range button {
	background: transparent;
	border: 0;
	border-radius: 999px;
	padding: 4px 14px;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	color: var(--bpt-text-secondary);
	transition: all .15s;
}

.bpt-range button.active {
	background: var(--bpt-accent);
	color: #fff;
}

.bpt-range button:hover:not(.active) {
	color: var(--bpt-text);
}

/* ========== 输入区域 ========== */
.bpt-drop {
	border: 2px dashed var(--bpt-border);
	border-radius: 12px;
	padding: 20px 16px;
	text-align: center;
	cursor: pointer;
	color: var(--bpt-text-secondary);
	transition: all .2s;
	background: var(--bpt-hover-bg);
	margin-bottom: 16px;
}

.bpt-drop:hover {
	border-color: var(--bpt-accent);
	color: var(--bpt-accent);
	background: var(--bpt-accent-light);
}

.bpt-drop.drag-over {
	border-color: var(--bpt-accent);
	background: var(--bpt-accent-light);
}

.bpt-drop input[type=file] {
	display: none;
}

.bpt-drop-icon {
	font-size: 32px;
	margin-bottom: 8px;
}

.bpt-drop p {
	margin: 4px 0;
	font-size: 13px;
}

.bpt-drop img {
	max-width: 100%;
	max-height: 160px;
	margin-top: 12px;
	border-radius: 8px;
	display: none;
}

/* ========== 按钮 ========== */
.bpt-btn {
	background: var(--bpt-btn-bg);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 10px 24px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all .15s;
	box-shadow: 0 1px 3px rgba(255,107,53,.2);
}

.bpt-btn:hover {
	background: var(--bpt-btn-hover);
	box-shadow: 0 2px 6px rgba(255,107,53,.3);
}

.bpt-btn:disabled {
	opacity: .5;
	cursor: wait;
	box-shadow: none;
}

.bpt-btn-block {
	width: 100%;
	margin-top: 12px;
}

.bpt-btn-small {
	background: var(--bpt-btn-secondary-bg);
	color: var(--bpt-btn-secondary-text);
	border: 1px solid var(--bpt-btn-secondary-border);
	border-radius: 999px;
	padding: 5px 14px;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	transition: all .15s;
}

.bpt-btn-small:hover {
	border-color: var(--bpt-accent);
	color: var(--bpt-accent);
}

.bpt-btn-icon {
	background: var(--bpt-btn-secondary-bg);
	border: 1px solid var(--bpt-btn-secondary-border);
	border-radius: 8px;
	padding: 6px 10px;
	font-size: 16px;
	cursor: pointer;
	line-height: 1;
}

/* ========== 表单 ========== */
.bpt-form-grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bpt-form-grid label {
	font-size: 13px;
	color: var(--bpt-text-secondary);
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.bpt-unit {
	font-size: 11px;
	color: var(--bpt-text-muted);
}

.bpt-form-grid input {
	width: 100%;
	padding: 10px 14px;
	background: var(--bpt-input-bg);
	border: 1px solid var(--bpt-input-border);
	border-radius: 8px;
	font-size: 14px;
	color: var(--bpt-text);
	transition: border-color .15s;
}

.bpt-form-grid input:focus {
	outline: none;
	border-color: var(--bpt-accent);
	box-shadow: 0 0 0 3px rgba(255,107,53,.1);
}

.bpt-form-grid input::placeholder {
	color: var(--bpt-text-muted);
}

/* ========== 状态提示 ========== */
.bpt-status {
	font-size: 13px;
	margin-top: 8px;
	color: var(--bpt-text-secondary);
}

.bpt-status.ok {
	color: var(--bpt-green);
}

.bpt-status.err {
	color: var(--bpt-red);
}

/* ========== BMI显示 ========== */
.bpt-bmi-display {
	margin-top: 16px;
	padding: 16px;
	background: var(--bpt-hover-bg);
	border-radius: 12px;
	text-align: center;
}

.bpt-bmi-value {
	font-size: 14px;
	color: var(--bpt-text-secondary);
	margin-bottom: 4px;
}

.bpt-bmi-value span {
	font-size: 32px;
	font-weight: 700;
	color: var(--bpt-text);
}

.bpt-bmi-label {
	font-size: 13px;
	font-weight: 600;
	margin-top: 4px;
}

/* ========== AI分析折叠 ========== */
.bpt-card-collapsible {
	padding: 0;
	overflow: hidden;
}

.bpt-card-collapsible .bpt-card-head {
	padding: 18px 24px;
	margin: 0;
	cursor: pointer;
	user-select: none;
}

.bpt-card-collapsible .bpt-card-head:hover {
	background: var(--bpt-hover-bg);
}

.bpt-collapse-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.bpt-collapse-icon {
	font-size: 12px;
	color: var(--bpt-text-muted);
	transition: transform .2s;
}

.bpt-card-collapsible.expanded .bpt-collapse-icon {
	transform: rotate(90deg);
}

.bpt-collapse-body {
	padding: 0 24px 20px;
	display: none;
}

.bpt-card-collapsible.expanded .bpt-collapse-body {
	display: block;
}

.bpt-analysis-box {
	background: var(--bpt-accent-light);
	border-left: 3px solid var(--bpt-accent);
	padding: 16px 20px;
	border-radius: 0 8px 8px 0;
	line-height: 1.8;
	white-space: pre-line;
	font-size: 14px;
	color: var(--bpt-text);
}

/* ========== 历史记录表格 ========== */
.bpt-table {
	width: 100%;
	border-collapse: collapse;
}

.bpt-table th,
.bpt-table td {
	text-align: left;
	padding: 12px 16px;
	border-bottom: 1px solid var(--bpt-divider);
	font-size: 13px;
}

.bpt-table th {
	font-weight: 500;
	color: var(--bpt-text-muted);
	font-size: 12px;
}

.bpt-table td {
	color: var(--bpt-text);
}

.bpt-table tr:hover {
	background: var(--bpt-hover-bg);
}

.bpt-table tr:last-child td {
	border-bottom: 0;
}

/* ========== 状态标签（徽章风格） ========== */
.bpt-level-tag,
.bmi-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 500;
}

.bpt-level-normal,
.bmi-normal { background: #F0FDF4; color: #16A34A; }
.bpt-level-elevated,
.bmi-overweight { background: #FFFBEB; color: #D97706; }
.bpt-level-high1 { background: #FFF7ED; color: #EA580C; }
.bpt-level-high2,
.bmi-obese { background: #FEF2F2; color: #DC2626; }
.bmi-na { background: #F3F4F6; color: #9CA3AF; }
.bmi-underweight { background: #EFF6FF; color: #2563EB; }

/* ========== 照片相册 ========== */
.bpt-gallery {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}

.bpt-gallery-item {
	border-radius: 12px;
	overflow: hidden;
	background: var(--bpt-hover-bg);
	border: 1px solid var(--bpt-border);
}

.bpt-gallery-item a {
	display: block;
	aspect-ratio: 4/3;
	overflow: hidden;
}

.bpt-gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .2s;
}

.bpt-gallery-item:hover img {
	transform: scale(1.05);
}

.bpt-gallery-info {
	padding: 8px 12px;
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: var(--bpt-text-secondary);
}

/* ========== 删除按钮 ========== */
.bpt-btn-delete {
	background: transparent;
	border: 1px solid transparent;
	border-radius: 6px;
	padding: 4px 8px;
	font-size: 12px;
	color: var(--bpt-text-muted);
	cursor: pointer;
	transition: all .15s;
}

.bpt-btn-delete:hover {
	background: #FEF2F2;
	border-color: #FECACA;
	color: var(--bpt-red);
}

/* ========== 免责声明 ========== */
.bpt-disclaimer {
	max-width: 1200px;
	margin: 0 auto;
	padding: 16px 32px;
	font-size: 12px;
	color: var(--bpt-text-muted);
	text-align: center;
}

/* ========== 登录页面 ========== */
.bpt-lock {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
	background: var(--bpt-bg);
}

.bpt-lock .bpt-card {
	max-width: 380px;
	width: 100%;
	text-align: center;
	padding: 32px;
}

.bpt-lock h3 {
	justify-content: center;
	font-size: 18px;
	margin-bottom: 24px;
}

/* ========== 移动端响应式 ========== */
@media (max-width: 1024px) {
	.bpt-main {
		grid-template-columns: 1fr;
		padding: 16px;
	}
	
	.bpt-sidebar {
		position: static;
	}
	
	.bpt-header {
		padding: 0 16px;
	}
	
	.bpt-kpi-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.bpt-header {
		padding: 0 12px;
		height: auto;
		flex-wrap: wrap;
		padding-top: 10px;
		padding-bottom: 10px;
	}
	
	.bpt-header-left {
		flex-wrap: wrap;
	}
	
	.bpt-header h2 {
		font-size: 15px;
	}
	
	.bpt-tabs {
		margin-left: 0;
	}
	
	.bpt-tab {
		padding: 5px 12px;
		font-size: 12px;
	}
	
	#bpt-print-btn {
		display: none !important;
	}
	
	.bpt-chart-wrap {
		height: 220px;
	}
	
	.bpt-card {
		padding: 16px;
	}
	
	.bpt-table th,
	.bpt-table td {
		padding: 10px 12px;
		font-size: 12px;
	}
	
	.bpt-kpi-value {
		font-size: 24px;
	}
}

@media (max-width: 480px) {
	.bpt-kpi-grid {
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}
	
	.bpt-kpi {
		padding: 14px;
	}
	
	.bpt-kpi-value {
		font-size: 20px;
	}
	
	.bpt-chart-wrap {
		height: 200px;
	}
	
	.bpt-gallery {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ========== 打印样式 ========== */
@media print {
	* {
		-webkit-print-color-adjust: exact !important;
		print-color-adjust: exact !important;
	}
	
	body { background: #fff !important; }
	.bpt-wrap { background: #fff !important; }
	
	.bpt-header {
		position: static;
		border-bottom: 2px solid var(--bpt-text);
		padding: 10px 0;
		margin-bottom: 20px;
	}
	
	.bpt-header-right { display: none; }
	.bpt-main { display: block; padding: 0; }
	.bpt-sidebar { display: none; }
	
	.bpt-card {
		box-shadow: none;
		border: 1px solid #ddd;
		page-break-inside: avoid;
		margin-bottom: 16px;
	}
	
	.bpt-chart-wrap { height: 300px; }
	
	.bpt-card-collapsible { padding: 16px; }
	.bpt-card-collapsible .bpt-card-head { padding: 0; cursor: default; }
	.bpt-collapse-actions button { display: none; }
	.bpt-collapse-body { display: block !important; padding: 0; }
	
	.bpt-disclaimer { margin-top: 20px; text-align: left; padding: 0; }
}
