* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, textarea, select { outline: none; font-family: inherit; }

/* Login Page */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-box { background: #fff; border-radius: 12px; padding: 40px; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo h1 { font-size: 24px; color: #333; margin-bottom: 8px; }
.login-logo p { color: #999; font-size: 14px; }
.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; margin-bottom: 8px; color: #666; font-size: 14px; }
.login-form input { width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; transition: border-color 0.3s; }
.login-form input:focus { border-color: #667eea; }
.login-btn { width: 100%; padding: 12px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border-radius: 8px; font-size: 16px; font-weight: 500; transition: opacity 0.3s; }
.login-btn:hover { opacity: 0.9; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #001529; color: #fff; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-logo { padding: 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo h2 { font-size: 18px; color: #fff; }
.sidebar-logo p { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 4px; }
.sidebar-menu { padding: 12px 0; }
.menu-item { display: flex; align-items: center; padding: 12px 24px; color: rgba(255,255,255,0.7); cursor: pointer; transition: all 0.3s; font-size: 14px; }
.menu-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.menu-item.active { color: #fff; background: #667eea; }
.menu-item .icon { width: 20px; margin-right: 12px; text-align: center; font-size: 16px; }

.main { flex: 1; margin-left: 220px; }
.header { height: 60px; 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-left { font-size: 18px; font-weight: 500; }
.header-right { display: flex; align-items: center; gap: 16px; }
.user-info { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 500; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: 50px; background: #fff; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); min-width: 160px; display: none; z-index: 200; }
.dropdown-menu.show { display: block; }
.dropdown-item { padding: 10px 16px; cursor: pointer; font-size: 14px; color: #333; }
.dropdown-item:hover { background: #f5f5f5; }

.content { padding: 24px; }

/* Cards */
.card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 20px; }
.card-title { font-size: 16px; font-weight: 500; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.stat-card .label { color: #999; font-size: 13px; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 600; color: #333; }
.stat-card .icon { float: right; font-size: 32px; opacity: 0.3; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #f0f0f0; }
th { background: #fafafa; font-weight: 500; color: #666; font-size: 13px; }
tr:hover { background: #fafafa; }

/* Buttons */
.btn { padding: 8px 16px; border-radius: 6px; font-size: 14px; transition: all 0.3s; display: inline-block; }
.btn-primary { background: #667eea; color: #fff; }
.btn-primary:hover { background: #5568d3; }
.btn-success { background: #52c41a; color: #fff; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-default { background: #fff; color: #666; border: 1px solid #ddd; }
.btn-default:hover { border-color: #667eea; color: #667eea; }
.btn-sm { padding: 4px 12px; font-size: 12px; }

/* Tags */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-warning { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.tag-danger { background: #fff1f0; color: #ff4d4f; border: 1px solid #ffa39e; }
.tag-info { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.tag-default { background: #fafafa; color: #999; border: 1px solid #d9d9d9; }

/* Forms */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; color: #666; font-size: 13px; }
.form-row input, .form-row textarea, .form-row select { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: #667eea; }
.form-row textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Modal */
.modal-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1000; }
.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-close { cursor: pointer; color: #999; font-size: 20px; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #f0f0f0; text-align: right; }
.modal-footer .btn { margin-left: 8px; }

/* Attendance */
.attendance-card { text-align: center; padding: 40px; }
.attendance-time { font-size: 48px; font-weight: 300; color: #333; margin-bottom: 8px; }
.attendance-date { color: #999; margin-bottom: 30px; }
.attendance-btns { display: flex; gap: 20px; justify-content: center; }
.attendance-btn { width: 140px; height: 140px; border-radius: 50%; font-size: 18px; font-weight: 500; color: #fff; transition: transform 0.2s; }
.attendance-btn:hover { transform: scale(1.05); }
.attendance-btn.in { background: linear-gradient(135deg, #52c41a, #73d13d); }
.attendance-btn.out { background: linear-gradient(135deg, #faad14, #ffc53d); }
.attendance-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.attendance-status { margin-top: 20px; }

/* Calendar */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #f0f0f0; border-radius: 8px; overflow: hidden; }
.calendar-header { background: #fafafa; padding: 10px; text-align: center; font-weight: 500; color: #666; }
.calendar-day { background: #fff; min-height: 100px; padding: 8px; cursor: pointer; position: relative; }
.calendar-day:hover { background: #f5f5f5; }
.calendar-day.other-month { opacity: 0.3; }
.calendar-day.today { background: #e6f7ff; }
.calendar-day .day-num { font-size: 14px; font-weight: 500; }
.calendar-event { background: #667eea; color: #fff; padding: 2px 6px; border-radius: 3px; font-size: 11px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Notice detail */
.notice-detail h2 { font-size: 20px; margin-bottom: 12px; }
.notice-meta { color: #999; font-size: 13px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; }
.notice-content { line-height: 1.8; color: #555; }

/* Empty */
.empty { text-align: center; padding: 40px; color: #999; }

/* Toast */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); padding: 12px 24px; border-radius: 6px; color: #fff; z-index: 2000; font-size: 14px; animation: slideDown 0.3s; }
.toast.success { background: #52c41a; }
.toast.error { background: #ff4d4f; }
.toast.info { background: #1890ff; }
@keyframes slideDown { from { opacity: 0; transform: translate(-50%, -20px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-logo h2, .sidebar-logo p, .menu-item span { display: none; }
    .main { margin-left: 60px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
}
