* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	background: #f7f7f7;
}
.container {
	position: relative;
	padding: 20px;
}
#flashContainer {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 55px;
}
/* ===== 顶部导航栏 ===== */
.app-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 20px;
	border-bottom: 1px solid #f0f0f0;
	margin-bottom: 20px;
}
.header-left .logo {
	font-size: 20px;
	font-weight: 600;
	color: #1a1a1a;
}
.header-right {
	display: flex;
	align-items: center;
	gap: 16px;
}
.header-user {
	display: flex;
	align-items: center;
	gap: 12px;
}
.header-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	background: #e0e0e0;
}
.header-logout {
	padding: 4px 14px;
	background: transparent;
	color: #ff4d4f;
	border: 1px solid #ffcdcd;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	transition: background 0.2s;
}
.header-logout:hover {
	background: #fff5f5;
}
.hidden {
	display: none !important;
}
/* ===== 登录界面 ===== */
#loginPanel {
	max-width: 480px;
	margin: 0 auto;
	padding: 20px 0;
}
#loginPanel h2 {
	margin-bottom: 8px;
}
#loginPanel .text-muted {
	margin-bottom: 20px;
}
/* ===== 主界面布局 ===== */
#dashboardPanel {
	position: relative;
	display: flex;
	gap: 24px;
	align-items: flex-start;
	overflow: auto;
}
/* 侧边栏 */
.sidebar {
	position: sticky;
	top: 0;
	width: 220px;
	flex-shrink: 0;
	background: #ffffff;
	border-radius: 12px;
	padding: 20px 0;
	display: flex;
	flex-direction: column;
	height: fit-content;
	min-height: 400px;
	border: 1px solid #f0f0f0;
}
.sidebar-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 16px 0px 16px;
	border-bottom: 1px solid #f0f0f0;
}
.sidebar-nav {
	flex: 1;
	padding: 12px 0;
}
.nav-item {
	padding: 10px 24px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 18px;
	color: #333;
	transition:
		background 0.15s,
		color 0.15s;
	border-left: 3px solid transparent;
}
.nav-item:hover {
	background: #f5f5f5;
}
.nav-item.active {
	background: #e8f5e9;
	color: #07c160;
	border-left-color: #07c160;
	font-weight: 500;
}
.sidebar-footer {
	border-top: 1px solid #f0f0f0;
}

/* 右侧主内容 */
.main-content {
	background: #ffffff;
	border-radius: 12px;
	margin: 0 auto;
	padding: 20px;
	width: 1000px;
	min-height: 400px;
	border: 1px solid #f0f0f0;
	height: 600px;
	overflow: auto;
}
.tab-content {
	display: block;
}
.tab-content.hidden {
	display: none;
}
.card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0px 12px 12px;
}
.tab-content h2 {
	font-size: 22px;
	color: #1a1a1a;
}
.info-card {
	background: #fafafa;
	border-radius: 12px;
	padding: 16px 20px;
}
.info-row {
	display: flex;
	padding-bottom: 12px;
	border-bottom: 1px solid #f0f0f0;
	font-size: 18px;
}
.info-row:last-child {
	border-bottom: none;
}
.info-label {
	width: 100px;
	flex-shrink: 0;
	font-weight: 500;
	color: #555;
}
.info-value {
	flex: 1;
	color: #1a1a1a;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}
.profile-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	background: #e0e0e0;
}
/* ===== 通用按钮 ===== */
.btn-small {
	padding: 4px 16px;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s;
	background: #07c160;
	color: #fff;
}
.btn-small:hover {
	background: #06ad56;
}
.btn-small.btn-danger {
	background: #ff4d4f;
}
.btn-small.btn-danger:hover {
	background: #e04345;
}
/* ===== 应用卡片 ===== */
.app-card {
	background: #ffffff;
	border-radius: 12px;
	padding: 16px 20px;
	margin-bottom: 16px;
	border: 1px solid #f0f0f0;
	transition: box-shadow 0.2s;
}
.app-card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.app-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}
.app-card-name {
	font-size: 18px;
	font-weight: 600;
	color: #1a1a1a;
}
.app-card-body {
	margin-bottom: 14px;
}
.app-card-data {
	background: #f7f8fa;
	border-radius: 8px;
	padding: 12px 16px;
	font-family: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
	font-size: 13px;
	line-height: 1.6;
	color: #333;
	overflow: auto;
	max-height: 180px;
	white-space: pre-wrap;
	word-break: break-all;
	border: 1px solid #e8e8e8;
}
.app-card-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}
.app-card-actions .btn-small {
	padding: 6px 18px;
	font-size: 14px;
}
/* ===== 表单样式 ===== */
.form-group {
	margin-bottom: 16px;
}
label {
	display: block;
	font-weight: 500;
	margin-bottom: 4px;
	color: #333;
}
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #d9d9d9;
	border-radius: 8px;
	font-size: 14px;
	background: #ffffff;
	transition:
		border-color 0.2s,
		box-shadow 0.2s;
}
input:focus,
textarea:focus {
	border-color: #07c160;
	outline: none;
	box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}
