* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", Arial, sans-serif; font-size: 14px; color: #333; background: #f0f2f5; }
a { text-decoration: none; color: #1890ff; }
a:hover { color: #40a9ff; }

/* 登录注册页 */
.auth-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.auth-box { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); width: 400px; }
.auth-box h2 { text-align: center; margin-bottom: 24px; color: #333; }
.auth-box .form-group { margin-bottom: 16px; }
.auth-box label { display: block; margin-bottom: 6px; color: #666; font-weight: 500; }
.auth-box input, .auth-box select { width: 100%; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; }
.auth-box input:focus, .auth-box select:focus { outline: none; border-color: #1890ff; }
.auth-box .btn { width: 100%; padding: 12px; background: #1890ff; color: #fff; border: none; border-radius: 4px; font-size: 16px; cursor: pointer; margin-top: 8px; }
.auth-box .btn:hover { background: #40a9ff; }
.auth-box .links { text-align: center; margin-top: 16px; }
.auth-box .links a { margin: 0 8px; }

/* 主布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #001529; color: #fff; position: fixed; top: 0; left: 0; bottom: 0; display: flex; flex-direction: column; transition: width 0.3s; z-index: 100; }
.sidebar.collapsed { width: 60px; }
.sidebar .logo { padding: 16px; text-align: center; font-size: 16px; font-weight: bold; border-bottom: 1px solid #1f3a5a; white-space: nowrap; overflow: hidden; }
.sidebar.collapsed .logo { font-size: 12px; padding: 16px 4px; }
.sidebar .menu { padding: 8px 0; flex: 1; overflow-y: auto; }
.sidebar .menu-group { margin-bottom: 4px; }
.sidebar .menu-group-title { padding: 10px 16px; color: #8c9eb5; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.sidebar .menu-group-title:hover { color: #fff; }
.sidebar .menu-group-title .arrow { transition: transform 0.3s; }
.sidebar .menu-group.collapsed .arrow { transform: rotate(-90deg); }
.sidebar .menu-group.collapsed .menu-items { display: none; }
.sidebar .menu-items { list-style: none; }
.sidebar .menu-items li a { display: block; padding: 10px 16px 10px 32px; color: #c9d6e3; font-size: 14px; white-space: nowrap; overflow: hidden; }
.sidebar .menu-items li a:hover, .sidebar .menu-items li a.active { background: #1890ff; color: #fff; }
.sidebar.collapsed .menu-group-title span, .sidebar.collapsed .menu-items li a { display: none; }

.main { flex: 1; margin-left: 220px; transition: margin-left 0.3s; display: flex; flex-direction: column; min-height: 100vh; }
.main.collapsed { margin-left: 60px; }
.header { height: 56px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.08); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 50; }
.header .toggle-btn { cursor: pointer; font-size: 18px; color: #666; margin-right: 16px; }
.header .breadcrumb { color: #666; }
.header .user-info { display: flex; align-items: center; gap: 12px; }
.header .user-info .dept-name { color: #333; font-weight: 500; }
.header .user-info a { color: #1890ff; }

.content { padding: 3px 20px; flex: 1; }
.card { background: #fff; border-radius: 6px; padding: 5px 12px; margin-bottom: 0; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; }

/* 表单 */
.form-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.form-group { flex: 1; min-width: 180px; }
.form-group label { display: block; margin-bottom: 6px; color: #666; font-size: 13px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; color: #000; background: #fff; }
.form-group select option { color: #000; background: #fff; }
select option { color: #000 !important; background: #fff; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #1890ff; }

/* 按钮 */
.btn { padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; display: inline-block; }
.btn-primary { background: #1890ff; color: #fff; }
.btn-primary:hover { background: #40a9ff; }
.btn-success { background: #52c41a; color: #fff; }
.btn-success:hover { background: #73d13d; }
.btn-warning { background: #faad14; color: #fff; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-danger:hover { background: #ff7875; }
.btn-default { background: #fff; color: #333; border: 1px solid #d9d9d9; }
.btn-default:hover { border-color: #1890ff; color: #1890ff; }
.btn-sm { padding: 4px 10px; font-size: 15px; }
.btn-block { width: 100%; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.table th { background: #fafafa; font-weight: 600; color: #666; white-space: nowrap; }
.table tr:hover { background: #f5f9ff; }
.table .text-right { text-align: right; }
.table .text-center { text-align: center; }
.table .amount { color: #f5222d; font-weight: 500; }
.table .warning { color: #ff4d4f; font-weight: 600; }

/* 状态标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-danger { background: #fff1f0; color: #ff4d4f; border: 1px solid #ffa39e; }
.tag-default { background: #fafafa; color: #999; border: 1px solid #d9d9d9; }

/* 提示消息 */
.flash { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.flash-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.flash-error { background: #fff1f0; color: #ff4d4f; border: 1px solid #ffa39e; }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 6px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.stat-card .label { color: #999; font-size: 13px; margin-bottom: 8px; }
.stat-card .value { font-size: 24px; font-weight: 600; color: #333; }
.stat-card .value.income { color: #52c41a; }
.stat-card .value.expense { color: #ff4d4f; }
.stat-card .value.profit { color: #1890ff; }

/* 弹窗 */
.modal-mask { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 8px; width: 500px; max-height: 80vh; overflow-y: auto; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 16px; }
.modal-header .close { cursor: pointer; font-size: 20px; color: #999; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #f0f0f0; text-align: right; }

/* 工资生成页 */
.wage-generate .step { margin-bottom: 24px; }
.wage-generate .step-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: #1890ff; }
.wage-generate .order-list { max-height: 200px; overflow-y: auto; border: 1px solid #f0f0f0; border-radius: 4px; }
.wage-generate .order-item { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.wage-generate .order-item:hover, .wage-generate .order-item.selected { background: #e6f7ff; }
.wage-generate .style-list { max-height: 300px; overflow-y: auto; }

/* 打印样式 */
@media print {
    .sidebar, .header, .no-print { display: none !important; }
    .main { margin-left: 0 !important; }
    .content { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    body { background: #fff; }
}
