/* 基础变量与重置 */
:root {
	--bg: #f5f7fb;
	--card: #ffffff;
	--text: #1f2937;
	--muted: #6b7280;
	--border: #e5e7eb;
	--primary: #1677ff;
	--primary-600: #1e90ff;
	--primary-700: #1362d6;
	--success: #22c55e;
	--warn: #f59e0b;
	--danger: #ef4444;
	--sidebar-bg: #0b3768;
	--sidebar-hover: #0e4280;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
	color: var(--text);
	background: var(--bg);
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
input, select, button { font: inherit; }

/* 顶部条 */
.topbar {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px;
	height: 56px;
	background: #ffffff;
	border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
	background: linear-gradient(90deg, var(--primary), var(--primary-600));
	color: #fff; padding: 6px 10px; border-radius: 6px; font-weight: 700;
}
.sidebar-toggle { border: none; background: transparent; font-size: 20px; }

.main-nav { display: flex; gap: 8px; align-items: center; }
.nav-link {
	color: #334155; padding: 6px 10px; border-radius: 6px;
}
.nav-link.active, .nav-link:hover { background: #eff6ff; color: var(--primary); }
.nav-more { position: relative; }
.more-btn { background: transparent; border: none; color: #334155; }
.more-menu {
	position: absolute; left: 0; top: 36px; min-width: 140px; background: #fff; border: 1px solid var(--border);
	border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.08); display: none; flex-direction: column; overflow: hidden;
}
.more-menu a { padding: 10px 12px; color: #334155; }
.more-menu a:hover { background: #f3f4f6; }
.nav-more.open .more-menu { display: flex; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn { position: relative; background: transparent; border: none; font-size: 18px; }
.badge { position: absolute; top: -6px; right: -8px; background: var(--danger); color: #fff; font-size: 12px; border-radius: 999px; padding: 0 6px; }
.company-select { border: 1px solid var(--border); padding: 6px 8px; border-radius: 6px; background: #fff; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
.search input { border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; }

/* 布局 */
.layout { display: grid; grid-template-columns: 240px 1fr; height: calc(100vh - 56px); }
.sidebar { background: var(--sidebar-bg); color: #c7d2fe; overflow: auto; }
.sidebar-inner { padding: 12px 8px 28px; }
.section-title {
	width: 100%; text-align: left; padding: 10px 12px; color: #e5ecff; background: transparent; border: none; border-radius: 8px;
	display: flex; align-items: center; justify-content: space-between; cursor: pointer;
}
.section-title:hover { background: var(--sidebar-hover); }
.expand-icon {
	transition: transform 0.2s ease; font-size: 12px;
}
.section-title.expanded .expand-icon {
	transform: rotate(90deg);
}

.menu { 
	list-style: none; margin: 0; padding: 0; 
	max-height: 0; overflow: hidden; 
	transition: max-height 0.3s ease, padding 0.3s ease;
}
.menu.expanded { 
	max-height: 1000px; padding: 4px 0 8px; 
}
.menu-link { 
	display: block; padding: 8px 16px; border-radius: 6px; color: #c7d2fe; 
	font-size: 13px; transition: all 0.2s ease;
}
.menu-link:hover { background: #0c427e; }
.menu-link.active { background: #0f5db8; color: #fff; }

.content { overflow: auto; padding: 16px 20px; }
.breadcrumbs { color: var(--muted); margin-bottom: 12px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.04); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-title { margin: 0; font-size: 18px; }
.card-actions { display: flex; gap: 8px; }
.card-footer { padding: 12px 16px; border-top: 1px solid var(--border); }

.filters { padding: 12px 16px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; background: #fcfdff; }
.filter-row { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; }
.filter-row label { display: grid; gap: 6px; color: #334155; font-size: 14px; }
.filters input[type="text"], .filters input[type="search"], .filters input[type="date"], .filters select {
	width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: #fff;
}
.filter-actions { display: flex; align-items: end; gap: 8px; }

.btn { border: 1px solid var(--border); background: #fff; padding: 8px 12px; border-radius: 8px; }
.btn:hover { background: #f3f4f6; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-700); }
.btn.ghost { background: transparent; }

.table-wrapper { overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table thead th { text-align: left; font-weight: 600; color: #334155; background: #f8fafc; border-bottom: 1px solid var(--border); padding: 12px; }
.table tbody td { border-bottom: 1px solid var(--border); padding: 12px; color: #374151; }
.table tbody tr:hover { background: #f9fbff; }
.table .actions { display: flex; gap: 10px; }
.link { color: var(--primary); }
.link.danger { color: var(--danger); }

.pagination { display: flex; gap: 6px; align-items: center; }
.page-btn { border: 1px solid var(--border); background: #fff; padding: 6px 10px; border-radius: 6px; }
.page-btn.active { background: #eff6ff; color: var(--primary); border-color: #bfdbfe; }
.pagination-info { margin-left: 12px; color: var(--muted); font-size: 14px; }

/* 状态和徽章样式 */
.badge { 
	display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500;
}
.badge.primary { background: #dbeafe; color: #1d4ed8; }
.badge.success { background: #dcfce7; color: #16a34a; }
.badge.info { background: #e0f2fe; color: #0284c7; }
.badge.warning { background: #fef3c7; color: #d97706; }

.status {
	display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500;
}
.status.active { background: #dcfce7; color: #16a34a; }
.status.inactive { background: #fee2e2; color: #dc2626; }
.status.pending { background: #fef3c7; color: #d97706; }

/* 模态框样式 */
.modal-overlay {
	position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5);
	display: flex; align-items: center; justify-content: center; z-index: 1000;
	opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.modal-overlay.show { opacity: 1; visibility: visible; }

.modal {
	background: #fff; border-radius: 12px; width: 90%; max-width: 800px; max-height: 90vh;
	overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
	transform: scale(0.9) translateY(20px); transition: transform 0.3s ease;
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }

.modal-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-title { margin: 0; font-size: 18px; font-weight: 600; }
.modal-close { 
	background: none; border: none; font-size: 24px; cursor: pointer; 
	color: #6b7280; padding: 0; width: 32px; height: 32px; border-radius: 6px;
	display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: #f3f4f6; }

.modal-body { 
	padding: 24px; max-height: calc(90vh - 140px); overflow-y: auto; 
}

.modal-footer {
	padding: 16px 24px; border-top: 1px solid var(--border);
	display: flex; gap: 12px; justify-content: flex-end;
}

/* 表单分组样式 */
.form-section {
	margin-bottom: 24px;
}
.form-section:last-child { margin-bottom: 0; }

.form-section-title {
	font-size: 16px; font-weight: 600; color: var(--text);
	margin-bottom: 16px; padding-left: 12px; position: relative;
}
.form-section-title::before {
	content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
	width: 4px; height: 16px; background: var(--primary); border-radius: 2px;
}

.form-grid {
	display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.form-grid.single { grid-template-columns: 1fr; }

.form-field {
	display: flex; flex-direction: column; gap: 6px;
}
.form-field.full-width { grid-column: 1 / -1; }

.form-label {
	font-size: 14px; color: var(--text); font-weight: 500;
}
.form-label .required { color: var(--danger); }

.form-input, .form-select, .form-textarea {
	border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
	font-size: 14px; transition: border-color 0.2s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
	outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,119,255,0.1);
}

.form-textarea {
	resize: vertical; min-height: 80px; font-family: inherit;
}

.char-count {
	text-align: right; font-size: 12px; color: var(--muted);
}

/* 文件上传样式 */
.upload-area {
	border: 2px dashed var(--border); border-radius: 8px; padding: 24px;
	text-align: center; cursor: pointer; transition: all 0.2s ease;
}
.upload-area:hover { border-color: var(--primary); background: #f8faff; }
.upload-area.dragover { border-color: var(--primary); background: #eff6ff; }

.upload-btn {
	background: var(--primary); color: #fff; border: none; border-radius: 6px;
	padding: 8px 16px; font-size: 14px; cursor: pointer; margin-bottom: 8px;
}
.upload-btn:hover { background: var(--primary-700); }

.upload-text {
	color: var(--muted); font-size: 14px; line-height: 1.5;
}

.file-list {
	margin-top: 12px;
}
.file-item {
	display: flex; align-items: center; justify-content: space-between;
	padding: 8px 12px; background: #f8fafc; border-radius: 6px; margin-bottom: 8px;
}
.file-name { font-size: 14px; color: var(--text); }
.file-remove {
	color: var(--danger); cursor: pointer; font-size: 16px;
}

/* 欢迎页面样式 */
.welcome-container {
	max-width: 1200px; margin: 0 auto; padding: 40px 20px;
}

.welcome-header {
	text-align: center; margin-bottom: 48px;
}

.welcome-title {
	font-size: 32px; font-weight: 700; color: var(--text); margin: 0 0 12px 0;
	background: linear-gradient(135deg, var(--primary), var(--primary-600));
	-webkit-background-clip: text; -webkit-text-fill-color: transparent;
	background-clip: text;
}

.welcome-subtitle {
	font-size: 18px; color: var(--muted); margin: 0;
}

.welcome-content h2 {
	font-size: 24px; color: var(--text); margin: 0 0 16px 0;
}

.welcome-content p {
	font-size: 16px; color: var(--muted); margin: 0 0 32px 0;
}

.module-grid {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
	gap: 24px; margin-top: 32px;
}

.module-card {
	background: var(--card); border: 1px solid var(--border); border-radius: 12px;
	padding: 24px; transition: all 0.3s ease; position: relative;
	box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.module-card:hover {
	transform: translateY(-4px); box-shadow: 0 8px 32px rgba(0,0,0,0.12);
	border-color: var(--primary);
}

.module-icon {
	font-size: 32px; margin-bottom: 16px; display: block;
}

.module-card h3 {
	font-size: 18px; font-weight: 600; color: var(--text); margin: 0 0 8px 0;
}

.module-card p {
	font-size: 14px; color: var(--muted); margin: 0 0 16px 0; line-height: 1.5;
}

.module-link {
	color: var(--primary); text-decoration: none; font-weight: 500; font-size: 14px;
	display: inline-flex; align-items: center; transition: color 0.2s ease;
}

.module-link:hover {
	color: var(--primary-700);
}

/* 响应式 */
@media (max-width: 1200px) {
	.filter-row { grid-template-columns: repeat(3, minmax(0,1fr)); }
	.module-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

@media (max-width: 768px) {
	.welcome-container { padding: 24px 16px; }
	.welcome-title { font-size: 24px; }
	.welcome-subtitle { font-size: 16px; }
	.module-grid { grid-template-columns: 1fr; gap: 16px; }
	.module-card { padding: 20px; }
}
@media (max-width: 768px) {
	.modal { width: 95%; margin: 20px; }
	.form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
	.layout { grid-template-columns: 0 1fr; }
	.sidebar { position: fixed; left: 0; top: 56px; bottom: 0; width: 240px; transform: translateX(-100%); transition: transform .25s ease; }
	.sidebar.open { transform: translateX(0); }
}