button,
.btn {
	padding: 10px 24px;
	background: #07c160;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s;
}
button:hover,
.btn:hover {
	background: #06ad56;
}
button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}
.flex-row {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	align-items: center;
}
.card {
	border-radius: 12px;
	margin-top: 16px;
}
.flash {
	padding: 10px 14px;
	border-radius: 8px;
	margin-bottom: 16px;
}
.flash.success {
	background: #d4edda;
	color: #155724;
}
.flash.error {
	background: #f8d7da;
	color: #721c24;
}
.flash.info {
	background: #cce5ff;
	color: #004085;
}
.text-muted {
	color: #999;
	font-size: 14px;
}
.mt-12 {
	margin-top: 12px;
}
.actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.actions button {
	width: auto;
}
.status-box {
	padding: 12px;
	border-radius: 8px;
	margin-top: 8px;
	border-left: 4px solid;
}
.status-approved {
	background: #d4edda;
	color: #155724;
	border-left-color: #28a745;
}
.status-pending {
	background: #fff3cd;
	color: #856404;
	border-left-color: #ffc107;
}
.status-error {
	background: #f8d7da;
	color: #721c24;
	border-left-color: #dc3545;
}
.status-info {
	background: #cce5ff;
	color: #004085;
	border-left-color: #0d6efd;
}
/* ===== 模态框 ===== */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.25s ease,
		visibility 0.25s ease;
}
.modal-overlay.active {
	opacity: 1;
	visibility: visible;
}
.modal-box {
	background: #ffffff;
	border-radius: 16px;
	padding: 30px 24px 24px;
	max-width: 480px;
	width: 90%;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
	transform: scale(0.95);
	transition: transform 0.25s ease;
}
.modal-overlay.active .modal-box {
	transform: scale(1);
}
.modal-box h3 {
	margin-bottom: 16px;
	font-size: 20px;
	color: #1a1a1a;
}
.modal-box p {
	margin-bottom: 16px;
	color: #555;
	line-height: 1.5;
}
.modal-box .form-group {
	margin-bottom: 16px;
}
.modal-box .form-group label {
	display: block;
	font-weight: 500;
	margin-bottom: 4px;
	color: #333;
}
.modal-box .form-group input,
.modal-box .form-group textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #d9d9d9;
	border-radius: 8px;
	font-size: 14px;
	box-sizing: border-box;
	background: #ffffff;
}
.modal-box .form-group textarea {
	resize: vertical;
	min-height: 80px;
}
.modal-actions {
	display: flex;
	gap: 12px;
	margin-top: 20px;
	justify-content: flex-end;
}
.modal-actions .btn-primary {
	background: #07c160;
	color: #fff;
}
.modal-actions .btn-primary:hover {
	background: #06ad56;
}
.modal-actions .btn-secondary {
	background: #f0f0f0;
	color: #333;
}
.modal-actions .btn-secondary:hover {
	background: #e0e0e0;
}
.modal-actions .btn-danger {
	background: #ff4d4f;
	color: #fff;
}
.modal-actions .btn-danger:hover {
	background: #e04345;
}
.avatar-preview {
	display: flex;
	justify-content: center;
	margin-bottom: 16px;
}
.avatar-preview img {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #f0f0f0;
}

/* ===== 布局 ===== */
.main-content {
	height: auto;
	min-height: 500px;
	width: 100%;
}

/* ===== 设备标签 ===== */
.device-tag {
	padding: 4px 14px;
	border-radius: 20px;
	font-size: 0.9rem;
	background: #e2e8f0;
	color: #475569;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.device-tag.online {
	background: #bbf7d0;
	color: #166534;
}
.device-tag.offline {
	background: #e2e8f0;
	color: #64748b;
}

/* ===== 后端警告 ===== */
#backendAlert {
	display: none;
	background: #f8d7da;
	color: #721c24;
	padding: 12px 20px;
	border-radius: 8px;
	margin-bottom: 16px;
	border: 1px solid #f5c6cb;
}

/* ===== 登录状态 ===== */
#loginStatus {
	margin-top: 12px;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 14px;
	min-height: 24px;
}
#loginStatus.loading {
	color: #0066cc;
}
#loginStatus.success {
	color: #28a745;
}
#loginStatus.error {
	color: #dc3545;
}

/* ===== 应用卡片 ===== */
.app-card {
	background: #ffffff;
	border-radius: 12px;
	padding: 16px 20px;
	margin-bottom: 16px;
	border: 1px solid #f0f0f0;
	transition: box-shadow 0.2s;
}
.app-card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.app-card .app-meta {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	align-items: center;
	margin-bottom: 4px;
}
.app-card .app-meta .tag {
	font-size: 12px;
	padding: 2px 10px;
	border-radius: 12px;
	background: #f0f0f0;
	color: #555;
}
.app-card .app-meta .tag.platform {
	background: #e3f2fd;
	color: #0d47a1;
}
.app-card .app-meta .tag.authorized {
	background: #c8e6c9;
	color: #2e7d32;
}
.app-card .app-meta .tag.unauthorized {
	background: #ffcdd2;
	color: #c62828;
}
.app-card .app-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 10px;
	flex-wrap: wrap;
}
.app-card .app-actions .btn-small {
	padding: 6px 18px;
	font-size: 14px;
	border: none;
	border-radius: 6px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s;
}
.app-card .app-actions .btn-launch {
	background: #2563eb;
	color: white;
}
.app-card .app-actions .btn-launch:hover {
	background: #1d4ed8;
}
.app-card .app-actions .btn-authorize {
	background: #facc15;
	color: #1e293b;
}
.app-card .app-actions .btn-authorize:hover {
	background: #eab308;
}
.app-card .app-actions .btn-small:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ===== 模态框（通用） ===== */
.modal-box {
	max-width: 520px;
	width: 92%;
	padding: 28px 28px 24px;
}
.modal-box .form-group {
	margin-bottom: 14px;
}
.modal-box .form-group label {
	display: block;
	font-weight: 500;
	margin-bottom: 4px;
	color: #333;
	font-size: 14px;
}
.modal-box .form-group input[type="text"],
.modal-box .form-group textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #d9d9d9;
	border-radius: 8px;
	font-size: 14px;
	box-sizing: border-box;
	background: #ffffff;
	font-family: inherit;
}
.modal-box .modal-actions {
	display: flex;
	gap: 12px;
	margin-top: 20px;
	justify-content: flex-end;
}
.modal-box .modal-actions button {
	padding: 10px 24px;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s;
}
.modal-box .modal-actions .btn-secondary {
	background: #f0f0f0;
	color: #333;
}
.modal-box .modal-actions .btn-secondary:hover {
	background: #e0e0e0;
}
.modal-box .modal-actions .btn-primary {
	background: #07c160;
	color: #fff;
}
.modal-box .modal-actions .btn-primary:hover {
	background: #06ad56;
}
.modal-box .modal-actions .btn-danger {
	background: #ff4d4f;
	color: #fff;
}
.modal-box .modal-actions .btn-danger:hover {
	background: #e04345;
}
.modal-box .modal-subtitle {
	font-size: 14px;
	color: #888;
	margin-bottom: 18px;
	line-height: 1.5;
}

/* ===== 复选框组 ===== */
.checkbox-group {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-top: 4px;
	flex-wrap: wrap;
}
.checkbox-group input[type="checkbox"] {
	width: 18px;
	height: 18px;
	cursor: pointer;
	flex-shrink: 0;
	accent-color: #07c160;
}
.checkbox-group label {
	margin: 0;
	cursor: pointer;
	font-weight: 400;
	color: #333;
}
.checkbox-group .hint {
	font-size: 13px;
	color: #888;
	margin-left: 4px;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
	.modal-box {
		padding: 20px 16px;
		width: 95%;
	}
	.app-card .app-meta {
		flex-direction: column;
		align-items: flex-start;
	}
	.app-card .app-actions {
		justify-content: stretch;
	}
	.app-card .app-actions .btn-small {
		flex: 1;
		text-align: center;
	}
}
/* ===== 响应式 ===== */
@media (max-width: 768px) {
	#dashboardPanel {
		flex-direction: column;
	}
	.sidebar {
		width: 100%;
		flex-direction: row;
		flex-wrap: wrap;
		padding: 12px 16px;
		min-height: auto;
	}
	.sidebar-header {
		width: 100%;
		padding-bottom: 12px;
	}
	.sidebar-nav {
		display: flex;
		flex-wrap: wrap;
		gap: 4px;
		padding: 8px 0;
		width: 100%;
	}
	.nav-item {
		flex: 1 0 auto;
		padding: 8px 12px;
		font-size: 13px;
		border-left: none;
		border-bottom: 3px solid transparent;
		justify-content: center;
	}
	.nav-item.active {
		border-left: none;
		border-bottom-color: #07c160;
	}
	.sidebar-footer {
		width: 100%;
		border-top: none;
		padding: 8px 0 0;
	}
	.logout-btn {
		width: 100%;
	}
	.main-content {
		padding: 16px;
	}
	.info-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}
	.info-label {
		width: 100%;
	}
	.app-item {
		flex-direction: column;
		align-items: stretch;
	}
}
